@tecture/web 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-lib/App.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsxs as r, jsx as e, Fragment as H } from "react/jsx-runtime";
2
- import { useMemo as F, createContext as se, memo as we, useContext as P, useCallback as C, useState as L, useEffect as B, useRef as V, useId as Ne, isValidElement as Ce } from "react";
3
- import { Position as k, useNodeId as ce, useStore as de, NodeResizer as Le, Handle as X, Panel as Me, useInternalNode as Z, getSmoothStepPath as Be, EdgeLabelRenderer as Se, MarkerType as We, ReactFlowProvider as De, useNodesState as ze, useEdgesState as Ae, useReactFlow as Ee, ReactFlow as Fe, Background as He, BackgroundVariant as Pe, Controls as Te, MiniMap as Ie } from "@xyflow/react";
4
- import je from "elkjs/lib/elk.bundled.js";
5
- import { buildSourceUrl as Re, isDeepDivable as q, buildDeepDivePrompt as $e } from "@tecture/shared";
6
- import Ge from "markdown-to-jsx";
7
- import { createPortal as Ve } from "react-dom";
8
- const I = {
1
+ import { jsxs as r, jsx as e, Fragment as T } from "react/jsx-runtime";
2
+ import { useMemo as A, createContext as de, memo as Ne, useContext as j, useCallback as C, useState as w, useEffect as S, useRef as U, useId as Ce, isValidElement as Le } from "react";
3
+ import { Position as k, useNodeId as me, useStore as ue, NodeResizer as Me, Handle as q, Panel as Se, useInternalNode as Q, getSmoothStepPath as Be, EdgeLabelRenderer as De, MarkerType as We, ReactFlowProvider as ze, useNodesState as Ee, useEdgesState as Ae, useReactFlow as Fe, ReactFlow as Ie, Background as Pe, BackgroundVariant as He, Controls as Te, MiniMap as je } from "@xyflow/react";
4
+ import Re from "elkjs/lib/elk.bundled.js";
5
+ import { driftForNode as $e, buildSourceUrl as Oe, isDeepDivable as J, buildDeepDivePrompt as Ge } from "@tecture/shared";
6
+ import Ve from "markdown-to-jsx";
7
+ import { createPortal as _e } from "react-dom";
8
+ const $ = {
9
9
  backgrounds: [
10
10
  { token: "--bg-deep", value: "#0a0f1a", label: "Deep" },
11
11
  { token: "--bg-surface", value: "#0f1628", label: "Surface" },
@@ -28,7 +28,7 @@ const I = {
28
28
  { token: "--accent-amber-hover", value: "#fbbf24", label: "Amber Hover" },
29
29
  { token: "--accent-emerald", value: "#34d399", label: "Emerald" }
30
30
  ]
31
- }, Oe = [
31
+ }, Ue = [
32
32
  { type: "System", accent: "#94a3b8", bg: "#1e293b" },
33
33
  { type: "Service", accent: "#818cf8", bg: "#1e1b4b" },
34
34
  { type: "Database", accent: "#34d399", bg: "#022c22" },
@@ -39,7 +39,7 @@ const I = {
39
39
  { type: "Storage", accent: "#2dd4bf", bg: "#042f2e" },
40
40
  { type: "External", accent: "#a1a1aa", bg: "#1c1c1e" }
41
41
  ];
42
- function E({ number: t, children: a }) {
42
+ function F({ number: t, children: a }) {
43
43
  return /* @__PURE__ */ r("div", { className: "mb-10", children: [
44
44
  /* @__PURE__ */ e("div", { className: "blueprint-annotation animate-fade-up", children: t }),
45
45
  /* @__PURE__ */ e(
@@ -52,7 +52,7 @@ function E({ number: t, children: a }) {
52
52
  )
53
53
  ] });
54
54
  }
55
- function Q({ token: t, value: a, label: o }) {
55
+ function ee({ token: t, value: a, label: o }) {
56
56
  return /* @__PURE__ */ r("div", { className: "group relative", children: [
57
57
  /* @__PURE__ */ e(
58
58
  "div",
@@ -68,7 +68,7 @@ function Q({ token: t, value: a, label: o }) {
68
68
  ] })
69
69
  ] });
70
70
  }
71
- function _e() {
71
+ function Ke() {
72
72
  return /* @__PURE__ */ r("div", { className: "blueprint-grid animate-grid-reveal min-h-screen relative", children: [
73
73
  /* @__PURE__ */ r(
74
74
  "svg",
@@ -153,19 +153,19 @@ function _e() {
153
153
  )
154
154
  ] }),
155
155
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
156
- /* @__PURE__ */ e(E, { number: "Section 01", children: "Color Palette" }),
156
+ /* @__PURE__ */ e(F, { number: "Section 01", children: "Color Palette" }),
157
157
  /* @__PURE__ */ r("div", { className: "space-y-12", children: [
158
158
  /* @__PURE__ */ r("div", { children: [
159
159
  /* @__PURE__ */ e("h3", { className: "mb-4 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Backgrounds" }),
160
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: I.backgrounds.map((t) => /* @__PURE__ */ e(Q, { ...t }, t.token)) })
160
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: $.backgrounds.map((t) => /* @__PURE__ */ e(ee, { ...t }, t.token)) })
161
161
  ] }),
162
162
  /* @__PURE__ */ r("div", { children: [
163
163
  /* @__PURE__ */ e("h3", { className: "mb-4 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Borders" }),
164
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: I.borders.map((t) => /* @__PURE__ */ e(Q, { ...t }, t.token)) })
164
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: $.borders.map((t) => /* @__PURE__ */ e(ee, { ...t }, t.token)) })
165
165
  ] }),
166
166
  /* @__PURE__ */ r("div", { children: [
167
167
  /* @__PURE__ */ e("h3", { className: "mb-4 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Text" }),
168
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: I.text.map((t) => /* @__PURE__ */ r("div", { className: "group", children: [
168
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-4", children: $.text.map((t) => /* @__PURE__ */ r("div", { className: "group", children: [
169
169
  /* @__PURE__ */ e(
170
170
  "div",
171
171
  {
@@ -183,7 +183,7 @@ function _e() {
183
183
  ] }),
184
184
  /* @__PURE__ */ r("div", { children: [
185
185
  /* @__PURE__ */ e("h3", { className: "mb-4 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Accents" }),
186
- /* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-4", children: I.accents.map((t) => /* @__PURE__ */ r("div", { className: "group", children: [
186
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-5 gap-4", children: $.accents.map((t) => /* @__PURE__ */ r("div", { className: "group", children: [
187
187
  /* @__PURE__ */ e(
188
188
  "div",
189
189
  {
@@ -205,7 +205,7 @@ function _e() {
205
205
  ] }),
206
206
  /* @__PURE__ */ r("div", { children: [
207
207
  /* @__PURE__ */ e("h3", { className: "mb-4 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Diagram Node Types" }),
208
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-3 sm:grid-cols-5", children: Oe.map((t) => /* @__PURE__ */ r(
208
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-3 sm:grid-cols-5", children: Ue.map((t) => /* @__PURE__ */ r(
209
209
  "div",
210
210
  {
211
211
  className: "border p-3",
@@ -222,7 +222,7 @@ function _e() {
222
222
  ] })
223
223
  ] }),
224
224
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
225
- /* @__PURE__ */ e(E, { number: "Section 02", children: "Typography" }),
225
+ /* @__PURE__ */ e(F, { number: "Section 02", children: "Typography" }),
226
226
  /* @__PURE__ */ r("div", { className: "space-y-12", children: [
227
227
  /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-6 sm:grid-cols-2", children: [
228
228
  {
@@ -378,7 +378,7 @@ function _e() {
378
378
  ] })
379
379
  ] }),
380
380
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
381
- /* @__PURE__ */ e(E, { number: "Section 03", children: "Components" }),
381
+ /* @__PURE__ */ e(F, { number: "Section 03", children: "Components" }),
382
382
  /* @__PURE__ */ r("div", { className: "space-y-16", children: [
383
383
  /* @__PURE__ */ r("div", { children: [
384
384
  /* @__PURE__ */ e("h3", { className: "mb-6 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Buttons" }),
@@ -675,7 +675,7 @@ function _e() {
675
675
  ] })
676
676
  ] }),
677
677
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
678
- /* @__PURE__ */ e(E, { number: "Section 04", children: "Animation & Motion" }),
678
+ /* @__PURE__ */ e(F, { number: "Section 04", children: "Animation & Motion" }),
679
679
  /* @__PURE__ */ r("div", { className: "space-y-8", children: [
680
680
  /* @__PURE__ */ e(
681
681
  "div",
@@ -776,7 +776,7 @@ function _e() {
776
776
  ] })
777
777
  ] }),
778
778
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
779
- /* @__PURE__ */ e(E, { number: "Section 05", children: "Layout & Spacing" }),
779
+ /* @__PURE__ */ e(F, { number: "Section 05", children: "Layout & Spacing" }),
780
780
  /* @__PURE__ */ r("div", { className: "space-y-10", children: [
781
781
  /* @__PURE__ */ r("div", { children: [
782
782
  /* @__PURE__ */ e("h3", { className: "mb-4 text-xs font-semibold uppercase tracking-wider", style: { color: "var(--text-muted)" }, children: "Container Widths" }),
@@ -880,7 +880,7 @@ function _e() {
880
880
  ] })
881
881
  ] }),
882
882
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
883
- /* @__PURE__ */ e(E, { number: "Section 06", children: "Blueprint Decorations" }),
883
+ /* @__PURE__ */ e(F, { number: "Section 06", children: "Blueprint Decorations" }),
884
884
  /* @__PURE__ */ r(
885
885
  "div",
886
886
  {
@@ -951,7 +951,7 @@ function _e() {
951
951
  )
952
952
  ] }),
953
953
  /* @__PURE__ */ r("section", { className: "mx-auto max-w-5xl px-6 py-16", children: [
954
- /* @__PURE__ */ e(E, { number: "Section 07", children: "Usage Guidelines" }),
954
+ /* @__PURE__ */ e(F, { number: "Section 07", children: "Usage Guidelines" }),
955
955
  /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-6 sm:grid-cols-2", children: [
956
956
  {
957
957
  title: "Landing pages",
@@ -1040,7 +1040,7 @@ function _e() {
1040
1040
  ) })
1041
1041
  ] });
1042
1042
  }
1043
- const Ue = {
1043
+ const Ye = {
1044
1044
  system: {
1045
1045
  label: "System",
1046
1046
  bg: "#0d1320",
@@ -1182,7 +1182,7 @@ const Ue = {
1182
1182
  ],
1183
1183
  accentGlow: "rgba(161,161,170,0.08)"
1184
1184
  }
1185
- }, J = {
1185
+ }, te = {
1186
1186
  label: "Component",
1187
1187
  bg: "#0a0f1a",
1188
1188
  bgHover: "#0f1628",
@@ -1195,91 +1195,91 @@ const Ue = {
1195
1195
  ],
1196
1196
  accentGlow: "rgba(100,116,139,0.08)"
1197
1197
  };
1198
- function _(t) {
1199
- return t ? Ue[t] ?? J : J;
1198
+ function Y(t) {
1199
+ return t ? Ye[t] ?? te : te;
1200
1200
  }
1201
- function j(t) {
1201
+ function O(t) {
1202
1202
  var a, o;
1203
1203
  return {
1204
1204
  x: t.internals.positionAbsolute.x + (((a = t.measured) == null ? void 0 : a.width) ?? 0) / 2,
1205
1205
  y: t.internals.positionAbsolute.y + (((o = t.measured) == null ? void 0 : o.height) ?? 0) / 2
1206
1206
  };
1207
1207
  }
1208
- function Ye(t, a) {
1209
- const o = j(t), n = j(a), l = Math.abs(o.x - n.x), i = Math.abs(o.y - n.y);
1210
- return l > i ? o.x > n.x ? k.Left : k.Right : o.y > n.y ? k.Top : k.Bottom;
1208
+ function Xe(t, a) {
1209
+ const o = O(t), n = O(a), l = Math.abs(o.x - n.x), s = Math.abs(o.y - n.y);
1210
+ return l > s ? o.x > n.x ? k.Left : k.Right : o.y > n.y ? k.Top : k.Bottom;
1211
1211
  }
1212
- function ee(t, a, o) {
1213
- const n = j(t), l = j(a), i = Math.abs(n.x - l.x), s = Math.abs(n.y - l.y);
1212
+ function re(t, a, o) {
1213
+ const n = O(t), l = O(a), s = Math.abs(n.x - l.x), i = Math.abs(n.y - l.y);
1214
1214
  let c;
1215
- i > s ? c = n.x > l.x ? k.Left : k.Right : c = n.y > l.y ? k.Top : k.Bottom;
1216
- const [h, d] = Ke(t, c, o);
1217
- return [h, d, c];
1215
+ s > i ? c = n.x > l.x ? k.Left : k.Right : c = n.y > l.y ? k.Top : k.Bottom;
1216
+ const [m, d] = Ze(t, c, o);
1217
+ return [m, d, c];
1218
1218
  }
1219
- function Ke(t, a, o) {
1220
- var d, u, g;
1219
+ function Ze(t, a, o) {
1220
+ var d, h, p;
1221
1221
  const n = (d = t.internals.handleBounds) == null ? void 0 : d[o], l = n == null ? void 0 : n.find((b) => b.position === a);
1222
1222
  if (!l)
1223
1223
  return [
1224
- t.internals.positionAbsolute.x + (((u = t.measured) == null ? void 0 : u.width) ?? 0) / 2,
1225
- t.internals.positionAbsolute.y + (((g = t.measured) == null ? void 0 : g.height) ?? 0) / 2
1224
+ t.internals.positionAbsolute.x + (((h = t.measured) == null ? void 0 : h.width) ?? 0) / 2,
1225
+ t.internals.positionAbsolute.y + (((p = t.measured) == null ? void 0 : p.height) ?? 0) / 2
1226
1226
  ];
1227
- let i = l.width / 2, s = l.height / 2;
1227
+ let s = l.width / 2, i = l.height / 2;
1228
1228
  switch (a) {
1229
1229
  case k.Left:
1230
- i = 0;
1230
+ s = 0;
1231
1231
  break;
1232
1232
  case k.Right:
1233
- i = l.width;
1233
+ s = l.width;
1234
1234
  break;
1235
1235
  case k.Top:
1236
- s = 0;
1236
+ i = 0;
1237
1237
  break;
1238
1238
  case k.Bottom:
1239
- s = l.height;
1239
+ i = l.height;
1240
1240
  break;
1241
1241
  }
1242
- const c = t.internals.positionAbsolute.x + l.x + i, h = t.internals.positionAbsolute.y + l.y + s;
1243
- return [c, h];
1242
+ const c = t.internals.positionAbsolute.x + l.x + s, m = t.internals.positionAbsolute.y + l.y + i;
1243
+ return [c, m];
1244
1244
  }
1245
- function Xe(t, a) {
1246
- const [o, n, l] = ee(t, a, "source"), [i, s, c] = ee(a, t, "target");
1247
- return { sx: o, sy: n, tx: i, ty: s, sourcePos: l, targetPos: c };
1245
+ function qe(t, a) {
1246
+ const [o, n, l] = re(t, a, "source"), [s, i, c] = re(a, t, "target");
1247
+ return { sx: o, sy: n, tx: s, ty: i, sourcePos: l, targetPos: c };
1248
1248
  }
1249
- function Ze() {
1250
- const t = ce(), a = de((o) => {
1249
+ function Qe() {
1250
+ const t = me(), a = ue((o) => {
1251
1251
  if (!t) return /* @__PURE__ */ new Set();
1252
1252
  const n = o.nodeLookup.get(t);
1253
1253
  if (!n) return /* @__PURE__ */ new Set();
1254
1254
  const l = /* @__PURE__ */ new Set();
1255
- for (const i of o.edges) {
1256
- let s = null;
1257
- if (i.source === t ? s = i.target : i.target === t && (s = i.source), !s) continue;
1258
- const c = o.nodeLookup.get(s);
1259
- c && l.add(Ye(n, c));
1255
+ for (const s of o.edges) {
1256
+ let i = null;
1257
+ if (s.source === t ? i = s.target : s.target === t && (i = s.source), !i) continue;
1258
+ const c = o.nodeLookup.get(i);
1259
+ c && l.add(Xe(n, c));
1260
1260
  }
1261
1261
  return l;
1262
1262
  });
1263
- return F(() => a, [a]);
1263
+ return A(() => a, [a]);
1264
1264
  }
1265
- const me = se(null), ue = [
1265
+ const he = de(null), pe = [
1266
1266
  { position: k.Top, prefix: "top" },
1267
1267
  { position: k.Bottom, prefix: "bottom" },
1268
1268
  { position: k.Left, prefix: "left" },
1269
1269
  { position: k.Right, prefix: "right" }
1270
1270
  ];
1271
- function qe({ data: t, selected: a }) {
1272
- const o = t, n = _(o.nodeType), l = Ze(), i = (s) => {
1273
- s.stopPropagation(), o.subDiagramId && (window.location.hash = `#/diagram/${o.subDiagramId}`);
1271
+ function Je({ data: t, selected: a }) {
1272
+ const o = t, n = Y(o.nodeType), l = Qe(), s = (i) => {
1273
+ i.stopPropagation(), o.subDiagramId && (window.location.hash = `#/diagram/${o.subDiagramId}`);
1274
1274
  };
1275
1275
  return o.isContainer || o.hasChildren ? /* @__PURE__ */ e(
1276
- Je,
1276
+ tt,
1277
1277
  {
1278
1278
  d: o,
1279
1279
  style: n,
1280
1280
  selected: a ?? !1,
1281
1281
  activeSides: l,
1282
- onDrillDown: i
1282
+ onDrillDown: s
1283
1283
  }
1284
1284
  ) : /* @__PURE__ */ r(
1285
1285
  "div",
@@ -1294,16 +1294,16 @@ function qe({ data: t, selected: a }) {
1294
1294
  "--tw-ring-color": o.hasSubDiagram ? n.accent : void 0
1295
1295
  },
1296
1296
  children: [
1297
- /* @__PURE__ */ e(he, { accent: n.accent }),
1298
- ue.map(({ position: s, prefix: c }) => {
1299
- const h = l.has(s);
1297
+ /* @__PURE__ */ e(fe, { accent: n.accent }),
1298
+ pe.map(({ position: i, prefix: c }) => {
1299
+ const m = l.has(i);
1300
1300
  return /* @__PURE__ */ e(
1301
- pe,
1301
+ ge,
1302
1302
  {
1303
- position: s,
1303
+ position: i,
1304
1304
  prefix: c,
1305
1305
  style: n,
1306
- isActive: h
1306
+ isActive: m
1307
1307
  },
1308
1308
  c
1309
1309
  );
@@ -1318,14 +1318,14 @@ function qe({ data: t, selected: a }) {
1318
1318
  strokeLinecap: "round",
1319
1319
  strokeLinejoin: "round",
1320
1320
  className: "shrink-0",
1321
- children: n.iconPaths.map((s, c) => /* @__PURE__ */ e(
1321
+ children: n.iconPaths.map((i, c) => /* @__PURE__ */ e(
1322
1322
  "path",
1323
1323
  {
1324
- d: s.d,
1325
- fill: s.fill ?? "none",
1326
- stroke: s.stroke ?? "none",
1327
- strokeWidth: s.strokeWidth ?? 0,
1328
- opacity: s.opacity ?? 1
1324
+ d: i.d,
1325
+ fill: i.fill ?? "none",
1326
+ stroke: i.stroke ?? "none",
1327
+ strokeWidth: i.strokeWidth ?? 0,
1328
+ opacity: i.opacity ?? 1
1329
1329
  },
1330
1330
  c
1331
1331
  ))
@@ -1354,7 +1354,7 @@ function qe({ data: t, selected: a }) {
1354
1354
  o.hasSubDiagram && /* @__PURE__ */ r(
1355
1355
  "div",
1356
1356
  {
1357
- onClick: i,
1357
+ onClick: s,
1358
1358
  className: "mx-auto mt-2 flex w-fit cursor-pointer items-center gap-1 px-2.5 py-0.5 text-[10px] font-medium transition-opacity hover:opacity-80",
1359
1359
  style: {
1360
1360
  background: `${n.accent}10`,
@@ -1365,7 +1365,7 @@ function qe({ data: t, selected: a }) {
1365
1365
  },
1366
1366
  children: [
1367
1367
  /* @__PURE__ */ e("span", { children: "Drill down" }),
1368
- /* @__PURE__ */ e(ge, {})
1368
+ /* @__PURE__ */ e(be, {})
1369
1369
  ]
1370
1370
  }
1371
1371
  )
@@ -1373,26 +1373,26 @@ function qe({ data: t, selected: a }) {
1373
1373
  }
1374
1374
  );
1375
1375
  }
1376
- const te = 16, Qe = 48;
1377
- function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1378
- const i = ce(), s = P(me), c = C(() => {
1379
- s == null || s.notifyLayoutChanged();
1380
- }, [s]), h = de(
1376
+ const ae = 16, et = 48;
1377
+ function tt({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1378
+ const s = me(), i = j(he), c = C(() => {
1379
+ i == null || i.notifyLayoutChanged();
1380
+ }, [i]), m = ue(
1381
1381
  C(
1382
1382
  (d) => {
1383
- var b, f, x, w;
1384
- let u = 200, g = Qe + 40;
1385
- if (!i) return { minWidth: u, minHeight: g };
1386
- for (const m of d.nodeLookup.values()) {
1387
- if (m.parentId !== i) continue;
1388
- const p = ((b = m.measured) == null ? void 0 : b.width) ?? 220, v = ((f = m.measured) == null ? void 0 : f.height) ?? 80, N = (((x = m.position) == null ? void 0 : x.x) ?? 0) + p + te, y = (((w = m.position) == null ? void 0 : w.y) ?? 0) + v + te;
1389
- N > u && (u = N), y > g && (g = y);
1383
+ var b, f, y, N;
1384
+ let h = 200, p = et + 40;
1385
+ if (!s) return { minWidth: h, minHeight: p };
1386
+ for (const u of d.nodeLookup.values()) {
1387
+ if (u.parentId !== s) continue;
1388
+ const g = ((b = u.measured) == null ? void 0 : b.width) ?? 220, L = ((f = u.measured) == null ? void 0 : f.height) ?? 80, x = (((y = u.position) == null ? void 0 : y.x) ?? 0) + g + ae, v = (((N = u.position) == null ? void 0 : N.y) ?? 0) + L + ae;
1389
+ x > h && (h = x), v > p && (p = v);
1390
1390
  }
1391
- return { minWidth: u, minHeight: g };
1391
+ return { minWidth: h, minHeight: p };
1392
1392
  },
1393
- [i]
1393
+ [s]
1394
1394
  ),
1395
- (d, u) => d.minWidth === u.minWidth && d.minHeight === u.minHeight
1395
+ (d, h) => d.minWidth === h.minWidth && d.minHeight === h.minHeight
1396
1396
  );
1397
1397
  return /* @__PURE__ */ r(
1398
1398
  "div",
@@ -1409,11 +1409,11 @@ function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1409
1409
  },
1410
1410
  children: [
1411
1411
  /* @__PURE__ */ e(
1412
- Le,
1412
+ Me,
1413
1413
  {
1414
1414
  isVisible: o,
1415
- minWidth: h.minWidth,
1416
- minHeight: h.minHeight,
1415
+ minWidth: m.minWidth,
1416
+ minHeight: m.minHeight,
1417
1417
  onResizeEnd: c,
1418
1418
  lineStyle: {
1419
1419
  borderColor: `${a.accent}55`,
@@ -1429,18 +1429,18 @@ function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1429
1429
  }
1430
1430
  }
1431
1431
  ),
1432
- /* @__PURE__ */ e(he, { accent: a.accent }),
1433
- ue.map(({ position: d, prefix: u }) => {
1434
- const g = n.has(d);
1432
+ /* @__PURE__ */ e(fe, { accent: a.accent }),
1433
+ pe.map(({ position: d, prefix: h }) => {
1434
+ const p = n.has(d);
1435
1435
  return /* @__PURE__ */ e(
1436
- pe,
1436
+ ge,
1437
1437
  {
1438
1438
  position: d,
1439
- prefix: u,
1439
+ prefix: h,
1440
1440
  style: a,
1441
- isActive: g
1441
+ isActive: p
1442
1442
  },
1443
- u
1443
+ h
1444
1444
  );
1445
1445
  }),
1446
1446
  /* @__PURE__ */ r(
@@ -1463,7 +1463,7 @@ function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1463
1463
  strokeLinecap: "round",
1464
1464
  strokeLinejoin: "round",
1465
1465
  className: "shrink-0",
1466
- children: a.iconPaths.map((d, u) => /* @__PURE__ */ e(
1466
+ children: a.iconPaths.map((d, h) => /* @__PURE__ */ e(
1467
1467
  "path",
1468
1468
  {
1469
1469
  d: d.d,
@@ -1472,7 +1472,7 @@ function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1472
1472
  strokeWidth: d.strokeWidth ?? 0,
1473
1473
  opacity: d.opacity ?? 1
1474
1474
  },
1475
- u
1475
+ h
1476
1476
  ))
1477
1477
  }
1478
1478
  ),
@@ -1511,7 +1511,7 @@ function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1511
1511
  },
1512
1512
  children: [
1513
1513
  /* @__PURE__ */ e("span", { children: "Drill down" }),
1514
- /* @__PURE__ */ e(ge, {})
1514
+ /* @__PURE__ */ e(be, {})
1515
1515
  ]
1516
1516
  }
1517
1517
  )
@@ -1522,8 +1522,8 @@ function Je({ d: t, style: a, selected: o, activeSides: n, onDrillDown: l }) {
1522
1522
  }
1523
1523
  );
1524
1524
  }
1525
- function he({ accent: t }) {
1526
- return /* @__PURE__ */ r(H, { children: [
1525
+ function fe({ accent: t }) {
1526
+ return /* @__PURE__ */ r(T, { children: [
1527
1527
  /* @__PURE__ */ e(
1528
1528
  "svg",
1529
1529
  {
@@ -1564,7 +1564,7 @@ function he({ accent: t }) {
1564
1564
  )
1565
1565
  ] });
1566
1566
  }
1567
- function pe({
1567
+ function ge({
1568
1568
  position: t,
1569
1569
  prefix: a,
1570
1570
  style: o,
@@ -1582,7 +1582,7 @@ function pe({
1582
1582
  };
1583
1583
  return /* @__PURE__ */ r("span", { children: [
1584
1584
  /* @__PURE__ */ e(
1585
- X,
1585
+ q,
1586
1586
  {
1587
1587
  type: "source",
1588
1588
  position: t,
@@ -1592,7 +1592,7 @@ function pe({
1592
1592
  }
1593
1593
  ),
1594
1594
  /* @__PURE__ */ e(
1595
- X,
1595
+ q,
1596
1596
  {
1597
1597
  type: "target",
1598
1598
  position: t,
@@ -1603,7 +1603,7 @@ function pe({
1603
1603
  )
1604
1604
  ] });
1605
1605
  }
1606
- function ge() {
1606
+ function be() {
1607
1607
  return /* @__PURE__ */ e(
1608
1608
  "svg",
1609
1609
  {
@@ -1619,33 +1619,33 @@ function ge() {
1619
1619
  }
1620
1620
  );
1621
1621
  }
1622
- const et = we(qe), tt = {
1622
+ const rt = Ne(Je), at = {
1623
1623
  calls: { color: "#818cf8", dashed: !1, animated: !1, label: "Calls" },
1624
1624
  "data-flow": { color: "#34d399", dashed: !1, animated: !0, label: "Data Flow" },
1625
1625
  publishes: { color: "#fbbf24", dashed: !0, animated: !1, label: "Publishes" },
1626
1626
  subscribes: { color: "#fbbf24", dashed: !0, animated: !1, label: "Subscribes" },
1627
1627
  reads: { color: "#34d399", dashed: !1, animated: !1, label: "Reads" },
1628
1628
  writes: { color: "#fb923c", dashed: !1, animated: !1, label: "Writes" }
1629
- }, re = {
1629
+ }, oe = {
1630
1630
  color: "#22d3ee",
1631
1631
  dashed: !1,
1632
1632
  animated: !1,
1633
1633
  label: "Connection"
1634
1634
  };
1635
- function fe(t) {
1636
- return t ? tt[t] ?? re : re;
1635
+ function xe(t) {
1636
+ return t ? at[t] ?? oe : oe;
1637
1637
  }
1638
- function rt({ diagram: t }) {
1639
- const [a, o] = L(!1), { nodeTypes: n, edgeTypes: l } = F(() => {
1640
- var c, h;
1641
- const i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
1638
+ function ot({ diagram: t }) {
1639
+ const [a, o] = w(!1), { nodeTypes: n, edgeTypes: l } = A(() => {
1640
+ var c, m;
1641
+ const s = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
1642
1642
  for (const d of t.nodes)
1643
- typeof ((c = d.meta) == null ? void 0 : c.type) == "string" && i.add(d.meta.type);
1643
+ typeof ((c = d.meta) == null ? void 0 : c.type) == "string" && s.add(d.meta.type);
1644
1644
  for (const d of t.edges)
1645
- typeof ((h = d.meta) == null ? void 0 : h.type) == "string" && s.add(d.meta.type);
1646
- return { nodeTypes: [...i].sort(), edgeTypes: [...s].sort() };
1645
+ typeof ((m = d.meta) == null ? void 0 : m.type) == "string" && i.add(d.meta.type);
1646
+ return { nodeTypes: [...s].sort(), edgeTypes: [...i].sort() };
1647
1647
  }, [t]);
1648
- return n.length === 0 && l.length === 0 ? null : /* @__PURE__ */ e(Me, { position: "top-right", className: "!m-3", children: /* @__PURE__ */ r(
1648
+ return n.length === 0 && l.length === 0 ? null : /* @__PURE__ */ e(Se, { position: "top-right", className: "!m-3", children: /* @__PURE__ */ r(
1649
1649
  "div",
1650
1650
  {
1651
1651
  className: "flex flex-col border shadow-lg backdrop-blur-md",
@@ -1660,14 +1660,14 @@ function rt({ diagram: t }) {
1660
1660
  "button",
1661
1661
  {
1662
1662
  type: "button",
1663
- onClick: () => o((i) => !i),
1663
+ onClick: () => o((s) => !s),
1664
1664
  className: "flex items-center gap-2 px-3 py-1.5 text-[10px] tracking-[0.2em] uppercase transition-colors hover:text-white",
1665
1665
  style: { color: "var(--text-muted, #94a3b8)" },
1666
1666
  "aria-expanded": a,
1667
1667
  children: [
1668
- /* @__PURE__ */ e(lt, {}),
1668
+ /* @__PURE__ */ e(st, {}),
1669
1669
  /* @__PURE__ */ e("span", { children: "Legend" }),
1670
- /* @__PURE__ */ e(it, { open: a })
1670
+ /* @__PURE__ */ e(ct, { open: a })
1671
1671
  ]
1672
1672
  }
1673
1673
  ),
@@ -1677,8 +1677,8 @@ function rt({ diagram: t }) {
1677
1677
  className: "flex flex-col gap-3 border-t px-3 py-2.5",
1678
1678
  style: { borderColor: "#1e2d4a", minWidth: 180 },
1679
1679
  children: [
1680
- n.length > 0 && /* @__PURE__ */ e(ae, { title: "Nodes", children: n.map((i) => /* @__PURE__ */ e(at, { type: i, style: _(i) }, i)) }),
1681
- l.length > 0 && /* @__PURE__ */ e(ae, { title: "Edges", children: l.map((i) => /* @__PURE__ */ e(ot, { style: fe(i) }, i)) })
1680
+ n.length > 0 && /* @__PURE__ */ e(ne, { title: "Nodes", children: n.map((s) => /* @__PURE__ */ e(nt, { type: s, style: Y(s) }, s)) }),
1681
+ l.length > 0 && /* @__PURE__ */ e(ne, { title: "Edges", children: l.map((s) => /* @__PURE__ */ e(lt, { style: xe(s) }, s)) })
1682
1682
  ]
1683
1683
  }
1684
1684
  )
@@ -1686,7 +1686,7 @@ function rt({ diagram: t }) {
1686
1686
  }
1687
1687
  ) });
1688
1688
  }
1689
- function ae({
1689
+ function ne({
1690
1690
  title: t,
1691
1691
  children: a
1692
1692
  }) {
@@ -1702,14 +1702,14 @@ function ae({
1702
1702
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: a })
1703
1703
  ] });
1704
1704
  }
1705
- function at({ type: t, style: a }) {
1705
+ function nt({ type: t, style: a }) {
1706
1706
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px]", children: [
1707
1707
  /* @__PURE__ */ e(
1708
1708
  "span",
1709
1709
  {
1710
1710
  className: "flex h-6 w-6 shrink-0 items-center justify-center border",
1711
1711
  style: { background: a.bg, borderColor: a.border },
1712
- children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: a.iconPaths.map((o, n) => /* @__PURE__ */ e(nt, { p: o }, n)) })
1712
+ children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: a.iconPaths.map((o, n) => /* @__PURE__ */ e(it, { p: o }, n)) })
1713
1713
  }
1714
1714
  ),
1715
1715
  /* @__PURE__ */ e("span", { style: { color: a.accent }, children: a.label }),
@@ -1723,7 +1723,7 @@ function at({ type: t, style: a }) {
1723
1723
  )
1724
1724
  ] });
1725
1725
  }
1726
- function ot({ style: t }) {
1726
+ function lt({ style: t }) {
1727
1727
  const a = t.dashed ? "4 3" : void 0;
1728
1728
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px]", children: [
1729
1729
  /* @__PURE__ */ r("svg", { width: "28", height: "10", className: "shrink-0", children: [
@@ -1760,7 +1760,7 @@ function ot({ style: t }) {
1760
1760
  /* @__PURE__ */ e("span", { style: { color: t.color }, children: t.label })
1761
1761
  ] });
1762
1762
  }
1763
- function nt({ p: t }) {
1763
+ function it({ p: t }) {
1764
1764
  return /* @__PURE__ */ e(
1765
1765
  "path",
1766
1766
  {
@@ -1774,7 +1774,7 @@ function nt({ p: t }) {
1774
1774
  }
1775
1775
  );
1776
1776
  }
1777
- function lt() {
1777
+ function st() {
1778
1778
  return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", children: [
1779
1779
  /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5" }),
1780
1780
  /* @__PURE__ */ e("rect", { x: "14", y: "4", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.6" }),
@@ -1782,7 +1782,7 @@ function lt() {
1782
1782
  /* @__PURE__ */ e("rect", { x: "14", y: "14", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.15" })
1783
1783
  ] });
1784
1784
  }
1785
- function it({ open: t }) {
1785
+ function ct({ open: t }) {
1786
1786
  return /* @__PURE__ */ e(
1787
1787
  "svg",
1788
1788
  {
@@ -1802,84 +1802,84 @@ function it({ open: t }) {
1802
1802
  }
1803
1803
  );
1804
1804
  }
1805
- function st({
1805
+ function dt({
1806
1806
  id: t,
1807
1807
  source: a,
1808
1808
  target: o,
1809
1809
  markerEnd: n,
1810
1810
  style: l,
1811
- label: i,
1812
- labelStyle: s,
1811
+ label: s,
1812
+ labelStyle: i,
1813
1813
  labelBgStyle: c,
1814
- labelBgPadding: h,
1814
+ labelBgPadding: m,
1815
1815
  labelBgBorderRadius: d,
1816
- animated: u
1816
+ animated: h
1817
1817
  }) {
1818
- const g = Z(a), b = Z(o);
1819
- if (!g || !b) return null;
1820
- const { sx: f, sy: x, tx: w, ty: m, sourcePos: p, targetPos: v } = Xe(
1821
- g,
1818
+ const p = Q(a), b = Q(o);
1819
+ if (!p || !b) return null;
1820
+ const { sx: f, sy: y, tx: N, ty: u, sourcePos: g, targetPos: L } = qe(
1821
+ p,
1822
1822
  b
1823
- ), [N, y, M] = Be({
1823
+ ), [x, v, M] = Be({
1824
1824
  sourceX: f,
1825
- sourceY: x,
1826
- sourcePosition: p,
1827
- targetPosition: v,
1828
- targetX: w,
1829
- targetY: m,
1825
+ sourceY: y,
1826
+ sourcePosition: g,
1827
+ targetPosition: L,
1828
+ targetX: N,
1829
+ targetY: u,
1830
1830
  borderRadius: 8
1831
1831
  });
1832
- return /* @__PURE__ */ r(H, { children: [
1832
+ return /* @__PURE__ */ r(T, { children: [
1833
1833
  /* @__PURE__ */ e(
1834
1834
  "path",
1835
1835
  {
1836
1836
  id: t,
1837
- className: `react-flow__edge-path${u ? " react-flow__edge-path--animated" : ""}`,
1838
- d: N,
1837
+ className: `react-flow__edge-path${h ? " react-flow__edge-path--animated" : ""}`,
1838
+ d: x,
1839
1839
  markerEnd: n,
1840
1840
  style: l
1841
1841
  }
1842
1842
  ),
1843
- i && /* @__PURE__ */ e(Se, { children: /* @__PURE__ */ e(
1843
+ s && /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
1844
1844
  "div",
1845
1845
  {
1846
1846
  style: {
1847
1847
  position: "absolute",
1848
- transform: `translate(-50%, -50%) translate(${y}px, ${M}px)`,
1848
+ transform: `translate(-50%, -50%) translate(${v}px, ${M}px)`,
1849
1849
  pointerEvents: "all",
1850
1850
  ...c ? {
1851
- background: ct(c),
1851
+ background: mt(c),
1852
1852
  borderRadius: d ?? 4,
1853
- padding: h ? `${h[1]}px ${h[0]}px` : "4px 6px"
1853
+ padding: m ? `${m[1]}px ${m[0]}px` : "4px 6px"
1854
1854
  } : {}
1855
1855
  },
1856
- children: /* @__PURE__ */ e("span", { style: s, children: i })
1856
+ children: /* @__PURE__ */ e("span", { style: i, children: s })
1857
1857
  }
1858
1858
  ) })
1859
1859
  ] });
1860
1860
  }
1861
- function ct(t) {
1861
+ function mt(t) {
1862
1862
  const a = t, o = a.fill ?? "#0a0f1a", n = a.fillOpacity ?? 1;
1863
1863
  if (n >= 1) return o;
1864
1864
  const l = o.replace("#", "");
1865
1865
  if (l.length !== 3 && l.length !== 6) return o;
1866
- const i = l.length === 3 ? l.split("").map((d) => d + d).join("") : l, s = parseInt(i.slice(0, 2), 16), c = parseInt(i.slice(2, 4), 16), h = parseInt(i.slice(4, 6), 16);
1867
- return `rgba(${s}, ${c}, ${h}, ${n})`;
1866
+ const s = l.length === 3 ? l.split("").map((d) => d + d).join("") : l, i = parseInt(s.slice(0, 2), 16), c = parseInt(s.slice(2, 4), 16), m = parseInt(s.slice(4, 6), 16);
1867
+ return `rgba(${i}, ${c}, ${m}, ${n})`;
1868
1868
  }
1869
- function dt(t) {
1869
+ function ut(t) {
1870
1870
  const a = new Set(t.nodes.map((n) => n.id)), o = /* @__PURE__ */ new Map();
1871
1871
  for (const n of t.nodes)
1872
1872
  n.parentId && a.has(n.parentId) && o.set(n.parentId, (o.get(n.parentId) ?? 0) + 1);
1873
1873
  return {
1874
- nodes: t.nodes.map((n) => mt(n, o.has(n.id))),
1875
- edges: t.edges.filter((n) => a.has(n.source) && a.has(n.target)).map(ut)
1874
+ nodes: t.nodes.map((n) => ht(n, o.has(n.id))),
1875
+ edges: t.edges.filter((n) => a.has(n.source) && a.has(n.target)).map(pt)
1876
1876
  };
1877
1877
  }
1878
- function mt(t, a) {
1879
- var i, s, c;
1880
- const o = !!((i = t.meta) != null && i.isContainer) || a, n = {
1878
+ function ht(t, a) {
1879
+ var s, i, c;
1880
+ const o = !!((s = t.meta) != null && s.isContainer) || a, n = {
1881
1881
  label: t.label,
1882
- nodeType: (s = t.meta) == null ? void 0 : s.type,
1882
+ nodeType: (i = t.meta) == null ? void 0 : i.type,
1883
1883
  technology: typeof ((c = t.meta) == null ? void 0 : c.technology) == "string" ? t.meta.technology : void 0,
1884
1884
  hasSubDiagram: !!t.subDiagramId,
1885
1885
  subDiagramId: t.subDiagramId ?? void 0,
@@ -1893,9 +1893,9 @@ function mt(t, a) {
1893
1893
  };
1894
1894
  return t.parentId && (l.parentId = t.parentId, l.extent = "parent"), l;
1895
1895
  }
1896
- function ut(t) {
1896
+ function pt(t) {
1897
1897
  var n;
1898
- const a = fe((n = t.meta) == null ? void 0 : n.type), o = { strokeWidth: 1.5, stroke: a.color };
1898
+ const a = xe((n = t.meta) == null ? void 0 : n.type), o = { strokeWidth: 1.5, stroke: a.color };
1899
1899
  return a.dashed && (o.strokeDasharray = "5 5"), {
1900
1900
  id: t.id,
1901
1901
  source: t.source,
@@ -1925,73 +1925,73 @@ function ut(t) {
1925
1925
  labelBgBorderRadius: 4
1926
1926
  };
1927
1927
  }
1928
- const ht = new je(), oe = 220, ne = 80, pt = "[top=48,left=16,bottom=16,right=16]";
1929
- function gt(t) {
1928
+ const ft = new Re(), le = 220, ie = 80, gt = "[top=48,left=16,bottom=16,right=16]";
1929
+ function bt(t) {
1930
1930
  return t === "LR" ? "RIGHT" : "DOWN";
1931
1931
  }
1932
- async function ft(t, a, o, n) {
1932
+ async function xt(t, a, o, n) {
1933
1933
  if (t.length === 0) return t;
1934
1934
  const l = /* @__PURE__ */ new Map();
1935
- for (const m of t) {
1936
- const p = m.parentId ?? void 0, v = l.get(p) ?? [];
1937
- v.push(m), l.set(p, v);
1935
+ for (const u of t) {
1936
+ const g = u.parentId ?? void 0, L = l.get(g) ?? [];
1937
+ L.push(u), l.set(g, L);
1938
1938
  }
1939
- const i = (m) => {
1940
- var p;
1941
- return (((p = l.get(m)) == null ? void 0 : p.length) ?? 0) > 0;
1942
- }, s = (m) => i(m.id) ? {
1943
- id: m.id,
1944
- layoutOptions: { "elk.padding": pt },
1945
- children: (l.get(m.id) ?? []).map(s)
1946
- } : { id: m.id, width: oe, height: ne }, c = l.get(void 0) ?? [], h = {
1939
+ const s = (u) => {
1940
+ var g;
1941
+ return (((g = l.get(u)) == null ? void 0 : g.length) ?? 0) > 0;
1942
+ }, i = (u) => s(u.id) ? {
1943
+ id: u.id,
1944
+ layoutOptions: { "elk.padding": gt },
1945
+ children: (l.get(u.id) ?? []).map(i)
1946
+ } : { id: u.id, width: le, height: ie }, c = l.get(void 0) ?? [], m = {
1947
1947
  id: "root",
1948
1948
  layoutOptions: {
1949
1949
  "elk.algorithm": "layered",
1950
- "elk.direction": gt(o),
1950
+ "elk.direction": bt(o),
1951
1951
  "elk.edgeRouting": "ORTHOGONAL",
1952
1952
  "elk.spacing.nodeNode": "80",
1953
1953
  "elk.layered.spacing.nodeNodeBetweenLayers": "120",
1954
1954
  "elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
1955
1955
  "elk.hierarchyHandling": "INCLUDE_CHILDREN"
1956
1956
  },
1957
- children: c.map(s),
1958
- edges: a.map((m) => ({
1959
- id: m.id,
1960
- sources: [m.source],
1961
- targets: [m.target]
1957
+ children: c.map(i),
1958
+ edges: a.map((u) => ({
1959
+ id: u.id,
1960
+ sources: [u.source],
1961
+ targets: [u.target]
1962
1962
  }))
1963
- }, d = await ht.layout(h), u = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), b = (m) => {
1964
- m.id !== "root" && (u.set(m.id, { x: m.x ?? 0, y: m.y ?? 0 }), i(m.id) && g.set(m.id, {
1965
- width: m.width ?? oe,
1966
- height: m.height ?? ne
1963
+ }, d = await ft.layout(m), h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), b = (u) => {
1964
+ u.id !== "root" && (h.set(u.id, { x: u.x ?? 0, y: u.y ?? 0 }), s(u.id) && p.set(u.id, {
1965
+ width: u.width ?? le,
1966
+ height: u.height ?? ie
1967
1967
  }));
1968
- for (const p of m.children ?? []) b(p);
1968
+ for (const g of u.children ?? []) b(g);
1969
1969
  };
1970
1970
  b(d);
1971
- const f = /* @__PURE__ */ new Set(), x = [], w = (m) => {
1972
- if (f.has(m.id)) return;
1973
- f.add(m.id);
1974
- const p = n == null ? void 0 : n.nodes[m.id], v = p ? { x: p.x, y: p.y } : u.get(m.id) ?? { x: 0, y: 0 }, N = { ...m, position: v }, y = g.get(m.id), M = (p == null ? void 0 : p.width) ?? (y == null ? void 0 : y.width), D = (p == null ? void 0 : p.height) ?? (y == null ? void 0 : y.height);
1975
- M !== void 0 && D !== void 0 && (N.style = { ...m.style ?? {}, width: M, height: D }), x.push(N);
1976
- for (const $ of l.get(m.id) ?? []) w($);
1971
+ const f = /* @__PURE__ */ new Set(), y = [], N = (u) => {
1972
+ if (f.has(u.id)) return;
1973
+ f.add(u.id);
1974
+ const g = n == null ? void 0 : n.nodes[u.id], L = g ? { x: g.x, y: g.y } : h.get(u.id) ?? { x: 0, y: 0 }, x = { ...u, position: L }, v = p.get(u.id), M = (g == null ? void 0 : g.width) ?? (v == null ? void 0 : v.width), W = (g == null ? void 0 : g.height) ?? (v == null ? void 0 : v.height);
1975
+ M !== void 0 && W !== void 0 && (x.style = { ...u.style ?? {}, width: M, height: W }), y.push(x);
1976
+ for (const I of l.get(u.id) ?? []) N(I);
1977
1977
  };
1978
- for (const m of c) w(m);
1979
- for (const m of t) f.has(m.id) || w(m);
1980
- return x;
1978
+ for (const u of c) N(u);
1979
+ for (const u of t) f.has(u.id) || N(u);
1980
+ return y;
1981
1981
  }
1982
- const bt = {
1982
+ const vt = {
1983
1983
  summary: "Reading manifest",
1984
1984
  diagrams: "Loading diagrams",
1985
1985
  descriptions: "Loading node details"
1986
- }, xt = 150;
1987
- function vt({ state: t }) {
1988
- const [a, o] = L(!1);
1989
- return B(() => {
1986
+ }, yt = 150;
1987
+ function kt({ state: t }) {
1988
+ const [a, o] = w(!1);
1989
+ return S(() => {
1990
1990
  if (t.status === "error") {
1991
1991
  o(!0);
1992
1992
  return;
1993
1993
  }
1994
- const n = setTimeout(() => o(!0), xt);
1994
+ const n = setTimeout(() => o(!0), yt);
1995
1995
  return () => clearTimeout(n);
1996
1996
  }, [t.status]), a ? /* @__PURE__ */ e(
1997
1997
  "div",
@@ -2008,7 +2008,7 @@ function vt({ state: t }) {
2008
2008
  borderColor: "var(--border-default)",
2009
2009
  backgroundColor: "rgba(10, 15, 26, 0.85)"
2010
2010
  },
2011
- children: t.status === "error" ? /* @__PURE__ */ e(kt, { message: t.message }) : /* @__PURE__ */ e(yt, { state: t })
2011
+ children: t.status === "error" ? /* @__PURE__ */ e(Nt, { message: t.message }) : /* @__PURE__ */ e(wt, { state: t })
2012
2012
  }
2013
2013
  )
2014
2014
  }
@@ -2021,11 +2021,11 @@ function vt({ state: t }) {
2021
2021
  }
2022
2022
  );
2023
2023
  }
2024
- function yt({
2024
+ function wt({
2025
2025
  state: t
2026
2026
  }) {
2027
- const { phase: a, done: o, total: n, archName: l } = t, i = n > 0 ? Math.min(1, o / n) : 0, s = a !== "summary";
2028
- return /* @__PURE__ */ r(H, { children: [
2027
+ const { phase: a, done: o, total: n, archName: l } = t, s = n > 0 ? Math.min(1, o / n) : 0, i = a !== "summary";
2028
+ return /* @__PURE__ */ r(T, { children: [
2029
2029
  /* @__PURE__ */ e(
2030
2030
  "div",
2031
2031
  {
@@ -2048,8 +2048,8 @@ function yt({
2048
2048
  className: "mt-5 flex items-center justify-between text-[10px] tracking-[0.2em] uppercase",
2049
2049
  style: { color: "var(--text-secondary)", fontFamily: "var(--font-mono)" },
2050
2050
  children: [
2051
- /* @__PURE__ */ e("span", { children: bt[a] }),
2052
- s && /* @__PURE__ */ r("span", { style: { color: "var(--text-muted)" }, children: [
2051
+ /* @__PURE__ */ e("span", { children: vt[a] }),
2052
+ i && /* @__PURE__ */ r("span", { style: { color: "var(--text-muted)" }, children: [
2053
2053
  o,
2054
2054
  " / ",
2055
2055
  n
@@ -2076,7 +2076,7 @@ function yt({
2076
2076
  {
2077
2077
  className: "h-full",
2078
2078
  style: {
2079
- width: `${i * 100}%`,
2079
+ width: `${s * 100}%`,
2080
2080
  backgroundColor: "var(--accent-cyan)",
2081
2081
  transition: "width 200ms ease-out"
2082
2082
  }
@@ -2086,8 +2086,8 @@ function yt({
2086
2086
  )
2087
2087
  ] });
2088
2088
  }
2089
- function kt({ message: t }) {
2090
- return /* @__PURE__ */ r(H, { children: [
2089
+ function Nt({ message: t }) {
2090
+ return /* @__PURE__ */ r(T, { children: [
2091
2091
  /* @__PURE__ */ e(
2092
2092
  "div",
2093
2093
  {
@@ -2129,169 +2129,172 @@ function kt({ message: t }) {
2129
2129
  )
2130
2130
  ] });
2131
2131
  }
2132
- const T = se(null);
2133
- function U() {
2134
- const t = P(T);
2132
+ const R = de(null);
2133
+ function V() {
2134
+ const t = j(R);
2135
2135
  if (!t)
2136
2136
  throw new Error(
2137
2137
  "useArchitectureBundle must be used inside ArchitectureBundleProvider"
2138
2138
  );
2139
2139
  return t.bundle;
2140
2140
  }
2141
- function wt() {
2142
- const t = P(T);
2141
+ function Ct() {
2142
+ const t = j(R);
2143
2143
  if (!t)
2144
2144
  throw new Error(
2145
2145
  "useSaveLayout must be used inside ArchitectureBundleProvider"
2146
2146
  );
2147
2147
  return t.saveLayout;
2148
2148
  }
2149
- function Nt() {
2150
- const t = P(T);
2149
+ function Lt() {
2150
+ const t = j(R);
2151
2151
  if (!t)
2152
2152
  throw new Error(
2153
2153
  "useOpenInEditor must be used inside ArchitectureBundleProvider"
2154
2154
  );
2155
2155
  return t.openInEditor;
2156
2156
  }
2157
- function Ct() {
2158
- const t = P(T);
2157
+ function Mt() {
2158
+ const t = j(R);
2159
2159
  if (!t)
2160
2160
  throw new Error(
2161
2161
  "useReportUsage must be used inside ArchitectureBundleProvider"
2162
2162
  );
2163
2163
  return t.reportUsage;
2164
2164
  }
2165
- function Lt({
2165
+ function St({
2166
2166
  dataSource: t,
2167
2167
  children: a,
2168
2168
  reloadKey: o
2169
2169
  }) {
2170
- const [n, l] = L({
2170
+ const [n, l] = w({
2171
2171
  status: "loading",
2172
2172
  phase: "summary",
2173
2173
  done: 0,
2174
2174
  total: 1
2175
2175
  });
2176
- B(() => {
2177
- let u = !1;
2178
- return l({ status: "loading", phase: "summary", done: 0, total: 1 }), Mt({
2176
+ S(() => {
2177
+ let h = !1;
2178
+ return l({ status: "loading", phase: "summary", done: 0, total: 1 }), Bt({
2179
2179
  dataSource: t,
2180
- onState: (g) => {
2181
- u || l(g);
2180
+ onState: (p) => {
2181
+ h || l(p);
2182
2182
  },
2183
- isCancelled: () => u
2183
+ isCancelled: () => h
2184
2184
  }), () => {
2185
- u = !0;
2185
+ h = !0;
2186
2186
  };
2187
2187
  }, [t, o]);
2188
- const i = C(
2189
- async (u, g) => {
2190
- const b = await t.saveLayout(u, g);
2188
+ const s = C(
2189
+ async (h, p) => {
2190
+ const b = await t.saveLayout(h, p);
2191
2191
  l((f) => f.status !== "ready" ? f : {
2192
2192
  status: "ready",
2193
2193
  bundle: {
2194
2194
  ...f.bundle,
2195
- layouts: { ...f.bundle.layouts, [u]: b }
2195
+ layouts: { ...f.bundle.layouts, [h]: b }
2196
2196
  }
2197
2197
  });
2198
2198
  },
2199
2199
  [t]
2200
- ), s = F(
2201
- () => t.openInEditor ? (u) => {
2202
- var g;
2203
- return (g = t.openInEditor) == null ? void 0 : g.call(t, u);
2200
+ ), i = A(
2201
+ () => t.openInEditor ? (h) => {
2202
+ var p;
2203
+ return (p = t.openInEditor) == null ? void 0 : p.call(t, h);
2204
2204
  } : void 0,
2205
2205
  [t]
2206
2206
  ), c = C(
2207
- (u, g) => {
2207
+ (h, p) => {
2208
2208
  var b;
2209
- (b = t.reportUsage) == null || b.call(t, u, g);
2209
+ (b = t.reportUsage) == null || b.call(t, h, p);
2210
2210
  },
2211
2211
  [t]
2212
- ), h = n.status === "ready" ? n.bundle : null, d = F(() => h ? { bundle: h, saveLayout: i, openInEditor: s, reportUsage: c } : null, [h, i, s, c]);
2213
- return n.status !== "ready" ? /* @__PURE__ */ e(vt, { state: n }) : d ? /* @__PURE__ */ e(T.Provider, { value: d, children: a }) : null;
2212
+ ), m = n.status === "ready" ? n.bundle : null, d = A(() => m ? { bundle: m, saveLayout: s, openInEditor: i, reportUsage: c } : null, [m, s, i, c]);
2213
+ return n.status !== "ready" ? /* @__PURE__ */ e(kt, { state: n }) : d ? /* @__PURE__ */ e(R.Provider, { value: d, children: a }) : null;
2214
2214
  }
2215
- async function Mt({
2215
+ async function Bt({
2216
2216
  dataSource: t,
2217
2217
  onState: a,
2218
2218
  isCancelled: o
2219
2219
  }) {
2220
2220
  try {
2221
2221
  a({ status: "loading", phase: "summary", done: 0, total: 1 });
2222
- const n = await t.loadSummary();
2222
+ const n = t.loadDrift ? t.loadDrift().catch(() => null) : Promise.resolve(null), l = await t.loadSummary();
2223
2223
  if (o()) return;
2224
- const l = n.diagrams.map((p) => p.slug);
2224
+ const s = l.diagrams.map((x) => x.slug);
2225
2225
  let i = 0;
2226
- const s = l.length * 2;
2226
+ const c = s.length * 2;
2227
2227
  a({
2228
2228
  status: "loading",
2229
2229
  phase: "diagrams",
2230
2230
  done: 0,
2231
- total: s,
2232
- archName: n.name
2231
+ total: c,
2232
+ archName: l.name
2233
2233
  });
2234
- const c = () => {
2234
+ const m = () => {
2235
2235
  i += 1, a({
2236
2236
  status: "loading",
2237
2237
  phase: "diagrams",
2238
2238
  done: i,
2239
- total: s,
2240
- archName: n.name
2239
+ total: c,
2240
+ archName: l.name
2241
2241
  });
2242
- }, h = await Promise.all(
2243
- l.map(async (p) => {
2244
- const v = t.loadDiagram(p).then((D) => (o() || c(), D)), N = t.loadLayout(p).then((D) => (o() || c(), D)), [y, M] = await Promise.all([
2242
+ }, d = await Promise.all(
2243
+ s.map(async (x) => {
2244
+ const v = t.loadDiagram(x).then((P) => (o() || m(), P)), M = t.loadLayout(x).then((P) => (o() || m(), P)), [W, I] = await Promise.all([
2245
2245
  v,
2246
- N
2246
+ M
2247
2247
  ]);
2248
- return { slug: p, diagram: y, layout: M };
2248
+ return { slug: x, diagram: W, layout: I };
2249
2249
  })
2250
2250
  );
2251
2251
  if (o()) return;
2252
- const d = {}, u = {}, g = /* @__PURE__ */ new Set();
2253
- for (const { slug: p, diagram: v, layout: N } of h) {
2254
- d[p] = v, u[p] = N;
2255
- for (const y of v.nodes ?? []) g.add(y.id);
2252
+ const h = {}, p = {}, b = /* @__PURE__ */ new Set();
2253
+ for (const { slug: x, diagram: v, layout: M } of d) {
2254
+ h[x] = v, p[x] = M;
2255
+ for (const W of v.nodes ?? []) b.add(W.id);
2256
2256
  }
2257
- const b = [...g];
2258
- let f = 0;
2257
+ const f = [...b];
2258
+ let y = 0;
2259
2259
  a({
2260
2260
  status: "loading",
2261
2261
  phase: "descriptions",
2262
2262
  done: 0,
2263
- total: b.length,
2264
- archName: n.name
2263
+ total: f.length,
2264
+ archName: l.name
2265
2265
  });
2266
- const x = () => {
2267
- f += 1, a({
2266
+ const N = () => {
2267
+ y += 1, a({
2268
2268
  status: "loading",
2269
2269
  phase: "descriptions",
2270
- done: f,
2271
- total: b.length,
2272
- archName: n.name
2270
+ done: y,
2271
+ total: f.length,
2272
+ archName: l.name
2273
2273
  });
2274
- }, w = {}, m = /* @__PURE__ */ new Set();
2274
+ }, u = {}, g = /* @__PURE__ */ new Set();
2275
2275
  if (await Promise.all(
2276
- b.map(async (p) => {
2276
+ f.map(async (x) => {
2277
2277
  try {
2278
- const v = await t.loadNodeDetail(p);
2279
- w[p] = v;
2278
+ const v = await t.loadNodeDetail(x);
2279
+ u[x] = v;
2280
2280
  } catch {
2281
- m.add(p);
2281
+ g.add(x);
2282
2282
  } finally {
2283
- o() || x();
2283
+ o() || N();
2284
2284
  }
2285
2285
  })
2286
2286
  ), o()) return;
2287
+ const L = await n;
2288
+ if (o()) return;
2287
2289
  a({
2288
2290
  status: "ready",
2289
2291
  bundle: {
2290
- summary: n,
2291
- diagrams: d,
2292
- layouts: u,
2293
- nodes: w,
2294
- missingDescriptions: m
2292
+ summary: l,
2293
+ diagrams: h,
2294
+ layouts: p,
2295
+ nodes: u,
2296
+ missingDescriptions: g,
2297
+ drift: L
2295
2298
  }
2296
2299
  });
2297
2300
  } catch (n) {
@@ -2300,91 +2303,91 @@ async function Mt({
2300
2303
  a({ status: "error", message: l });
2301
2304
  }
2302
2305
  }
2303
- const Bt = { architecture: et }, St = { floating: st };
2304
- function Wt(t) {
2305
- return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(At, { ...t }) });
2306
+ const Dt = { architecture: rt }, Wt = { floating: dt };
2307
+ function zt(t) {
2308
+ return /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ft, { ...t }) });
2306
2309
  }
2307
- const Dt = (t) => ({
2310
+ const Et = (t) => ({
2308
2311
  version: 1,
2309
2312
  diagramId: t,
2310
2313
  updatedAt: "",
2311
2314
  nodes: {}
2312
2315
  });
2313
- function zt(t) {
2314
- var o, n, l, i;
2316
+ function At(t) {
2317
+ var o, n, l, s;
2315
2318
  const a = {};
2316
- for (const s of t) {
2319
+ for (const i of t) {
2317
2320
  const c = {
2318
- x: ((o = s.position) == null ? void 0 : o.x) ?? 0,
2319
- y: ((n = s.position) == null ? void 0 : n.y) ?? 0
2320
- }, h = s.width ?? ((l = s.style) == null ? void 0 : l.width), d = s.height ?? ((i = s.style) == null ? void 0 : i.height);
2321
- typeof h == "number" && Number.isFinite(h) && (c.width = h), typeof d == "number" && Number.isFinite(d) && (c.height = d), a[s.id] = c;
2321
+ x: ((o = i.position) == null ? void 0 : o.x) ?? 0,
2322
+ y: ((n = i.position) == null ? void 0 : n.y) ?? 0
2323
+ }, m = i.width ?? ((l = i.style) == null ? void 0 : l.width), d = i.height ?? ((s = i.style) == null ? void 0 : s.height);
2324
+ typeof m == "number" && Number.isFinite(m) && (c.width = m), typeof d == "number" && Number.isFinite(d) && (c.height = d), a[i.id] = c;
2322
2325
  }
2323
2326
  return a;
2324
2327
  }
2325
- function At({ diagramId: t, onSelectNode: a, onDrillIn: o }) {
2326
- const n = U(), l = wt(), i = n.diagrams[t], [s, c, h] = ze([]), [d, u, g] = Ae([]), [b, f] = L(!1), [x, w] = L(null), { getNodes: m } = Ee(), p = V(null), v = V(t);
2327
- v.current = t;
2328
- const N = V(n);
2329
- N.current = n, B(() => {
2330
- var K;
2331
- let S = !1;
2332
- f(!1), w(null), a(null);
2333
- const z = N.current, A = z.diagrams[t];
2334
- if (!A)
2335
- return w(`Diagram "${t}" was not loaded`), c([]), u([]), () => {
2336
- S = !0;
2328
+ function Ft({ diagramId: t, onSelectNode: a, onDrillIn: o }) {
2329
+ const n = V(), l = Ct(), s = n.diagrams[t], [i, c, m] = Ee([]), [d, h, p] = Ae([]), [b, f] = w(!1), [y, N] = w(null), { getNodes: u } = Fe(), g = U(null), L = U(t);
2330
+ L.current = t;
2331
+ const x = U(n);
2332
+ x.current = n, S(() => {
2333
+ var Z;
2334
+ let B = !1;
2335
+ f(!1), N(null), a(null);
2336
+ const z = x.current, E = z.diagrams[t];
2337
+ if (!E)
2338
+ return N(`Diagram "${t}" was not loaded`), c([]), h([]), () => {
2339
+ B = !0;
2337
2340
  };
2338
- const ye = z.layouts[t] ?? Dt(t), { nodes: ke, edges: Y } = dt(A);
2339
- return ft(ke, Y, (K = A.meta) == null ? void 0 : K.direction, ye).then((G) => {
2340
- S || (c(G), u(Y), requestAnimationFrame(() => !S && f(!0)));
2341
- }).catch((G) => {
2342
- S || w(G.message);
2341
+ const ke = z.layouts[t] ?? Et(t), { nodes: we, edges: X } = ut(E);
2342
+ return xt(we, X, (Z = E.meta) == null ? void 0 : Z.direction, ke).then((_) => {
2343
+ B || (c(_), h(X), requestAnimationFrame(() => !B && f(!0)));
2344
+ }).catch((_) => {
2345
+ B || N(_.message);
2343
2346
  }), () => {
2344
- S = !0, p.current && (clearTimeout(p.current), p.current = null);
2347
+ B = !0, g.current && (clearTimeout(g.current), g.current = null);
2345
2348
  };
2346
- }, [t, a, u, c]);
2347
- const y = C(() => {
2348
- const S = v.current, z = {
2349
- nodes: zt(m())
2349
+ }, [t, a, h, c]);
2350
+ const v = C(() => {
2351
+ const B = L.current, z = {
2352
+ nodes: At(u())
2350
2353
  };
2351
- l(S, z).catch((A) => {
2352
- console.warn("[tecture] failed to persist layout", A);
2354
+ l(B, z).catch((E) => {
2355
+ console.warn("[tecture] failed to persist layout", E);
2353
2356
  });
2354
- }, [m, l]), M = C(() => {
2355
- p.current && clearTimeout(p.current), p.current = setTimeout(() => {
2356
- p.current = null, y();
2357
+ }, [u, l]), M = C(() => {
2358
+ g.current && clearTimeout(g.current), g.current = setTimeout(() => {
2359
+ g.current = null, v();
2357
2360
  }, 150);
2358
- }, [y]), D = F(
2361
+ }, [v]), W = A(
2359
2362
  () => ({ notifyLayoutChanged: M }),
2360
2363
  [M]
2361
- ), $ = C(() => {
2364
+ ), I = C(() => {
2362
2365
  M();
2363
- }, [M]), xe = F(
2364
- () => (S, z) => {
2366
+ }, [M]), P = A(
2367
+ () => (B, z) => {
2365
2368
  a(z.id);
2366
2369
  },
2367
2370
  [a]
2368
- ), ve = F(
2369
- () => (S, z) => {
2370
- const A = z.data;
2371
- A.subDiagramId && o(A.subDiagramId);
2371
+ ), ye = A(
2372
+ () => (B, z) => {
2373
+ const E = z.data;
2374
+ E.subDiagramId && o(E.subDiagramId);
2372
2375
  },
2373
2376
  [o]
2374
2377
  );
2375
- return /* @__PURE__ */ e(me.Provider, { value: D, children: /* @__PURE__ */ r("div", { className: "relative h-full w-full", children: [
2378
+ return /* @__PURE__ */ e(he.Provider, { value: W, children: /* @__PURE__ */ r("div", { className: "relative h-full w-full", children: [
2376
2379
  /* @__PURE__ */ r(
2377
- Fe,
2380
+ Ie,
2378
2381
  {
2379
- nodes: s,
2382
+ nodes: i,
2380
2383
  edges: d,
2381
- nodeTypes: Bt,
2382
- edgeTypes: St,
2383
- onNodesChange: h,
2384
- onEdgesChange: g,
2385
- onNodeClick: xe,
2386
- onNodeDoubleClick: ve,
2387
- onNodeDragStop: $,
2384
+ nodeTypes: Dt,
2385
+ edgeTypes: Wt,
2386
+ onNodesChange: m,
2387
+ onEdgesChange: p,
2388
+ onNodeClick: P,
2389
+ onNodeDoubleClick: ye,
2390
+ onNodeDragStop: I,
2388
2391
  onPaneClick: () => a(null),
2389
2392
  fitView: !0,
2390
2393
  fitViewOptions: { padding: 0.2 },
@@ -2398,18 +2401,18 @@ function At({ diagramId: t, onSelectNode: a, onDrillIn: o }) {
2398
2401
  },
2399
2402
  children: [
2400
2403
  /* @__PURE__ */ e(
2401
- He,
2404
+ Pe,
2402
2405
  {
2403
- variant: Pe.Lines,
2406
+ variant: He.Lines,
2404
2407
  gap: 20,
2405
2408
  size: 1,
2406
2409
  color: "rgba(34, 78, 130, 0.12)"
2407
2410
  }
2408
2411
  ),
2409
2412
  /* @__PURE__ */ e(Te, { showInteractive: !1, position: "bottom-right" }),
2410
- i && /* @__PURE__ */ e(rt, { diagram: i }),
2413
+ s && /* @__PURE__ */ e(ot, { diagram: s }),
2411
2414
  /* @__PURE__ */ e(
2412
- Ie,
2415
+ je,
2413
2416
  {
2414
2417
  position: "bottom-left",
2415
2418
  pannable: !0,
@@ -2422,10 +2425,10 @@ function At({ diagramId: t, onSelectNode: a, onDrillIn: o }) {
2422
2425
  ]
2423
2426
  }
2424
2427
  ),
2425
- x && /* @__PURE__ */ e(Et, { label: `Error: ${x}` })
2428
+ y && /* @__PURE__ */ e(It, { label: `Error: ${y}` })
2426
2429
  ] }) });
2427
2430
  }
2428
- function Et({ label: t }) {
2431
+ function It({ label: t }) {
2429
2432
  return /* @__PURE__ */ e(
2430
2433
  "div",
2431
2434
  {
@@ -2438,13 +2441,13 @@ function Et({ label: t }) {
2438
2441
  }
2439
2442
  );
2440
2443
  }
2441
- function Ft({
2444
+ function Pt({
2442
2445
  summary: t,
2443
2446
  currentDiagramId: a,
2444
2447
  onSelect: o,
2445
2448
  onGoHome: n
2446
2449
  }) {
2447
- const [l, i] = L(!0), s = t != null && a === t.topDiagram;
2450
+ const [l, s] = w(!0), i = t != null && a === t.topDiagram;
2448
2451
  return /* @__PURE__ */ e("div", { className: "absolute top-3 left-3 z-10 w-64", children: /* @__PURE__ */ r(
2449
2452
  "div",
2450
2453
  {
@@ -2459,16 +2462,16 @@ function Ft({
2459
2462
  {
2460
2463
  type: "button",
2461
2464
  onClick: n,
2462
- disabled: s,
2465
+ disabled: i,
2463
2466
  className: "group flex w-full flex-col items-start gap-1 px-3 pt-2.5 pb-3 text-left transition-colors disabled:cursor-default",
2464
2467
  style: {
2465
2468
  background: "transparent",
2466
2469
  border: "none",
2467
2470
  borderBottom: "1px solid var(--border-default)",
2468
- cursor: s ? "default" : "pointer"
2471
+ cursor: i ? "default" : "pointer"
2469
2472
  },
2470
- title: s ? void 0 : "Return to entry diagram",
2471
- "aria-label": s ? "Architecture title block" : "Return to entry diagram",
2473
+ title: i ? void 0 : "Return to entry diagram",
2474
+ "aria-label": i ? "Architecture title block" : "Return to entry diagram",
2472
2475
  children: [
2473
2476
  /* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between", children: [
2474
2477
  /* @__PURE__ */ e(
@@ -2482,7 +2485,7 @@ function Ft({
2482
2485
  children: "Architecture"
2483
2486
  }
2484
2487
  ),
2485
- !s && /* @__PURE__ */ r(
2488
+ !i && /* @__PURE__ */ r(
2486
2489
  "span",
2487
2490
  {
2488
2491
  className: "flex items-center gap-1 text-[9px] tracking-[0.2em] uppercase opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",
@@ -2532,7 +2535,7 @@ function Ft({
2532
2535
  "button",
2533
2536
  {
2534
2537
  type: "button",
2535
- onClick: () => i((c) => !c),
2538
+ onClick: () => s((c) => !c),
2536
2539
  className: "flex w-full items-center justify-between px-3 py-2 transition-colors hover:text-white",
2537
2540
  style: {
2538
2541
  color: "var(--text-muted)",
@@ -2677,10 +2680,184 @@ function Ht({
2677
2680
  }
2678
2681
  ) });
2679
2682
  }
2680
- let le = !1;
2681
- async function Pt() {
2683
+ const H = {
2684
+ error: "#f87171",
2685
+ warn: "#fbbf24",
2686
+ info: "#38bdf8"
2687
+ }, Tt = {
2688
+ "missing-path": "Missing paths",
2689
+ "unverified-edge": "Unverified edges",
2690
+ "undeclared-dependency": "Undeclared dependencies",
2691
+ "unmapped-external": "Unmapped externals",
2692
+ "skipped-node": "Skipped nodes",
2693
+ "skipped-edge": "Skipped edges"
2694
+ }, jt = [
2695
+ "missing-path",
2696
+ "unverified-edge",
2697
+ "undeclared-dependency",
2698
+ "unmapped-external",
2699
+ "skipped-node",
2700
+ "skipped-edge"
2701
+ ];
2702
+ function Rt(t) {
2703
+ return t.summary.errors > 0 ? H.error : t.summary.warns > 0 ? H.warn : H.info;
2704
+ }
2705
+ function $t() {
2706
+ const t = V(), [a, o] = w(!1), n = t.drift, l = A(() => {
2707
+ if (!n) return [];
2708
+ const i = /* @__PURE__ */ new Map();
2709
+ for (const c of n.findings) {
2710
+ const m = i.get(c.kind) ?? [];
2711
+ m.push(c), i.set(c.kind, m);
2712
+ }
2713
+ return jt.filter((c) => i.has(c)).map((c) => ({
2714
+ kind: c,
2715
+ findings: i.get(c) ?? []
2716
+ }));
2717
+ }, [n]);
2718
+ if (!n || n.findings.length === 0) return null;
2719
+ const s = Rt(n);
2720
+ return /* @__PURE__ */ r(
2721
+ "div",
2722
+ {
2723
+ className: "absolute top-3 left-1/2 z-10 flex -translate-x-1/2 flex-col items-center",
2724
+ style: { fontFamily: "var(--font-mono)" },
2725
+ children: [
2726
+ /* @__PURE__ */ r(
2727
+ "button",
2728
+ {
2729
+ type: "button",
2730
+ onClick: () => o((i) => !i),
2731
+ "aria-expanded": a,
2732
+ className: "flex items-center gap-2 border px-3 py-1.5 text-[10px] tracking-[0.2em] uppercase shadow-lg backdrop-blur-md transition-colors hover:text-white",
2733
+ style: {
2734
+ backgroundColor: "rgba(10, 15, 26, 0.85)",
2735
+ borderColor: "var(--border-default)",
2736
+ color: s
2737
+ },
2738
+ title: "Code-vs-architecture drift findings from the evidence script",
2739
+ children: [
2740
+ /* @__PURE__ */ e(
2741
+ "span",
2742
+ {
2743
+ className: "inline-block h-1.5 w-1.5 rounded-full",
2744
+ style: { backgroundColor: s }
2745
+ }
2746
+ ),
2747
+ /* @__PURE__ */ r("span", { children: [
2748
+ "Drift: ",
2749
+ n.findings.length
2750
+ ] })
2751
+ ]
2752
+ }
2753
+ ),
2754
+ a && /* @__PURE__ */ r(
2755
+ "div",
2756
+ {
2757
+ className: "mt-2 flex flex-col overflow-y-auto border shadow-lg backdrop-blur-md",
2758
+ style: {
2759
+ width: "min(560px, calc(100vw - 24px))",
2760
+ maxHeight: "min(480px, calc(100vh - 96px))",
2761
+ backgroundColor: "rgba(10, 15, 26, 0.9)",
2762
+ borderColor: "var(--border-default)"
2763
+ },
2764
+ children: [
2765
+ /* @__PURE__ */ r(
2766
+ "div",
2767
+ {
2768
+ className: "flex items-center justify-between border-b px-4 py-2 text-[10px]",
2769
+ style: {
2770
+ borderColor: "var(--border-default)",
2771
+ color: "var(--text-muted)"
2772
+ },
2773
+ children: [
2774
+ /* @__PURE__ */ r("span", { children: [
2775
+ "generated ",
2776
+ Gt(n.generatedAt),
2777
+ " · codegraph schema v",
2778
+ n.codegraphSchemaVersion
2779
+ ] }),
2780
+ /* @__PURE__ */ r("span", { children: [
2781
+ n.summary.errors,
2782
+ " err / ",
2783
+ n.summary.warns,
2784
+ " warn /",
2785
+ " ",
2786
+ n.summary.infos,
2787
+ " info"
2788
+ ] })
2789
+ ]
2790
+ }
2791
+ ),
2792
+ n.staleIndex && /* @__PURE__ */ r(
2793
+ "div",
2794
+ {
2795
+ className: "border-b px-4 py-2 text-[11px]",
2796
+ style: {
2797
+ borderColor: "var(--border-default)",
2798
+ color: H.warn
2799
+ },
2800
+ children: [
2801
+ "Index may be stale — files changed after the last CodeGraph sync. Run ",
2802
+ /* @__PURE__ */ e("code", { children: "codegraph sync" }),
2803
+ " and re-run the evidence script."
2804
+ ]
2805
+ }
2806
+ ),
2807
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-3 px-4 py-3", children: l.map(({ kind: i, findings: c }) => /* @__PURE__ */ r("div", { className: "flex flex-col gap-1.5", children: [
2808
+ /* @__PURE__ */ r(
2809
+ "div",
2810
+ {
2811
+ className: "text-[9px] tracking-[0.25em] uppercase",
2812
+ style: { color: "var(--text-muted)" },
2813
+ children: [
2814
+ Tt[i],
2815
+ " (",
2816
+ c.length,
2817
+ ")"
2818
+ ]
2819
+ }
2820
+ ),
2821
+ c.map((m, d) => /* @__PURE__ */ e(Ot, { finding: m }, `${i}-${d}`))
2822
+ ] }, i)) })
2823
+ ]
2824
+ }
2825
+ )
2826
+ ]
2827
+ }
2828
+ );
2829
+ }
2830
+ function Ot({ finding: t }) {
2831
+ var n, l;
2832
+ const a = H[t.severity], o = t.nodeId ?? (t.edge ? `${t.edge.sourceId} → ${t.edge.targetId}` : (n = t.evidence) == null ? void 0 : n.package);
2833
+ return /* @__PURE__ */ r("div", { className: "flex items-start gap-2 text-[11px] leading-snug", children: [
2834
+ /* @__PURE__ */ e(
2835
+ "span",
2836
+ {
2837
+ className: "mt-1 inline-block h-1.5 w-1.5 shrink-0 rounded-full",
2838
+ style: { backgroundColor: a },
2839
+ title: t.severity
2840
+ }
2841
+ ),
2842
+ /* @__PURE__ */ r("span", { style: { color: "var(--text-primary, #e2e8f0)" }, children: [
2843
+ o ? /* @__PURE__ */ e("span", { className: "mr-1.5", style: { color: a }, children: o }) : null,
2844
+ t.message,
2845
+ (l = t.evidence) != null && l.edgeKinds ? /* @__PURE__ */ r("span", { className: "ml-1.5", style: { color: "var(--text-muted)" }, children: [
2846
+ "(",
2847
+ Object.entries(t.evidence.edgeKinds).map(([s, i]) => `${s}:${i}`).join(", "),
2848
+ ")"
2849
+ ] }) : null
2850
+ ] })
2851
+ ] });
2852
+ }
2853
+ function Gt(t) {
2854
+ const a = Date.parse(t);
2855
+ return Number.isNaN(a) ? t : new Date(a).toLocaleString();
2856
+ }
2857
+ let se = !1;
2858
+ async function Vt() {
2682
2859
  const a = (await import("mermaid")).default;
2683
- return le || (a.initialize({
2860
+ return se || (a.initialize({
2684
2861
  startOnLoad: !1,
2685
2862
  theme: "dark",
2686
2863
  securityLevel: "strict",
@@ -2715,27 +2892,27 @@ async function Pt() {
2715
2892
  noteBorderColor: "#854d0e",
2716
2893
  noteTextColor: "#fef3c7"
2717
2894
  }
2718
- }), le = !0), a;
2895
+ }), se = !0), a;
2719
2896
  }
2720
- function Tt({ chart: t }) {
2721
- const [a, o] = L({ status: "loading" }), [n, l] = L(!1), s = `mermaid-${Ne().replace(/:/g, "")}`;
2722
- return B(() => {
2897
+ function _t({ chart: t }) {
2898
+ const [a, o] = w({ status: "loading" }), [n, l] = w(!1), i = `mermaid-${Ce().replace(/:/g, "")}`;
2899
+ return S(() => {
2723
2900
  let c = !1;
2724
2901
  return o({ status: "loading" }), (async () => {
2725
2902
  try {
2726
- const h = await Pt();
2727
- await h.parse(t);
2728
- const { svg: d } = await h.render(s, t);
2903
+ const m = await Vt();
2904
+ await m.parse(t);
2905
+ const { svg: d } = await m.render(i, t);
2729
2906
  c || o({ status: "ready", svg: d });
2730
- } catch (h) {
2907
+ } catch (m) {
2731
2908
  if (c) return;
2732
- const d = h instanceof Error ? h.message : "Failed to render diagram";
2909
+ const d = m instanceof Error ? m.message : "Failed to render diagram";
2733
2910
  o({ status: "error", message: d });
2734
2911
  }
2735
2912
  })(), () => {
2736
2913
  c = !0;
2737
2914
  };
2738
- }, [t, s]), a.status === "loading" ? /* @__PURE__ */ e(
2915
+ }, [t, i]), a.status === "loading" ? /* @__PURE__ */ e(
2739
2916
  "div",
2740
2917
  {
2741
2918
  className: "mermaid-block",
@@ -2763,7 +2940,7 @@ function Tt({ chart: t }) {
2763
2940
  }
2764
2941
  ),
2765
2942
  /* @__PURE__ */ e("pre", { style: { margin: 0 }, children: /* @__PURE__ */ e("code", { className: "lang-mermaid", children: t }) })
2766
- ] }) : /* @__PURE__ */ r(H, { children: [
2943
+ ] }) : /* @__PURE__ */ r(T, { children: [
2767
2944
  /* @__PURE__ */ r("div", { className: "mermaid-block group relative", children: [
2768
2945
  /* @__PURE__ */ e(
2769
2946
  "button",
@@ -2809,14 +2986,14 @@ function Tt({ chart: t }) {
2809
2986
  }
2810
2987
  )
2811
2988
  ] }),
2812
- n && /* @__PURE__ */ e(It, { svg: a.svg, onClose: () => l(!1) })
2989
+ n && /* @__PURE__ */ e(Ut, { svg: a.svg, onClose: () => l(!1) })
2813
2990
  ] });
2814
2991
  }
2815
- function It({
2992
+ function Ut({
2816
2993
  svg: t,
2817
2994
  onClose: a
2818
2995
  }) {
2819
- return B(() => {
2996
+ return S(() => {
2820
2997
  const o = (l) => {
2821
2998
  l.key === "Escape" && a();
2822
2999
  };
@@ -2825,7 +3002,7 @@ function It({
2825
3002
  return document.body.style.overflow = "hidden", () => {
2826
3003
  document.removeEventListener("keydown", o), document.body.style.overflow = n;
2827
3004
  };
2828
- }, [a]), Ve(
3005
+ }, [a]), _e(
2829
3006
  /* @__PURE__ */ e(
2830
3007
  "div",
2831
3008
  {
@@ -2933,22 +3110,22 @@ function It({
2933
3110
  document.body
2934
3111
  );
2935
3112
  }
2936
- function jt({ source: t }) {
3113
+ function Kt({ source: t }) {
2937
3114
  return /* @__PURE__ */ e("div", { className: "prose-markdown", children: /* @__PURE__ */ e(
2938
- Ge,
3115
+ Ve,
2939
3116
  {
2940
3117
  options: {
2941
3118
  forceBlock: !0,
2942
3119
  overrides: {
2943
- pre: { component: $t },
2944
- a: { component: Rt }
3120
+ pre: { component: Xt },
3121
+ a: { component: Yt }
2945
3122
  }
2946
3123
  },
2947
3124
  children: t
2948
3125
  }
2949
3126
  ) });
2950
3127
  }
2951
- function Rt({
3128
+ function Yt({
2952
3129
  href: t,
2953
3130
  children: a,
2954
3131
  ...o
@@ -2964,23 +3141,23 @@ function Rt({
2964
3141
  }
2965
3142
  );
2966
3143
  }
2967
- function $t({ children: t }) {
2968
- const a = Gt(t);
2969
- return a !== null ? /* @__PURE__ */ e(Tt, { chart: a }) : /* @__PURE__ */ e("pre", { children: t });
3144
+ function Xt({ children: t }) {
3145
+ const a = Zt(t);
3146
+ return a !== null ? /* @__PURE__ */ e(_t, { chart: a }) : /* @__PURE__ */ e("pre", { children: t });
2970
3147
  }
2971
- function Gt(t) {
3148
+ function Zt(t) {
2972
3149
  const a = Array.isArray(t) && t.length === 1 ? t[0] : t;
2973
- if (!Ce(a)) return null;
3150
+ if (!Le(a)) return null;
2974
3151
  const o = a;
2975
3152
  if (o.type !== "code") return null;
2976
3153
  const n = o.props.className ?? "";
2977
3154
  if (!(n === "lang-mermaid" || n === "language-mermaid" || n.split(/\s+/).includes("lang-mermaid") || n.split(/\s+/).includes("language-mermaid"))) return null;
2978
- const i = o.props.children;
2979
- return typeof i == "string" ? i : Array.isArray(i) ? i.map((s) => String(s ?? "")).join("") : String(i ?? "");
3155
+ const s = o.props.children;
3156
+ return typeof s == "string" ? s : Array.isArray(s) ? s.map((i) => String(i ?? "")).join("") : String(s ?? "");
2980
3157
  }
2981
- function Vt({ nodeId: t, onClose: a }) {
2982
- var d, u;
2983
- const o = U(), n = Nt(), l = o.nodes[t], i = o.missingDescriptions.has(t), s = _((d = l == null ? void 0 : l.meta) == null ? void 0 : d.type), c = l == null ? void 0 : l.path, h = n ? void 0 : c ? Re(o.summary.source, o.summary.sourceHost, c) : void 0;
3158
+ function qt({ nodeId: t, onClose: a }) {
3159
+ var h, p;
3160
+ const o = V(), n = Lt(), l = o.nodes[t], s = o.missingDescriptions.has(t), i = o.drift && l ? $e(o.drift, l.diagramId, t) : [], c = Y((h = l == null ? void 0 : l.meta) == null ? void 0 : h.type), m = l == null ? void 0 : l.path, d = n ? void 0 : m ? Oe(o.summary.source, o.summary.sourceHost, m) : void 0;
2984
3161
  return /* @__PURE__ */ r(
2985
3162
  "aside",
2986
3163
  {
@@ -3003,8 +3180,8 @@ function Vt({ nodeId: t, onClose: a }) {
3003
3180
  "div",
3004
3181
  {
3005
3182
  className: "blueprint-annotation mb-1",
3006
- style: { color: s.accent },
3007
- children: s.label
3183
+ style: { color: c.accent },
3184
+ children: c.label
3008
3185
  }
3009
3186
  ),
3010
3187
  /* @__PURE__ */ e(
@@ -3015,7 +3192,7 @@ function Vt({ nodeId: t, onClose: a }) {
3015
3192
  children: (l == null ? void 0 : l.label) ?? t
3016
3193
  }
3017
3194
  ),
3018
- (u = l == null ? void 0 : l.meta) != null && u.technology ? /* @__PURE__ */ e(
3195
+ (p = l == null ? void 0 : l.meta) != null && p.technology ? /* @__PURE__ */ e(
3019
3196
  "div",
3020
3197
  {
3021
3198
  className: "mt-0.5 text-xs",
@@ -3023,21 +3200,21 @@ function Vt({ nodeId: t, onClose: a }) {
3023
3200
  children: String(l.meta.technology)
3024
3201
  }
3025
3202
  ) : null,
3026
- c || l && q(l) ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex w-full items-center gap-x-3", children: [
3027
- c ? /* @__PURE__ */ e(
3028
- Ot,
3203
+ m || l && J(l) ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex w-full items-center gap-x-3", children: [
3204
+ m ? /* @__PURE__ */ e(
3205
+ er,
3029
3206
  {
3030
- path: c,
3031
- accent: s.accent,
3032
- onOpenInEditor: n ? () => n(c) : void 0,
3033
- sourceUrl: h
3207
+ path: m,
3208
+ accent: c.accent,
3209
+ onOpenInEditor: n ? () => n(m) : void 0,
3210
+ sourceUrl: d
3034
3211
  }
3035
3212
  ) : null,
3036
- l && q(l) ? /* @__PURE__ */ e(
3037
- _t,
3213
+ l && J(l) ? /* @__PURE__ */ e(
3214
+ tr,
3038
3215
  {
3039
- prompt: $e(l),
3040
- accent: s.accent,
3216
+ prompt: Ge(l),
3217
+ accent: c.accent,
3041
3218
  className: "ml-auto"
3042
3219
  }
3043
3220
  ) : null
@@ -3079,15 +3256,65 @@ function Vt({ nodeId: t, onClose: a }) {
3079
3256
  ),
3080
3257
  /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4", children: [
3081
3258
  !l && /* @__PURE__ */ e("div", { className: "text-xs", style: { color: "var(--text-muted)" }, children: "No details available for this node." }),
3082
- l && i && /* @__PURE__ */ e("div", { className: "text-xs", style: { color: "var(--text-muted)" }, children: "Description not available." }),
3083
- l && !i && (l.description ? /* @__PURE__ */ e(jt, { source: l.description }) : /* @__PURE__ */ e("div", { className: "text-xs", style: { color: "var(--text-muted)" }, children: "No description provided." }))
3259
+ l && s && /* @__PURE__ */ e("div", { className: "text-xs", style: { color: "var(--text-muted)" }, children: "Description not available." }),
3260
+ l && !s && (l.description ? /* @__PURE__ */ e(Kt, { source: l.description }) : /* @__PURE__ */ e("div", { className: "text-xs", style: { color: "var(--text-muted)" }, children: "No description provided." })),
3261
+ i.length > 0 && /* @__PURE__ */ e(Jt, { findings: i })
3084
3262
  ] })
3085
3263
  ]
3086
3264
  }
3087
3265
  );
3088
3266
  }
3089
- const R = "inline-flex items-center gap-1.5 text-xs transition-opacity hover:opacity-80";
3090
- function O(t) {
3267
+ const Qt = {
3268
+ error: "#f87171",
3269
+ warn: "#fbbf24",
3270
+ info: "#38bdf8"
3271
+ };
3272
+ function Jt({ findings: t }) {
3273
+ return /* @__PURE__ */ r(
3274
+ "div",
3275
+ {
3276
+ className: "mt-4 border-t pt-3",
3277
+ style: { borderColor: "var(--border-default)" },
3278
+ children: [
3279
+ /* @__PURE__ */ r(
3280
+ "div",
3281
+ {
3282
+ className: "mb-2 text-[9px] tracking-[0.25em] uppercase",
3283
+ style: { color: "var(--text-muted)", fontFamily: "var(--font-mono)" },
3284
+ children: [
3285
+ "Evidence (",
3286
+ t.length,
3287
+ ")"
3288
+ ]
3289
+ }
3290
+ ),
3291
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-1.5", children: t.map((a, o) => /* @__PURE__ */ r(
3292
+ "div",
3293
+ {
3294
+ className: "flex items-start gap-2 text-[11px] leading-snug",
3295
+ style: { fontFamily: "var(--font-mono)" },
3296
+ children: [
3297
+ /* @__PURE__ */ e(
3298
+ "span",
3299
+ {
3300
+ className: "mt-1 inline-block h-1.5 w-1.5 shrink-0 rounded-full",
3301
+ style: {
3302
+ backgroundColor: Qt[a.severity]
3303
+ },
3304
+ title: a.severity
3305
+ }
3306
+ ),
3307
+ /* @__PURE__ */ e("span", { style: { color: "var(--text-primary, #e2e8f0)" }, children: a.message })
3308
+ ]
3309
+ },
3310
+ o
3311
+ )) })
3312
+ ]
3313
+ }
3314
+ );
3315
+ }
3316
+ const G = "inline-flex items-center gap-1.5 text-xs transition-opacity hover:opacity-80";
3317
+ function K(t) {
3091
3318
  return {
3092
3319
  color: t,
3093
3320
  fontFamily: "var(--font-mono)",
@@ -3097,13 +3324,13 @@ function O(t) {
3097
3324
  cursor: "pointer"
3098
3325
  };
3099
3326
  }
3100
- function Ot({
3327
+ function er({
3101
3328
  path: t,
3102
3329
  accent: a,
3103
3330
  onOpenInEditor: o,
3104
3331
  sourceUrl: n
3105
3332
  }) {
3106
- const l = t.endsWith("/"), i = /* @__PURE__ */ r(
3333
+ const l = t.endsWith("/"), s = /* @__PURE__ */ r(
3107
3334
  "svg",
3108
3335
  {
3109
3336
  width: "11",
@@ -3125,48 +3352,48 @@ function Ot({
3125
3352
  "button",
3126
3353
  {
3127
3354
  type: "button",
3128
- className: R,
3129
- style: O(a),
3355
+ className: G,
3356
+ style: K(a),
3130
3357
  onClick: o,
3131
3358
  title: t,
3132
3359
  children: [
3133
- i,
3360
+ s,
3134
3361
  /* @__PURE__ */ e("span", { children: l ? "Open folder" : "Open file" })
3135
3362
  ]
3136
3363
  }
3137
3364
  ) : n ? /* @__PURE__ */ r(
3138
3365
  "a",
3139
3366
  {
3140
- className: R,
3141
- style: O(a),
3367
+ className: G,
3368
+ style: K(a),
3142
3369
  href: n,
3143
3370
  target: "_blank",
3144
3371
  rel: "noreferrer",
3145
3372
  title: t,
3146
3373
  children: [
3147
- i,
3374
+ s,
3148
3375
  /* @__PURE__ */ e("span", { children: l ? "View folder" : "View file" })
3149
3376
  ]
3150
3377
  }
3151
3378
  ) : null;
3152
3379
  }
3153
- function _t({
3380
+ function tr({
3154
3381
  prompt: t,
3155
3382
  accent: a,
3156
3383
  className: o
3157
3384
  }) {
3158
- const [n, l] = L(!1), i = C(() => {
3159
- Ut(t).then((s) => {
3160
- s && (l(!0), window.setTimeout(() => l(!1), 1500));
3385
+ const [n, l] = w(!1), s = C(() => {
3386
+ rr(t).then((i) => {
3387
+ i && (l(!0), window.setTimeout(() => l(!1), 1500));
3161
3388
  });
3162
3389
  }, [t]);
3163
3390
  return /* @__PURE__ */ r(
3164
3391
  "button",
3165
3392
  {
3166
3393
  type: "button",
3167
- className: o ? `${R} ${o}` : R,
3168
- style: O(a),
3169
- onClick: i,
3394
+ className: o ? `${G} ${o}` : G,
3395
+ style: K(a),
3396
+ onClick: s,
3170
3397
  title: "Copy a prompt to enrich this component's description with a coding agent",
3171
3398
  children: [
3172
3399
  n ? /* @__PURE__ */ e(
@@ -3204,7 +3431,7 @@ function _t({
3204
3431
  }
3205
3432
  );
3206
3433
  }
3207
- async function Ut(t) {
3434
+ async function rr(t) {
3208
3435
  var a;
3209
3436
  try {
3210
3437
  if ((a = navigator.clipboard) != null && a.writeText)
@@ -3220,9 +3447,9 @@ async function Ut(t) {
3220
3447
  return !1;
3221
3448
  }
3222
3449
  }
3223
- function Yt() {
3224
- const [t, a] = L(!0);
3225
- return B(() => {
3450
+ function ar() {
3451
+ const [t, a] = w(!0);
3452
+ return S(() => {
3226
3453
  const o = setTimeout(() => a(!1), 3500);
3227
3454
  return () => clearTimeout(o);
3228
3455
  }, []), t ? /* @__PURE__ */ e(
@@ -3241,7 +3468,7 @@ function Yt() {
3241
3468
  }
3242
3469
  ) : null;
3243
3470
  }
3244
- function be({ className: t }) {
3471
+ function ve({ className: t }) {
3245
3472
  return /* @__PURE__ */ e("svg", { className: `ob-cursor ${t}`, viewBox: "0 0 24 24", "aria-hidden": !0, children: /* @__PURE__ */ e(
3246
3473
  "path",
3247
3474
  {
@@ -3253,7 +3480,7 @@ function be({ className: t }) {
3253
3480
  }
3254
3481
  ) });
3255
3482
  }
3256
- function W({
3483
+ function D({
3257
3484
  label: t,
3258
3485
  style: a,
3259
3486
  className: o = "",
@@ -3265,10 +3492,10 @@ function W({
3265
3492
  n
3266
3493
  ] });
3267
3494
  }
3268
- function Kt() {
3495
+ function or() {
3269
3496
  return /* @__PURE__ */ r("div", { className: "ob-stage blueprint-grid", children: [
3270
3497
  /* @__PURE__ */ e(
3271
- W,
3498
+ D,
3272
3499
  {
3273
3500
  label: "Service",
3274
3501
  className: "ob-click-target",
@@ -3276,7 +3503,7 @@ function Kt() {
3276
3503
  }
3277
3504
  ),
3278
3505
  /* @__PURE__ */ e(
3279
- W,
3506
+ D,
3280
3507
  {
3281
3508
  label: "Database",
3282
3509
  style: { left: "6%", top: "58%", width: "34%", height: "30%" }
@@ -3296,10 +3523,10 @@ function Kt() {
3296
3523
  /* @__PURE__ */ e("div", { className: "ob-line", style: { width: "58%" } }),
3297
3524
  /* @__PURE__ */ e("div", { className: "ob-line", style: { width: "82%" } })
3298
3525
  ] }),
3299
- /* @__PURE__ */ e(be, { className: "ob-click-cursor" })
3526
+ /* @__PURE__ */ e(ve, { className: "ob-click-cursor" })
3300
3527
  ] });
3301
3528
  }
3302
- function Xt() {
3529
+ function nr() {
3303
3530
  return /* @__PURE__ */ e(
3304
3531
  "svg",
3305
3532
  {
@@ -3316,59 +3543,59 @@ function Xt() {
3316
3543
  }
3317
3544
  );
3318
3545
  }
3319
- function Zt() {
3546
+ function lr() {
3320
3547
  return /* @__PURE__ */ r("div", { className: "ob-stage blueprint-grid", children: [
3321
3548
  /* @__PURE__ */ r("div", { className: "ob-level-1", children: [
3322
3549
  /* @__PURE__ */ e(
3323
- W,
3550
+ D,
3324
3551
  {
3325
3552
  label: "User",
3326
3553
  style: { left: "34%", top: "3%", width: "24%", height: "20%" }
3327
3554
  }
3328
3555
  ),
3329
3556
  /* @__PURE__ */ e(
3330
- W,
3557
+ D,
3331
3558
  {
3332
3559
  label: "Files",
3333
3560
  style: { left: "64%", top: "40%", width: "24%", height: "24%" }
3334
3561
  }
3335
3562
  ),
3336
3563
  /* @__PURE__ */ e(
3337
- W,
3564
+ D,
3338
3565
  {
3339
3566
  label: "Service",
3340
3567
  style: { left: "28%", top: "33%", width: "30%", height: "42%" },
3341
3568
  children: /* @__PURE__ */ r("span", { className: "ob-pill ob-drill-pill", children: [
3342
3569
  "Drill down",
3343
- /* @__PURE__ */ e(Xt, {})
3570
+ /* @__PURE__ */ e(nr, {})
3344
3571
  ] })
3345
3572
  }
3346
3573
  )
3347
3574
  ] }),
3348
3575
  /* @__PURE__ */ r("div", { className: "ob-level-2", children: [
3349
3576
  /* @__PURE__ */ e(
3350
- W,
3577
+ D,
3351
3578
  {
3352
3579
  label: "API",
3353
3580
  style: { left: "8%", top: "14%", width: "24%", height: "26%" }
3354
3581
  }
3355
3582
  ),
3356
3583
  /* @__PURE__ */ e(
3357
- W,
3584
+ D,
3358
3585
  {
3359
3586
  label: "Router",
3360
3587
  style: { left: "40%", top: "8%", width: "24%", height: "26%" }
3361
3588
  }
3362
3589
  ),
3363
3590
  /* @__PURE__ */ e(
3364
- W,
3591
+ D,
3365
3592
  {
3366
3593
  label: "Store",
3367
3594
  style: { left: "20%", top: "56%", width: "24%", height: "26%" }
3368
3595
  }
3369
3596
  ),
3370
3597
  /* @__PURE__ */ e(
3371
- W,
3598
+ D,
3372
3599
  {
3373
3600
  label: "Worker",
3374
3601
  style: { left: "54%", top: "52%", width: "28%", height: "28%" }
@@ -3382,51 +3609,51 @@ function Zt() {
3382
3609
  style: { left: "43%", top: "64%" }
3383
3610
  }
3384
3611
  ),
3385
- /* @__PURE__ */ e(be, { className: "ob-drill-cursor" })
3612
+ /* @__PURE__ */ e(ve, { className: "ob-drill-cursor" })
3386
3613
  ] });
3387
3614
  }
3388
- function qt({
3615
+ function ir({
3389
3616
  open: t,
3390
3617
  onClose: a,
3391
3618
  architectureName: o,
3392
3619
  architectureDescription: n
3393
3620
  }) {
3394
3621
  var b;
3395
- const [l, i] = L(0);
3396
- B(() => {
3397
- t && i(0);
3622
+ const [l, s] = w(0);
3623
+ S(() => {
3624
+ t && s(0);
3398
3625
  }, [t]);
3399
- const s = (b = (n ?? "").split(/\n\s*\n/)[0]) == null ? void 0 : b.trim(), c = [
3626
+ const i = (b = (n ?? "").split(/\n\s*\n/)[0]) == null ? void 0 : b.trim(), c = [
3400
3627
  {
3401
3628
  eyebrow: "Architecture",
3402
3629
  title: o,
3403
- blurb: s || "An interactive map of this system — its components and how they connect.",
3404
- media: /* @__PURE__ */ e(Qt, { name: o })
3630
+ blurb: i || "An interactive map of this system — its components and how they connect.",
3631
+ media: /* @__PURE__ */ e(sr, { name: o })
3405
3632
  },
3406
3633
  {
3407
3634
  eyebrow: "Tip · 1 of 2",
3408
3635
  title: "Click a component",
3409
3636
  blurb: "Click any box to open its details — the technology it uses, its source files, and a full description.",
3410
- media: /* @__PURE__ */ e(Kt, {})
3637
+ media: /* @__PURE__ */ e(or, {})
3411
3638
  },
3412
3639
  {
3413
3640
  eyebrow: "Tip · 2 of 2",
3414
3641
  title: "Drill down for more",
3415
3642
  blurb: "Boxes with a “Drill down” button go deeper — double-click one to open its sub-diagram and explore the next level.",
3416
- media: /* @__PURE__ */ e(Zt, {})
3643
+ media: /* @__PURE__ */ e(lr, {})
3417
3644
  }
3418
- ], h = c.length - 1, d = C(() => {
3419
- i((f) => f >= c.length - 1 ? (a(), f) : f + 1);
3420
- }, [c.length, a]), u = C(() => i((f) => Math.max(0, f - 1)), []);
3421
- B(() => {
3645
+ ], m = c.length - 1, d = C(() => {
3646
+ s((f) => f >= c.length - 1 ? (a(), f) : f + 1);
3647
+ }, [c.length, a]), h = C(() => s((f) => Math.max(0, f - 1)), []);
3648
+ S(() => {
3422
3649
  if (!t) return;
3423
- const f = (x) => {
3424
- x.key === "Escape" ? a() : x.key === "ArrowRight" ? d() : x.key === "ArrowLeft" && u();
3650
+ const f = (y) => {
3651
+ y.key === "Escape" ? a() : y.key === "ArrowRight" ? d() : y.key === "ArrowLeft" && h();
3425
3652
  };
3426
3653
  return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
3427
- }, [t, a, d, u]);
3428
- const g = c[l] ?? c[0];
3429
- return !t || !g ? null : /* @__PURE__ */ e(
3654
+ }, [t, a, d, h]);
3655
+ const p = c[l] ?? c[0];
3656
+ return !t || !p ? null : /* @__PURE__ */ e(
3430
3657
  "div",
3431
3658
  {
3432
3659
  className: "absolute inset-0 z-50 flex items-center justify-center",
@@ -3460,7 +3687,7 @@ function qt({
3460
3687
  color: "var(--text-muted)",
3461
3688
  fontFamily: "var(--font-mono)"
3462
3689
  },
3463
- children: g.eyebrow
3690
+ children: p.eyebrow
3464
3691
  }
3465
3692
  ),
3466
3693
  /* @__PURE__ */ e(
@@ -3472,7 +3699,7 @@ function qt({
3472
3699
  color: "var(--text-primary)",
3473
3700
  fontFamily: "var(--font-sans)"
3474
3701
  },
3475
- children: g.title
3702
+ children: p.title
3476
3703
  }
3477
3704
  )
3478
3705
  ] }),
@@ -3518,7 +3745,7 @@ function qt({
3518
3745
  borderColor: "var(--border-default)",
3519
3746
  backgroundColor: "var(--bg-deep)"
3520
3747
  },
3521
- children: g.media
3748
+ children: p.media
3522
3749
  }
3523
3750
  ),
3524
3751
  /* @__PURE__ */ e(
@@ -3529,7 +3756,7 @@ function qt({
3529
3756
  color: "var(--text-secondary)",
3530
3757
  fontFamily: "var(--font-sans)"
3531
3758
  },
3532
- children: g.blurb
3759
+ children: p.blurb
3533
3760
  }
3534
3761
  ),
3535
3762
  /* @__PURE__ */ r(
@@ -3538,13 +3765,13 @@ function qt({
3538
3765
  className: "flex items-center justify-between border-t px-6 py-4",
3539
3766
  style: { borderColor: "var(--border-default)" },
3540
3767
  children: [
3541
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: c.map((f, x) => /* @__PURE__ */ e(
3768
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: c.map((f, y) => /* @__PURE__ */ e(
3542
3769
  "span",
3543
3770
  {
3544
3771
  className: "h-1.5 rounded-full transition-all",
3545
3772
  style: {
3546
- width: x === l ? "18px" : "6px",
3547
- backgroundColor: x === l ? "var(--accent-cyan)" : "var(--border-default)"
3773
+ width: y === l ? "18px" : "6px",
3774
+ backgroundColor: y === l ? "var(--accent-cyan)" : "var(--border-default)"
3548
3775
  }
3549
3776
  },
3550
3777
  f.title
@@ -3554,7 +3781,7 @@ function qt({
3554
3781
  "button",
3555
3782
  {
3556
3783
  type: "button",
3557
- onClick: u,
3784
+ onClick: h,
3558
3785
  className: "border px-3 py-1.5 text-[10px] tracking-[0.2em] uppercase transition-colors hover:text-white",
3559
3786
  style: {
3560
3787
  borderColor: "var(--border-default)",
@@ -3577,7 +3804,7 @@ function qt({
3577
3804
  fontFamily: "var(--font-mono)",
3578
3805
  backgroundColor: "transparent"
3579
3806
  },
3580
- children: l === h ? "Got it" : "Next"
3807
+ children: l === m ? "Got it" : "Next"
3581
3808
  }
3582
3809
  )
3583
3810
  ] })
@@ -3590,7 +3817,7 @@ function qt({
3590
3817
  }
3591
3818
  );
3592
3819
  }
3593
- function Qt({ name: t }) {
3820
+ function sr({ name: t }) {
3594
3821
  return /* @__PURE__ */ r("div", { className: "ob-stage blueprint-grid flex flex-col items-center justify-center text-center", children: [
3595
3822
  /* @__PURE__ */ e(
3596
3823
  "div",
@@ -3618,31 +3845,31 @@ function Qt({ name: t }) {
3618
3845
  )
3619
3846
  ] });
3620
3847
  }
3621
- function Jt() {
3622
- const [t, a] = L(!0), o = C(() => a(!0), []), n = C(() => a(!1), []);
3848
+ function cr() {
3849
+ const [t, a] = w(!0), o = C(() => a(!0), []), n = C(() => a(!1), []);
3623
3850
  return { open: t, openWizard: o, closeWizard: n };
3624
3851
  }
3625
- let ie = null;
3626
- function er({ diagramId: t, showDiagramList: a = !0 }) {
3627
- const o = U(), n = Ct(), [l, i] = L(null), s = Jt();
3628
- B(() => {
3852
+ let ce = null;
3853
+ function dr({ diagramId: t, showDiagramList: a = !0 }) {
3854
+ const o = V(), n = Mt(), [l, s] = w(null), i = cr();
3855
+ S(() => {
3629
3856
  t || (window.location.hash = `#/diagram/${o.summary.topDiagram}`);
3630
- }, [t, o.summary.topDiagram]), B(() => {
3631
- var u;
3632
- if (!t || t === ie) return;
3633
- ie = t;
3634
- const d = (u = o.summary.diagrams.find(
3635
- (g) => g.slug === t
3636
- )) == null ? void 0 : u.level;
3857
+ }, [t, o.summary.topDiagram]), S(() => {
3858
+ var h;
3859
+ if (!t || t === ce) return;
3860
+ ce = t;
3861
+ const d = (h = o.summary.diagrams.find(
3862
+ (p) => p.slug === t
3863
+ )) == null ? void 0 : h.level;
3637
3864
  n("diagram.viewed", typeof d == "number" ? { level: d } : {});
3638
3865
  }, [t, o.summary.diagrams, n]);
3639
3866
  const c = C(
3640
3867
  (d) => {
3641
- i(d), d && n("node.inspected");
3868
+ s(d), d && n("node.inspected");
3642
3869
  },
3643
3870
  [n]
3644
- ), h = C((d) => {
3645
- i(null), window.location.hash = `#/diagram/${d}`;
3871
+ ), m = C((d) => {
3872
+ s(null), window.location.hash = `#/diagram/${d}`;
3646
3873
  }, []);
3647
3874
  return /* @__PURE__ */ r(
3648
3875
  "div",
@@ -3651,38 +3878,39 @@ function er({ diagramId: t, showDiagramList: a = !0 }) {
3651
3878
  style: { backgroundColor: "var(--bg-deep)" },
3652
3879
  children: [
3653
3880
  t ? /* @__PURE__ */ e(
3654
- Wt,
3881
+ zt,
3655
3882
  {
3656
3883
  diagramId: t,
3657
3884
  onSelectNode: c,
3658
- onDrillIn: h
3885
+ onDrillIn: m
3659
3886
  },
3660
3887
  t
3661
- ) : /* @__PURE__ */ e(rr, { message: "Opening top diagram…" }),
3888
+ ) : /* @__PURE__ */ e(ur, { message: "Opening top diagram…" }),
3662
3889
  a && /* @__PURE__ */ e(
3663
- Ft,
3890
+ Pt,
3664
3891
  {
3665
3892
  summary: o.summary,
3666
3893
  currentDiagramId: t,
3667
- onSelect: h,
3668
- onGoHome: () => h(o.summary.topDiagram)
3894
+ onSelect: m,
3895
+ onGoHome: () => m(o.summary.topDiagram)
3669
3896
  }
3670
3897
  ),
3671
- /* @__PURE__ */ e(Yt, {}),
3898
+ /* @__PURE__ */ e(ar, {}),
3899
+ /* @__PURE__ */ e($t, {}),
3672
3900
  l && /* @__PURE__ */ e(
3673
- Vt,
3901
+ qt,
3674
3902
  {
3675
3903
  nodeId: l,
3676
- onClose: () => i(null)
3904
+ onClose: () => s(null)
3677
3905
  },
3678
3906
  l
3679
3907
  ),
3680
- /* @__PURE__ */ e(tr, { onClick: s.openWizard }),
3908
+ /* @__PURE__ */ e(mr, { onClick: i.openWizard }),
3681
3909
  /* @__PURE__ */ e(
3682
- qt,
3910
+ ir,
3683
3911
  {
3684
- open: s.open,
3685
- onClose: s.closeWizard,
3912
+ open: i.open,
3913
+ onClose: i.closeWizard,
3686
3914
  architectureName: o.summary.name,
3687
3915
  architectureDescription: o.summary.description
3688
3916
  }
@@ -3691,7 +3919,7 @@ function er({ diagramId: t, showDiagramList: a = !0 }) {
3691
3919
  }
3692
3920
  );
3693
3921
  }
3694
- function tr({ onClick: t }) {
3922
+ function mr({ onClick: t }) {
3695
3923
  return /* @__PURE__ */ e(
3696
3924
  "button",
3697
3925
  {
@@ -3729,7 +3957,7 @@ function tr({ onClick: t }) {
3729
3957
  }
3730
3958
  );
3731
3959
  }
3732
- function rr({ message: t }) {
3960
+ function ur({ message: t }) {
3733
3961
  return /* @__PURE__ */ e(
3734
3962
  "div",
3735
3963
  {
@@ -3742,22 +3970,22 @@ function rr({ message: t }) {
3742
3970
  }
3743
3971
  );
3744
3972
  }
3745
- function ar() {
3746
- const [t, a] = L(() => window.location.hash);
3747
- return B(() => {
3973
+ function hr() {
3974
+ const [t, a] = w(() => window.location.hash);
3975
+ return S(() => {
3748
3976
  const o = () => a(window.location.hash);
3749
3977
  return window.addEventListener("hashchange", o), () => window.removeEventListener("hashchange", o);
3750
3978
  }, []), t;
3751
3979
  }
3752
- function or(t) {
3980
+ function pr(t) {
3753
3981
  if (t === "#/style-guide") return { view: "style-guide", diagramId: null };
3754
3982
  const a = t.match(/^#\/diagram\/([^/?#]+)/);
3755
3983
  return a ? { view: "architecture", diagramId: decodeURIComponent(a[1]) } : { view: "architecture", diagramId: null };
3756
3984
  }
3757
- function ur({ dataSource: t, reloadKey: a, showDiagramList: o = !0 }) {
3758
- const n = ar(), l = or(n);
3759
- return l.view === "style-guide" ? /* @__PURE__ */ e(_e, {}) : /* @__PURE__ */ e(Lt, { dataSource: t, reloadKey: a, children: /* @__PURE__ */ e(
3760
- er,
3985
+ function wr({ dataSource: t, reloadKey: a, showDiagramList: o = !0 }) {
3986
+ const n = hr(), l = pr(n);
3987
+ return l.view === "style-guide" ? /* @__PURE__ */ e(Ke, {}) : /* @__PURE__ */ e(St, { dataSource: t, reloadKey: a, children: /* @__PURE__ */ e(
3988
+ dr,
3761
3989
  {
3762
3990
  diagramId: l.diagramId,
3763
3991
  showDiagramList: o
@@ -3765,6 +3993,6 @@ function ur({ dataSource: t, reloadKey: a, showDiagramList: o = !0 }) {
3765
3993
  ) });
3766
3994
  }
3767
3995
  export {
3768
- ur as App
3996
+ wr as App
3769
3997
  };
3770
3998
  //# sourceMappingURL=App.js.map