@omg-dev/app 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist-lib/{ChangelogPage-BzsTWlhq.js → ChangelogPage-Cjj_DiYL.js} +33 -1
  2. package/dist-lib/{File-B-qYa2zY.js → File-DQRr5F_e.js} +1761 -1826
  3. package/dist-lib/FileEditor-BrI3dfcp.js +6895 -0
  4. package/dist-lib/FileTreePane-J8P-OiHb.js +8413 -0
  5. package/dist-lib/{FileViewer-Clmf04v1.js → FileViewer-DRrfus7c.js} +1 -1
  6. package/dist-lib/{SessionFilesPanel-K4lGGdJ4.js → SessionFilesPanel-DxVJ43fE.js} +69 -69
  7. package/dist-lib/{TermView-CWr-zJmM.js → TermView-B4V-DyD-.js} +521 -530
  8. package/dist-lib/{abnfDiagram-VRR7QNED-Chn1Z_p9.js → abnfDiagram-VRR7QNED-CiXfOnAu.js} +4 -4
  9. package/dist-lib/{arc-B652oHQ-.js → arc-QOMNKQA5.js} +1 -1
  10. package/dist-lib/{architectureDiagram-ZJ3FMSHR-CMatArpz.js → architectureDiagram-ZJ3FMSHR-BcFBTmfD.js} +2059 -2064
  11. package/dist-lib/{blockDiagram-677ZJIJ3-CEOPfI9A.js → blockDiagram-677ZJIJ3-Qj8-RIV3.js} +920 -925
  12. package/dist-lib/{c4Diagram-LMCZKHZV-DcUHrESL.js → c4Diagram-LMCZKHZV-BpinEmj4.js} +598 -593
  13. package/dist-lib/{channel-B5lJFbed.js → channel-D6YHMmF7.js} +1 -1
  14. package/dist-lib/{chat-engine-P0yDhFOX.js → chat-engine-CUiDTHFP.js} +1173 -1218
  15. package/dist-lib/chunk-2Q5K7J3B-CFSi414U.js +18 -0
  16. package/dist-lib/{chunk-32BRIVSS-IYmNSvH8.js → chunk-32BRIVSS-DvywQiCk.js} +1 -1
  17. package/dist-lib/{chunk-5VM5RSS4-DO2g-xIj.js → chunk-5VM5RSS4-xd6XuI9Q.js} +1 -1
  18. package/dist-lib/{chunk-BO2N2NFS-kYiI5SD9.js → chunk-BO2N2NFS-BbJdm-59.js} +4892 -4903
  19. package/dist-lib/{chunk-EX3LRPZG-N96wfks9.js → chunk-EX3LRPZG-BLDKx-Yg.js} +507 -514
  20. package/dist-lib/chunk-JWPE2WC7-DnwG7Xzp.js +8 -0
  21. package/dist-lib/chunk-MOJQB5TN-BrENeFT5.js +670 -0
  22. package/dist-lib/chunk-RYQCIY6F-I-J4fVFd.js +313 -0
  23. package/dist-lib/{chunk-V7JOEXUC-DQwf2vkP.js → chunk-V7JOEXUC-Bkakcs1-.js} +458 -453
  24. package/dist-lib/chunk-VR4S4FIN-BDq3jZ0m.js +19 -0
  25. package/dist-lib/{chunk-XXDRQBXY-Ccv4aRcn.js → chunk-XXDRQBXY-DRKeYnrF.js} +1 -1
  26. package/dist-lib/{classDiagram-v2-EOCWNBFH-DOn-rhuL.js → classDiagram-OUVF2IWQ-DISUfvR5.js} +2 -2
  27. package/dist-lib/{classDiagram-OUVF2IWQ-DOn-rhuL.js → classDiagram-v2-EOCWNBFH-DISUfvR5.js} +2 -2
  28. package/dist-lib/{coding-agents-page-DCafIpWL.js → coding-agents-page-DtxZ0nbQ.js} +152 -131
  29. package/dist-lib/computer-page-DIJeFOZz.js +8860 -0
  30. package/dist-lib/{cose-bilkent-JH36ORCC-C-tACTrT.js → cose-bilkent-JH36ORCC-DCfmoChv.js} +281 -281
  31. package/dist-lib/{create-BrnHvSDE.js → create-CBk9uwJH.js} +2 -2
  32. package/dist-lib/cynefin-VYW2F7L2-XAY3mHv8.js +24430 -0
  33. package/dist-lib/{cynefinDiagram-TSTJHNR4-Be7CamD2.js → cynefinDiagram-TSTJHNR4-CrgvPEr1.js} +3 -3
  34. package/dist-lib/{cytoscape.esm-B0ledd6M.js → cytoscape.esm-BB6Ga9He.js} +3 -3
  35. package/dist-lib/dagre-VKFMJZFB-CE5k06mJ.js +343 -0
  36. package/dist-lib/{diagram-FQU43EPY-Jg12ow4Z.js → diagram-FQU43EPY-gOcCiJEN.js} +136 -139
  37. package/dist-lib/diagram-G47NLZAW-BVJLfRsd.js +531 -0
  38. package/dist-lib/diagram-NH7WQ7WH-u6QnHasL.js +145 -0
  39. package/dist-lib/diagram-OA4YK3LP-D4Kcl3uM.js +350 -0
  40. package/dist-lib/{diagram-WEI45ONY-D1kKPOc_.js → diagram-WEI45ONY-6a__oIb0.js} +38 -42
  41. package/dist-lib/{ebnfDiagram-CCIWWBDH-BhQWrGMc.js → ebnfDiagram-CCIWWBDH-PXSrB6lG.js} +4 -4
  42. package/dist-lib/{embedded-CLYU5z7h.js → embedded-PUsgcSTE.js} +10592 -10725
  43. package/dist-lib/{engine-compile-BeDRSL6Y.js → engine-compile-D_stzVMa.js} +2939 -2991
  44. package/dist-lib/{erDiagram-Q63AITRT-D2q6Nmwa.js → erDiagram-Q63AITRT-BbsttUCs.js} +286 -284
  45. package/dist-lib/flowDiagram-23GEKE2U-CX5x3zVA.js +1641 -0
  46. package/dist-lib/{ganttDiagram-NO4QXBWP-C_Lj-cJB.js → ganttDiagram-NO4QXBWP-Bq0aSPs8.js} +2 -2
  47. package/dist-lib/gitGraphDiagram-IHSO6WYX-BjAezjIv.js +815 -0
  48. package/dist-lib/{graph-B68L3K2T.js → graph-DAHC4kPm.js} +2 -2
  49. package/dist-lib/{highlighted-body-OFNGDK62-C2DGVKV8.js → highlighted-body-OFNGDK62-DWhG_ijx.js} +1 -1
  50. package/dist-lib/index-B0neMIbR.js +16520 -0
  51. package/dist-lib/index-BBC0E3Qg.js +4994 -0
  52. package/dist-lib/{index-Dtkd4mEk.js → index-CE7H8LiZ.js} +2 -2
  53. package/dist-lib/{index-DWkBvb-9.js → index-FgVvPpIY.js} +2 -2
  54. package/dist-lib/index.js +1 -1
  55. package/dist-lib/{infoDiagram-FWYZ7A6U-BbUkT0KS.js → infoDiagram-FWYZ7A6U-Bo_FNR91.js} +2 -2
  56. package/dist-lib/ishikawaDiagram-FXEZZL3T-C5bGD-Eb.js +624 -0
  57. package/dist-lib/{journeyDiagram-5HDEW3XC-CgykmVSC.js → journeyDiagram-5HDEW3XC-C8qM7SxF.js} +4 -4
  58. package/dist-lib/kanban-definition-HUTT4EX6-C-EK5Puz.js +724 -0
  59. package/dist-lib/{katex-jHfnQmlp.js → katex-DoRnZ_sp.js} +1 -1
  60. package/dist-lib/{layout-BGrtsiRL.js → layout-DBbo_M5I.js} +2 -2
  61. package/dist-lib/{linear-B5ZSwawJ.js → linear-zGzX0-I0.js} +1 -1
  62. package/dist-lib/{map-hbfFlSln.js → map-DRdzG8Ho.js} +1 -1
  63. package/dist-lib/mermaid-GHXKKRXX-hOE9C3qW.js +4 -0
  64. package/dist-lib/{mindmap-definition-LN4V7U3C-CfhfeEht.js → mindmap-definition-LN4V7U3C-DlVCRx6k.js} +310 -311
  65. package/dist-lib/{pegDiagram-2B236MQR-CYDAJHPF.js → pegDiagram-2B236MQR-DrKNikeG.js} +4 -4
  66. package/dist-lib/{pieDiagram-ENE6RG2P-udKxQm4p.js → pieDiagram-ENE6RG2P-Fm_jc0HL.js} +83 -84
  67. package/dist-lib/quadrantDiagram-ABIIQ3AL-zDRY0VtB.js +1029 -0
  68. package/dist-lib/{railroadDiagram-RFXS5EU6-q0Svkmuy.js → railroadDiagram-RFXS5EU6-BQuFX39y.js} +4 -4
  69. package/dist-lib/{requirementDiagram-TGXJPOKE-tNxRI1gc.js → requirementDiagram-TGXJPOKE-BWwBQZXn.js} +269 -268
  70. package/dist-lib/{resume-session-sheet-CHwpwguS.js → resume-session-sheet-DTe_2QtJ.js} +2 -3
  71. package/dist-lib/sankeyDiagram-HTMAVEWB-BjRyuB6L.js +859 -0
  72. package/dist-lib/{sequenceDiagram-DBY2YBRQ-Dvl2_CXL.js → sequenceDiagram-DBY2YBRQ-69pcw_2M.js} +892 -899
  73. package/dist-lib/{session-token-usage-BUz6b-IB.js → session-token-usage-DY4vFlfs.js} +82 -83
  74. package/dist-lib/{shadow-text-size-CBCTdbYU.js → shadow-text-size-smWA4wIU.js} +1 -2
  75. package/dist-lib/{shipped-page-CXy85bsL.js → shipped-page-B-ruG8li.js} +233 -236
  76. package/dist-lib/sizeCapture-X5ZJPWSS-DqkV8s1N.js +46 -0
  77. package/dist-lib/{stateDiagram-2N3HPSRC-CnWB7HvU.js → stateDiagram-2N3HPSRC-0vE3REl_.js} +4 -4
  78. package/dist-lib/{stateDiagram-v2-6OUMAXLB-DnZ0UI2p.js → stateDiagram-v2-6OUMAXLB-u_56Obsh.js} +2 -2
  79. package/dist-lib/{streamdown-response-CUB9sK6V.js → streamdown-response-BQy3geXs.js} +290 -297
  80. package/dist-lib/styles.css +1 -1
  81. package/dist-lib/swimlanes-5IMT3BWC-H0raIBd1.js +5332 -0
  82. package/dist-lib/{swimlanesDiagram-G3AALYLV-CKyOeqF_.js → swimlanesDiagram-G3AALYLV-By52HaDu.js} +2 -2
  83. package/dist-lib/timeline-definition-FHXFAJF6-h1LLYUQk.js +1055 -0
  84. package/dist-lib/vennDiagram-L72KCM5P-B4wDw_Kh.js +1578 -0
  85. package/dist-lib/wardleyDiagram-EHGQE667-DLMBGiwD.js +678 -0
  86. package/dist-lib/{xychartDiagram-FW5EYKEG-m3s7caPv.js → xychartDiagram-FW5EYKEG-BHvf5Noj.js} +526 -496
  87. package/package.json +4 -3
  88. package/dist-lib/FileEditor-BIz0qCyW.js +0 -6892
  89. package/dist-lib/FileTreePane-BG2k7gTc.js +0 -8422
  90. package/dist-lib/chunk-2Q5K7J3B-Ex8Ly28R.js +0 -15
  91. package/dist-lib/chunk-JWPE2WC7-DFPBClX_.js +0 -9
  92. package/dist-lib/chunk-MOJQB5TN-dusfI9ob.js +0 -664
  93. package/dist-lib/chunk-RYQCIY6F-fkeERzIG.js +0 -315
  94. package/dist-lib/chunk-VR4S4FIN-hOZG7eF3.js +0 -20
  95. package/dist-lib/cynefin-VYW2F7L2-DQXPWaog.js +0 -23853
  96. package/dist-lib/dagre-VKFMJZFB-BhCjK7XQ.js +0 -346
  97. package/dist-lib/diagram-G47NLZAW-C3_z2t6T.js +0 -530
  98. package/dist-lib/diagram-NH7WQ7WH-DUdK08IT.js +0 -143
  99. package/dist-lib/diagram-OA4YK3LP-TUUyRYY3.js +0 -353
  100. package/dist-lib/flowDiagram-23GEKE2U-DU3S3biU.js +0 -1645
  101. package/dist-lib/gitGraphDiagram-IHSO6WYX-CvGu0XAR.js +0 -828
  102. package/dist-lib/index-DcwavxA1.js +0 -5062
  103. package/dist-lib/index-JkCQXUYs.js +0 -16566
  104. package/dist-lib/ishikawaDiagram-FXEZZL3T-D_Y6Tuyb.js +0 -622
  105. package/dist-lib/kanban-definition-HUTT4EX6-CPFLTskY.js +0 -726
  106. package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +0 -4
  107. package/dist-lib/quadrantDiagram-ABIIQ3AL-BmDmLczk.js +0 -1025
  108. package/dist-lib/sankeyDiagram-HTMAVEWB-B9Bl7f2P.js +0 -847
  109. package/dist-lib/sizeCapture-X5ZJPWSS-B1EeO3N9.js +0 -47
  110. package/dist-lib/swimlanes-5IMT3BWC-CvqDJcS9.js +0 -5353
  111. package/dist-lib/timeline-definition-FHXFAJF6-b15X0Oru.js +0 -1066
  112. package/dist-lib/vennDiagram-L72KCM5P-C4lh5m77.js +0 -1585
  113. package/dist-lib/wardleyDiagram-EHGQE667-Cev6fT_D.js +0 -684
@@ -1,6 +1,6 @@
1
- import { p as xt } from "./chunk-JWPE2WC7-DFPBClX_.js";
2
- import { s as gt, g as $t, p as bt, o as wt, a as Ct, b as vt, _ as s, l as O, F as Dt, e as kt, q as Tt, B as U, z as Q, D as At, W as ot } from "./index-JkCQXUYs.js";
3
- import { p as Bt } from "./cynefin-VYW2F7L2-DQXPWaog.js";
1
+ import { p as xt } from "./chunk-JWPE2WC7-DnwG7Xzp.js";
2
+ import { s as gt, g as $t, p as bt, o as wt, a as Ct, b as vt, _ as s, l as O, F as Dt, e as kt, q as Tt, B as U, z as Q, D as At, W as ot } from "./index-B0neMIbR.js";
3
+ import { p as Bt } from "./cynefin-VYW2F7L2-XAY3mHv8.js";
4
4
  var rt = /* @__PURE__ */ s(() => ({
5
5
  domains: /* @__PURE__ */ new Map(),
6
6
  transitions: []
@@ -788,7 +788,7 @@ var _o = !0, Kc = console.warn != null, Xc = console.trace != null, Js = Number.
788
788
  var t = Object.keys(e);
789
789
  return function(a) {
790
790
  for (var n = {}, i = 0; i < t.length; i++) {
791
- var s = t[i], o = a == null ? void 0 : a[s];
791
+ var s = t[i], o = a?.[s];
792
792
  n[s] = o === void 0 ? e[s] : o;
793
793
  }
794
794
  return n;
@@ -3460,7 +3460,7 @@ function Vh() {
3460
3460
  if (pu) return ki;
3461
3461
  pu = 1;
3462
3462
  function r(e, t) {
3463
- return e == null ? void 0 : e[t];
3463
+ return e?.[t];
3464
3464
  }
3465
3465
  return ki = r, ki;
3466
3466
  }
@@ -14391,7 +14391,7 @@ ia.load = function() {
14391
14391
  };
14392
14392
  fe.emit(pe("box")).stdFilter(ke).select().emit(pe("boxselect")), fe.nonempty() && r.redrawHint("eles", !0), r.redraw();
14393
14393
  }
14394
- if (z != null && z.unactivate(), T.touches[2])
14394
+ if (z?.unactivate(), T.touches[2])
14395
14395
  r.data.bgActivePosistion = void 0, r.redrawHint("select", !0);
14396
14396
  else if (!T.touches[1]) {
14397
14397
  if (!T.touches[0]) {
@@ -0,0 +1,343 @@
1
+ import { c as O, w as I, a as J, f as P, b as E, s as A } from "./chunk-RYQCIY6F-I-J4fVFd.js";
2
+ import { _ as w, am as v, an as D, ao as H, ap as Y, l, c as _, aq as W, ar as $, ag as j, as as q, ah as R, af as F, at as z, au as K, av as G } from "./index-B0neMIbR.js";
3
+ import { G as Q } from "./graph-DAHC4kPm.js";
4
+ import { l as U } from "./layout-DBbo_M5I.js";
5
+ var C = /* @__PURE__ */ w((s, t, g) => Math.max(t, Math.min(g, s)), "clamp"), B = /* @__PURE__ */ w((s = "TB") => {
6
+ switch (s) {
7
+ case "BT":
8
+ return "bottom";
9
+ case "LR":
10
+ return "right";
11
+ case "RL":
12
+ return "left";
13
+ case "TB":
14
+ default:
15
+ return "top";
16
+ }
17
+ }, "getDefaultSelfLoopSide"), V = /* @__PURE__ */ w((s) => s === "flowchart" || s === "flowchart-v2" || s === "stateDiagram", "shouldMergeSelfLoopSegments"), Z = /* @__PURE__ */ w((s, t, g, y, c) => {
18
+ const o = [], r = /* @__PURE__ */ new Set();
19
+ if (g.forEach(({ start: i, end: n }) => {
20
+ i !== y && r.add(i), n !== y && r.add(n);
21
+ }), r.forEach((i) => {
22
+ const n = s.node(i);
23
+ typeof n?.x == "number" && typeof n?.y == "number" && o.push(n);
24
+ }), o.length === 0 && g.forEach(({ edge: i }) => {
25
+ (i.points ?? []).forEach((n) => {
26
+ typeof n?.x == "number" && typeof n?.y == "number" && o.push(n);
27
+ });
28
+ }), o.length === 0)
29
+ return B(c);
30
+ const f = o.reduce(
31
+ (i, n) => ({
32
+ x: i.x + n.x / o.length,
33
+ y: i.y + n.y / o.length
34
+ }),
35
+ { x: 0, y: 0 }
36
+ ), h = f.x - t.x, a = f.y - t.y;
37
+ return Math.abs(h) > Math.abs(a) ? h > 0 ? "right" : "left" : Math.abs(a) > 0 ? a > 0 ? "bottom" : "top" : B(c);
38
+ }, "getSelfLoopSide"), ee = /* @__PURE__ */ w((s, t = "top", g = 0, y = 0) => {
39
+ const c = s.x, o = s.y - g, r = s.width / 2, f = s.height / 2, h = Math.max(36, Math.min(100, s.width * 0.8)), a = C(Math.max(y, s.width * 0.35), 36, h), i = C(Math.min(s.width, s.height) * 0.45, 24, 48);
40
+ switch (t) {
41
+ case "bottom": {
42
+ const n = o + f;
43
+ return [
44
+ { x: c - a / 2, y: n },
45
+ { x: c - a / 2, y: n + i },
46
+ { x: c + a / 2, y: n + i },
47
+ { x: c + a / 2, y: n }
48
+ ];
49
+ }
50
+ case "right": {
51
+ const n = c + r;
52
+ return [
53
+ { x: n, y: o - a / 2 },
54
+ { x: n + i, y: o - a / 2 },
55
+ { x: n + i, y: o + a / 2 },
56
+ { x: n, y: o + a / 2 }
57
+ ];
58
+ }
59
+ case "left": {
60
+ const n = c - r;
61
+ return [
62
+ { x: n, y: o - a / 2 },
63
+ { x: n - i, y: o - a / 2 },
64
+ { x: n - i, y: o + a / 2 },
65
+ { x: n, y: o + a / 2 }
66
+ ];
67
+ }
68
+ case "top":
69
+ default: {
70
+ const n = o - f;
71
+ return [
72
+ { x: c - a / 2, y: n },
73
+ { x: c - a / 2, y: n - i },
74
+ { x: c + a / 2, y: n - i },
75
+ { x: c + a / 2, y: n }
76
+ ];
77
+ }
78
+ }
79
+ }, "getSelfLoopPoints"), te = /* @__PURE__ */ w((s, t, g = "top", y = 0, c = {}) => {
80
+ const r = s.x, f = s.y - y, h = c.width ?? 0, a = c.height ?? 0;
81
+ switch (g) {
82
+ case "bottom":
83
+ return { x: r, y: Math.max(...t.map((i) => i.y)) + a / 2 + 4 };
84
+ case "right":
85
+ return { x: Math.max(...t.map((i) => i.x)) + h / 2 + 4, y: f };
86
+ case "left":
87
+ return { x: Math.min(...t.map((i) => i.x)) - h / 2 - 4, y: f };
88
+ case "top":
89
+ default:
90
+ return { x: r, y: Math.min(...t.map((i) => i.y)) - a / 2 - 4 };
91
+ }
92
+ }, "getSelfLoopLabelPosition"), ne = /* @__PURE__ */ w((s, t = 0, { mergeSelfLoops: g = !0 } = {}) => {
93
+ const y = /* @__PURE__ */ new Map(), c = [], o = s.graph()?.rankdir;
94
+ return s.edges().forEach((r) => {
95
+ const f = s.edge(r);
96
+ if (g && f.selfLoop) {
97
+ const h = f.selfLoop.id;
98
+ y.has(h) || y.set(h, []), y.get(h).push({ edge: f, start: r.v, end: r.w });
99
+ } else
100
+ c.push({ edge: f, start: r.v, end: r.w });
101
+ }), y.forEach((r) => {
102
+ if (r.length !== 3) {
103
+ r.forEach((L) => c.push(L));
104
+ return;
105
+ }
106
+ r.sort((L, d) => L.edge.selfLoop.order - d.edge.selfLoop.order);
107
+ const [f, h, a] = r, i = f.edge.originalEdge ?? h.edge.originalEdge ?? a.edge.originalEdge ?? h.edge, n = s.node(i.start);
108
+ if (!n) {
109
+ r.forEach((L) => c.push(L));
110
+ return;
111
+ }
112
+ const p = {
113
+ width: h.edge.width,
114
+ height: h.edge.height
115
+ }, m = Z(s, n, r, i.start, o), X = ee(n, m, t, p.width ?? 0), S = te(n, X, m, t, p), b = {
116
+ ...h.edge,
117
+ ...i,
118
+ id: i.id,
119
+ points: X,
120
+ start: i.start,
121
+ end: i.end,
122
+ x: S.x,
123
+ y: S.y,
124
+ width: p.width,
125
+ height: p.height,
126
+ labelStyle: h.edge.labelStyle,
127
+ fromCluster: f.edge.fromCluster ?? h.edge.fromCluster ?? a.edge.fromCluster,
128
+ toCluster: f.edge.toCluster ?? h.edge.toCluster ?? a.edge.toCluster
129
+ };
130
+ delete b.selfLoop, delete b.originalEdge, c.push({ edge: b, start: b.start, end: b.end });
131
+ }), c;
132
+ }, "getEdgesToRender"), T = /* @__PURE__ */ w(async (s, t, g, y, c, o) => {
133
+ l.warn("Graph in recursive render:XAX", I(t), c);
134
+ const r = t.graph().rankdir;
135
+ l.trace("Dir in recursive render - dir:", r);
136
+ const f = s.insert("g").attr("class", "root");
137
+ t.nodes() ? l.info("Recursive render XXX", t.nodes()) : l.info("No nodes found for", t), t.edges().length > 0 && l.info("Recursive edges", t.edge(t.edges()[0]));
138
+ const h = f.insert("g").attr("class", "clusters"), a = f.insert("g").attr("class", "edgePaths"), i = f.insert("g").attr("class", "edgeLabels"), n = f.insert("g").attr("class", "nodes"), p = V(g);
139
+ await Promise.all(
140
+ t.nodes().map(async function(d) {
141
+ const e = t.node(d);
142
+ if (c !== void 0) {
143
+ const u = JSON.parse(JSON.stringify(c.clusterData));
144
+ l.trace(
145
+ `Setting data for parent cluster XXX
146
+ Node.id = `,
147
+ d,
148
+ `
149
+ data=`,
150
+ u.height,
151
+ `
152
+ Parent cluster`,
153
+ c.height
154
+ ), t.setNode(c.id, u), t.parent(d) || (l.trace("Setting parent", d, c.id), t.setParent(d, c.id, u));
155
+ }
156
+ if (l.info("(Insert) Node XXX" + d + ": " + JSON.stringify(t.node(d))), e?.clusterNode) {
157
+ l.info("Cluster identified XBX", d, e.width, t.node(d));
158
+ const { ranksep: u, nodesep: x } = t.graph();
159
+ e.graph.setGraph({
160
+ ...e.graph.graph(),
161
+ ranksep: u + 25,
162
+ nodesep: x
163
+ });
164
+ const N = await T(
165
+ n,
166
+ e.graph,
167
+ g,
168
+ y,
169
+ t.node(d),
170
+ o
171
+ ), M = N.elem;
172
+ W(e, M), e.diff = N.diff || 0, l.info(
173
+ "New compound node after recursive render XAX",
174
+ d,
175
+ "width",
176
+ // node,
177
+ e.width,
178
+ "height",
179
+ e.height
180
+ // node.x,
181
+ // node.y
182
+ ), $(M, e);
183
+ } else
184
+ t.children(d).length > 0 ? (l.trace(
185
+ "Cluster - the non recursive path XBX",
186
+ d,
187
+ e.id,
188
+ e,
189
+ e.width,
190
+ "Graph:",
191
+ t
192
+ ), l.trace(P(e.id, t)), E.set(e.id, { id: P(e.id, t), node: e })) : (l.trace("Node - the non recursive path XAX", d, n, t.node(d), r), await j(n, t.node(d), { config: o, dir: r }));
193
+ })
194
+ ), await (/* @__PURE__ */ w(async () => {
195
+ const d = t.edges().map(async function(e) {
196
+ const u = t.edge(e.v, e.w, e.name);
197
+ if (l.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e)), l.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(t.edge(e))), l.info(
198
+ "Fix",
199
+ E,
200
+ "ids:",
201
+ e.v,
202
+ e.w,
203
+ "Translating: ",
204
+ E.get(e.v),
205
+ E.get(e.w)
206
+ ), p && u.selfLoop) {
207
+ if (u.selfLoop.order !== 1)
208
+ return;
209
+ const x = u.id;
210
+ u.id = u.selfLoop.id, await G(i, u), u.id = x;
211
+ return;
212
+ }
213
+ await G(i, u);
214
+ });
215
+ await Promise.all(d);
216
+ }, "processEdges"))(), l.info("Graph before layout:", JSON.stringify(I(t))), l.info("############################################# XXX"), l.info("### Layout ### XXX"), l.info("############################################# XXX"), U(t), l.info("Graph after layout:", JSON.stringify(I(t)));
217
+ let X = 0, { subGraphTitleTotalMargin: S } = q(o);
218
+ await Promise.all(
219
+ A(t).map(async function(d) {
220
+ const e = t.node(d);
221
+ if (l.info(
222
+ "Position XBX => " + d + ": (" + e.x,
223
+ "," + e.y,
224
+ ") width: ",
225
+ e.width,
226
+ " height: ",
227
+ e.height
228
+ ), e?.clusterNode)
229
+ e.y += S, l.info(
230
+ "A tainted cluster node XBX1",
231
+ d,
232
+ e.id,
233
+ e.width,
234
+ e.height,
235
+ e.x,
236
+ e.y,
237
+ t.parent(d)
238
+ ), E.get(e.id).node = e, R(e);
239
+ else if (t.children(d).length > 0) {
240
+ l.info(
241
+ "A pure cluster node XBX1",
242
+ d,
243
+ e.id,
244
+ e.x,
245
+ e.y,
246
+ e.width,
247
+ e.height,
248
+ t.parent(d)
249
+ ), e.height += S, t.node(e.parentId);
250
+ const u = e?.padding / 2 || 0, x = e?.labelBBox?.height || 0, N = x - u || 0;
251
+ l.debug("OffsetY", N, "labelHeight", x, "halfPadding", u), await F(h, e), E.get(e.id).node = e;
252
+ } else {
253
+ const u = t.node(e.parentId);
254
+ e.y += S / 2, l.info(
255
+ "A regular node XBX1 - using the padding",
256
+ e.id,
257
+ "parent",
258
+ e.parentId,
259
+ e.width,
260
+ e.height,
261
+ e.x,
262
+ e.y,
263
+ "offsetY",
264
+ e.offsetY,
265
+ "parent",
266
+ u,
267
+ u?.offsetY,
268
+ e
269
+ ), R(e);
270
+ }
271
+ })
272
+ );
273
+ const b = S / 2;
274
+ return ne(t, b, { mergeSelfLoops: p }).forEach(function({ edge: d, start: e, end: u }) {
275
+ l.info("Edge " + e + " -> " + u + ": " + JSON.stringify(d), d), d.points.forEach((k) => k.y += b);
276
+ const x = t.node(e), N = t.node(u), M = z(a, d, E, g, x, N, y);
277
+ K(d, M);
278
+ }), t.nodes().forEach(function(d) {
279
+ const e = t.node(d);
280
+ l.info(d, e.type, e.diff), e.isGroup && (X = e.diff);
281
+ }), l.warn("Returning from recursive render XAX", f, X), { elem: f, diff: X };
282
+ }, "recursiveRender"), de = /* @__PURE__ */ w(async (s, t) => {
283
+ const g = new Q({
284
+ multigraph: !0,
285
+ compound: !0
286
+ }).setGraph({
287
+ rankdir: s.direction,
288
+ nodesep: s.config?.nodeSpacing || s.config?.flowchart?.nodeSpacing || s.nodeSpacing,
289
+ ranksep: s.config?.rankSpacing || s.config?.flowchart?.rankSpacing || s.rankSpacing,
290
+ marginx: 8,
291
+ marginy: 8
292
+ }).setDefaultEdgeLabel(function() {
293
+ return {};
294
+ }), y = t.select("g");
295
+ v(y, s.markers, s.type, s.diagramId), D(), H(), Y(), O(), s.nodes.forEach((o) => {
296
+ g.setNode(o.id, { ...o }), o.parentId && g.setParent(o.id, o.parentId);
297
+ }), l.debug("Edges:", s.edges), s.edges.forEach((o) => {
298
+ if (o.start === o.end) {
299
+ const r = o.start, f = r + "---" + r + "---1", h = r + "---" + r + "---2", a = g.node(r);
300
+ g.setNode(f, {
301
+ domId: f,
302
+ id: f,
303
+ parentId: a.parentId,
304
+ labelStyle: "",
305
+ label: "",
306
+ padding: 0,
307
+ shape: "labelRect",
308
+ // shape: 'rect',
309
+ style: "",
310
+ width: 10,
311
+ height: 10
312
+ }), g.setParent(f, a.parentId), g.setNode(h, {
313
+ domId: h,
314
+ id: h,
315
+ parentId: a.parentId,
316
+ labelStyle: "",
317
+ padding: 0,
318
+ // shape: 'rect',
319
+ shape: "labelRect",
320
+ label: "",
321
+ style: "",
322
+ width: 10,
323
+ height: 10
324
+ }), g.setParent(h, a.parentId);
325
+ const i = structuredClone(o), n = structuredClone(o), p = structuredClone(o), m = structuredClone(o);
326
+ n.originalEdge = i, n.selfLoop = { id: i.id, order: 0 }, p.originalEdge = i, p.selfLoop = { id: i.id, order: 1 }, m.originalEdge = i, m.selfLoop = { id: i.id, order: 2 }, n.label = "", n.arrowTypeEnd = "none", n.endLabelLeft = "", n.endLabelRight = "", n.startLabelLeft = "", n.id = r + "-cyclic-special-1", p.startLabelRight = "", p.startLabelLeft = "", p.endLabelLeft = "", p.endLabelRight = "", p.arrowTypeStart = "none", p.arrowTypeEnd = "none", p.id = r + "-cyclic-special-mid", m.label = "", m.startLabelRight = "", m.startLabelLeft = "", m.arrowTypeStart = "none", a.isGroup && (n.fromCluster = r, m.toCluster = r), m.id = r + "-cyclic-special-2", m.arrowTypeStart = "none", g.setEdge(r, f, n, r + "-cyclic-special-0"), g.setEdge(f, h, p, r + "-cyclic-special-1"), g.setEdge(h, r, m, r + "-cyclic-special-2");
327
+ } else
328
+ g.setEdge(o.start, o.end, { ...o }, o.id);
329
+ }), l.warn("Graph at first:", JSON.stringify(I(g))), J(g), l.warn("Graph after XAX:", JSON.stringify(I(g)));
330
+ const c = _();
331
+ await T(
332
+ y,
333
+ g,
334
+ s.type,
335
+ s.diagramId,
336
+ void 0,
337
+ c
338
+ );
339
+ }, "render");
340
+ export {
341
+ ne as getEdgesToRender,
342
+ de as render
343
+ };