@qwik.dev/core 2.0.0-beta.38 → 2.0.0-beta.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,166 @@
1
- const Cn = (t, e = 0) => {
1
+ const On = (t, e = 0) => {
2
2
  for (let n = 0; n < t.length; n++) {
3
3
  const r = t.charCodeAt(n);
4
4
  e = (e << 5) - e + r, e |= 0;
5
5
  }
6
6
  return Number(Math.abs(e)).toString(36);
7
- }, Tn = /* @__PURE__ */ new Set([
7
+ };
8
+ const Pn = 13020833333333334e-21, Rn = (t) => {
9
+ const e = t.lastIndexOf("_");
10
+ return e > -1 ? t.slice(e + 1) : t;
11
+ };
12
+ function Ln(t, e) {
13
+ const n = [];
14
+ if (!t.bundles)
15
+ return [];
16
+ const r = { ...t.bundles };
17
+ for (const [c, u] of Object.entries(t.mapping)) {
18
+ if (c.startsWith("_") && c.length < 10)
19
+ continue;
20
+ const o = Rn(c);
21
+ o && (r[o] = { dynamicImports: [u] });
22
+ }
23
+ if (e) {
24
+ const c = { ...t, bundles: r };
25
+ for (const u of e) {
26
+ const o = u(c);
27
+ o && Object.assign(r, o);
28
+ }
29
+ }
30
+ for (const c of Object.keys(r)) {
31
+ const u = r[c], o = u.imports?.filter((b) => r[b]) || [], w = u.dynamicImports?.filter(
32
+ // we only want to include dynamic imports that belong to the app
33
+ // e.g. not all languages supported by shiki
34
+ (b) => r[b] && // either there are qrls
35
+ (r[b].symbols || // or it's a dynamic import from the app source
36
+ r[b].origins?.some((f) => !f.includes("node_modules")))
37
+ ) || [];
38
+ r[c] = {
39
+ ...u,
40
+ imports: o,
41
+ dynamicImports: w
42
+ };
43
+ }
44
+ const i = new Set(Object.keys(r));
45
+ for (const c of Object.keys(r)) {
46
+ for (const u of r[c].imports)
47
+ i.delete(u);
48
+ for (const u of r[c].dynamicImports)
49
+ i.delete(u);
50
+ }
51
+ for (const c of i) {
52
+ const u = r[c];
53
+ !u.imports?.length && !u.dynamicImports?.length && delete r[c];
54
+ }
55
+ const s = Object.keys(r), l = /* @__PURE__ */ new Map(), a = Mn(r);
56
+ for (const c of s) {
57
+ const u = r[c], o = new Set(u.imports);
58
+ a(o, c);
59
+ const w = new Set(u.dynamicImports);
60
+ a(w, c);
61
+ const b = /* @__PURE__ */ new Map();
62
+ for (const v of w) {
63
+ const x = r[v];
64
+ let C = 0.5;
65
+ if (C += (x.interactivity || 0) * 0.08, u.origins && x.origins) {
66
+ for (const T of u.origins)
67
+ if (x.origins.some((W) => W.startsWith(T))) {
68
+ C += 0.25;
69
+ break;
70
+ }
71
+ }
72
+ x.total > Pn && (C += C > 0.5 ? 0.02 : -0.02), x.total < 1e3 && (C += 0.15), b.set(v, Math.min(C, 0.99));
73
+ }
74
+ if (w.size > 0) {
75
+ const v = Array.from(w).sort(
76
+ (C, T) => b.get(T) - b.get(C)
77
+ );
78
+ let x = -1;
79
+ for (const C of v)
80
+ b.get(C) !== x && (x = b.get(C), o.add(-Math.round(x * 10))), o.add(C);
81
+ }
82
+ const f = n.length;
83
+ n.push(c);
84
+ for (let v = 0; v < o.size; v++)
85
+ n.push(null);
86
+ l.set(c, { index: f, deps: o });
87
+ }
88
+ for (const c of s) {
89
+ const u = l.get(c);
90
+ let { index: o, deps: w } = u;
91
+ o++;
92
+ for (const b of w) {
93
+ if (typeof b == "number") {
94
+ n[o++] = b;
95
+ continue;
96
+ }
97
+ const v = l.get(b).index;
98
+ n[o++] = v;
99
+ }
100
+ }
101
+ return n;
102
+ }
103
+ function Mn(t) {
104
+ const { componentOf: e, successors: n } = rn(t), r = new Array(n.length), i = (s) => {
105
+ const l = r[s];
106
+ if (l)
107
+ return l;
108
+ const a = /* @__PURE__ */ new Set();
109
+ r[s] = a;
110
+ for (const c of n[s]) {
111
+ a.add(c);
112
+ for (const u of i(c))
113
+ a.add(u);
114
+ }
115
+ return a;
116
+ };
117
+ return (s, l) => {
118
+ const a = e.get(l), c = /* @__PURE__ */ new Set();
119
+ for (const u of s) {
120
+ const o = e.get(u);
121
+ o !== a && c.add(o);
122
+ }
123
+ for (const u of [...s]) {
124
+ const o = e.get(u);
125
+ if (o !== a) {
126
+ for (const w of c)
127
+ if (w !== o && i(w).has(o)) {
128
+ s.delete(u);
129
+ break;
130
+ }
131
+ }
132
+ }
133
+ };
134
+ }
135
+ function rn(t) {
136
+ const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [], l = [];
137
+ let a = 0;
138
+ const c = (o) => {
139
+ n.set(o, a), r.set(o, a), a++, s.push(o), i.add(o);
140
+ for (const w of t[o].imports || [])
141
+ t[w] && (n.has(w) ? i.has(w) && r.set(o, Math.min(r.get(o), n.get(w))) : (c(w), r.set(o, Math.min(r.get(o), r.get(w)))));
142
+ if (r.get(o) === n.get(o)) {
143
+ const w = [];
144
+ let b;
145
+ do
146
+ b = s.pop(), i.delete(b), e.set(b, l.length), w.push(b);
147
+ while (b !== o);
148
+ l.push(w);
149
+ }
150
+ };
151
+ for (const o of Object.keys(t))
152
+ n.has(o) || c(o);
153
+ const u = Array.from({ length: l.length }, () => /* @__PURE__ */ new Set());
154
+ for (const o of Object.keys(t)) {
155
+ const w = e.get(o);
156
+ for (const b of t[o].imports || []) {
157
+ const f = e.get(b);
158
+ f !== void 0 && f !== w && u[w].add(f);
159
+ }
160
+ }
161
+ return { componentOf: e, components: l, successors: u };
162
+ }
163
+ const jn = /* @__PURE__ */ new Set([
8
164
  "_chk",
9
165
  "_rsc",
10
166
  "_res",
@@ -25,7 +181,7 @@ const Cn = (t, e = 0) => {
25
181
  "_reC",
26
182
  "_reT"
27
183
  ]);
28
- function Pn(t) {
184
+ function qn(t) {
29
185
  const e = t.symbols;
30
186
  return Object.keys(e).sort((n, r) => {
31
187
  const i = e[n], s = e[r];
@@ -34,7 +190,7 @@ function Pn(t) {
34
190
  if (i.ctxKind !== "eventHandler" && s.ctxKind === "eventHandler")
35
191
  return 1;
36
192
  if (i.ctxKind === "eventHandler" && s.ctxKind === "eventHandler") {
37
- const l = bt.indexOf(i.ctxName.toLowerCase()), a = bt.indexOf(s.ctxName.toLowerCase());
193
+ const l = St.indexOf(i.ctxName.toLowerCase()), a = St.indexOf(s.ctxName.toLowerCase());
38
194
  if (l > -1 && a > -1) {
39
195
  if (l < a)
40
196
  return -1;
@@ -47,7 +203,7 @@ function Pn(t) {
47
203
  return 1;
48
204
  }
49
205
  } else if (i.ctxKind === "function" && s.ctxKind === "function") {
50
- const l = xt.indexOf(i.ctxName.toLowerCase()), a = xt.indexOf(s.ctxName.toLowerCase());
206
+ const l = Et.indexOf(i.ctxName.toLowerCase()), a = Et.indexOf(s.ctxName.toLowerCase());
51
207
  if (l > -1 && a > -1) {
52
208
  if (l < a)
53
209
  return -1;
@@ -63,7 +219,7 @@ function Pn(t) {
63
219
  return !i.parent && s.parent ? -1 : i.parent && !s.parent ? 1 : i.hash < s.hash ? -1 : i.hash > s.hash ? 1 : 0;
64
220
  });
65
221
  }
66
- const bt = [
222
+ const St = [
67
223
  // Click Events
68
224
  "click",
69
225
  "dblclick",
@@ -119,36 +275,36 @@ const bt = [
119
275
  "reset",
120
276
  // Scroll Events
121
277
  "scroll"
122
- ].map((t) => `on${t.toLowerCase()}$`), xt = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
278
+ ].map((t) => `on${t.toLowerCase()}$`), Et = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
123
279
  (t) => t.toLowerCase()
124
280
  );
125
- function Nn(t) {
126
- return Object.keys(t.bundles).sort(Ye);
281
+ function zn(t) {
282
+ return Object.keys(t.bundles).sort(ze);
127
283
  }
128
- function Dn(t) {
129
- const e = Pn(t), n = {}, r = {};
284
+ function Fn(t) {
285
+ const e = qn(t), n = {}, r = {};
130
286
  for (const l of e)
131
287
  n[l] = t.symbols[l], r[l] = t.mapping[l];
132
- const i = Nn(t), s = {};
288
+ const i = zn(t), s = {};
133
289
  for (const l of i) {
134
290
  s[l] = t.bundles[l];
135
291
  const a = t.bundles[l];
136
- Array.isArray(a.imports) && a.imports.sort(Ye), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(Ye);
292
+ Array.isArray(a.imports) && a.imports.sort(ze), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(ze);
137
293
  const c = [];
138
- for (const h of e)
139
- l === r[h] && c.push(h);
140
- c.length > 0 && (c.sort(Ye), a.symbols = c);
294
+ for (const u of e)
295
+ l === r[u] && c.push(u);
296
+ c.length > 0 && (c.sort(ze), a.symbols = c);
141
297
  }
142
298
  return t.symbols = n, t.mapping = r, t.bundles = s, t;
143
299
  }
144
- function Ye(t, e) {
300
+ function ze(t, e) {
145
301
  return t = t.toLocaleLowerCase(), e = e.toLocaleLowerCase(), t < e ? -1 : t > e ? 1 : 0;
146
302
  }
147
- function St(t) {
303
+ function Ct(t) {
148
304
  if (t != null && t.mapping != null && typeof t.mapping == "object" && t.symbols != null && typeof t.symbols == "object" && t.bundles != null && typeof t.bundles == "object")
149
305
  return t;
150
306
  }
151
- const Rn = (t, e) => {
307
+ const An = (t, e) => {
152
308
  let n = 0;
153
309
  if (t.symbols)
154
310
  for (const r of t.symbols) {
@@ -158,70 +314,39 @@ const Rn = (t, e) => {
158
314
  }
159
315
  return n;
160
316
  };
161
- function Ln(t) {
162
- let e = 0;
163
- const n = [], r = [], i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
164
- function a(d) {
165
- i.set(d, e), s.set(d, e), e++, n.push(d), l.add(d);
166
- const u = t[d].imports || [];
167
- for (const p of u)
168
- i.has(p) ? l.has(p) && s.set(d, Math.min(s.get(d), i.get(p))) : (a(p), s.set(d, Math.min(s.get(d), s.get(p))));
169
- if (s.get(d) === i.get(d)) {
170
- const p = [];
171
- let x;
172
- do
173
- x = n.pop(), l.delete(x), p.push(x);
174
- while (x !== d);
175
- r.push(p);
176
- }
317
+ function Un(t) {
318
+ const { components: e, successors: n } = rn(t), r = /* @__PURE__ */ new Set(), i = [];
319
+ function s(a) {
320
+ r.add(a);
321
+ for (const c of n[a])
322
+ r.has(c) || s(c);
323
+ i.push(a);
324
+ }
325
+ for (let a = 0; a < e.length; a++)
326
+ r.has(a) || s(a);
327
+ i.reverse();
328
+ const l = new Array(e.length).fill(0);
329
+ for (let a = 0; a < e.length; a++) {
330
+ let c = 0;
331
+ for (const u of e[a])
332
+ c += t[u].size;
333
+ l[a] = c;
177
334
  }
178
- for (const d of Object.keys(t))
179
- i.has(d) || a(d);
180
- const c = /* @__PURE__ */ new Map();
181
- r.forEach((d, u) => {
182
- for (const p of d)
183
- c.set(p, u);
184
- });
185
- const h = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
186
- for (const d of Object.keys(t)) {
187
- const u = c.get(d);
188
- for (const p of t[d].imports || []) {
189
- const x = c.get(p);
190
- u !== x && h[u].add(x);
191
- }
192
- }
193
- const o = /* @__PURE__ */ new Set(), w = [];
194
- function v(d) {
195
- o.add(d);
196
- for (const u of h[d])
197
- o.has(u) || v(u);
198
- w.push(d);
199
- }
200
- for (let d = 0; d < r.length; d++)
201
- o.has(d) || v(d);
202
- w.reverse();
203
- const g = new Array(r.length).fill(0);
204
- for (let d = 0; d < r.length; d++) {
205
- let u = 0;
206
- for (const p of r[d])
207
- u += t[p].size;
208
- g[d] = u;
209
- }
210
- for (let d = w.length - 1; d >= 0; d--) {
211
- const u = w[d];
212
- let p = g[u];
213
- for (const x of h[u])
214
- p += g[x];
215
- g[u] = p;
216
- }
217
- for (let d = 0; d < r.length; d++) {
218
- const u = g[d];
219
- for (const p of r[d])
220
- t[p].total = u;
221
- }
222
- }
223
- const kt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, Et = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, It = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
224
- function On(t, e, n, r, i, s, l) {
335
+ for (let a = i.length - 1; a >= 0; a--) {
336
+ const c = i[a];
337
+ let u = l[c];
338
+ for (const o of n[c])
339
+ u += l[o];
340
+ l[c] = u;
341
+ }
342
+ for (let a = 0; a < e.length; a++) {
343
+ const c = l[a];
344
+ for (const u of e[a])
345
+ t[u].total = c;
346
+ }
347
+ }
348
+ const It = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, _t = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, Tt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
349
+ function Bn(t, e, n, r, i, s, l) {
225
350
  const a = {
226
351
  version: "1",
227
352
  manifestHash: "",
@@ -241,182 +366,83 @@ function On(t, e, n, r, i, s, l) {
241
366
  assets: {},
242
367
  symbols: {},
243
368
  bundleGraph: void 0
244
- }, c = (g) => {
245
- const d = r[g];
246
- if (!d) {
247
- console.warn(`Client manifest generation: skipping external import "${g}"`);
369
+ }, c = (f) => {
370
+ const v = r[f];
371
+ if (!v) {
372
+ console.warn(`Client manifest generation: skipping external import "${f}"`);
248
373
  return;
249
374
  }
250
- return l(d.fileName);
375
+ return l(v.fileName);
251
376
  };
252
- let h, o, w;
253
- for (const g of Object.values(r)) {
254
- const d = c(g.fileName);
255
- g.name === "core" && (h = d), g.name === "preloader" && (o = d), g.name === "handlers" && (w = d);
256
- }
257
- const v = new Set(e.map((g) => g.name));
258
- for (const g of Object.values(r)) {
259
- if (g.type === "asset") {
260
- g.fileName.endsWith("js.map") || (a.assets[g.fileName] = {
261
- name: g.names[0],
262
- size: g.source.length
377
+ let u, o, w;
378
+ for (const f of Object.values(r)) {
379
+ const v = c(f.fileName);
380
+ f.name === "core" && (u = v), f.name === "preloader" && (o = v), f.name === "handlers" && (w = v);
381
+ }
382
+ const b = new Set(e.map((f) => f.name));
383
+ for (const f of Object.values(r)) {
384
+ if (f.type === "asset") {
385
+ f.fileName.endsWith("js.map") || (a.assets[f.fileName] = {
386
+ name: f.names[0],
387
+ size: f.source.length
263
388
  });
264
389
  continue;
265
390
  }
266
- const d = l(g.fileName), p = {
267
- size: g.code.length,
391
+ const v = l(f.fileName), C = {
392
+ size: f.code.length,
268
393
  total: -1
269
394
  };
270
- for (const b of g.exports)
271
- v.has(b) && (!a.mapping[b] || g.exports.length !== 1) && (a.mapping[b] = d);
272
- const x = g.imports.filter((b) => g.code.includes(t.basename(b))).map((b) => c(b)).filter((b) => b !== o && b !== h && b !== w).filter(Boolean);
273
- x.length > 0 && (p.imports = x);
274
- const R = g.dynamicImports.filter((b) => g.code.includes(t.basename(b))).map((b) => c(b)).filter(Boolean);
275
- R.length > 0 && (p.dynamicImports = R), g.facadeModuleId && (kt.test(g.facadeModuleId) ? a.preloader = d : Et.test(g.facadeModuleId) ? a.core = d : It.test(g.facadeModuleId) && (a.qwikLoader = d));
276
- const m = (g.moduleIds || Object.keys(g.modules)).filter((b) => !b.startsWith("\0")).map((b) => t.relative(i.rootDir, b));
277
- m.length > 0 && (p.origins = m, !a.preloader && m.some((b) => kt.test(b)) && (a.preloader = d), !a.core && m.some((b) => Et.test(b)) && (a.core = d), !a.qwikLoader && m.some((b) => It.test(b)) && (a.qwikLoader = d)), a.bundles[d] = p;
278
- }
279
- for (const g of e) {
280
- const d = g.name, u = a.mapping[d];
281
- if (!u) {
282
- s(`Note: qrl ${g.name} is not in the bundle, likely tree shaken`, a);
395
+ for (const g of f.exports)
396
+ b.has(g) && (!a.mapping[g] || f.exports.length !== 1) && (a.mapping[g] = v);
397
+ const T = f.imports.filter((g) => f.code.includes(t.basename(g))).map((g) => c(g)).filter((g) => g !== o && g !== u && g !== w).filter(Boolean);
398
+ T.length > 0 && (C.imports = T);
399
+ const W = f.dynamicImports.filter((g) => f.code.includes(t.basename(g))).map((g) => c(g)).filter(Boolean);
400
+ W.length > 0 && (C.dynamicImports = W), f.facadeModuleId && (It.test(f.facadeModuleId) ? a.preloader = v : _t.test(f.facadeModuleId) ? a.core = v : Tt.test(f.facadeModuleId) && (a.qwikLoader = v));
401
+ const h = (f.moduleIds || Object.keys(f.modules)).filter((g) => !g.startsWith("\0")).map((g) => t.relative(i.rootDir, g));
402
+ h.length > 0 && (C.origins = h, !a.preloader && h.some((g) => It.test(g)) && (a.preloader = v), !a.core && h.some((g) => _t.test(g)) && (a.core = v), !a.qwikLoader && h.some((g) => Tt.test(g)) && (a.qwikLoader = v)), a.bundles[v] = C;
403
+ }
404
+ for (const f of e) {
405
+ const v = f.name, x = a.mapping[v];
406
+ if (!x) {
407
+ s(`Note: qrl ${f.name} is not in the bundle, likely tree shaken`, a);
283
408
  continue;
284
409
  }
285
- (a.bundles[u].symbols ||= []).push(d), a.symbols[d] = {
286
- displayName: g.displayName,
287
- hash: g.hash,
288
- ctxKind: g.ctxKind,
289
- ctxName: g.ctxName,
290
- captures: g.captures,
291
- canonicalFilename: g.canonicalFilename,
292
- parent: g.parent,
293
- origin: g.origin,
294
- loc: g.loc,
295
- paramNames: g.paramNames,
296
- captureNames: g.captureNames
410
+ (a.bundles[x].symbols ||= []).push(v), a.symbols[v] = {
411
+ displayName: f.displayName,
412
+ hash: f.hash,
413
+ ctxKind: f.ctxKind,
414
+ ctxName: f.ctxName,
415
+ captures: f.captures,
416
+ canonicalFilename: f.canonicalFilename,
417
+ parent: f.parent,
418
+ origin: f.origin,
419
+ loc: f.loc,
420
+ paramNames: f.paramNames,
421
+ captureNames: f.captureNames
297
422
  };
298
423
  }
299
424
  if (w)
300
- for (const g of Tn)
301
- a.symbols[g] = {
425
+ for (const f of jn)
426
+ a.symbols[f] = {
302
427
  origin: "Qwik core",
303
- displayName: g,
428
+ displayName: f,
304
429
  canonicalFilename: "",
305
- hash: g,
430
+ hash: f,
306
431
  ctxKind: "function",
307
- ctxName: g,
432
+ ctxName: f,
308
433
  captures: !1,
309
434
  parent: null,
310
435
  loc: [0, 0]
311
- }, a.mapping[g] = w;
436
+ }, a.mapping[f] = w;
312
437
  else
313
438
  console.error("Qwik core bundle not found, is Qwik actually used in this project?");
314
- for (const g of Object.values(a.bundles)) {
315
- const d = Rn(g, a);
316
- g.interactivity = d;
317
- }
318
- return Ln(a.bundles), Dn(a);
319
- }
320
- const Mn = 300, $n = 0.5 / (Mn * 1024 / 8), jn = (t) => {
321
- const e = t.lastIndexOf("_");
322
- return e > -1 ? t.slice(e + 1) : t;
323
- };
324
- function qn(t, e) {
325
- const n = [];
326
- if (!t.bundles)
327
- return [];
328
- const r = { ...t.bundles };
329
- for (const [c, h] of Object.entries(t.mapping)) {
330
- if (c.startsWith("_") && c.length < 10)
331
- continue;
332
- const o = jn(c);
333
- o && (r[o] = { dynamicImports: [h] });
334
- }
335
- if (e) {
336
- const c = { ...t, bundles: r };
337
- for (const h of e) {
338
- const o = h(c);
339
- o && Object.assign(r, o);
340
- }
341
- }
342
- for (const c of Object.keys(r)) {
343
- const h = r[c], o = h.imports?.filter((v) => r[v]) || [], w = h.dynamicImports?.filter(
344
- // we only want to include dynamic imports that belong to the app
345
- // e.g. not all languages supported by shiki
346
- (v) => r[v] && // either there are qrls
347
- (r[v].symbols || // or it's a dynamic import from the app source
348
- r[v].origins?.some((g) => !g.includes("node_modules")))
349
- ) || [];
350
- r[c] = {
351
- ...h,
352
- imports: o,
353
- dynamicImports: w
354
- };
355
- }
356
- const i = new Set(Object.keys(r));
357
- for (const c of Object.keys(r)) {
358
- for (const h of r[c].imports)
359
- i.delete(h);
360
- for (const h of r[c].dynamicImports)
361
- i.delete(h);
439
+ for (const f of Object.values(a.bundles)) {
440
+ const v = An(f, a);
441
+ f.interactivity = v;
362
442
  }
363
- for (const c of i) {
364
- const h = r[c];
365
- !h.imports?.length && !h.dynamicImports?.length && delete r[c];
366
- }
367
- const s = Object.keys(r), l = /* @__PURE__ */ new Map(), a = (c, h, o = /* @__PURE__ */ new Set()) => {
368
- const w = r[h];
369
- for (const v of w.imports)
370
- c.has(v) && c.delete(v), o.has(v) || (o.add(v), a(c, v, o));
371
- };
372
- for (const c of s) {
373
- const h = r[c], o = new Set(h.imports);
374
- for (const d of o)
375
- a(o, d);
376
- const w = new Set(h.dynamicImports), v = /* @__PURE__ */ new Map();
377
- for (const d of w) {
378
- a(w, d);
379
- const u = r[d];
380
- let p = 0.5;
381
- if (p += (u.interactivity || 0) * 0.08, h.origins && u.origins) {
382
- for (const x of h.origins)
383
- if (u.origins.some((R) => R.startsWith(x))) {
384
- p += 0.25;
385
- break;
386
- }
387
- }
388
- u.total > $n && (p += p > 0.5 ? 0.02 : -0.02), u.total < 1e3 && (p += 0.15), v.set(d, Math.min(p, 0.99));
389
- }
390
- if (w.size > 0) {
391
- const d = Array.from(w).sort(
392
- (p, x) => v.get(x) - v.get(p)
393
- );
394
- let u = -1;
395
- for (const p of d)
396
- v.get(p) !== u && (u = v.get(p), o.add(-Math.round(u * 10))), o.add(p);
397
- }
398
- const g = n.length;
399
- n.push(c);
400
- for (let d = 0; d < o.size; d++)
401
- n.push(null);
402
- l.set(c, { index: g, deps: o });
403
- }
404
- for (const c of s) {
405
- const h = l.get(c);
406
- let { index: o, deps: w } = h;
407
- o++;
408
- for (const v of w) {
409
- if (typeof v == "number") {
410
- n[o++] = v;
411
- continue;
412
- }
413
- const d = l.get(v).index;
414
- n[o++] = d;
415
- }
416
- }
417
- return n;
443
+ return Un(a.bundles), Fn(a);
418
444
  }
419
- async function Un(t, e, n) {
445
+ async function Wn(t, e, n) {
420
446
  const r = await t.dynamicImport("eslint");
421
447
  let i = new r.ESLint({ cache: !0 });
422
448
  if ((await i.calculateConfigForFile("no-real-file.tsx")).parser === null) {
@@ -439,19 +465,19 @@ async function Un(t, e, n) {
439
465
  i = new r.ESLint(a);
440
466
  }
441
467
  return {
442
- async lint(a, c, h) {
468
+ async lint(a, c, u) {
443
469
  try {
444
- const o = Bn(h);
470
+ const o = Hn(u);
445
471
  if (await i.isPathIgnored(o))
446
472
  return null;
447
473
  (await i.lintText(c, {
448
474
  filePath: o
449
- })).forEach((v) => {
450
- for (const g of v.messages) {
451
- if (g.ruleId != null && !g.ruleId.startsWith("qwik/"))
475
+ })).forEach((b) => {
476
+ for (const f of b.messages) {
477
+ if (f.ruleId != null && !f.ruleId.startsWith("qwik/"))
452
478
  continue;
453
- const d = Fn(v.filePath, g);
454
- a.warn(d);
479
+ const v = Qn(b.filePath, f);
480
+ a.warn(v);
455
481
  }
456
482
  });
457
483
  } catch (o) {
@@ -460,10 +486,10 @@ async function Un(t, e, n) {
460
486
  }
461
487
  };
462
488
  }
463
- function Bn(t) {
489
+ function Hn(t) {
464
490
  return t.split("?", 2)[0];
465
491
  }
466
- function Fn(t, e) {
492
+ function Qn(t, e) {
467
493
  return Object.assign(new Error(e.message), {
468
494
  id: t,
469
495
  plugin: "vite-plugin-eslint",
@@ -475,19 +501,19 @@ function Fn(t, e) {
475
501
  stack: ""
476
502
  });
477
503
  }
478
- const An = /\.server\.[cm]?[jt]sx?$/, zn = /\.server\.[cm]?[jt]sx?_/, Wn = /(^|\/)server(\/|$)/, _t = (t) => t.includes(".server") || t.includes("/server") || t.includes("\\server") || t.includes("server/") || t.includes("server\\"), Xe = (t) => t.replace(/\\/g, "/").replace(/^\/@fs\//, ""), Hn = (t, e) => {
479
- const n = Xe(t), r = e.rootDir ? Xe(e.rootDir).replace(/\/+$/, "") : "";
504
+ const Gn = /\.server\.[cm]?[jt]sx?$/, Kn = /\.server\.[cm]?[jt]sx?_/, Vn = /(^|\/)server(\/|$)/, $t = (t) => t.includes(".server") || t.includes("/server") || t.includes("\\server") || t.includes("server/") || t.includes("server\\"), Be = (t) => t.replace(/\\/g, "/").replace(/^\/@fs\//, ""), Jn = (t, e) => {
505
+ const n = Be(t), r = e.rootDir ? Be(e.rootDir).replace(/\/+$/, "") : "";
480
506
  return r && (n === r || n.startsWith(r + "/")) ? n : r && n.startsWith("/") && !n.startsWith("//") && !/^[a-zA-Z]:\//.test(n) ? `${r}${n}` : n;
481
- }, Gn = (t) => {
482
- const e = Xe(t);
483
- return An.test(e) || zn.test(e);
484
- }, Qn = (t, e) => {
507
+ }, Yn = (t) => {
508
+ const e = Be(t);
509
+ return Gn.test(e) || Kn.test(e);
510
+ }, Xn = (t, e) => {
485
511
  const n = typeof e == "string" || e == null ? { srcDir: e } : e;
486
512
  if (!n.srcDir)
487
513
  return !1;
488
- const r = Hn(t, n), i = Xe(n.srcDir).replace(/\/+$/, "");
489
- return r.startsWith(i + "/") ? Wn.test(r.slice(i.length + 1)) : !1;
490
- }, Kn = (t, e) => Gn(t) || Qn(t, e), Jn = (t, e) => {
514
+ const r = Jn(t, n), i = Be(n.srcDir).replace(/\/+$/, "");
515
+ return r.startsWith(i + "/") ? Vn.test(r.slice(i.length + 1)) : !1;
516
+ }, Zn = (t, e) => Yn(t) || Xn(t, e), er = (t, e) => {
491
517
  const n = e ? `
492
518
  Importer: ${e}` : "";
493
519
  return `Server-only module cannot be imported by client code.
@@ -495,7 +521,7 @@ Importer: ${e}` : "";
495
521
  Server-only module: ${t}${n}
496
522
 
497
523
  Files named \`.server.*\` or placed under \`src/**/server/**\` are excluded from client bundles. Move this import behind SSR-only route loaders, actions, endpoint handlers, or expose the operation through an intentional \`server$\` API.`;
498
- }, Yn = (t) => {
524
+ }, tr = (t) => {
499
525
  const e = t.stack;
500
526
  if (typeof e == "string") {
501
527
  const n = e.split(`
@@ -505,14 +531,14 @@ Files named \`.server.*\` or placed under \`src/**/server/**\` are excluded from
505
531
  if (/^\s+at/.test(i)) {
506
532
  const s = i.indexOf("/"), l = i.lastIndexOf(")", s);
507
533
  if (s > 0) {
508
- const c = i.slice(s, l).split(":"), h = Ct(c[c.length - 1]), o = Ct(c[c.length - 2]);
509
- return typeof h == "number" && typeof o == "number" ? (c.length -= 2, {
534
+ const c = i.slice(s, l).split(":"), u = Dt(c[c.length - 1]), o = Dt(c[c.length - 2]);
535
+ return typeof u == "number" && typeof o == "number" ? (c.length -= 2, {
510
536
  file: c.join(":"),
511
537
  line: o,
512
- column: h
513
- }) : typeof h == "number" ? (c.length -= 1, {
538
+ column: u
539
+ }) : typeof u == "number" ? (c.length -= 1, {
514
540
  file: c.join(":"),
515
- line: h,
541
+ line: u,
516
542
  column: void 0
517
543
  }) : {
518
544
  file: c.join(":"),
@@ -523,14 +549,14 @@ Files named \`.server.*\` or placed under \`src/**/server/**\` are excluded from
523
549
  }
524
550
  }
525
551
  }
526
- }, ne = (t) => t.startsWith("\0"), Ct = (t) => {
552
+ }, Z = (t) => t.startsWith("\0"), Dt = (t) => {
527
553
  try {
528
554
  return parseInt(t, 10);
529
555
  } catch {
530
556
  return;
531
557
  }
532
- }, on = /\r?\n/, Tt = 2;
533
- function Xn(t, e) {
558
+ }, on = /\r?\n/, Nt = 2;
559
+ function nr(t, e) {
534
560
  if (typeof e == "number")
535
561
  return e;
536
562
  if (e.lo != null)
@@ -541,28 +567,28 @@ function Xn(t, e) {
541
567
  s += n[l].length + 1;
542
568
  return s + i;
543
569
  }
544
- function Zn(t, e = 0, n) {
545
- e = Xn(t, e), n = n || e;
570
+ function rr(t, e = 0, n) {
571
+ e = nr(t, e), n = n || e;
546
572
  const r = t.split(on);
547
573
  let i = 0;
548
574
  const s = [];
549
575
  for (let l = 0; l < r.length; l++)
550
576
  if (i += r[l].length + 1, i >= e) {
551
- for (let a = l - Tt; a <= l + Tt || n > i; a++) {
577
+ for (let a = l - Nt; a <= l + Nt || n > i; a++) {
552
578
  if (a < 0 || a >= r.length)
553
579
  continue;
554
580
  const c = a + 1;
555
581
  s.push(`${c}${" ".repeat(Math.max(3 - String(c).length, 0))}| ${r[a]}`);
556
- const h = r[a].length;
582
+ const u = r[a].length;
557
583
  if (a === l) {
558
- const o = Math.max(e - (i - h) + 1, 0), w = Math.max(1, n > i ? h - o : n - e);
584
+ const o = Math.max(e - (i - u) + 1, 0), w = Math.max(1, n > i ? u - o : n - e);
559
585
  s.push(" | " + " ".repeat(o) + "^".repeat(w));
560
586
  } else if (a > l) {
561
587
  if (n > i) {
562
- const o = Math.max(Math.min(n - i, h), 1);
588
+ const o = Math.max(Math.min(n - i, u), 1);
563
589
  s.push(" | " + "^".repeat(o));
564
590
  }
565
- i += h + 1;
591
+ i += u + 1;
566
592
  }
567
593
  }
568
594
  break;
@@ -570,10 +596,10 @@ function Zn(t, e = 0, n) {
570
596
  return s.join(`
571
597
  `);
572
598
  }
573
- function Vn(t) {
599
+ function ir(t) {
574
600
  return t === "win32";
575
601
  }
576
- function me(t) {
602
+ function pe(t) {
577
603
  const [e, n] = t.split("?"), r = n || "";
578
604
  return {
579
605
  originalId: t,
@@ -582,10 +608,10 @@ function me(t) {
582
608
  params: new URLSearchParams(r)
583
609
  };
584
610
  }
585
- var er = 44, tr = 59, Pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", sn = new Uint8Array(64), nr = new Uint8Array(128);
586
- for (let t = 0; t < Pt.length; t++) {
587
- const e = Pt.charCodeAt(t);
588
- sn[t] = e, nr[e] = t;
611
+ var or = 44, sr = 59, Ot = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", sn = new Uint8Array(64), ar = new Uint8Array(128);
612
+ for (let t = 0; t < Ot.length; t++) {
613
+ const e = Ot.charCodeAt(t);
614
+ sn[t] = e, ar[e] = t;
589
615
  }
590
616
  function ke(t, e, n) {
591
617
  let r = e - n;
@@ -596,7 +622,7 @@ function ke(t, e, n) {
596
622
  } while (r > 0);
597
623
  return e;
598
624
  }
599
- var Nt = 1024 * 16, Dt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
625
+ var Pt = 1024 * 16, Rt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
600
626
  decode(t) {
601
627
  return Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString();
602
628
  }
@@ -607,36 +633,36 @@ var Nt = 1024 * 16, Dt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDeco
607
633
  e += String.fromCharCode(t[n]);
608
634
  return e;
609
635
  }
610
- }, rr = class {
636
+ }, lr = class {
611
637
  constructor() {
612
- this.pos = 0, this.out = "", this.buffer = new Uint8Array(Nt);
638
+ this.pos = 0, this.out = "", this.buffer = new Uint8Array(Pt);
613
639
  }
614
640
  write(t) {
615
641
  const { buffer: e } = this;
616
- e[this.pos++] = t, this.pos === Nt && (this.out += Dt.decode(e), this.pos = 0);
642
+ e[this.pos++] = t, this.pos === Pt && (this.out += Rt.decode(e), this.pos = 0);
617
643
  }
618
644
  flush() {
619
645
  const { buffer: t, out: e, pos: n } = this;
620
- return n > 0 ? e + Dt.decode(t.subarray(0, n)) : e;
646
+ return n > 0 ? e + Rt.decode(t.subarray(0, n)) : e;
621
647
  }
622
648
  };
623
- function ir(t) {
624
- const e = new rr();
649
+ function cr(t) {
650
+ const e = new lr();
625
651
  let n = 0, r = 0, i = 0, s = 0;
626
652
  for (let l = 0; l < t.length; l++) {
627
653
  const a = t[l];
628
- if (l > 0 && e.write(tr), a.length === 0) continue;
654
+ if (l > 0 && e.write(sr), a.length === 0) continue;
629
655
  let c = 0;
630
- for (let h = 0; h < a.length; h++) {
631
- const o = a[h];
632
- h > 0 && e.write(er), c = ke(e, o[0], c), o.length !== 1 && (n = ke(e, o[1], n), r = ke(e, o[2], r), i = ke(e, o[3], i), o.length !== 4 && (s = ke(e, o[4], s)));
656
+ for (let u = 0; u < a.length; u++) {
657
+ const o = a[u];
658
+ u > 0 && e.write(or), c = ke(e, o[0], c), o.length !== 1 && (n = ke(e, o[1], n), r = ke(e, o[2], r), i = ke(e, o[3], i), o.length !== 4 && (s = ke(e, o[4], s)));
633
659
  }
634
660
  }
635
661
  return e.flush();
636
662
  }
637
- class Ze {
663
+ class We {
638
664
  constructor(e) {
639
- this.bits = e instanceof Ze ? e.bits.slice() : [];
665
+ this.bits = e instanceof We ? e.bits.slice() : [];
640
666
  }
641
667
  add(e) {
642
668
  this.bits[e >> 5] |= 1 << (e & 31);
@@ -645,7 +671,7 @@ class Ze {
645
671
  return !!(this.bits[e >> 5] & 1 << (e & 31));
646
672
  }
647
673
  }
648
- class ze {
674
+ class Ie {
649
675
  constructor(e, n, r) {
650
676
  this.start = e, this.end = n, this.original = r, this.intro = "", this.outro = "", this.content = r, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
651
677
  }
@@ -656,7 +682,7 @@ class ze {
656
682
  this.intro = this.intro + e;
657
683
  }
658
684
  clone() {
659
- const e = new ze(this.start, this.end, this.original);
685
+ const e = new Ie(this.start, this.end, this.original);
660
686
  return e.intro = this.intro, e.outro = this.outro, e.content = this.content, e.storeName = this.storeName, e.edited = this.edited, e;
661
687
  }
662
688
  contains(e) {
@@ -687,7 +713,7 @@ class ze {
687
713
  split(e) {
688
714
  const n = e - this.start, r = this.original.slice(0, n), i = this.original.slice(n);
689
715
  this.original = r;
690
- const s = new ze(e, this.end, i);
716
+ const s = new Ie(e, this.end, i);
691
717
  return s.outro = this.outro, this.outro = "", this.end = e, this.edited ? (s.edit("", !1), this.content = "") : this.content = r, s.next = this.next, s.next && (s.next.previous = s), s.previous = this, this.next = s, s;
692
718
  }
693
719
  toString() {
@@ -712,24 +738,24 @@ class ze {
712
738
  } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
713
739
  }
714
740
  }
715
- function or() {
741
+ function dr() {
716
742
  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") : () => {
717
743
  throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
718
744
  };
719
745
  }
720
- const sr = /* @__PURE__ */ or();
721
- class ar {
746
+ const ur = /* @__PURE__ */ dr();
747
+ class fr {
722
748
  constructor(e) {
723
- this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = ir(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
749
+ this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = cr(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
724
750
  }
725
751
  toString() {
726
752
  return JSON.stringify(this);
727
753
  }
728
754
  toUrl() {
729
- return "data:application/json;charset=utf-8;base64," + sr(this.toString());
755
+ return "data:application/json;charset=utf-8;base64," + ur(this.toString());
730
756
  }
731
757
  }
732
- function lr(t) {
758
+ function hr(t) {
733
759
  const e = t.split(`
734
760
  `), n = e.filter((s) => /^\t+/.test(s)), r = e.filter((s) => /^ {2,}/.test(s));
735
761
  if (n.length === 0 && r.length === 0)
@@ -742,7 +768,7 @@ function lr(t) {
742
768
  }, 1 / 0);
743
769
  return new Array(i + 1).join(" ");
744
770
  }
745
- function cr(t, e) {
771
+ function pr(t, e) {
746
772
  const n = t.split(/[/\\]/), r = e.split(/[/\\]/);
747
773
  for (n.pop(); n[0] === r[0]; )
748
774
  n.shift(), r.shift();
@@ -752,11 +778,11 @@ function cr(t, e) {
752
778
  }
753
779
  return n.concat(r).join("/");
754
780
  }
755
- const dr = Object.prototype.toString;
756
- function ur(t) {
757
- return dr.call(t) === "[object Object]";
781
+ const gr = Object.prototype.toString;
782
+ function mr(t) {
783
+ return gr.call(t) === "[object Object]";
758
784
  }
759
- function Rt(t) {
785
+ function Lt(t) {
760
786
  const e = t.split(`
761
787
  `), n = [];
762
788
  for (let r = 0, i = 0; r < e.length; r++)
@@ -764,15 +790,15 @@ function Rt(t) {
764
790
  return function(i) {
765
791
  let s = 0, l = n.length;
766
792
  for (; s < l; ) {
767
- const h = s + l >> 1;
768
- i < n[h] ? l = h : s = h + 1;
793
+ const u = s + l >> 1;
794
+ i < n[u] ? l = u : s = u + 1;
769
795
  }
770
796
  const a = s - 1, c = i - n[a];
771
797
  return { line: a, column: c };
772
798
  };
773
799
  }
774
- const fr = /\w/;
775
- class hr {
800
+ const wr = /\w/;
801
+ class vr {
776
802
  constructor(e) {
777
803
  this.hires = e, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
778
804
  }
@@ -782,8 +808,8 @@ class hr {
782
808
  let l = n.indexOf(`
783
809
  `, 0), a = -1;
784
810
  for (; l >= 0 && s > l; ) {
785
- const h = [this.generatedCodeColumn, e, r.line, r.column];
786
- i >= 0 && h.push(i), this.rawSegments.push(h), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = l, l = n.indexOf(`
811
+ const u = [this.generatedCodeColumn, e, r.line, r.column];
812
+ i >= 0 && u.push(i), this.rawSegments.push(u), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = l, l = n.indexOf(`
787
813
  `, l + 1);
788
814
  }
789
815
  const c = [this.generatedCodeColumn, e, r.line, r.column];
@@ -799,8 +825,8 @@ class hr {
799
825
  i.line += 1, i.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = !0, c = !1;
800
826
  else {
801
827
  if (this.hires || a || s.has(l)) {
802
- const h = [this.generatedCodeColumn, e, i.line, i.column];
803
- this.hires === "boundary" ? fr.test(r[l]) ? c || (this.rawSegments.push(h), c = !0) : (this.rawSegments.push(h), c = !1) : this.rawSegments.push(h);
828
+ const u = [this.generatedCodeColumn, e, i.line, i.column];
829
+ this.hires === "boundary" ? wr.test(r[l]) ? c || (this.rawSegments.push(u), c = !0) : (this.rawSegments.push(u), c = !1) : this.rawSegments.push(u);
804
830
  }
805
831
  i.column += 1, this.generatedCodeColumn += 1, a = !1;
806
832
  }
@@ -820,15 +846,15 @@ class hr {
820
846
  this.generatedCodeColumn += n[n.length - 1].length;
821
847
  }
822
848
  }
823
- const Ee = `
824
- `, ve = {
849
+ const Se = `
850
+ `, ge = {
825
851
  insertLeft: !1,
826
852
  insertRight: !1,
827
853
  storeName: !1
828
854
  };
829
- class ht {
855
+ class gt {
830
856
  constructor(e, n = {}) {
831
- const r = new ze(0, e.length, e);
857
+ const r = new Ie(0, e.length, e);
832
858
  Object.defineProperties(this, {
833
859
  original: { writable: !0, value: e },
834
860
  outro: { writable: !0, value: "" },
@@ -840,7 +866,7 @@ class ht {
840
866
  byEnd: { writable: !0, value: {} },
841
867
  filename: { writable: !0, value: n.filename },
842
868
  indentExclusionRanges: { writable: !0, value: n.indentExclusionRanges },
843
- sourcemapLocations: { writable: !0, value: new Ze() },
869
+ sourcemapLocations: { writable: !0, value: new We() },
844
870
  storedNames: { writable: !0, value: {} },
845
871
  indentStr: { writable: !0, value: void 0 },
846
872
  ignoreList: { writable: !0, value: n.ignoreList },
@@ -867,18 +893,18 @@ class ht {
867
893
  return r ? r.appendRight(n) : this.outro += n, this;
868
894
  }
869
895
  clone() {
870
- const e = new ht(this.original, { filename: this.filename, offset: this.offset });
896
+ const e = new gt(this.original, { filename: this.filename, offset: this.offset });
871
897
  let n = this.firstChunk, r = e.firstChunk = e.lastSearchedChunk = n.clone();
872
898
  for (; n; ) {
873
899
  e.byStart[r.start] = r, e.byEnd[r.end] = r;
874
900
  const i = n.next, s = i && i.clone();
875
901
  s && (r.next = s, s.previous = r, r = s), n = i;
876
902
  }
877
- return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new Ze(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
903
+ return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new We(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
878
904
  }
879
905
  generateDecodedMap(e) {
880
906
  e = e || {};
881
- const n = 0, r = Object.keys(this.storedNames), i = new hr(e.hires), s = Rt(this.original);
907
+ const n = 0, r = Object.keys(this.storedNames), i = new vr(e.hires), s = Lt(this.original);
882
908
  return this.intro && i.advance(this.intro), this.firstChunk.eachNext((l) => {
883
909
  const a = s(l.start);
884
910
  l.intro.length && i.advance(l.intro), l.edited ? i.addEdit(
@@ -890,7 +916,7 @@ class ht {
890
916
  }), this.outro && i.advance(this.outro), {
891
917
  file: e.file ? e.file.split(/[/\\]/).pop() : void 0,
892
918
  sources: [
893
- e.source ? cr(e.file || "", e.source) : e.file || ""
919
+ e.source ? pr(e.file || "", e.source) : e.file || ""
894
920
  ],
895
921
  sourcesContent: e.includeContent ? [this.original] : void 0,
896
922
  names: r,
@@ -899,10 +925,10 @@ class ht {
899
925
  };
900
926
  }
901
927
  generateMap(e) {
902
- return new ar(this.generateDecodedMap(e));
928
+ return new fr(this.generateDecodedMap(e));
903
929
  }
904
930
  _ensureindentStr() {
905
- this.indentStr === void 0 && (this.indentStr = lr(this.original));
931
+ this.indentStr === void 0 && (this.indentStr = hr(this.original));
906
932
  }
907
933
  _getRawIndentString() {
908
934
  return this._ensureindentStr(), this.indentStr;
@@ -912,7 +938,7 @@ class ht {
912
938
  }
913
939
  indent(e, n) {
914
940
  const r = /^[^\r\n]/gm;
915
- if (ur(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
941
+ if (mr(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
916
942
  n = n || {};
917
943
  const i = {};
918
944
  n.exclude && (typeof n.exclude[0] == "number" ? [n.exclude] : n.exclude).forEach((o) => {
@@ -920,16 +946,16 @@ class ht {
920
946
  i[w] = !0;
921
947
  });
922
948
  let s = n.indentStart !== !1;
923
- const l = (h) => s ? `${e}${h}` : (s = !0, h);
949
+ const l = (u) => s ? `${e}${u}` : (s = !0, u);
924
950
  this.intro = this.intro.replace(r, l);
925
951
  let a = 0, c = this.firstChunk;
926
952
  for (; c; ) {
927
- const h = c.end;
953
+ const u = c.end;
928
954
  if (c.edited)
929
955
  i[a] || (c.content = c.content.replace(r, l), c.content.length && (s = c.content[c.content.length - 1] === `
930
956
  `));
931
957
  else
932
- for (a = c.start; a < h; ) {
958
+ for (a = c.start; a < u; ) {
933
959
  if (!i[a]) {
934
960
  const o = this.original[a];
935
961
  o === `
@@ -947,22 +973,22 @@ class ht {
947
973
  );
948
974
  }
949
975
  insertLeft(e, n) {
950
- return ve.insertLeft || (console.warn(
976
+ return ge.insertLeft || (console.warn(
951
977
  "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
952
- ), ve.insertLeft = !0), this.appendLeft(e, n);
978
+ ), ge.insertLeft = !0), this.appendLeft(e, n);
953
979
  }
954
980
  insertRight(e, n) {
955
- return ve.insertRight || (console.warn(
981
+ return ge.insertRight || (console.warn(
956
982
  "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
957
- ), ve.insertRight = !0), this.prependRight(e, n);
983
+ ), ge.insertRight = !0), this.prependRight(e, n);
958
984
  }
959
985
  move(e, n, r) {
960
986
  if (e = e + this.offset, n = n + this.offset, r = r + this.offset, r >= e && r <= n) throw new Error("Cannot move a selection inside itself");
961
987
  this._split(e), this._split(n), this._split(r);
962
988
  const i = this.byStart[e], s = this.byEnd[n], l = i.previous, a = s.next, c = this.byStart[r];
963
989
  if (!c && s === this.lastChunk) return this;
964
- const h = c ? c.previous : this.lastChunk;
965
- return l && (l.next = a), a && (a.previous = l), h && (h.next = i), c && (c.previous = s), i.previous || (this.firstChunk = s.next), s.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = h, s.next = c || null, h || (this.firstChunk = i), c || (this.lastChunk = s), this;
990
+ const u = c ? c.previous : this.lastChunk;
991
+ return l && (l.next = a), a && (a.previous = l), u && (u.next = i), c && (c.previous = s), i.previous || (this.firstChunk = s.next), s.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = u, s.next = c || null, u || (this.firstChunk = i), c || (this.lastChunk = s), this;
966
992
  }
967
993
  overwrite(e, n, r, i) {
968
994
  return i = i || {}, this.update(e, n, r, { ...i, overwrite: !i.contentOnly });
@@ -978,13 +1004,13 @@ class ht {
978
1004
  throw new Error(
979
1005
  "Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
980
1006
  );
981
- this._split(e), this._split(n), i === !0 && (ve.storeName || (console.warn(
1007
+ this._split(e), this._split(n), i === !0 && (ge.storeName || (console.warn(
982
1008
  "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
983
- ), ve.storeName = !0), i = { storeName: !0 });
1009
+ ), ge.storeName = !0), i = { storeName: !0 });
984
1010
  const s = i !== void 0 ? i.storeName : !1, l = i !== void 0 ? i.overwrite : !1;
985
1011
  if (s) {
986
- const h = this.original.slice(e, n);
987
- Object.defineProperty(this.storedNames, h, {
1012
+ const u = this.original.slice(e, n);
1013
+ Object.defineProperty(this.storedNames, u, {
988
1014
  writable: !0,
989
1015
  value: !0,
990
1016
  enumerable: !0
@@ -992,16 +1018,16 @@ class ht {
992
1018
  }
993
1019
  const a = this.byStart[e], c = this.byEnd[n];
994
1020
  if (a) {
995
- let h = a;
996
- for (; h !== c; ) {
997
- if (h.next !== this.byStart[h.end])
1021
+ let u = a;
1022
+ for (; u !== c; ) {
1023
+ if (u.next !== this.byStart[u.end])
998
1024
  throw new Error("Cannot overwrite across a split point");
999
- h = h.next, h.edit("", !1);
1025
+ u = u.next, u.edit("", !1);
1000
1026
  }
1001
1027
  a.edit(r, s, !l);
1002
1028
  } else {
1003
- const h = new ze(e, n, "").edit(r, s);
1004
- c.next = h, h.previous = c;
1029
+ const u = new Ie(e, n, "").edit(r, s);
1030
+ c.next = u, u.previous = c;
1005
1031
  }
1006
1032
  return this;
1007
1033
  }
@@ -1060,24 +1086,24 @@ class ht {
1060
1086
  return this.intro.length ? this.intro[this.intro.length - 1] : "";
1061
1087
  }
1062
1088
  lastLine() {
1063
- let e = this.outro.lastIndexOf(Ee);
1089
+ let e = this.outro.lastIndexOf(Se);
1064
1090
  if (e !== -1) return this.outro.substr(e + 1);
1065
1091
  let n = this.outro, r = this.lastChunk;
1066
1092
  do {
1067
1093
  if (r.outro.length > 0) {
1068
- if (e = r.outro.lastIndexOf(Ee), e !== -1) return r.outro.substr(e + 1) + n;
1094
+ if (e = r.outro.lastIndexOf(Se), e !== -1) return r.outro.substr(e + 1) + n;
1069
1095
  n = r.outro + n;
1070
1096
  }
1071
1097
  if (r.content.length > 0) {
1072
- if (e = r.content.lastIndexOf(Ee), e !== -1) return r.content.substr(e + 1) + n;
1098
+ if (e = r.content.lastIndexOf(Se), e !== -1) return r.content.substr(e + 1) + n;
1073
1099
  n = r.content + n;
1074
1100
  }
1075
1101
  if (r.intro.length > 0) {
1076
- if (e = r.intro.lastIndexOf(Ee), e !== -1) return r.intro.substr(e + 1) + n;
1102
+ if (e = r.intro.lastIndexOf(Se), e !== -1) return r.intro.substr(e + 1) + n;
1077
1103
  n = r.intro + n;
1078
1104
  }
1079
1105
  } while (r = r.previous);
1080
- return e = this.intro.lastIndexOf(Ee), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
1106
+ return e = this.intro.lastIndexOf(Se), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
1081
1107
  }
1082
1108
  slice(e = 0, n = this.original.length - this.offset) {
1083
1109
  if (e = e + this.offset, n = n + this.offset, this.original.length !== 0) {
@@ -1122,7 +1148,7 @@ class ht {
1122
1148
  }
1123
1149
  _splitChunk(e, n) {
1124
1150
  if (e.edited && e.content.length) {
1125
- const i = Rt(this.original)(n);
1151
+ const i = Lt(this.original)(n);
1126
1152
  throw new Error(
1127
1153
  `Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`
1128
1154
  );
@@ -1241,13 +1267,13 @@ class ht {
1241
1267
  return this._replaceRegexp(e, n);
1242
1268
  }
1243
1269
  }
1244
- const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr = new RegExp(`${gr}([^"'\\\`\\s]+)`, "g"), lt = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), an = (t) => {
1270
+ const br = "__QWIK_WORKER_QRL__", yr = `${br}:`, st = "__QWIK_WORKER_CORE__", xr = new RegExp(`${yr}([^"'\\\`\\s]+)`, "g"), at = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), an = (t) => {
1245
1271
  const e = t.replace(/\/+$/, ""), n = e.lastIndexOf("/");
1246
1272
  return n === -1 ? "." : n === 0 ? "/" : e.slice(0, n);
1247
- }, vr = (t, e) => {
1273
+ }, kr = (t, e) => {
1248
1274
  const n = e.replace(/^\.\//, "");
1249
- return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? lt(t, n) : new URL(n, `https://qwik.dev${lt(t, "build/")}`).pathname;
1250
- }, wr = (t, e) => {
1275
+ return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? at(t, n) : new URL(n, `https://qwik.dev${at(t, "build/")}`).pathname;
1276
+ }, Sr = (t, e) => {
1251
1277
  const n = /* @__PURE__ */ new Map();
1252
1278
  for (const [r, i] of Object.entries(t.symbols)) {
1253
1279
  const s = t.mapping[r];
@@ -1259,35 +1285,35 @@ const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr
1259
1285
  return (r) => n.get(
1260
1286
  r.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, "")
1261
1287
  );
1262
- }, ln = (t, e) => t.replace(mr, (n, r) => e(r) ?? n), yr = (t, e) => wr(
1288
+ }, ln = (t, e) => t.replace(xr, (n, r) => e(r) ?? n), Er = (t, e) => Sr(
1263
1289
  t,
1264
- (n) => vr(e, n)
1265
- ), br = (t) => {
1290
+ (n) => kr(e, n)
1291
+ ), Cr = (t) => {
1266
1292
  const e = t.replace(/\\/g, "/"), n = an(e);
1267
1293
  return (r) => {
1268
- const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a = lt(n, `${l}.js`);
1294
+ const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a = at(n, `${l}.js`);
1269
1295
  return s.startsWith("?") ? `${a}?worker_file&type=module&${s.slice(1)}` : s.startsWith("#") ? `${a}?worker_file&type=module${s}` : `${a}?worker_file&type=module`;
1270
1296
  };
1271
- }, xr = (t) => t.startsWith(".") ? t : `./${t}`, Lt = (t) => {
1297
+ }, Ir = (t) => t.startsWith(".") ? t : `./${t}`, Mt = (t) => {
1272
1298
  const e = [];
1273
1299
  for (const n of t.replace(/\\/g, "/").split("/"))
1274
1300
  !n || n === "." || (n === ".." && e.length > 0 && e[e.length - 1] !== ".." ? e.pop() : e.push(n));
1275
1301
  return e;
1276
- }, Sr = (t, e) => {
1277
- const n = t === "." ? [] : Lt(t), r = Lt(e);
1302
+ }, _r = (t, e) => {
1303
+ const n = t === "." ? [] : Mt(t), r = Mt(e);
1278
1304
  let i = 0;
1279
1305
  for (; i < n.length && i < r.length && n[i] === r[i]; )
1280
1306
  i++;
1281
1307
  return [...n.slice(i).map(() => ".."), ...r.slice(i)].join("/");
1282
1308
  }, cn = (t) => (e) => {
1283
- const n = Sr(an(e), t);
1284
- return xr(n);
1285
- }, Ot = (t, e) => {
1286
- if (!t.includes(at))
1309
+ const n = _r(an(e), t);
1310
+ return Ir(n);
1311
+ }, jt = (t, e) => {
1312
+ if (!t.includes(st))
1287
1313
  return t;
1288
1314
  const n = e();
1289
- return n ? t.replaceAll(at, n) : t;
1290
- }, kr = ["server"], Mt = [
1315
+ return n ? t.replaceAll(st, n) : t;
1316
+ }, Tr = ["server"], qt = [
1291
1317
  "onGet",
1292
1318
  "onPost",
1293
1319
  "onPut",
@@ -1297,7 +1323,7 @@ const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr
1297
1323
  "onOptions",
1298
1324
  "onPatch",
1299
1325
  "onStaticGenerate"
1300
- ], $t = [
1326
+ ], zt = [
1301
1327
  "useServer",
1302
1328
  "route",
1303
1329
  "server",
@@ -1306,7 +1332,7 @@ const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr
1306
1332
  "zod$",
1307
1333
  "validator$",
1308
1334
  "globalAction$"
1309
- ], Er = [
1335
+ ], $r = [
1310
1336
  "useClient",
1311
1337
  "useBrowser",
1312
1338
  "useVisibleTask",
@@ -1317,7 +1343,7 @@ const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr
1317
1343
  var dn = /* @__PURE__ */ ((t) => (t.each = "each", t.show = "show", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t.blockSSR = "blockSSR", t))(dn || {});
1318
1344
  function un(t = {}) {
1319
1345
  const e = `${Math.round(Math.random() * 899) + 100}`, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
1320
- let a = null, c, h = () => {
1346
+ let a = null, c, u = () => {
1321
1347
  };
1322
1348
  const o = {
1323
1349
  csr: !1,
@@ -1348,201 +1374,201 @@ function un(t = {}) {
1348
1374
  lint: !1,
1349
1375
  experimental: void 0
1350
1376
  };
1351
- let w, v;
1352
- const g = async () => {
1377
+ let w, b;
1378
+ const f = async () => {
1353
1379
  if (!a) {
1354
- const y = (t._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
1355
- if (a = await y(t), w = Ir(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
1380
+ const p = (t._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
1381
+ if (a = await p(t), w = Dr(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
1356
1382
  try {
1357
- v === void 0 && (v = await a.sys.dynamicImport("node:fs"));
1383
+ b === void 0 && (b = await a.sys.dynamicImport("node:fs"));
1358
1384
  } catch {
1359
- console.log("node:fs not available, disabling automatic manifest reading"), v = null;
1385
+ console.log("node:fs not available, disabling automatic manifest reading"), b = null;
1360
1386
  }
1361
1387
  }
1362
- }, d = () => {
1388
+ }, v = () => {
1363
1389
  if (!a)
1364
1390
  throw new Error("Qwik plugin has not been initialized");
1365
1391
  return a;
1366
- }, u = () => d().sys, p = () => d().sys.path;
1367
- let x;
1368
- const R = (y) => {
1369
- x = y;
1370
- }, K = async (y) => {
1371
- const f = Object.assign({}, y), k = d(), _ = k.sys.path, E = (...P) => Q(_.resolve(...P));
1372
- o.debug = !!f.debug, f.devTools && (o.devTools = {
1392
+ }, x = () => v().sys, C = () => v().sys.path;
1393
+ let T;
1394
+ const W = (p) => {
1395
+ T = p;
1396
+ }, Te = async (p) => {
1397
+ const d = Object.assign({}, p), y = v(), E = y.sys.path, k = (...$) => H(E.resolve(...$));
1398
+ o.debug = !!d.debug, d.devTools && (o.devTools = {
1373
1399
  ...o.devTools,
1374
- ...f.devTools
1375
- }), f.target === "ssr" || f.target === "client" || f.target === "lib" || f.target === "test" ? o.target = f.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : f.buildMode === "production" || f.buildMode === "development" ? o.buildMode = f.buildMode : o.buildMode ||= "development", o.csr = !!f.csr, f.entryStrategy && typeof f.entryStrategy == "object" && (o.entryStrategy = { ...f.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 f.rootDir == "string" && (o.rootDir = f.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= k.sys.cwd()), o.rootDir = E(k.sys.cwd(), o.rootDir);
1376
- let S = E(o.rootDir, Cr);
1377
- if (typeof f.srcDir == "string" ? (o.srcDir = E(o.rootDir, f.srcDir), S = o.srcDir) : o.srcDir ||= S, o.srcDir = E(o.rootDir, o.srcDir), Array.isArray(f.tsconfigFileNames) && f.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = f.tsconfigFileNames), !o.csr && !f.input && !o.input && (o.target === "ssr" ? o.input = [E(S, "entry.ssr")] : o.target === "client" ? o.input = [E(S, "root")] : o.input = void 0), f.outDir && (o.outDir = E(o.rootDir, f.outDir)), o.clientOutDir = E(o.rootDir, f.clientOutDir || Ut), o.ssrOutDir = E(o.rootDir, f.ssrOutDir || Tr), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= E(o.rootDir, Pr) : o.outDir ||= o.clientOutDir, typeof f.manifestOutput == "function" && (o.manifestOutput = f.manifestOutput), f.manifestInput && (o.manifestInput = St(f.manifestInput) || null), typeof f.transformedModuleOutput == "function" && (o.transformedModuleOutput = f.transformedModuleOutput), f.scope !== void 0)
1378
- o.scope = f.scope;
1379
- else if (!o.scope && v) {
1380
- let P = "";
1400
+ ...d.devTools
1401
+ }), d.target === "ssr" || d.target === "client" || d.target === "lib" || d.target === "test" ? o.target = d.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : d.buildMode === "production" || d.buildMode === "development" ? o.buildMode = d.buildMode : o.buildMode ||= "development", o.csr = !!d.csr, d.entryStrategy && typeof d.entryStrategy == "object" && (o.entryStrategy = { ...d.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 d.rootDir == "string" && (o.rootDir = d.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= y.sys.cwd()), o.rootDir = k(y.sys.cwd(), o.rootDir);
1402
+ let m = k(o.rootDir, Or);
1403
+ if (typeof d.srcDir == "string" ? (o.srcDir = k(o.rootDir, d.srcDir), m = o.srcDir) : o.srcDir ||= m, o.srcDir = k(o.rootDir, o.srcDir), Array.isArray(d.tsconfigFileNames) && d.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = d.tsconfigFileNames), !o.csr && !d.input && !o.input && (o.target === "ssr" ? o.input = [k(m, "entry.ssr")] : o.target === "client" ? o.input = [k(m, "root")] : o.input = void 0), d.outDir && (o.outDir = k(o.rootDir, d.outDir)), o.clientOutDir = k(o.rootDir, d.clientOutDir || Ut), o.ssrOutDir = k(o.rootDir, d.ssrOutDir || Pr), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= k(o.rootDir, Rr) : o.outDir ||= o.clientOutDir, typeof d.manifestOutput == "function" && (o.manifestOutput = d.manifestOutput), d.manifestInput && (o.manifestInput = Ct(d.manifestInput) || null), typeof d.transformedModuleOutput == "function" && (o.transformedModuleOutput = d.transformedModuleOutput), d.scope !== void 0)
1404
+ o.scope = d.scope;
1405
+ else if (!o.scope && b) {
1406
+ let $ = "";
1381
1407
  try {
1382
- let M = o.rootDir;
1383
- for (; P = _.resolve(M, "package.json"), !await v.promises.stat(P).catch(() => !1); ) {
1384
- const N = _.resolve(M, "..");
1385
- if (N === M)
1408
+ let R = o.rootDir;
1409
+ for (; $ = E.resolve(R, "package.json"), !await b.promises.stat($).catch(() => !1); ) {
1410
+ const D = E.resolve(R, "..");
1411
+ if (D === R)
1386
1412
  break;
1387
- M = N, P = "";
1413
+ R = D, $ = "";
1388
1414
  }
1389
- if (P) {
1390
- const N = await v.promises.readFile(P, "utf-8"), D = JSON.parse(N);
1391
- typeof D.name == "string" && (o.scope = D.name);
1415
+ if ($) {
1416
+ const D = await b.promises.readFile($, "utf-8"), N = JSON.parse(D);
1417
+ typeof N.name == "string" && (o.scope = N.name);
1392
1418
  }
1393
- } catch (M) {
1419
+ } catch (R) {
1394
1420
  console.warn(
1395
- `could not read ${P || "package.json"} to determine package name, ignoring. (${M})`
1421
+ `could not read ${$ || "package.json"} to determine package name, ignoring. (${R})`
1396
1422
  );
1397
1423
  }
1398
1424
  }
1399
- if (typeof f.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = f.resolveQwikBuild), typeof f.devTools == "object" && ("imageDevTools" in f.devTools && (o.devTools.imageDevTools = f.devTools.imageDevTools), "clickToSource" in f.devTools && (o.devTools.clickToSource = f.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof f.lint == "boolean" && (o.lint = f.lint), "experimental" in f) {
1425
+ if (typeof d.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = d.resolveQwikBuild), typeof d.devTools == "object" && ("imageDevTools" in d.devTools && (o.devTools.imageDevTools = d.devTools.imageDevTools), "clickToSource" in d.devTools && (o.devTools.clickToSource = d.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof d.lint == "boolean" && (o.lint = d.lint), "experimental" in d) {
1400
1426
  o.experimental = void 0;
1401
- for (const P of f.experimental ?? [])
1402
- dn[P] ? (o.experimental ||= {})[P] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${P}`);
1427
+ for (const $ of d.experimental ?? [])
1428
+ dn[$] ? (o.experimental ||= {})[$] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${$}`);
1403
1429
  }
1404
- const L = { ...o };
1405
- return o.input ||= f.input, o.input && typeof o.input == "string" && (o.input = [o.input]), L;
1430
+ const O = { ...o };
1431
+ return o.input ||= d.input, o.input && typeof o.input == "string" && (o.input = [o.input]), O;
1406
1432
  };
1407
- let m = !1;
1408
- const b = async (y) => {
1409
- if (!m) {
1410
- m = !0;
1411
- const f = u();
1412
- if (f.env === "node") {
1413
- const k = await f.dynamicImport("node:fs");
1414
- if (!k.existsSync(o.rootDir))
1433
+ let h = !1;
1434
+ const g = async (p) => {
1435
+ if (!h) {
1436
+ h = !0;
1437
+ const d = x();
1438
+ if (d.env === "node") {
1439
+ const y = await d.dynamicImport("node:fs");
1440
+ if (!y.existsSync(o.rootDir))
1415
1441
  throw new Error(`Qwik rootDir "${o.rootDir}" not found.`);
1416
- if (typeof o.srcDir == "string" && !k.existsSync(o.srcDir))
1442
+ if (typeof o.srcDir == "string" && !y.existsSync(o.srcDir))
1417
1443
  throw new Error(`Qwik srcDir "${o.srcDir}" not found.`);
1418
- for (const [_, E] of Object.entries(o.input || {}))
1419
- if (!await y(E))
1420
- throw new Error(`Qwik input "${E}" not found.`);
1444
+ for (const [E, k] of Object.entries(o.input || {}))
1445
+ if (!await p(k))
1446
+ throw new Error(`Qwik input "${k}" not found.`);
1421
1447
  }
1422
1448
  }
1423
1449
  };
1424
- let C, $ = !1;
1425
- const I = async (y) => {
1426
- if (O("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), C = d(), $ = !x, C.sys.env === "node" && o.target === "ssr" && o.lint)
1450
+ let I, M = !1;
1451
+ const S = async (p) => {
1452
+ if (P("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), I = v(), M = !T, I.sys.env === "node" && o.target === "ssr" && o.lint)
1427
1453
  try {
1428
- c = await Un(C.sys, o.rootDir, o.tsconfigFileNames);
1454
+ c = await Wn(I.sys, o.rootDir, o.tsconfigFileNames);
1429
1455
  } catch {
1430
1456
  }
1431
- if (O("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !x) {
1432
- const f = await y.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1457
+ if (P("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !T) {
1458
+ const d = await p.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1433
1459
  skipSelf: !0
1434
1460
  });
1435
- f && y.emitFile({
1436
- id: f.id,
1461
+ d && p.emitFile({
1462
+ id: d.id,
1437
1463
  type: "chunk",
1438
1464
  preserveSignature: "allow-extension"
1439
1465
  });
1440
1466
  }
1441
- }, T = (y, f) => y.environment ? y.environment.config.consumer === "server" : x ? !!f?.ssr : o.target === "ssr" || o.target === "test", z = (y) => !y && (o.target === "client" || !!x && o.target === "ssr"), j = (y) => !!x && y && (o.target === "client" || o.target === "ssr"), q = (y, f, k = !1) => {
1442
- if (z(k) && Kn(y, o))
1443
- throw new Error(Jn(y, f));
1444
- }, A = (y) => {
1445
- const f = y.replace(/\\/g, "/");
1446
- return f.includes(".server") || /(^|\/)server(\/|$)/.test(f);
1447
- }, J = (y, f) => {
1448
- const k = /* @__PURE__ */ new Set(), _ = (S) => {
1449
- typeof S?.value == "string" && k.add(S.value);
1450
- }, E = [y.parse(f)];
1451
- for (; E.length > 0; ) {
1452
- const S = E.pop();
1453
- if (!(!S || typeof S != "object" || typeof S.type != "string")) {
1454
- S.type === "ImportDeclaration" && S.importKind !== "type" || (S.type === "ExportNamedDeclaration" || S.type === "ExportAllDeclaration") && S.exportKind !== "type" || S.type === "ImportExpression" ? _(S.source) : S.type === "CallExpression" && S.callee?.type === "Import" && _(S.arguments?.[0]);
1455
- for (const L of Object.keys(S)) {
1456
- if (L === "parent")
1467
+ }, _ = (p, d) => p.environment ? p.environment.config.consumer === "server" : T ? !!d?.ssr : o.target === "ssr" || o.target === "test", U = (p) => !p && (o.target === "client" || !!T && o.target === "ssr"), L = (p) => !!T && p && (o.target === "client" || o.target === "ssr"), j = (p, d, y = !1) => {
1468
+ if (U(y) && Zn(p, o))
1469
+ throw new Error(er(p, d));
1470
+ }, A = (p) => {
1471
+ const d = p.replace(/\\/g, "/");
1472
+ return d.includes(".server") || /(^|\/)server(\/|$)/.test(d);
1473
+ }, Q = (p, d) => {
1474
+ const y = /* @__PURE__ */ new Set(), E = (m) => {
1475
+ typeof m?.value == "string" && y.add(m.value);
1476
+ }, k = [p.parse(d)];
1477
+ for (; k.length > 0; ) {
1478
+ const m = k.pop();
1479
+ if (!(!m || typeof m != "object" || typeof m.type != "string")) {
1480
+ m.type === "ImportDeclaration" && m.importKind !== "type" || (m.type === "ExportNamedDeclaration" || m.type === "ExportAllDeclaration") && m.exportKind !== "type" || m.type === "ImportExpression" ? E(m.source) : m.type === "CallExpression" && m.callee?.type === "Import" && E(m.arguments?.[0]);
1481
+ for (const O of Object.keys(m)) {
1482
+ if (O === "parent")
1457
1483
  continue;
1458
- const P = S[L];
1459
- if (Array.isArray(P))
1460
- for (const M of P)
1461
- E.push(M);
1484
+ const $ = m[O];
1485
+ if (Array.isArray($))
1486
+ for (const R of $)
1487
+ k.push(R);
1462
1488
  else
1463
- E.push(P);
1489
+ k.push($);
1464
1490
  }
1465
1491
  }
1466
1492
  }
1467
- return Array.from(k);
1468
- }, X = async (y, f, k, _ = k) => {
1469
- if (_t(f))
1470
- for (const E of J(y, f)) {
1471
- if (!A(E))
1493
+ return Array.from(y);
1494
+ }, K = async (p, d, y, E = y) => {
1495
+ if ($t(d))
1496
+ for (const k of Q(p, d)) {
1497
+ if (!A(k))
1472
1498
  continue;
1473
- q(E, _);
1474
- const S = await y.resolve(E, k, { skipSelf: !0 });
1475
- S && q(Q(me(S.id).pathId), _);
1499
+ j(k, E);
1500
+ const m = await p.resolve(k, y, { skipSelf: !0 });
1501
+ m && j(H(pe(m.id).pathId), E);
1476
1502
  }
1477
- }, Y = async (y, f, k, _, E = !1) => {
1478
- const S = p();
1479
- for (const L of f.modules) {
1480
- if (E && !jt(L))
1503
+ }, G = async (p, d, y, E, k = !1) => {
1504
+ const m = C();
1505
+ for (const O of d.modules) {
1506
+ if (k && !Ft(O))
1481
1507
  continue;
1482
- const P = Q(S.join(k, L.path));
1483
- await X(y, L.code, P, _ ?? P);
1508
+ const $ = H(m.join(y, O.path));
1509
+ await K(p, O.code, $, E ?? $);
1484
1510
  }
1485
- }, ae = async (y, f, k) => {
1486
- const _ = await y.resolve(f, k, { skipSelf: !0 });
1487
- if (!_ || _.external || ne(_.id))
1511
+ }, ie = async (p, d, y) => {
1512
+ const E = await p.resolve(d, y, { skipSelf: !0 });
1513
+ if (!E || E.external || Z(E.id))
1488
1514
  return;
1489
- const E = me(_.id);
1490
- if (E.query)
1515
+ const k = pe(E.id);
1516
+ if (k.query)
1491
1517
  return;
1492
- const S = Q(E.pathId);
1493
- if (p().extname(S).toLowerCase() in qt || ct.test(S))
1494
- return S;
1495
- }, W = async (y, f, k) => {
1496
- if (f.length === 0)
1518
+ const m = H(k.pathId);
1519
+ if (C().extname(m).toLowerCase() in At || lt.test(m))
1520
+ return m;
1521
+ }, B = async (p, d, y) => {
1522
+ if (d.length === 0)
1497
1523
  return [];
1498
- const _ = [];
1499
- for (const E of f) {
1500
- const S = await ae(y, E, k);
1501
- S && _.push(S);
1524
+ const E = [];
1525
+ for (const k of d) {
1526
+ const m = await ie(p, k, y);
1527
+ m && E.push(m);
1502
1528
  }
1503
- return _;
1529
+ return E;
1504
1530
  };
1505
- let le = 0, V = !1;
1506
- const de = async (y, f, k, _) => {
1507
- if (ne(f))
1531
+ let oe = 0, J = !1;
1532
+ const ae = async (p, d, y, E) => {
1533
+ if (Z(d))
1508
1534
  return;
1509
- const E = x && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(f);
1510
- if (E) {
1511
- if (!V) {
1512
- V = !0, setTimeout(() => V = !1, 500);
1513
- const [, F, U] = E, re = await y.resolve(F, k);
1514
- if (re) {
1515
- const ue = y.environment.moduleGraph.getModuleById(re.id)?.file;
1516
- if (ue) {
1517
- const ee = `${ue}${U}`;
1535
+ const k = T && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(d);
1536
+ if (k) {
1537
+ if (!J) {
1538
+ J = !0, setTimeout(() => J = !1, 500);
1539
+ const [, F, q] = k, ee = await p.resolve(F, y);
1540
+ if (ee) {
1541
+ const le = p.environment.moduleGraph.getModuleById(ee.id)?.file;
1542
+ if (le) {
1543
+ const Y = `${le}${q}`;
1518
1544
  try {
1519
- console.warn(`Opening in editor: ${ee}`);
1520
- const fe = (await import("launch-editor")).default;
1521
- fe(ee);
1522
- } catch (fe) {
1523
- console.error(`Failed to open editor: ${fe.message}`);
1545
+ console.warn(`Opening in editor: ${Y}`);
1546
+ const ce = (await import("launch-editor")).default;
1547
+ ce(Y);
1548
+ } catch (ce) {
1549
+ console.error(`Failed to open editor: ${ce.message}`);
1524
1550
  }
1525
1551
  }
1526
1552
  }
1527
1553
  }
1528
1554
  return { id: "\0editor" };
1529
1555
  }
1530
- const S = le++, L = T(y, _);
1531
- O(`resolveId(${S})`, `begin ${f} | ${L ? "server" : "client"} | ${k}`);
1532
- const P = k && me(k);
1533
- if (k = P && Q(P.pathId), f.startsWith(".") && P) {
1534
- const F = p(), U = F.dirname(P.pathId);
1535
- U && (f = F.resolve(U, f));
1556
+ const m = oe++, O = _(p, E);
1557
+ P(`resolveId(${m})`, `begin ${d} | ${O ? "server" : "client"} | ${y}`);
1558
+ const $ = y && pe(y);
1559
+ if (y = $ && H($.pathId), d.startsWith(".") && $) {
1560
+ const F = C(), q = F.dirname($.pathId);
1561
+ q && (d = F.resolve(q, d));
1536
1562
  }
1537
- const M = me(f), N = Q(M.pathId);
1538
- let D;
1539
- if (x && _?.scan || q(N, k, L), /**
1563
+ const R = pe(d), D = H(R.pathId);
1564
+ let N;
1565
+ if (T && E?.scan || j(D, y, O), /**
1540
1566
  * Check if we know the QRL. During regular builds, we'll encounter and build parents before
1541
1567
  * their QRLs, so this will always match.
1542
1568
  */
1543
- s.get(N))
1544
- O(`resolveId(${S}) Resolved already known ${N}`), D = {
1545
- id: N + M.query,
1569
+ s.get(D))
1570
+ P(`resolveId(${m}) Resolved already known ${D}`), N = {
1571
+ id: D + R.query,
1546
1572
  moduleSideEffects: !1
1547
1573
  };
1548
1574
  else if (
@@ -1551,158 +1577,158 @@ function un(t = {}) {
1551
1577
  * been transformed yet.
1552
1578
  */
1553
1579
  // We test with endsWith because the dev server adds the base pathname
1554
- N.endsWith(se)
1580
+ D.endsWith(re)
1555
1581
  )
1556
- o.resolveQwikBuild && (O(`resolveId(${S})`, "Resolved", se), D = {
1557
- id: se,
1582
+ o.resolveQwikBuild && (P(`resolveId(${m})`, "Resolved", re), N = {
1583
+ id: re,
1558
1584
  moduleSideEffects: !1
1559
1585
  });
1560
- else if (N.endsWith(oe))
1586
+ else if (D.endsWith(ne))
1561
1587
  console.error(
1562
- `${k ? `${k}: ` : ""}importing ${oe} is deprecated. Use \`getClientManifest()\` instead.`
1563
- ), O(`resolveId(${S})`, "Resolved", oe), D = {
1564
- id: oe,
1588
+ `${y ? `${y}: ` : ""}importing ${ne} is deprecated. Use \`getClientManifest()\` instead.`
1589
+ ), P(`resolveId(${m})`, "Resolved", ne), N = {
1590
+ id: ne,
1565
1591
  moduleSideEffects: !1
1566
1592
  };
1567
- else if (!x && !L && N.endsWith(nt)) {
1568
- O(`resolveId(${S})`, "Resolved", nt);
1569
- const F = await y.resolve(nt, k, {
1593
+ else if (!T && !O && D.endsWith(Ye)) {
1594
+ P(`resolveId(${m})`, "Resolved", Ye);
1595
+ const F = await p.resolve(Ye, y, {
1570
1596
  skipSelf: !0
1571
1597
  });
1572
1598
  if (F)
1573
- return y.emitFile({
1599
+ return p.emitFile({
1574
1600
  id: F.id,
1575
1601
  type: "chunk",
1576
1602
  preserveSignature: "allow-extension"
1577
1603
  }), F;
1578
- } else if (N.endsWith(Ie))
1579
- O(`resolveId(${S})`, "Resolved", Ie), D = {
1580
- id: Ie,
1604
+ } else if (D.endsWith(Ee))
1605
+ P(`resolveId(${m})`, "Resolved", Ee), N = {
1606
+ id: Ee,
1581
1607
  moduleSideEffects: !1
1582
1608
  };
1583
1609
  else {
1584
- if (!L && $ && f.endsWith("@qwik.dev/core")) {
1585
- $ = !1;
1586
- const U = await y.resolve("@qwik.dev/core/handlers.mjs", k, {
1610
+ if (!O && M && d.endsWith("@qwik.dev/core")) {
1611
+ M = !1;
1612
+ const q = await p.resolve("@qwik.dev/core/handlers.mjs", y, {
1587
1613
  skipSelf: !0
1588
1614
  });
1589
- if (!U)
1615
+ if (!q)
1590
1616
  throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
1591
- y.emitFile({
1592
- id: U.id,
1617
+ p.emitFile({
1618
+ id: q.id,
1593
1619
  type: "chunk",
1594
1620
  preserveSignature: "allow-extension"
1595
1621
  });
1596
1622
  }
1597
- const F = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(f)?.groups;
1623
+ const F = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(d)?.groups;
1598
1624
  if (F) {
1599
- const { parent: U, name: re, query: Ge } = F, ue = await y.resolve(U, k, { skipSelf: !0 });
1600
- if (ue) {
1601
- const ee = ue.id.split("?")[0], be = x && k?.endsWith(".html") ? `${ee}_${re}.js` : N;
1602
- O(`resolveId(${S})`, `resolved to QRL ${re} of ${ee}`), s.set(be, ee), D = {
1603
- id: be + Ge,
1625
+ const { parent: q, name: ee, query: De } = F, le = await p.resolve(q, y, { skipSelf: !0 });
1626
+ if (le) {
1627
+ const Y = le.id.split("?")[0], be = T && y?.endsWith(".html") ? `${Y}_${ee}.js` : D;
1628
+ P(`resolveId(${m})`, `resolved to QRL ${ee} of ${Y}`), s.set(be, Y), N = {
1629
+ id: be + De,
1604
1630
  // QRL segments can't have side effects. Probably never useful, but it's here for consistency
1605
1631
  moduleSideEffects: !1
1606
1632
  };
1607
1633
  } else
1608
- console.error(`resolveId(${S})`, `QRL parent ${U} does not exist!`);
1609
- } else if (k) {
1610
- const U = s.get(k);
1611
- if (U)
1612
- return O(`resolveId(${S}) end`, `resolving via ${U}`), y.resolve(f, U, { skipSelf: !0 });
1634
+ console.error(`resolveId(${m})`, `QRL parent ${q} does not exist!`);
1635
+ } else if (y) {
1636
+ const q = s.get(y);
1637
+ if (q)
1638
+ return P(`resolveId(${m}) end`, `resolving via ${q}`), p.resolve(d, q, { skipSelf: !0 });
1613
1639
  }
1614
1640
  }
1615
- return O(`resolveId(${S}) end`, D?.id || D), D;
1641
+ return P(`resolveId(${m}) end`, N?.id || N), N;
1616
1642
  };
1617
- let pn = 0;
1618
- const gn = async (y, f, k) => {
1619
- if (f === "\0editor")
1643
+ let bn = 0;
1644
+ const yn = async (p, d, y) => {
1645
+ if (d === "\0editor")
1620
1646
  return '"opening in editor"';
1621
- if (ne(f))
1647
+ if (Z(d))
1622
1648
  return;
1623
- const _ = pn++, E = T(y, k), S = me(f), L = Q(S.pathId);
1624
- if (q(L, void 0, E), f.startsWith("/@fs/"))
1649
+ const E = bn++, k = _(p, y), m = pe(d), O = H(m.pathId);
1650
+ if (j(O, void 0, k), d.startsWith("/@fs/"))
1625
1651
  return;
1626
- if (o.resolveQwikBuild && f === se)
1627
- return O(`load(${_})`, se, o.buildMode), {
1652
+ if (o.resolveQwikBuild && d === re)
1653
+ return P(`load(${E})`, re, o.buildMode), {
1628
1654
  moduleSideEffects: !1,
1629
- code: mt(E, o.target)
1655
+ code: bt(k, o.target)
1630
1656
  };
1631
- if (f === oe)
1632
- return O(`load(${_})`, oe, o.buildMode), {
1657
+ if (d === ne)
1658
+ return P(`load(${E})`, ne, o.buildMode), {
1633
1659
  moduleSideEffects: !1,
1634
1660
  code: `import { getClientManifest } from '@qwik.dev/core'; export const manifest = getClientManifest();
1635
1661
  `
1636
1662
  };
1637
- if (f === Ie)
1638
- return O(`load(${_})`, Ie, o.buildMode), {
1663
+ if (d === Ee)
1664
+ return P(`load(${E})`, Ee, o.buildMode), {
1639
1665
  moduleSideEffects: !1,
1640
1666
  code: "export * from '@qwik.dev/core';"
1641
1667
  };
1642
- f = L;
1643
- const P = E ? i : r;
1644
- if (x && !P.has(f)) {
1645
- const N = s.get(f);
1646
- if (N) {
1647
- O(`load(${_})`, "transforming QRL parent", N);
1648
- const D = x.moduleGraph.getModuleById(N);
1649
- if (D)
1650
- await x.transformRequest(D.url);
1668
+ d = O;
1669
+ const $ = k ? i : r;
1670
+ if (T && !$.has(d)) {
1671
+ const D = s.get(d);
1672
+ if (D) {
1673
+ P(`load(${E})`, "transforming QRL parent", D);
1674
+ const N = T.moduleGraph.getModuleById(D);
1675
+ if (N)
1676
+ await T.transformRequest(N.url);
1651
1677
  else
1652
1678
  try {
1653
- await x.transformRequest(N);
1679
+ await T.transformRequest(D);
1654
1680
  } catch (F) {
1655
- console.error(`load(${_})`, `could not transform QRL parent ${N}:`, F);
1681
+ console.error(`load(${E})`, `could not transform QRL parent ${D}:`, F);
1656
1682
  }
1657
- if (!P.has(f))
1658
- return O(`load(${_})`, `QRL segment ${f} not found in ${N}`), null;
1683
+ if (!$.has(d))
1684
+ return P(`load(${E})`, `QRL segment ${d} not found in ${D}`), null;
1659
1685
  }
1660
1686
  }
1661
- const M = P.get(f);
1662
- if (M) {
1663
- O(`load(${_})`, "Found", f);
1664
- let { code: N } = M[0];
1665
- const { map: D, segment: F } = M[0], U = M[1];
1666
- if (x?.hot && U && o.devTools.hmr && F?.ctxName !== "worker$") {
1667
- const re = U.startsWith(o.rootDir) ? U.slice(o.rootDir.length) : U;
1668
- N += `
1669
- if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(re)}], t: document.__hmrT}}));});}`;
1687
+ const R = $.get(d);
1688
+ if (R) {
1689
+ P(`load(${E})`, "Found", d);
1690
+ let { code: D } = R[0];
1691
+ const { map: N, segment: F } = R[0], q = R[1];
1692
+ if (T?.hot && q && o.devTools.hmr && F?.ctxName !== "worker$") {
1693
+ const ee = q.startsWith(o.rootDir) ? q.slice(o.rootDir.length) : q;
1694
+ D += `
1695
+ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(ee)}], t: document.__hmrT}}));});}`;
1670
1696
  }
1671
- return { code: N, map: D, meta: { segment: F } };
1697
+ return { code: D, map: N, meta: { segment: F } };
1672
1698
  }
1673
- return O(`load(${_})`, "Not a QRL or virtual module", f), null;
1699
+ return P(`load(${E})`, "Not a QRL or virtual module", d), null;
1674
1700
  };
1675
- let He, mn = 0;
1676
- const vn = async function(y, f, k, _ = {}) {
1677
- if (ne(k))
1701
+ let $e, xn = 0;
1702
+ const kn = async function(p, d, y, E = {}) {
1703
+ if (Z(y))
1678
1704
  return;
1679
- const E = T(y, _), S = E ? i : r;
1680
- if (S.has(k))
1705
+ const k = _(p, E), m = k ? i : r;
1706
+ if (m.has(y))
1681
1707
  return;
1682
- let L = !1;
1683
- const P = mn++, M = d(), N = p(), { pathId: D } = me(k), F = Q(D);
1684
- q(F, void 0, E);
1685
- const U = N.parse(D), re = U.dir, Ge = U.base, ue = U.ext.toLowerCase();
1686
- let ee, fe;
1687
- const be = o.target === "lib" ? "lib" : o.buildMode === "development" ? x?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
1688
- if (be !== "lib" && (f = f.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (te, ge) => (L = !0, o.experimental?.[ge] ? "true" : "false"))), ue in qt || ct.test(D)) {
1689
- const te = o.target === "client" || o.target === "ssr";
1690
- O(
1691
- `transform(${P})`,
1692
- `Transforming ${k} (for: ${E ? "server" : "client"}${te ? ", strip" : ""})`
1708
+ let O = !1;
1709
+ const $ = xn++, R = v(), D = C(), { pathId: N } = pe(y), F = H(N);
1710
+ j(F, void 0, k);
1711
+ const q = D.parse(N), ee = q.dir, De = q.base, le = q.ext.toLowerCase();
1712
+ let Y, ce;
1713
+ const be = o.target === "lib" ? "lib" : o.buildMode === "development" ? T?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
1714
+ if (be !== "lib" && (d = d.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (X, he) => (O = !0, o.experimental?.[he] ? "true" : "false"))), le in At || lt.test(N)) {
1715
+ const X = o.target === "client" || o.target === "ssr";
1716
+ P(
1717
+ `transform(${$})`,
1718
+ `Transforming ${y} (for: ${k ? "server" : "client"}${X ? ", strip" : ""})`
1693
1719
  );
1694
- let ge = Ge;
1695
- o.srcDir && (ge = N.relative(o.srcDir, D)), ge = Q(ge);
1696
- const xe = o.srcDir ? o.srcDir : Q(re), vt = o.entryStrategy;
1697
- let ie;
1698
- const wt = y.environment?.moduleGraph ?? x?.moduleGraph;
1699
- if (wt && (ie = wt.getModuleById(D)?.url, !ie && o.rootDir)) {
1700
- const B = Q(o.rootDir), Z = Q(D);
1701
- Z.startsWith(B) && (ie = Z.slice(B.length), ie.startsWith("/") || (ie = "/" + ie));
1720
+ let he = De;
1721
+ o.srcDir && (he = D.relative(o.srcDir, N)), he = H(he);
1722
+ const ye = o.srcDir ? o.srcDir : H(ee), yt = o.entryStrategy;
1723
+ let te;
1724
+ const xt = p.environment?.moduleGraph ?? T?.moduleGraph;
1725
+ if (xt && (te = xt.getModuleById(N)?.url, !te && o.rootDir)) {
1726
+ const z = H(o.rootDir), V = H(N);
1727
+ V.startsWith(z) && (te = V.slice(z.length), te.startsWith("/") || (te = "/" + te));
1702
1728
  }
1703
- const he = {
1704
- input: [{ code: f, path: ge, devPath: ie }],
1705
- entryStrategy: E ? { type: "hoist" } : vt,
1729
+ const de = {
1730
+ input: [{ code: d, path: he, devPath: te }],
1731
+ entryStrategy: k ? { type: "hoist" } : yt,
1706
1732
  minify: "simplify",
1707
1733
  // Always enable sourcemaps in dev for click-to-source
1708
1734
  sourceMaps: o.sourcemap || o.buildMode === "development",
@@ -1710,106 +1736,106 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
1710
1736
  transpileJsx: !0,
1711
1737
  explicitExtensions: !0,
1712
1738
  preserveFilenames: !0,
1713
- srcDir: xe,
1739
+ srcDir: ye,
1714
1740
  rootDir: o.rootDir,
1715
1741
  mode: be,
1716
1742
  scope: o.scope || void 0,
1717
- isServer: E
1743
+ isServer: k
1718
1744
  };
1719
- te && (E ? (he.stripCtxName = Er, he.stripEventHandlers = !0, he.regCtxName = kr) : (he.stripCtxName = $t, he.stripExports = Mt));
1720
- const _n = Date.now(), pe = await M.transformModules(he);
1721
- if (O(`transform(${P})`, `done in ${Date.now() - _n}ms`), ie) {
1722
- const B = br(ie);
1723
- for (const Z of pe.modules)
1724
- Z.code = ln(
1725
- Z.code,
1726
- B
1745
+ X && (k ? (de.stripCtxName = $r, de.stripEventHandlers = !0, de.regCtxName = Tr) : (de.stripCtxName = zt, de.stripExports = qt));
1746
+ const Nn = Date.now(), ue = await R.transformModules(de);
1747
+ if (P(`transform(${$})`, `done in ${Date.now() - Nn}ms`), te) {
1748
+ const z = Cr(te);
1749
+ for (const V of ue.modules)
1750
+ V.code = ln(
1751
+ V.code,
1752
+ z
1727
1753
  );
1728
1754
  }
1729
- const Se = pe.modules.find((B) => !jt(B));
1730
- if (z(E))
1731
- await Y(y, pe, xe, F);
1732
- else if (j(E) && _t(f)) {
1733
- const B = {
1734
- ...he,
1735
- entryStrategy: vt,
1755
+ const xe = ue.modules.find((z) => !Ft(z));
1756
+ if (U(k))
1757
+ await G(p, ue, ye, F);
1758
+ else if (L(k) && $t(d)) {
1759
+ const z = {
1760
+ ...de,
1761
+ entryStrategy: yt,
1736
1762
  isServer: !1
1737
1763
  };
1738
- te && (B.stripCtxName = $t, B.stripExports = Mt, B.stripEventHandlers = void 0, B.regCtxName = void 0), await Y(
1739
- y,
1740
- await M.transformModules(B),
1741
- xe,
1764
+ X && (z.stripCtxName = zt, z.stripExports = qt, z.stripEventHandlers = void 0, z.regCtxName = void 0), await G(
1765
+ p,
1766
+ await R.transformModules(z),
1767
+ ye,
1742
1768
  F,
1743
1769
  !0
1744
1770
  );
1745
1771
  }
1746
- h(pe.diagnostics, M, xe);
1747
- let yt = [];
1748
- E && te && (yt = await W(y, Se.imports ?? [], k)), E ? pe.diagnostics.length === 0 && c && c.lint(y, f, k) : n.set(k, pe);
1749
- const tt = /* @__PURE__ */ new Set();
1750
- for (const B of pe.modules)
1751
- if (B !== Se) {
1752
- const Z = Q(N.join(xe, B.path));
1753
- if (O(`transform(${P})`, `segment ${Z}`, B.segment.displayName), s.set(Z, k), S.set(Z, [B, k]), tt.add(Z), x) {
1754
- const Qe = x.moduleGraph.getModuleById(Z);
1755
- Qe && x.moduleGraph.invalidateModule(Qe);
1772
+ u(ue.diagnostics, R, ye);
1773
+ let kt = [];
1774
+ k && X && (kt = await B(p, xe.imports ?? [], y)), k ? ue.diagnostics.length === 0 && c && c.lint(p, d, y) : n.set(y, ue);
1775
+ const Je = /* @__PURE__ */ new Set();
1776
+ for (const z of ue.modules)
1777
+ if (z !== xe) {
1778
+ const V = H(D.join(ye, z.path));
1779
+ if (P(`transform(${$})`, `segment ${V}`, z.segment.displayName), s.set(V, y), m.set(V, [z, y]), Je.add(V), T) {
1780
+ const Ne = T.moduleGraph.getModuleById(V);
1781
+ Ne && T.moduleGraph.invalidateModule(Ne);
1756
1782
  }
1757
- if (o.target === "client" && !x && y.emitFile({
1758
- id: Z,
1783
+ if (o.target === "client" && !T && p.emitFile({
1784
+ id: V,
1759
1785
  type: "chunk",
1760
1786
  preserveSignature: "allow-extension"
1761
- }), B.segment && l.size > 0)
1762
- for (const Qe of l)
1763
- Qe(k, B.segment);
1787
+ }), z.segment && l.size > 0)
1788
+ for (const Ne of l)
1789
+ Ne(y, z.segment);
1764
1790
  }
1765
- for (const B of yt)
1766
- tt.add(B);
1767
- y.addWatchFile(k), f = Se.code, ee = Se.map, fe = {
1768
- segment: Se.segment,
1769
- qwikdeps: Array.from(tt)
1770
- }, L = !0;
1771
- }
1772
- if (f.includes(`globalThis.${Je}`)) {
1773
- He === void 0 && (He = await xn(E));
1774
- const te = new ht(f);
1775
- te.replace(`!globalThis.${Je}`, "false"), He && te.replace(`globalThis.${Je}`, He), f = te.toString(), ee ||= te.generateMap({ source: k, includeContent: !1 }), L = !0, O(`transform(${P})`, `Replaced globalThis.${Je} with manifest input`);
1776
- }
1777
- if (L)
1778
- return _r(k) && (ee = null), { code: f, map: ee, meta: fe };
1779
- O(`transform(${P})`, "Not transforming", k);
1780
- }, pt = (y) => {
1781
- const f = [], k = {
1782
- addInjection: (_) => f.push(_)
1791
+ for (const z of kt)
1792
+ Je.add(z);
1793
+ p.addWatchFile(y), d = xe.code, Y = xe.map, ce = {
1794
+ segment: xe.segment,
1795
+ qwikdeps: Array.from(Je)
1796
+ }, O = !0;
1797
+ }
1798
+ if (d.includes(`globalThis.${Pe}`)) {
1799
+ $e === void 0 && ($e = await In(k));
1800
+ const X = new gt(d);
1801
+ X.replace(`!globalThis.${Pe}`, "false"), $e && X.replace(`globalThis.${Pe}`, $e), d = X.toString(), Y ||= X.generateMap({ source: y, includeContent: !1 }), O = !0, P(`transform(${$})`, `Replaced globalThis.${Pe} with manifest input`);
1802
+ }
1803
+ if (O)
1804
+ return Nr(y) && (Y = null), { code: d, map: Y, meta: ce };
1805
+ P(`transform(${$})`, "Not transforming", y);
1806
+ }, wt = (p) => {
1807
+ const d = [], y = {
1808
+ addInjection: (E) => d.push(E)
1783
1809
  };
1784
- return k.generateManifest = async (_) => {
1785
- const S = d().sys.path, L = S.resolve(o.rootDir, o.outDir, "build"), P = (D) => S.relative(L, S.resolve(o.rootDir, o.outDir, D));
1786
- k.canonPath = P;
1787
- const M = Array.from(n.values()).flatMap((D) => D.modules).map((D) => D.segment).filter((D) => !!D), N = On(
1788
- S,
1789
- M,
1790
- f,
1791
- y,
1810
+ return y.generateManifest = async (E) => {
1811
+ const m = v().sys.path, O = m.resolve(o.rootDir, o.outDir, "build"), $ = (N) => m.relative(O, m.resolve(o.rootDir, o.outDir, N));
1812
+ y.canonPath = $;
1813
+ const R = Array.from(n.values()).flatMap((N) => N.modules).map((N) => N.segment).filter((N) => !!N), D = Bn(
1814
+ m,
1815
+ R,
1816
+ d,
1817
+ p,
1792
1818
  o,
1793
- O,
1794
- P
1819
+ P,
1820
+ $
1795
1821
  );
1796
- _ && Object.assign(N, _);
1797
- for (const D of Object.values(N.symbols))
1798
- D.origin && (D.origin = Q(D.origin));
1799
- for (const D of Object.values(N.bundles))
1800
- D.origins && (D.origins = D.origins.sort());
1801
- return N.manifestHash = Cn(JSON.stringify(N)), N;
1802
- }, k;
1803
- }, wn = () => o, gt = () => Array.from(r.values()).map((y) => y[0]), O = (...y) => {
1804
- o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...y);
1805
- }, yn = (...y) => {
1806
- console.log(`[QWIK PLUGIN: ${e}]`, ...y);
1807
- }, bn = (y) => {
1808
- h = y;
1809
- }, Q = (y) => w(y);
1810
- function mt(y, f) {
1811
- const k = o.buildMode === "development";
1812
- return k ? `// @qwik.dev/core/build
1822
+ E && Object.assign(D, E);
1823
+ for (const N of Object.values(D.symbols))
1824
+ N.origin && (N.origin = H(N.origin));
1825
+ for (const N of Object.values(D.bundles))
1826
+ N.origins && (N.origins = N.origins.sort());
1827
+ return D.manifestHash = On(JSON.stringify(D)), D;
1828
+ }, y;
1829
+ }, Sn = () => o, vt = () => Array.from(r.values()).map((p) => p[0]), P = (...p) => {
1830
+ o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...p);
1831
+ }, En = (...p) => {
1832
+ console.log(`[QWIK PLUGIN: ${e}]`, ...p);
1833
+ }, Cn = (p) => {
1834
+ u = p;
1835
+ }, H = (p) => w(p);
1836
+ function bt(p, d) {
1837
+ const y = o.buildMode === "development";
1838
+ return y ? `// @qwik.dev/core/build
1813
1839
  export const isBrowser = /*#__PURE__*/ (() =>
1814
1840
  typeof window !== 'undefined' &&
1815
1841
  typeof HTMLElement !== 'undefined' &&
@@ -1818,154 +1844,154 @@ export const isBrowser = /*#__PURE__*/ (() =>
1818
1844
  export const isServer = !isBrowser;
1819
1845
  export const isDev = true;
1820
1846
  ` : `// @qwik.dev/core/build
1821
- export const isServer = ${JSON.stringify(y)};
1822
- export const isBrowser = ${JSON.stringify(!y)};
1823
- export const isDev = ${JSON.stringify(k)};
1847
+ export const isServer = ${JSON.stringify(p)};
1848
+ export const isBrowser = ${JSON.stringify(!p)};
1849
+ export const isDev = ${JSON.stringify(y)};
1824
1850
  `;
1825
1851
  }
1826
- async function xn(y) {
1827
- if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && v) {
1828
- const _ = p();
1829
- let E = o.manifestInputPath || _.resolve(o.clientOutDir, rt);
1830
- await v.promises.stat(E).catch(() => !1) || (E = _.resolve(o.rootDir, Ut, rt));
1852
+ async function In(p) {
1853
+ if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && b) {
1854
+ const E = C();
1855
+ let k = o.manifestInputPath || E.resolve(o.clientOutDir, Xe);
1856
+ await b.promises.stat(k).catch(() => !1) || (k = E.resolve(o.rootDir, Ut, Xe));
1831
1857
  try {
1832
- const S = await v.promises.readFile(E, "utf-8");
1833
- o.manifestInput = St(JSON.parse(S)) || null, console.info("Read client manifest from", E);
1834
- } catch (S) {
1858
+ const m = await b.promises.readFile(k, "utf-8");
1859
+ o.manifestInput = Ct(JSON.parse(m)) || null, console.info("Read client manifest from", k);
1860
+ } catch (m) {
1835
1861
  console.warn(
1836
1862
  `
1837
1863
  ==========
1838
- Could not read Qwik client manifest ${E}.
1864
+ Could not read Qwik client manifest ${k}.
1839
1865
  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__\`.
1840
1866
  Without the manifest, the SSR renderer will not be able to generate event handlers.
1841
- (${S})
1867
+ (${m})
1842
1868
  ==========
1843
1869
  `
1844
1870
  );
1845
1871
  }
1846
1872
  }
1847
- const f = y ? o.manifestInput : null;
1848
- let k = null;
1849
- return f?.manifestHash && (k = {
1850
- manifestHash: f.manifestHash,
1851
- core: f.core,
1852
- preloader: f.preloader,
1853
- qwikLoader: f.qwikLoader,
1854
- bundleGraphAsset: f.bundleGraphAsset,
1855
- injections: f.injections,
1856
- mapping: f.mapping,
1857
- bundleGraph: f.bundleGraph
1858
- }), k && JSON.stringify(k);
1859
- }
1860
- function Sn(y) {
1861
- o.sourcemap = y;
1862
- }
1863
- function kn(y, f) {
1864
- const k = y.name === "ssr";
1865
- O("hotUpdate()", f.file, y.name);
1866
- const _ = k ? i : r;
1867
- for (const E of f.modules) {
1868
- const { id: S } = E;
1869
- if (S) {
1870
- O("hotUpdate()", `invalidate ${S}`), n.delete(S);
1871
- for (const [L, [P, M]] of _)
1872
- if (M === S) {
1873
- O("hotUpdate()", `invalidate ${S} segment ${L}`), _.delete(L);
1874
- const N = y.moduleGraph.getModuleById(L);
1875
- N && y.moduleGraph.invalidateModule(N);
1873
+ const d = p ? o.manifestInput : null;
1874
+ let y = null;
1875
+ return d?.manifestHash && (y = {
1876
+ manifestHash: d.manifestHash,
1877
+ core: d.core,
1878
+ preloader: d.preloader,
1879
+ qwikLoader: d.qwikLoader,
1880
+ bundleGraphAsset: d.bundleGraphAsset,
1881
+ injections: d.injections,
1882
+ mapping: d.mapping,
1883
+ bundleGraph: d.bundleGraph
1884
+ }), y && JSON.stringify(y);
1885
+ }
1886
+ function _n(p) {
1887
+ o.sourcemap = p;
1888
+ }
1889
+ function Tn(p, d) {
1890
+ const y = p.name === "ssr";
1891
+ P("hotUpdate()", d.file, p.name);
1892
+ const E = y ? i : r;
1893
+ for (const k of d.modules) {
1894
+ const { id: m } = k;
1895
+ if (m) {
1896
+ P("hotUpdate()", `invalidate ${m}`), n.delete(m);
1897
+ for (const [O, [$, R]] of E)
1898
+ if (R === m) {
1899
+ P("hotUpdate()", `invalidate ${m} segment ${O}`), E.delete(O);
1900
+ const D = p.moduleGraph.getModuleById(O);
1901
+ D && p.moduleGraph.invalidateModule(D);
1876
1902
  }
1877
1903
  }
1878
1904
  }
1879
1905
  }
1880
- const En = (y, { getModuleInfo: f }) => {
1906
+ const $n = (p, { getModuleInfo: d }) => {
1881
1907
  if (o.target === "client") {
1882
1908
  if (
1883
1909
  // The preloader has to stay in a separate chunk if it's a client build
1884
- y.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(y)
1910
+ p.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(p)
1885
1911
  )
1886
1912
  return "qwik-preloader";
1887
1913
  if (
1888
1914
  // likewise, core and handlers have to be in the same chunk so there's no import waterfall
1889
- /[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(y)
1915
+ /[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(p)
1890
1916
  )
1891
1917
  return "qwik-core";
1892
- if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(y))
1918
+ if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(p))
1893
1919
  return "qwik-loader";
1894
1920
  }
1895
- const k = f(y);
1896
- if (k) {
1897
- const _ = k.meta.segment;
1898
- if (_) {
1899
- if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(_.ctxName))
1921
+ const y = d(p);
1922
+ if (y) {
1923
+ const E = y.meta.segment;
1924
+ if (E) {
1925
+ if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(E.ctxName))
1900
1926
  return null;
1901
- const { hash: E } = _, S = o.entryStrategy.manual?.[E] || _.entry;
1902
- if (S)
1903
- return S;
1927
+ const { hash: k } = E, m = o.entryStrategy.manual?.[k] || E.entry;
1928
+ if (m)
1929
+ return m;
1904
1930
  }
1905
1931
  }
1906
1932
  return null;
1907
1933
  };
1908
- async function In(y, f, k, _) {
1909
- const S = await pt(f).generateManifest(_);
1910
- S.platform = {
1911
- ..._?.platform,
1912
- rollup: y.meta?.rollupVersion || "",
1913
- env: C.sys.env,
1914
- os: C.sys.os
1915
- }, C.sys.env === "node" && (S.platform.node = process.versions.node);
1916
- const L = qn(S, k), P = y.emitFile({
1934
+ async function Dn(p, d, y, E) {
1935
+ const m = await wt(d).generateManifest(E);
1936
+ m.platform = {
1937
+ ...E?.platform,
1938
+ rollup: p.meta?.rollupVersion || "",
1939
+ env: I.sys.env,
1940
+ os: I.sys.os
1941
+ }, I.sys.env === "node" && (m.platform.node = process.versions.node);
1942
+ const O = Ln(m, y), $ = p.emitFile({
1917
1943
  type: "asset",
1918
1944
  name: "bundle-graph.json",
1919
- source: JSON.stringify(L)
1920
- }), M = y.getFileName(P);
1921
- S.bundleGraphAsset = M, S.assets[M] = {
1945
+ source: JSON.stringify(O)
1946
+ }), R = p.getFileName($);
1947
+ m.bundleGraphAsset = R, m.assets[R] = {
1922
1948
  name: "bundle-graph.json",
1923
- size: L.length
1949
+ size: O.length
1924
1950
  };
1925
- const N = JSON.stringify(S, null, " ");
1926
- return y.emitFile({
1927
- fileName: rt,
1951
+ const D = JSON.stringify(m, null, " ");
1952
+ return p.emitFile({
1953
+ fileName: Xe,
1928
1954
  type: "asset",
1929
- source: N
1930
- }), typeof o.manifestOutput == "function" && await o.manifestOutput(S), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(gt()), S;
1955
+ source: D
1956
+ }), typeof o.manifestOutput == "function" && await o.manifestOutput(m), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(vt()), m;
1931
1957
  }
1932
1958
  return {
1933
- buildStart: I,
1934
- createOutputAnalyzer: pt,
1935
- getQwikBuildModule: mt,
1936
- getOptimizer: d,
1937
- getOptions: wn,
1938
- getPath: p,
1939
- getSys: u,
1940
- getTransformedOutputs: gt,
1941
- init: g,
1942
- load: gn,
1943
- debug: O,
1944
- log: yn,
1945
- normalizeOptions: K,
1946
- normalizePath: Q,
1947
- onDiagnostics: bn,
1948
- resolveId: de,
1959
+ buildStart: S,
1960
+ createOutputAnalyzer: wt,
1961
+ getQwikBuildModule: bt,
1962
+ getOptimizer: v,
1963
+ getOptions: Sn,
1964
+ getPath: C,
1965
+ getSys: x,
1966
+ getTransformedOutputs: vt,
1967
+ init: f,
1968
+ load: yn,
1969
+ debug: P,
1970
+ log: En,
1971
+ normalizeOptions: Te,
1972
+ normalizePath: H,
1973
+ onDiagnostics: Cn,
1974
+ resolveId: ae,
1949
1975
  segmentCallbacks: l,
1950
- transform: vn,
1951
- validateSource: b,
1952
- setSourceMapSupport: Sn,
1953
- configureServer: R,
1954
- hotUpdate: kn,
1955
- manualChunks: En,
1956
- generateManifest: In
1976
+ transform: kn,
1977
+ validateSource: g,
1978
+ setSourceMapSupport: _n,
1979
+ configureServer: W,
1980
+ hotUpdate: Tn,
1981
+ manualChunks: $n,
1982
+ generateManifest: Dn
1957
1983
  };
1958
1984
  }
1959
- const Ir = (t) => (e) => typeof e == "string" ? Vn(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
1960
- function jt(t) {
1985
+ const Dr = (t) => (e) => typeof e == "string" ? ir(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
1986
+ function Ft(t) {
1961
1987
  return t.isEntry || t.segment;
1962
1988
  }
1963
- const _r = (t) => t.startsWith("virtual:"), qt = {
1989
+ const Nr = (t) => t.startsWith("virtual:"), At = {
1964
1990
  ".jsx": !0,
1965
1991
  ".ts": !0,
1966
1992
  ".tsx": !0
1967
- }, ct = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", ye = "@qwik.dev/core/internal", se = "@qwik.dev/core/build", dt = "@qwik.dev/core/jsx-runtime", ut = "@qwik.dev/core/jsx-dev-runtime", Ke = "@qwik.dev/core/server", oe = "@qwik-client-manifest", nt = "@qwik.dev/core/preloader", Ie = "@qwik-handlers", Cr = "src", Ut = "dist", Tr = "server", Pr = "lib", rt = "q-manifest.json", Je = "__QWIK_MANIFEST__";
1968
- async function Nr(t, e, n) {
1993
+ }, lt = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", ve = "@qwik.dev/core/internal", re = "@qwik.dev/core/build", ct = "@qwik.dev/core/jsx-runtime", dt = "@qwik.dev/core/jsx-dev-runtime", Oe = "@qwik.dev/core/server", ne = "@qwik-client-manifest", Ye = "@qwik.dev/core/preloader", Ee = "@qwik-handlers", Or = "src", Ut = "dist", Pr = "server", Rr = "lib", Xe = "q-manifest.json", Pe = "__QWIK_MANIFEST__";
1994
+ async function Lr(t, e, n) {
1969
1995
  if (t.env === "browsermain" || t.env === "webworker")
1970
1996
  return;
1971
1997
  const r = await t.dynamicImport("node:fs");
@@ -1982,7 +2008,7 @@ async function Nr(t, e, n) {
1982
2008
  i = l;
1983
2009
  }
1984
2010
  }
1985
- function ho(t = {}) {
2011
+ function is(t = {}) {
1986
2012
  const e = un(t.optimizerOptions);
1987
2013
  return {
1988
2014
  name: "rollup-plugin-qwik",
@@ -2019,7 +2045,7 @@ function ho(t = {}) {
2019
2045
  return r.input = l, r;
2020
2046
  },
2021
2047
  outputOptions(r) {
2022
- return ft(
2048
+ return ut(
2023
2049
  e,
2024
2050
  r,
2025
2051
  e.getOptions().outDir
@@ -2029,33 +2055,33 @@ function ho(t = {}) {
2029
2055
  e.onDiagnostics((r, i, s) => {
2030
2056
  r.forEach((l) => {
2031
2057
  const a = e.normalizePath(i.sys.path.join(s, l.file));
2032
- l.category === "error" ? this.error(Ve(a, l)) : this.warn(Ve(a, l));
2058
+ l.category === "error" ? this.error(He(a, l)) : this.warn(He(a, l));
2033
2059
  });
2034
2060
  }), await e.buildStart(this);
2035
2061
  },
2036
2062
  resolveId(r, i) {
2037
- return ne(r) ? null : e.resolveId(this, r, i);
2063
+ return Z(r) ? null : e.resolveId(this, r, i);
2038
2064
  },
2039
2065
  load(r) {
2040
- return ne(r) ? null : e.load(this, r);
2066
+ return Z(r) ? null : e.load(this, r);
2041
2067
  },
2042
2068
  transform(r, i) {
2043
- return ne(i) ? null : e.transform(this, r, i);
2069
+ return Z(i) ? null : e.transform(this, r, i);
2044
2070
  },
2045
2071
  async generateBundle(r, i) {
2046
2072
  e.getOptions().target === "client" && await e.generateManifest(this, i);
2047
2073
  }
2048
2074
  };
2049
2075
  }
2050
- async function Dr(t, e) {
2076
+ async function Mr(t, e) {
2051
2077
  return Array.isArray(e) ? (e.length || e.push({}), await Promise.all(
2052
2078
  e.map(
2053
- (n) => ft(t, n)
2079
+ (n) => ut(t, n)
2054
2080
  )
2055
- )) : ft(t, e);
2081
+ )) : ut(t, e);
2056
2082
  }
2057
- const Rr = (t) => "", Lr = (t) => `${Rr()}build/`, Or = (t, e, n) => {
2058
- const r = Lr();
2083
+ const jr = (t) => "", qr = (t) => `${jr()}build/`, zr = (t, e, n) => {
2084
+ const r = qr();
2059
2085
  return e.buildMode === "production" && !e.debug ? `${r}q-[hash].js` : (i) => {
2060
2086
  if (i.moduleIds?.some((a) => /core\.(prod|min)\.mjs$/.test(a)))
2061
2087
  return `${r}core.js`;
@@ -2065,31 +2091,31 @@ const Rr = (t) => "", Lr = (t) => `${Rr()}build/`, Or = (t, e, n) => {
2065
2091
  return `${r}${l}.js`;
2066
2092
  };
2067
2093
  };
2068
- async function ft(t, e, n) {
2094
+ async function ut(t, e, n) {
2069
2095
  const r = { ...e }, i = t.getOptions(), s = t.getOptimizer(), l = t.manualChunks;
2070
2096
  r.assetFileNames || (r.assetFileNames = "assets/[hash]-[name].[ext]");
2071
- const a = Or("", i, s);
2097
+ const a = zr("", i, s);
2072
2098
  if (i.target === "client") {
2073
2099
  r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
2074
- const h = r.manualChunks;
2075
- if (h && typeof h != "function")
2100
+ const u = r.manualChunks;
2101
+ if (u && typeof u != "function")
2076
2102
  throw new Error("manualChunks must be a function");
2077
- r.manualChunks = h ? (o, w) => h(o, w) || l(o, w) : l;
2103
+ r.manualChunks = u ? (o, w) => u(o, w) || l(o, w) : l;
2078
2104
  } else
2079
2105
  r.chunkFileNames || (r.chunkFileNames = a);
2080
2106
  !r.dir && n && (r.dir = n), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
2081
- const c = await Nr(s.sys, "rollup", s.sys.cwd());
2107
+ const c = await Lr(s.sys, "rollup", s.sys.cwd());
2082
2108
  if (c)
2083
2109
  try {
2084
- const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o), v = String(w?.version || ""), [g, d, u] = v.split(".").map((x) => parseInt(x, 10));
2085
- Number.isFinite(g) && (g > 4 || g === 4 && (d > 52 || d === 52 && (u || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
2086
- `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${v}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
2110
+ const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o), b = String(w?.version || ""), [f, v, x] = b.split(".").map((T) => parseInt(T, 10));
2111
+ Number.isFinite(f) && (f > 4 || f === 4 && (v > 52 || v === 52 && (x || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
2112
+ `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${b}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
2087
2113
  );
2088
2114
  } catch {
2089
2115
  }
2090
2116
  return r;
2091
2117
  }
2092
- function Ve(t, e) {
2118
+ function He(t, e) {
2093
2119
  const n = e.highlights?.[0];
2094
2120
  return Object.assign(new Error(e.message), {
2095
2121
  id: t,
@@ -2101,7 +2127,7 @@ function Ve(t, e) {
2101
2127
  stack: ""
2102
2128
  });
2103
2129
  }
2104
- const Mr = `"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'"))`, $r = '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)}', jr = `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)})}`, qr = '[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}', Ur = '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>&lt;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>
2130
+ 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'"))`, Ar = '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)}', Ur = `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)})}`, Br = '[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>&lt;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)}', Hr = `<style>
2105
2131
  :host {
2106
2132
  position: absolute;
2107
2133
  border: 1px solid red;
@@ -2265,32 +2291,32 @@ const Mr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
2265
2291
  <p class="action-container"></p>
2266
2292
  </div>
2267
2293
  </dialog>
2268
- `, Fr = `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}`, Ar = "#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}}";
2269
- async function zr(t, e, n, r) {
2294
+ `, Qr = `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}`, Gr = "#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}}";
2295
+ async function Kr(t, e, n, r) {
2270
2296
  const i = await n.dynamicImport("node:fs"), s = await n.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
2271
2297
  (c) => r.join(e, `entry.preview.${c}`)
2272
2298
  ).find((c) => i.existsSync(c));
2273
2299
  if (!a)
2274
- return it(
2300
+ return Ze(
2275
2301
  t,
2276
2302
  `Unable to find output "${e}/entry.preview" module.
2277
2303
 
2278
2304
  Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
2279
2305
  );
2280
2306
  try {
2281
- const c = s.pathToFileURL(a).href, h = await n.strictDynamicImport(c);
2307
+ const c = s.pathToFileURL(a).href, u = await n.strictDynamicImport(c);
2282
2308
  let o = null;
2283
- if (h.default && (typeof h.default == "function" ? o = h.default : typeof h.default == "object" && (o = h.default.router)), typeof o != "function")
2284
- return it(
2309
+ if (u.default && (typeof u.default == "function" ? o = u.default : typeof u.default == "object" && (o = u.default.router)), typeof o != "function")
2310
+ return Ze(
2285
2311
  t,
2286
2312
  `Entry preview module "${a}" does not export a default middleware function`
2287
2313
  );
2288
2314
  t.use(o);
2289
2315
  } catch (c) {
2290
- return it(t, String(c));
2316
+ return Ze(t, String(c));
2291
2317
  }
2292
2318
  }
2293
- function it(t, e) {
2319
+ function Ze(t, e) {
2294
2320
  console.log(`
2295
2321
  ❌ ${e}
2296
2322
  `), t.use((n, r) => {
@@ -2299,25 +2325,25 @@ function it(t, e) {
2299
2325
  }), r.end(e);
2300
2326
  });
2301
2327
  }
2302
- const Wr = (t, e) => {
2328
+ const Vr = (t, e) => {
2303
2329
  const n = [
2304
- { tag: "style", children: Fr, injectTo: "body" },
2305
- { tag: "style", children: Ar, injectTo: "body" },
2306
- { tag: "script", attrs: { type: "module" }, children: jr, injectTo: "body" },
2307
- { tag: "script", attrs: { type: "module" }, children: Mr, injectTo: "body" }
2330
+ { tag: "style", children: Qr, injectTo: "body" },
2331
+ { tag: "style", children: Gr, injectTo: "body" },
2332
+ { tag: "script", attrs: { type: "module" }, children: Ur, injectTo: "body" },
2333
+ { tag: "script", attrs: { type: "module" }, children: Fr, injectTo: "body" }
2308
2334
  ];
2309
2335
  if ((t.devTools?.imageDevTools ?? !0) && n.push(
2310
2336
  {
2311
2337
  tag: "style",
2312
- children: qr,
2338
+ children: Br,
2313
2339
  injectTo: "body"
2314
2340
  },
2315
2341
  {
2316
2342
  tag: "script",
2317
2343
  attrs: { type: "module" },
2318
- children: Ur.replace(
2344
+ children: Wr.replace(
2319
2345
  "globalThis.__TEMPLATE__",
2320
- JSON.stringify(Br)
2346
+ JSON.stringify(Hr)
2321
2347
  ),
2322
2348
  injectTo: "body"
2323
2349
  }
@@ -2326,673 +2352,574 @@ const Wr = (t, e) => {
2326
2352
  e.endsWith("/") && (e = e.slice(0, -1)), n.push({
2327
2353
  tag: "script",
2328
2354
  attrs: { type: "module" },
2329
- children: $r.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
2355
+ children: Ar.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
2330
2356
  injectTo: "body"
2331
2357
  });
2332
2358
  }
2333
2359
  return n;
2334
2360
  };
2335
- function H(t) {
2336
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2337
- }
2338
- var _e = {}, ot = {}, Bt;
2339
- function G() {
2340
- return Bt || (Bt = 1, (function(t) {
2341
- 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;
2342
- const e = new TextDecoder(), n = (u, p = 0, x = u.length) => e.decode(u.slice(p, x));
2343
- t.toUTF8String = n;
2344
- const r = (u, p = 0, x = u.length) => u.slice(p, x).reduce((R, K) => R + ("0" + K.toString(16)).slice(-2), "");
2345
- t.toHexString = r;
2346
- const i = (u, p = 0) => {
2347
- const x = u[p] + u[p + 1] * 256;
2348
- return x | (x & 2 ** 15) * 131070;
2361
+ var Jr = new TextDecoder(), Yr = (t, e = 0, n = t.length) => Jr.decode(t.slice(e, n)), fn = (t, e) => new DataView(t.buffer, t.byteOffset + e), Xr = (t, e = 0) => fn(t, e).getInt32(0, !0), Zr = (t, e = 0) => fn(t, e).getUint32(0, !0), ei = {
2362
+ validate: (t) => Yr(t, 0, 2) === "BM",
2363
+ calculate: (t) => ({
2364
+ height: Math.abs(Xr(t, 22)),
2365
+ width: Zr(t, 18)
2366
+ })
2367
+ };
2368
+ new TextDecoder();
2369
+ var ti = (t, e) => new DataView(t.buffer, t.byteOffset + e), fe = (t, e = 0) => ti(t, e).getUint16(0, !0), ni = 1, ri = 6, ii = 16;
2370
+ function Bt(t, e) {
2371
+ const n = t[e];
2372
+ return n === 0 ? 256 : n;
2373
+ }
2374
+ function Wt(t, e) {
2375
+ const n = ri + e * ii;
2376
+ return {
2377
+ height: Bt(t, n + 1),
2378
+ width: Bt(t, n)
2379
+ };
2380
+ }
2381
+ var oi = {
2382
+ validate(t) {
2383
+ const e = fe(t, 0), n = fe(t, 4);
2384
+ return e !== 0 || n === 0 ? !1 : fe(t, 2) === ni;
2385
+ },
2386
+ calculate(t) {
2387
+ const e = fe(t, 4), n = Wt(t, 0);
2388
+ if (e === 1) return n;
2389
+ const r = [];
2390
+ for (let i = 0; i < e; i += 1)
2391
+ r.push(Wt(t, i));
2392
+ return {
2393
+ width: n.width,
2394
+ height: n.height,
2395
+ images: r
2349
2396
  };
2350
- t.readInt16LE = i;
2351
- const s = (u, p = 0) => u[p] * 2 ** 8 + u[p + 1];
2352
- t.readUInt16BE = s;
2353
- const l = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8;
2354
- t.readUInt16LE = l;
2355
- const a = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16;
2356
- t.readUInt24LE = a;
2357
- const c = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + (u[p + 3] << 24);
2358
- t.readInt32LE = c;
2359
- const h = (u, p = 0) => u[p] * 2 ** 24 + u[p + 1] * 2 ** 16 + u[p + 2] * 2 ** 8 + u[p + 3];
2360
- t.readUInt32BE = h;
2361
- const o = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + u[p + 3] * 2 ** 24;
2362
- t.readUInt32LE = o;
2363
- const w = {
2364
- readUInt16BE: t.readUInt16BE,
2365
- readUInt16LE: t.readUInt16LE,
2366
- readUInt32BE: t.readUInt32BE,
2367
- readUInt32LE: t.readUInt32LE
2397
+ }
2398
+ }, si = 2, ai = {
2399
+ validate(t) {
2400
+ const e = fe(t, 0), n = fe(t, 4);
2401
+ return e !== 0 || n === 0 ? !1 : fe(t, 2) === si;
2402
+ },
2403
+ calculate: (t) => oi.calculate(t)
2404
+ };
2405
+ new TextDecoder();
2406
+ var li = (t, e) => new DataView(t.buffer, t.byteOffset + e), et = (t, e = 0) => li(t, e).getUint32(0, !0), ci = {
2407
+ validate: (t) => et(t, 0) === 542327876,
2408
+ calculate: (t) => ({
2409
+ height: et(t, 12),
2410
+ width: et(t, 16)
2411
+ })
2412
+ }, di = new TextDecoder(), ui = (t, e = 0, n = t.length) => di.decode(t.slice(e, n)), fi = (t, e) => new DataView(t.buffer, t.byteOffset + e), Ht = (t, e = 0) => fi(t, e).getUint16(0, !0), hi = /^GIF8[79]a/, pi = {
2413
+ validate: (t) => hi.test(ui(t, 0, 6)),
2414
+ calculate: (t) => ({
2415
+ height: Ht(t, 8),
2416
+ width: Ht(t, 6)
2417
+ })
2418
+ }, gi = new TextDecoder(), Fe = (t, e = 0, n = t.length) => gi.decode(t.slice(e, n)), mi = (t, e) => new DataView(t.buffer, t.byteOffset + e), Ae = (t, e = 0) => mi(t, e).getUint32(0, !1);
2419
+ function wi(t, e) {
2420
+ if (t.length - e < 4) return;
2421
+ const n = Ae(t, e);
2422
+ if (!(t.length - e < n))
2423
+ return {
2424
+ name: Fe(t, 4 + e, 8 + e),
2425
+ offset: e,
2426
+ size: n
2368
2427
  };
2369
- function v(u, p, x, R) {
2370
- x = x || 0;
2371
- const K = R ? "BE" : "LE", m = "readUInt" + p + K;
2372
- return w[m](u, x);
2373
- }
2374
- t.readUInt = v;
2375
- function g(u, p) {
2376
- if (u.length - p < 4)
2377
- return;
2378
- const x = (0, t.readUInt32BE)(u, p);
2379
- if (!(u.length - p < x))
2380
- return {
2381
- name: (0, t.toUTF8String)(u, 4 + p, 8 + p),
2382
- offset: p,
2383
- size: x
2384
- };
2385
- }
2386
- function d(u, p, x) {
2387
- for (; x < u.length; ) {
2388
- const R = g(u, x);
2389
- if (!R)
2390
- break;
2391
- if (R.name === p)
2392
- return R;
2393
- x += R.size > 0 ? R.size : 8;
2428
+ }
2429
+ function me(t, e, n) {
2430
+ for (; n < t.length; ) {
2431
+ const r = wi(t, n);
2432
+ if (!r) break;
2433
+ if (r.name === e) return r;
2434
+ n += r.size > 0 ? r.size : 8;
2435
+ }
2436
+ }
2437
+ var vi = {
2438
+ avif: "avif",
2439
+ mif1: "heif",
2440
+ msf1: "heif",
2441
+ // heif-sequence
2442
+ heic: "heic",
2443
+ heix: "heic",
2444
+ hevc: "heic",
2445
+ // heic-sequence
2446
+ hevx: "heic"
2447
+ // heic-sequence
2448
+ }, bi = {
2449
+ validate(t) {
2450
+ if (Fe(t, 4, 8) !== "ftyp") return !1;
2451
+ const n = me(t, "ftyp", 0);
2452
+ return n ? Fe(t, n.offset + 8, n.offset + 12) in vi : !1;
2453
+ },
2454
+ calculate(t) {
2455
+ const e = me(t, "meta", 0), n = e && me(t, "iprp", e.offset + 12), r = n && me(t, "ipco", n.offset + 8);
2456
+ if (!r)
2457
+ throw new TypeError("Invalid HEIF, no ipco box found");
2458
+ const i = Fe(t, 8, 12), s = [];
2459
+ let l = r.offset + 8;
2460
+ for (; l < r.offset + r.size; ) {
2461
+ const a = me(t, "ispe", l);
2462
+ if (!a) break;
2463
+ const c = Ae(t, a.offset + 12), u = Ae(t, a.offset + 16), o = me(t, "clap", l);
2464
+ let w = c, b = u;
2465
+ if (o && o.offset < r.offset + r.size) {
2466
+ const f = Ae(t, o.offset + 12);
2467
+ w = c - f;
2394
2468
  }
2469
+ s.push({ height: b, width: w }), l = a.offset + a.size;
2395
2470
  }
2396
- t.findBox = d;
2397
- })(ot)), ot;
2398
- }
2399
- var Ft;
2400
- function Hr() {
2401
- if (Ft) return _e;
2402
- Ft = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.BMP = void 0;
2403
- const t = G();
2404
- return _e.BMP = {
2405
- validate: (e) => (0, t.toUTF8String)(e, 0, 2) === "BM",
2406
- calculate: (e) => ({
2407
- height: Math.abs((0, t.readInt32LE)(e, 22)),
2408
- width: (0, t.readUInt32LE)(e, 18)
2409
- })
2410
- }, _e;
2411
- }
2412
- var Gr = Hr();
2413
- const Qr = /* @__PURE__ */ H(Gr);
2414
- var Ce = {}, Te = {}, At;
2415
- function fn() {
2416
- if (At) return Te;
2417
- At = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.ICO = void 0;
2418
- const t = G(), e = 1, n = 6, r = 16;
2419
- function i(l, a) {
2420
- const c = l[a];
2421
- return c === 0 ? 256 : c;
2471
+ if (s.length === 0)
2472
+ throw new TypeError("Invalid HEIF, no sizes found");
2473
+ return {
2474
+ width: s[0].width,
2475
+ height: s[0].height,
2476
+ type: i,
2477
+ ...s.length > 1 ? { images: s } : {}
2478
+ };
2422
2479
  }
2423
- function s(l, a) {
2424
- const c = n + a * r;
2480
+ }, yi = new TextDecoder(), hn = (t, e = 0, n = t.length) => yi.decode(t.slice(e, n)), xi = (t, e) => new DataView(t.buffer, t.byteOffset + e), pn = (t, e = 0) => xi(t, e).getUint32(0, !1), ki = 8, Si = 4, Ei = 4, Ci = {
2481
+ ICON: 32,
2482
+ "ICN#": 32,
2483
+ // m => 16 x 16
2484
+ "icm#": 16,
2485
+ icm4: 16,
2486
+ icm8: 16,
2487
+ // s => 16 x 16
2488
+ "ics#": 16,
2489
+ ics4: 16,
2490
+ ics8: 16,
2491
+ is32: 16,
2492
+ s8mk: 16,
2493
+ icp4: 16,
2494
+ // l => 32 x 32
2495
+ icl4: 32,
2496
+ icl8: 32,
2497
+ il32: 32,
2498
+ l8mk: 32,
2499
+ icp5: 32,
2500
+ ic11: 32,
2501
+ // h => 48 x 48
2502
+ ich4: 48,
2503
+ ich8: 48,
2504
+ ih32: 48,
2505
+ h8mk: 48,
2506
+ // . => 64 x 64
2507
+ icp6: 64,
2508
+ ic12: 32,
2509
+ // t => 128 x 128
2510
+ it32: 128,
2511
+ t8mk: 128,
2512
+ ic07: 128,
2513
+ // . => 256 x 256
2514
+ ic08: 256,
2515
+ ic13: 256,
2516
+ // . => 512 x 512
2517
+ ic09: 512,
2518
+ ic14: 512,
2519
+ // . => 1024 x 1024
2520
+ ic10: 1024
2521
+ };
2522
+ function Ii(t, e) {
2523
+ const n = e + Ei;
2524
+ return [
2525
+ hn(t, e, n),
2526
+ pn(t, n)
2527
+ ];
2528
+ }
2529
+ function _i(t) {
2530
+ const e = Ci[t];
2531
+ return { width: e, height: e, type: t };
2532
+ }
2533
+ var Ti = {
2534
+ validate: (t) => hn(t, 0, 4) === "icns",
2535
+ calculate(t) {
2536
+ const e = t.length, n = pn(t, Si);
2537
+ let r = ki;
2538
+ const i = [];
2539
+ for (; r < n && r < e; ) {
2540
+ const s = Ii(t, r), l = _i(s[0]);
2541
+ i.push(l), r += s[1];
2542
+ }
2543
+ if (i.length === 0)
2544
+ throw new TypeError("Invalid ICNS, no sizes found");
2425
2545
  return {
2426
- height: i(l, c + 1),
2427
- width: i(l, c)
2546
+ width: i[0].width,
2547
+ height: i[0].height,
2548
+ ...i.length > 1 ? { images: i } : {}
2428
2549
  };
2429
2550
  }
2430
- return Te.ICO = {
2431
- validate(l) {
2432
- const a = (0, t.readUInt16LE)(l, 0), c = (0, t.readUInt16LE)(l, 4);
2433
- return a !== 0 || c === 0 ? !1 : (0, t.readUInt16LE)(l, 2) === e;
2434
- },
2435
- calculate(l) {
2436
- const a = (0, t.readUInt16LE)(l, 4), c = s(l, 0);
2437
- if (a === 1)
2438
- return c;
2439
- const h = [c];
2440
- for (let o = 1; o < a; o += 1)
2441
- h.push(s(l, o));
2442
- return {
2443
- height: c.height,
2444
- images: h,
2445
- width: c.width
2446
- };
2447
- }
2448
- }, Te;
2449
- }
2450
- var zt;
2451
- function Kr() {
2452
- if (zt) return Ce;
2453
- zt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.CUR = void 0;
2454
- const t = fn(), e = G(), n = 2;
2455
- return Ce.CUR = {
2456
- validate(r) {
2457
- const i = (0, e.readUInt16LE)(r, 0), s = (0, e.readUInt16LE)(r, 4);
2458
- return i !== 0 || s === 0 ? !1 : (0, e.readUInt16LE)(r, 2) === n;
2459
- },
2460
- calculate: (r) => t.ICO.calculate(r)
2461
- }, Ce;
2462
- }
2463
- var Jr = Kr();
2464
- const Yr = /* @__PURE__ */ H(Jr);
2465
- var Pe = {}, Wt;
2466
- function Xr() {
2467
- if (Wt) return Pe;
2468
- Wt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.DDS = void 0;
2469
- const t = G();
2470
- return Pe.DDS = {
2471
- validate: (e) => (0, t.readUInt32LE)(e, 0) === 542327876,
2472
- calculate: (e) => ({
2473
- height: (0, t.readUInt32LE)(e, 12),
2474
- width: (0, t.readUInt32LE)(e, 16)
2475
- })
2476
- }, Pe;
2477
- }
2478
- var Zr = Xr();
2479
- const Vr = /* @__PURE__ */ H(Zr);
2480
- var Ne = {}, Ht;
2481
- function ei() {
2482
- if (Ht) return Ne;
2483
- Ht = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.GIF = void 0;
2484
- const t = G(), e = /^GIF8[79]a/;
2485
- return Ne.GIF = {
2486
- validate: (n) => e.test((0, t.toUTF8String)(n, 0, 6)),
2487
- calculate: (n) => ({
2488
- height: (0, t.readUInt16LE)(n, 8),
2489
- width: (0, t.readUInt16LE)(n, 6)
2490
- })
2491
- }, Ne;
2492
- }
2493
- var ti = ei();
2494
- const ni = /* @__PURE__ */ H(ti);
2495
- var De = {}, Gt;
2496
- function ri() {
2497
- if (Gt) return De;
2498
- Gt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.ICNS = void 0;
2499
- const t = G(), e = 8, n = 4, r = 4, i = {
2500
- ICON: 32,
2501
- "ICN#": 32,
2502
- // m => 16 x 16
2503
- "icm#": 16,
2504
- icm4: 16,
2505
- icm8: 16,
2506
- // s => 16 x 16
2507
- "ics#": 16,
2508
- ics4: 16,
2509
- ics8: 16,
2510
- is32: 16,
2511
- s8mk: 16,
2512
- icp4: 16,
2513
- // l => 32 x 32
2514
- icl4: 32,
2515
- icl8: 32,
2516
- il32: 32,
2517
- l8mk: 32,
2518
- icp5: 32,
2519
- ic11: 32,
2520
- // h => 48 x 48
2521
- ich4: 48,
2522
- ich8: 48,
2523
- ih32: 48,
2524
- h8mk: 48,
2525
- // . => 64 x 64
2526
- icp6: 64,
2527
- ic12: 32,
2528
- // t => 128 x 128
2529
- it32: 128,
2530
- t8mk: 128,
2531
- ic07: 128,
2532
- // . => 256 x 256
2533
- ic08: 256,
2534
- ic13: 256,
2535
- // . => 512 x 512
2536
- ic09: 512,
2537
- ic14: 512,
2538
- // . => 1024 x 1024
2539
- ic10: 1024
2551
+ };
2552
+ new TextDecoder();
2553
+ var $i = (t, e) => new DataView(t.buffer, t.byteOffset + e), Re = (t, e = 0) => $i(t, e).getUint16(0, !0), Di = 1, Ni = 6, Oi = 16;
2554
+ function Qt(t, e) {
2555
+ const n = t[e];
2556
+ return n === 0 ? 256 : n;
2557
+ }
2558
+ function Gt(t, e) {
2559
+ const n = Ni + e * Oi;
2560
+ return {
2561
+ height: Qt(t, n + 1),
2562
+ width: Qt(t, n)
2540
2563
  };
2541
- function s(a, c) {
2542
- const h = c + r;
2543
- return [
2544
- (0, t.toUTF8String)(a, c, h),
2545
- (0, t.readUInt32BE)(a, h)
2546
- ];
2547
- }
2548
- function l(a) {
2549
- const c = i[a];
2550
- return { width: c, height: c, type: a };
2551
- }
2552
- return De.ICNS = {
2553
- validate: (a) => (0, t.toUTF8String)(a, 0, 4) === "icns",
2554
- calculate(a) {
2555
- const c = a.length, h = (0, t.readUInt32BE)(a, n);
2556
- let o = e, w = s(a, o), v = l(w[0]);
2557
- if (o += w[1], o === h)
2558
- return v;
2559
- const g = {
2560
- height: v.height,
2561
- images: [v],
2562
- width: v.width
2563
- };
2564
- for (; o < h && o < c; )
2565
- w = s(a, o), v = l(w[0]), o += w[1], g.images.push(v);
2566
- return g;
2567
- }
2568
- }, De;
2569
- }
2570
- var ii = ri();
2571
- const oi = /* @__PURE__ */ H(ii);
2572
- var si = fn();
2573
- const ai = /* @__PURE__ */ H(si);
2574
- var Re = {}, Qt;
2575
- function li() {
2576
- if (Qt) return Re;
2577
- Qt = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.J2C = void 0;
2578
- const t = G();
2579
- return Re.J2C = {
2580
- // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
2581
- validate: (e) => (0, t.readUInt32BE)(e, 0) === 4283432785,
2582
- calculate: (e) => ({
2583
- height: (0, t.readUInt32BE)(e, 12),
2584
- width: (0, t.readUInt32BE)(e, 8)
2585
- })
2586
- }, Re;
2587
- }
2588
- var ci = li();
2589
- const di = /* @__PURE__ */ H(ci);
2590
- var Le = {}, Kt;
2591
- function ui() {
2592
- if (Kt) return Le;
2593
- Kt = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.JP2 = void 0;
2594
- const t = G();
2595
- return Le.JP2 = {
2596
- validate(e) {
2597
- if ((0, t.toUTF8String)(e, 4, 8) !== "jP ")
2598
- return !1;
2599
- const r = (0, t.findBox)(e, "ftyp", 0);
2600
- return r ? (0, t.toUTF8String)(e, r.offset + 8, r.offset + 12) === "jp2 " : !1;
2601
- },
2602
- calculate(e) {
2603
- const n = (0, t.findBox)(e, "jp2h", 0), r = n && (0, t.findBox)(e, "ihdr", n.offset + 8);
2604
- if (r)
2605
- return {
2606
- height: (0, t.readUInt32BE)(e, r.offset + 8),
2607
- width: (0, t.readUInt32BE)(e, r.offset + 12)
2608
- };
2609
- throw new TypeError("Unsupported JPEG 2000 format");
2610
- }
2611
- }, Le;
2612
2564
  }
2613
- var fi = ui();
2614
- const hi = /* @__PURE__ */ H(fi);
2615
- var Oe = {}, Jt;
2616
- function pi() {
2617
- if (Jt) return Oe;
2618
- Jt = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.JPG = void 0;
2619
- const t = G(), e = "45786966", n = 2, r = 6, i = 2, s = "4d4d", l = "4949", a = 12, c = 2;
2620
- function h(d) {
2621
- return (0, t.toHexString)(d, 2, 6) === e;
2622
- }
2623
- function o(d, u) {
2565
+ var Pi = {
2566
+ validate(t) {
2567
+ const e = Re(t, 0), n = Re(t, 4);
2568
+ return e !== 0 || n === 0 ? !1 : Re(t, 2) === Di;
2569
+ },
2570
+ calculate(t) {
2571
+ const e = Re(t, 4), n = Gt(t, 0);
2572
+ if (e === 1) return n;
2573
+ const r = [];
2574
+ for (let i = 0; i < e; i += 1)
2575
+ r.push(Gt(t, i));
2624
2576
  return {
2625
- height: (0, t.readUInt16BE)(d, u),
2626
- width: (0, t.readUInt16BE)(d, u + 2)
2577
+ width: n.width,
2578
+ height: n.height,
2579
+ images: r
2627
2580
  };
2628
2581
  }
2629
- function w(d, u) {
2630
- const x = r + 8, R = (0, t.readUInt)(d, 16, x, u);
2631
- for (let K = 0; K < R; K++) {
2632
- const m = x + c + K * a, b = m + a;
2633
- if (m > d.length)
2634
- return;
2635
- const C = d.slice(m, b);
2636
- if ((0, t.readUInt)(C, 16, 0, u) === 274)
2637
- return (0, t.readUInt)(C, 16, 2, u) !== 3 || (0, t.readUInt)(C, 32, 4, u) !== 1 ? void 0 : (0, t.readUInt)(C, 16, 8, u);
2638
- }
2639
- }
2640
- function v(d, u) {
2641
- const p = d.slice(n, u), x = (0, t.toHexString)(p, r, r + i), R = x === s;
2642
- if (R || x === l)
2643
- return w(p, R);
2644
- }
2645
- function g(d, u) {
2646
- if (u > d.length)
2647
- throw new TypeError("Corrupt JPG, exceeded buffer limits");
2648
- }
2649
- return Oe.JPG = {
2650
- validate: (d) => (0, t.toHexString)(d, 0, 2) === "ffd8",
2651
- calculate(d) {
2652
- d = d.slice(4);
2653
- let u, p;
2654
- for (; d.length; ) {
2655
- const x = (0, t.readUInt16BE)(d, 0);
2656
- if (d[x] !== 255) {
2657
- d = d.slice(1);
2658
- continue;
2659
- }
2660
- if (h(d) && (u = v(d, x)), g(d, x), p = d[x + 1], p === 192 || p === 193 || p === 194) {
2661
- const R = o(d, x + 5);
2662
- return u ? {
2663
- height: R.height,
2664
- orientation: u,
2665
- width: R.width
2666
- } : R;
2667
- }
2668
- d = d.slice(x + 2);
2669
- }
2670
- throw new TypeError("Invalid JPG, no size found");
2671
- }
2672
- }, Oe;
2673
- }
2674
- var gi = pi();
2675
- const mi = /* @__PURE__ */ H(gi);
2676
- var Me = {}, Yt;
2677
- function vi() {
2678
- if (Yt) return Me;
2679
- Yt = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.KTX = void 0;
2680
- const t = G();
2681
- return Me.KTX = {
2682
- validate: (e) => {
2683
- const n = (0, t.toUTF8String)(e, 1, 7);
2684
- return ["KTX 11", "KTX 20"].includes(n);
2685
- },
2686
- calculate: (e) => {
2687
- const n = e[5] === 49 ? "ktx" : "ktx2", r = n === "ktx" ? 36 : 20;
2582
+ };
2583
+ new TextDecoder();
2584
+ var Ri = (t, e) => new DataView(t.buffer, t.byteOffset + e), tt = (t, e = 0) => Ri(t, e).getUint32(0, !1), Li = {
2585
+ // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
2586
+ validate: (t) => tt(t, 0) === 4283432785,
2587
+ calculate: (t) => ({
2588
+ height: tt(t, 12),
2589
+ width: tt(t, 8)
2590
+ })
2591
+ }, Mi = new TextDecoder(), ft = (t, e = 0, n = t.length) => Mi.decode(t.slice(e, n)), ji = (t, e) => new DataView(t.buffer, t.byteOffset + e), ht = (t, e = 0) => ji(t, e).getUint32(0, !1);
2592
+ function qi(t, e) {
2593
+ if (t.length - e < 4) return;
2594
+ const n = ht(t, e);
2595
+ if (!(t.length - e < n))
2596
+ return {
2597
+ name: ft(t, 4 + e, 8 + e),
2598
+ offset: e,
2599
+ size: n
2600
+ };
2601
+ }
2602
+ function nt(t, e, n) {
2603
+ for (; n < t.length; ) {
2604
+ const r = qi(t, n);
2605
+ if (!r) break;
2606
+ if (r.name === e) return r;
2607
+ n += r.size > 0 ? r.size : 8;
2608
+ }
2609
+ }
2610
+ var zi = {
2611
+ validate(t) {
2612
+ if (ft(t, 4, 8) !== "jP ") return !1;
2613
+ const n = nt(t, "ftyp", 0);
2614
+ return n ? ft(t, n.offset + 8, n.offset + 12) === "jp2 " : !1;
2615
+ },
2616
+ calculate(t) {
2617
+ const e = nt(t, "jp2h", 0), n = e && nt(t, "ihdr", e.offset + 8);
2618
+ if (n)
2688
2619
  return {
2689
- height: (0, t.readUInt32LE)(e, r + 4),
2690
- width: (0, t.readUInt32LE)(e, r),
2691
- type: n
2620
+ height: ht(t, n.offset + 8),
2621
+ width: ht(t, n.offset + 12)
2692
2622
  };
2693
- }
2694
- }, Me;
2623
+ throw new TypeError("Unsupported JPEG 2000 format");
2624
+ }
2625
+ };
2626
+ new TextDecoder();
2627
+ var mt = (t, e = 0, n = t.length) => t.slice(e, n).reduce((r, i) => r + `0${i.toString(16)}`.slice(-2), ""), Ve = (t, e) => new DataView(t.buffer, t.byteOffset + e), Qe = (t, e = 0) => Ve(t, e).getUint16(0, !1), Fi = (t, e = 0) => Ve(t, e).getUint16(0, !0), Ai = (t, e = 0) => Ve(t, e).getUint32(0, !1), Ui = (t, e = 0) => Ve(t, e).getUint32(0, !0), Bi = {
2628
+ readUInt16BE: Qe,
2629
+ readUInt16LE: Fi,
2630
+ readUInt32BE: Ai,
2631
+ readUInt32LE: Ui
2632
+ };
2633
+ function Ce(t, e, n = 0, r = !1) {
2634
+ const s = `readUInt${e}${r ? "BE" : "LE"}`;
2635
+ return Bi[s](t, n);
2695
2636
  }
2696
- var wi = vi();
2697
- const yi = /* @__PURE__ */ H(wi);
2698
- var $e = {}, Xt;
2699
- function bi() {
2700
- if (Xt) return $e;
2701
- Xt = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.PNG = void 0;
2702
- const t = G(), e = `PNG\r
2703
- 
2704
- `, n = "IHDR", r = "CgBI";
2705
- return $e.PNG = {
2706
- validate(i) {
2707
- if (e === (0, t.toUTF8String)(i, 1, 8)) {
2708
- let s = (0, t.toUTF8String)(i, 12, 16);
2709
- if (s === r && (s = (0, t.toUTF8String)(i, 28, 32)), s !== n)
2710
- throw new TypeError("Invalid PNG");
2711
- return !0;
2637
+ var Wi = "45786966", Hi = 2, pt = 6, Qi = 2, Gi = "4d4d", Ki = "4949", Kt = 12, Vi = 2;
2638
+ function Ji(t) {
2639
+ return mt(t, 2, 6) === Wi;
2640
+ }
2641
+ function Yi(t, e) {
2642
+ return {
2643
+ height: Qe(t, e),
2644
+ width: Qe(t, e + 2)
2645
+ };
2646
+ }
2647
+ function Xi(t, e) {
2648
+ const r = pt + 8, i = Ce(t, 16, r, e);
2649
+ for (let s = 0; s < i; s++) {
2650
+ const l = r + Vi + s * Kt, a = l + Kt;
2651
+ if (l > t.length)
2652
+ return;
2653
+ const c = t.slice(l, a);
2654
+ if (Ce(c, 16, 0, e) === 274)
2655
+ return Ce(c, 16, 2, e) !== 3 || Ce(c, 32, 4, e) !== 1 ? void 0 : Ce(c, 16, 8, e);
2656
+ }
2657
+ }
2658
+ function Zi(t, e) {
2659
+ const n = t.slice(Hi, e), r = mt(
2660
+ n,
2661
+ pt,
2662
+ pt + Qi
2663
+ ), i = r === Gi;
2664
+ if (i || r === Ki)
2665
+ return Xi(n, i);
2666
+ }
2667
+ function eo(t, e) {
2668
+ if (e > t.length)
2669
+ throw new TypeError("Corrupt JPG, exceeded buffer limits");
2670
+ }
2671
+ var to = {
2672
+ validate: (t) => mt(t, 0, 2) === "ffd8",
2673
+ calculate(t) {
2674
+ let e = t.slice(4), n, r;
2675
+ for (; e.length; ) {
2676
+ const i = Qe(e, 0);
2677
+ if (eo(e, i), e[i] !== 255) {
2678
+ e = e.slice(1);
2679
+ continue;
2712
2680
  }
2713
- return !1;
2714
- },
2715
- calculate(i) {
2716
- return (0, t.toUTF8String)(i, 12, 16) === r ? {
2717
- height: (0, t.readUInt32BE)(i, 36),
2718
- width: (0, t.readUInt32BE)(i, 32)
2719
- } : {
2720
- height: (0, t.readUInt32BE)(i, 20),
2721
- width: (0, t.readUInt32BE)(i, 16)
2722
- };
2723
- }
2724
- }, $e;
2725
- }
2726
- var xi = bi();
2727
- const Si = /* @__PURE__ */ H(xi);
2728
- var je = {}, Zt;
2729
- function ki() {
2730
- if (Zt) return je;
2731
- Zt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.PNM = void 0;
2732
- const t = G(), e = {
2733
- P1: "pbm/ascii",
2734
- P2: "pgm/ascii",
2735
- P3: "ppm/ascii",
2736
- P4: "pbm",
2737
- P5: "pgm",
2738
- P6: "ppm",
2739
- P7: "pam",
2740
- PF: "pfm"
2741
- }, n = {
2742
- default: (r) => {
2743
- let i = [];
2744
- for (; r.length > 0; ) {
2745
- const s = r.shift();
2746
- if (s[0] !== "#") {
2747
- i = s.split(" ");
2748
- break;
2749
- }
2681
+ if (Ji(e) && (n = Zi(e, i)), r = e[i + 1], r === 192 || r === 193 || r === 194) {
2682
+ const s = Yi(e, i + 5);
2683
+ return n ? {
2684
+ height: s.height,
2685
+ orientation: n,
2686
+ width: s.width
2687
+ } : s;
2750
2688
  }
2751
- if (i.length === 2)
2752
- return {
2753
- height: parseInt(i[1], 10),
2754
- width: parseInt(i[0], 10)
2755
- };
2756
- throw new TypeError("Invalid PNM");
2757
- },
2758
- pam: (r) => {
2759
- const i = {};
2760
- for (; r.length > 0; ) {
2761
- const s = r.shift();
2762
- if (s.length > 16 || s.charCodeAt(0) > 128)
2763
- continue;
2764
- const [l, a] = s.split(" ");
2765
- if (l && a && (i[l.toLowerCase()] = parseInt(a, 10)), i.height && i.width)
2766
- break;
2767
- }
2768
- if (i.height && i.width)
2769
- return {
2770
- height: i.height,
2771
- width: i.width
2772
- };
2773
- throw new TypeError("Invalid PAM");
2689
+ e = e.slice(i + 2);
2774
2690
  }
2775
- };
2776
- return je.PNM = {
2777
- validate: (r) => (0, t.toUTF8String)(r, 0, 2) in e,
2778
- calculate(r) {
2779
- const i = (0, t.toUTF8String)(r, 0, 2), s = e[i], l = (0, t.toUTF8String)(r, 3).split(/[\r\n]+/);
2780
- return (n[s] || n.default)(l);
2781
- }
2782
- }, je;
2783
- }
2784
- var Ei = ki();
2785
- const Ii = /* @__PURE__ */ H(Ei);
2786
- var qe = {}, Vt;
2787
- function _i() {
2788
- if (Vt) return qe;
2789
- Vt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.PSD = void 0;
2790
- const t = G();
2791
- return qe.PSD = {
2792
- validate: (e) => (0, t.toUTF8String)(e, 0, 4) === "8BPS",
2793
- calculate: (e) => ({
2794
- height: (0, t.readUInt32BE)(e, 14),
2795
- width: (0, t.readUInt32BE)(e, 18)
2796
- })
2797
- }, qe;
2798
- }
2799
- var Ci = _i();
2800
- const Ti = /* @__PURE__ */ H(Ci);
2801
- var Ue = {}, en;
2802
- function Pi() {
2803
- if (en) return Ue;
2804
- en = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.SVG = void 0;
2805
- const t = G(), e = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, n = {
2806
- height: /\sheight=(['"])([^%]+?)\1/,
2807
- root: e,
2808
- viewbox: /\sviewBox=(['"])(.+?)\1/i,
2809
- width: /\swidth=(['"])([^%]+?)\1/
2810
- }, r = 2.54, i = {
2811
- in: 96,
2812
- cm: 96 / r,
2813
- em: 16,
2814
- ex: 8,
2815
- m: 96 / r * 100,
2816
- mm: 96 / r / 10,
2817
- pc: 96 / 72 / 12,
2818
- pt: 96 / 72,
2819
- px: 1
2820
- }, s = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(i).join("|")})?$`);
2821
- function l(w) {
2822
- const v = s.exec(w);
2823
- if (v)
2824
- return Math.round(Number(v[1]) * (i[v[2]] || 1));
2825
- }
2826
- function a(w) {
2827
- const v = w.split(" ");
2828
- return {
2829
- height: l(v[3]),
2830
- width: l(v[2])
2831
- };
2691
+ throw new TypeError("Invalid JPG, no size found");
2832
2692
  }
2833
- function c(w) {
2834
- const v = w.match(n.width), g = w.match(n.height), d = w.match(n.viewbox);
2693
+ }, no = new TextDecoder(), ro = (t, e = 0, n = t.length) => no.decode(t.slice(e, n)), io = (t, e) => new DataView(t.buffer, t.byteOffset + e), Vt = (t, e = 0) => io(t, e).getUint32(0, !0), oo = {
2694
+ validate: (t) => {
2695
+ const e = ro(t, 1, 7);
2696
+ return ["KTX 11", "KTX 20"].includes(e);
2697
+ },
2698
+ calculate: (t) => {
2699
+ const e = t[5] === 49 ? "ktx" : "ktx2", n = e === "ktx" ? 36 : 20;
2835
2700
  return {
2836
- height: g && l(g[2]),
2837
- viewbox: d && a(d[2]),
2838
- width: v && l(v[2])
2701
+ height: Vt(t, n + 4),
2702
+ width: Vt(t, n),
2703
+ type: e
2839
2704
  };
2840
2705
  }
2841
- function h(w) {
2842
- return {
2843
- height: w.height,
2844
- width: w.width
2845
- };
2846
- }
2847
- function o(w, v) {
2848
- const g = v.width / v.height;
2849
- return w.width ? {
2850
- height: Math.floor(w.width / g),
2851
- width: w.width
2852
- } : w.height ? {
2853
- height: w.height,
2854
- width: Math.floor(w.height * g)
2706
+ }, so = new TextDecoder(), Le = (t, e = 0, n = t.length) => so.decode(t.slice(e, n)), ao = (t, e) => new DataView(t.buffer, t.byteOffset + e), Me = (t, e = 0) => ao(t, e).getUint32(0, !1), lo = `PNG\r
2707
+ 
2708
+ `, co = "IHDR", Jt = "CgBI", uo = {
2709
+ validate(t) {
2710
+ if (lo === Le(t, 1, 8)) {
2711
+ let e = Le(t, 12, 16);
2712
+ if (e === Jt && (e = Le(t, 28, 32)), e !== co)
2713
+ throw new TypeError("Invalid PNG");
2714
+ return !0;
2715
+ }
2716
+ return !1;
2717
+ },
2718
+ calculate(t) {
2719
+ return Le(t, 12, 16) === Jt ? {
2720
+ height: Me(t, 36),
2721
+ width: Me(t, 32)
2855
2722
  } : {
2856
- height: v.height,
2857
- width: v.width
2723
+ height: Me(t, 20),
2724
+ width: Me(t, 16)
2858
2725
  };
2859
2726
  }
2860
- return Ue.SVG = {
2861
- // Scan only the first kilo-byte to speed up the check on larger files
2862
- validate: (w) => e.test((0, t.toUTF8String)(w, 0, 1e3)),
2863
- calculate(w) {
2864
- const v = (0, t.toUTF8String)(w).match(n.root);
2865
- if (v) {
2866
- const g = c(v[0]);
2867
- if (g.width && g.height)
2868
- return h(g);
2869
- if (g.viewbox)
2870
- return o(g, g.viewbox);
2727
+ }, fo = new TextDecoder(), rt = (t, e = 0, n = t.length) => fo.decode(t.slice(e, n)), Yt = {
2728
+ P1: "pbm/ascii",
2729
+ P2: "pgm/ascii",
2730
+ P3: "ppm/ascii",
2731
+ P4: "pbm",
2732
+ P5: "pgm",
2733
+ P6: "ppm",
2734
+ P7: "pam",
2735
+ PF: "pfm"
2736
+ }, Xt = {
2737
+ default: (t) => {
2738
+ let e = [];
2739
+ for (; t.length > 0; ) {
2740
+ const n = t.shift();
2741
+ if (n[0] !== "#") {
2742
+ e = n.split(" ");
2743
+ break;
2871
2744
  }
2872
- throw new TypeError("Invalid SVG");
2873
- }
2874
- }, Ue;
2875
- }
2876
- var Ni = Pi();
2877
- const Di = /* @__PURE__ */ H(Ni);
2878
- var Be = {}, tn;
2879
- function Ri() {
2880
- if (tn) return Be;
2881
- tn = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.TGA = void 0;
2882
- const t = G();
2883
- return Be.TGA = {
2884
- validate(e) {
2885
- return (0, t.readUInt16LE)(e, 0) === 0 && (0, t.readUInt16LE)(e, 4) === 0;
2886
- },
2887
- calculate(e) {
2745
+ }
2746
+ if (e.length === 2)
2888
2747
  return {
2889
- height: (0, t.readUInt16LE)(e, 14),
2890
- width: (0, t.readUInt16LE)(e, 12)
2748
+ height: Number.parseInt(e[1], 10),
2749
+ width: Number.parseInt(e[0], 10)
2891
2750
  };
2751
+ throw new TypeError("Invalid PNM");
2752
+ },
2753
+ pam: (t) => {
2754
+ const e = {};
2755
+ for (; t.length > 0; ) {
2756
+ const n = t.shift();
2757
+ if (n.length > 16 || n.charCodeAt(0) > 128)
2758
+ continue;
2759
+ const [r, i] = n.split(" ");
2760
+ if (r && i && (e[r.toLowerCase()] = Number.parseInt(i, 10)), e.height && e.width)
2761
+ break;
2892
2762
  }
2893
- }, Be;
2763
+ if (e.height && e.width)
2764
+ return {
2765
+ height: e.height,
2766
+ width: e.width
2767
+ };
2768
+ throw new TypeError("Invalid PAM");
2769
+ }
2770
+ }, ho = {
2771
+ validate: (t) => rt(t, 0, 2) in Yt,
2772
+ calculate(t) {
2773
+ const e = rt(t, 0, 2), n = Yt[e], r = rt(t, 3).split(/[\r\n]+/);
2774
+ return (Xt[n] || Xt.default)(r);
2775
+ }
2776
+ }, po = new TextDecoder(), go = (t, e = 0, n = t.length) => po.decode(t.slice(e, n)), mo = (t, e) => new DataView(t.buffer, t.byteOffset + e), Zt = (t, e = 0) => mo(t, e).getUint32(0, !1), wo = {
2777
+ validate: (t) => go(t, 0, 4) === "8BPS",
2778
+ calculate: (t) => ({
2779
+ height: Zt(t, 14),
2780
+ width: Zt(t, 18)
2781
+ })
2782
+ }, vo = new TextDecoder(), en = (t, e = 0, n = t.length) => vo.decode(t.slice(e, n)), gn = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, Ue = {
2783
+ height: /\sheight=(['"])([^%]+?)\1/,
2784
+ root: gn,
2785
+ viewbox: /\sviewBox=(['"])(.+?)\1/i,
2786
+ width: /\swidth=(['"])([^%]+?)\1/
2787
+ }, it = 2.54, mn = {
2788
+ in: 96,
2789
+ cm: 96 / it,
2790
+ em: 16,
2791
+ ex: 8,
2792
+ m: 96 / it * 100,
2793
+ mm: 96 / it / 10,
2794
+ pc: 96 / 72 / 12,
2795
+ pt: 96 / 72,
2796
+ px: 1
2797
+ }, bo = new RegExp(
2798
+ `^([0-9.]+(?:e\\d+)?)(${Object.keys(mn).join("|")})?$`
2799
+ );
2800
+ function Ge(t) {
2801
+ const e = bo.exec(t);
2802
+ if (e)
2803
+ return Math.round(Number(e[1]) * (mn[e[2]] || 1));
2894
2804
  }
2895
- var Li = Ri();
2896
- const Oi = /* @__PURE__ */ H(Li);
2897
- var Fe = {}, nn;
2898
- function Mi() {
2899
- if (nn) return Fe;
2900
- nn = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.WEBP = void 0;
2901
- const t = G();
2902
- function e(i) {
2903
- return {
2904
- height: 1 + (0, t.readUInt24LE)(i, 7),
2905
- width: 1 + (0, t.readUInt24LE)(i, 4)
2906
- };
2907
- }
2908
- function n(i) {
2909
- return {
2910
- height: 1 + ((i[4] & 15) << 10 | i[3] << 2 | (i[2] & 192) >> 6),
2911
- width: 1 + ((i[2] & 63) << 8 | i[1])
2912
- };
2805
+ function yo(t) {
2806
+ const e = t.split(" ");
2807
+ return {
2808
+ height: Ge(e[3]),
2809
+ width: Ge(e[2])
2810
+ };
2811
+ }
2812
+ function xo(t) {
2813
+ const e = t.match(Ue.width), n = t.match(Ue.height), r = t.match(Ue.viewbox);
2814
+ return {
2815
+ height: n && Ge(n[2]),
2816
+ viewbox: r && yo(r[2]),
2817
+ width: e && Ge(e[2])
2818
+ };
2819
+ }
2820
+ function ko(t) {
2821
+ return {
2822
+ height: t.height,
2823
+ width: t.width
2824
+ };
2825
+ }
2826
+ function So(t, e) {
2827
+ const n = e.width / e.height;
2828
+ return t.width ? {
2829
+ height: Math.floor(t.width / n),
2830
+ width: t.width
2831
+ } : t.height ? {
2832
+ height: t.height,
2833
+ width: Math.floor(t.height * n)
2834
+ } : {
2835
+ height: e.height,
2836
+ width: e.width
2837
+ };
2838
+ }
2839
+ var Eo = {
2840
+ // Scan only the first kilo-byte to speed up the check on larger files
2841
+ validate: (t) => gn.test(en(t, 0, 1e3)),
2842
+ calculate(t) {
2843
+ const e = en(t).match(Ue.root);
2844
+ if (e) {
2845
+ const n = xo(e[0]);
2846
+ if (n.width && n.height)
2847
+ return ko(n);
2848
+ if (n.viewbox)
2849
+ return So(n, n.viewbox);
2850
+ }
2851
+ throw new TypeError("Invalid SVG");
2913
2852
  }
2914
- function r(i) {
2853
+ };
2854
+ new TextDecoder();
2855
+ var Co = (t, e) => new DataView(t.buffer, t.byteOffset + e), je = (t, e = 0) => Co(t, e).getUint16(0, !0), Io = {
2856
+ validate(t) {
2857
+ return je(t, 0) === 0 && je(t, 4) === 0;
2858
+ },
2859
+ calculate(t) {
2915
2860
  return {
2916
- height: (0, t.readInt16LE)(i, 8) & 16383,
2917
- width: (0, t.readInt16LE)(i, 6) & 16383
2861
+ height: je(t, 14),
2862
+ width: je(t, 12)
2918
2863
  };
2919
2864
  }
2920
- return Fe.WEBP = {
2921
- validate(i) {
2922
- const s = (0, t.toUTF8String)(i, 0, 4) === "RIFF", l = (0, t.toUTF8String)(i, 8, 12) === "WEBP", a = (0, t.toUTF8String)(i, 12, 15) === "VP8";
2923
- return s && l && a;
2924
- },
2925
- calculate(i) {
2926
- const s = (0, t.toUTF8String)(i, 12, 16);
2927
- if (i = i.slice(20, 30), s === "VP8X") {
2928
- const a = i[0], c = (a & 192) === 0, h = (a & 1) === 0;
2929
- if (c && h)
2930
- return e(i);
2931
- throw new TypeError("Invalid WebP");
2932
- }
2933
- if (s === "VP8 " && i[0] !== 47)
2934
- return r(i);
2935
- const l = (0, t.toHexString)(i, 3, 6);
2936
- if (s === "VP8L" && l !== "9d012a")
2937
- return n(i);
2938
- throw new TypeError("Invalid WebP");
2939
- }
2940
- }, Fe;
2941
- }
2942
- var $i = Mi();
2943
- const ji = /* @__PURE__ */ H($i);
2944
- var Ae = {}, rn;
2945
- function qi() {
2946
- if (rn) return Ae;
2947
- rn = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.HEIF = void 0;
2948
- const t = G(), e = {
2949
- avif: "avif",
2950
- mif1: "heif",
2951
- msf1: "heif",
2952
- // heif-sequence
2953
- heic: "heic",
2954
- heix: "heic",
2955
- hevc: "heic",
2956
- // heic-sequence
2957
- hevx: "heic"
2958
- // heic-sequence
2865
+ }, _o = new TextDecoder(), qe = (t, e = 0, n = t.length) => _o.decode(t.slice(e, n)), To = (t, e = 0, n = t.length) => t.slice(e, n).reduce((r, i) => r + `0${i.toString(16)}`.slice(-2), ""), wn = (t, e) => new DataView(t.buffer, t.byteOffset + e), tn = (t, e = 0) => wn(t, e).getInt16(0, !0), nn = (t, e = 0) => {
2866
+ const n = wn(t, e);
2867
+ return n.getUint16(0, !0) + (n.getUint8(2) << 16);
2868
+ };
2869
+ function $o(t) {
2870
+ return {
2871
+ height: 1 + nn(t, 7),
2872
+ width: 1 + nn(t, 4)
2873
+ };
2874
+ }
2875
+ function Do(t) {
2876
+ return {
2877
+ height: 1 + ((t[4] & 15) << 10 | t[3] << 2 | (t[2] & 192) >> 6),
2878
+ width: 1 + ((t[2] & 63) << 8 | t[1])
2879
+ };
2880
+ }
2881
+ function No(t) {
2882
+ return {
2883
+ height: tn(t, 8) & 16383,
2884
+ width: tn(t, 6) & 16383
2959
2885
  };
2960
- return Ae.HEIF = {
2961
- validate(n) {
2962
- if ((0, t.toUTF8String)(n, 4, 8) !== "ftyp")
2963
- return !1;
2964
- const i = (0, t.findBox)(n, "ftyp", 0);
2965
- return i ? (0, t.toUTF8String)(n, i.offset + 8, i.offset + 12) in e : !1;
2966
- },
2967
- calculate(n) {
2968
- const r = (0, t.findBox)(n, "meta", 0), i = r && (0, t.findBox)(n, "iprp", r.offset + 12), s = i && (0, t.findBox)(n, "ipco", i.offset + 8), l = s && (0, t.findBox)(n, "ispe", s.offset + 8);
2969
- if (l)
2970
- return {
2971
- height: (0, t.readUInt32BE)(n, l.offset + 16),
2972
- width: (0, t.readUInt32BE)(n, l.offset + 12),
2973
- type: (0, t.toUTF8String)(n, 8, 12)
2974
- };
2975
- throw new TypeError("Invalid HEIF, no size found");
2976
- }
2977
- }, Ae;
2978
2886
  }
2979
- var Ui = qi();
2980
- const Bi = /* @__PURE__ */ H(Ui);
2981
- async function Fi(t, e) {
2887
+ var Oo = {
2888
+ validate(t) {
2889
+ const e = qe(t, 0, 4) === "RIFF", n = qe(t, 8, 12) === "WEBP", r = qe(t, 12, 15) === "VP8";
2890
+ return e && n && r;
2891
+ },
2892
+ calculate(t) {
2893
+ const e = qe(t, 12, 16), n = t.slice(20, 30);
2894
+ if (e === "VP8X") {
2895
+ const i = n[0], s = (i & 192) === 0, l = (i & 1) === 0;
2896
+ if (s && l)
2897
+ return $o(n);
2898
+ throw new TypeError("Invalid WebP");
2899
+ }
2900
+ if (e === "VP8 " && n[0] !== 47)
2901
+ return No(n);
2902
+ const r = To(n, 3, 6);
2903
+ if (e === "VP8L" && r !== "9d012a")
2904
+ return Do(n);
2905
+ throw new TypeError("Invalid WebP");
2906
+ }
2907
+ };
2908
+ async function Po(t, e) {
2982
2909
  const n = e;
2983
2910
  let r = n.loc;
2984
- if (!n.frame && !n.plugin && (r || (r = Yn(n)), r && (n.loc = r, r.file))) {
2911
+ if (!n.frame && !n.plugin && (r || (r = tr(n)), r && (n.loc = r, r.file))) {
2985
2912
  const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
2986
2913
  n.id = s(n.loc.file);
2987
2914
  try {
2988
2915
  const l = i.readFileSync(n.loc.file, "utf-8");
2989
- n.frame = Zn(l, n.loc);
2916
+ n.frame = rr(l, n.loc);
2990
2917
  } catch {
2991
2918
  }
2992
2919
  }
2993
2920
  return e;
2994
2921
  }
2995
- const Ai = {
2922
+ const Ro = {
2996
2923
  56: "psd",
2997
2924
  66: "bmp",
2998
2925
  68: "dds",
@@ -3001,38 +2928,38 @@ const Ai = {
3001
2928
  105: "icns",
3002
2929
  137: "png",
3003
2930
  255: "jpg"
3004
- }, et = {
3005
- webp: ji.WEBP,
3006
- jpg: mi.JPG,
3007
- png: Si.PNG,
3008
- svg: Di.SVG,
3009
- gif: ni.GIF,
3010
- avif: Bi.HEIF,
3011
- bmp: Qr.BMP,
3012
- cur: Yr.CUR,
3013
- dds: Vr.DDS,
3014
- icns: oi.ICNS,
3015
- ico: ai.ICO,
3016
- j2c: di.J2C,
3017
- jp2: hi.JP2,
3018
- ktx: yi.KTX,
3019
- pnm: Ii.PNM,
3020
- psd: Ti.PSD,
3021
- tga: Oi.TGA
3022
- }, zi = Object.keys(et);
3023
- function Wi(t) {
3024
- const e = t[0], n = Ai[e];
3025
- return n && et[n].validate(t) ? n : zi.find((r) => et[r].validate(t));
3026
- }
3027
- function Hi(t) {
3028
- const e = Wi(t);
2931
+ }, Ke = {
2932
+ webp: Oo,
2933
+ jpg: to,
2934
+ png: uo,
2935
+ svg: Eo,
2936
+ gif: pi,
2937
+ avif: bi,
2938
+ bmp: ei,
2939
+ cur: ai,
2940
+ dds: ci,
2941
+ icns: Ti,
2942
+ ico: Pi,
2943
+ j2c: Li,
2944
+ jp2: zi,
2945
+ ktx: oo,
2946
+ pnm: ho,
2947
+ psd: wo,
2948
+ tga: Io
2949
+ }, Lo = Object.keys(Ke);
2950
+ function Mo(t) {
2951
+ const e = t[0], n = Ro[e];
2952
+ return n && Ke[n].validate(t) ? n : Lo.find((r) => Ke[r].validate(t));
2953
+ }
2954
+ function jo(t) {
2955
+ const e = Mo(t);
3029
2956
  if (typeof e < "u") {
3030
- const n = et[e].calculate(t);
2957
+ const n = Ke[e].calculate(t);
3031
2958
  if (n !== void 0)
3032
2959
  return n.type = e, n;
3033
2960
  }
3034
2961
  }
3035
- async function Gi(t) {
2962
+ async function qo(t) {
3036
2963
  if (/^(https?|file|capacitor):/.test(t))
3037
2964
  try {
3038
2965
  const e = await fetch(t, {
@@ -3042,7 +2969,7 @@ async function Gi(t) {
3042
2969
  console.error("can not fetch", t);
3043
2970
  return;
3044
2971
  }
3045
- const n = await e.arrayBuffer(), r = Hi(Buffer.from(n));
2972
+ const n = await e.arrayBuffer(), r = jo(Buffer.from(n));
3046
2973
  if (r)
3047
2974
  return {
3048
2975
  width: r.width,
@@ -3055,7 +2982,7 @@ async function Gi(t) {
3055
2982
  return;
3056
2983
  }
3057
2984
  }
3058
- const Qi = (t, e, n) => async (r, i, s) => {
2985
+ const zo = (t, e, n) => async (r, i, s) => {
3059
2986
  try {
3060
2987
  const l = await t.dynamicImport("node:fs"), a = await t.dynamicImport("node:path");
3061
2988
  let c;
@@ -3066,9 +2993,9 @@ const Qi = (t, e, n) => async (r, i, s) => {
3066
2993
  return;
3067
2994
  }
3068
2995
  if (r.method === "GET" && c.pathname === "/__image_info") {
3069
- const h = c.searchParams.get("url");
3070
- if (i.setHeader("content-type", "application/json"), h) {
3071
- const o = await Gi(h);
2996
+ const u = c.searchParams.get("url");
2997
+ if (i.setHeader("content-type", "application/json"), u) {
2998
+ const o = await qo(u);
3072
2999
  i.setHeader("cache-control", "public, max-age=31536000, immutable"), o ? i.write(JSON.stringify(o)) : i.statusCode = 404;
3073
3000
  } else {
3074
3001
  i.statusCode = 500;
@@ -3078,127 +3005,127 @@ const Qi = (t, e, n) => async (r, i, s) => {
3078
3005
  i.end();
3079
3006
  return;
3080
3007
  } else if (r.method === "POST" && c.pathname === "/__image_fix") {
3081
- const h = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"), v = c.searchParams.get("src"), g = c.searchParams.get("currentHref"), d = h.split(":"), u = parseInt(d[d.length - 1], 10) - 1;
3082
- let p = parseInt(d[d.length - 2], 10) - 1;
3083
- const x = a.resolve(n, d.slice(0, d.length - 2).join(":")), R = a.extname(x).toLowerCase();
3084
- let m = l.readFileSync(x).toString("utf-8"), b = 0;
3085
- for (; b < m.length; b++)
3086
- if (p === 0) {
3087
- b += u;
3008
+ const u = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"), b = c.searchParams.get("src"), f = c.searchParams.get("currentHref"), v = u.split(":"), x = parseInt(v[v.length - 1], 10) - 1;
3009
+ let C = parseInt(v[v.length - 2], 10) - 1;
3010
+ const T = a.resolve(n, v.slice(0, v.length - 2).join(":")), W = a.extname(T).toLowerCase();
3011
+ let h = l.readFileSync(T).toString("utf-8"), g = 0;
3012
+ for (; g < h.length; g++)
3013
+ if (C === 0) {
3014
+ g += x;
3088
3015
  break;
3089
- } else if (m[b] === `
3016
+ } else if (h[g] === `
3090
3017
  `) {
3091
- p--;
3018
+ C--;
3092
3019
  continue;
3093
3020
  }
3094
- if (m.slice(b, b + 4) !== "<img") {
3021
+ if (h.slice(g, g + 4) !== "<img") {
3095
3022
  console.error(
3096
3023
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
3097
3024
  ), i.statusCode = 500;
3098
3025
  return;
3099
3026
  }
3100
- const C = m.indexOf(">", b) + 1;
3101
- if (C < b) {
3027
+ const I = h.indexOf(">", g) + 1;
3028
+ if (I < g) {
3102
3029
  console.error(
3103
3030
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
3104
3031
  ), i.statusCode = 500;
3105
3032
  return;
3106
3033
  }
3107
- const $ = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(R);
3108
- let I = m.slice(b, C);
3109
- if (v && g && $) {
3110
- const T = new URL(v), z = new URL(g);
3111
- if (T.origin === z.origin) {
3112
- const j = a.join(e, "public", T.pathname), q = a.join(e, T.pathname);
3034
+ const M = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(W);
3035
+ let S = h.slice(g, I);
3036
+ if (b && f && M) {
3037
+ const _ = new URL(b), U = new URL(f);
3038
+ if (_.origin === U.origin) {
3039
+ const L = a.join(e, "public", _.pathname), j = a.join(e, _.pathname);
3113
3040
  let A;
3114
- if (l.existsSync(j)) {
3115
- const W = a.join(n, "media", a.dirname(T.pathname));
3116
- await l.promises.mkdir(W, { recursive: !0 }), await l.promises.copyFile(
3117
- j,
3118
- a.join(n, "media", T.pathname)
3119
- ), A = "~/media" + T.pathname;
3120
- } else if (l.existsSync(q))
3121
- A = T.pathname.replace("/src/", "~/");
3041
+ if (l.existsSync(L)) {
3042
+ const B = a.join(n, "media", a.dirname(_.pathname));
3043
+ await l.promises.mkdir(B, { recursive: !0 }), await l.promises.copyFile(
3044
+ L,
3045
+ a.join(n, "media", _.pathname)
3046
+ ), A = "~/media" + _.pathname;
3047
+ } else if (l.existsSync(j))
3048
+ A = _.pathname.replace("/src/", "~/");
3122
3049
  else
3123
3050
  return;
3124
- const J = Ki(T.pathname), X = `${A}?jsx`;
3125
- I = I.replace(/^<img/, `<${J}`), I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
3126
- let Y = 0;
3127
- if (R === ".mdx" && m.startsWith("---") && (Y = m.indexOf("---", 4) + 3, Y === -1))
3051
+ const Q = Fo(_.pathname), K = `${A}?jsx`;
3052
+ S = S.replace(/^<img/, `<${Q}`), S = S.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), S = S.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), S = S.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
3053
+ let G = 0;
3054
+ if (W === ".mdx" && h.startsWith("---") && (G = h.indexOf("---", 4) + 3, G === -1))
3128
3055
  return;
3129
- const ae = `
3130
- import ${J} from '${X}';`;
3131
- m = `${m.slice(0, Y)}${ae}${m.slice(
3132
- Y,
3133
- b
3134
- )}${I}${m.slice(C)}`, l.writeFileSync(x, m);
3056
+ const ie = `
3057
+ import ${Q} from '${K}';`;
3058
+ h = `${h.slice(0, G)}${ie}${h.slice(
3059
+ G,
3060
+ g
3061
+ )}${S}${h.slice(I)}`, l.writeFileSync(T, h);
3135
3062
  return;
3136
3063
  }
3137
3064
  }
3138
- I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${o}"`), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), I.includes("height=") || (I = I.replace(/<img/, `<img height="${w}"`)), I.includes("width=") || (I = I.replace(/<img/, `<img width="${o}"`)), m = m.slice(0, b) + I + m.slice(C), l.writeFileSync(x, m);
3065
+ S = S.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${o}"`), S = S.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), S.includes("height=") || (S = S.replace(/<img/, `<img height="${w}"`)), S.includes("width=") || (S = S.replace(/<img/, `<img width="${o}"`)), h = h.slice(0, g) + S + h.slice(I), l.writeFileSync(T, h);
3139
3066
  } else
3140
3067
  s();
3141
3068
  } catch (l) {
3142
- l instanceof Error && await Fi(t, l), s(l);
3069
+ l instanceof Error && await Po(t, l), s(l);
3143
3070
  }
3144
3071
  };
3145
- function Ki(t) {
3072
+ function Fo(t) {
3146
3073
  const e = t.lastIndexOf("."), n = t.lastIndexOf("/");
3147
- return t = t.substring(n + 1, e), `Img${Ji(t)}`;
3074
+ return t = t.substring(n + 1, e), `Img${Ao(t)}`;
3148
3075
  }
3149
- function Ji(t) {
3076
+ function Ao(t) {
3150
3077
  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());
3151
3078
  }
3152
- const We = "@qwik-worker-core", Yi = `
3079
+ const _e = "@qwik-worker-core", Uo = `
3153
3080
  export { setPlatform } from '@qwik.dev/core';
3154
3081
  export { _deserialize } from '@qwik.dev/core/internal';
3155
- `, Xi = (t) => t.endsWith(We), Zi = () => ({
3082
+ `, Bo = (t) => t.endsWith(_e), Wo = () => ({
3156
3083
  moduleSideEffects: !1,
3157
- code: Yi
3158
- }), Vi = (t) => {
3084
+ code: Uo
3085
+ }), Ho = (t) => {
3159
3086
  t.emitFile({
3160
- id: We,
3087
+ id: _e,
3161
3088
  name: "qwik-worker-core",
3162
3089
  type: "chunk",
3163
3090
  preserveSignature: "allow-extension"
3164
3091
  });
3165
- }, eo = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
3092
+ }, Qo = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
3166
3093
  ...t,
3167
3094
  format: "es",
3168
- plugins: io(t?.plugins)
3169
- }, to = (t) => {
3095
+ plugins: Jo(t?.plugins)
3096
+ }, Go = (t) => {
3170
3097
  const e = Object.values(t).find(
3171
- (r) => r.type === "chunk" && r.facadeModuleId === We
3098
+ (r) => r.type === "chunk" && r.facadeModuleId === _e
3172
3099
  ), n = e ? cn(e.fileName) : void 0;
3173
- hn(
3100
+ vn(
3174
3101
  t,
3175
3102
  (r) => n?.(r)
3176
3103
  );
3177
- }, no = (t, e) => {
3178
- const n = oo(e), r = n ? cn(n) : void 0;
3179
- hn(
3104
+ }, Ko = (t, e) => {
3105
+ const n = Yo(e), r = n ? cn(n) : void 0;
3106
+ vn(
3180
3107
  t,
3181
3108
  (i) => r?.(i)
3182
3109
  );
3183
- }, ro = () => ({
3110
+ }, Vo = () => ({
3184
3111
  name: "vite-plugin-qwik-worker-core-external",
3185
3112
  enforce: "pre",
3186
3113
  resolveId(t) {
3187
- return t === we || t === ye ? {
3188
- id: at,
3114
+ return t === we || t === ve ? {
3115
+ id: st,
3189
3116
  external: !0
3190
3117
  } : null;
3191
3118
  }
3192
- }), io = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], ro()], hn = (t, e) => {
3119
+ }), Jo = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], Vo()], vn = (t, e) => {
3193
3120
  for (const n of Object.values(t))
3194
- n.type === "chunk" ? n.code = Ot(
3121
+ n.type === "chunk" ? n.code = jt(
3195
3122
  n.code,
3196
3123
  () => e(n.fileName)
3197
- ) : n.type === "asset" && typeof n.source == "string" && (n.source = Ot(
3124
+ ) : n.type === "asset" && typeof n.source == "string" && (n.source = jt(
3198
3125
  n.source,
3199
3126
  () => e(n.fileName)
3200
3127
  ));
3201
- }, oo = (t) => {
3128
+ }, Yo = (t) => {
3202
3129
  if (!t)
3203
3130
  return;
3204
3131
  const e = Object.keys(t.bundles).find(
@@ -3206,15 +3133,15 @@ export { _deserialize } from '@qwik.dev/core/internal';
3206
3133
  );
3207
3134
  if (e)
3208
3135
  return e === "build" || e.startsWith("build/") || /[/\\]build[/\\]/.test(e) ? e : `build/${e}`;
3209
- }, so = [
3136
+ }, Xo = [
3210
3137
  we,
3138
+ ct,
3211
3139
  dt,
3212
- ut,
3213
- ye,
3140
+ ve,
3214
3141
  "@builder.io/qwik",
3215
3142
  "@builder.io/qwik/jsx-runtime",
3216
3143
  "@builder.io/qwik/jsx-dev-runtime"
3217
- ], ao = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], lo = [".woff", ".woff2", ".ttf"], st = "@qwik-hmr-bridge", co = `
3144
+ ], Zo = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], es = [".woff", ".woff2", ".ttf"], ot = "@qwik-hmr-bridge", ts = `
3218
3145
  // HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
3219
3146
  if (import.meta.hot) {
3220
3147
  let timeout;
@@ -3239,68 +3166,68 @@ export { _deserialize } from '@qwik.dev/core/internal';
3239
3166
  });
3240
3167
  }
3241
3168
  `;
3242
- function po(t = {}) {
3243
- let e = "serve", n = null, r = "/", i = null, s = null, l = null, a = null, c = "development", h;
3169
+ function os(t = {}) {
3170
+ let e = "serve", n = null, r = "/", i = null, s = null, l = null, a = null, c = "development", u;
3244
3171
  const o = t.client?.outDir;
3245
3172
  let w = null;
3246
- const v = t.fileFilter ? (m, b) => ct.test(m) || t.fileFilter(m, b) : () => !0, g = t.disableFontPreload ?? !1, d = [], u = un(t.optimizerOptions), p = /* @__PURE__ */ new Set();
3173
+ const b = t.fileFilter ? (h, g) => lt.test(h) || t.fileFilter(h, g) : () => !0, f = t.disableFontPreload ?? !1, v = [], x = un(t.optimizerOptions), C = /* @__PURE__ */ new Set();
3247
3174
  return [{
3248
3175
  name: "vite-plugin-qwik",
3249
3176
  enforce: "pre",
3250
3177
  api: {
3251
- getOptimizer: () => u.getOptimizer(),
3252
- getOptions: () => u.getOptions(),
3253
- getManifest: () => u.getOptions().manifestInput,
3254
- getRootDir: () => u.getOptions().rootDir,
3178
+ getOptimizer: () => x.getOptimizer(),
3179
+ getOptions: () => x.getOptions(),
3180
+ getManifest: () => x.getOptions().manifestInput,
3181
+ getRootDir: () => x.getOptions().rootDir,
3255
3182
  getClientOutDir: () => n,
3256
3183
  getClientPublicOutDir: () => i,
3257
- registerBundleGraphAdder: (m) => p.add(m),
3258
- onSegment: (m) => {
3259
- u.segmentCallbacks.add(m);
3184
+ registerBundleGraphAdder: (h) => C.add(h),
3185
+ onSegment: (h) => {
3186
+ x.segmentCallbacks.add(h);
3260
3187
  },
3261
3188
  _oldDevSsrServer: () => t.devSsrServer
3262
3189
  },
3263
- async config(m, b) {
3264
- await u.init();
3265
- let C;
3266
- b.mode === "lib" ? C = "lib" : m.build?.ssr || b.mode === "ssr" ? C = "ssr" : b.mode === "test" || b.mode === "benchmark" ? C = "test" : C = "client", e = b.command, b.mode === "production" ? c = "production" : b.mode === "development" ? c = "development" : e === "build" && C === "client" ? c = "production" : c = "development", u.debug(`vite config(), command: ${e}, env.mode: ${b.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : C === "ssr" ? t.entryStrategy = { type: "hoist" } : C === "lib" && (t.entryStrategy = { type: "inline" });
3267
- const $ = C === "ssr" ? typeof m.build?.ssr == "string" ? m.build.ssr : t.ssr?.input : void 0, I = C === "client" ? t.client?.input : void 0;
3268
- let T = m.build?.rollupOptions?.input || I || $;
3269
- T && typeof T == "string" && (T = [T]);
3270
- const z = {
3271
- target: C,
3190
+ async config(h, g) {
3191
+ await x.init();
3192
+ let I;
3193
+ g.mode === "lib" ? I = "lib" : h.build?.ssr || g.mode === "ssr" ? I = "ssr" : g.mode === "test" || g.mode === "benchmark" ? I = "test" : I = "client", e = g.command, g.mode === "production" ? c = "production" : g.mode === "development" ? c = "development" : e === "build" && I === "client" ? c = "production" : c = "development", x.debug(`vite config(), command: ${e}, env.mode: ${g.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : I === "ssr" ? t.entryStrategy = { type: "hoist" } : I === "lib" && (t.entryStrategy = { type: "inline" });
3194
+ const M = I === "ssr" ? typeof h.build?.ssr == "string" ? h.build.ssr : t.ssr?.input : void 0, S = I === "client" ? t.client?.input : void 0;
3195
+ let _ = h.build?.rollupOptions?.input || S || M;
3196
+ _ && typeof _ == "string" && (_ = [_]);
3197
+ const U = {
3198
+ target: I,
3272
3199
  buildMode: c,
3273
3200
  csr: t.csr,
3274
3201
  debug: t.debug,
3275
3202
  entryStrategy: t.entryStrategy,
3276
3203
  srcDir: t.srcDir,
3277
- rootDir: m.root,
3204
+ rootDir: h.root,
3278
3205
  tsconfigFileNames: t.tsconfigFileNames,
3279
3206
  resolveQwikBuild: !0,
3280
3207
  transformedModuleOutput: t.transformedModuleOutput,
3281
- outDir: m.build?.outDir,
3282
- ssrOutDir: t.ssr?.outDir || m.build?.outDir,
3208
+ outDir: h.build?.outDir,
3209
+ ssrOutDir: t.ssr?.outDir || h.build?.outDir,
3283
3210
  clientOutDir: o || // When ssr is true, this is probably an adapter build and not where the client build is
3284
3211
  // However, if client.outDir was explicitly set, always use it
3285
- (m.build?.ssr && !o ? void 0 : m.build?.outDir),
3212
+ (h.build?.ssr && !o ? void 0 : h.build?.outDir),
3286
3213
  devTools: t.devTools,
3287
- sourcemap: !!m.build?.sourcemap,
3214
+ sourcemap: !!h.build?.sourcemap,
3288
3215
  lint: t.lint,
3289
3216
  experimental: t.experimental,
3290
- input: T,
3217
+ input: _,
3291
3218
  manifestInput: t.ssr?.manifestInput,
3292
3219
  manifestInputPath: t.ssr?.manifestInputPath,
3293
3220
  manifestOutput: t.client?.manifestOutput
3294
- }, j = await u.normalizeOptions(z);
3295
- T ||= j.input, w = z, s = j.srcDir, l = j.rootDir, t.csr || (n = j.clientOutDir, i = n, a = j.ssrOutDir);
3296
- const q = c === "development", A = "globalThis.qDev", J = "globalThis.qTest", X = "globalThis.qInspector", Y = m?.define?.[A] ?? q, ae = m?.define?.[X] ?? q, W = {
3221
+ }, L = await x.normalizeOptions(U);
3222
+ _ ||= L.input, w = U, s = L.srcDir, l = L.rootDir, t.csr || (n = L.clientOutDir, i = n, a = L.ssrOutDir);
3223
+ const j = c === "development", A = "globalThis.qDev", Q = "globalThis.qTest", K = "globalThis.qInspector", G = h?.define?.[A] ?? j, ie = h?.define?.[K] ?? j, B = {
3297
3224
  // Duplicated in configEnvironment to support legacy vite build --ssr compatibility
3298
3225
  ssr: {
3299
- noExternal: [we, ye, Ke, se]
3226
+ noExternal: [we, ve, Oe, re]
3300
3227
  },
3301
3228
  envPrefix: ["VITE_", "PUBLIC_"],
3302
3229
  resolve: {
3303
- dedupe: [...so],
3230
+ dedupe: [...Xo],
3304
3231
  alias: {
3305
3232
  "@builder.io/qwik": "@qwik.dev/core",
3306
3233
  "@builder.io/qwik/build": "@qwik.dev/core/build",
@@ -3320,16 +3247,16 @@ function po(t = {}) {
3320
3247
  // using optimized deps for qwik libraries will lead to duplicate imports
3321
3248
  // this breaks Qwik because it relies a lot on module scoped symbols
3322
3249
  we,
3323
- ye,
3324
- Ke,
3250
+ ve,
3251
+ Oe,
3252
+ ct,
3325
3253
  dt,
3326
- ut,
3327
- se,
3328
- oe,
3254
+ re,
3255
+ ne,
3329
3256
  "@builder.io/qwik"
3330
3257
  ],
3331
3258
  // Enforce scanning our input even when overridden later
3332
- entries: T && (typeof T == "string" ? [T] : typeof T == "object" ? Object.values(T) : T)
3259
+ entries: _ && (typeof _ == "string" ? [_] : typeof _ == "object" ? Object.values(_) : _)
3333
3260
  },
3334
3261
  build: {
3335
3262
  modulePreload: !1,
@@ -3339,50 +3266,50 @@ function po(t = {}) {
3339
3266
  rollupOptions: {
3340
3267
  external: ["node:async_hooks"],
3341
3268
  // This will amend the existing input
3342
- input: T
3269
+ input: _
3343
3270
  // temporary fix for rolldown-vite types
3344
3271
  }
3345
3272
  },
3346
- worker: eo(m.worker, C, e),
3273
+ worker: Qo(h.worker, I, e),
3347
3274
  define: {
3348
- [A]: Y,
3349
- [X]: ae,
3350
- [J]: JSON.stringify(process.env.NODE_ENV === "test")
3275
+ [A]: G,
3276
+ [K]: ie,
3277
+ [Q]: JSON.stringify(process.env.NODE_ENV === "test")
3351
3278
  }
3352
3279
  };
3353
3280
  if (!t.csr) {
3354
- W.build.cssCodeSplit = !1, j.outDir && (W.build.outDir = j.outDir);
3355
- const le = W.build.rollupOptions?.onwarn;
3356
- W.build.rollupOptions = {
3357
- ...W.build.rollupOptions,
3358
- output: await Dr(
3359
- u,
3360
- m.build?.rollupOptions?.output
3281
+ B.build.cssCodeSplit = !1, L.outDir && (B.build.outDir = L.outDir);
3282
+ const oe = B.build.rollupOptions?.onwarn;
3283
+ B.build.rollupOptions = {
3284
+ ...B.build.rollupOptions,
3285
+ output: await Mr(
3286
+ x,
3287
+ h.build?.rollupOptions?.output
3361
3288
  ),
3362
3289
  preserveEntrySignatures: "exports-only",
3363
- onwarn: (V, de) => {
3364
- V.plugin === "typescript" && V.message.includes("outputToFilesystem") || (le ? le(V, de) : de(V));
3290
+ onwarn: (J, ae) => {
3291
+ J.plugin === "typescript" && J.message.includes("outputToFilesystem") || (oe ? oe(J, ae) : ae(J));
3365
3292
  }
3366
- }, j.target === "ssr" ? e === "build" && (W.publicDir = !1, W.build.ssr = !0, m.build?.minify == null && c === "production" && (W.build.minify = !0)) : j.target === "client" || (j.target === "lib" ? (W.build.minify = !1, W.build.rollupOptions.external = [
3293
+ }, L.target === "ssr" ? e === "build" && (B.publicDir = !1, B.build.ssr = !0, h.build?.minify == null && c === "production" && (B.build.minify = !0)) : L.target === "client" || (L.target === "lib" ? (B.build.minify = !1, B.build.rollupOptions.external = [
3367
3294
  we,
3368
- ye,
3369
- Ke,
3295
+ ve,
3296
+ Oe,
3297
+ ct,
3370
3298
  dt,
3371
- ut,
3372
- se,
3373
- oe
3374
- ]) : W.define = {
3299
+ re,
3300
+ ne
3301
+ ]) : B.define = {
3375
3302
  [A]: !0,
3376
- [J]: !0,
3377
- [X]: !1
3378
- }), globalThis.qDev = Y, globalThis.qTest = !0, globalThis.qInspector = ae;
3303
+ [Q]: !0,
3304
+ [K]: !1
3305
+ }), globalThis.qDev = G, globalThis.qTest = !0, globalThis.qInspector = ie;
3379
3306
  }
3380
- return W;
3307
+ return B;
3381
3308
  },
3382
- configEnvironment(m, b, C) {
3383
- return m === "ssr" || m === "ssg" ? {
3309
+ configEnvironment(h, g, I) {
3310
+ return h === "ssr" || h === "ssg" ? {
3384
3311
  resolve: {
3385
- noExternal: [we, ye, Ke, se]
3312
+ noExternal: [we, ve, Oe, re]
3386
3313
  }
3387
3314
  } : c === "production" ? {
3388
3315
  resolve: {
@@ -3390,48 +3317,48 @@ function po(t = {}) {
3390
3317
  }
3391
3318
  } : {};
3392
3319
  },
3393
- async configResolved(m) {
3394
- if (r = m.base, !(r.startsWith("/") && r.endsWith("/")))
3320
+ async configResolved(h) {
3321
+ if (r = h.base, !(r.startsWith("/") && r.endsWith("/")))
3395
3322
  throw new Error("vite's config.base must begin and end with /");
3396
- if (m.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && u.setSourceMapSupport(!0), w ? u.normalizeOptions(w) : u.normalizeOptions(t), e === "build" && !t.csr && u.getOptions().target === "client") {
3397
- const C = ["vite:build-import-analysis"], $ = m.plugins;
3398
- for (const I of C) {
3399
- const T = $.findIndex((z) => z?.name === I);
3400
- T >= 0 && $.splice(T, 1);
3323
+ if (h.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && x.setSourceMapSupport(!0), w ? x.normalizeOptions(w) : x.normalizeOptions(t), e === "build" && !t.csr && x.getOptions().target === "client") {
3324
+ const I = ["vite:build-import-analysis"], M = h.plugins;
3325
+ for (const S of I) {
3326
+ const _ = M.findIndex((U) => U?.name === S);
3327
+ _ >= 0 && M.splice(_, 1);
3401
3328
  }
3402
3329
  }
3403
3330
  },
3404
3331
  async buildStart() {
3405
- d.length = 0;
3406
- const m = this.resolve.bind(this);
3407
- await u.validateSource(m), u.onDiagnostics((b, C, $) => {
3408
- b.forEach((I) => {
3409
- const T = u.normalizePath(C.sys.path.join($, I.file));
3410
- I.category === "error" ? this.error(Ve(T, I)) : this.warn(Ve(T, I));
3332
+ v.length = 0;
3333
+ const h = this.resolve.bind(this);
3334
+ await x.validateSource(h), x.onDiagnostics((g, I, M) => {
3335
+ g.forEach((S) => {
3336
+ const _ = x.normalizePath(I.sys.path.join(M, S.file));
3337
+ S.category === "error" ? this.error(He(_, S)) : this.warn(He(_, S));
3411
3338
  });
3412
- }), await u.buildStart(this), e === "build" && u.getOptions().target === "client" && Vi(this);
3339
+ }), await x.buildStart(this), e === "build" && x.getOptions().target === "client" && Ho(this);
3413
3340
  },
3414
- resolveId(m, b, C) {
3415
- if (m.endsWith(st))
3416
- return st;
3417
- if (Xi(m))
3418
- return We;
3419
- const $ = v(m, "resolveId");
3420
- return ne(m) || !$ ? null : u.resolveId(this, m, b, C);
3341
+ resolveId(h, g, I) {
3342
+ if (h.endsWith(ot))
3343
+ return ot;
3344
+ if (Bo(h))
3345
+ return _e;
3346
+ const M = b(h, "resolveId");
3347
+ return Z(h) || !M ? null : x.resolveId(this, h, g, I);
3421
3348
  },
3422
- load(m, b) {
3423
- if (m === st)
3424
- return { code: co };
3425
- if (m === We)
3426
- return Zi();
3427
- const C = v(m, "load");
3428
- return ne(m) || !C ? null : (m = u.normalizePath(m), e === "serve" && m.endsWith(oe) ? {
3349
+ load(h, g) {
3350
+ if (h === ot)
3351
+ return { code: ts };
3352
+ if (h === _e)
3353
+ return Wo();
3354
+ const I = b(h, "load");
3355
+ return Z(h) || !I ? null : (h = x.normalizePath(h), e === "serve" && h.endsWith(ne) ? {
3429
3356
  code: "export const manifest = undefined;"
3430
- } : u.load(this, m, b));
3357
+ } : x.load(this, h, g));
3431
3358
  },
3432
- transform(m, b, C) {
3433
- if (b.includes(".vite/deps/") && m.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(m)) {
3434
- const T = l && b.startsWith(l) ? b.slice(l.length) : b;
3359
+ transform(h, g, I) {
3360
+ if (g.includes(".vite/deps/") && h.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(h)) {
3361
+ const _ = l && g.startsWith(l) ? g.slice(l.length) : g;
3435
3362
  throw new Error(
3436
3363
  `
3437
3364
 
@@ -3440,37 +3367,37 @@ function po(t = {}) {
3440
3367
  ⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
3441
3368
 
3442
3369
  👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
3443
- 👉 ${T}
3370
+ 👉 ${_}
3444
3371
 
3445
3372
  ==============
3446
3373
 
3447
3374
  `
3448
3375
  );
3449
3376
  }
3450
- const $ = v(b, "transform"), I = b.includes("?raw");
3451
- return ne(b) || !$ || I ? null : u.transform(this, m, b, C);
3377
+ const M = b(g, "transform"), S = g.includes("?raw");
3378
+ return Z(g) || !M || S ? null : x.transform(this, h, g, I);
3452
3379
  }
3453
3380
  }, {
3454
3381
  name: "vite-plugin-qwik-post",
3455
3382
  enforce: "post",
3456
3383
  generateBundle: {
3457
3384
  order: "post",
3458
- async handler(m, b) {
3459
- const C = this.environment.config.consumer === "client", $ = this.environment.config.consumer === "server";
3460
- if (C) {
3461
- const I = u.getOptions();
3462
- for (const [j, q] of Object.entries(b))
3463
- if (q.type === "asset") {
3464
- const A = r + j;
3465
- if (ao.some((J) => j.endsWith(J)))
3466
- typeof q.source == "string" && q.source.length < I.inlineStylesUpToBytes ? d.push({
3385
+ async handler(h, g) {
3386
+ const I = this.environment.config.consumer === "client", M = this.environment.config.consumer === "server";
3387
+ if (I) {
3388
+ const S = x.getOptions();
3389
+ for (const [L, j] of Object.entries(g))
3390
+ if (j.type === "asset") {
3391
+ const A = r + L;
3392
+ if (Zo.some((Q) => L.endsWith(Q)))
3393
+ typeof j.source == "string" && j.source.length < S.inlineStylesUpToBytes ? v.push({
3467
3394
  tag: "style",
3468
3395
  location: "head",
3469
3396
  attributes: {
3470
3397
  "data-src": A,
3471
- dangerouslySetInnerHTML: q.source
3398
+ dangerouslySetInnerHTML: j.source
3472
3399
  }
3473
- }) : d.push({
3400
+ }) : v.push({
3474
3401
  tag: "link",
3475
3402
  location: "head",
3476
3403
  attributes: {
@@ -3479,119 +3406,119 @@ function po(t = {}) {
3479
3406
  }
3480
3407
  });
3481
3408
  else {
3482
- const J = lo.find((X) => j.endsWith(X));
3483
- J && !g && d.unshift({
3409
+ const Q = es.find((K) => L.endsWith(K));
3410
+ Q && !f && v.unshift({
3484
3411
  tag: "link",
3485
3412
  location: "head",
3486
3413
  attributes: {
3487
3414
  rel: "preload",
3488
3415
  href: A,
3489
3416
  as: "font",
3490
- type: `font/${J.slice(1)}`,
3417
+ type: `font/${Q.slice(1)}`,
3491
3418
  crossorigin: ""
3492
3419
  }
3493
3420
  });
3494
3421
  }
3495
3422
  }
3496
- const T = await u.generateManifest(
3423
+ const _ = await x.generateManifest(
3497
3424
  this,
3498
- b,
3499
- p,
3425
+ g,
3426
+ C,
3500
3427
  {
3501
- injections: d,
3428
+ injections: v,
3502
3429
  platform: { vite: "" }
3503
3430
  }
3504
- ), z = yr(T, r);
3505
- for (const j of Object.values(b))
3506
- j.type === "chunk" && (j.code = ln(j.code, z));
3507
- to(b);
3508
- } else $ && no(b, u.getOptions().manifestInput);
3431
+ ), U = Er(_, r);
3432
+ for (const L of Object.values(g))
3433
+ L.type === "chunk" && (L.code = ln(L.code, U));
3434
+ Go(g);
3435
+ } else M && Ko(g, x.getOptions().manifestInput);
3509
3436
  }
3510
3437
  },
3511
- async writeBundle(m, b) {
3512
- const C = u.getOptions();
3438
+ async writeBundle(h, g) {
3439
+ const I = x.getOptions();
3513
3440
  if (this.environment.config.consumer === "server") {
3514
- const I = u.getSys();
3515
- if (I.env === "node" || I.env === "bun" || I.env === "deno") {
3516
- const T = Object.keys(b), z = async (j) => {
3441
+ const S = x.getSys();
3442
+ if (S.env === "node" || S.env === "bun" || S.env === "deno") {
3443
+ const _ = Object.keys(g), U = async (L) => {
3517
3444
  try {
3518
- const q = I.path.basename(j), A = I.path.extname(q);
3519
- if ((q.startsWith("entry.") || q.startsWith("entry_")) && !q.includes("preview") && (A === ".mjs" || A === ".cjs")) {
3520
- const X = I.path.basename(q, A), Y = `${X}.js`, ae = X + A;
3521
- if (!T.some((le) => I.path.basename(le) === Y)) {
3522
- const le = I.path.dirname(j), V = await I.dynamicImport("node:fs"), de = I.path.join(m.dir || C.outDir, le);
3523
- await V.promises.mkdir(de, { recursive: !0 }), await V.promises.writeFile(
3524
- I.path.join(de, Y),
3525
- `export * from "./${ae}";`
3445
+ const j = S.path.basename(L), A = S.path.extname(j);
3446
+ if ((j.startsWith("entry.") || j.startsWith("entry_")) && !j.includes("preview") && (A === ".mjs" || A === ".cjs")) {
3447
+ const K = S.path.basename(j, A), G = `${K}.js`, ie = K + A;
3448
+ if (!_.some((oe) => S.path.basename(oe) === G)) {
3449
+ const oe = S.path.dirname(L), J = await S.dynamicImport("node:fs"), ae = S.path.join(h.dir || I.outDir, oe);
3450
+ await J.promises.mkdir(ae, { recursive: !0 }), await J.promises.writeFile(
3451
+ S.path.join(ae, G),
3452
+ `export * from "./${ie}";`
3526
3453
  );
3527
3454
  }
3528
3455
  }
3529
- } catch (q) {
3530
- console.error("patchModuleFormat", q);
3456
+ } catch (j) {
3457
+ console.error("patchModuleFormat", j);
3531
3458
  }
3532
3459
  };
3533
- await Promise.all(T.map(z));
3460
+ await Promise.all(_.map(U));
3534
3461
  }
3535
3462
  }
3536
3463
  },
3537
3464
  transformIndexHtml() {
3538
3465
  if (e === "serve")
3539
- return Wr(u.getOptions(), r);
3466
+ return Vr(x.getOptions(), r);
3540
3467
  },
3541
- configureServer(m) {
3542
- h = m, u.configureServer(m), (t?.devTools?.imageDevTools ?? !0) && m.middlewares.use(Qi(u.getSys(), l, s));
3468
+ configureServer(h) {
3469
+ u = h, x.configureServer(h), (t?.devTools?.imageDevTools ?? !0) && h.middlewares.use(zo(x.getSys(), l, s));
3543
3470
  },
3544
- configurePreviewServer(m) {
3471
+ configurePreviewServer(h) {
3545
3472
  return async () => {
3546
- const b = u.getSys(), C = u.getPath();
3547
- await zr(m.middlewares, a, b, C);
3473
+ const g = x.getSys(), I = x.getPath();
3474
+ await Kr(h.middlewares, a, g, I);
3548
3475
  };
3549
3476
  },
3550
- hotUpdate(m) {
3551
- u.hotUpdate(this.environment, m);
3552
- const b = t?.devTools?.hmr ?? !0;
3553
- if (this.environment.name === "ssr" && m.modules.length)
3554
- if (b) {
3555
- const C = /* @__PURE__ */ new Set(), $ = (I) => /\.([mc]?[jt]sx?|mdx?)$/.test(I.split("?")[0]);
3556
- for (const I of m.modules) {
3557
- const T = I.url.split("?")[0];
3558
- if (I.type === "js" && $(I.url))
3559
- C.add(T);
3477
+ hotUpdate(h) {
3478
+ x.hotUpdate(this.environment, h);
3479
+ const g = t?.devTools?.hmr ?? !0;
3480
+ if (this.environment.name === "ssr" && h.modules.length)
3481
+ if (g) {
3482
+ const I = /* @__PURE__ */ new Set(), M = (S) => /\.([mc]?[jt]sx?|mdx?)$/.test(S.split("?")[0]);
3483
+ for (const S of h.modules) {
3484
+ const _ = S.url.split("?")[0];
3485
+ if (S.type === "js" && M(S.url))
3486
+ I.add(_);
3560
3487
  else
3561
- for (const z of I.importers)
3562
- z.type === "js" && $(z.url) && C.add(z.url.split("?")[0]);
3488
+ for (const U of S.importers)
3489
+ U.type === "js" && M(U.url) && I.add(U.url.split("?")[0]);
3563
3490
  }
3564
- C.size > 0 && h && h.environments.client.hot.send({
3491
+ I.size > 0 && u && u.environments.client.hot.send({
3565
3492
  type: "custom",
3566
3493
  event: "qwik:hmr",
3567
- data: { files: [...C], t: m.timestamp }
3494
+ data: { files: [...I], t: h.timestamp }
3568
3495
  });
3569
3496
  } else
3570
- h?.environments.client.hot.send({ type: "full-reload" });
3497
+ u?.environments.client.hot.send({ type: "full-reload" });
3571
3498
  },
3572
- onLog(m, b) {
3573
- if (b.plugin == "vite-plugin-qwik") {
3574
- const C = fo[m] || ce.White, $ = (b.frame || "").split(`
3499
+ onLog(h, g) {
3500
+ if (g.plugin == "vite-plugin-qwik") {
3501
+ const I = rs[h] || se.White, M = (g.frame || "").split(`
3575
3502
  `).map(
3576
- (I) => (I.match(/^\s*\^\s*$/) ? ce.BrightWhite : ce.BrightBlack) + I
3503
+ (S) => (S.match(/^\s*\^\s*$/) ? se.BrightWhite : se.BrightBlack) + S
3577
3504
  );
3578
- return console[m](
3579
- `${C}%s
3580
- ${ce.BrightWhite}%s
3581
- %s${ce.RESET}`,
3582
- `[${b.plugin}](${m}): ${b.message}
3505
+ return console[h](
3506
+ `${I}%s
3507
+ ${se.BrightWhite}%s
3508
+ %s${se.RESET}`,
3509
+ `[${g.plugin}](${h}): ${g.message}
3583
3510
  `,
3584
- ` ${b?.loc?.file}:${b?.loc?.line}:${b?.loc?.column}
3511
+ ` ${g?.loc?.file}:${g?.loc?.line}:${g?.loc?.column}
3585
3512
  `,
3586
- ` ${$.join(`
3513
+ ` ${M.join(`
3587
3514
  `)}
3588
3515
  `
3589
3516
  ), !1;
3590
3517
  }
3591
3518
  }
3592
- }, uo()];
3519
+ }, ns()];
3593
3520
  }
3594
- async function uo() {
3521
+ async function ns() {
3595
3522
  let t, e, n = !1;
3596
3523
  async function r() {
3597
3524
  if (n)
@@ -3605,42 +3532,42 @@ async function uo() {
3605
3532
  const i = /* @__PURE__ */ new Set(), s = [];
3606
3533
  let l;
3607
3534
  const a = "@qwik.dev/core", c = "@builder.io/qwik";
3608
- async function h(w) {
3609
- const v = /* @__PURE__ */ new Set();
3610
- let g = w;
3611
- for (; g; ) {
3535
+ async function u(w) {
3536
+ const b = /* @__PURE__ */ new Set();
3537
+ let f = w;
3538
+ for (; f; ) {
3612
3539
  try {
3613
- const u = e.join(g, "package.json"), p = await t.readFile(u, { encoding: "utf-8" }), x = JSON.parse(p);
3614
- for (const R of Object.keys(x.dependencies || {}))
3615
- v.add(R);
3616
- for (const R of Object.keys(x.devDependencies || {}))
3617
- v.add(R);
3618
- for (const R of Object.keys(x.optionalDependencies || {}))
3619
- v.add(R);
3540
+ const x = e.join(f, "package.json"), C = await t.readFile(x, { encoding: "utf-8" }), T = JSON.parse(C);
3541
+ for (const W of Object.keys(T.dependencies || {}))
3542
+ b.add(W);
3543
+ for (const W of Object.keys(T.devDependencies || {}))
3544
+ b.add(W);
3545
+ for (const W of Object.keys(T.optionalDependencies || {}))
3546
+ b.add(W);
3620
3547
  } catch {
3621
3548
  }
3622
- const d = e.dirname(g);
3623
- if (d === g)
3549
+ const v = e.dirname(f);
3550
+ if (v === f)
3624
3551
  break;
3625
- g = d;
3552
+ f = v;
3626
3553
  }
3627
- return [...v];
3554
+ return [...b];
3628
3555
  }
3629
- async function o(w, v) {
3630
- for (; v; ) {
3631
- const g = e.join(v, "node_modules", w, "package.json");
3556
+ async function o(w, b) {
3557
+ for (; b; ) {
3558
+ const f = e.join(b, "node_modules", w, "package.json");
3632
3559
  try {
3633
- await t.access(g);
3634
- const u = await t.readFile(g, {
3560
+ await t.access(f);
3561
+ const x = await t.readFile(f, {
3635
3562
  encoding: "utf-8"
3636
- }), p = JSON.parse(u);
3637
- return !!(p.qwik || p.dependencies?.[a] || p.peerDependencies?.[a] || p.devDependencies?.[a] || p.dependencies?.[c] || p.peerDependencies?.[c] || p.devDependencies?.[c]);
3563
+ }), C = JSON.parse(x);
3564
+ return !!(C.qwik || C.dependencies?.[a] || C.peerDependencies?.[a] || C.devDependencies?.[a] || C.dependencies?.[c] || C.peerDependencies?.[c] || C.devDependencies?.[c]);
3638
3565
  } catch {
3639
3566
  }
3640
- const d = e.dirname(v);
3641
- if (d === v)
3567
+ const v = e.dirname(b);
3568
+ if (v === b)
3642
3569
  break;
3643
- v = d;
3570
+ b = v;
3644
3571
  }
3645
3572
  return !1;
3646
3573
  }
@@ -3656,73 +3583,73 @@ async function uo() {
3656
3583
  async handler(w) {
3657
3584
  if (!await r())
3658
3585
  return;
3659
- const v = w.root || process.cwd(), g = w.optimizeDeps?.exclude ?? [], d = await h(v);
3586
+ const b = w.root || process.cwd(), f = w.optimizeDeps?.exclude ?? [], v = await u(b);
3660
3587
  s.length = 0;
3661
- for (const p of d)
3662
- await o(p, v) && s.push(p);
3663
- const u = s.filter((p) => !g.includes(p));
3588
+ for (const C of v)
3589
+ await o(C, b) && s.push(C);
3590
+ const x = s.filter((C) => !f.includes(C));
3664
3591
  return {
3665
- optimizeDeps: { exclude: u },
3666
- ssr: { noExternal: u }
3592
+ optimizeDeps: { exclude: x },
3593
+ ssr: { noExternal: x }
3667
3594
  };
3668
3595
  }
3669
3596
  },
3670
3597
  // qwik deps need to be marked as noExternal per-environment
3671
- configEnvironment(w, v) {
3598
+ configEnvironment(w, b) {
3672
3599
  if (s.length === 0)
3673
3600
  return;
3674
- const g = v.resolve?.noExternal;
3675
- if (g === !0)
3601
+ const f = b.resolve?.noExternal;
3602
+ if (f === !0)
3676
3603
  return;
3677
- let d;
3678
- return Array.isArray(g) ? d = g : g ? d = [g] : d = [], {
3679
- resolve: { noExternal: [...d, ...s] }
3604
+ let v;
3605
+ return Array.isArray(f) ? v = f : f ? v = [f] : v = [], {
3606
+ resolve: { noExternal: [...v, ...s] }
3680
3607
  };
3681
3608
  },
3682
3609
  // We check all SSR build lookups for external Qwik deps
3683
3610
  resolveId: {
3684
3611
  order: "pre",
3685
- async handler(w, v, g) {
3612
+ async handler(w, b, f) {
3686
3613
  if (!await r() || !(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(w) || i.has(w))
3687
3614
  return;
3688
- const u = (w.startsWith("@") ? w.split("/").slice(0, 2).join("/") : w.split("/")[0]).split("?")[0];
3689
- if (i.has(u))
3615
+ const x = (w.startsWith("@") ? w.split("/").slice(0, 2).join("/") : w.split("/")[0]).split("?")[0];
3616
+ if (i.has(x))
3690
3617
  return;
3691
- i.add(w), i.add(u);
3692
- let p;
3618
+ i.add(w), i.add(x);
3619
+ let C;
3693
3620
  try {
3694
- p = await this.resolve(u, v, { ...g, skipSelf: !0 });
3621
+ C = await this.resolve(x, b, { ...f, skipSelf: !0 });
3695
3622
  } catch {
3696
3623
  return;
3697
3624
  }
3698
- if (p?.external && await o(u, v ? e.dirname(v) : l))
3625
+ if (C?.external && await o(x, b ? e.dirname(b) : l))
3699
3626
  throw new Error(
3700
3627
  `
3701
3628
  ==============
3702
- ${u} is being treated as an external dependency, but it should be included in the server bundle, because it uses Qwik and it needs to be processed by the optimizer.
3629
+ ${x} is being treated as an external dependency, but it should be included in the server bundle, because it uses Qwik and it needs to be processed by the optimizer.
3703
3630
  Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
3704
3631
  ==============
3705
3632
  `
3706
3633
  );
3707
- if (u === w)
3708
- return p;
3634
+ if (x === w)
3635
+ return C;
3709
3636
  }
3710
3637
  }
3711
3638
  };
3712
3639
  }
3713
- const ce = {
3640
+ const se = {
3714
3641
  Yellow: "\x1B[33m",
3715
3642
  Cyan: "\x1B[36m",
3716
3643
  White: "\x1B[37m",
3717
3644
  BrightBlack: "\x1B[90m",
3718
3645
  BrightWhite: "\x1B[97m",
3719
3646
  RESET: "\x1B[0m"
3720
- }, fo = {
3721
- warn: ce.Yellow,
3722
- info: ce.Cyan,
3723
- debug: ce.BrightBlack
3647
+ }, rs = {
3648
+ warn: se.Yellow,
3649
+ info: se.Cyan,
3650
+ debug: se.BrightBlack
3724
3651
  };
3725
3652
  export {
3726
- ho as qwikRollup,
3727
- po as qwikVite
3653
+ is as qwikRollup,
3654
+ os as qwikVite
3728
3655
  };