@ashwin_droid/notion-stream 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/{_baseUniq-DSwfPiGC.js → _baseUniq-D32sgNIc.js} +1 -1
  2. package/dist/{_baseUniq-CT-tc-CG.mjs → _baseUniq-DCnQIx8G.mjs} +51 -51
  3. package/dist/{arc-BBnIBs2j.js → arc-B0uBm0sN.js} +1 -1
  4. package/dist/{arc-DmoYXidQ.mjs → arc-OrNNmmBm.mjs} +1 -1
  5. package/dist/{architecture-U656AL7Q-C0ZB2O9M.js → architecture-U656AL7Q-CLYqYgyv.js} +1 -1
  6. package/dist/{architecture-U656AL7Q-CMPtJMZ-.mjs → architecture-U656AL7Q-seCMyeyz.mjs} +1 -1
  7. package/dist/architectureDiagram-VXUJARFQ-BGsDPmi_.js +36 -0
  8. package/dist/{architectureDiagram-VXUJARFQ-BYzpbF40.mjs → architectureDiagram-VXUJARFQ-BmPLNLcs.mjs} +1846 -1850
  9. package/dist/{blockDiagram-VD42YOAC-DPVTCHn5.mjs → blockDiagram-VD42YOAC-CXKvT-9-.mjs} +913 -922
  10. package/dist/blockDiagram-VD42YOAC-NQhzFvsO.js +122 -0
  11. package/dist/c4Diagram-YG6GDRKO-CMXx6pyB.js +10 -0
  12. package/dist/{c4Diagram-YG6GDRKO-C2Y4q08p.mjs → c4Diagram-YG6GDRKO-DAGMHESb.mjs} +169 -170
  13. package/dist/{channel-DVpqhnow.mjs → channel-BXGyzQA6.mjs} +1 -1
  14. package/dist/channel-Dw8BXC8D.js +1 -0
  15. package/dist/chunk-4BX2VUAB-MnK73C0-.js +1 -0
  16. package/dist/chunk-4BX2VUAB-ZaWvd3Xe.mjs +8 -0
  17. package/dist/{chunk-55IACEB6-P_FVKIbW.js → chunk-55IACEB6-B1EpdpVW.js} +1 -1
  18. package/dist/{chunk-55IACEB6-Du1Simcj.mjs → chunk-55IACEB6-iKbZBHA5.mjs} +1 -1
  19. package/dist/chunk-B4BG7PRW-Bo_sfBKL.js +165 -0
  20. package/dist/{chunk-B4BG7PRW-BUKsa2yH.mjs → chunk-B4BG7PRW-DgqSow4f.mjs} +251 -252
  21. package/dist/{chunk-DI55MBZ5-C9h0qLVI.mjs → chunk-DI55MBZ5-BAHL-2VJ.mjs} +444 -456
  22. package/dist/chunk-DI55MBZ5-BuuMLI1S.js +220 -0
  23. package/dist/{chunk-FMBD7UC4-C08-zA06.mjs → chunk-FMBD7UC4-BE8MbNLe.mjs} +1 -1
  24. package/dist/{chunk-FMBD7UC4-48-zdz-1.js → chunk-FMBD7UC4-Cs1BNv23.js} +1 -1
  25. package/dist/chunk-QN33PNHL-MX1ZMWu-.js +1 -0
  26. package/dist/chunk-QN33PNHL-ZaWv5vaA.mjs +19 -0
  27. package/dist/{chunk-QZHKN3VN-DbO6TJSK.mjs → chunk-QZHKN3VN-D2X7PBDi.mjs} +1 -1
  28. package/dist/{chunk-QZHKN3VN-Dy2264ui.js → chunk-QZHKN3VN-Db6mVb9M.js} +1 -1
  29. package/dist/{chunk-TZMSLE5B-BPmI9i6R.mjs → chunk-TZMSLE5B-AMFXF6mq.mjs} +20 -20
  30. package/dist/{chunk-TZMSLE5B-COENnLAZ.js → chunk-TZMSLE5B-CzjtACDr.js} +1 -1
  31. package/dist/{classDiagram-v2-WZHVMYZB-mzvV1Ifg.mjs → classDiagram-2ON5EDUG-CPwvtUDj.mjs} +2 -2
  32. package/dist/{classDiagram-2ON5EDUG-CFFwYK87.js → classDiagram-2ON5EDUG-UNrH9bQo.js} +1 -1
  33. package/dist/{classDiagram-2ON5EDUG-mzvV1Ifg.mjs → classDiagram-v2-WZHVMYZB-CPwvtUDj.mjs} +2 -2
  34. package/dist/{classDiagram-v2-WZHVMYZB-CFFwYK87.js → classDiagram-v2-WZHVMYZB-UNrH9bQo.js} +1 -1
  35. package/dist/{clone-KtLCwiKH.mjs → clone-CV4F8CSW.mjs} +1 -1
  36. package/dist/clone-HVsPHeK3.js +1 -0
  37. package/dist/{code-block-37QAKDTI-sxlq94xm.js → code-block-37QAKDTI-38K5Mxo2.js} +1 -1
  38. package/dist/{code-block-37QAKDTI-CmykMxjQ.mjs → code-block-37QAKDTI-Q-OOsw6q.mjs} +1 -1
  39. package/dist/cose-bilkent-S5V4N54A-1B77PywG.js +1 -0
  40. package/dist/{cose-bilkent-S5V4N54A-BXcldnso.mjs → cose-bilkent-S5V4N54A-greBbyuM.mjs} +592 -589
  41. package/dist/cytoscape.esm-CNUX3VTg.js +321 -0
  42. package/dist/{cytoscape.esm-ZmItrg9y.mjs → cytoscape.esm-Cvf3sx9F.mjs} +56 -83
  43. package/dist/dagre-6UL2VRFP-DEQXyXKh.js +4 -0
  44. package/dist/dagre-6UL2VRFP-DN5Inkgr.mjs +443 -0
  45. package/dist/diagram-PSM6KHXK-C7tjFZpr.js +24 -0
  46. package/dist/{diagram-PSM6KHXK-DIV3jw9d.mjs → diagram-PSM6KHXK-D-GS1fTc.mjs} +45 -48
  47. package/dist/{diagram-QEK2KX5R-Q0M2_YtR.mjs → diagram-QEK2KX5R-DJXBxeH4.mjs} +10 -14
  48. package/dist/diagram-QEK2KX5R-Doa8ooC_.js +43 -0
  49. package/dist/diagram-S2PKOQOG-BN04h93a.js +24 -0
  50. package/dist/{diagram-S2PKOQOG-_WGA6s2-.mjs → diagram-S2PKOQOG-BuPevKqw.mjs} +22 -23
  51. package/dist/erDiagram-Q2GNP2WA-AS2vnQKc.js +60 -0
  52. package/dist/{erDiagram-Q2GNP2WA-CW0D_QGb.mjs → erDiagram-Q2GNP2WA-DxOmvmqL.mjs} +77 -78
  53. package/dist/flowDiagram-NV44I4VS-BChiRwcp.js +162 -0
  54. package/dist/{flowDiagram-NV44I4VS-DVQ8Ntc4.mjs → flowDiagram-NV44I4VS-Cs_jC87H.mjs} +442 -449
  55. package/dist/{ganttDiagram-JELNMOA3-Bk-dX6qT.mjs → ganttDiagram-JELNMOA3-02b_-xyZ.mjs} +1049 -1041
  56. package/dist/ganttDiagram-JELNMOA3-BGy1b6TD.js +267 -0
  57. package/dist/{gitGraph-F6HP7TQM-CsdwxYUE.mjs → gitGraph-F6HP7TQM-BWm0SBV4.mjs} +1 -1
  58. package/dist/{gitGraph-F6HP7TQM-DvIgo2TM.js → gitGraph-F6HP7TQM-DVfckSNX.js} +1 -1
  59. package/dist/gitGraphDiagram-NY62KEGX-CfzoE07P.mjs +699 -0
  60. package/dist/gitGraphDiagram-NY62KEGX-Cm9ywQoW.js +65 -0
  61. package/dist/{graph-C_T4ZBuC.mjs → graph-DEu7-ZhH.mjs} +8 -8
  62. package/dist/{graph-BNpx6ebg.js → graph-Dw_87ii6.js} +1 -1
  63. package/dist/index-BwYOYPeK.js +670 -0
  64. package/dist/{index-oe4HpmeG.mjs → index-DH3CVXwD.mjs} +22541 -22646
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.js +1 -1
  67. package/dist/index.mjs +3 -3
  68. package/dist/{info-NVLQJR56-BwFQRguW.js → info-NVLQJR56-BpKxONZx.js} +1 -1
  69. package/dist/info-NVLQJR56-MmJP3L6S.mjs +5 -0
  70. package/dist/{infoDiagram-WHAUD3N6-C-gzsm95.mjs → infoDiagram-WHAUD3N6-Bfsucvti.mjs} +2 -2
  71. package/dist/{infoDiagram-WHAUD3N6-CCb5k_S7.js → infoDiagram-WHAUD3N6-q-yX3_By.js} +1 -1
  72. package/dist/journeyDiagram-XKPGCS4Q-BqtyHvQF.js +139 -0
  73. package/dist/{journeyDiagram-XKPGCS4Q-DzkUL_YG.mjs → journeyDiagram-XKPGCS4Q-dFRLmnr-.mjs} +24 -26
  74. package/dist/kanban-definition-3W4ZIXB7-DeOl9Eme.mjs +719 -0
  75. package/dist/kanban-definition-3W4ZIXB7-DraMxv75.js +89 -0
  76. package/dist/{layout-CuWQnP5Y.js → layout-BKTUO8WZ.js} +1 -1
  77. package/dist/{layout-Cd98WJ7r.mjs → layout-CpL-hYTa.mjs} +22 -22
  78. package/dist/{linear-SU4e8MRt.mjs → linear-CLwIU3di.mjs} +20 -20
  79. package/dist/{linear-DFDw13y6.js → linear-DvM229Di.js} +1 -1
  80. package/dist/mermaid-4DMBBIKO-BpqXz0_U.mjs +4 -0
  81. package/dist/{mermaid-4DMBBIKO-BihEtyib.js → mermaid-4DMBBIKO-Cd15t2pT.js} +1 -1
  82. package/dist/mermaid-parser.core-BVlc9Lqd.js +128 -0
  83. package/dist/{mermaid-parser.core-C8Sxzqul.mjs → mermaid-parser.core-CLAapB2-.mjs} +3404 -3369
  84. package/dist/{min-C2k771MZ.mjs → min--ML-ONY_.mjs} +2 -2
  85. package/dist/{min-CppMRDFn.js → min-BQ4NUvNf.js} +1 -1
  86. package/dist/{mindmap-definition-VGOIOE7T-BUd354uH.mjs → mindmap-definition-VGOIOE7T-78K_EDCb.mjs} +170 -172
  87. package/dist/mindmap-definition-VGOIOE7T-ZHY70ZzV.js +68 -0
  88. package/dist/notion-stream.css +1 -0
  89. package/dist/{ordinal-C0oynhte.mjs → ordinal-B-KqvkJf.mjs} +1 -1
  90. package/dist/{packet-BFZMPI3H-Cz_A86d3.mjs → packet-BFZMPI3H-B34lFb6T.mjs} +1 -1
  91. package/dist/{packet-BFZMPI3H-CFx3kSkL.js → packet-BFZMPI3H-C9xcJQVN.js} +1 -1
  92. package/dist/{pie-7BOR55EZ-_1MqisBd.js → pie-7BOR55EZ-Bz_jfTd_.js} +1 -1
  93. package/dist/pie-7BOR55EZ-DW2Zgje5.mjs +5 -0
  94. package/dist/{pieDiagram-ADFJNKIX-Bg0_gu43.js → pieDiagram-ADFJNKIX-CKzchAXU.js} +2 -2
  95. package/dist/{pieDiagram-ADFJNKIX-lRs_rpwI.mjs → pieDiagram-ADFJNKIX-Ctp6QR7f.mjs} +21 -21
  96. package/dist/quadrantDiagram-AYHSOK5B-D2Rt32D2.js +7 -0
  97. package/dist/{quadrantDiagram-AYHSOK5B-D9kypJt6.mjs → quadrantDiagram-AYHSOK5B-D3U_Qicu.mjs} +230 -232
  98. package/dist/{radar-NHE76QYJ-B-PvZD0K.mjs → radar-NHE76QYJ-CO5ECFHq.mjs} +1 -1
  99. package/dist/{radar-NHE76QYJ-CdtC4C8F.js → radar-NHE76QYJ-DI4PJJjm.js} +1 -1
  100. package/dist/requirementDiagram-UZGBJVZJ-CSgb6U9N.js +64 -0
  101. package/dist/{requirementDiagram-UZGBJVZJ-B5ulaHjE.mjs → requirementDiagram-UZGBJVZJ-Da_yWSD1.mjs} +190 -192
  102. package/dist/sankeyDiagram-TZEHDZUN-C8jpBnM0.js +10 -0
  103. package/dist/{sankeyDiagram-TZEHDZUN-DprIPFbe.mjs → sankeyDiagram-TZEHDZUN-Dp3Eyl8Q.mjs} +189 -189
  104. package/dist/sequenceDiagram-WL72ISMW-BZJ7d_X4.js +145 -0
  105. package/dist/{sequenceDiagram-WL72ISMW-B4m4oag0.mjs → sequenceDiagram-WL72ISMW-yJKe02sV.mjs} +222 -229
  106. package/dist/{stateDiagram-FKZM4ZOC-BD4tnS-V.js → stateDiagram-FKZM4ZOC-Cfuygt_P.js} +1 -1
  107. package/dist/{stateDiagram-FKZM4ZOC-DjkdDbQ2.mjs → stateDiagram-FKZM4ZOC-z0IX85WL.mjs} +4 -4
  108. package/dist/{stateDiagram-v2-4FDKWEC3-AK86F3i6.mjs → stateDiagram-v2-4FDKWEC3-BDMFqSat.mjs} +2 -2
  109. package/dist/{stateDiagram-v2-4FDKWEC3-sybMoxOk.js → stateDiagram-v2-4FDKWEC3-BiriAQkj.js} +1 -1
  110. package/dist/{timeline-definition-IT6M3QCI-BFuQEeZP.mjs → timeline-definition-IT6M3QCI-BmEq-RM3.mjs} +217 -223
  111. package/dist/timeline-definition-IT6M3QCI-CBmpRgUM.js +61 -0
  112. package/dist/{treemap-KMMF4GRG-gtrnY16v.mjs → treemap-KMMF4GRG-IaHP18r_.mjs} +1 -1
  113. package/dist/{treemap-KMMF4GRG-DTnRa789.js → treemap-KMMF4GRG-qP0VzKwW.js} +1 -1
  114. package/dist/{xychartDiagram-PRI3JC2R-CjXiy6m0.mjs → xychartDiagram-PRI3JC2R-BSaI76KX.mjs} +7 -7
  115. package/dist/xychartDiagram-PRI3JC2R-CQgij0Fy.js +7 -0
  116. package/package.json +5 -5
  117. package/dist/architectureDiagram-VXUJARFQ-BPQoZmaM.js +0 -36
  118. package/dist/blockDiagram-VD42YOAC-Z3Fc3Bew.js +0 -122
  119. package/dist/c4Diagram-YG6GDRKO-LzDuCZ2V.js +0 -10
  120. package/dist/channel-6dUO0MQi.js +0 -1
  121. package/dist/chunk-4BX2VUAB-BwubFldI.js +0 -1
  122. package/dist/chunk-4BX2VUAB-DldMXCTt.mjs +0 -9
  123. package/dist/chunk-B4BG7PRW-CKX0VJ-S.js +0 -165
  124. package/dist/chunk-DI55MBZ5-CMq-O8k2.js +0 -220
  125. package/dist/chunk-QN33PNHL-B0sO38bZ.js +0 -1
  126. package/dist/chunk-QN33PNHL-B_PGnTkk.mjs +0 -20
  127. package/dist/clone-B0UaPT2Z.js +0 -1
  128. package/dist/cose-bilkent-S5V4N54A-BCaAPmuF.js +0 -1
  129. package/dist/cytoscape.esm-DkGgpG6d.js +0 -331
  130. package/dist/dagre-6UL2VRFP-By42zbLA.mjs +0 -446
  131. package/dist/dagre-6UL2VRFP-DCwfkcWi.js +0 -4
  132. package/dist/diagram-PSM6KHXK-hjXN9n1N.js +0 -24
  133. package/dist/diagram-QEK2KX5R-B04ODMim.js +0 -43
  134. package/dist/diagram-S2PKOQOG-BmCs4MZE.js +0 -24
  135. package/dist/erDiagram-Q2GNP2WA-4KtQUUuI.js +0 -60
  136. package/dist/flowDiagram-NV44I4VS-BwpfJE0U.js +0 -162
  137. package/dist/ganttDiagram-JELNMOA3-D7rI7u8B.js +0 -267
  138. package/dist/gitGraphDiagram-NY62KEGX-BDTsbSkO.mjs +0 -712
  139. package/dist/gitGraphDiagram-NY62KEGX-IQ8KriUw.js +0 -65
  140. package/dist/index-CkYZRBYn.js +0 -676
  141. package/dist/info-NVLQJR56-B5gDnSIT.mjs +0 -5
  142. package/dist/journeyDiagram-XKPGCS4Q-POnSekz9.js +0 -139
  143. package/dist/kanban-definition-3W4ZIXB7-BPr0_7wG.mjs +0 -720
  144. package/dist/kanban-definition-3W4ZIXB7-Bm064qrf.js +0 -89
  145. package/dist/mermaid-4DMBBIKO-DDxvQcE9.mjs +0 -4
  146. package/dist/mermaid-parser.core-BHAgLMGa.js +0 -128
  147. package/dist/mindmap-definition-VGOIOE7T-CV7bD4HY.js +0 -68
  148. package/dist/pie-7BOR55EZ-B0-atE_o.mjs +0 -5
  149. package/dist/quadrantDiagram-AYHSOK5B-B4gVakRV.js +0 -7
  150. package/dist/requirementDiagram-UZGBJVZJ-0zMPj-SD.js +0 -64
  151. package/dist/sankeyDiagram-TZEHDZUN-Cl8-L83T.js +0 -10
  152. package/dist/sequenceDiagram-WL72ISMW-DRQn7Fe4.js +0 -145
  153. package/dist/timeline-definition-IT6M3QCI-2X4dfyLj.js +0 -61
  154. package/dist/xychartDiagram-PRI3JC2R-BaFd1In8.js +0 -7
@@ -1,446 +0,0 @@
1
- import { _ as X, aw as F, ax as Y, ay as _, az as H, l as i, f as V, aA as z, aB as U, an as $, as as q, ao as P, am as K, aC as Q, aD as W, aE as Z } from "./index-oe4HpmeG.mjs";
2
- import { i as x, G as B } from "./graph-C_T4ZBuC.mjs";
3
- import { l as I } from "./layout-Cd98WJ7r.mjs";
4
- import { c as L } from "./clone-KtLCwiKH.mjs";
5
- import { m as A } from "./min-C2k771MZ.mjs";
6
- function p(e) {
7
- var t = {
8
- options: {
9
- directed: e.isDirected(),
10
- multigraph: e.isMultigraph(),
11
- compound: e.isCompound()
12
- },
13
- nodes: ee(e),
14
- edges: ne(e)
15
- };
16
- return x(e.graph()) || (t.value = L(e.graph())), t;
17
- }
18
- function ee(e) {
19
- return A(e.nodes(), function(t) {
20
- var n = e.node(t), o = e.parent(t), c = { v: t };
21
- return x(n) || (c.value = n), x(o) || (c.parent = o), c;
22
- });
23
- }
24
- function ne(e) {
25
- return A(e.edges(), function(t) {
26
- var n = e.edge(t), o = { v: t.v, w: t.w };
27
- return x(t.name) || (o.name = t.name), x(n) || (o.value = n), o;
28
- });
29
- }
30
- var f = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ X(() => {
31
- b.clear(), J.clear(), f.clear();
32
- }, "clear"), O = /* @__PURE__ */ X((e, t) => {
33
- const n = b.get(t) || [];
34
- return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
35
- }, "isDescendant"), se = /* @__PURE__ */ X((e, t) => {
36
- const n = b.get(t) || [];
37
- return i.info("Descendants of ", t, " is ", n), i.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || O(e.v, t) || O(e.w, t) || n.includes(e.w) : (i.debug("Tilt, ", t, ",not in descendants"), !1);
38
- }, "edgeInCluster"), G = /* @__PURE__ */ X((e, t, n, o) => {
39
- i.warn(
40
- "Copying children of ",
41
- e,
42
- "root",
43
- o,
44
- "data",
45
- t.node(e),
46
- o
47
- );
48
- const c = t.children(e) || [];
49
- e !== o && c.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", c), c.forEach((a) => {
50
- if (t.children(a).length > 0)
51
- G(a, t, n, o);
52
- else {
53
- const r = t.node(a);
54
- i.info("cp ", a, " to ", o, " with parent ", e), n.setNode(a, r), o !== t.parent(a) && (i.warn("Setting parent", a, t.parent(a)), n.setParent(a, t.parent(a))), e !== o && a !== e ? (i.debug("Setting parent", a, e), n.setParent(a, e)) : (i.info("In copy ", e, "root", o, "data", t.node(e), o), i.debug(
55
- "Not Setting parent for node=",
56
- a,
57
- "cluster!==rootId",
58
- e !== o,
59
- "node!==clusterId",
60
- a !== e
61
- ));
62
- const u = t.edges(a);
63
- i.debug("Copying Edges", u), u.forEach((l) => {
64
- i.info("Edge", l);
65
- const v = t.edge(l.v, l.w, l.name);
66
- i.info("Edge data", v, o);
67
- try {
68
- se(l, o) ? (i.info("Copying as ", l.v, l.w, v, l.name), n.setEdge(l.v, l.w, v, l.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info(
69
- "Skipping copy of edge ",
70
- l.v,
71
- "-->",
72
- l.w,
73
- " rootId: ",
74
- o,
75
- " clusterId:",
76
- e
77
- );
78
- } catch (C) {
79
- i.error(C);
80
- }
81
- });
82
- }
83
- i.debug("Removing node", a), t.removeNode(a);
84
- });
85
- }, "copy"), R = /* @__PURE__ */ X((e, t) => {
86
- const n = t.children(e);
87
- let o = [...n];
88
- for (const c of n)
89
- J.set(c, e), o = [...o, ...R(c, t)];
90
- return o;
91
- }, "extractDescendants"), ie = /* @__PURE__ */ X((e, t, n) => {
92
- const o = e.edges().filter((l) => l.v === t || l.w === t), c = e.edges().filter((l) => l.v === n || l.w === n), a = o.map((l) => ({ v: l.v === t ? n : l.v, w: l.w === t ? t : l.w })), r = c.map((l) => ({ v: l.v, w: l.w }));
93
- return a.filter((l) => r.some((v) => l.v === v.v && l.w === v.w));
94
- }, "findCommonEdges"), D = /* @__PURE__ */ X((e, t, n) => {
95
- const o = t.children(e);
96
- if (i.trace("Searching children of id ", e, o), o.length < 1)
97
- return e;
98
- let c;
99
- for (const a of o) {
100
- const r = D(a, t, n), u = ie(t, n, r);
101
- if (r)
102
- if (u.length > 0)
103
- c = r;
104
- else
105
- return r;
106
- }
107
- return c;
108
- }, "findNonClusterChild"), k = /* @__PURE__ */ X((e) => !f.has(e) || !f.get(e).externalConnections ? e : f.has(e) ? f.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ X((e, t) => {
109
- if (!e || t > 10) {
110
- i.debug("Opting out, no graph ");
111
- return;
112
- } else
113
- i.debug("Opting in, graph ");
114
- e.nodes().forEach(function(n) {
115
- e.children(n).length > 0 && (i.warn(
116
- "Cluster identified",
117
- n,
118
- " Replacement id in edges: ",
119
- D(n, e, n)
120
- ), b.set(n, R(n, e)), f.set(n, { id: D(n, e, n), clusterData: e.node(n) }));
121
- }), e.nodes().forEach(function(n) {
122
- const o = e.children(n), c = e.edges();
123
- o.length > 0 ? (i.debug("Cluster identified", n, b), c.forEach((a) => {
124
- const r = O(a.v, n), u = O(a.w, n);
125
- r ^ u && (i.warn("Edge: ", a, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", b.get(n)), f.get(n).externalConnections = !0);
126
- })) : i.debug("Not a cluster ", n, b);
127
- });
128
- for (let n of f.keys()) {
129
- const o = f.get(n).id, c = e.parent(o);
130
- c !== n && f.has(c) && !f.get(c).externalConnections && (f.get(n).id = c);
131
- }
132
- e.edges().forEach(function(n) {
133
- const o = e.edge(n);
134
- i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
135
- let c = n.v, a = n.w;
136
- if (i.warn(
137
- "Fix XXX",
138
- f,
139
- "ids:",
140
- n.v,
141
- n.w,
142
- "Translating: ",
143
- f.get(n.v),
144
- " --- ",
145
- f.get(n.w)
146
- ), f.get(n.v) || f.get(n.w)) {
147
- if (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), c = k(n.v), a = k(n.w), e.removeEdge(n.v, n.w, n.name), c !== n.v) {
148
- const r = e.parent(c);
149
- f.get(r).externalConnections = !0, o.fromCluster = n.v;
150
- }
151
- if (a !== n.w) {
152
- const r = e.parent(a);
153
- f.get(r).externalConnections = !0, o.toCluster = n.w;
154
- }
155
- i.warn("Fix Replacing with XXX", c, a, n.name), e.setEdge(c, a, o, n.name);
156
- }
157
- }), i.warn("Adjusted Graph", p(e)), T(e, 0), i.trace(f);
158
- }, "adjustClustersAndEdges"), T = /* @__PURE__ */ X((e, t) => {
159
- var c, a;
160
- if (i.warn("extractor - ", t, p(e), e.children("D")), t > 10) {
161
- i.error("Bailing out");
162
- return;
163
- }
164
- let n = e.nodes(), o = !1;
165
- for (const r of n) {
166
- const u = e.children(r);
167
- o = o || u.length > 0;
168
- }
169
- if (!o) {
170
- i.debug("Done, no node has children", e.nodes());
171
- return;
172
- }
173
- i.debug("Nodes = ", n, t);
174
- for (const r of n)
175
- if (i.debug(
176
- "Extracting node",
177
- r,
178
- f,
179
- f.has(r) && !f.get(r).externalConnections,
180
- !e.parent(r),
181
- e.node(r),
182
- e.children("D"),
183
- " Depth ",
184
- t
185
- ), !f.has(r))
186
- i.debug("Not a cluster", r, t);
187
- else if (!f.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
188
- i.warn(
189
- "Cluster without external connections, without a parent and with children",
190
- r,
191
- t
192
- );
193
- let l = e.graph().rankdir === "TB" ? "LR" : "TB";
194
- (a = (c = f.get(r)) == null ? void 0 : c.clusterData) != null && a.dir && (l = f.get(r).clusterData.dir, i.warn("Fixing dir", f.get(r).clusterData.dir, l));
195
- const v = new B({
196
- multigraph: !0,
197
- compound: !0
198
- }).setGraph({
199
- rankdir: l,
200
- nodesep: 50,
201
- ranksep: 50,
202
- marginx: 8,
203
- marginy: 8
204
- }).setDefaultEdgeLabel(function() {
205
- return {};
206
- });
207
- i.warn("Old graph before copy", p(e)), G(r, e, v, r), e.setNode(r, {
208
- clusterNode: !0,
209
- id: r,
210
- clusterData: f.get(r).clusterData,
211
- label: f.get(r).label,
212
- graph: v
213
- }), i.warn("New graph after copy node: (", r, ")", p(v)), i.debug("Old graph after copy", p(e));
214
- } else
215
- i.warn(
216
- "Cluster ** ",
217
- r,
218
- " **not meeting the criteria !externalConnections:",
219
- !f.get(r).externalConnections,
220
- " no parent: ",
221
- !e.parent(r),
222
- " children ",
223
- e.children(r) && e.children(r).length > 0,
224
- e.children("D"),
225
- t
226
- ), i.debug(f);
227
- n = e.nodes(), i.warn("New list of nodes", n);
228
- for (const r of n) {
229
- const u = e.node(r);
230
- i.warn(" Now next level", r, u), u != null && u.clusterNode && T(u.graph, t + 1);
231
- }
232
- }, "extractor"), M = /* @__PURE__ */ X((e, t) => {
233
- if (t.length === 0)
234
- return [];
235
- let n = Object.assign([], t);
236
- return t.forEach((o) => {
237
- const c = e.children(o), a = M(e, c);
238
- n = [...n, ...a];
239
- }), n;
240
- }, "sorter"), oe = /* @__PURE__ */ X((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ X(async (e, t, n, o, c, a) => {
241
- i.warn("Graph in recursive render:XAX", p(t), c);
242
- const r = t.graph().rankdir;
243
- i.trace("Dir in recursive render - dir:", r);
244
- const u = e.insert("g").attr("class", "root");
245
- t.nodes() ? i.info("Recursive render XXX", t.nodes()) : i.info("No nodes found for", t), t.edges().length > 0 && i.info("Recursive edges", t.edge(t.edges()[0]));
246
- const l = u.insert("g").attr("class", "clusters"), v = u.insert("g").attr("class", "edgePaths"), C = u.insert("g").attr("class", "edgeLabels"), g = u.insert("g").attr("class", "nodes");
247
- await Promise.all(
248
- t.nodes().map(async function(d) {
249
- const s = t.node(d);
250
- if (c !== void 0) {
251
- const w = JSON.parse(JSON.stringify(c.clusterData));
252
- i.trace(
253
- `Setting data for parent cluster XXX
254
- Node.id = `,
255
- d,
256
- `
257
- data=`,
258
- w.height,
259
- `
260
- Parent cluster`,
261
- c.height
262
- ), t.setNode(c.id, w), t.parent(d) || (i.trace("Setting parent", d, c.id), t.setParent(d, c.id, w));
263
- }
264
- if (i.info("(Insert) Node XXX" + d + ": " + JSON.stringify(t.node(d))), s != null && s.clusterNode) {
265
- i.info("Cluster identified XBX", d, s.width, t.node(d));
266
- const { ranksep: w, nodesep: m } = t.graph();
267
- s.graph.setGraph({
268
- ...s.graph.graph(),
269
- ranksep: w + 25,
270
- nodesep: m
271
- });
272
- const N = await j(
273
- g,
274
- s.graph,
275
- n,
276
- o,
277
- t.node(d),
278
- a
279
- ), S = N.elem;
280
- z(s, S), s.diff = N.diff || 0, i.info(
281
- "New compound node after recursive render XAX",
282
- d,
283
- "width",
284
- // node,
285
- s.width,
286
- "height",
287
- s.height
288
- // node.x,
289
- // node.y
290
- ), U(S, s);
291
- } else
292
- t.children(d).length > 0 ? (i.trace(
293
- "Cluster - the non recursive path XBX",
294
- d,
295
- s.id,
296
- s,
297
- s.width,
298
- "Graph:",
299
- t
300
- ), i.trace(D(s.id, t)), f.set(s.id, { id: D(s.id, t), node: s })) : (i.trace("Node - the non recursive path XAX", d, g, t.node(d), r), await $(g, t.node(d), { config: a, dir: r }));
301
- })
302
- ), await (/* @__PURE__ */ X(async () => {
303
- const d = t.edges().map(async function(s) {
304
- const w = t.edge(s.v, s.w, s.name);
305
- i.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), i.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), i.info(
306
- "Fix",
307
- f,
308
- "ids:",
309
- s.v,
310
- s.w,
311
- "Translating: ",
312
- f.get(s.v),
313
- f.get(s.w)
314
- ), await Z(C, w);
315
- });
316
- await Promise.all(d);
317
- }, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(p(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.info("Graph after layout:", JSON.stringify(p(t)));
318
- let E = 0, { subGraphTitleTotalMargin: y } = q(a);
319
- return await Promise.all(
320
- oe(t).map(async function(d) {
321
- var w;
322
- const s = t.node(d);
323
- if (i.info(
324
- "Position XBX => " + d + ": (" + s.x,
325
- "," + s.y,
326
- ") width: ",
327
- s.width,
328
- " height: ",
329
- s.height
330
- ), s != null && s.clusterNode)
331
- s.y += y, i.info(
332
- "A tainted cluster node XBX1",
333
- d,
334
- s.id,
335
- s.width,
336
- s.height,
337
- s.x,
338
- s.y,
339
- t.parent(d)
340
- ), f.get(s.id).node = s, P(s);
341
- else if (t.children(d).length > 0) {
342
- i.info(
343
- "A pure cluster node XBX1",
344
- d,
345
- s.id,
346
- s.x,
347
- s.y,
348
- s.width,
349
- s.height,
350
- t.parent(d)
351
- ), s.height += y, t.node(s.parentId);
352
- const m = (s == null ? void 0 : s.padding) / 2 || 0, N = ((w = s == null ? void 0 : s.labelBBox) == null ? void 0 : w.height) || 0, S = N - m || 0;
353
- i.debug("OffsetY", S, "labelHeight", N, "halfPadding", m), await K(l, s), f.get(s.id).node = s;
354
- } else {
355
- const m = t.node(s.parentId);
356
- s.y += y / 2, i.info(
357
- "A regular node XBX1 - using the padding",
358
- s.id,
359
- "parent",
360
- s.parentId,
361
- s.width,
362
- s.height,
363
- s.x,
364
- s.y,
365
- "offsetY",
366
- s.offsetY,
367
- "parent",
368
- m,
369
- m == null ? void 0 : m.offsetY,
370
- s
371
- ), P(s);
372
- }
373
- })
374
- ), t.edges().forEach(function(d) {
375
- const s = t.edge(d);
376
- i.info("Edge " + d.v + " -> " + d.w + ": " + JSON.stringify(s), s), s.points.forEach((S) => S.y += y / 2);
377
- const w = t.node(d.v);
378
- var m = t.node(d.w);
379
- const N = Q(v, s, f, n, w, m, o);
380
- W(s, N);
381
- }), t.nodes().forEach(function(d) {
382
- const s = t.node(d);
383
- i.info(d, s.type, s.diff), s.isGroup && (E = s.diff);
384
- }), i.warn("Returning from recursive render XAX", u, E), { elem: u, diff: E };
385
- }, "recursiveRender"), ue = /* @__PURE__ */ X(async (e, t) => {
386
- var a, r, u, l, v, C;
387
- const n = new B({
388
- multigraph: !0,
389
- compound: !0
390
- }).setGraph({
391
- rankdir: e.direction,
392
- nodesep: ((a = e.config) == null ? void 0 : a.nodeSpacing) || ((u = (r = e.config) == null ? void 0 : r.flowchart) == null ? void 0 : u.nodeSpacing) || e.nodeSpacing,
393
- ranksep: ((l = e.config) == null ? void 0 : l.rankSpacing) || ((C = (v = e.config) == null ? void 0 : v.flowchart) == null ? void 0 : C.rankSpacing) || e.rankSpacing,
394
- marginx: 8,
395
- marginy: 8
396
- }).setDefaultEdgeLabel(function() {
397
- return {};
398
- }), o = t.select("g");
399
- F(o, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((g) => {
400
- n.setNode(g.id, { ...g }), g.parentId && n.setParent(g.id, g.parentId);
401
- }), i.debug("Edges:", e.edges), e.edges.forEach((g) => {
402
- if (g.start === g.end) {
403
- const h = g.start, E = h + "---" + h + "---1", y = h + "---" + h + "---2", d = n.node(h);
404
- n.setNode(E, {
405
- domId: E,
406
- id: E,
407
- parentId: d.parentId,
408
- labelStyle: "",
409
- label: "",
410
- padding: 0,
411
- shape: "labelRect",
412
- // shape: 'rect',
413
- style: "",
414
- width: 10,
415
- height: 10
416
- }), n.setParent(E, d.parentId), n.setNode(y, {
417
- domId: y,
418
- id: y,
419
- parentId: d.parentId,
420
- labelStyle: "",
421
- padding: 0,
422
- // shape: 'rect',
423
- shape: "labelRect",
424
- label: "",
425
- style: "",
426
- width: 10,
427
- height: 10
428
- }), n.setParent(y, d.parentId);
429
- const s = structuredClone(g), w = structuredClone(g), m = structuredClone(g);
430
- s.label = "", s.arrowTypeEnd = "none", s.id = h + "-cyclic-special-1", w.arrowTypeStart = "none", w.arrowTypeEnd = "none", w.id = h + "-cyclic-special-mid", m.label = "", d.isGroup && (s.fromCluster = h, m.toCluster = h), m.id = h + "-cyclic-special-2", m.arrowTypeStart = "none", n.setEdge(h, E, s, h + "-cyclic-special-0"), n.setEdge(E, y, w, h + "-cyclic-special-1"), n.setEdge(y, h, m, h + "-cyc<lic-special-2");
431
- } else
432
- n.setEdge(g.start, g.end, { ...g }, g.id);
433
- }), i.warn("Graph at first:", JSON.stringify(p(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(p(n)));
434
- const c = V();
435
- await j(
436
- o,
437
- n,
438
- e.type,
439
- e.diagramId,
440
- void 0,
441
- c
442
- );
443
- }, "render");
444
- export {
445
- ue as render
446
- };
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CkYZRBYn.js"),b=require("./graph-BNpx6ebg.js"),G=require("./layout-CuWQnP5Y.js"),R=require("./clone-B0UaPT2Z.js"),O=require("./min-CppMRDFn.js");function E(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:j(e)};return b.isUndefined(e.graph())||(o.value=R.clone(e.graph())),o}function M(e){return O.map(e.nodes(),function(o){var n=e.node(o),r=e.parent(o),c={v:o};return b.isUndefined(n)||(c.value=n),b.isUndefined(r)||(c.parent=r),c})}function j(e){return O.map(e.edges(),function(o){var n=e.edge(o),r={v:o.v,w:o.w};return b.isUndefined(o.name)||(r.name=o.name),b.isUndefined(n)||(r.value=n),r})}var f=new Map,p=new Map,P=new Map,q=t.__name(()=>{p.clear(),P.clear(),f.clear()},"clear"),x=t.__name((e,o)=>{const n=p.get(o)||[];return t.log.trace("In isDescendant",o," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),F=t.__name((e,o)=>{const n=p.get(o)||[];return t.log.info("Descendants of ",o," is ",n),t.log.info("Edge is ",e),e.v===o||e.w===o?!1:n?n.includes(e.v)||x(e.v,o)||x(e.w,o)||n.includes(e.w):(t.log.debug("Tilt, ",o,",not in descendants"),!1)},"edgeInCluster"),k=t.__name((e,o,n,r)=>{t.log.warn("Copying children of ",e,"root",r,"data",o.node(e),r);const c=o.children(e)||[];e!==r&&c.push(e),t.log.warn("Copying (nodes) clusterId",e,"nodes",c),c.forEach(l=>{if(o.children(l).length>0)k(l,o,n,r);else{const s=o.node(l);t.log.info("cp ",l," to ",r," with parent ",e),n.setNode(l,s),r!==o.parent(l)&&(t.log.warn("Setting parent",l,o.parent(l)),n.setParent(l,o.parent(l))),e!==r&&l!==e?(t.log.debug("Setting parent",l,e),n.setParent(l,e)):(t.log.info("In copy ",e,"root",r,"data",o.node(e),r),t.log.debug("Not Setting parent for node=",l,"cluster!==rootId",e!==r,"node!==clusterId",l!==e));const g=o.edges(l);t.log.debug("Copying Edges",g),g.forEach(d=>{t.log.info("Edge",d);const v=o.edge(d.v,d.w,d.name);t.log.info("Edge data",v,r);try{F(d,r)?(t.log.info("Copying as ",d.v,d.w,v,d.name),n.setEdge(d.v,d.w,v,d.name),t.log.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):t.log.info("Skipping copy of edge ",d.v,"-->",d.w," rootId: ",r," clusterId:",e)}catch(C){t.log.error(C)}})}t.log.debug("Removing node",l),o.removeNode(l)})},"copy"),B=t.__name((e,o)=>{const n=o.children(e);let r=[...n];for(const c of n)P.set(c,e),r=[...r,...B(c,o)];return r},"extractDescendants"),U=t.__name((e,o,n)=>{const r=e.edges().filter(d=>d.v===o||d.w===o),c=e.edges().filter(d=>d.v===n||d.w===n),l=r.map(d=>({v:d.v===o?n:d.v,w:d.w===o?o:d.w})),s=c.map(d=>({v:d.v,w:d.w}));return l.filter(d=>s.some(v=>d.v===v.v&&d.w===v.w))},"findCommonEdges"),_=t.__name((e,o,n)=>{const r=o.children(e);if(t.log.trace("Searching children of id ",e,r),r.length<1)return e;let c;for(const l of r){const s=_(l,o,n),g=U(o,n,s);if(s)if(g.length>0)c=s;else return s}return c},"findNonClusterChild"),D=t.__name(e=>!f.has(e)||!f.get(e).externalConnections?e:f.has(e)?f.get(e).id:e,"getAnchorId"),Y=t.__name((e,o)=>{if(!e||o>10){t.log.debug("Opting out, no graph ");return}else t.log.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(t.log.warn("Cluster identified",n," Replacement id in edges: ",_(n,e,n)),p.set(n,B(n,e)),f.set(n,{id:_(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const r=e.children(n),c=e.edges();r.length>0?(t.log.debug("Cluster identified",n,p),c.forEach(l=>{const s=x(l.v,n),g=x(l.w,n);s^g&&(t.log.warn("Edge: ",l," leaves cluster ",n),t.log.warn("Descendants of XXX ",n,": ",p.get(n)),f.get(n).externalConnections=!0)})):t.log.debug("Not a cluster ",n,p)});for(let n of f.keys()){const r=f.get(n).id,c=e.parent(r);c!==n&&f.has(c)&&!f.get(c).externalConnections&&(f.get(n).id=c)}e.edges().forEach(function(n){const r=e.edge(n);t.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),t.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let c=n.v,l=n.w;if(t.log.warn("Fix XXX",f,"ids:",n.v,n.w,"Translating: ",f.get(n.v)," --- ",f.get(n.w)),f.get(n.v)||f.get(n.w)){if(t.log.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),c=D(n.v),l=D(n.w),e.removeEdge(n.v,n.w,n.name),c!==n.v){const s=e.parent(c);f.get(s).externalConnections=!0,r.fromCluster=n.v}if(l!==n.w){const s=e.parent(l);f.get(s).externalConnections=!0,r.toCluster=n.w}t.log.warn("Fix Replacing with XXX",c,l,n.name),e.setEdge(c,l,r,n.name)}}),t.log.warn("Adjusted Graph",E(e)),A(e,0),t.log.trace(f)},"adjustClustersAndEdges"),A=t.__name((e,o)=>{var c,l;if(t.log.warn("extractor - ",o,E(e),e.children("D")),o>10){t.log.error("Bailing out");return}let n=e.nodes(),r=!1;for(const s of n){const g=e.children(s);r=r||g.length>0}if(!r){t.log.debug("Done, no node has children",e.nodes());return}t.log.debug("Nodes = ",n,o);for(const s of n)if(t.log.debug("Extracting node",s,f,f.has(s)&&!f.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",o),!f.has(s))t.log.debug("Not a cluster",s,o);else if(!f.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){t.log.warn("Cluster without external connections, without a parent and with children",s,o);let d=e.graph().rankdir==="TB"?"LR":"TB";(l=(c=f.get(s))==null?void 0:c.clusterData)!=null&&l.dir&&(d=f.get(s).clusterData.dir,t.log.warn("Fixing dir",f.get(s).clusterData.dir,d));const v=new b.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});t.log.warn("Old graph before copy",E(e)),k(s,e,v,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:f.get(s).clusterData,label:f.get(s).label,graph:v}),t.log.warn("New graph after copy node: (",s,")",E(v)),t.log.debug("Old graph after copy",E(e))}else t.log.warn("Cluster ** ",s," **not meeting the criteria !externalConnections:",!f.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),o),t.log.debug(f);n=e.nodes(),t.log.warn("New list of nodes",n);for(const s of n){const g=e.node(s);t.log.warn(" Now next level",s,g),g!=null&&g.clusterNode&&A(g.graph,o+1)}},"extractor"),J=t.__name((e,o)=>{if(o.length===0)return[];let n=Object.assign([],o);return o.forEach(r=>{const c=e.children(r),l=J(e,c);n=[...n,...l]}),n},"sorter"),H=t.__name(e=>J(e,e.children()),"sortNodesByHierarchy"),T=t.__name(async(e,o,n,r,c,l)=>{t.log.warn("Graph in recursive render:XAX",E(o),c);const s=o.graph().rankdir;t.log.trace("Dir in recursive render - dir:",s);const g=e.insert("g").attr("class","root");o.nodes()?t.log.info("Recursive render XXX",o.nodes()):t.log.info("No nodes found for",o),o.edges().length>0&&t.log.info("Recursive edges",o.edge(o.edges()[0]));const d=g.insert("g").attr("class","clusters"),v=g.insert("g").attr("class","edgePaths"),C=g.insert("g").attr("class","edgeLabels"),u=g.insert("g").attr("class","nodes");await Promise.all(o.nodes().map(async function(a){const i=o.node(a);if(c!==void 0){const w=JSON.parse(JSON.stringify(c.clusterData));t.log.trace(`Setting data for parent cluster XXX
2
- Node.id = `,a,`
3
- data=`,w.height,`
4
- Parent cluster`,c.height),o.setNode(c.id,w),o.parent(a)||(t.log.trace("Setting parent",a,c.id),o.setParent(a,c.id,w))}if(t.log.info("(Insert) Node XXX"+a+": "+JSON.stringify(o.node(a))),i!=null&&i.clusterNode){t.log.info("Cluster identified XBX",a,i.width,o.node(a));const{ranksep:w,nodesep:m}=o.graph();i.graph.setGraph({...i.graph.graph(),ranksep:w+25,nodesep:m});const N=await T(u,i.graph,n,r,o.node(a),l),S=N.elem;t.updateNodeBounds(i,S),i.diff=N.diff||0,t.log.info("New compound node after recursive render XAX",a,"width",i.width,"height",i.height),t.setNodeElem(S,i)}else o.children(a).length>0?(t.log.trace("Cluster - the non recursive path XBX",a,i.id,i,i.width,"Graph:",o),t.log.trace(_(i.id,o)),f.set(i.id,{id:_(i.id,o),node:i})):(t.log.trace("Node - the non recursive path XAX",a,u,o.node(a),s),await t.insertNode(u,o.node(a),{config:l,dir:s}))})),await t.__name(async()=>{const a=o.edges().map(async function(i){const w=o.edge(i.v,i.w,i.name);t.log.info("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(i)),t.log.info("Edge "+i.v+" -> "+i.w+": ",i," ",JSON.stringify(o.edge(i))),t.log.info("Fix",f,"ids:",i.v,i.w,"Translating: ",f.get(i.v),f.get(i.w)),await t.insertEdgeLabel(C,w)});await Promise.all(a)},"processEdges")(),t.log.info("Graph before layout:",JSON.stringify(E(o))),t.log.info("############################################# XXX"),t.log.info("### Layout ### XXX"),t.log.info("############################################# XXX"),G.layout(o),t.log.info("Graph after layout:",JSON.stringify(E(o)));let X=0,{subGraphTitleTotalMargin:y}=t.getSubGraphTitleMargins(l);return await Promise.all(H(o).map(async function(a){var w;const i=o.node(a);if(t.log.info("Position XBX => "+a+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i!=null&&i.clusterNode)i.y+=y,t.log.info("A tainted cluster node XBX1",a,i.id,i.width,i.height,i.x,i.y,o.parent(a)),f.get(i.id).node=i,t.positionNode(i);else if(o.children(a).length>0){t.log.info("A pure cluster node XBX1",a,i.id,i.x,i.y,i.width,i.height,o.parent(a)),i.height+=y,o.node(i.parentId);const m=(i==null?void 0:i.padding)/2||0,N=((w=i==null?void 0:i.labelBBox)==null?void 0:w.height)||0,S=N-m||0;t.log.debug("OffsetY",S,"labelHeight",N,"halfPadding",m),await t.insertCluster(d,i),f.get(i.id).node=i}else{const m=o.node(i.parentId);i.y+=y/2,t.log.info("A regular node XBX1 - using the padding",i.id,"parent",i.parentId,i.width,i.height,i.x,i.y,"offsetY",i.offsetY,"parent",m,m==null?void 0:m.offsetY,i),t.positionNode(i)}})),o.edges().forEach(function(a){const i=o.edge(a);t.log.info("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i),i),i.points.forEach(S=>S.y+=y/2);const w=o.node(a.v);var m=o.node(a.w);const N=t.insertEdge(v,i,f,n,w,m,r);t.positionEdgeLabel(i,N)}),o.nodes().forEach(function(a){const i=o.node(a);t.log.info(a,i.type,i.diff),i.isGroup&&(X=i.diff)}),t.log.warn("Returning from recursive render XAX",g,X),{elem:g,diff:X}},"recursiveRender"),V=t.__name(async(e,o)=>{var l,s,g,d,v,C;const n=new b.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((l=e.config)==null?void 0:l.nodeSpacing)||((g=(s=e.config)==null?void 0:s.flowchart)==null?void 0:g.nodeSpacing)||e.nodeSpacing,ranksep:((d=e.config)==null?void 0:d.rankSpacing)||((C=(v=e.config)==null?void 0:v.flowchart)==null?void 0:C.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),r=o.select("g");t.markers_default(r,e.markers,e.type,e.diagramId),t.clear2(),t.clear$1(),t.clear$2(),q(),e.nodes.forEach(u=>{n.setNode(u.id,{...u}),u.parentId&&n.setParent(u.id,u.parentId)}),t.log.debug("Edges:",e.edges),e.edges.forEach(u=>{if(u.start===u.end){const h=u.start,X=h+"---"+h+"---1",y=h+"---"+h+"---2",a=n.node(h);n.setNode(X,{domId:X,id:X,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(X,a.parentId),n.setNode(y,{domId:y,id:y,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(y,a.parentId);const i=structuredClone(u),w=structuredClone(u),m=structuredClone(u);i.label="",i.arrowTypeEnd="none",i.id=h+"-cyclic-special-1",w.arrowTypeStart="none",w.arrowTypeEnd="none",w.id=h+"-cyclic-special-mid",m.label="",a.isGroup&&(i.fromCluster=h,m.toCluster=h),m.id=h+"-cyclic-special-2",m.arrowTypeStart="none",n.setEdge(h,X,i,h+"-cyclic-special-0"),n.setEdge(X,y,w,h+"-cyclic-special-1"),n.setEdge(y,h,m,h+"-cyc<lic-special-2")}else n.setEdge(u.start,u.end,{...u},u.id)}),t.log.warn("Graph at first:",JSON.stringify(E(n))),Y(n),t.log.warn("Graph after XAX:",JSON.stringify(E(n)));const c=t.getConfig2();await T(r,n,e.type,e.diagramId,void 0,c)},"render");exports.render=V;
@@ -1,24 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-CkYZRBYn.js"),se=require("./chunk-QN33PNHL-B0sO38bZ.js"),ie=require("./chunk-4BX2VUAB-BwubFldI.js"),oe=require("./mermaid-parser.core-BHAgLMGa.js"),I=require("./defaultLocale-C4wbwF1n.js"),U=require("./ordinal-CPpcdEvZ.js");function ce(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function de(){return this.eachAfter(ce)}function ue(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function he(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function pe(t,a){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)t.call(a,l,++m,this);return this}function fe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function ge(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,o=n&&n.length;--o>=0;)l+=n[o].value;a.value=l})}function me(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ye(t){for(var a=this,l=Se(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Se(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function ve(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function xe(){return Array.from(this)}function be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function we(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ce(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Le)):a===void 0&&(a=Te);for(var l=new j(t),n,o=[l],s,d,h,m;n=o.pop();)if((d=a(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new j(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ae)}function _e(){return Q(this).eachBefore($e)}function Te(t){return t.children}function Le(t){return Array.isArray(t)?t[1]:null}function $e(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ae(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=Q.prototype={constructor:j,count:de,each:ue,eachAfter:pe,eachBefore:he,find:fe,sum:ge,sort:me,path:ye,ancestors:ve,descendants:xe,leaves:be,links:we,copy:_e,[Symbol.iterator]:Ce};function ke(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Ne(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Me(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(n-a)/t.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=a,d.x1=a+=d.value*c}function Fe(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(o-l)/t.value;++h<m;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var ze=(1+Math.sqrt(5))/2;function Ve(t,a,l,n,o,s){for(var d=[],h=a.children,m,c,p=0,w=0,r=h.length,b,v,x=a.value,f,y,N,k,V,R,M;p<r;){b=o-l,v=s-n;do f=h[w++].value;while(!f&&w<r);for(y=N=f,R=Math.max(v/b,b/v)/(x*t),M=f*f*R,V=Math.max(N/M,M/y);w<r;++w){if(f+=c=h[w].value,c<y&&(y=c),c>N&&(N=c),M=f*f*R,k=Math.max(N/M,M/y),k>V){f-=c;break}V=k}d.push(m={value:f,dice:b<v,children:h.slice(p,w)}),m.dice?Me(m,l,n,o,x?n+=v*f/x:s):Fe(m,l,n,x?l+=b*f/x:o,s),x-=f,p=w}return d}const Pe=function t(a){function l(n,o,s,d,h){Ve(a,n,o,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(ze);function Be(){var t=Pe,a=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(w),o=[0],a&&r.eachBefore(Ne),r}function w(r){var b=o[r.depth],v=r.x0+b,x=r.y0+b,f=r.x1-b,y=r.y1-b;f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),r.x0=v,r.y0=x,r.x1=f,r.y1=y,r.children&&(b=o[r.depth+1]=s(r)/2,v+=c(r)-b,x+=d(r)-b,f-=h(r)-b,y-=m(r)-b,f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),t(r,v,x,f,y))}return p.round=function(r){return arguments.length?(a=!!r,p):a},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(t=ke(r),p):t},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:O(+r),p):s},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:O(+r),p):d},p.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:O(+r),p):h},p.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:O(+r),p):m},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:O(+r),p):c},p}var D,J=(D=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u.setAccTitle,this.getAccTitle=u.getAccTitle,this.setDiagramTitle=u.setDiagramTitle,this.getDiagramTitle=u.getDiagramTitle,this.getAccDescription=u.getAccDescription,this.setAccDescription=u.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=u.defaultConfig_default,l=u.getConfig();return u.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{u.isLabelStyle(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){u.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},u.__name(D,"TreeMapDB"),D);function K(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}u.__name(K,"buildHierarchy");var De=u.__name((t,a)=>{ie.populateCommonDb(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=Re(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,w={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=K(l),o=u.__name((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),Re=u.__name(t=>t.name?String(t.name):"","getItemName"),ee={parser:{yy:void 0},parse:u.__name(async t=>{var a;try{const l=oe.parse,n=await l("treemap",t);u.log.debug("Treemap AST:",n);const o=(a=ee.parser)==null?void 0:a.yy;if(!(o instanceof J))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");De(n,o)}catch(l){throw u.log.error("Error parsing treemap:",l),l}},"parse")},Ee=10,B=10,G=25,We=u.__name((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??Ee,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=u.getConfig();if(!m)return;const p=h?30:0,w=u.selectSvgElement(a),r=s.nodeWidth?s.nodeWidth*B:960,b=s.nodeHeight?s.nodeHeight*B:500,v=r,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),u.configureSvgSize(w,x,v,s.useMaxWidth);let f;try{const e=s.valueFormat||",";if(e==="$0,0")f=u.__name(i=>"$"+I.format(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),g=i?i[0]:"";f=u.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);f=u.__name(g=>"$"+I.format(i||"")(g),"valueFormat")}else f=I.format(e)}catch(e){u.log.error("Error creating format function:",e),f=I.format(",")}const y=U.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=U.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=U.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=Be().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(R),te=Z.descendants().filter(e=>e.children&&e.children.length>0),E=V.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),E.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=u.select(this),g=e.data.name;i.text(g);const C=e.x1-e.x0,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),S=i.node();if(S.getComputedTextLength()>A){const _="...";let T=g;for(;T.length>0;){if(T=g.substring(0,T.length-1),T.length===0){i.text(_),S.getComputedTextLength()>A&&i.text("");break}if(i.text(T+_),S.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")});const ae=Z.leaves(),X=V.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);X.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=u.select(this),g=e.x1-e.x0,C=e.y1-e.y0,L=i.node(),$=4,P=g-2*$,A=C-2*$;if(P<10||A<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,_=28,T=.6,z=6,W=2;for(;L.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(_,Math.round(S*T))),Y=S+W+H;for(;Y>A&&S>F&&(S--,H=Math.max(z,Math.min(_,Math.round(S*T))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(L.getComputedTextLength()>P||S<F||A<S)&&i.style("display","none")}),s.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const g="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=u.styles2String({cssCompiledStyles:i.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,g)=>`url(#clip-${a}-${g})`).text(i=>i.value?f(i.value):"").each(function(i){const g=u.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const L=u.select(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){g.style("display","none");return}const $=parseFloat(L.style("font-size")),P=28,A=.6,S=6,F=2,_=Math.max(S,Math.min(P,Math.round($*A)));g.style("font-size",`${_}px`);const z=(i.y1-i.y0)/2+$/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-2*4;g.node().getComputedTextLength()>re||z+_>le||_<S?g.style("display","none"):g.style("display",null)});const ne=s.diagramPadding??8;se.setupViewPortForSVG(w,ne,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),He=u.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ie={draw:We,getClasses:He},qe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},Oe=u.__name(({treemap:t}={})=>{const a=u.cleanAndMerge(qe,t);return`
2
- .treemapNode.section {
3
- stroke: ${a.sectionStrokeColor};
4
- stroke-width: ${a.sectionStrokeWidth};
5
- fill: ${a.sectionFillColor};
6
- }
7
- .treemapNode.leaf {
8
- stroke: ${a.leafStrokeColor};
9
- stroke-width: ${a.leafStrokeWidth};
10
- fill: ${a.leafFillColor};
11
- }
12
- .treemapLabel {
13
- fill: ${a.labelColor};
14
- font-size: ${a.labelFontSize};
15
- }
16
- .treemapValue {
17
- fill: ${a.valueColor};
18
- font-size: ${a.valueFontSize};
19
- }
20
- .treemapTitle {
21
- fill: ${a.titleColor};
22
- font-size: ${a.titleFontSize};
23
- }
24
- `},"getStyles"),Ge=Oe,Xe={parser:ee,get db(){return new J},renderer:Ie,styles:Ge};exports.diagram=Xe;
@@ -1,43 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CkYZRBYn.js"),L=require("./chunk-4BX2VUAB-BwubFldI.js"),O=require("./mermaid-parser.core-BHAgLMGa.js");var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y={axes:[],curves:[],options:h},p=structuredClone(y),S=s.defaultConfig_default.radar,k=s.__name(()=>s.cleanAndMerge({...S,...s.getConfig().radar}),"getConfig"),f=s.__name(()=>p.axes,"getAxes"),D=s.__name(()=>p.curves,"getCurves"),R=s.__name(()=>p.options,"getOptions"),I=s.__name(a=>{p.axes=a.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),E=s.__name(a=>{p.curves=a.map(e=>({name:e.name,label:e.label??e.name,entries:F(e.entries)}))},"setCurves"),F=s.__name(a=>{if(a[0].axis==null)return a.map(t=>t.value);const e=f();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(t=>{const r=a.find(n=>{var o;return((o=n.axis)==null?void 0:o.$refText)===t.name});if(r===void 0)throw new Error("Missing entry for axis "+t.label);return r.value})},"computeCurveEntries"),P=s.__name(a=>{var t,r,n,o,l;const e=a.reduce((i,c)=>(i[c.name]=c,i),{});p.options={showLegend:((t=e.showLegend)==null?void 0:t.value)??h.showLegend,ticks:((r=e.ticks)==null?void 0:r.value)??h.ticks,max:((n=e.max)==null?void 0:n.value)??h.max,min:((o=e.min)==null?void 0:o.value)??h.min,graticule:((l=e.graticule)==null?void 0:l.value)??h.graticule}},"setOptions"),G=s.__name(()=>{s.clear(),p=structuredClone(y)},"clear"),_={getAxes:f,getCurves:D,getOptions:R,setAxes:I,setCurves:E,setOptions:P,getConfig:k,clear:G,setAccTitle:s.setAccTitle,getAccTitle:s.getAccTitle,setDiagramTitle:s.setDiagramTitle,getDiagramTitle:s.getDiagramTitle,getAccDescription:s.getAccDescription,setAccDescription:s.setAccDescription},z=s.__name(a=>{L.populateCommonDb(a,_);const{axes:e,curves:t,options:r}=a;_.setAxes(e),_.setCurves(t),_.setOptions(r)},"populate"),B={parse:s.__name(async a=>{const e=await O.parse("radar",a);s.log.debug(e),z(e)},"parse")},V=s.__name((a,e,t,r)=>{const n=r.db,o=n.getAxes(),l=n.getCurves(),i=n.getOptions(),c=n.getConfig(),d=n.getDiagramTitle(),m=s.selectSvgElement(e),u=W(m,c),g=i.max??Math.max(...l.map($=>Math.max(...$.entries))),x=i.min,v=Math.min(c.width,c.height)/2;j(u,o,v,i.ticks,i.graticule),q(u,o,v,c),C(u,o,l,x,g,i.graticule,c),A(u,l,i.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),W=s.__name((a,e)=>{const t=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return a.attr("viewbox",`0 0 ${t} ${r}`).attr("width",t).attr("height",r),a.append("g").attr("transform",`translate(${n.x}, ${n.y})`)},"drawFrame"),j=s.__name((a,e,t,r,n)=>{if(n==="circle")for(let o=0;o<r;o++){const l=t*(o+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(n==="polygon"){const o=e.length;for(let l=0;l<r;l++){const i=t*(l+1)/r,c=e.map((d,m)=>{const u=2*m*Math.PI/o-Math.PI/2,g=i*Math.cos(u),x=i*Math.sin(u);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),q=s.__name((a,e,t,r)=>{const n=e.length;for(let o=0;o<n;o++){const l=e[o].label,i=2*o*Math.PI/n-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",t*r.axisScaleFactor*Math.cos(i)).attr("y2",t*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",t*r.axisLabelFactor*Math.cos(i)).attr("y",t*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,e,t,r,n,o,l){const i=e.length,c=Math.min(l.width,l.height)/2;t.forEach((d,m)=>{if(d.entries.length!==i)return;const u=d.entries.map((g,x)=>{const v=2*Math.PI*x/i-Math.PI/2,$=w(g,r,n,c),M=$*Math.cos(v),T=$*Math.sin(v);return{x:M,y:T}});o==="circle"?a.append("path").attr("d",b(u,l.curveTension)).attr("class",`radarCurve-${m}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}s.__name(C,"drawCurves");function w(a,e,t,r){const n=Math.min(Math.max(a,e),t);return r*(n-e)/(t-e)}s.__name(w,"relativeRadius");function b(a,e){const t=a.length;let r=`M${a[0].x},${a[0].y}`;for(let n=0;n<t;n++){const o=a[(n-1+t)%t],l=a[n],i=a[(n+1)%t],c=a[(n+2)%t],d={x:l.x+(i.x-o.x)*e,y:l.y+(i.y-o.y)*e},m={x:i.x-(c.x-l.x)*e,y:i.y-(c.y-l.y)*e};r+=` C${d.x},${d.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${r} Z`}s.__name(b,"closedRoundCurve");function A(a,e,t,r){if(!t)return;const n=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,l=20;e.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${n}, ${o+c*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}s.__name(A,"drawLegend");var H={draw:V},U=s.__name((a,e)=>{let t="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const n=a[`cScale${r}`];t+=`
2
- .radarCurve-${r} {
3
- color: ${n};
4
- fill: ${n};
5
- fill-opacity: ${e.curveOpacity};
6
- stroke: ${n};
7
- stroke-width: ${e.curveStrokeWidth};
8
- }
9
- .radarLegendBox-${r} {
10
- fill: ${n};
11
- fill-opacity: ${e.curveOpacity};
12
- stroke: ${n};
13
- }
14
- `}return t},"genIndexStyles"),X=s.__name(a=>{const e=s.getThemeVariables3(),t=s.getConfig(),r=s.cleanAndMerge(e,t.themeVariables),n=s.cleanAndMerge(r.radar,a);return{themeVariables:r,radarOptions:n}},"buildRadarStyleOptions"),N=s.__name(({radar:a}={})=>{const{themeVariables:e,radarOptions:t}=X(a);return`
15
- .radarTitle {
16
- font-size: ${e.fontSize};
17
- color: ${e.titleColor};
18
- dominant-baseline: hanging;
19
- text-anchor: middle;
20
- }
21
- .radarAxisLine {
22
- stroke: ${t.axisColor};
23
- stroke-width: ${t.axisStrokeWidth};
24
- }
25
- .radarAxisLabel {
26
- dominant-baseline: middle;
27
- text-anchor: middle;
28
- font-size: ${t.axisLabelFontSize}px;
29
- color: ${t.axisColor};
30
- }
31
- .radarGraticule {
32
- fill: ${t.graticuleColor};
33
- fill-opacity: ${t.graticuleOpacity};
34
- stroke: ${t.graticuleColor};
35
- stroke-width: ${t.graticuleStrokeWidth};
36
- }
37
- .radarLegendText {
38
- text-anchor: start;
39
- font-size: ${t.legendFontSize}px;
40
- dominant-baseline: hanging;
41
- }
42
- ${U(e,t)}
43
- `},"styles"),Y={parser:B,db:_,renderer:H,styles:N};exports.diagram=Y;
@@ -1,24 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CkYZRBYn.js"),y=require("./chunk-4BX2VUAB-BwubFldI.js"),B=require("./mermaid-parser.core-BHAgLMGa.js");var $=a.defaultConfig_default.packet,b,m=(b=class{constructor(){this.packet=[],this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getAccDescription=a.getAccDescription,this.setAccDescription=a.setAccDescription}getConfig(){const t=a.cleanAndMerge({...$,...a.getConfig().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){a.clear(),this.packet=[]}},a.__name(b,"PacketDB"),b),C=1e4,_=a.__name((e,t)=>{y.populateCommonDb(e,t);let i=-1,o=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:n,bits:p,label:d}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??(r=i+1),r!==i+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${i+1}.`);if(p===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??(n=r+(p??1)-1),p??(p=n-r+1),i=n,a.log.debug(`Packet block ${r} - ${i} with label ${d}`);o.length<=c+1&&t.getPacket().length<C;){const[g,s]=S({start:r,end:n,bits:p,label:d},l,c);if(o.push(g),g.end+1===l*c&&(t.pushWord(o),o=[],l++),!s)break;({start:r,end:n,bits:p,label:d}=s)}}t.pushWord(o)},"populate"),S=a.__name((e,t,i)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*i)return[e,void 0];const o=t*i-1,l=t*i;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),w={parser:{yy:void 0},parse:a.__name(async e=>{var o;const t=await B.parse("packet",e),i=(o=w.parser)==null?void 0:o.yy;if(!(i instanceof m))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.log.debug(t),_(t,i)},"parse")},P=a.__name((e,t,i,o)=>{const l=o.db,c=l.getConfig(),{rowHeight:r,paddingY:n,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),s=l.getDiagramTitle(),k=r+n,h=k*(g.length+1)-(s?0:r),f=p*d+2,u=a.selectSvgElement(t);u.attr("viewbox",`0 0 ${f} ${h}`),a.configureSvgSize(u,h,f,c.useMaxWidth);for(const[v,x]of g.entries())T(u,x,v,c);u.append("text").text(s).attr("x",f/2).attr("y",h-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),T=a.__name((e,t,i,{rowHeight:o,paddingX:l,paddingY:c,bitWidth:r,bitsPerRow:n,showBits:p})=>{const d=e.append("g"),g=i*(o+c)+c;for(const s of t){const k=s.start%n*r+1,h=(s.end-s.start+1)*r-l;if(d.append("rect").attr("x",k).attr("y",g).attr("width",h).attr("height",o).attr("class","packetBlock"),d.append("text").attr("x",k+h/2).attr("y",g+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!p)continue;const f=s.end===s.start,u=g-2;d.append("text").attr("x",k+(f?h/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||d.append("text").attr("x",k+h).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),D={draw:P},A={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(A,e);return`
2
- .packetByte {
3
- font-size: ${t.byteFontSize};
4
- }
5
- .packetByte.start {
6
- fill: ${t.startByteColor};
7
- }
8
- .packetByte.end {
9
- fill: ${t.endByteColor};
10
- }
11
- .packetLabel {
12
- fill: ${t.labelColor};
13
- font-size: ${t.labelFontSize};
14
- }
15
- .packetTitle {
16
- fill: ${t.titleColor};
17
- font-size: ${t.titleFontSize};
18
- }
19
- .packetBlock {
20
- stroke: ${t.blockStrokeColor};
21
- stroke-width: ${t.blockStrokeWidth};
22
- fill: ${t.blockFillColor};
23
- }
24
- `},"styles"),E={parser:w,get db(){return new m},renderer:D,styles:z};exports.diagram=E;