@nimtech/nimpress 2.6.0 → 2.6.1

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.
@@ -19,9 +19,7 @@ import { createHighlighter as Ho } from "shiki";
19
19
  import { fileURLToPath as zo, pathToFileURL as hn } from "node:url";
20
20
  import { exporter as qo } from "@dbml/core";
21
21
  import { n as Uo, r as Qe, e as yt, b as Bt, p as Ln, c as Gt, d as Vt, g as bt, h as Jo, k as Xt, o as Go, s as Vo, l as Xo, q as Yo, t as Ko, j as we, m as Zo, a as Qo } from "./typeMembers-CNvE92EX.js";
22
- import { svelte as es } from "@sveltejs/vite-plugin-svelte";
23
- import ts from "@tailwindcss/vite";
24
- import { loadConfigFromFile as ns } from "vite";
22
+ import { loadConfigFromFile as es } from "vite";
25
23
  const gn = {
26
24
  out: "dist",
27
25
  cache: "node_modules/.nimpress",
@@ -54,7 +52,7 @@ const gn = {
54
52
  route: `/${gn.modules}`,
55
53
  systems: {}
56
54
  }
57
- }, ft = ["stock", "glass"], os = [
55
+ }, ft = ["stock", "glass"], ts = [
58
56
  "Header",
59
57
  "Announce",
60
58
  "Footer",
@@ -91,26 +89,26 @@ const gn = {
91
89
  function wt(e) {
92
90
  return ft.includes(e) ? e : e.replace(/^.*\//, "").replace(/\.css$/, "");
93
91
  }
94
- const ss = m.object({
92
+ const ns = m.object({
95
93
  primary: m.string().optional(),
96
94
  primaryHover: m.string().optional()
97
- }).passthrough(), rs = m.object({
95
+ }).passthrough(), os = m.object({
98
96
  title: m.string(),
99
97
  url: m.string().optional(),
100
98
  description: m.string().optional(),
101
99
  ogImage: m.string().optional(),
102
100
  twitterSite: m.string().optional(),
103
101
  locale: m.string().optional()
104
- }).passthrough(), as = m.object({
102
+ }).passthrough(), ss = m.object({
105
103
  text: m.string(),
106
104
  link: m.string(),
107
105
  gate: m.string().optional()
108
- }), is = m.object({
106
+ }), rs = m.object({
109
107
  title: m.string().optional(),
110
108
  tagline: m.string().optional(),
111
109
  company: m.string().optional(),
112
110
  version: m.string().optional()
113
- }).passthrough(), cs = m.object({
111
+ }).passthrough(), as = m.object({
114
112
  name: m.string(),
115
113
  framework: m.enum(["vue", "svelte"]),
116
114
  source: m.string().optional(),
@@ -121,11 +119,11 @@ const ss = m.object({
121
119
  harness: m.string().optional(),
122
120
  port: m.number().optional(),
123
121
  visibility: m.enum(["visible", "dev-only"]).optional()
124
- }), ls = m.object({
122
+ }), is = m.object({
125
123
  title: m.string().optional(),
126
124
  logo: m.string().optional(),
127
125
  github: m.string().optional(),
128
- brand: ss.optional(),
126
+ brand: ns.optional(),
129
127
  footer: m.object({
130
128
  text: m.string().optional(),
131
129
  copyright: m.string().optional(),
@@ -155,7 +153,7 @@ const ss = m.object({
155
153
  icons: m.string().optional(),
156
154
  math: m.boolean().optional(),
157
155
  tags: m.object({ icons: m.record(m.string()).optional(), map: m.record(m.string()).optional() }).optional(),
158
- navRoutes: m.array(as).optional(),
156
+ navRoutes: m.array(ss).optional(),
159
157
  auth: m.object({
160
158
  issuer: m.string(),
161
159
  clientId: m.string(),
@@ -209,7 +207,7 @@ const ss = m.object({
209
207
  expires: m.string().optional()
210
208
  }).passthrough().optional()
211
209
  }).passthrough().optional(),
212
- site: rs.optional(),
210
+ site: os.optional(),
213
211
  base: m.string().optional(),
214
212
  contentDir: m.string().optional(),
215
213
  assetsDir: m.string().optional(),
@@ -224,20 +222,20 @@ const ss = m.object({
224
222
  exclude: m.array(m.string()).optional(),
225
223
  defaultFrontmatter: m.record(m.unknown()).optional(),
226
224
  defaultFrontmatterExclude: m.array(m.string()).optional(),
227
- banner: m.union([is, m.literal(!1)]).optional(),
225
+ banner: m.union([rs, m.literal(!1)]).optional(),
228
226
  theme: m.string().optional(),
229
227
  themes: m.array(m.string()).optional(),
230
- components: m.record(m.enum(os), m.string()).optional(),
228
+ components: m.record(m.enum(ts), m.string()).optional(),
231
229
  css: m.union([m.string(), m.array(m.string())]).optional(),
232
230
  vite: m.record(m.unknown()).optional(),
233
231
  pageTypes: m.record(m.string()).optional(),
234
- modules: m.array(cs).optional()
232
+ modules: m.array(as).optional()
235
233
  }).passthrough();
236
234
  function _n(e, t) {
237
- const n = ls.safeParse(e);
235
+ const n = is.safeParse(e);
238
236
  return n.success ? n.data : (console.warn(`[nimpress] invalid config in ${t}: ${n.error.message}`), {});
239
237
  }
240
- const ps = ["nimpress.config.ts", "nimpress.config.js", "nimpress.config.mjs", "nimpress.config.json"];
238
+ const cs = ["nimpress.config.ts", "nimpress.config.js", "nimpress.config.mjs", "nimpress.config.json"];
241
239
  function yn(e) {
242
240
  return typeof e == "object" && e !== null && !Array.isArray(e);
243
241
  }
@@ -251,21 +249,21 @@ function Wt(e, t) {
251
249
  }
252
250
  return n;
253
251
  }
254
- async function us(e) {
255
- for (const t of ps) {
252
+ async function ls(e) {
253
+ for (const t of cs) {
256
254
  const n = G(e, t);
257
255
  if (!fe(n)) continue;
258
256
  if (t.endsWith(".json")) {
259
257
  const r = JSON.parse(Oe(n, "utf-8"));
260
258
  return { config: _n(r, n), file: n };
261
259
  }
262
- const s = (await ns({ command: "serve", mode: "development" }, n, e))?.config ?? {};
260
+ const s = (await es({ command: "serve", mode: "development" }, n, e))?.config ?? {};
263
261
  return { config: _n(s, n), file: n };
264
262
  }
265
263
  return null;
266
264
  }
267
- async function ms(e, t) {
268
- const n = await us(e), o = n?.config ? { ...n.config, modules: void 0 } : void 0, s = t ? { ...t, modules: void 0 } : void 0;
265
+ async function ps(e, t) {
266
+ const n = await ls(e), o = n?.config ? { ...n.config, modules: void 0 } : void 0, s = t ? { ...t, modules: void 0 } : void 0;
269
267
  let r = Wt(Ye, o);
270
268
  r = Wt(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Uo(r.base);
271
269
  const i = t?.modules ?? n?.config?.modules;
@@ -275,7 +273,7 @@ async function ms(e, t) {
275
273
  systems: i ? Object.fromEntries(i.map((c) => [c.name, c])) : {}
276
274
  }, { resolved: r, configFile: n?.file ?? null };
277
275
  }
278
- function fs(e) {
276
+ function us(e) {
279
277
  return {
280
278
  title: e.title,
281
279
  logo: e.logo,
@@ -303,7 +301,7 @@ function fs(e) {
303
301
  function vt(e) {
304
302
  return Array.from(/* @__PURE__ */ new Set([...e.themes, e.theme]));
305
303
  }
306
- function ds(e) {
304
+ function ms(e) {
307
305
  function t(o, s) {
308
306
  const r = o.pos, i = o.src.charCodeAt(r);
309
307
  if (s || i !== 61)
@@ -362,8 +360,8 @@ function ds(e) {
362
360
  r[s] && r[s].delimiters && n(o, r[s].delimiters);
363
361
  });
364
362
  }
365
- const hs = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
366
- function gs(e, t) {
363
+ const fs = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
364
+ function ds(e, t) {
367
365
  const n = e.posMax, o = e.pos;
368
366
  if (e.src.charCodeAt(o) !== 126 || t || o + 2 >= n)
369
367
  return !1;
@@ -385,15 +383,15 @@ function gs(e, t) {
385
383
  const i = e.push("sub_open", "sub", 1);
386
384
  i.markup = "~";
387
385
  const c = e.push("text", "", 0);
388
- c.content = r.replace(hs, "$1");
386
+ c.content = r.replace(fs, "$1");
389
387
  const u = e.push("sub_close", "sub", -1);
390
388
  return u.markup = "~", e.pos = e.posMax + 1, e.posMax = n, !0;
391
389
  }
392
- function _s(e) {
393
- e.inline.ruler.after("emphasis", "sub", gs);
390
+ function hs(e) {
391
+ e.inline.ruler.after("emphasis", "sub", ds);
394
392
  }
395
- const ys = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
396
- function bs(e, t) {
393
+ const gs = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
394
+ function _s(e, t) {
397
395
  const n = e.posMax, o = e.pos;
398
396
  if (e.src.charCodeAt(o) !== 94 || t || o + 2 >= n)
399
397
  return !1;
@@ -415,17 +413,17 @@ function bs(e, t) {
415
413
  const i = e.push("sup_open", "sup", 1);
416
414
  i.markup = "^";
417
415
  const c = e.push("text", "", 0);
418
- c.content = r.replace(ys, "$1");
416
+ c.content = r.replace(gs, "$1");
419
417
  const u = e.push("sup_close", "sup", -1);
420
418
  return u.markup = "^", e.pos = e.posMax + 1, e.posMax = n, !0;
421
419
  }
422
- function ws(e) {
423
- e.inline.ruler.after("emphasis", "sup", bs);
420
+ function ys(e) {
421
+ e.inline.ruler.after("emphasis", "sup", _s);
424
422
  }
425
- function vs(e, t) {
423
+ function bs(e, t) {
426
424
  return e[t].content;
427
425
  }
428
- function ks(e, t, n, o, s) {
426
+ function ws(e, t, n, o, s) {
429
427
  const r = e.utils.arrayReplaceAt, i = e.utils.lib.ucmicro, c = new RegExp([i.Z.source, i.P.source, i.Cc.source].join("|"));
430
428
  function u(h, g, w) {
431
429
  let P = 0;
@@ -466,17 +464,17 @@ function ks(e, t, n, o, s) {
466
464
  }
467
465
  };
468
466
  }
469
- function $s(e) {
467
+ function vs(e) {
470
468
  return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
471
469
  }
472
- function xs(e) {
470
+ function ks(e) {
473
471
  let t = e.defs;
474
472
  e.enabled.length && (t = Object.keys(t).reduce((c, u) => (e.enabled.indexOf(u) >= 0 && (c[u] = t[u]), c), {}));
475
473
  const n = Object.keys(e.shortcuts).reduce((c, u) => t[u] ? Array.isArray(e.shortcuts[u]) ? (e.shortcuts[u].forEach((h) => {
476
474
  c[h] = u;
477
475
  }), c) : (c[e.shortcuts[u]] = u, c) : c, {}), o = Object.keys(t);
478
476
  let s;
479
- o.length === 0 ? s = "^$" : s = o.map((c) => `:${c}:`).concat(Object.keys(n)).sort().reverse().map((c) => $s(c)).join("|");
477
+ o.length === 0 ? s = "^$" : s = o.map((c) => `:${c}:`).concat(Object.keys(n)).sort().reverse().map((c) => vs(c)).join("|");
480
478
  const r = RegExp(s), i = RegExp(s, "g");
481
479
  return {
482
480
  defs: t,
@@ -485,19 +483,19 @@ function xs(e) {
485
483
  replaceRE: i
486
484
  };
487
485
  }
488
- function Ss(e, t) {
489
- const o = xs(Object.assign({}, {
486
+ function $s(e, t) {
487
+ const o = ks(Object.assign({}, {
490
488
  defs: {},
491
489
  shortcuts: {},
492
490
  enabled: []
493
491
  }, t || {}));
494
- e.renderer.rules.emoji = vs, e.core.ruler.after(
492
+ e.renderer.rules.emoji = bs, e.core.ruler.after(
495
493
  "linkify",
496
494
  "emoji",
497
- ks(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
495
+ ws(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
498
496
  );
499
497
  }
500
- const js = {
498
+ const xs = {
501
499
  angry: [">:(", ">:-("],
502
500
  blush: [':")', ':-")'],
503
501
  broken_heart: ["</3", "<\\3"],
@@ -525,7 +523,7 @@ const js = {
525
523
  sweat_smile: [",:)", ",:-)"],
526
524
  unamused: [":s", ":-S", ":z", ":-Z", ":$", ":-$"],
527
525
  wink: [";)", ";-)"]
528
- }, Ps = {
526
+ }, Ss = {
529
527
  100: "💯",
530
528
  1234: "🔢",
531
529
  grinning: "😀",
@@ -2430,13 +2428,13 @@ const js = {
2430
2428
  scotland: "🏴󠁧󠁢󠁳󠁣󠁴󠁿",
2431
2429
  wales: "🏴󠁧󠁢󠁷󠁬󠁳󠁿"
2432
2430
  };
2433
- function As(e, t) {
2431
+ function js(e, t) {
2434
2432
  const o = Object.assign({}, {
2435
- defs: Ps,
2436
- shortcuts: js,
2433
+ defs: Ss,
2434
+ shortcuts: xs,
2437
2435
  enabled: []
2438
2436
  }, t || {});
2439
- Ss(e, o);
2437
+ $s(e, o);
2440
2438
  }
2441
2439
  const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m", Hn = "\x1B[38;2;204;120;92m", Ae = "\x1B[38;2;229;174;156m", Me = "\x1B[38;2;160;160;170m", at = [
2442
2440
  " ███╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗ ███████╗ ███████╗",
@@ -2446,17 +2444,17 @@ const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m", Hn = "\x1B[38;2;204;120;92
2446
2444
  " ██║ ╚████║ ██║ ██║ ╚═╝ ██║ ██║ ██║ ██║ ███████╗ ███████║ ███████║",
2447
2445
  " ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ ╚══════╝"
2448
2446
  ], Ve = 60;
2449
- function Es(e, t) {
2447
+ function Ps(e, t) {
2450
2448
  const n = e.replace(/\x1b\[[0-9;]*m/g, ""), o = Math.max(0, t - n.length);
2451
2449
  return e + " ".repeat(o);
2452
2450
  }
2453
- function Cs(e) {
2451
+ function As(e) {
2454
2452
  const t = "╔" + "═".repeat(Ve + 2) + "╗", n = "╠" + "═".repeat(Ve + 2) + "╣", o = "╚" + "═".repeat(Ve + 2) + "╝", s = [t];
2455
2453
  for (let r = 0; r < e.length; r++)
2456
- s.push("║ " + Es(e[r], Ve) + " ║"), r < e.length - 1 && s.push(n);
2454
+ s.push("║ " + Ps(e[r], Ve) + " ║"), r < e.length - 1 && s.push(n);
2457
2455
  return s.push(o), s;
2458
2456
  }
2459
- function Os() {
2457
+ function Es() {
2460
2458
  try {
2461
2459
  const e = Y(zo(import.meta.url)), t = [
2462
2460
  G(e, "package.json"),
@@ -2473,8 +2471,8 @@ function Os() {
2473
2471
  }
2474
2472
  return "";
2475
2473
  }
2476
- function Ds(e = {}) {
2477
- const t = e.title ?? "Nimpress", n = e.tagline ?? "Docs framework on Svelte", o = e.company ?? `Samna® ${(/* @__PURE__ */ new Date()).getFullYear()}`, s = e.version ?? "dev", r = e.localUrl ?? "http://localhost:5173/", i = e.networkUrl ?? "use --host to expose", c = typeof e.duration == "number" ? `ready in ${e.duration} ms` : "ready", u = e.nimpressVersion ?? Os(), h = [];
2474
+ function Cs(e = {}) {
2475
+ const t = e.title ?? "Nimpress", n = e.tagline ?? "Docs framework on Svelte", o = e.company ?? `Samna® ${(/* @__PURE__ */ new Date()).getFullYear()}`, s = e.version ?? "dev", r = e.localUrl ?? "http://localhost:5173/", i = e.networkUrl ?? "use --host to expose", c = typeof e.duration == "number" ? `ready in ${e.duration} ms` : "ready", u = e.nimpressVersion ?? Es(), h = [];
2478
2476
  h.push("");
2479
2477
  for (const v of at) h.push(Hn + v + ce);
2480
2478
  h.push("");
@@ -2484,12 +2482,12 @@ function Ds(e = {}) {
2484
2482
  `${Ae}Version${ce} ${s} ${Ae}${c}${ce}`
2485
2483
  ];
2486
2484
  u && g.push(`${Ae}Nimpress${ce} ${u}`), g.push(`${Ae}➜${ce} Local ${kt}${r}${ce}`), g.push(`${Ae}➜${ce} Network ${dt}${i}${ce}`);
2487
- const w = Cs(g), P = at[0].length, A = at[0].length - at[0].trimStart().length, T = Ve + 4, d = " ".repeat(Math.max(0, Math.floor((P + A - T) / 2)));
2485
+ const w = As(g), P = at[0].length, A = at[0].length - at[0].trimStart().length, T = Ve + 4, d = " ".repeat(Math.max(0, Math.floor((P + A - T) / 2)));
2488
2486
  for (const v of w) h.push(d + v);
2489
2487
  return h.push(""), h.join(`
2490
2488
  `);
2491
2489
  }
2492
- function Ts() {
2490
+ function Os() {
2493
2491
  try {
2494
2492
  const e = Oe(G(process.cwd(), "package.json"), "utf-8"), t = JSON.parse(e);
2495
2493
  return { name: t.name, version: t.version };
@@ -2497,10 +2495,10 @@ function Ts() {
2497
2495
  return {};
2498
2496
  }
2499
2497
  }
2500
- const Ms = 27, Ns = 14, Is = 16, Fs = 20, Rs = 17, Bs = 14, zn = 110, Ws = 60, Ls = 120, Ke = 40, Hs = 200, zs = 420, qs = 24, Us = 7.6, Js = 6.6, qn = 7.4, Gs = 5.4, Vs = 5.8, Xs = 6.2, Ys = 34, Ks = 48, bn = 8, Zs = 260, Qs = 18, er = 6.2, tr = 30, wn = 24, vn = 24;
2498
+ const Ds = 27, Ts = 14, Ms = 16, Ns = 20, Is = 17, Fs = 14, zn = 110, Rs = 60, Bs = 120, Ke = 40, Ws = 200, Ls = 420, Hs = 24, zs = 7.6, qs = 6.6, qn = 7.4, Us = 5.4, Js = 5.8, Gs = 6.2, Vs = 34, Xs = 48, bn = 8, Ys = 260, Ks = 18, Zs = 6.2, Qs = 30, wn = 24, vn = 24;
2501
2499
  class Yt extends Error {
2502
2500
  }
2503
- function nr(e) {
2501
+ function er(e) {
2504
2502
  const t = e?.diags;
2505
2503
  return Array.isArray(t) && t.length ? t.map((n) => {
2506
2504
  const o = n.location, s = o?.start?.line, r = o?.start?.column;
@@ -2508,23 +2506,23 @@ function nr(e) {
2508
2506
  }).join(`
2509
2507
  `) : e instanceof Error ? e.message : String(e);
2510
2508
  }
2511
- function or(e) {
2509
+ function tr(e) {
2512
2510
  try {
2513
2511
  return JSON.parse(qo.export(e, "json"));
2514
2512
  } catch (t) {
2515
- throw new Yt(nr(t));
2513
+ throw new Yt(er(t));
2516
2514
  }
2517
2515
  }
2518
- function sr(e) {
2516
+ function nr(e) {
2519
2517
  return (e.type?.type_name ?? "").trim();
2520
2518
  }
2521
- function rr(e) {
2519
+ function or(e) {
2522
2520
  const t = e.dbdefault;
2523
2521
  return !t || t.value === void 0 || t.value === null ? "" : String(t.value);
2524
2522
  }
2525
- const ar = /\[([^\]]+)\]\(([^)\s]+)\)/;
2526
- function ir(e) {
2527
- const t = String(e ?? "").trim(), n = ar.exec(t);
2523
+ const sr = /\[([^\]]+)\]\(([^)\s]+)\)/;
2524
+ function rr(e) {
2525
+ const t = String(e ?? "").trim(), n = sr.exec(t);
2528
2526
  return n ? {
2529
2527
  note: t.replace(n[0], "").replace(/\s{2,}/g, " ").trim(),
2530
2528
  label: n[1].trim(),
@@ -2540,36 +2538,36 @@ function ht(e, t, n) {
2540
2538
  function Et(e) {
2541
2539
  return e.reduce((t, n) => Math.max(t, n.length), 0);
2542
2540
  }
2543
- function cr(e, t) {
2544
- const n = Et(t.map((u) => u.name)) * Us, o = Et(t.map((u) => u.type)) * Js, s = Et(t.map((u) => u.linkLabel)) * Xs, r = t.some((u) => u.pk || u.fk) ? Ys : 0, i = Math.round(n + o + s + r + Ks), c = Math.round(e.length * qn + 32);
2545
- return Math.min(zs, Math.max(Hs, i, c));
2541
+ function ar(e, t) {
2542
+ const n = Et(t.map((u) => u.name)) * zs, o = Et(t.map((u) => u.type)) * qs, s = Et(t.map((u) => u.linkLabel)) * Gs, r = t.some((u) => u.pk || u.fk) ? Vs : 0, i = Math.round(n + o + s + r + Xs), c = Math.round(e.length * qn + 32);
2543
+ return Math.min(Ls, Math.max(Ws, i, c));
2546
2544
  }
2547
- function lr(e) {
2548
- const t = e.width - qs, n = Math.max(1, ht(e.name, qn, t)), o = ht(e.note, Gs, t), s = Fs + n * Rs + o * Bs, r = Math.max(e.columns.length, 1) * Ms, i = e.indexes.reduce(
2549
- (u, h) => u + ht(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`, Vs, t),
2545
+ function ir(e) {
2546
+ const t = e.width - Hs, n = Math.max(1, ht(e.name, qn, t)), o = ht(e.note, Us, t), s = Ns + n * Is + o * Fs, r = Math.max(e.columns.length, 1) * Ds, i = e.indexes.reduce(
2547
+ (u, h) => u + ht(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`, Js, t),
2550
2548
  0
2551
- ), c = e.indexes.length ? Is + i * Ns : 0;
2549
+ ), c = e.indexes.length ? Ms + i * Ts : 0;
2552
2550
  return Math.round(s + r + c + 2);
2553
2551
  }
2554
- function pr(e) {
2555
- const t = e.width - wn, n = ht(e.body, er, t), o = e.title ? tr : 0;
2556
- return Math.round(wn + o + Math.max(1, n) * Qs);
2552
+ function cr(e) {
2553
+ const t = e.width - wn, n = ht(e.body, Zs, t), o = e.title ? Qs : 0;
2554
+ return Math.round(wn + o + Math.max(1, n) * Ks);
2557
2555
  }
2558
- function ur(e, t, n) {
2556
+ function lr(e, t, n) {
2559
2557
  return e.x < t.x + t.width + n && t.x < e.x + e.width + n && e.y < t.y + t.height + n && t.y < e.y + e.height + n;
2560
2558
  }
2561
- function mr(e, t) {
2559
+ function pr(e, t) {
2562
2560
  const n = [...e].sort((o, s) => o.y - s.y || o.x - s.x);
2563
2561
  for (let o = 1; o < n.length; o++) {
2564
2562
  let s = !0, r = 0;
2565
2563
  for (; s && r < n.length; ) {
2566
2564
  s = !1, r += 1;
2567
2565
  for (let i = 0; i < o; i++)
2568
- ur(n[o], n[i], t) && (n[o].y = n[i].y + n[i].height + t, s = !0);
2566
+ lr(n[o], n[i], t) && (n[o].y = n[i].y + n[i].height + t, s = !0);
2569
2567
  }
2570
2568
  }
2571
2569
  }
2572
- function fr(e, t) {
2570
+ function ur(e, t) {
2573
2571
  const n = /* @__PURE__ */ new Map();
2574
2572
  for (const c of e) n.set(c.id, /* @__PURE__ */ new Set());
2575
2573
  for (const [c, u] of t)
@@ -2593,7 +2591,7 @@ function fr(e, t) {
2593
2591
  }
2594
2592
  return r;
2595
2593
  }
2596
- function dr(e, t) {
2594
+ function mr(e, t) {
2597
2595
  const n = new Set(e.map((h) => h.id)), o = /* @__PURE__ */ new Map();
2598
2596
  for (const h of e) o.set(h.id, /* @__PURE__ */ new Set());
2599
2597
  for (const [h, g] of t)
@@ -2619,24 +2617,24 @@ function dr(e, t) {
2619
2617
  }
2620
2618
  return u;
2621
2619
  }
2622
- function hr(e, t) {
2620
+ function fr(e, t) {
2623
2621
  const n = [];
2624
2622
  let o = Ke;
2625
- for (const s of fr(e, t)) {
2623
+ for (const s of ur(e, t)) {
2626
2624
  let r = Ke, i = o;
2627
- for (const c of dr(s, t)) {
2625
+ for (const c of mr(s, t)) {
2628
2626
  const u = Math.max(...c.map((g) => g.width));
2629
2627
  let h = o;
2630
2628
  for (const g of c)
2631
- g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height + Ws, i = Math.max(i, g.y + g.height), n.push(g);
2629
+ g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height + Rs, i = Math.max(i, g.y + g.height), n.push(g);
2632
2630
  r += u + zn;
2633
2631
  }
2634
- o = i + Ls;
2632
+ o = i + Bs;
2635
2633
  }
2636
2634
  return n;
2637
2635
  }
2638
- function gr(e) {
2639
- const t = or(e), n = Object.values(t.database)[0], o = /* @__PURE__ */ new Map(), s = [];
2636
+ function dr(e) {
2637
+ const t = tr(e), n = Object.values(t.database)[0], o = /* @__PURE__ */ new Map(), s = [];
2640
2638
  for (const x of Object.values(t.schemas).sort((E, I) => E.id - I.id))
2641
2639
  for (const E of x.tableIds)
2642
2640
  s.push(E), o.set(E, x.name);
@@ -2660,12 +2658,12 @@ function gr(e) {
2660
2658
  E.fieldIds.forEach((ge) => {
2661
2659
  const oe = t.fields[String(ge)];
2662
2660
  if (!oe) return;
2663
- const de = !!oe.pk || r.has(oe.id), be = ir(oe.note ?? "");
2661
+ const de = !!oe.pk || r.has(oe.id), be = rr(oe.note ?? "");
2664
2662
  h.set(oe.id, re.length), g.set(oe.id, K), re.push({
2665
2663
  name: oe.name,
2666
- type: sr(oe),
2664
+ type: nr(oe),
2667
2665
  note: be.note,
2668
- default: rr(oe),
2666
+ default: or(oe),
2669
2667
  pk: de,
2670
2668
  fk: !1,
2671
2669
  unique: !!oe.unique,
@@ -2696,10 +2694,10 @@ function gr(e) {
2696
2694
  indexes: he,
2697
2695
  x: 0,
2698
2696
  y: 0,
2699
- width: cr(H, re),
2697
+ width: ar(H, re),
2700
2698
  height: 0
2701
2699
  };
2702
- te.height = lr(te), i.push(te), c.set(K, te), u.set(E.name, K), u.set(H, K);
2700
+ te.height = ir(te), i.push(te), c.set(K, te), u.set(E.name, K), u.set(H, K);
2703
2701
  }
2704
2702
  for (const x of i)
2705
2703
  for (const E of x.columns) {
@@ -2731,7 +2729,7 @@ function gr(e) {
2731
2729
  });
2732
2730
  }
2733
2731
  }
2734
- const P = hr(
2732
+ const P = fr(
2735
2733
  i,
2736
2734
  w.map((x) => [x.parent, x.child])
2737
2735
  ), A = P.length ? P : i, T = [], d = A.reduce((x, E) => Math.max(x, E.x + E.width), Ke);
@@ -2746,12 +2744,12 @@ function gr(e) {
2746
2744
  body: E,
2747
2745
  x: D,
2748
2746
  y: v,
2749
- width: Zs,
2747
+ width: Ys,
2750
2748
  height: 0
2751
2749
  };
2752
- I.height = pr(I), T.push(I), v += I.height + vn;
2750
+ I.height = cr(I), T.push(I), v += I.height + vn;
2753
2751
  }
2754
- mr([...A, ...T], vn);
2752
+ pr([...A, ...T], vn);
2755
2753
  const R = [];
2756
2754
  for (const x of w) {
2757
2755
  const E = c.get(x.parent), I = c.get(x.child);
@@ -2774,9 +2772,9 @@ function gr(e) {
2774
2772
  };
2775
2773
  }
2776
2774
  function Un(e) {
2777
- return JSON.stringify(gr(e));
2775
+ return JSON.stringify(dr(e));
2778
2776
  }
2779
- function _r(e, t, n = "") {
2777
+ function hr(e, t, n = "") {
2780
2778
  const o = e.match(/<script[^>]*\bsetup\b[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = e.match(/<template>([\s\S]*)<\/template>/)?.[1] ?? "", r = `${o}
2781
2779
  ${n}`;
2782
2780
  let i = null;
@@ -2837,7 +2835,7 @@ ${n}`;
2837
2835
  (d.bindable || A.includes(`update:${d.name}`)) && (d.bindable = !0, A.includes(`update:${d.name}`) || A.push(`update:${d.name}`));
2838
2836
  return { component: t, props: g, slots: w, emits: A };
2839
2837
  }
2840
- function yr(e, t, n = "") {
2838
+ function gr(e, t, n = "") {
2841
2839
  const o = e.match(/<script[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = `${o}
2842
2840
  ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$props\(\)/), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
2843
2841
  if (r)
@@ -2900,7 +2898,7 @@ function Jn(e, t = []) {
2900
2898
  }
2901
2899
  return t;
2902
2900
  }
2903
- function br(e, t, n) {
2901
+ function _r(e, t, n) {
2904
2902
  const o = q(e, "node_modules", t);
2905
2903
  if (!fe(o) || !gt(o).isDirectory()) return null;
2906
2904
  const s = [
@@ -2915,7 +2913,7 @@ function br(e, t, n) {
2915
2913
  }
2916
2914
  return null;
2917
2915
  }
2918
- function _i(e, t) {
2916
+ function fi(e, t) {
2919
2917
  const n = yt(e, `${t}Props`) ?? yt(e, "Props");
2920
2918
  if (!n) return;
2921
2919
  const o = [], s = [], r = [];
@@ -2952,7 +2950,7 @@ function Ot(e, t) {
2952
2950
  const s = Qe(e, o + 1);
2953
2951
  return e.slice(0, n) + e.slice(o + 1 + s.length + 1);
2954
2952
  }
2955
- function wr(e, t) {
2953
+ function yr(e, t) {
2956
2954
  const n = e.match(/^\s*\/\/\s*story:\s*(.+)$/m)?.[1]?.trim(), o = Ot(Ot(e, "props"), "slots"), s = Ct(o, "sidebar"), r = Ot(o, "sidebar"), i = r.match(/\bname\s*:\s*['"]([^'"]+)['"]/)?.[1], c = r.match(/\bdescription\s*:\s*['"]([^'"]+)['"]/)?.[1], u = Ct(e, "props"), h = Ct(e, "slots");
2957
2955
  return {
2958
2956
  name: n ?? i ?? Ce(t).replace(/\.story\.tsx?$/, "").replace(/_/g, " "),
@@ -2963,7 +2961,7 @@ function wr(e, t) {
2963
2961
  sidebar: s
2964
2962
  };
2965
2963
  }
2966
- async function vr(e) {
2964
+ async function br(e) {
2967
2965
  let t;
2968
2966
  try {
2969
2967
  t = await Ut(e, { withFileTypes: !0 });
@@ -2979,7 +2977,7 @@ async function vr(e) {
2979
2977
  } catch {
2980
2978
  continue;
2981
2979
  }
2982
- n.push(wr(s, o.name));
2980
+ n.push(yr(s, o.name));
2983
2981
  }
2984
2982
  return n.sort((o, s) => o.name.localeCompare(s.name)), n;
2985
2983
  }
@@ -3053,19 +3051,19 @@ function et(e, t) {
3053
3051
  }
3054
3052
  async function Zt(e, t, n) {
3055
3053
  try {
3056
- return await Nr(Y(e), e, t, n);
3054
+ return await Tr(Y(e), e, t, n);
3057
3055
  } catch (o) {
3058
3056
  console.warn(`nimpress modules: schema parse failed for ${n}: ${String(o)}`);
3059
3057
  return;
3060
3058
  }
3061
3059
  }
3062
- const kr = ["description", "default", "enum", "mock", "format", "minimum", "maximum", "title"], $r = ["type", "tsType", "bindable"];
3060
+ const wr = ["description", "default", "enum", "mock", "format", "minimum", "maximum", "title"], vr = ["type", "tsType", "bindable"];
3063
3061
  function Ze(e, t) {
3064
3062
  const n = { ...e }, o = n, s = t;
3065
- for (const r of $r)
3063
+ for (const r of vr)
3066
3064
  s[r] !== void 0 && (o[r] = s[r]);
3067
3065
  t.type !== void 0 && t.tsType === void 0 && delete n.tsType, t.required !== void 0 && (n.required = t.required);
3068
- for (const r of kr)
3066
+ for (const r of wr)
3069
3067
  o[r] === void 0 && s[r] !== void 0 && (o[r] = s[r]);
3070
3068
  if (t.properties) {
3071
3069
  const r = {};
@@ -3100,21 +3098,21 @@ function Qt(e, t) {
3100
3098
  return { merged: { ...e, ...t, properties: s, slots: r, emits: i }, report: o };
3101
3099
  }
3102
3100
  const Xe = [], kn = /* @__PURE__ */ new Set();
3103
- function xr(e) {
3101
+ function kr(e) {
3104
3102
  return `${e.component}|${e.kind}|${e.path}`;
3105
3103
  }
3106
3104
  function $n(e) {
3107
3105
  for (const t of e) {
3108
- const n = xr(t);
3106
+ const n = kr(t);
3109
3107
  kn.has(n) || (kn.add(n), Xe.push(t));
3110
3108
  }
3111
3109
  }
3112
- const Sr = {
3110
+ const $r = {
3113
3111
  opaque: "author opaque members in the schema with enum or properties, or type them in the source",
3114
3112
  undocumented: "describe them in the schema or above the type member in the source",
3115
3113
  orphan: "remove the schema member or restore it in the source"
3116
3114
  };
3117
- function jr(e) {
3115
+ function xr(e) {
3118
3116
  const t = e.match(/^type (.+) is opaque$/);
3119
3117
  return t ? `${Me}type${ce} ${t[1]} ${Me}is opaque${ce}` : `${Me}${e}${ce}`;
3120
3118
  }
@@ -3135,10 +3133,10 @@ function Je(e = process.cwd()) {
3135
3133
  const h = Math.max(...c.map((w) => (w.line ? `L${w.line}` : "·").length)), g = Math.max(...c.map((w) => (w.path || "(component)").length));
3136
3134
  for (const w of c) {
3137
3135
  const P = (w.line ? `L${w.line}` : "·").padStart(h), A = (w.path || "(component)").padEnd(g);
3138
- r.push(` ${Me}${P}${ce} ${Ae}${A}${ce} ${jr(w.detail)}`);
3136
+ r.push(` ${Me}${P}${ce} ${Ae}${A}${ce} ${xr(w.detail)}`);
3139
3137
  }
3140
3138
  for (const w of new Set(c.map((P) => P.kind)))
3141
- r.push(` ${Ae}→${ce} ${dt}${Sr[w]}${ce}`);
3139
+ r.push(` ${Ae}→${ce} ${dt}${$r[w]}${ce}`);
3142
3140
  r.push(` ${Ae}→${ce} ${dt}then run${ce} nimpress modules update ${i}`), r.push("");
3143
3141
  }
3144
3142
  console.warn(r.join(`
@@ -3192,7 +3190,7 @@ async function en(e, t, n, o) {
3192
3190
  $n(Sn(t, h, { sourceFile: o, sourceText: r, report: g }));
3193
3191
  }
3194
3192
  const jn = /* @__PURE__ */ new Map();
3195
- async function Pr(e, t, n, o) {
3193
+ async function Sr(e, t, n, o) {
3196
3194
  let s;
3197
3195
  try {
3198
3196
  s = await ie(n, "utf-8");
@@ -3205,7 +3203,7 @@ async function Pr(e, t, n, o) {
3205
3203
  const i = await Zt(n, o, t);
3206
3204
  i && await en(e, t, i, n);
3207
3205
  }
3208
- async function yi(e, t) {
3206
+ async function di(e, t) {
3209
3207
  const n = nt(e);
3210
3208
  if (!n) {
3211
3209
  await pe(q(e, "schema.json"), et(t, "json"));
@@ -3218,7 +3216,7 @@ function Lt(e) {
3218
3216
  const t = Jt(e);
3219
3217
  return t === ".vue" ? "vue" : t === ".svelte" ? "svelte" : null;
3220
3218
  }
3221
- function Ar(e, t, n) {
3219
+ function jr(e, t, n) {
3222
3220
  for (const [o, s] of Object.entries(t.modules.systems)) {
3223
3221
  if (!s.source) continue;
3224
3222
  const r = G(e, s.source);
@@ -3226,19 +3224,19 @@ function Ar(e, t, n) {
3226
3224
  }
3227
3225
  return null;
3228
3226
  }
3229
- function Er(e, t, n) {
3227
+ function Pr(e, t, n) {
3230
3228
  return e.find((o) => o.system === t && o.component === n);
3231
3229
  }
3232
- async function Cr(e, t, n) {
3230
+ async function Ar(e, t, n) {
3233
3231
  const o = await Kt(e, t.contentDir), s = G(e, n);
3234
3232
  if ((n.includes("/") || n.includes("\\")) && fe(s)) {
3235
3233
  const h = Lt(s);
3236
3234
  if (!h)
3237
3235
  throw new Error(`[nimpress] modules: ${n} is not a .vue or .svelte component file`);
3238
- const g = Ce(s, Jt(s)), w = Ar(e, t, s);
3236
+ const g = Ce(s, Jt(s)), w = jr(e, t, s);
3239
3237
  if (!w)
3240
3238
  throw new Error(`[nimpress] modules: ${n} sits under no configured system source`);
3241
- const P = Er(o, w, g);
3239
+ const P = Pr(o, w, g);
3242
3240
  if (!P)
3243
3241
  throw new Error(
3244
3242
  `[nimpress] modules: no component page found for ${w}/${g}, run nimpress modules create ${w} ${g} first`
@@ -3266,17 +3264,17 @@ async function Cr(e, t, n) {
3266
3264
  pageDir: Y(i.pageFile)
3267
3265
  };
3268
3266
  }
3269
- async function Or(e, t, n) {
3270
- const o = await Cr(e, t, n), s = await Zt(o.componentFile, o.framework, o.component);
3267
+ async function Er(e, t, n) {
3268
+ const o = await Ar(e, t, n), s = await Zt(o.componentFile, o.framework, o.component);
3271
3269
  if (!s)
3272
3270
  throw new Error(`[nimpress] modules: schema parse produced nothing for ${o.component}`);
3273
3271
  await en(o.pageDir, o.component, s);
3274
3272
  const r = nt(o.pageDir);
3275
3273
  return je(e, r?.path ?? q(o.pageDir, "schema.json"));
3276
3274
  }
3277
- async function bi(e, t, n = {}) {
3275
+ async function hi(e, t, n = {}) {
3278
3276
  if (n.ref)
3279
- return await Or(e, t, n.ref), 1;
3277
+ return await Er(e, t, n.ref), 1;
3280
3278
  const o = await Kt(e, t.contentDir);
3281
3279
  let s = 0;
3282
3280
  for (const r of o) {
@@ -3291,7 +3289,7 @@ async function bi(e, t, n = {}) {
3291
3289
  }
3292
3290
  return s;
3293
3291
  }
3294
- function Dr(e) {
3292
+ function Cr(e) {
3295
3293
  let t = e;
3296
3294
  for (let n = 0; n < 8; n++) {
3297
3295
  if (t.endsWith("/src")) return t;
@@ -3305,8 +3303,8 @@ function Pn(e, t) {
3305
3303
  return !e.endsWith(".vue") && !e.endsWith(".svelte") ? t : [...t.matchAll(/<script[^>]*>([\s\S]*?)<\/script>/g)].map((n) => n[1]).join(`
3306
3304
  `);
3307
3305
  }
3308
- async function Tr(e, t, n) {
3309
- const o = Dr(e), s = /* @__PURE__ */ new Set([G(t)]), r = [{ file: t, text: n, depth: 0 }];
3306
+ async function Or(e, t, n) {
3307
+ const o = Cr(e), s = /* @__PURE__ */ new Set([G(t)]), r = [{ file: t, text: n, depth: 0 }];
3310
3308
  let i = "";
3311
3309
  for (; r.length; ) {
3312
3310
  const c = r.shift();
@@ -3316,7 +3314,7 @@ async function Tr(e, t, n) {
3316
3314
  const g = h[1];
3317
3315
  let w = null;
3318
3316
  if (g.startsWith(".") ? w = G(Y(c.file), g) : g.startsWith("@/") && o && (w = G(o, g.slice(2))), !w || !ke(w)) continue;
3319
- const A = [w, `${w}.ts`, `${w}.vue`, q(w, "index.ts")].find((v) => Mr(v));
3317
+ const A = [w, `${w}.ts`, `${w}.vue`, q(w, "index.ts")].find((v) => Dr(v));
3320
3318
  if (!A) continue;
3321
3319
  const T = G(A);
3322
3320
  if (s.has(T) || s.size > 50) continue;
@@ -3328,21 +3326,21 @@ async function Tr(e, t, n) {
3328
3326
  }
3329
3327
  return i;
3330
3328
  }
3331
- function Mr(e) {
3329
+ function Dr(e) {
3332
3330
  try {
3333
3331
  return gt(e).isFile();
3334
3332
  } catch {
3335
3333
  return !1;
3336
3334
  }
3337
3335
  }
3338
- async function Nr(e, t, n, o) {
3336
+ async function Tr(e, t, n, o) {
3339
3337
  const s = await ie(t, "utf-8");
3340
3338
  let r = "";
3341
3339
  for (const c of Le(e))
3342
3340
  c.endsWith(".ts") && (c.endsWith(".stories.ts") || c.endsWith(".story.ts") || (r += await ie(q(e, c), "utf-8"), r += `
3343
3341
  `));
3344
- r += await Tr(e, t, s);
3345
- const i = n === "vue" ? _r(s, o, r) : yr(s, o, r);
3342
+ r += await Or(e, t, s);
3343
+ const i = n === "vue" ? hr(s, o, r) : gr(s, o, r);
3346
3344
  for (const c of i.props) {
3347
3345
  if (!c.format) {
3348
3346
  const u = Xo(c);
@@ -3352,12 +3350,12 @@ async function Nr(e, t, n, o) {
3352
3350
  }
3353
3351
  return i;
3354
3352
  }
3355
- async function Ir(e) {
3356
- const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), u = typeof s.file == "string" ? s.file : void 0, h = await vr(Y(o)), g = $t(t, n, i, c, u), w = [];
3353
+ async function Mr(e) {
3354
+ const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), u = typeof s.file == "string" ? s.file : void 0, h = await br(Y(o)), g = $t(t, n, i, c, u), w = [];
3357
3355
  if (r && g) {
3358
3356
  const x = g.componentFile.endsWith(".svelte") ? "svelte" : "vue";
3359
3357
  try {
3360
- await Pr(Y(o), c, g.componentFile, x);
3358
+ await Sr(Y(o), c, g.componentFile, x);
3361
3359
  } catch (E) {
3362
3360
  console.warn(`nimpress modules: ${i}/${c} schema upsert failed: ${String(E)}`);
3363
3361
  }
@@ -3381,7 +3379,7 @@ async function Ir(e) {
3381
3379
  else {
3382
3380
  const x = typeof s.package == "string" ? s.package : n.systems[i]?.package;
3383
3381
  if (x) {
3384
- const E = br(t, x, c);
3382
+ const E = _r(t, x, c);
3385
3383
  if (E) {
3386
3384
  const I = E.replace(/[^/]+$/, "CLAUDE.md");
3387
3385
  fe(I) && (T = await ie(I, "utf-8"));
@@ -3414,10 +3412,10 @@ function Vn(e, t) {
3414
3412
  function Xn(e, t, ...n) {
3415
3413
  return G(e, t.paths.cache, ...n);
3416
3414
  }
3417
- function wi(e, t) {
3415
+ function gi(e, t) {
3418
3416
  return q(e, t.paths.guarded);
3419
3417
  }
3420
- function Fr(e) {
3418
+ function Nr(e) {
3421
3419
  const t = /* @__PURE__ */ new Map();
3422
3420
  for (const c of Object.values(e))
3423
3421
  c.type === "chunk" && t.set(c.fileName, c);
@@ -3445,7 +3443,7 @@ function Yn() {
3445
3443
  name: "nimpress:chunk-cycle-guard",
3446
3444
  apply: "build",
3447
3445
  generateBundle(e, t) {
3448
- const n = Fr(t);
3446
+ const n = Nr(t);
3449
3447
  if (!n.length) return;
3450
3448
  const o = n.map((s) => {
3451
3449
  const r = s.chunks.join(" -> "), i = s.modules.map((c) => ` ${c}`).join(`
@@ -3472,17 +3470,17 @@ function tn(e, t) {
3472
3470
  }
3473
3471
  return n;
3474
3472
  }
3475
- function vi(e) {
3476
- const { cwd: t, command: n, resolved: o, htmlInput: s } = e, r = {
3473
+ async function _i(e) {
3474
+ const { cwd: t, command: n, resolved: o, htmlInput: s } = e, { svelte: r } = await import("@sveltejs/vite-plugin-svelte"), { default: i } = await import("@tailwindcss/vite"), c = {
3477
3475
  root: t,
3478
3476
  base: o.base,
3479
3477
  configFile: !1,
3480
3478
  publicDir: !1,
3481
3479
  appType: "custom",
3482
3480
  plugins: [
3483
- es({ compilerOptions: { runes: !0, dev: n === "serve" } }),
3484
- ts(),
3485
- Ja({ ...o, modules: Object.values(o.modules.systems) }),
3481
+ r({ compilerOptions: { runes: !0, dev: n === "serve" } }),
3482
+ i(),
3483
+ qa({ ...o, modules: Object.values(o.modules.systems) }),
3486
3484
  Yn()
3487
3485
  ],
3488
3486
  cacheDir: Xn(t, o, "site"),
@@ -3493,14 +3491,14 @@ function vi(e) {
3493
3491
  ...s ? { rollupOptions: { input: s } } : {}
3494
3492
  }
3495
3493
  };
3496
- return tn(r, o.vite);
3494
+ return tn(c, o.vite);
3497
3495
  }
3498
- const Rr = 6161, Ht = "virtual:nimpress-harness/";
3496
+ const Ir = 6161, Ht = "virtual:nimpress-harness/";
3499
3497
  function zt(e, t) {
3500
3498
  const n = e.systems[t]?.port;
3501
3499
  if (n) return n;
3502
3500
  const o = Object.keys(e.systems).sort();
3503
- return Rr + Math.max(0, o.indexOf(t));
3501
+ return Ir + Math.max(0, o.indexOf(t));
3504
3502
  }
3505
3503
  function Kn(e, t) {
3506
3504
  return `${Ht}${e}/${t}/entry`;
@@ -3699,7 +3697,7 @@ const activeStoryDef = activeLoader ? (await activeLoader()).default : null`;
3699
3697
  function to(e) {
3700
3698
  return e ? `import harnessSetup from ${JSON.stringify(e)}` : "const harnessSetup = null";
3701
3699
  }
3702
- function Br(e, t, n, o, s) {
3700
+ function Fr(e, t, n, o, s) {
3703
3701
  const r = t.map((c) => `import ${JSON.stringify(c)}`).join(`
3704
3702
  `), i = o ? `import HarnessOverride from ${JSON.stringify(o)}` : "const HarnessOverride = null";
3705
3703
  return `import { createApp, h } from 'vue'
@@ -3793,7 +3791,7 @@ try {
3793
3791
  parent.postMessage({ type: 'nimpress:ready' }, '*')
3794
3792
  `;
3795
3793
  }
3796
- function Wr(e, t, n, o, s) {
3794
+ function Rr(e, t, n, o, s) {
3797
3795
  const r = t.map((c) => `import ${JSON.stringify(c)}`).join(`
3798
3796
  `), i = o ? `import HarnessOverride from ${JSON.stringify(o)}` : "const HarnessOverride = null";
3799
3797
  return `import { mount, createRawSnippet } from 'svelte'
@@ -3860,7 +3858,7 @@ try {
3860
3858
  parent.postMessage({ type: 'nimpress:ready' }, '*')
3861
3859
  `;
3862
3860
  }
3863
- function Lr(e) {
3861
+ function Br(e) {
3864
3862
  if (!e.schemaFile || !fe(e.schemaFile)) return {};
3865
3863
  let t;
3866
3864
  try {
@@ -3876,9 +3874,9 @@ function Lr(e) {
3876
3874
  }
3877
3875
  return o;
3878
3876
  }
3879
- function Hr(e, t, n, o, s) {
3880
- const r = Lr(t);
3881
- return e === "vue" ? Br(t, n, o, s, r) : Wr(t, n, o, s, r);
3877
+ function Wr(e, t, n, o, s) {
3878
+ const r = Br(t);
3879
+ return e === "vue" ? Fr(t, n, o, s, r) : Rr(t, n, o, s, r);
3882
3880
  }
3883
3881
  function An(e, t, n) {
3884
3882
  const o = n.map((s) => ` <link rel="stylesheet" href="${s}" />`).join(`
@@ -3908,7 +3906,7 @@ ${o ? o + `
3908
3906
  </html>
3909
3907
  `;
3910
3908
  }
3911
- async function zr(e, t) {
3909
+ async function Lr(e, t) {
3912
3910
  if (t === "svelte") {
3913
3911
  const { svelte: c } = await import("@sveltejs/vite-plugin-svelte");
3914
3912
  return c();
@@ -3928,13 +3926,13 @@ async function zr(e, t) {
3928
3926
  }
3929
3927
  return i;
3930
3928
  }
3931
- function qr(e, t, n, o) {
3929
+ function Hr(e, t, n, o) {
3932
3930
  const s = t.systems[n];
3933
3931
  if (!s) return [];
3934
3932
  const r = [];
3935
3933
  for (const i of o) {
3936
3934
  if (i.system !== n) continue;
3937
- const c = Ur(i.pageFile), u = nt(Y(i.pageFile))?.path ?? q(Y(i.pageFile), "schema.json"), h = s.source ? $t(e, t, n, i.component, i.file) : null;
3935
+ const c = zr(i.pageFile), u = nt(Y(i.pageFile))?.path ?? q(Y(i.pageFile), "schema.json"), h = s.source ? $t(e, t, n, i.component, i.file) : null;
3938
3936
  if (h) {
3939
3937
  r.push({ component: i.component, importSpec: h.componentFile, storyFiles: c, schemaFile: u });
3940
3938
  continue;
@@ -3948,7 +3946,7 @@ function qr(e, t, n, o) {
3948
3946
  }
3949
3947
  return r;
3950
3948
  }
3951
- function Ur(e) {
3949
+ function zr(e) {
3952
3950
  const t = Y(e);
3953
3951
  let n;
3954
3952
  try {
@@ -3961,22 +3959,22 @@ function Ur(e) {
3961
3959
  path: q(t, o)
3962
3960
  }));
3963
3961
  }
3964
- function Jr(e, t) {
3962
+ function qr(e, t) {
3965
3963
  if (t.setup)
3966
3964
  return t.setup.startsWith(".") || ke(t.setup) ? G(e, t.setup) : t.setup;
3967
3965
  }
3968
- function Gr(e, t) {
3966
+ function Ur(e, t) {
3969
3967
  if (t.harness)
3970
3968
  return t.harness.startsWith(".") || ke(t.harness) ? G(e, t.harness) : t.harness;
3971
3969
  }
3972
- function Vr(e, t, n, o, s) {
3970
+ function Jr(e, t, n, o, s) {
3973
3971
  const r = (t.css ?? []).map(
3974
3972
  (P) => P.startsWith(".") || ke(P) ? G(e, P) : P
3975
- ), i = Jr(e, t), c = Gr(e, t), u = new Map(o.map((P) => [P.component, P])), h = "\0" + Ht, g = (P) => {
3973
+ ), i = qr(e, t), c = Ur(e, t), u = new Map(o.map((P) => [P.component, P])), h = "\0" + Ht, g = (P) => {
3976
3974
  if (!P.startsWith(h)) return null;
3977
3975
  const A = P.slice(h.length).split("/");
3978
3976
  return A[0] === n && A[1] ? A[1] : null;
3979
- }, w = (P) => Hr(t.framework, P, r, i, c);
3977
+ }, w = (P) => Wr(t.framework, P, r, i, c);
3980
3978
  return {
3981
3979
  name: "nimpress:harness",
3982
3980
  resolveId(P) {
@@ -4038,18 +4036,18 @@ function Vr(e, t, n, o, s) {
4038
4036
  }
4039
4037
  };
4040
4038
  }
4041
- async function ki(e, t, n, o) {
4039
+ async function yi(e, t, n, o) {
4042
4040
  const s = t.modules, r = s.systems[n];
4043
4041
  if (!r) throw new Error(`[nimpress] unknown module system: ${n}`);
4044
- const i = await Kt(e, t.contentDir), c = qr(e, s, n, i);
4042
+ const i = await Kt(e, t.contentDir), c = Hr(e, s, n, i);
4045
4043
  c.length || console.warn(`[nimpress] modules: no component pages found for system ${n}`);
4046
- const u = await zr(e, r.framework), h = r.source ? G(e, r.source) : e, g = s.route.replace(/\/$/, ""), w = `${g}/${n}/`, P = o === "build" ? we(t.base, w) : w, A = c.filter((d) => ke(d.importSpec)).map((d) => d.importSpec).concat(c.flatMap((d) => (d.storyFiles ?? []).map((v) => v.path))), T = {
4044
+ const u = await Lr(e, r.framework), h = r.source ? G(e, r.source) : e, g = s.route.replace(/\/$/, ""), w = `${g}/${n}/`, P = o === "build" ? we(t.base, w) : w, A = c.filter((d) => ke(d.importSpec)).map((d) => d.importSpec).concat(c.flatMap((d) => (d.storyFiles ?? []).map((v) => v.path))), T = {
4047
4045
  root: e,
4048
4046
  configFile: !1,
4049
4047
  publicDir: !1,
4050
4048
  appType: "mpa",
4051
4049
  cacheDir: Xn(e, t, "modules", n),
4052
- plugins: [Vr(e, r, n, c, P), u, Yn()],
4050
+ plugins: [Jr(e, r, n, c, P), u, Yn()],
4053
4051
  resolve: r.framework === "vue" ? { alias: { vue: "vue/dist/vue.esm-bundler.js" } } : void 0,
4054
4052
  optimizeDeps: {
4055
4053
  entries: A,
@@ -4078,7 +4076,7 @@ async function ki(e, t, n, o) {
4078
4076
  };
4079
4077
  return tn(T, t.vite);
4080
4078
  }
4081
- function Xr(e, t = "virtual:nimpress/main") {
4079
+ function Gr(e, t = "virtual:nimpress/main") {
4082
4080
  const n = e.logo ? `
4083
4081
  <link rel="icon" href="${e.logo}" />` : "", o = JSON.stringify(vt(e).map(wt)), s = JSON.stringify(wt(e.theme));
4084
4082
  return `<!doctype html>
@@ -4108,11 +4106,11 @@ function Xr(e, t = "virtual:nimpress/main") {
4108
4106
  </html>
4109
4107
  `;
4110
4108
  }
4111
- const it = "virtual:nimpress/manifest", ct = "virtual:nimpress/search", lt = "virtual:nimpress/pages", pt = "virtual:nimpress/bodies", Dt = "virtual:nimpress/config", Tt = "virtual:nimpress/main", Ge = "virtual:nimpress/page-component/", We = "virtual:nimpress/page-body/", Mt = 20, Yr = "https://github.com/nimling/nimpress";
4109
+ const it = "virtual:nimpress/manifest", ct = "virtual:nimpress/search", lt = "virtual:nimpress/pages", pt = "virtual:nimpress/bodies", Dt = "virtual:nimpress/config", Tt = "virtual:nimpress/main", Ge = "virtual:nimpress/page-component/", We = "virtual:nimpress/page-body/", Mt = 20, Vr = "https://github.com/nimling/nimpress";
4112
4110
  function ye(e) {
4113
4111
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
4114
4112
  }
4115
- function Kr(e) {
4113
+ function Xr(e) {
4116
4114
  return `<![CDATA[${e.replace(/\]\]>/g, "]]]]><![CDATA[>")}]]>`;
4117
4115
  }
4118
4116
  function En(e) {
@@ -4156,15 +4154,15 @@ const Nt = [
4156
4154
  "DotBot",
4157
4155
  "MJ12bot"
4158
4156
  ];
4159
- function Zr(e) {
4157
+ function Yr(e) {
4160
4158
  return `<script type="application/ld+json">${(typeof e == "string" ? e : JSON.stringify(e)).replace(/</g, "\\u003c")}<\/script>`;
4161
4159
  }
4162
- const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidden" || e.visibility === "dev-only", ut = (e) => e.visibility === "dev-only", Qr = {
4160
+ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidden" || e.visibility === "dev-only", ut = (e) => e.visibility === "dev-only", Kr = {
4163
4161
  milestone: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" x2="4" y1="22" y2="15"/></svg>',
4164
4162
  epic: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>',
4165
4163
  feature: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></svg>',
4166
4164
  bug: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>'
4167
- }, ea = m.object({
4165
+ }, Zr = m.object({
4168
4166
  title: m.string().optional(),
4169
4167
  description: m.string().optional(),
4170
4168
  type: m.string().optional(),
@@ -4173,7 +4171,7 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4173
4171
  url: m.string().optional(),
4174
4172
  siteName: m.string().optional(),
4175
4173
  locale: m.string().optional()
4176
- }).passthrough(), ta = m.object({
4174
+ }).passthrough(), Qr = m.object({
4177
4175
  card: m.string().optional(),
4178
4176
  site: m.string().optional(),
4179
4177
  creator: m.string().optional(),
@@ -4181,7 +4179,7 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4181
4179
  description: m.string().optional(),
4182
4180
  image: m.string().optional(),
4183
4181
  imageAlt: m.string().optional()
4184
- }).passthrough(), na = m.object({
4182
+ }).passthrough(), ea = m.object({
4185
4183
  override: m.boolean().optional(),
4186
4184
  ai: m.boolean().optional(),
4187
4185
  description: m.string().optional(),
@@ -4190,8 +4188,8 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4190
4188
  keywords: m.union([m.string(), m.array(m.string())]).optional(),
4191
4189
  author: m.string().optional(),
4192
4190
  themeColor: m.string().optional(),
4193
- og: ea.optional(),
4194
- twitter: ta.optional(),
4191
+ og: Zr.optional(),
4192
+ twitter: Qr.optional(),
4195
4193
  jsonLd: m.unknown().optional()
4196
4194
  }).passthrough(), no = m.object({
4197
4195
  title: m.string().optional(),
@@ -4223,10 +4221,10 @@ const It = (e) => e.visibility === "hidden", Se = (e) => e.visibility === "hidde
4223
4221
  subscribe: m.boolean().optional(),
4224
4222
  feedback: m.boolean().optional(),
4225
4223
  styles: m.array(m.string()).optional(),
4226
- meta: na.optional(),
4224
+ meta: ea.optional(),
4227
4225
  data: m.record(m.unknown()).optional()
4228
4226
  }).passthrough(), oo = /* @__PURE__ */ new Set(["doc", "openapi", "changelog", "hero", "fullpage", "404", "section", "tags", "glossary", "team", "pricing", "roadmap", "dbml", "milestone", "epic", "feature", "bug", "component"]), Ne = /* @__PURE__ */ new Map();
4229
- function oa(e, t) {
4227
+ function ta(e, t) {
4230
4228
  Ne.clear();
4231
4229
  for (const [n, o] of Object.entries(t)) {
4232
4230
  const s = G(e, o), r = s.replace(/\.svelte$/, ".schema.json");
@@ -4240,17 +4238,17 @@ function oa(e, t) {
4240
4238
  Ne.set(n, { file: o, schema: i });
4241
4239
  }
4242
4240
  }
4243
- function sa(e) {
4241
+ function na(e) {
4244
4242
  return Array.isArray(e) ? "array" : e === null ? "null" : typeof e;
4245
4243
  }
4246
- function ra(e, t) {
4244
+ function oa(e, t) {
4247
4245
  const n = Ne.get(e)?.schema;
4248
4246
  if (!n) return [];
4249
4247
  const o = [];
4250
4248
  for (const s of n.required ?? [])
4251
4249
  t[s] === void 0 && o.push(`type ${e} requires data.${s}`);
4252
4250
  for (const [s, r] of Object.entries(n.properties ?? {}))
4253
- t[s] !== void 0 && r.type && sa(t[s]) !== r.type && o.push(`type ${e} expects data.${s} to be ${r.type}`);
4251
+ t[s] !== void 0 && r.type && na(t[s]) !== r.type && o.push(`type ${e} expects data.${s} to be ${r.type}`);
4254
4252
  return o;
4255
4253
  }
4256
4254
  function so(e, t = "x") {
@@ -4274,7 +4272,7 @@ function so(e, t = "x") {
4274
4272
  const h = c.title === void 0 ? "" : String(c.title);
4275
4273
  h.trim() || n.push("changelog requires data.title"), h.length > 48 && n.push("changelog data.title exceeds 48 characters"), h.includes(",") && n.push("changelog data.title must not contain a comma"), c.description !== void 0 && String(c.description).length > 160 && n.push("changelog data.description exceeds 160 characters");
4276
4274
  }
4277
- if ((i.type === "milestone" || i.type === "epic" || i.type === "feature" || i.type === "bug") && (i.description || n.push(`type ${i.type} requires a description`), (c.date === void 0 || Number.isNaN(new Date(String(c.date)).getTime())) && n.push(`type ${i.type} requires a valid data.date`)), i.type && Ne.has(i.type) && n.push(...ra(i.type, c)), i.type === "team") {
4275
+ if ((i.type === "milestone" || i.type === "epic" || i.type === "feature" || i.type === "bug") && (i.description || n.push(`type ${i.type} requires a description`), (c.date === void 0 || Number.isNaN(new Date(String(c.date)).getTime())) && n.push(`type ${i.type} requires a valid data.date`)), i.type && Ne.has(i.type) && n.push(...oa(i.type, c)), i.type === "team") {
4278
4276
  const h = Array.isArray(c.members) ? c.members : [];
4279
4277
  h.length === 0 && n.push("type team requires data.members with at least one member"), h.forEach((g, w) => {
4280
4278
  (typeof g?.name != "string" || !g.name.trim()) && n.push(`type team member ${w + 1} needs a name`);
@@ -4288,7 +4286,7 @@ function so(e, t = "x") {
4288
4286
  }
4289
4287
  return i.type === "component" && ((c.system === void 0 || String(c.system).trim() === "") && n.push("type component requires data.system"), (c.component === void 0 || String(c.component).trim() === "") && n.push("type component requires data.component")), n;
4290
4288
  }
4291
- function aa(e, t) {
4289
+ function sa(e, t) {
4292
4290
  const n = (u) => {
4293
4291
  const h = String(u ?? "").replace(/^v/i, "").replace(/\+.*$/, ""), g = h.indexOf("-");
4294
4292
  return {
@@ -4326,12 +4324,12 @@ function aa(e, t) {
4326
4324
  }
4327
4325
  return 0;
4328
4326
  }
4329
- function ia(e, t) {
4327
+ function ra(e, t) {
4330
4328
  const n = je(e, t).split(xe).join("/");
4331
4329
  if (!(!n || n.startsWith("..") || ke(n)))
4332
4330
  return `/${n}`;
4333
4331
  }
4334
- function ca(e, t) {
4332
+ function aa(e, t) {
4335
4333
  const n = je(e, t).split(xe).join("/");
4336
4334
  if (n.startsWith("..") || ke(n))
4337
4335
  throw new Error(
@@ -4342,11 +4340,11 @@ Check the working directory you run vite from and the contentDir option.`
4342
4340
  );
4343
4341
  return n.replace(/\.md$/, "").replace(/\/index$/, "").replace(/^index$/, "");
4344
4342
  }
4345
- function la(e) {
4343
+ function ia(e) {
4346
4344
  const t = e.lastIndexOf("/");
4347
4345
  return t >= 0 ? e.slice(0, t) : "";
4348
4346
  }
4349
- function pa(e) {
4347
+ function ca(e) {
4350
4348
  return e ? "/" + e : "/";
4351
4349
  }
4352
4350
  function Cn(e) {
@@ -4409,11 +4407,11 @@ const On = {
4409
4407
  plus: "+",
4410
4408
  minus: "−"
4411
4409
  };
4412
- function ua(e) {
4410
+ function la(e) {
4413
4411
  const t = e.trim().toLowerCase();
4414
4412
  return On[t] ? On[t] : t.length === 1 ? t.toUpperCase() : t.charAt(0).toUpperCase() + t.slice(1);
4415
4413
  }
4416
- const ma = (e, t) => {
4414
+ const pa = (e, t) => {
4417
4415
  const n = e.src, o = e.pos;
4418
4416
  if (n.charCodeAt(o) !== 94 || n.charCodeAt(o + 1) !== 94) return !1;
4419
4417
  const s = n.indexOf("^^", o + 2);
@@ -4426,7 +4424,7 @@ const ma = (e, t) => {
4426
4424
  i.content = r, e.push("ins_close", "ins", -1);
4427
4425
  }
4428
4426
  return e.pos = s + 2, !0;
4429
- }, fa = (e, t) => {
4427
+ }, ua = (e, t) => {
4430
4428
  const n = e.src, o = e.pos;
4431
4429
  if (n.charCodeAt(o) !== 43 || n.charCodeAt(o + 1) !== 43) return !1;
4432
4430
  const s = n.indexOf("++", o + 2);
@@ -4437,20 +4435,20 @@ const ma = (e, t) => {
4437
4435
  if (i.length === 0) return !1;
4438
4436
  if (!t) {
4439
4437
  const c = e.push("html_inline", "", 0);
4440
- c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(ua(u))}</kbd>`).join('<span class="np-key-join">+</span>')}</span>`;
4438
+ c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(la(u))}</kbd>`).join('<span class="np-key-join">+</span>')}</span>`;
4441
4439
  }
4442
4440
  return e.pos = s + 2, !0;
4443
- }, da = (e) => {
4441
+ }, ma = (e) => {
4444
4442
  const t = e.tokens;
4445
4443
  for (let n = 0; n + 2 < t.length; n++) {
4446
4444
  if (t[n].type !== "paragraph_open" || t[n + 1].type !== "inline" || t[n + 2].type !== "paragraph_close") continue;
4447
4445
  const s = (t[n + 1].children ?? []).filter((r) => !(r.type === "text" && r.content.trim() === ""));
4448
4446
  s.length !== 1 || s[0].type !== "image" || !s[0].attrGet("title") || (s[0].meta = { ...s[0].meta ?? {}, figure: !0 }, t[n].tag = "figure", t[n + 2].tag = "figure", t[n].attrJoin("class", "np-figure"));
4449
4447
  }
4450
- }, ha = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, ga = In(import.meta.url);
4451
- function _a() {
4448
+ }, fa = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, da = In(import.meta.url);
4449
+ function ha() {
4452
4450
  try {
4453
- return Y(ga.resolve("lucide-static/icons/a-arrow-down.svg"));
4451
+ return Y(da.resolve("lucide-static/icons/a-arrow-down.svg"));
4454
4452
  } catch {
4455
4453
  return G(process.cwd(), "node_modules", "lucide-static", "icons");
4456
4454
  }
@@ -4460,11 +4458,11 @@ function ro(e, t) {
4460
4458
  const n = `${t ?? ""}:${e}`, o = Dn.get(n);
4461
4459
  if (o !== void 0) return o;
4462
4460
  let s = null;
4463
- e.startsWith("lucide-") ? s = q(_a(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
4461
+ e.startsWith("lucide-") ? s = q(ha(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
4464
4462
  let r = null;
4465
4463
  return s && fe(s) && (r = Oe(s, "utf8").replace(/<\?xml[^>]*>/g, "").replace(/<!--[\s\S]*?-->/g, "").replace(/\s+(width|height)="[^"]*"/g, "").replace(/<svg/, '<svg aria-hidden="true" focusable="false"').trim()), Dn.set(n, r), r;
4466
4464
  }
4467
- function ya(e) {
4465
+ function ga(e) {
4468
4466
  const t = [], n = [];
4469
4467
  for (const o of e.trim().split(/\s+/).filter(Boolean))
4470
4468
  if (o.startsWith(".")) n.push(o.slice(1));
@@ -4475,17 +4473,17 @@ function ya(e) {
4475
4473
  }
4476
4474
  return n.length && t.push(["class", n.join(" ")]), t;
4477
4475
  }
4478
- function ba(e) {
4476
+ function _a(e) {
4479
4477
  return (t, n) => {
4480
4478
  if (t.src.charCodeAt(t.pos) !== 58) return !1;
4481
- const o = ha.exec(t.src.slice(t.pos));
4479
+ const o = fa.exec(t.src.slice(t.pos));
4482
4480
  if (!o) return !1;
4483
4481
  const s = o[1], r = ro(s, e);
4484
4482
  if (!r)
4485
4483
  return s.startsWith("lucide-") && console.warn(`[nimpress] icon :${s}: is not a lucide icon; the shortcode stays as text`), !1;
4486
4484
  let i = t.pos + o[0].length, c = [];
4487
4485
  const u = t.src.slice(i), h = /^\{([^}\n]*)\}/.exec(u);
4488
- if (h && (c = ya(h[1]), i += h[0].length), !n) {
4486
+ if (h && (c = ga(h[1]), i += h[0].length), !n) {
4489
4487
  const g = t.push("np_icon", "span", 0);
4490
4488
  g.content = r, g.attrSet("data-icon", s), g.attrJoin("class", "np-icon");
4491
4489
  for (const [w, P] of c)
@@ -4497,7 +4495,7 @@ function ba(e) {
4497
4495
  function Tn(e) {
4498
4496
  return Buffer.from(e, "utf-8").toString("base64");
4499
4497
  }
4500
- const wa = (e, t, n, o) => {
4498
+ const ya = (e, t, n, o) => {
4501
4499
  const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
4502
4500
  if (e.src.slice(s, s + 2) !== "$$") return !1;
4503
4501
  const i = e.src.slice(s + 2, r);
@@ -4527,7 +4525,7 @@ const wa = (e, t, n, o) => {
4527
4525
  const g = e.push("np_math_block", "div", 0);
4528
4526
  return g.content = u.join(`
4529
4527
  `).trim(), g.map = [t, c + 1], e.line = c + 1, !0;
4530
- }, va = (e, t) => {
4528
+ }, ba = (e, t) => {
4531
4529
  const n = e.src, o = e.pos;
4532
4530
  if (n.charCodeAt(o) !== 36 || n.charCodeAt(o + 1) === 36 || o > 0 && n.charCodeAt(o - 1) === 92) return !1;
4533
4531
  const s = n.charCodeAt(o + 1);
@@ -4552,25 +4550,25 @@ const wa = (e, t, n, o) => {
4552
4550
  u.content = i;
4553
4551
  }
4554
4552
  return e.pos = r + 1, !0;
4555
- }, ka = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, $a = (e, t, n, o) => {
4553
+ }, wa = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, va = (e, t, n, o) => {
4556
4554
  const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
4557
4555
  if (e.src.charCodeAt(s) !== 42 || e.src.charCodeAt(s + 1) !== 91) return !1;
4558
- const i = ka.exec(e.src.slice(s, r));
4556
+ const i = wa.exec(e.src.slice(s, r));
4559
4557
  if (!i) return !1;
4560
4558
  if (o) return !0;
4561
4559
  const c = e.env;
4562
4560
  return c.abbr = { ...c.abbr ?? {}, [i[1].trim()]: i[2].trim() }, e.line = t + 1, !0;
4563
4561
  };
4564
- function xa(e) {
4562
+ function ka(e) {
4565
4563
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4566
4564
  }
4567
- function Sa(e) {
4565
+ function $a(e) {
4568
4566
  return (t) => {
4569
4567
  const n = t.env, o = /* @__PURE__ */ new Map();
4570
4568
  if (!n.glossaryPage) for (const u of e) o.set(u.term, u.description);
4571
4569
  for (const [u, h] of Object.entries(n.abbr ?? {})) o.set(u, h);
4572
4570
  if (o.size === 0) return;
4573
- const s = Array.from(o.entries()).sort((u, h) => h[0].length - u[0].length), r = new Map(s.map(([u]) => [u.toLowerCase(), u])), i = new RegExp(`(^|[^\\p{L}\\p{N}_])(${s.map(([u]) => xa(u)).join("|")})(?![\\p{L}\\p{N}_])`, "iu"), c = t.tokens;
4571
+ const s = Array.from(o.entries()).sort((u, h) => h[0].length - u[0].length), r = new Map(s.map(([u]) => [u.toLowerCase(), u])), i = new RegExp(`(^|[^\\p{L}\\p{N}_])(${s.map(([u]) => ka(u)).join("|")})(?![\\p{L}\\p{N}_])`, "iu"), c = t.tokens;
4574
4572
  for (let u = 0; u < c.length; u++) {
4575
4573
  const h = c[u];
4576
4574
  if (h.type !== "inline" || !h.children || c[u - 1]?.type === "heading_open") continue;
@@ -4616,12 +4614,12 @@ function Sa(e) {
4616
4614
  }
4617
4615
  };
4618
4616
  }
4619
- const ja = (e) => {
4617
+ const xa = (e) => {
4620
4618
  if (!e.env.glossaryPage) return;
4621
4619
  const n = e.tokens;
4622
4620
  for (let o = 0; o + 1 < n.length; o++)
4623
4621
  n[o].type !== "dt_open" || n[o + 1].type !== "inline" || (n[o].attrSet("id", `term-${Ie(n[o + 1].content)}`), n[o].attrJoin("class", "np-glossary-term"));
4624
- }, Pa = (e) => {
4622
+ }, Sa = (e) => {
4625
4623
  const t = e.tokens, n = /* @__PURE__ */ new Map();
4626
4624
  for (let o = 0; o < t.length; o++) {
4627
4625
  if (t[o].type !== "footnote_open") continue;
@@ -4638,7 +4636,7 @@ const ja = (e) => {
4638
4636
  r && (s.meta = { ...s.meta, tip: r });
4639
4637
  }
4640
4638
  };
4641
- function Aa(e, t) {
4639
+ function ja(e, t) {
4642
4640
  const n = e.parse(t, {}), o = [];
4643
4641
  let s = "";
4644
4642
  for (let r = 0; r + 1 < n.length; r++) {
@@ -4655,21 +4653,21 @@ function Aa(e, t) {
4655
4653
  }
4656
4654
  return o;
4657
4655
  }
4658
- const $i = ["prose", "page", "callout", "code", "code-group", "tabs", "cards", "card", "features", "feature", "actions", "action", "hero", "fullpage", "section", "tags", "tag", "footer", "announce", "feedback", "header", "sidebar", "toc", "crumbs", "search", "mermaid", "dbml", "op", "changelog", "roadmap", "team", "pricing", "glossary", "notfound", "math", "icon", "figure", "keys", "lightbox", "abbr", "img", "page-actions"];
4656
+ const bi = ["prose", "page", "callout", "code", "code-group", "tabs", "cards", "card", "features", "feature", "actions", "action", "hero", "fullpage", "section", "tags", "tag", "footer", "announce", "feedback", "header", "sidebar", "toc", "crumbs", "search", "mermaid", "dbml", "op", "changelog", "roadmap", "team", "pricing", "glossary", "notfound", "math", "icon", "figure", "keys", "lightbox", "abbr", "img", "page-actions"];
4659
4657
  function Mn(e, t) {
4660
4658
  return `@scope (.np-${e}) {
4661
4659
  ${t}
4662
4660
  }`;
4663
4661
  }
4664
- function Ea(e, t) {
4662
+ function Pa(e, t) {
4665
4663
  const n = new RegExp(`^${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\.([a-z0-9-]+)\\.css$`).exec(e);
4666
4664
  return n ? n[1] : null;
4667
4665
  }
4668
- const Ca = new Set("a an the and or but if then else of to in on at by for with from as is are was were be been being it its this that these those there here which who whom what when where why how not no yes you your we our they their he she his her them us me my i so do does did done can could should would will shall may might must into over under again more most some any each every all both few own same than too very just also only such other another one two three first last new use used using page pages file files field fields set sets value values see".split(" "));
4666
+ const Aa = new Set("a an the and or but if then else of to in on at by for with from as is are was were be been being it its this that these those there here which who whom what when where why how not no yes you your we our they their he she his her them us me my i so do does did done can could should would will shall may might must into over under again more most some any each every all both few own same than too very just also only such other another one two three first last new use used using page pages file files field fields set sets value values see".split(" "));
4669
4667
  function Rt(e) {
4670
- return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !Ca.has(t) && !/^\d+$/.test(t));
4668
+ return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !Aa.has(t) && !/^\d+$/.test(t));
4671
4669
  }
4672
- function Oa(e) {
4670
+ function Ea(e) {
4673
4671
  const t = e.replace(/```[\s\S]*?```/g, "").replace(/^:{3,}.*$/gm, "").replace(/^\s*[#>|-].*$/gm, "").split(/\n\s*\n/).map((s) => s.replace(/\s+/g, " ").trim()).find((s) => s.length > 40 && !s.startsWith("!") && !s.startsWith("<"));
4674
4672
  if (!t) return "";
4675
4673
  const n = t.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/[*_`~^=]+/g, "");
@@ -4677,7 +4675,7 @@ function Oa(e) {
4677
4675
  const o = n.slice(0, 157);
4678
4676
  return `${o.slice(0, Math.max(o.lastIndexOf(" "), 100))}…`;
4679
4677
  }
4680
- function Da(e) {
4678
+ function Ca(e) {
4681
4679
  const t = /* @__PURE__ */ new Map(), n = e.map((r) => {
4682
4680
  const i = /* @__PURE__ */ new Map(), c = (u, h) => {
4683
4681
  for (const g of u) i.set(g, (i.get(g) ?? 0) + h);
@@ -4693,11 +4691,11 @@ function Da(e) {
4693
4691
  if (u.length >= 8) break;
4694
4692
  u.some((g) => g.toLowerCase() === h.word) || u.push(h.word);
4695
4693
  }
4696
- s.set(r.slug, { keywords: u, description: Oa(r.body) });
4694
+ s.set(r.slug, { keywords: u, description: Ea(r.body) });
4697
4695
  }
4698
4696
  return s;
4699
4697
  }
4700
- function Ta(e, t, n) {
4698
+ function Oa(e, t, n) {
4701
4699
  return n === !1 || t === !1 && n !== !0 ? `${e}, noai, noimageai` : e;
4702
4700
  }
4703
4701
  function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
@@ -4712,13 +4710,13 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4712
4710
  zsh: "bash",
4713
4711
  console: "bash",
4714
4712
  hurl: "http"
4715
- }, E = ((D ? D.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K = Na(D ?? ""), re = Ia(E, K), he = ao.test(d) ? { includeExplanation: "scopeName" } : {};
4713
+ }, E = ((D ? D.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K = Ta(D ?? ""), re = Ma(E, K), he = ao.test(d) ? { includeExplanation: "scopeName" } : {};
4716
4714
  try {
4717
4715
  return e.codeToHtml(d, {
4718
4716
  ...he,
4719
4717
  lang: H,
4720
4718
  theme: "github-dark",
4721
- transformers: [Ba(re, K)]
4719
+ transformers: [Fa(re, K)]
4722
4720
  });
4723
4721
  } catch {
4724
4722
  return `<pre ${Object.entries(re).map(([ge, oe]) => `${ge}="${s.utils.escapeHtml(oe)}"`).join(" ")}><code>${s.utils.escapeHtml(d)}</code></pre>`;
@@ -4768,12 +4766,12 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4768
4766
  }, s.use(dn, {
4769
4767
  slugify: Ie,
4770
4768
  permalink: dn.permalink.headerLink({ safariReaderFix: !0 })
4771
- }), s.use(Fo), s.use(Bn), s.use(Bo), s.use(Wo, { enabled: !0 }), s.use(ds), s.inline.ruler.before("emphasis", "np_ins", ma), s.renderer.rules.s_open = () => "<del>", s.renderer.rules.s_close = () => "</del>", s.use(_s), s.use(ws), s.inline.ruler.before("emphasis", "np_keys", fa), s.core.ruler.push("np_figures", da), s.block.ruler.before("reference", "np_abbr_definition", $a, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.core.ruler.after("inline", "np_abbr", Sa(o.glossary ?? [])), s.core.ruler.push("np_glossary_anchors", ja), s.core.ruler.after("footnote_tail", "np_footnote_tips", Pa);
4769
+ }), s.use(Fo), s.use(Bn), s.use(Bo), s.use(Wo, { enabled: !0 }), s.use(ms), s.inline.ruler.before("emphasis", "np_ins", pa), s.renderer.rules.s_open = () => "<del>", s.renderer.rules.s_close = () => "</del>", s.use(hs), s.use(ys), s.inline.ruler.before("emphasis", "np_keys", ua), s.core.ruler.push("np_figures", ma), s.block.ruler.before("reference", "np_abbr_definition", va, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.core.ruler.after("inline", "np_abbr", $a(o.glossary ?? [])), s.core.ruler.push("np_glossary_anchors", xa), s.core.ruler.after("footnote_tail", "np_footnote_tips", Sa);
4772
4770
  const h = s.renderer.rules.footnote_ref ?? r;
4773
4771
  s.renderer.rules.footnote_ref = (d, v, D, R, x) => {
4774
4772
  const E = String(d[v].meta?.tip ?? ""), I = h(d, v, D, R, x);
4775
4773
  return E ? I.replace('<sup class="footnote-ref">', `<sup class="footnote-ref np-tip" aria-label="${s.utils.escapeHtml(E)}">`) : I;
4776
- }, s.inline.ruler.before("emphasis", "np_icon", ba(o.icons)), s.use(As), s.renderer.rules.np_icon = (d, v, D, R, x) => `<span${x.renderAttrs(d[v])}>${d[v].content}</span>`, o.math !== !1 && (s.block.ruler.before("fence", "np_math_block", wa, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.inline.ruler.before("emphasis", "np_math_inline", va), s.renderer.rules.np_math_block = (d, v) => `<div class="np-math np-math-display" data-math="${Tn(d[v].content)}"></div>
4774
+ }, s.inline.ruler.before("emphasis", "np_icon", _a(o.icons)), s.use(js), s.renderer.rules.np_icon = (d, v, D, R, x) => `<span${x.renderAttrs(d[v])}>${d[v].content}</span>`, o.math !== !1 && (s.block.ruler.before("fence", "np_math_block", ya, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.inline.ruler.before("emphasis", "np_math_inline", ba), s.renderer.rules.np_math_block = (d, v) => `<div class="np-math np-math-display" data-math="${Tn(d[v].content)}"></div>
4777
4775
  `, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${Tn(d[v].content)}"></span>`);
4778
4776
  const g = (d, v) => {
4779
4777
  s.use(Ro, d, v);
@@ -4908,7 +4906,7 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4908
4906
  }), s;
4909
4907
  }
4910
4908
  const ao = /\((\d+)\)(!?)[ \t]*$/m;
4911
- function Ma(e) {
4909
+ function Da(e) {
4912
4910
  const t = /* @__PURE__ */ new Set(), n = Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : typeof e == "number" ? [e] : [];
4913
4911
  for (const o of n) {
4914
4912
  const s = String(o).trim(), r = /^(\d+)(?:-(\d+))?$/.exec(s);
@@ -4918,28 +4916,28 @@ function Ma(e) {
4918
4916
  }
4919
4917
  return t;
4920
4918
  }
4921
- function Na(e) {
4919
+ function Ta(e) {
4922
4920
  const t = e.indexOf("{"), n = t >= 0 ? Ee(e.slice(t), e) : {}, o = typeof n.start == "number" && Number.isInteger(n.start) ? n.start : 1;
4923
4921
  return {
4924
4922
  title: typeof n.title == "string" ? n.title.trim() : "",
4925
4923
  lines: n.lines === !0 || typeof n.start == "number",
4926
4924
  start: o,
4927
- highlight: Ma(n.highlight)
4925
+ highlight: Da(n.highlight)
4928
4926
  };
4929
4927
  }
4930
- function Ia(e, t) {
4928
+ function Ma(e, t) {
4931
4929
  const n = { "data-lang": e };
4932
4930
  return t.title && (n["data-title"] = t.title), t.lines && (n["data-lines"] = "true", n["data-start"] = String(t.start)), n;
4933
4931
  }
4934
- function Fa(e) {
4932
+ function Na(e) {
4935
4933
  const t = e.explanation ?? [];
4936
4934
  return t.length > 0 && t.every(
4937
4935
  (n) => n.scopes.some((o) => /(^|\.)comment(\.|$)/.test(o.scopeName)) && !n.scopes.some((o) => o.scopeName.startsWith("markup.fenced_code") || o.scopeName.startsWith("markup.raw"))
4938
4936
  );
4939
4937
  }
4940
- function Ra(e) {
4938
+ function Ia(e) {
4941
4939
  let t = e.length;
4942
- for (; t > 0 && Fa(e[t - 1]); ) t -= 1;
4940
+ for (; t > 0 && Na(e[t - 1]); ) t -= 1;
4943
4941
  if (t === e.length) return e;
4944
4942
  const n = e.slice(t).flatMap(
4945
4943
  (w) => (w.explanation ?? []).map((P) => ({
@@ -4968,11 +4966,11 @@ function Ra(e) {
4968
4966
  });
4969
4967
  return [...e.slice(0, t), ...u.map(g), i, ...h.map(g)];
4970
4968
  }
4971
- function Ba(e, t) {
4969
+ function Fa(e, t) {
4972
4970
  return {
4973
4971
  name: "nimpress:code-fence",
4974
4972
  tokens(n) {
4975
- return n.map(Ra);
4973
+ return n.map(Ia);
4976
4974
  },
4977
4975
  pre(n) {
4978
4976
  n.properties.style = String(n.properties.style ?? "").replace(/background-color:[^;]*;?/, "");
@@ -4997,10 +4995,10 @@ function Ee(e, t) {
4997
4995
  function tt(e) {
4998
4996
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4999
4997
  }
5000
- function Wa(e) {
4998
+ function Ra(e) {
5001
4999
  return `<div class="np-mermaid" data-graph="${Buffer.from(e, "utf-8").toString("base64")}"></div>`;
5002
5000
  }
5003
- function La(e, t, n) {
5001
+ function Ba(e, t, n) {
5004
5002
  const o = t.startsWith("{") ? Ee(t, t) : {};
5005
5003
  let s = "", r = "";
5006
5004
  try {
@@ -5016,7 +5014,7 @@ ${r}`);
5016
5014
  c ? `data-height="${tt(c)}"` : ""
5017
5015
  ].filter(Boolean).join(" ")}></div>`;
5018
5016
  }
5019
- function Ha(e, t) {
5017
+ function Wa(e, t) {
5020
5018
  const n = e.split(`
5021
5019
  `), o = [];
5022
5020
  let s = 0;
@@ -5031,13 +5029,13 @@ function Ha(e, t) {
5031
5029
  for (; g < n.length && !h.test(n[g]); ) g += 1;
5032
5030
  const w = u.trim(), P = w.split(/\s+/)[0].toLowerCase(), A = n.slice(s + 1, g).join(`
5033
5031
  `);
5034
- P === "mermaid" ? o.push(`${i}${Wa(A && `${A}
5035
- `)}`) : P === "dbml" ? o.push(`${i}${La(A, w.slice(P.length).trim(), t)}`) : o.push(...n.slice(s, Math.min(g + 1, n.length))), s = g + 1;
5032
+ P === "mermaid" ? o.push(`${i}${Ra(A && `${A}
5033
+ `)}`) : P === "dbml" ? o.push(`${i}${Ba(A, w.slice(P.length).trim(), t)}`) : o.push(...n.slice(s, Math.min(g + 1, n.length))), s = g + 1;
5036
5034
  }
5037
5035
  return o.join(`
5038
5036
  `);
5039
5037
  }
5040
- function za(e) {
5038
+ function La(e) {
5041
5039
  if (!e) return "";
5042
5040
  const t = [], n = (s) => {
5043
5041
  if (s)
@@ -5048,14 +5046,14 @@ function za(e) {
5048
5046
  const o = t.join("").trim();
5049
5047
  return o || (e.content ?? "").trim();
5050
5048
  }
5051
- function qa(e, t) {
5049
+ function Ha(e, t) {
5052
5050
  const n = e.parse(t, {}), o = [];
5053
5051
  let s = 0;
5054
5052
  const r = /* @__PURE__ */ new Map();
5055
5053
  for (let i = 0; i < n.length; i++) {
5056
5054
  const c = n[i];
5057
5055
  if (c.type === "heading_open") {
5058
- const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = za(h) || `heading-${s++}`;
5056
+ const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = La(h) || `heading-${s++}`;
5059
5057
  let w = Ie(g);
5060
5058
  w || (w = `heading-${s++}`);
5061
5059
  const P = r.get(w);
@@ -5069,7 +5067,7 @@ function qa(e, t) {
5069
5067
  }
5070
5068
  return o;
5071
5069
  }
5072
- function Ua(e) {
5070
+ function za(e) {
5073
5071
  return e.frontmatter.slug ?? e.frontmatter.title;
5074
5072
  }
5075
5073
  function mt(e) {
@@ -5083,7 +5081,7 @@ function qt(e) {
5083
5081
  for (const t of e)
5084
5082
  t.items && qt(t.items);
5085
5083
  }
5086
- function Ja(e) {
5084
+ function qa(e) {
5087
5085
  let t = Ye, n = G(process.cwd(), Ye.contentDir), o = G(process.cwd(), Ye.assetsDir), s = /* @__PURE__ */ new Map(), r = null, i = G(process.cwd(), "dist"), c = !1, u = null;
5088
5086
  const h = /* @__PURE__ */ new Map();
5089
5087
  let g = [], w = "";
@@ -5281,7 +5279,7 @@ function Ja(e) {
5281
5279
  if (c) throw new Error(`[nimpress] invalid frontmatter in ${X}`);
5282
5280
  console.warn(`[nimpress] invalid frontmatter in ${X}`);
5283
5281
  }
5284
- const y = no.safeParse(p), f = y.success ? y.data : { title: a }, _ = ca(n, a), C = f.type ?? "doc", $ = Cn(f.path ?? pa(_)), S = typeof f.link == "string" && f.link.trim() !== "" ? f.link.trim() : void 0, U = !!S || p.type === void 0 && b.trim() === "", j = t.defaultFrontmatter ?? {};
5282
+ const y = no.safeParse(p), f = y.success ? y.data : { title: a }, _ = aa(n, a), C = f.type ?? "doc", $ = Cn(f.path ?? ca(_)), S = typeof f.link == "string" && f.link.trim() !== "" ? f.link.trim() : void 0, U = !!S || p.type === void 0 && b.trim() === "", j = t.defaultFrontmatter ?? {};
5285
5283
  if (!(t.defaultFrontmatterExclude ?? []).some((X) => {
5286
5284
  const le = X.startsWith("/") ? X : "/" + X;
5287
5285
  return $ === le || $.startsWith(le + "/");
@@ -5290,7 +5288,7 @@ function Ja(e) {
5290
5288
  const Te = X;
5291
5289
  Te === "hide" ? f.hide = Array.from(/* @__PURE__ */ new Set([...le ?? [], ...f.hide ?? []])) : (f[Te] === void 0 || f[Te] === null || f[Te] === "") && (f[Te] = le);
5292
5290
  }
5293
- const B = await D(), M = Nn(B, be(), t.base, { math: t.math, icons: t.icons, glossary: g }), W = Ha(b, a), L = qa(M, W), J = M.render(W, { glossaryPage: C === "glossary" });
5291
+ const B = await D(), M = Nn(B, be(), t.base, { math: t.math, icons: t.icons, glossary: g }), W = Wa(b, a), L = Ha(M, W), J = M.render(W, { glossaryPage: C === "glossary" });
5294
5292
  if (C === "team" || C === "pricing") {
5295
5293
  const X = { ...f.data ?? {} };
5296
5294
  Array.isArray(X.members) && (X.members = X.members.map((le) => ({ ...le, bioHtml: typeof le.bio == "string" ? M.renderInline(le.bio) : "" }))), Array.isArray(X.tiers) && (X.tiers = X.tiers.map((le) => ({ ...le, benefitsHtml: Array.isArray(le.benefits) ? le.benefits.map((Te) => M.renderInline(String(Te))) : [] }))), typeof X.footnote == "string" && (X.footnoteHtml = M.renderInline(X.footnote)), f.data = X;
@@ -5300,7 +5298,7 @@ function Ja(e) {
5300
5298
  if (!f.spec)
5301
5299
  console.warn(`[nimpress] page ${a} has type openapi but no spec field`);
5302
5300
  else {
5303
- z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = ia(n, z);
5301
+ z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = ra(n, z);
5304
5302
  const X = await x(a, f.spec);
5305
5303
  Z = X ? re(X, M) ?? void 0 : void 0;
5306
5304
  }
@@ -5323,7 +5321,7 @@ function Ja(e) {
5323
5321
  te(a, z);
5324
5322
  let ue, me = [];
5325
5323
  if (C === "component") {
5326
- const X = await Ir({
5324
+ const X = await Mr({
5327
5325
  cwd: process.cwd(),
5328
5326
  modules: t.modules,
5329
5327
  pageFile: a,
@@ -5339,7 +5337,7 @@ function Ja(e) {
5339
5337
  _e !== a && fe(_e) && $e.push(await ie(_e, "utf-8"));
5340
5338
  const Be = Ce(a, ".md");
5341
5339
  for (const X of Le(Y(a)).sort()) {
5342
- const le = Ea(X, Be);
5340
+ const le = Pa(X, Be);
5343
5341
  le && $e.push(Mn(le, await ie(q(Y(a), X), "utf-8")));
5344
5342
  }
5345
5343
  for (const X of f.styles ?? []) {
@@ -5424,7 +5422,7 @@ function Ja(e) {
5424
5422
  continue;
5425
5423
  }
5426
5424
  const { data: F, content: B } = _t(O);
5427
- String(F.type) === "glossary" && ($.push(j), S = Aa(new Rn().use(Bn), B));
5425
+ String(F.type) === "glossary" && ($.push(j), S = ja(new Rn().use(Bn), B));
5428
5426
  }
5429
5427
  if ($.length > 1) throw new Error(`[nimpress] one type glossary page per site: ${$.join(" and ")}`);
5430
5428
  g = S, w = JSON.stringify(S);
@@ -5441,7 +5439,7 @@ function Ja(e) {
5441
5439
  }
5442
5440
  if (!O || Fe(O.slug)) continue;
5443
5441
  if (C.push(O), O.type === "changelog") {
5444
- const M = `${la(O.slug)}\0${O.frontmatter.title}`, W = b.get(M) ?? [];
5442
+ const M = `${ia(O.slug)}\0${O.frontmatter.title}`, W = b.get(M) ?? [];
5445
5443
  W.push(O), b.set(M, W);
5446
5444
  continue;
5447
5445
  }
@@ -5489,7 +5487,7 @@ function Ja(e) {
5489
5487
  if (M.length === 0) continue;
5490
5488
  M.sort((N, z) => {
5491
5489
  const V = String(N.frontmatter.data?.version ?? ""), se = String(z.frontmatter.data?.version ?? "");
5492
- return aa(se, V);
5490
+ return sa(se, V);
5493
5491
  });
5494
5492
  const W = M[0], L = `__changelog__${(F || "root").replace(/\//g, "__")}`, J = M.map((N) => {
5495
5493
  const z = N.frontmatter.data, V = String(z?.version ?? ""), se = String(z?.title ?? ""), ne = z?.description !== void 0 ? String(z.description) : void 0, Q = z?.release_date;
@@ -5540,7 +5538,7 @@ function Ja(e) {
5540
5538
  p.set(B, ee.filePath), l.set(ee.slug, ee);
5541
5539
  }
5542
5540
  if (wo(k, C), co(l), io(l), t.seo?.auto) {
5543
- const j = Da(C.map((O) => ({
5541
+ const j = Ca(C.map((O) => ({
5544
5542
  slug: O.slug,
5545
5543
  title: O.frontmatter.title,
5546
5544
  headings: O.headings.map((F) => F.text),
@@ -5616,7 +5614,7 @@ function Ja(e) {
5616
5614
  `<link>${ye(se)}</link>`,
5617
5615
  `<guid isPermaLink="true">${ye(se)}</guid>`
5618
5616
  ];
5619
- return V.releaseDate && ne.push(`<pubDate>${new Date(V.releaseDate).toUTCString()}</pubDate>`), V.description && ne.push(`<description>${ye(V.description)}</description>`), V.html && ne.push(`<content:encoded>${Kr(V.html)}</content:encoded>`), ` <item>
5617
+ return V.releaseDate && ne.push(`<pubDate>${new Date(V.releaseDate).toUTCString()}</pubDate>`), V.description && ne.push(`<description>${ye(V.description)}</description>`), V.html && ne.push(`<content:encoded>${Xr(V.html)}</content:encoded>`), ` <item>
5620
5618
  ${ne.join(`
5621
5619
  `)}
5622
5620
  </item>`;
@@ -5629,7 +5627,7 @@ function Ja(e) {
5629
5627
  M && N.push(`<language>${ye(M)}</language>`), O && N.push(`<lastBuildDate>${O}</lastBuildDate>`), N.push(`<ttl>${U}</ttl>`), N.push(`<sy:updatePeriod>${j}</sy:updatePeriod>`), N.push("<sy:updateFrequency>1</sy:updateFrequency>"), S !== void 0 && N.push(`<nimpress:releaseCadence>${S}</nimpress:releaseCadence>`), N.push(`<nimpress:latestVersion>${ye(b[0].version)}</nimpress:latestVersion>`), N.push(`<nimpress:releaseCount>${b.length}</nimpress:releaseCount>`), L > 0 && N.push("<fh:archive/>");
5630
5628
  const z = [
5631
5629
  '<?xml version="1.0" encoding="UTF-8"?>',
5632
- `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${Yr}">`,
5630
+ `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${Vr}">`,
5633
5631
  " <channel>",
5634
5632
  ` ${N.join(`
5635
5633
  `)}`,
@@ -5694,7 +5692,7 @@ function Ja(e) {
5694
5692
  if (k.keywords) return Array.isArray(k.keywords) ? k.keywords : [k.keywords];
5695
5693
  const ne = Re(b.tags);
5696
5694
  return ne.length ? ne : l.keywords ?? [];
5697
- })(), j = Ta(k.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, k.ai), O = y.title ?? _, F = y.description ?? $, B = y.image ?? p?.ogImage, M = B ? Pe(B) ?? B : void 0, W = y.type ?? (b.type === "hero" || b.type === "fullpage" || a.effectivePath === "/" ? "website" : "article"), L = l.og?.width ?? 1200, J = l.og?.height ?? 600, Z = f.card ?? (M ? "summary_large_image" : "summary"), ee = f.site ?? p?.twitterSite, N = tt, z = [];
5695
+ })(), j = Oa(k.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, k.ai), O = y.title ?? _, F = y.description ?? $, B = y.image ?? p?.ogImage, M = B ? Pe(B) ?? B : void 0, W = y.type ?? (b.type === "hero" || b.type === "fullpage" || a.effectivePath === "/" ? "website" : "article"), L = l.og?.width ?? 1200, J = l.og?.height ?? 600, Z = f.card ?? (M ? "summary_large_image" : "summary"), ee = f.site ?? p?.twitterSite, N = tt, z = [];
5698
5696
  if (z.push(`<title>${N(C)}</title>`), $ && z.push(`<meta name="description" content="${N($)}">`), U.length && z.push(`<meta name="keywords" content="${N(U.join(", "))}">`), z.push(`<meta name="robots" content="${N(j)}">`), z.push(`<meta name="googlebot" content="${N(j)}">`), S) {
5699
5697
  z.push(`<link rel="canonical" href="${N(S)}">`);
5700
5698
  const ne = l.localeAlternates ?? [];
@@ -5745,7 +5743,7 @@ function Ja(e) {
5745
5743
  isPartOf: V ? `${V}${we(t.base, "/")}#website` : void 0,
5746
5744
  dateModified: on(a.filePath)
5747
5745
  }), k.jsonLd && se.push(k.jsonLd);
5748
- for (const ne of se) z.push(Zr(ne));
5746
+ for (const ne of se) z.push(Yr(ne));
5749
5747
  return `
5750
5748
  ${z.join(`
5751
5749
  `)}
@@ -6073,7 +6071,7 @@ ${S.join(`
6073
6071
  for (const $ of y.children.values()) f.push(b($));
6074
6072
  if (qt(f), y.page) {
6075
6073
  const $ = {
6076
- text: Ua(y.page),
6074
+ text: za(y.page),
6077
6075
  link: y.page.linkTo ?? y.page.effectivePath,
6078
6076
  external: y.page.linkTo ? !0 : void 0,
6079
6077
  slug: y.page.slug,
@@ -6116,7 +6114,7 @@ ${S.join(`
6116
6114
  text: J.title,
6117
6115
  link: J.href,
6118
6116
  slug: J.slug,
6119
- icon: Qr[J.kind],
6117
+ icon: Kr[J.kind],
6120
6118
  hidden: J.hidden,
6121
6119
  order: Z
6122
6120
  };
@@ -6464,7 +6462,7 @@ ${C}
6464
6462
  return {
6465
6463
  name: "@nimtech/nimpress:markdown",
6466
6464
  async config() {
6467
- t = (await ms(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), oa(process.cwd(), t.pageTypes ?? {});
6465
+ t = (await ps(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), ta(process.cwd(), t.pageTypes ?? {});
6468
6466
  for (const l of vt(t))
6469
6467
  ft.includes(l) || fe(G(process.cwd(), l)) || console.warn(`[nimpress] theme ${l} is neither a built in theme, ${ft.join(" or ")}, nor a stylesheet`);
6470
6468
  return o = G(process.cwd(), t.assetsDir), {};
@@ -6533,9 +6531,9 @@ ${C}
6533
6531
  T.has(f) && de(T.get(f));
6534
6532
  };
6535
6533
  if (a.watcher.on("add", l), a.watcher.on("unlink", p), t.banner !== !1) {
6536
- const f = Ts(), _ = t.banner, C = Date.now();
6534
+ const f = Os(), _ = t.banner, C = Date.now();
6537
6535
  a.printUrls = function() {
6538
- const $ = a.resolvedUrls, S = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", j = Ds({
6536
+ const $ = a.resolvedUrls, S = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", j = Cs({
6539
6537
  title: _.title ?? t.title ?? f.name ?? "Nimpress",
6540
6538
  tagline: _.tagline,
6541
6539
  company: _.company,
@@ -6655,7 +6653,7 @@ ${C}
6655
6653
  try {
6656
6654
  const $ = await a.transformIndexHtml(
6657
6655
  f.url ?? "/",
6658
- Xr(t, "/@id/__x00__virtual:nimpress/main")
6656
+ Gr(t, "/@id/__x00__virtual:nimpress/main")
6659
6657
  );
6660
6658
  _.statusCode = 200, _.setHeader("Content-Type", "text/html"), _.end($);
6661
6659
  } catch ($) {
@@ -6694,7 +6692,7 @@ ${C}
6694
6692
  if (a === "\0" + it)
6695
6693
  return `export default ${JSON.stringify(So())}`;
6696
6694
  if (a === "\0" + Dt) {
6697
- const l = fs(t), p = l.announce || l.feedback ? Nn(await D(), be(), t.base, { math: t.math, icons: t.icons }) : null;
6695
+ const l = us(t), p = l.announce || l.feedback ? Nn(await D(), be(), t.base, { math: t.math, icons: t.icons }) : null;
6698
6696
  if (l.feedback && p && (l.feedback = {
6699
6697
  ...l.feedback,
6700
6698
  ratings: l.feedback.ratings.map((b) => ({ ...b, html: p.renderInline(b.note) }))
@@ -6744,10 +6742,10 @@ app.mount(target)
6744
6742
  }
6745
6743
  };
6746
6744
  }
6747
- function xi(e) {
6745
+ function wi(e) {
6748
6746
  return e;
6749
6747
  }
6750
- async function Si(e, t) {
6748
+ async function vi(e, t) {
6751
6749
  const n = G(e, t), o = await nn(n), s = [];
6752
6750
  for (const r of o) {
6753
6751
  let i;
@@ -6764,38 +6762,38 @@ async function Si(e, t) {
6764
6762
  return s;
6765
6763
  }
6766
6764
  export {
6767
- Ta as A,
6768
- ms as B,
6769
- $i as C,
6770
- aa as D,
6771
- Ja as E,
6772
- xi as F,
6765
+ Oa as A,
6766
+ ps as B,
6767
+ bi as C,
6768
+ sa as D,
6769
+ qa as E,
6770
+ wi as F,
6773
6771
  Mn as G,
6774
- Oa as H,
6775
- vr as a,
6772
+ Ea as H,
6773
+ br as a,
6776
6774
  Zt as b,
6777
6775
  Kt as c,
6778
6776
  Ye as d,
6779
6777
  $n as e,
6780
6778
  Sn as f,
6781
6779
  Je as g,
6782
- vi as h,
6783
- Xr as i,
6784
- ki as j,
6780
+ _i as h,
6781
+ Gr as i,
6782
+ yi as j,
6785
6783
  zt as k,
6786
- oa as l,
6787
- Si as m,
6788
- Ea as n,
6784
+ ta as l,
6785
+ vi as m,
6786
+ Pa as n,
6789
6787
  Xn as o,
6790
6788
  ot as p,
6791
- wi as q,
6789
+ gi as q,
6792
6790
  $t as r,
6793
6791
  nt as s,
6794
- yi as t,
6795
- br as u,
6796
- _i as v,
6792
+ di as t,
6793
+ _r as u,
6794
+ fi as v,
6797
6795
  en as w,
6798
- bi as x,
6799
- Or as y,
6800
- Da as z
6796
+ hi as x,
6797
+ Er as y,
6798
+ Ca as z
6801
6799
  };