@nimtech/nimpress 2.6.0 → 2.6.2

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,27 +1,25 @@
1
1
  import { readdir as Ut, readFile as ie, writeFile as pe, copyFile as mn, cp as fn, mkdir as Ue } from "node:fs/promises";
2
- import { existsSync as fe, readFileSync as Oe, statSync as gt, readdirSync as Le, createReadStream as Mo } from "node:fs";
3
- import { createRequire as In } from "node:module";
4
- import { request as No } from "node:http";
5
- import { execFileSync as Io } from "node:child_process";
2
+ import { existsSync as fe, readFileSync as Oe, statSync as gt, readdirSync as Le, createReadStream as No } from "node:fs";
3
+ import { createRequire as Nn } from "node:module";
4
+ import { request as Io } from "node:http";
5
+ import { execFileSync as Fo } from "node:child_process";
6
6
  import { resolve as G, dirname as Y, join as q, basename as Ce, relative as je, extname as Jt, isAbsolute as ke, sep as xe } from "node:path";
7
- import { createHash as Fn } from "node:crypto";
7
+ import { createHash as In } from "node:crypto";
8
8
  import _t from "gray-matter";
9
- import Rn from "markdown-it";
9
+ import Fn from "markdown-it";
10
10
  import dn from "markdown-it-anchor";
11
- import Fo from "markdown-it-attrs";
12
- import Ro from "markdown-it-container";
13
- import Bn from "markdown-it-deflist";
14
- import Bo from "markdown-it-footnote";
15
- import Wo from "markdown-it-task-lists";
11
+ import Ro from "markdown-it-attrs";
12
+ import Bo from "markdown-it-container";
13
+ import Rn from "markdown-it-deflist";
14
+ import Wo from "markdown-it-footnote";
15
+ import Lo from "markdown-it-task-lists";
16
16
  import { z as m } from "zod";
17
- import { parse as Wn, stringify as Lo } from "yaml";
18
- import { createHighlighter as Ho } from "shiki";
19
- import { fileURLToPath as zo, pathToFileURL as hn } from "node:url";
20
- import { exporter as qo } from "@dbml/core";
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";
17
+ import { parse as Bn, stringify as Ho } from "yaml";
18
+ import { createHighlighter as zo } from "shiki";
19
+ import { fileURLToPath as qo, pathToFileURL as hn } from "node:url";
20
+ import { exporter as Uo } from "@dbml/core";
21
+ import { n as Jo, r as Qe, e as yt, b as Bt, p as Wn, c as Gt, d as Vt, g as bt, h as Go, k as Xt, o as Vo, s as Xo, l as Yo, q as Ko, t as Zo, j as we, m as Qo, a as es } from "./typeMembers-CNvE92EX.js";
22
+ import { loadConfigFromFile as ts } 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"], ns = [
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 os = m.object({
95
93
  primary: m.string().optional(),
96
94
  primaryHover: m.string().optional()
97
- }).passthrough(), rs = m.object({
95
+ }).passthrough(), ss = 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(), rs = m.object({
105
103
  text: m.string(),
106
104
  link: m.string(),
107
105
  gate: m.string().optional()
108
- }), is = m.object({
106
+ }), as = 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(), is = 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
+ }), cs = 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: os.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(rs).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: ss.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([as, 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(ns), 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(is).optional()
235
233
  }).passthrough();
236
234
  function _n(e, t) {
237
- const n = ls.safeParse(e);
235
+ const n = cs.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 ls = ["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,23 +249,23 @@ 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 ps(e) {
253
+ for (const t of ls) {
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 ts({ 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 us(e, t) {
266
+ const n = await ps(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
- r = Wt(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Uo(r.base);
268
+ r = Wt(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Jo(r.base);
271
269
  const i = t?.modules ?? n?.config?.modules;
272
270
  return r.modules = {
273
271
  dir: Ye.modules.dir,
@@ -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 ms(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 fs(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 ds = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
364
+ function hs(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(ds, "$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 gs(e) {
391
+ e.inline.ruler.after("emphasis", "sub", hs);
394
392
  }
395
- const ys = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
396
- function bs(e, t) {
393
+ const _s = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
394
+ function ys(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(_s, "$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 bs(e) {
421
+ e.inline.ruler.after("emphasis", "sup", ys);
424
422
  }
425
- function vs(e, t) {
423
+ function ws(e, t) {
426
424
  return e[t].content;
427
425
  }
428
- function ks(e, t, n, o, s) {
426
+ function vs(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 ks(e) {
470
468
  return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
471
469
  }
472
- function xs(e) {
470
+ function $s(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) => ks(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 xs(e, t) {
487
+ const o = $s(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 = ws, e.core.ruler.after(
495
493
  "linkify",
496
494
  "emoji",
497
- ks(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
495
+ vs(e, o.defs, o.shortcuts, o.scanRE, o.replaceRE)
498
496
  );
499
497
  }
500
- const js = {
498
+ const Ss = {
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
+ }, js = {
529
527
  100: "💯",
530
528
  1234: "🔢",
531
529
  grinning: "😀",
@@ -2430,15 +2428,15 @@ const js = {
2430
2428
  scotland: "🏴󠁧󠁢󠁳󠁣󠁴󠁿",
2431
2429
  wales: "🏴󠁧󠁢󠁷󠁬󠁳󠁿"
2432
2430
  };
2433
- function As(e, t) {
2431
+ function Ps(e, t) {
2434
2432
  const o = Object.assign({}, {
2435
- defs: Ps,
2436
- shortcuts: js,
2433
+ defs: js,
2434
+ shortcuts: Ss,
2437
2435
  enabled: []
2438
2436
  }, t || {});
2439
- Ss(e, o);
2437
+ xs(e, o);
2440
2438
  }
2441
- 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 = [
2439
+ const ce = "\x1B[0m", kt = "\x1B[1m", dt = "\x1B[2m", Ln = "\x1B[38;2;204;120;92m", Ae = "\x1B[38;2;229;174;156m", Me = "\x1B[38;2;160;160;170m", at = [
2442
2440
  " ███╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗ ███████╗ ███████╗",
2443
2441
  " ████╗ ██║ ██║ ████╗ ████║ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔════╝ ██╔════╝",
2444
2442
  " ██╔██╗ ██║ ██║ ██╔████╔██║ ██████╔╝ ██████╔╝ █████╗ ███████╗ ███████╗",
@@ -2446,19 +2444,19 @@ 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 As(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 Es(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("║ " + As(e[r], Ve) + " ║"), r < e.length - 1 && s.push(n);
2457
2455
  return s.push(o), s;
2458
2456
  }
2459
- function Os() {
2457
+ function Cs() {
2460
2458
  try {
2461
- const e = Y(zo(import.meta.url)), t = [
2459
+ const e = Y(qo(import.meta.url)), t = [
2462
2460
  G(e, "package.json"),
2463
2461
  G(e, "..", "package.json"),
2464
2462
  G(e, "..", "..", "package.json")
@@ -2473,10 +2471,10 @@ 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 Os(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 ?? Cs(), h = [];
2478
2476
  h.push("");
2479
- for (const v of at) h.push(Hn + v + ce);
2477
+ for (const v of at) h.push(Ln + v + ce);
2480
2478
  h.push("");
2481
2479
  const g = [
2482
2480
  `${kt}${t}${ce}${Me} · ${o}${ce}`,
@@ -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 = Es(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 Ds() {
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 Ts = 27, Ms = 14, Ns = 16, Is = 20, Fs = 17, Rs = 14, Hn = 110, Bs = 60, Ws = 120, Ke = 40, Ls = 200, Hs = 420, zs = 24, qs = 7.6, Us = 6.6, zn = 7.4, Js = 5.4, Gs = 5.8, Vs = 6.2, Xs = 34, Ys = 48, bn = 8, Ks = 260, Zs = 18, Qs = 6.2, er = 30, wn = 24, vn = 24;
2501
2499
  class Yt extends Error {
2502
2500
  }
2503
- function nr(e) {
2501
+ function tr(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 nr(e) {
2512
2510
  try {
2513
- return JSON.parse(qo.export(e, "json"));
2511
+ return JSON.parse(Uo.export(e, "json"));
2514
2512
  } catch (t) {
2515
- throw new Yt(nr(t));
2513
+ throw new Yt(tr(t));
2516
2514
  }
2517
2515
  }
2518
- function sr(e) {
2516
+ function or(e) {
2519
2517
  return (e.type?.type_name ?? "").trim();
2520
2518
  }
2521
- function rr(e) {
2519
+ function sr(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 rr = /\[([^\]]+)\]\(([^)\s]+)\)/;
2524
+ function ar(e) {
2525
+ const t = String(e ?? "").trim(), n = rr.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 ir(e, t) {
2542
+ const n = Et(t.map((u) => u.name)) * qs, o = Et(t.map((u) => u.type)) * Us, s = Et(t.map((u) => u.linkLabel)) * Vs, r = t.some((u) => u.pk || u.fk) ? Xs : 0, i = Math.round(n + o + s + r + Ys), c = Math.round(e.length * zn + 32);
2543
+ return Math.min(Hs, Math.max(Ls, 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 cr(e) {
2546
+ const t = e.width - zs, n = Math.max(1, ht(e.name, zn, t)), o = ht(e.note, Js, t), s = Is + n * Fs + o * Rs, r = Math.max(e.columns.length, 1) * Ts, i = e.indexes.reduce(
2547
+ (u, h) => u + ht(`${h.unique ? "unique" : "index"} ${h.columns.join(", ")}`, Gs, t),
2550
2548
  0
2551
- ), c = e.indexes.length ? Is + i * Ns : 0;
2549
+ ), c = e.indexes.length ? Ns + i * Ms : 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 lr(e) {
2553
+ const t = e.width - wn, n = ht(e.body, Qs, t), o = e.title ? er : 0;
2554
+ return Math.round(wn + o + Math.max(1, n) * Zs);
2557
2555
  }
2558
- function ur(e, t, n) {
2556
+ function pr(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 ur(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
+ pr(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 mr(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 fr(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 dr(e, t) {
2623
2621
  const n = [];
2624
2622
  let o = Ke;
2625
- for (const s of fr(e, t)) {
2623
+ for (const s of mr(e, t)) {
2626
2624
  let r = Ke, i = o;
2627
- for (const c of dr(s, t)) {
2625
+ for (const c of fr(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);
2632
- r += u + zn;
2629
+ g.x = r + Math.round((u - g.width) / 2), g.y = h, h += g.height + Bs, i = Math.max(i, g.y + g.height), n.push(g);
2630
+ r += u + Hn;
2633
2631
  }
2634
- o = i + Ls;
2632
+ o = i + Ws;
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 hr(e) {
2637
+ const t = nr(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 = ar(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: or(oe),
2667
2665
  note: be.note,
2668
- default: rr(oe),
2666
+ default: sr(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: ir(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 = cr(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,12 +2729,12 @@ function gr(e) {
2731
2729
  });
2732
2730
  }
2733
2731
  }
2734
- const P = hr(
2732
+ const P = dr(
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);
2738
2736
  let v = Ke;
2739
- const D = d + Ke + zn;
2737
+ const D = d + Ke + Hn;
2740
2738
  for (const x of Object.values(t.notes).sort((E, I) => E.id - I.id)) {
2741
2739
  const E = String(x.content ?? "").trim();
2742
2740
  if (!E) continue;
@@ -2746,12 +2744,12 @@ function gr(e) {
2746
2744
  body: E,
2747
2745
  x: D,
2748
2746
  y: v,
2749
- width: Zs,
2747
+ width: Ks,
2750
2748
  height: 0
2751
2749
  };
2752
- I.height = pr(I), T.push(I), v += I.height + vn;
2750
+ I.height = lr(I), T.push(I), v += I.height + vn;
2753
2751
  }
2754
- mr([...A, ...T], vn);
2752
+ ur([...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);
@@ -2773,10 +2771,10 @@ function gr(e) {
2773
2771
  notes: T
2774
2772
  };
2775
2773
  }
2776
- function Un(e) {
2777
- return JSON.stringify(gr(e));
2774
+ function qn(e) {
2775
+ return JSON.stringify(hr(e));
2778
2776
  }
2779
- function _r(e, t, n = "") {
2777
+ function gr(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;
@@ -2791,7 +2789,7 @@ ${n}`;
2791
2789
  if (h)
2792
2790
  for (const d of Bt(h[1])) {
2793
2791
  const v = d.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
2794
- v && u.set(v[1], Ln(v[2]));
2792
+ v && u.set(v[1], Wn(v[2]));
2795
2793
  }
2796
2794
  const g = [];
2797
2795
  if (i)
@@ -2809,7 +2807,7 @@ ${n}`;
2809
2807
  D.bindable = !0;
2810
2808
  const R = o.slice(0, d.index).match(/\/\*\*((?:[^*]|\*(?!\/))*)\*\/\s*(?:const|let)\s+[\w$]+\s*=\s*$/);
2811
2809
  if (R) {
2812
- const x = Jo(R[1].replace(/^\s*\*\s?/gm, "").trim());
2810
+ const x = Go(R[1].replace(/^\s*\*\s?/gm, "").trim());
2813
2811
  x.description && (D.description = x.description), x.mock && !D.mock && (D.mock = x.mock);
2814
2812
  }
2815
2813
  g.push(D);
@@ -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 _r(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)
@@ -2845,7 +2843,7 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
2845
2843
  const T = A.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
2846
2844
  if (!T) continue;
2847
2845
  const d = T[2].trim().match(/^\$bindable\(([\s\S]*)\)$/);
2848
- d && c.add(T[1]), i.set(T[1], Ln(d ? d[1] : T[2]));
2846
+ d && c.add(T[1]), i.set(T[1], Wn(d ? d[1] : T[2]));
2849
2847
  }
2850
2848
  let u = null;
2851
2849
  const h = r?.[2]?.trim();
@@ -2884,7 +2882,7 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
2884
2882
  }
2885
2883
  return { component: t, props: g, slots: w, emits: P };
2886
2884
  }
2887
- function Jn(e, t = []) {
2885
+ function Un(e, t = []) {
2888
2886
  let n;
2889
2887
  try {
2890
2888
  n = Le(e, { withFileTypes: !0 });
@@ -2895,12 +2893,12 @@ function Jn(e, t = []) {
2895
2893
  const s = q(e, o.name);
2896
2894
  if (o.isDirectory()) {
2897
2895
  if (o.name === "node_modules") continue;
2898
- Jn(s, t);
2896
+ Un(s, t);
2899
2897
  } else o.isFile() && o.name.endsWith(".d.ts") && t.push(s);
2900
2898
  }
2901
2899
  return t;
2902
2900
  }
2903
- function br(e, t, n) {
2901
+ function yr(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 = [
@@ -2908,14 +2906,14 @@ function br(e, t, n) {
2908
2906
  `${n}.svelte.d.ts`,
2909
2907
  `${n}.d.ts`,
2910
2908
  `${n.toLowerCase()}/index.d.ts`
2911
- ], r = Jn(o);
2909
+ ], r = Un(o);
2912
2910
  for (const i of s) {
2913
2911
  const c = r.find((u) => u.endsWith(`/${i}`));
2914
2912
  if (c) return c;
2915
2913
  }
2916
2914
  return null;
2917
2915
  }
2918
- function _i(e, t) {
2916
+ function di(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 br(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 wr(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(br(s, o.name));
2983
2981
  }
2984
2982
  return n.sort((o, s) => o.name.localeCompare(s.name)), n;
2985
2983
  }
@@ -2999,7 +2997,7 @@ function $t(e, t, n, o, s) {
2999
2997
  }
3000
2998
  return null;
3001
2999
  }
3002
- async function Gn(e, t = []) {
3000
+ async function Jn(e, t = []) {
3003
3001
  let n;
3004
3002
  try {
3005
3003
  n = await Ut(e, { withFileTypes: !0 });
@@ -3010,13 +3008,13 @@ async function Gn(e, t = []) {
3010
3008
  const s = q(e, o.name);
3011
3009
  if (o.isDirectory()) {
3012
3010
  if (o.name.startsWith(".") || o.name === "node_modules") continue;
3013
- await Gn(s, t);
3011
+ await Jn(s, t);
3014
3012
  } else o.isFile() && o.name.endsWith(".md") && t.push(s);
3015
3013
  }
3016
3014
  return t;
3017
3015
  }
3018
3016
  async function Kt(e, t) {
3019
- const n = G(e, t), o = await Gn(n), s = [];
3017
+ const n = G(e, t), o = await Jn(n), s = [];
3020
3018
  for (const r of o) {
3021
3019
  let i;
3022
3020
  try {
@@ -3045,27 +3043,27 @@ function nt(e) {
3045
3043
  return fe(n) ? { path: n, form: "json" } : null;
3046
3044
  }
3047
3045
  function ot(e, t) {
3048
- return t === "yml" ? Wn(e) : JSON.parse(e);
3046
+ return t === "yml" ? Bn(e) : JSON.parse(e);
3049
3047
  }
3050
3048
  function et(e, t) {
3051
- return t === "yml" ? Lo(e) : JSON.stringify(e, null, 2) + `
3049
+ return t === "yml" ? Ho(e) : JSON.stringify(e, null, 2) + `
3052
3050
  `;
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 Mr(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 vr = ["description", "default", "enum", "mock", "format", "minimum", "maximum", "title"], kr = ["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 kr)
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 vr)
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 $r(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 = $r(t);
3109
3107
  kn.has(n) || (kn.add(n), Xe.push(t));
3110
3108
  }
3111
3109
  }
3112
- const Sr = {
3110
+ const xr = {
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 Sr(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
  }
@@ -3131,14 +3129,14 @@ function Je(e = process.cwd()) {
3131
3129
  r.push(` ${Ae}${kt}nimpress modules${ce} ${Me}${n} ${o} in ${t.size} ${s}${ce}`), r.push("");
3132
3130
  for (const [i, c] of t) {
3133
3131
  const u = c.find((w) => w.sourceFile)?.sourceFile;
3134
- r.push(` ${Hn}${kt}${i}${ce}${u ? ` ${dt}${je(e, u)}${ce}` : ""}`);
3132
+ r.push(` ${Ln}${kt}${i}${ce}${u ? ` ${dt}${je(e, u)}${ce}` : ""}`);
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} ${Sr(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}${xr[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(`
@@ -3160,7 +3158,7 @@ function Sn(e, t, n = {}) {
3160
3158
  const o = [], s = Xt(e, t);
3161
3159
  for (const r of s.props.filter((i) => !i.description))
3162
3160
  o.push({ component: e, sourceFile: n.sourceFile, line: xn(n.sourceText, r.name), path: r.name, detail: "has no description", kind: "undocumented" });
3163
- for (const r of Go(s.props))
3161
+ for (const r of Vo(s.props))
3164
3162
  o.push({ component: e, sourceFile: n.sourceFile, line: xn(n.sourceText, r.path), path: r.path, detail: `type ${r.type} is opaque`, kind: "opaque" });
3165
3163
  for (const r of n.report?.missing ?? [])
3166
3164
  o.push({ component: e, sourceFile: n.sourceFile, path: r, detail: "has no counterpart in the component source", kind: "orphan" });
@@ -3168,7 +3166,7 @@ function Sn(e, t, n = {}) {
3168
3166
  }
3169
3167
  async function en(e, t, n, o) {
3170
3168
  if (!n) return;
3171
- const s = Vo(t, n.props, n.slots, n.emits), r = o ? await ie(o, "utf-8").catch(() => {
3169
+ const s = Xo(t, n.props, n.slots, n.emits), r = o ? await ie(o, "utf-8").catch(() => {
3172
3170
  }) : void 0, i = nt(e);
3173
3171
  if (!i) {
3174
3172
  const P = q(e, "schema.json");
@@ -3192,20 +3190,20 @@ 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 jr(e, t, n, o) {
3196
3194
  let s;
3197
3195
  try {
3198
3196
  s = await ie(n, "utf-8");
3199
3197
  } catch {
3200
3198
  return;
3201
3199
  }
3202
- const r = Fn("sha1").update(s).digest("hex");
3200
+ const r = In("sha1").update(s).digest("hex");
3203
3201
  if (jn.get(n) === r) return;
3204
3202
  jn.set(n, r);
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 hi(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 Pr(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 Ar(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 Er(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 = Pr(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 = Ar(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 Cr(e, t, n) {
3268
+ const o = await Er(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 gi(e, t, n = {}) {
3278
3276
  if (n.ref)
3279
- return await Or(e, t, n.ref), 1;
3277
+ return await Cr(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 Or(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 Dr(e, t, n) {
3307
+ const o = Or(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) => Tr(v));
3320
3318
  if (!A) continue;
3321
3319
  const T = G(A);
3322
3320
  if (s.has(T) || s.size > 50) continue;
@@ -3328,36 +3326,36 @@ async function Tr(e, t, n) {
3328
3326
  }
3329
3327
  return i;
3330
3328
  }
3331
- function Mr(e) {
3329
+ function Tr(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 Mr(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 Dr(e, t, s);
3343
+ const i = n === "vue" ? gr(s, o, r) : _r(s, o, r);
3346
3344
  for (const c of i.props) {
3347
3345
  if (!c.format) {
3348
- const u = Xo(c);
3346
+ const u = Yo(c);
3349
3347
  u && (c.format = u);
3350
3348
  }
3351
- c.mock || (c.mock = Yo(c.name, Ko(c)));
3349
+ c.mock || (c.mock = Ko(c.name, Zo(c)));
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 Nr(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 wr(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 jr(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 = yr(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"));
@@ -3408,16 +3406,16 @@ async function Ir(e) {
3408
3406
  watchFiles: w
3409
3407
  };
3410
3408
  }
3411
- function Vn(e, t) {
3409
+ function Gn(e, t) {
3412
3410
  return G(e, t.paths.out);
3413
3411
  }
3414
- function Xn(e, t, ...n) {
3412
+ function Vn(e, t, ...n) {
3415
3413
  return G(e, t.paths.cache, ...n);
3416
3414
  }
3417
- function wi(e, t) {
3415
+ function _i(e, t) {
3418
3416
  return q(e, t.paths.guarded);
3419
3417
  }
3420
- function Fr(e) {
3418
+ function Ir(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);
@@ -3440,12 +3438,12 @@ function Fr(e) {
3440
3438
  n.get(c) || i(c);
3441
3439
  return s;
3442
3440
  }
3443
- function Yn() {
3441
+ function Xn() {
3444
3442
  return {
3445
3443
  name: "nimpress:chunk-cycle-guard",
3446
3444
  apply: "build",
3447
3445
  generateBundle(e, t) {
3448
- const n = Fr(t);
3446
+ const n = Ir(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,40 +3470,40 @@ 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 yi(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) }),
3486
- Yn()
3481
+ r({ compilerOptions: { runes: !0, dev: n === "serve" } }),
3482
+ i(),
3483
+ Ua({ ...o, modules: Object.values(o.modules.systems) }),
3484
+ Xn()
3487
3485
  ],
3488
- cacheDir: Xn(t, o, "site"),
3486
+ cacheDir: Vn(t, o, "site"),
3489
3487
  build: {
3490
- outDir: Vn(t, o),
3488
+ outDir: Gn(t, o),
3491
3489
  emptyOutDir: !0,
3492
3490
  target: "es2022",
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 Fr = 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 Fr + Math.max(0, o.indexOf(t));
3504
3502
  }
3505
- function Kn(e, t) {
3503
+ function Yn(e, t) {
3506
3504
  return `${Ht}${e}/${t}/entry`;
3507
3505
  }
3508
- function Zn() {
3506
+ function Kn() {
3509
3507
  return `const params = new URLSearchParams(location.search)
3510
3508
  function parseParam(name) {
3511
3509
  const raw = params.get(name)
@@ -3677,7 +3675,7 @@ window.addEventListener('dblclick', (event) => {
3677
3675
  applyPan()
3678
3676
  })`;
3679
3677
  }
3680
- function Qn(e) {
3678
+ function Zn(e) {
3681
3679
  const t = e.named ? `mod[${JSON.stringify(e.component)}]` : "mod.default ?? mod";
3682
3680
  return `let ComponentRef = null
3683
3681
  async function ensureComponent() {
@@ -3688,7 +3686,7 @@ async function ensureComponent() {
3688
3686
  return ComponentRef
3689
3687
  }`;
3690
3688
  }
3691
- function eo(e) {
3689
+ function Qn(e) {
3692
3690
  return `const storyLoaders = {
3693
3691
  ${(e.storyFiles ?? []).map((n) => ` ${JSON.stringify(n.base)}: () => import(${JSON.stringify(n.path)})`).join(`,
3694
3692
  `)}
@@ -3696,21 +3694,21 @@ ${(e.storyFiles ?? []).map((n) => ` ${JSON.stringify(n.base)}: () => import(${J
3696
3694
  const activeLoader = storyLoaders[params.get('story') ?? '']
3697
3695
  const activeStoryDef = activeLoader ? (await activeLoader()).default : null`;
3698
3696
  }
3699
- function to(e) {
3697
+ function eo(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 Rr(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'
3706
3704
  import { DefaultHarness, ComponentStory, createHarnessContext, HARNESS_KEY } from '@nimtech/nimpress/harness/vue'
3707
3705
  ${r}
3708
- ${to(n)}
3706
+ ${eo(n)}
3709
3707
  ${i}
3710
3708
 
3711
- ${Zn()}
3712
- ${eo(e)}
3709
+ ${Kn()}
3713
3710
  ${Qn(e)}
3711
+ ${Zn(e)}
3714
3712
 
3715
3713
  const setupDef = typeof harnessSetup === 'function' ? await harnessSetup() : harnessSetup
3716
3714
  const Overlay = setupDef ? (setupDef.companion ?? null) : null
@@ -3793,18 +3791,18 @@ try {
3793
3791
  parent.postMessage({ type: 'nimpress:ready' }, '*')
3794
3792
  `;
3795
3793
  }
3796
- function Wr(e, t, n, o, s) {
3794
+ function Br(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'
3800
3798
  import { DefaultHarness, HarnessRoot, createHarnessContext } from '@nimtech/nimpress/harness/svelte'
3801
3799
  ${r}
3802
- ${to(n)}
3800
+ ${eo(n)}
3803
3801
  ${i}
3804
3802
 
3805
- ${Zn()}
3806
- ${eo(e)}
3803
+ ${Kn()}
3807
3804
  ${Qn(e)}
3805
+ ${Zn(e)}
3808
3806
 
3809
3807
  if (typeof harnessSetup === 'function') await harnessSetup()
3810
3808
 
@@ -3860,7 +3858,7 @@ try {
3860
3858
  parent.postMessage({ type: 'nimpress:ready' }, '*')
3861
3859
  `;
3862
3860
  }
3863
- function Lr(e) {
3861
+ function Wr(e) {
3864
3862
  if (!e.schemaFile || !fe(e.schemaFile)) return {};
3865
3863
  let t;
3866
3864
  try {
@@ -3871,14 +3869,14 @@ function Lr(e) {
3871
3869
  const n = Xt(e.component, t), o = {};
3872
3870
  for (const s of n.props) {
3873
3871
  if (!s.required) continue;
3874
- const r = s.default !== void 0 ? s.default : Zo(s, 0);
3872
+ const r = s.default !== void 0 ? s.default : Qo(s, 0);
3875
3873
  r !== void 0 && (o[s.name] = r);
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 Lr(e, t, n, o, s) {
3878
+ const r = Wr(t);
3879
+ return e === "vue" ? Rr(t, n, o, s, r) : Br(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,12 +3906,12 @@ ${o ? o + `
3908
3906
  </html>
3909
3907
  `;
3910
3908
  }
3911
- async function zr(e, t) {
3909
+ async function Hr(e, t) {
3912
3910
  if (t === "svelte") {
3913
3911
  const { svelte: c } = await import("@sveltejs/vite-plugin-svelte");
3914
3912
  return c();
3915
3913
  }
3916
- const n = In(q(e, "package.json"));
3914
+ const n = Nn(q(e, "package.json"));
3917
3915
  let o;
3918
3916
  try {
3919
3917
  o = n.resolve("@vitejs/plugin-vue");
@@ -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 zr(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 = qr(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 qr(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 Ur(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 Jr(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 Gr(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 = Ur(e, t), c = Jr(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) => Lr(t.framework, P, r, i, c);
3980
3978
  return {
3981
3979
  name: "nimpress:harness",
3982
3980
  resolveId(P) {
@@ -4004,7 +4002,7 @@ function Vr(e, t, n, o, s) {
4004
4002
  return;
4005
4003
  }
4006
4004
  if (E === "entry.js") {
4007
- const I = await P.transformRequest(Kn(n, x));
4005
+ const I = await P.transformRequest(Yn(n, x));
4008
4006
  if (!I) return d();
4009
4007
  T.statusCode = 200, T.setHeader("Content-Type", "application/javascript"), T.end(I.code);
4010
4008
  return;
@@ -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 bi(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 = zr(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 Hr(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
- cacheDir: Xn(e, t, "modules", n),
4052
- plugins: [Vr(e, r, n, c, P), u, Yn()],
4049
+ cacheDir: Vn(e, t, "modules", n),
4050
+ plugins: [Gr(e, r, n, c, P), u, Xn()],
4053
4051
  resolve: r.framework === "vue" ? { alias: { vue: "vue/dist/vue.esm-bundler.js" } } : void 0,
4054
4052
  optimizeDeps: {
4055
4053
  entries: A,
@@ -4067,18 +4065,18 @@ async function ki(e, t, n, o) {
4067
4065
  }
4068
4066
  },
4069
4067
  build: {
4070
- outDir: q(Vn(e, t), g.replace(/^\//, ""), n),
4068
+ outDir: q(Gn(e, t), g.replace(/^\//, ""), n),
4071
4069
  emptyOutDir: !0,
4072
4070
  target: "es2022",
4073
4071
  rollupOptions: {
4074
- input: Object.fromEntries(c.map((d) => [d.component, Kn(n, d.component)]))
4072
+ input: Object.fromEntries(c.map((d) => [d.component, Yn(n, d.component)]))
4075
4073
  }
4076
4074
  },
4077
4075
  base: P
4078
4076
  };
4079
4077
  return tn(T, t.vite);
4080
4078
  }
4081
- function Xr(e, t = "virtual:nimpress/main") {
4079
+ function Vr(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, Xr = "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 Yr(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 Kr(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", Zr = {
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
+ }, Qr = 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(), ea = 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(), ta = m.object({
4185
4183
  override: m.boolean().optional(),
4186
4184
  ai: m.boolean().optional(),
4187
4185
  description: m.string().optional(),
@@ -4190,10 +4188,10 @@ 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: Qr.optional(),
4192
+ twitter: ea.optional(),
4195
4193
  jsonLd: m.unknown().optional()
4196
- }).passthrough(), no = m.object({
4194
+ }).passthrough(), to = m.object({
4197
4195
  title: m.string().optional(),
4198
4196
  slug: m.string().optional(),
4199
4197
  type: 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: ta.optional(),
4227
4225
  data: m.record(m.unknown()).optional()
4228
- }).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) {
4226
+ }).passthrough(), no = /* @__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();
4227
+ function na(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,30 +4238,30 @@ function oa(e, t) {
4240
4238
  Ne.set(n, { file: o, schema: i });
4241
4239
  }
4242
4240
  }
4243
- function sa(e) {
4241
+ function oa(e) {
4244
4242
  return Array.isArray(e) ? "array" : e === null ? "null" : typeof e;
4245
4243
  }
4246
- function ra(e, t) {
4244
+ function sa(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 && oa(t[s]) !== r.type && o.push(`type ${e} expects data.${s} to be ${r.type}`);
4254
4252
  return o;
4255
4253
  }
4256
- function so(e, t = "x") {
4254
+ function oo(e, t = "x") {
4257
4255
  const n = [], s = (typeof e == "object" && e !== null ? Object.keys(e) : []).find((h) => h.toLowerCase() === "notoc");
4258
4256
  s && n.push(`${s}: write hide: [toc], the hide list carries every element a page drops`);
4259
- const r = no.safeParse(e);
4257
+ const r = to.safeParse(e);
4260
4258
  if (!r.success) {
4261
4259
  for (const h of r.error.errors)
4262
4260
  n.push(`${h.path.join(".") || "frontmatter"}: ${h.message}`);
4263
4261
  return n;
4264
4262
  }
4265
4263
  const i = r.data;
4266
- i.type && !oo.has(i.type) && !Ne.has(i.type) && n.push(`type: ${i.type} is not a page type; add it under pageTypes in the config`);
4264
+ i.type && !no.has(i.type) && !Ne.has(i.type) && n.push(`type: ${i.type} is not a page type; add it under pageTypes in the config`);
4267
4265
  const c = i.data ?? {};
4268
4266
  if (i.link)
4269
4267
  return !i.title && !i.sidebar?.name && n.push("a link page needs a title or a sidebar.name for its label"), /^[a-z][a-z0-9+.-]*:\/\/|^mailto:|^tel:/i.test(i.link) || n.push("link: must be an absolute url"), t.trim() !== "" && n.push("a link page carries no body, the entry opens link instead of a page"), n;
@@ -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(...sa(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 ra(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 aa(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 so(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,18 +4340,21 @@ 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
- function Cn(e) {
4350
+ function ro(e) {
4353
4351
  if (!e) return "/";
4354
4352
  let t = e.startsWith("/") ? e : "/" + e;
4355
4353
  return t.length > 1 && t.endsWith("/") && (t = t.slice(0, -1)), t;
4356
4354
  }
4355
+ function la(e, t, n) {
4356
+ return ro(n ?? ca(so(e, t)));
4357
+ }
4357
4358
  async function nn(e, t = []) {
4358
4359
  let n;
4359
4360
  try {
@@ -4376,7 +4377,7 @@ function Ie(e) {
4376
4377
  function Ft(e) {
4377
4378
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
4378
4379
  }
4379
- const On = {
4380
+ const Cn = {
4380
4381
  ctrl: "Ctrl",
4381
4382
  control: "Ctrl",
4382
4383
  alt: "Alt",
@@ -4409,11 +4410,11 @@ const On = {
4409
4410
  plus: "+",
4410
4411
  minus: "−"
4411
4412
  };
4412
- function ua(e) {
4413
+ function pa(e) {
4413
4414
  const t = e.trim().toLowerCase();
4414
- return On[t] ? On[t] : t.length === 1 ? t.toUpperCase() : t.charAt(0).toUpperCase() + t.slice(1);
4415
+ return Cn[t] ? Cn[t] : t.length === 1 ? t.toUpperCase() : t.charAt(0).toUpperCase() + t.slice(1);
4415
4416
  }
4416
- const ma = (e, t) => {
4417
+ const ua = (e, t) => {
4417
4418
  const n = e.src, o = e.pos;
4418
4419
  if (n.charCodeAt(o) !== 94 || n.charCodeAt(o + 1) !== 94) return !1;
4419
4420
  const s = n.indexOf("^^", o + 2);
@@ -4426,7 +4427,7 @@ const ma = (e, t) => {
4426
4427
  i.content = r, e.push("ins_close", "ins", -1);
4427
4428
  }
4428
4429
  return e.pos = s + 2, !0;
4429
- }, fa = (e, t) => {
4430
+ }, ma = (e, t) => {
4430
4431
  const n = e.src, o = e.pos;
4431
4432
  if (n.charCodeAt(o) !== 43 || n.charCodeAt(o + 1) !== 43) return !1;
4432
4433
  const s = n.indexOf("++", o + 2);
@@ -4437,34 +4438,34 @@ const ma = (e, t) => {
4437
4438
  if (i.length === 0) return !1;
4438
4439
  if (!t) {
4439
4440
  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>`;
4441
+ c.content = `<span class="np-keys">${i.map((u) => `<kbd class="np-key">${e.md.utils.escapeHtml(pa(u))}</kbd>`).join('<span class="np-key-join">+</span>')}</span>`;
4441
4442
  }
4442
4443
  return e.pos = s + 2, !0;
4443
- }, da = (e) => {
4444
+ }, fa = (e) => {
4444
4445
  const t = e.tokens;
4445
4446
  for (let n = 0; n + 2 < t.length; n++) {
4446
4447
  if (t[n].type !== "paragraph_open" || t[n + 1].type !== "inline" || t[n + 2].type !== "paragraph_close") continue;
4447
4448
  const s = (t[n + 1].children ?? []).filter((r) => !(r.type === "text" && r.content.trim() === ""));
4448
4449
  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
4450
  }
4450
- }, ha = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, ga = In(import.meta.url);
4451
- function _a() {
4451
+ }, da = /^:([a-z0-9]+(?:-[a-z0-9]+)*):/, ha = Nn(import.meta.url);
4452
+ function ga() {
4452
4453
  try {
4453
- return Y(ga.resolve("lucide-static/icons/a-arrow-down.svg"));
4454
+ return Y(ha.resolve("lucide-static/icons/a-arrow-down.svg"));
4454
4455
  } catch {
4455
4456
  return G(process.cwd(), "node_modules", "lucide-static", "icons");
4456
4457
  }
4457
4458
  }
4458
- const Dn = /* @__PURE__ */ new Map();
4459
- function ro(e, t) {
4460
- const n = `${t ?? ""}:${e}`, o = Dn.get(n);
4459
+ const On = /* @__PURE__ */ new Map();
4460
+ function ao(e, t) {
4461
+ const n = `${t ?? ""}:${e}`, o = On.get(n);
4461
4462
  if (o !== void 0) return o;
4462
4463
  let s = null;
4463
- e.startsWith("lucide-") ? s = q(_a(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
4464
+ e.startsWith("lucide-") ? s = q(ga(), `${e.slice(7)}.svg`) : t && (s = G(process.cwd(), t, `${e}.svg`));
4464
4465
  let r = null;
4465
- 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
+ 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()), On.set(n, r), r;
4466
4467
  }
4467
- function ya(e) {
4468
+ function _a(e) {
4468
4469
  const t = [], n = [];
4469
4470
  for (const o of e.trim().split(/\s+/).filter(Boolean))
4470
4471
  if (o.startsWith(".")) n.push(o.slice(1));
@@ -4475,17 +4476,17 @@ function ya(e) {
4475
4476
  }
4476
4477
  return n.length && t.push(["class", n.join(" ")]), t;
4477
4478
  }
4478
- function ba(e) {
4479
+ function ya(e) {
4479
4480
  return (t, n) => {
4480
4481
  if (t.src.charCodeAt(t.pos) !== 58) return !1;
4481
- const o = ha.exec(t.src.slice(t.pos));
4482
+ const o = da.exec(t.src.slice(t.pos));
4482
4483
  if (!o) return !1;
4483
- const s = o[1], r = ro(s, e);
4484
+ const s = o[1], r = ao(s, e);
4484
4485
  if (!r)
4485
4486
  return s.startsWith("lucide-") && console.warn(`[nimpress] icon :${s}: is not a lucide icon; the shortcode stays as text`), !1;
4486
4487
  let i = t.pos + o[0].length, c = [];
4487
4488
  const u = t.src.slice(i), h = /^\{([^}\n]*)\}/.exec(u);
4488
- if (h && (c = ya(h[1]), i += h[0].length), !n) {
4489
+ if (h && (c = _a(h[1]), i += h[0].length), !n) {
4489
4490
  const g = t.push("np_icon", "span", 0);
4490
4491
  g.content = r, g.attrSet("data-icon", s), g.attrJoin("class", "np-icon");
4491
4492
  for (const [w, P] of c)
@@ -4494,10 +4495,10 @@ function ba(e) {
4494
4495
  return t.pos = i, !0;
4495
4496
  };
4496
4497
  }
4497
- function Tn(e) {
4498
+ function Dn(e) {
4498
4499
  return Buffer.from(e, "utf-8").toString("base64");
4499
4500
  }
4500
- const wa = (e, t, n, o) => {
4501
+ const ba = (e, t, n, o) => {
4501
4502
  const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
4502
4503
  if (e.src.slice(s, s + 2) !== "$$") return !1;
4503
4504
  const i = e.src.slice(s + 2, r);
@@ -4527,7 +4528,7 @@ const wa = (e, t, n, o) => {
4527
4528
  const g = e.push("np_math_block", "div", 0);
4528
4529
  return g.content = u.join(`
4529
4530
  `).trim(), g.map = [t, c + 1], e.line = c + 1, !0;
4530
- }, va = (e, t) => {
4531
+ }, wa = (e, t) => {
4531
4532
  const n = e.src, o = e.pos;
4532
4533
  if (n.charCodeAt(o) !== 36 || n.charCodeAt(o + 1) === 36 || o > 0 && n.charCodeAt(o - 1) === 92) return !1;
4533
4534
  const s = n.charCodeAt(o + 1);
@@ -4552,25 +4553,25 @@ const wa = (e, t, n, o) => {
4552
4553
  u.content = i;
4553
4554
  }
4554
4555
  return e.pos = r + 1, !0;
4555
- }, ka = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, $a = (e, t, n, o) => {
4556
+ }, va = /^\*\[([^\]\n]+)\]:[ \t]*(.+?)[ \t]*$/, ka = (e, t, n, o) => {
4556
4557
  const s = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
4557
4558
  if (e.src.charCodeAt(s) !== 42 || e.src.charCodeAt(s + 1) !== 91) return !1;
4558
- const i = ka.exec(e.src.slice(s, r));
4559
+ const i = va.exec(e.src.slice(s, r));
4559
4560
  if (!i) return !1;
4560
4561
  if (o) return !0;
4561
4562
  const c = e.env;
4562
4563
  return c.abbr = { ...c.abbr ?? {}, [i[1].trim()]: i[2].trim() }, e.line = t + 1, !0;
4563
4564
  };
4564
- function xa(e) {
4565
+ function $a(e) {
4565
4566
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4566
4567
  }
4567
- function Sa(e) {
4568
+ function xa(e) {
4568
4569
  return (t) => {
4569
4570
  const n = t.env, o = /* @__PURE__ */ new Map();
4570
4571
  if (!n.glossaryPage) for (const u of e) o.set(u.term, u.description);
4571
4572
  for (const [u, h] of Object.entries(n.abbr ?? {})) o.set(u, h);
4572
4573
  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;
4574
+ 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]) => $a(u)).join("|")})(?![\\p{L}\\p{N}_])`, "iu"), c = t.tokens;
4574
4575
  for (let u = 0; u < c.length; u++) {
4575
4576
  const h = c[u];
4576
4577
  if (h.type !== "inline" || !h.children || c[u - 1]?.type === "heading_open") continue;
@@ -4616,12 +4617,12 @@ function Sa(e) {
4616
4617
  }
4617
4618
  };
4618
4619
  }
4619
- const ja = (e) => {
4620
+ const Sa = (e) => {
4620
4621
  if (!e.env.glossaryPage) return;
4621
4622
  const n = e.tokens;
4622
4623
  for (let o = 0; o + 1 < n.length; o++)
4623
4624
  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) => {
4625
+ }, ja = (e) => {
4625
4626
  const t = e.tokens, n = /* @__PURE__ */ new Map();
4626
4627
  for (let o = 0; o < t.length; o++) {
4627
4628
  if (t[o].type !== "footnote_open") continue;
@@ -4638,7 +4639,7 @@ const ja = (e) => {
4638
4639
  r && (s.meta = { ...s.meta, tip: r });
4639
4640
  }
4640
4641
  };
4641
- function Aa(e, t) {
4642
+ function Pa(e, t) {
4642
4643
  const n = e.parse(t, {}), o = [];
4643
4644
  let s = "";
4644
4645
  for (let r = 0; r + 1 < n.length; r++) {
@@ -4655,21 +4656,21 @@ function Aa(e, t) {
4655
4656
  }
4656
4657
  return o;
4657
4658
  }
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"];
4659
- function Mn(e, t) {
4659
+ const wi = ["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"];
4660
+ function Tn(e, t) {
4660
4661
  return `@scope (.np-${e}) {
4661
4662
  ${t}
4662
4663
  }`;
4663
4664
  }
4664
- function Ea(e, t) {
4665
+ function Aa(e, t) {
4665
4666
  const n = new RegExp(`^${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\.([a-z0-9-]+)\\.css$`).exec(e);
4666
4667
  return n ? n[1] : null;
4667
4668
  }
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(" "));
4669
+ const Ea = 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
4670
  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));
4671
+ 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 && !Ea.has(t) && !/^\d+$/.test(t));
4671
4672
  }
4672
- function Oa(e) {
4673
+ function Ca(e) {
4673
4674
  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
4675
  if (!t) return "";
4675
4676
  const n = t.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/[*_`~^=]+/g, "");
@@ -4677,7 +4678,7 @@ function Oa(e) {
4677
4678
  const o = n.slice(0, 157);
4678
4679
  return `${o.slice(0, Math.max(o.lastIndexOf(" "), 100))}…`;
4679
4680
  }
4680
- function Da(e) {
4681
+ function Oa(e) {
4681
4682
  const t = /* @__PURE__ */ new Map(), n = e.map((r) => {
4682
4683
  const i = /* @__PURE__ */ new Map(), c = (u, h) => {
4683
4684
  for (const g of u) i.set(g, (i.get(g) ?? 0) + h);
@@ -4693,15 +4694,15 @@ function Da(e) {
4693
4694
  if (u.length >= 8) break;
4694
4695
  u.some((g) => g.toLowerCase() === h.word) || u.push(h.word);
4695
4696
  }
4696
- s.set(r.slug, { keywords: u, description: Oa(r.body) });
4697
+ s.set(r.slug, { keywords: u, description: Ca(r.body) });
4697
4698
  }
4698
4699
  return s;
4699
4700
  }
4700
- function Ta(e, t, n) {
4701
+ function Da(e, t, n) {
4701
4702
  return n === !1 || t === !1 && n !== !0 ? `${e}, noai, noimageai` : e;
4702
4703
  }
4703
- function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4704
- const s = new Rn({
4704
+ function Mn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4705
+ const s = new Fn({
4705
4706
  html: !0,
4706
4707
  linkify: !0,
4707
4708
  typographer: !1,
@@ -4712,13 +4713,13 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4712
4713
  zsh: "bash",
4713
4714
  console: "bash",
4714
4715
  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" } : {};
4716
+ }, E = ((D ? D.match(/\[([^\]]+)\]/) : null)?.[1].trim() || v || "text").trim(), I = R[v] ?? v, H = I && e.getLoadedLanguages().includes(I) ? I : "text", K = Ma(D ?? ""), re = Na(E, K), he = io.test(d) ? { includeExplanation: "scopeName" } : {};
4716
4717
  try {
4717
4718
  return e.codeToHtml(d, {
4718
4719
  ...he,
4719
4720
  lang: H,
4720
4721
  theme: "github-dark",
4721
- transformers: [Ba(re, K)]
4722
+ transformers: [Ra(re, K)]
4722
4723
  });
4723
4724
  } catch {
4724
4725
  return `<pre ${Object.entries(re).map(([ge, oe]) => `${ge}="${s.utils.escapeHtml(oe)}"`).join(" ")}><code>${s.utils.escapeHtml(d)}</code></pre>`;
@@ -4768,15 +4769,15 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4768
4769
  }, s.use(dn, {
4769
4770
  slugify: Ie,
4770
4771
  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);
4772
+ }), s.use(Ro), s.use(Rn), s.use(Wo), s.use(Lo, { enabled: !0 }), s.use(fs), s.inline.ruler.before("emphasis", "np_ins", ua), s.renderer.rules.s_open = () => "<del>", s.renderer.rules.s_close = () => "</del>", s.use(gs), s.use(bs), s.inline.ruler.before("emphasis", "np_keys", ma), s.core.ruler.push("np_figures", fa), s.block.ruler.before("reference", "np_abbr_definition", ka, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.core.ruler.after("inline", "np_abbr", xa(o.glossary ?? [])), s.core.ruler.push("np_glossary_anchors", Sa), s.core.ruler.after("footnote_tail", "np_footnote_tips", ja);
4772
4773
  const h = s.renderer.rules.footnote_ref ?? r;
4773
4774
  s.renderer.rules.footnote_ref = (d, v, D, R, x) => {
4774
4775
  const E = String(d[v].meta?.tip ?? ""), I = h(d, v, D, R, x);
4775
4776
  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>
4777
- `, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${Tn(d[v].content)}"></span>`);
4777
+ }, s.inline.ruler.before("emphasis", "np_icon", ya(o.icons)), s.use(Ps), 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", ba, { alt: ["paragraph", "reference", "blockquote", "list"] }), s.inline.ruler.before("emphasis", "np_math_inline", wa), s.renderer.rules.np_math_block = (d, v) => `<div class="np-math np-math-display" data-math="${Dn(d[v].content)}"></div>
4778
+ `, s.renderer.rules.np_math_inline = (d, v) => `<span class="np-math" data-math="${Dn(d[v].content)}"></span>`);
4778
4779
  const g = (d, v) => {
4779
- s.use(Ro, d, v);
4780
+ s.use(Bo, d, v);
4780
4781
  }, w = [
4781
4782
  "tip",
4782
4783
  "note",
@@ -4907,8 +4908,8 @@ function Nn(e, t = { route: "/_components" }, n = "/", o = { math: !0 }) {
4907
4908
  }
4908
4909
  }), s;
4909
4910
  }
4910
- const ao = /\((\d+)\)(!?)[ \t]*$/m;
4911
- function Ma(e) {
4911
+ const io = /\((\d+)\)(!?)[ \t]*$/m;
4912
+ function Ta(e) {
4912
4913
  const t = /* @__PURE__ */ new Set(), n = Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : typeof e == "number" ? [e] : [];
4913
4914
  for (const o of n) {
4914
4915
  const s = String(o).trim(), r = /^(\d+)(?:-(\d+))?$/.exec(s);
@@ -4918,28 +4919,28 @@ function Ma(e) {
4918
4919
  }
4919
4920
  return t;
4920
4921
  }
4921
- function Na(e) {
4922
+ function Ma(e) {
4922
4923
  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
4924
  return {
4924
4925
  title: typeof n.title == "string" ? n.title.trim() : "",
4925
4926
  lines: n.lines === !0 || typeof n.start == "number",
4926
4927
  start: o,
4927
- highlight: Ma(n.highlight)
4928
+ highlight: Ta(n.highlight)
4928
4929
  };
4929
4930
  }
4930
- function Ia(e, t) {
4931
+ function Na(e, t) {
4931
4932
  const n = { "data-lang": e };
4932
4933
  return t.title && (n["data-title"] = t.title), t.lines && (n["data-lines"] = "true", n["data-start"] = String(t.start)), n;
4933
4934
  }
4934
- function Fa(e) {
4935
+ function Ia(e) {
4935
4936
  const t = e.explanation ?? [];
4936
4937
  return t.length > 0 && t.every(
4937
4938
  (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
4939
  );
4939
4940
  }
4940
- function Ra(e) {
4941
+ function Fa(e) {
4941
4942
  let t = e.length;
4942
- for (; t > 0 && Fa(e[t - 1]); ) t -= 1;
4943
+ for (; t > 0 && Ia(e[t - 1]); ) t -= 1;
4943
4944
  if (t === e.length) return e;
4944
4945
  const n = e.slice(t).flatMap(
4945
4946
  (w) => (w.explanation ?? []).map((P) => ({
@@ -4952,7 +4953,7 @@ function Ra(e) {
4952
4953
  let o = n.length - 1;
4953
4954
  for (; o >= 0 && (n[o].punctuation || !n[o].text.trim()); ) o -= 1;
4954
4955
  if (o < 0) return e;
4955
- const s = ao.exec(n[o].text);
4956
+ const s = io.exec(n[o].text);
4956
4957
  if (!s) return e;
4957
4958
  const r = s[2] === "!";
4958
4959
  n[o].text = n[o].text.slice(0, s.index);
@@ -4968,11 +4969,11 @@ function Ra(e) {
4968
4969
  });
4969
4970
  return [...e.slice(0, t), ...u.map(g), i, ...h.map(g)];
4970
4971
  }
4971
- function Ba(e, t) {
4972
+ function Ra(e, t) {
4972
4973
  return {
4973
4974
  name: "nimpress:code-fence",
4974
4975
  tokens(n) {
4975
- return n.map(Ra);
4976
+ return n.map(Fa);
4976
4977
  },
4977
4978
  pre(n) {
4978
4979
  n.properties.style = String(n.properties.style ?? "").replace(/background-color:[^;]*;?/, "");
@@ -4997,14 +4998,14 @@ function Ee(e, t) {
4997
4998
  function tt(e) {
4998
4999
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4999
5000
  }
5000
- function Wa(e) {
5001
+ function Ba(e) {
5001
5002
  return `<div class="np-mermaid" data-graph="${Buffer.from(e, "utf-8").toString("base64")}"></div>`;
5002
5003
  }
5003
- function La(e, t, n) {
5004
+ function Wa(e, t, n) {
5004
5005
  const o = t.startsWith("{") ? Ee(t, t) : {};
5005
5006
  let s = "", r = "";
5006
5007
  try {
5007
- s = Un(e);
5008
+ s = qn(e);
5008
5009
  } catch (h) {
5009
5010
  r = h instanceof Yt ? h.message : String(h), console.warn(`[nimpress] invalid dbml in ${n}:
5010
5011
  ${r}`);
@@ -5016,7 +5017,7 @@ ${r}`);
5016
5017
  c ? `data-height="${tt(c)}"` : ""
5017
5018
  ].filter(Boolean).join(" ")}></div>`;
5018
5019
  }
5019
- function Ha(e, t) {
5020
+ function La(e, t) {
5020
5021
  const n = e.split(`
5021
5022
  `), o = [];
5022
5023
  let s = 0;
@@ -5031,13 +5032,13 @@ function Ha(e, t) {
5031
5032
  for (; g < n.length && !h.test(n[g]); ) g += 1;
5032
5033
  const w = u.trim(), P = w.split(/\s+/)[0].toLowerCase(), A = n.slice(s + 1, g).join(`
5033
5034
  `);
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;
5035
+ P === "mermaid" ? o.push(`${i}${Ba(A && `${A}
5036
+ `)}`) : P === "dbml" ? o.push(`${i}${Wa(A, w.slice(P.length).trim(), t)}`) : o.push(...n.slice(s, Math.min(g + 1, n.length))), s = g + 1;
5036
5037
  }
5037
5038
  return o.join(`
5038
5039
  `);
5039
5040
  }
5040
- function za(e) {
5041
+ function Ha(e) {
5041
5042
  if (!e) return "";
5042
5043
  const t = [], n = (s) => {
5043
5044
  if (s)
@@ -5048,14 +5049,14 @@ function za(e) {
5048
5049
  const o = t.join("").trim();
5049
5050
  return o || (e.content ?? "").trim();
5050
5051
  }
5051
- function qa(e, t) {
5052
+ function za(e, t) {
5052
5053
  const n = e.parse(t, {}), o = [];
5053
5054
  let s = 0;
5054
5055
  const r = /* @__PURE__ */ new Map();
5055
5056
  for (let i = 0; i < n.length; i++) {
5056
5057
  const c = n[i];
5057
5058
  if (c.type === "heading_open") {
5058
- const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = za(h) || `heading-${s++}`;
5059
+ const u = parseInt(c.tag.slice(1)), h = n[i + 1], g = Ha(h) || `heading-${s++}`;
5059
5060
  let w = Ie(g);
5060
5061
  w || (w = `heading-${s++}`);
5061
5062
  const P = r.get(w);
@@ -5069,7 +5070,7 @@ function qa(e, t) {
5069
5070
  }
5070
5071
  return o;
5071
5072
  }
5072
- function Ua(e) {
5073
+ function qa(e) {
5073
5074
  return e.frontmatter.slug ?? e.frontmatter.title;
5074
5075
  }
5075
5076
  function mt(e) {
@@ -5083,16 +5084,16 @@ function qt(e) {
5083
5084
  for (const t of e)
5084
5085
  t.items && qt(t.items);
5085
5086
  }
5086
- function Ja(e) {
5087
+ function Ua(e) {
5087
5088
  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
5089
  const h = /* @__PURE__ */ new Map();
5089
5090
  let g = [], w = "";
5090
5091
  const P = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
5091
5092
  function v(a) {
5092
- return Fn("sha1").update(a).digest("hex");
5093
+ return In("sha1").update(a).digest("hex");
5093
5094
  }
5094
5095
  async function D() {
5095
- return r || (r = await Ho({
5096
+ return r || (r = await zo({
5096
5097
  themes: ["github-dark"],
5097
5098
  langs: [
5098
5099
  "ts",
@@ -5119,7 +5120,7 @@ function Ja(e) {
5119
5120
  }), r);
5120
5121
  }
5121
5122
  function R(a, l) {
5122
- return /\.ya?ml$/i.test(l) ? Wn(a) : JSON.parse(a);
5123
+ return /\.ya?ml$/i.test(l) ? Bn(a) : JSON.parse(a);
5123
5124
  }
5124
5125
  async function x(a, l) {
5125
5126
  try {
@@ -5273,7 +5274,7 @@ function Ja(e) {
5273
5274
  async function he(a) {
5274
5275
  const l = await ie(a, "utf-8"), { data: p, content: b } = _t(l);
5275
5276
  typeof p.type == "number" && (p.type = String(p.type));
5276
- const k = so(p, b);
5277
+ const k = oo(p, b);
5277
5278
  if (k.length) {
5278
5279
  const X = `${a}
5279
5280
  ${k.join(`
@@ -5281,7 +5282,7 @@ function Ja(e) {
5281
5282
  if (c) throw new Error(`[nimpress] invalid frontmatter in ${X}`);
5282
5283
  console.warn(`[nimpress] invalid frontmatter in ${X}`);
5283
5284
  }
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 ?? {};
5285
+ const y = to.safeParse(p), f = y.success ? y.data : { title: a }, _ = so(n, a), C = f.type ?? "doc", $ = la(n, a, f.path), 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
5286
  if (!(t.defaultFrontmatterExclude ?? []).some((X) => {
5286
5287
  const le = X.startsWith("/") ? X : "/" + X;
5287
5288
  return $ === le || $.startsWith(le + "/");
@@ -5290,7 +5291,7 @@ function Ja(e) {
5290
5291
  const Te = X;
5291
5292
  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
5293
  }
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" });
5294
+ const B = await D(), M = Mn(B, be(), t.base, { math: t.math, icons: t.icons, glossary: g }), W = La(b, a), L = za(M, W), J = M.render(W, { glossaryPage: C === "glossary" });
5294
5295
  if (C === "team" || C === "pricing") {
5295
5296
  const X = { ...f.data ?? {} };
5296
5297
  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 +5301,7 @@ function Ja(e) {
5300
5301
  if (!f.spec)
5301
5302
  console.warn(`[nimpress] page ${a} has type openapi but no spec field`);
5302
5303
  else {
5303
- z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = ia(n, z);
5304
+ z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ee = Ce(z), N = aa(n, z);
5304
5305
  const X = await x(a, f.spec);
5305
5306
  Z = X ? re(X, M) ?? void 0 : void 0;
5306
5307
  }
@@ -5311,7 +5312,7 @@ function Ja(e) {
5311
5312
  else {
5312
5313
  z = ke(f.spec) ? f.spec : G(Y(a), f.spec), ne = Ce(z);
5313
5314
  try {
5314
- se = await ie(z, "utf-8"), V = Un(se);
5315
+ se = await ie(z, "utf-8"), V = qn(se);
5315
5316
  } catch (X) {
5316
5317
  Q = X instanceof Yt ? X.message : String(X);
5317
5318
  const le = `${a} -> ${f.spec}
@@ -5323,7 +5324,7 @@ function Ja(e) {
5323
5324
  te(a, z);
5324
5325
  let ue, me = [];
5325
5326
  if (C === "component") {
5326
- const X = await Ir({
5327
+ const X = await Nr({
5327
5328
  cwd: process.cwd(),
5328
5329
  modules: t.modules,
5329
5330
  pageFile: a,
@@ -5339,8 +5340,8 @@ function Ja(e) {
5339
5340
  _e !== a && fe(_e) && $e.push(await ie(_e, "utf-8"));
5340
5341
  const Be = Ce(a, ".md");
5341
5342
  for (const X of Le(Y(a)).sort()) {
5342
- const le = Ea(X, Be);
5343
- le && $e.push(Mn(le, await ie(q(Y(a), X), "utf-8")));
5343
+ const le = Aa(X, Be);
5344
+ le && $e.push(Tn(le, await ie(q(Y(a), X), "utf-8")));
5344
5345
  }
5345
5346
  for (const X of f.styles ?? []) {
5346
5347
  const le = G(Y(a), X);
@@ -5424,7 +5425,7 @@ function Ja(e) {
5424
5425
  continue;
5425
5426
  }
5426
5427
  const { data: F, content: B } = _t(O);
5427
- String(F.type) === "glossary" && ($.push(j), S = Aa(new Rn().use(Bn), B));
5428
+ String(F.type) === "glossary" && ($.push(j), S = Pa(new Fn().use(Rn), B));
5428
5429
  }
5429
5430
  if ($.length > 1) throw new Error(`[nimpress] one type glossary page per site: ${$.join(" and ")}`);
5430
5431
  g = S, w = JSON.stringify(S);
@@ -5441,7 +5442,7 @@ function Ja(e) {
5441
5442
  }
5442
5443
  if (!O || Fe(O.slug)) continue;
5443
5444
  if (C.push(O), O.type === "changelog") {
5444
- const M = `${la(O.slug)}\0${O.frontmatter.title}`, W = b.get(M) ?? [];
5445
+ const M = `${ia(O.slug)}\0${O.frontmatter.title}`, W = b.get(M) ?? [];
5445
5446
  W.push(O), b.set(M, W);
5446
5447
  continue;
5447
5448
  }
@@ -5480,7 +5481,7 @@ function Ja(e) {
5480
5481
  }
5481
5482
  xt.clear();
5482
5483
  for (const [j, O] of b) {
5483
- const F = j.split("\0", 1)[0], B = Cn(F ? "/" + F : "/");
5484
+ const F = j.split("\0", 1)[0], B = ro(F ? "/" + F : "/");
5484
5485
  if (p.has(B))
5485
5486
  throw new Error(
5486
5487
  `[nimpress] path ${B} is occupied by both a changelog collection and a regular page`
@@ -5489,7 +5490,7 @@ function Ja(e) {
5489
5490
  if (M.length === 0) continue;
5490
5491
  M.sort((N, z) => {
5491
5492
  const V = String(N.frontmatter.data?.version ?? ""), se = String(z.frontmatter.data?.version ?? "");
5492
- return aa(se, V);
5493
+ return ra(se, V);
5493
5494
  });
5494
5495
  const W = M[0], L = `__changelog__${(F || "root").replace(/\//g, "__")}`, J = M.map((N) => {
5495
5496
  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;
@@ -5539,8 +5540,8 @@ function Ja(e) {
5539
5540
  };
5540
5541
  p.set(B, ee.filePath), l.set(ee.slug, ee);
5541
5542
  }
5542
- if (wo(k, C), co(l), io(l), t.seo?.auto) {
5543
- const j = Da(C.map((O) => ({
5543
+ if (vo(k, C), lo(l), co(l), t.seo?.auto) {
5544
+ const j = Oa(C.map((O) => ({
5544
5545
  slug: O.slug,
5545
5546
  title: O.frontmatter.title,
5546
5547
  headings: O.headings.map((F) => F.text),
@@ -5559,7 +5560,7 @@ function Ja(e) {
5559
5560
  const ze = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map();
5560
5561
  let St = JSON.stringify({ pages: [] }, null, 2) + `
5561
5562
  `;
5562
- function io(a) {
5563
+ function co(a) {
5563
5564
  const l = [];
5564
5565
  for (const p of a.values()) {
5565
5566
  if (p.frontmatter.subscribe !== !0 || It(p.frontmatter)) continue;
@@ -5583,7 +5584,7 @@ function Ja(e) {
5583
5584
  l.sort((p, b) => p.path.localeCompare(b.path)), St = JSON.stringify({ pages: l }, null, 2) + `
5584
5585
  `;
5585
5586
  }
5586
- function co(a) {
5587
+ function lo(a) {
5587
5588
  ze.clear();
5588
5589
  const l = t.site?.url?.replace(/\/$/, "");
5589
5590
  for (const p of a.values()) {
@@ -5616,7 +5617,7 @@ function Ja(e) {
5616
5617
  `<link>${ye(se)}</link>`,
5617
5618
  `<guid isPermaLink="true">${ye(se)}</guid>`
5618
5619
  ];
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>
5620
+ 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>${Yr(V.html)}</content:encoded>`), ` <item>
5620
5621
  ${ne.join(`
5621
5622
  `)}
5622
5623
  </item>`;
@@ -5629,7 +5630,7 @@ function Ja(e) {
5629
5630
  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
5631
  const z = [
5631
5632
  '<?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}">`,
5633
+ `<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="${Xr}">`,
5633
5634
  " <channel>",
5634
5635
  ` ${N.join(`
5635
5636
  `)}`,
@@ -5647,7 +5648,7 @@ function Ja(e) {
5647
5648
  function ve(a) {
5648
5649
  return a.frontmatter.gate !== void 0;
5649
5650
  }
5650
- function lo(a) {
5651
+ function po(a) {
5651
5652
  const l = Y(a.filePath);
5652
5653
  let p = [];
5653
5654
  try {
@@ -5659,9 +5660,9 @@ function Ja(e) {
5659
5660
  }
5660
5661
  function st(a) {
5661
5662
  const l = t.auth?.guard;
5662
- return typeof l == "function" ? l(a.frontmatter, je(process.cwd(), a.filePath), lo(a)) : a.frontmatter.gate ?? "default";
5663
+ return typeof l == "function" ? l(a.frontmatter, je(process.cwd(), a.filePath), po(a)) : a.frontmatter.gate ?? "default";
5663
5664
  }
5664
- function po() {
5665
+ function uo() {
5665
5666
  const a = [];
5666
5667
  for (const l of s.values())
5667
5668
  l.sidebarOnly || It(l.frontmatter) || ve(l) || a.push(l);
@@ -5676,7 +5677,7 @@ function Ja(e) {
5676
5677
  if (jt.has(a)) return jt.get(a);
5677
5678
  let l;
5678
5679
  try {
5679
- l = Io("git", ["log", "-1", "--format=%cI", "--", a], {
5680
+ l = Fo("git", ["log", "-1", "--format=%cI", "--", a], {
5680
5681
  cwd: process.cwd(),
5681
5682
  encoding: "utf-8",
5682
5683
  stdio: ["ignore", "pipe", "ignore"]
@@ -5686,15 +5687,15 @@ function Ja(e) {
5686
5687
  }
5687
5688
  return jt.set(a, l), l;
5688
5689
  }
5689
- function uo(a) {
5690
+ function mo(a) {
5690
5691
  return a === "changelog" || a === "roadmap" ? "CollectionPage" : a === "openapi" ? "APIReference" : a === "hero" || a === "fullpage" || a === "404" ? "WebPage" : a === "section" || a === "tags" ? "CollectionPage" : a === "glossary" ? "DefinedTermSet" : a === "team" ? "AboutPage" : "TechArticle";
5691
5692
  }
5692
- function mo(a) {
5693
+ function fo(a) {
5693
5694
  const l = t.meta ?? {}, p = t.site, b = a.frontmatter, k = b.meta ?? {}, y = k.og ?? {}, f = k.twitter ?? {}, _ = b.title, C = p?.title && p.title !== _ ? `${_} · ${p.title}` : _, $ = k.description ?? b.description ?? p?.description, S = k.canonical ?? Pe(a.effectivePath), U = (() => {
5694
5695
  if (k.keywords) return Array.isArray(k.keywords) ? k.keywords : [k.keywords];
5695
5696
  const ne = Re(b.tags);
5696
5697
  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 = [];
5698
+ })(), j = Da(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
5699
  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
5700
  z.push(`<link rel="canonical" href="${N(S)}">`);
5700
5701
  const ne = l.localeAlternates ?? [];
@@ -5737,7 +5738,7 @@ function Ja(e) {
5737
5738
  }
5738
5739
  se.push({
5739
5740
  "@context": "https://schema.org",
5740
- "@type": uo(a.type),
5741
+ "@type": mo(a.type),
5741
5742
  name: C,
5742
5743
  headline: _,
5743
5744
  description: $,
@@ -5745,13 +5746,13 @@ function Ja(e) {
5745
5746
  isPartOf: V ? `${V}${we(t.base, "/")}#website` : void 0,
5746
5747
  dateModified: on(a.filePath)
5747
5748
  }), k.jsonLd && se.push(k.jsonLd);
5748
- for (const ne of se) z.push(Zr(ne));
5749
+ for (const ne of se) z.push(Kr(ne));
5749
5750
  return `
5750
5751
  ${z.join(`
5751
5752
  `)}
5752
5753
  `;
5753
5754
  }
5754
- function fo() {
5755
+ function ho() {
5755
5756
  const a = t.meta ?? {};
5756
5757
  if (a.robots?.custom) return a.robots.custom;
5757
5758
  const l = /* @__PURE__ */ new Set([...a.robots?.block ?? [], ...t.seo?.ai?.index === !1 ? Nt : []]), p = ["User-agent: *", "Allow: /", ""];
@@ -5767,7 +5768,7 @@ function Ja(e) {
5767
5768
  `).trim() + `
5768
5769
  `;
5769
5770
  }
5770
- function ho(a) {
5771
+ function go(a) {
5771
5772
  const l = t.site?.url?.replace(/\/$/, "");
5772
5773
  if (!l) return;
5773
5774
  const p = t.meta?.localeAlternates ?? [];
@@ -5790,7 +5791,7 @@ ${S.join(`
5790
5791
  ].join(`
5791
5792
  `);
5792
5793
  }
5793
- function go(a) {
5794
+ function _o(a) {
5794
5795
  const l = t.meta ?? {}, p = t.site, b = [`# ${p?.title ?? t.title}`, ""], k = l.llms?.summary ?? p?.description;
5795
5796
  k && b.push(`> ${k}`, "");
5796
5797
  const y = /* @__PURE__ */ new Map(), f = [];
@@ -5824,7 +5825,7 @@ ${S.join(`
5824
5825
 
5825
5826
  `);
5826
5827
  }
5827
- function _o(a) {
5828
+ function yo(a) {
5828
5829
  const p = [`# ${t.site?.title ?? t.title}`, ""];
5829
5830
  for (const b of a) {
5830
5831
  p.push(`## ${b.frontmatter.title}`, "");
@@ -5836,15 +5837,15 @@ ${S.join(`
5836
5837
 
5837
5838
  `);
5838
5839
  }
5839
- async function yo() {
5840
- const a = t.meta ?? {}, l = po().sort((f, _) => f.effectivePath.localeCompare(_.effectivePath)), p = q(i, "index.html"), b = await ie(p, "utf-8");
5840
+ async function bo() {
5841
+ const a = t.meta ?? {}, l = uo().sort((f, _) => f.effectivePath.localeCompare(_.effectivePath)), p = q(i, "index.html"), b = await ie(p, "utf-8");
5841
5842
  for (const f of l) {
5842
- const _ = mo(f), C = b.replace("</head>", `${_}</head>`), $ = f.effectivePath === "/" ? p : q(i, f.effectivePath.replace(/^\//, ""), "index.html");
5843
+ const _ = fo(f), C = b.replace("</head>", `${_}</head>`), $ = f.effectivePath === "/" ? p : q(i, f.effectivePath.replace(/^\//, ""), "index.html");
5843
5844
  await Ue(Y($), { recursive: !0 }), await pe($, C);
5844
5845
  }
5845
- await pe(q(i, "robots.txt"), fo());
5846
- const k = l.filter((f) => f.type !== "404"), y = ho(k);
5847
- if (y && await pe(q(i, "sitemap.xml"), y), await pe(q(i, "llms.txt"), go(k)), a.llms?.full && await pe(q(i, "llms-full.txt"), _o(k)), a.webmanifest && await pe(q(i, "site.webmanifest"), JSON.stringify(a.webmanifest, null, 2) + `
5846
+ await pe(q(i, "robots.txt"), ho());
5847
+ const k = l.filter((f) => f.type !== "404"), y = go(k);
5848
+ if (y && await pe(q(i, "sitemap.xml"), y), await pe(q(i, "llms.txt"), _o(k)), a.llms?.full && await pe(q(i, "llms-full.txt"), yo(k)), a.webmanifest && await pe(q(i, "site.webmanifest"), JSON.stringify(a.webmanifest, null, 2) + `
5848
5849
  `), a.humans && await pe(q(i, "humans.txt"), a.humans.trim() + `
5849
5850
  `), a.security) {
5850
5851
  const f = a.security, _ = [];
@@ -5853,7 +5854,7 @@ ${S.join(`
5853
5854
  `));
5854
5855
  }
5855
5856
  }
5856
- async function bo() {
5857
+ async function wo() {
5857
5858
  const a = [...s.values()].filter((f) => !It(f.frontmatter) && ve(f)), l = {}, p = /* @__PURE__ */ new Map();
5858
5859
  for (const f of a) {
5859
5860
  const _ = st(f);
@@ -5911,9 +5912,9 @@ ${S.join(`
5911
5912
  `
5912
5913
  );
5913
5914
  }
5914
- function wo(a, l) {
5915
+ function vo(a, l) {
5915
5916
  if (a.size === 0) return;
5916
- const p = l.filter((k) => vo(k.type)), b = /* @__PURE__ */ new Map();
5917
+ const p = l.filter((k) => ko(k.type)), b = /* @__PURE__ */ new Map();
5917
5918
  for (const k of p) b.set(k.filePath, k);
5918
5919
  for (const [, k] of a) {
5919
5920
  const y = k[0], f = Y(y.filePath), _ = y.frontmatter.data, C = _?.issues ?? _?.entries, $ = [];
@@ -6004,7 +6005,7 @@ ${S.join(`
6004
6005
  }));
6005
6006
  }
6006
6007
  }
6007
- function vo(a) {
6008
+ function ko(a) {
6008
6009
  return a === "milestone" || a === "epic" || a === "feature" || a === "bug";
6009
6010
  }
6010
6011
  function sn(a, l) {
@@ -6023,7 +6024,7 @@ ${S.join(`
6023
6024
  function qe(a, l) {
6024
6025
  const p = a ? /^:([a-z0-9]+(?:-[a-z0-9]+)*):$/.exec(a.trim()) : null;
6025
6026
  if (p) {
6026
- const y = ro(p[1], t.icons);
6027
+ const y = ao(p[1], t.icons);
6027
6028
  return y || console.warn(`[nimpress] icon ${a} referenced from ${l} is not a known shortcode`), y ?? void 0;
6028
6029
  }
6029
6030
  if (!a || !/\.svg$/i.test(a.trim())) return a;
@@ -6073,7 +6074,7 @@ ${S.join(`
6073
6074
  for (const $ of y.children.values()) f.push(b($));
6074
6075
  if (qt(f), y.page) {
6075
6076
  const $ = {
6076
- text: Ua(y.page),
6077
+ text: qa(y.page),
6077
6078
  link: y.page.linkTo ?? y.page.effectivePath,
6078
6079
  external: y.page.linkTo ? !0 : void 0,
6079
6080
  slug: y.page.slug,
@@ -6116,7 +6117,7 @@ ${S.join(`
6116
6117
  text: J.title,
6117
6118
  link: J.href,
6118
6119
  slug: J.slug,
6119
- icon: Qr[J.kind],
6120
+ icon: Zr[J.kind],
6120
6121
  hidden: J.hidden,
6121
6122
  order: Z
6122
6123
  };
@@ -6158,10 +6159,10 @@ ${S.join(`
6158
6159
  for (const y of l.children.values()) k.push(b(y));
6159
6160
  return qt(k), k;
6160
6161
  }
6161
- function ko(a) {
6162
+ function $o(a) {
6162
6163
  return `tag-${Ie(a)}`;
6163
6164
  }
6164
- function $o(a) {
6165
+ function xo(a) {
6165
6166
  const l = t.tags?.icons;
6166
6167
  if (!l) return;
6167
6168
  const p = l[t.tags?.map?.[a] ?? a] ?? l.default;
@@ -6172,17 +6173,17 @@ ${S.join(`
6172
6173
  for (const l of s.values())
6173
6174
  if (!(l.sidebarOnly || l.type === "404" || l.type === "tags") && !(c && (Se(l.frontmatter) || ve(l))))
6174
6175
  for (const p of Re(l.frontmatter.tags)) {
6175
- const b = a.get(p) ?? { name: p, slug: ko(p), icon: $o(p), pages: [] };
6176
+ const b = a.get(p) ?? { name: p, slug: $o(p), icon: xo(p), pages: [] };
6176
6177
  b.pages.push({ slug: l.slug, title: l.frontmatter.title, path: l.effectivePath, description: l.frontmatter.description }), a.set(p, b);
6177
6178
  }
6178
6179
  return Array.from(a.values()).sort((l, p) => l.name.localeCompare(p.name)).map((l) => ({ ...l, pages: l.pages.sort((p, b) => p.title.localeCompare(b.title)) }));
6179
6180
  }
6180
- function xo() {
6181
+ function So() {
6181
6182
  const a = q(n, "styles");
6182
- return fe(a) ? Le(a).filter((l) => l.endsWith(".css")).sort().map((l) => Mn(l.replace(/\.css$/, ""), Oe(q(a, l), "utf-8"))).join(`
6183
+ return fe(a) ? Le(a).filter((l) => l.endsWith(".css")).sort().map((l) => Tn(l.replace(/\.css$/, ""), Oe(q(a, l), "utf-8"))).join(`
6183
6184
  `) : "";
6184
6185
  }
6185
- function So() {
6186
+ function jo() {
6186
6187
  const a = {}, l = {};
6187
6188
  for (const [k, y] of s) {
6188
6189
  if (c && (Se(y.frontmatter) || ve(y)) || y.sidebarOnly) continue;
@@ -6206,7 +6207,7 @@ ${S.join(`
6206
6207
  for (const _ of y.componentData?.stories ?? [])
6207
6208
  l[`${y.effectivePath}/${Ft(_.name)}`] = k;
6208
6209
  }
6209
- const p = {}, b = xo();
6210
+ const p = {}, b = So();
6210
6211
  b && (p["/"] = b);
6211
6212
  for (const k of s.values())
6212
6213
  k.sidebarOnly || c && (Se(k.frontmatter) || ve(k)) || k.pageCss && (p[k.effectivePath] = [p[k.effectivePath], k.pageCss].filter(Boolean).join(`
@@ -6220,7 +6221,7 @@ ${S.join(`
6220
6221
  if (a) {
6221
6222
  if (Se(y.frontmatter) || !ve(y)) continue;
6222
6223
  } else if (c && (Se(y.frontmatter) || ve(y))) continue;
6223
- const f = y.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), _ = y.type === "openapi" ? jo(y.openApiSpec) : "", C = y.type === "roadmap" ? Po(y.roadmapEntries ?? []) : "", $ = y.componentData ? [
6224
+ const f = y.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), _ = y.type === "openapi" ? Po(y.openApiSpec) : "", C = y.type === "roadmap" ? Ao(y.roadmapEntries ?? []) : "", $ = y.componentData ? [
6224
6225
  y.componentData.component,
6225
6226
  y.componentData.system,
6226
6227
  ...(y.componentData.stories ?? []).flatMap((j) => [j.name, j.file])
@@ -6245,7 +6246,7 @@ ${S.join(`
6245
6246
  function pn(a) {
6246
6247
  return a ? a.replace(/<[^>]+>/g, " ").replace(/&[a-z]+;/gi, " ") : "";
6247
6248
  }
6248
- function jo(a) {
6249
+ function Po(a) {
6249
6250
  if (!a || typeof a != "object") return "";
6250
6251
  const l = a, p = [], b = /* @__PURE__ */ new WeakSet(), k = 12, y = (f, _) => {
6251
6252
  if (f == null || _ > k) return;
@@ -6290,7 +6291,7 @@ ${S.join(`
6290
6291
  return p.join(`
6291
6292
  `);
6292
6293
  }
6293
- function Po(a) {
6294
+ function Ao(a) {
6294
6295
  const l = [];
6295
6296
  for (const p of a) {
6296
6297
  l.push(p.slug, p.kind, p.title), p.description && l.push(p.description), p.targetDate && l.push(p.targetDate), p.html && l.push(pn(p.html));
@@ -6327,7 +6328,7 @@ ${S.join(`
6327
6328
  k && a.moduleGraph.invalidateModule(k), y && a.moduleGraph.invalidateModule(y);
6328
6329
  }
6329
6330
  }
6330
- function Ao() {
6331
+ function Eo() {
6331
6332
  const a = [];
6332
6333
  for (const [l, p] of s) {
6333
6334
  if (p.sidebarOnly || c && (Se(p.frontmatter) || ve(p))) continue;
@@ -6341,7 +6342,7 @@ ${a.join(`,
6341
6342
  export default pages
6342
6343
  `;
6343
6344
  }
6344
- function Eo() {
6345
+ function Co() {
6345
6346
  const a = [];
6346
6347
  for (const [l, p] of s) {
6347
6348
  if (p.sidebarOnly || c && (Se(p.frontmatter) || ve(p))) continue;
@@ -6355,7 +6356,7 @@ ${a.join(`,
6355
6356
  export default bodies
6356
6357
  `;
6357
6358
  }
6358
- function Co(a) {
6359
+ function Oo(a) {
6359
6360
  if (a.type === "tags") return [...a.headings, ...cn().map((l) => ({ level: 2, text: l.name, slug: l.slug }))];
6360
6361
  if (a.type === "glossary") return [...a.headings, ...g.map((l) => ({ level: 2, text: l.term, slug: l.slug }))];
6361
6362
  if (a.type === "team") {
@@ -6364,12 +6365,12 @@ export default bodies
6364
6365
  }
6365
6366
  return a.headings;
6366
6367
  }
6367
- function Oo(a) {
6368
+ function Do(a) {
6368
6369
  const l = s.get(a);
6369
6370
  if (!l) return null;
6370
6371
  const p = {
6371
6372
  html: l.html,
6372
- headings: Co(l),
6373
+ headings: Oo(l),
6373
6374
  openApiSpec: l.openApiSpec,
6374
6375
  openApiFile: l.openApiFile,
6375
6376
  openApiUrl: l.openApiUrl,
@@ -6387,10 +6388,10 @@ export default bodies
6387
6388
  function At(a) {
6388
6389
  return `Custom_${a.replace(/[^a-zA-Z0-9]/g, "_")}`;
6389
6390
  }
6390
- function Do(a) {
6391
+ function To(a) {
6391
6392
  return a.startsWith("/") ? a : "/" + a.replace(/^\.\//, "");
6392
6393
  }
6393
- function To(a) {
6394
+ function Mo(a) {
6394
6395
  const l = s.get(a);
6395
6396
  if (!l) return null;
6396
6397
  const p = {
@@ -6398,7 +6399,7 @@ export default bodies
6398
6399
  path: l.effectivePath,
6399
6400
  type: l.type,
6400
6401
  frontmatter: l.frontmatter
6401
- }, b = `${We}${De(a)}.js`, k = JSON.stringify(p).replace(/<\/script>/g, "<\\/script>"), y = Array.from(Ne.entries()), f = y.map(([$, S]) => ` import ${At($)} from ${JSON.stringify(Do(S.file))}`).join(`
6402
+ }, b = `${We}${De(a)}.js`, k = JSON.stringify(p).replace(/<\/script>/g, "<\\/script>"), y = Array.from(Ne.entries()), f = y.map(([$, S]) => ` import ${At($)} from ${JSON.stringify(To(S.file))}`).join(`
6402
6403
  `), _ = ($, S) => Ne.has($) ? At($) : S, C = [
6403
6404
  ["team", "TeamPage"],
6404
6405
  ["pricing", "PricingPage"],
@@ -6412,7 +6413,7 @@ export default bodies
6412
6413
  ["dbml", "DbmlPage"]
6413
6414
  ].map(([$, S]) => ` {:else if shell.type === ${JSON.stringify($)}}
6414
6415
  <${_($, S)} page={{ ...shell, ...mod.default }} />`).concat(
6415
- y.filter(([$]) => !oo.has($)).map(([$]) => ` {:else if shell.type === ${JSON.stringify($)}}
6416
+ y.filter(([$]) => !no.has($)).map(([$]) => ` {:else if shell.type === ${JSON.stringify($)}}
6416
6417
  <${At($)} page={{ ...shell, ...mod.default }} />`)
6417
6418
  ).join(`
6418
6419
  `);
@@ -6464,7 +6465,7 @@ ${C}
6464
6465
  return {
6465
6466
  name: "@nimtech/nimpress:markdown",
6466
6467
  async config() {
6467
- t = (await ms(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), oa(process.cwd(), t.pageTypes ?? {});
6468
+ t = (await us(process.cwd(), e)).resolved, n = G(process.cwd(), t.contentDir), na(process.cwd(), t.pageTypes ?? {});
6468
6469
  for (const l of vt(t))
6469
6470
  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
6471
  return o = G(process.cwd(), t.assetsDir), {};
@@ -6495,9 +6496,9 @@ ${C}
6495
6496
  const f = q(i, k.replace(/^\//, ""));
6496
6497
  await Ue(Y(f), { recursive: !0 }), await pe(f, y);
6497
6498
  }
6498
- await pe(q(i, "subscribe.map.json"), St), await yo();
6499
+ await pe(q(i, "subscribe.map.json"), St), await bo();
6499
6500
  const b = Array.from(s.values()).find((k) => k.type === "404" && !Se(k.frontmatter) && !ve(k));
6500
- b && await mn(q(i, b.effectivePath.replace(/^\//, ""), "index.html"), q(i, "404.html")), await bo();
6501
+ b && await mn(q(i, b.effectivePath.replace(/^\//, ""), "index.html"), q(i, "404.html")), await wo();
6501
6502
  },
6502
6503
  configureServer(a) {
6503
6504
  u = a, a.watcher.add(n), a.watcher.add(o);
@@ -6533,9 +6534,9 @@ ${C}
6533
6534
  T.has(f) && de(T.get(f));
6534
6535
  };
6535
6536
  if (a.watcher.on("add", l), a.watcher.on("unlink", p), t.banner !== !1) {
6536
- const f = Ts(), _ = t.banner, C = Date.now();
6537
+ const f = Ds(), _ = t.banner, C = Date.now();
6537
6538
  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({
6539
+ const $ = a.resolvedUrls, S = $?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, U = $?.network?.[0] ?? "use --host to expose", j = Os({
6539
6540
  title: _.title ?? t.title ?? f.name ?? "Nimpress",
6540
6541
  tagline: _.tagline,
6541
6542
  company: _.company,
@@ -6567,10 +6568,10 @@ ${C}
6567
6568
  }, k = t.assetUrlBase, y = (f, _, C) => {
6568
6569
  if (!_ || _.endsWith(".md")) return !1;
6569
6570
  const $ = q(f, decodeURIComponent(_));
6570
- return !$.startsWith(f) || !fe($) || !gt($).isFile() ? !1 : (C.setHeader("Content-Type", b[Jt($).toLowerCase()] ?? "application/octet-stream"), Mo($).pipe(C), !0);
6571
+ return !$.startsWith(f) || !fe($) || !gt($).isFile() ? !1 : (C.setHeader("Content-Type", b[Jt($).toLowerCase()] ?? "application/octet-stream"), No($).pipe(C), !0);
6571
6572
  };
6572
6573
  return a.middlewares.use((f, _, C) => {
6573
- const $ = (f.url ?? "").split("?")[0], S = Qo(t.base, $);
6574
+ const $ = (f.url ?? "").split("?")[0], S = es(t.base, $);
6574
6575
  if (S.startsWith("/@") || S.startsWith("/node_modules/")) return C();
6575
6576
  if (S === "/__nimpress/claude-md" && f.method === "PUT") {
6576
6577
  const F = [];
@@ -6625,7 +6626,7 @@ ${C}
6625
6626
  _.statusCode = 404, _.end(`unknown module system: ${B}`);
6626
6627
  return;
6627
6628
  }
6628
- const W = No(
6629
+ const W = Io(
6629
6630
  {
6630
6631
  host: "127.0.0.1",
6631
6632
  port: zt(t.modules, B),
@@ -6655,7 +6656,7 @@ ${C}
6655
6656
  try {
6656
6657
  const $ = await a.transformIndexHtml(
6657
6658
  f.url ?? "/",
6658
- Xr(t, "/@id/__x00__virtual:nimpress/main")
6659
+ Vr(t, "/@id/__x00__virtual:nimpress/main")
6659
6660
  );
6660
6661
  _.statusCode = 200, _.setHeader("Content-Type", "text/html"), _.end($);
6661
6662
  } catch ($) {
@@ -6692,9 +6693,9 @@ ${C}
6692
6693
  },
6693
6694
  async load(a) {
6694
6695
  if (a === "\0" + it)
6695
- return `export default ${JSON.stringify(So())}`;
6696
+ return `export default ${JSON.stringify(jo())}`;
6696
6697
  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;
6698
+ const l = ms(t), p = l.announce || l.feedback ? Mn(await D(), be(), t.base, { math: t.math, icons: t.icons }) : null;
6698
6699
  if (l.feedback && p && (l.feedback = {
6699
6700
  ...l.feedback,
6700
6701
  ratings: l.feedback.ratings.map((b) => ({ ...b, html: p.renderInline(b.note) }))
@@ -6729,25 +6730,25 @@ app.mount(target)
6729
6730
  if (a === "\0" + ct)
6730
6731
  return `export default ${JSON.stringify(ln())}`;
6731
6732
  if (a === "\0" + lt)
6732
- return Ao();
6733
- if (a === "\0" + pt)
6734
6733
  return Eo();
6734
+ if (a === "\0" + pt)
6735
+ return Co();
6735
6736
  if (a.startsWith(Ge) && a.endsWith(".svelte")) {
6736
6737
  const l = a.slice(Ge.length, -7);
6737
- return To(un(l));
6738
+ return Mo(un(l));
6738
6739
  }
6739
6740
  if (a.startsWith(We) && a.endsWith(".js")) {
6740
6741
  const l = a.slice(We.length, -3);
6741
- return Oo(un(l));
6742
+ return Do(un(l));
6742
6743
  }
6743
6744
  return null;
6744
6745
  }
6745
6746
  };
6746
6747
  }
6747
- function xi(e) {
6748
+ function vi(e) {
6748
6749
  return e;
6749
6750
  }
6750
- async function Si(e, t) {
6751
+ async function ki(e, t) {
6751
6752
  const n = G(e, t), o = await nn(n), s = [];
6752
6753
  for (const r of o) {
6753
6754
  let i;
@@ -6758,44 +6759,45 @@ async function Si(e, t) {
6758
6759
  }
6759
6760
  const { data: c, content: u } = _t(i);
6760
6761
  typeof c.type == "number" && (c.type = String(c.type));
6761
- for (const h of so(c, u))
6762
+ for (const h of oo(c, u))
6762
6763
  s.push(`${je(n, r).split(xe).join("/")}: ${h}`);
6763
6764
  }
6764
6765
  return s;
6765
6766
  }
6766
6767
  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,
6773
- Mn as G,
6774
- Oa as H,
6775
- vr as a,
6768
+ Da as A,
6769
+ us as B,
6770
+ wi as C,
6771
+ la as D,
6772
+ ra as E,
6773
+ Ua as F,
6774
+ vi as G,
6775
+ Tn as H,
6776
+ Ca as I,
6777
+ wr as a,
6776
6778
  Zt as b,
6777
6779
  Kt as c,
6778
6780
  Ye as d,
6779
6781
  $n as e,
6780
6782
  Sn as f,
6781
6783
  Je as g,
6782
- vi as h,
6783
- Xr as i,
6784
- ki as j,
6784
+ yi as h,
6785
+ Vr as i,
6786
+ bi as j,
6785
6787
  zt as k,
6786
- oa as l,
6787
- Si as m,
6788
- Ea as n,
6789
- Xn as o,
6788
+ na as l,
6789
+ ki as m,
6790
+ Aa as n,
6791
+ Vn as o,
6790
6792
  ot as p,
6791
- wi as q,
6793
+ _i as q,
6792
6794
  $t as r,
6793
6795
  nt as s,
6794
- yi as t,
6795
- br as u,
6796
- _i as v,
6796
+ hi as t,
6797
+ yr as u,
6798
+ di as v,
6797
6799
  en as w,
6798
- bi as x,
6799
- Or as y,
6800
- Da as z
6800
+ gi as x,
6801
+ Cr as y,
6802
+ Oa as z
6801
6803
  };