@leanspec/ui-components 0.2.21 → 0.2.22

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 (167) hide show
  1. package/dist/{_baseUniq-KSDS6tgF.js → _baseUniq-D7Jo4wA-.js} +2 -2
  2. package/dist/{_baseUniq-ifpVq4u5.cjs → _baseUniq-DuU2z5Ko.cjs} +1 -1
  3. package/dist/{arc-CutFaiCL.cjs → arc-DVobalXV.cjs} +1 -1
  4. package/dist/{arc-C-X5Xt_b.js → arc-bSbgZKu2.js} +1 -1
  5. package/dist/{architecture-U656AL7Q-DOVRDeZr.cjs → architecture-U656AL7Q-BnnsKr-v.cjs} +1 -1
  6. package/dist/{architecture-U656AL7Q-BB1A66AM.js → architecture-U656AL7Q-pOUzdaWZ.js} +1 -1
  7. package/dist/{architectureDiagram-VXUJARFQ-Bal8NTn4.js → architectureDiagram-VXUJARFQ-B9csKaKv.js} +1272 -1279
  8. package/dist/architectureDiagram-VXUJARFQ-Dwe8uzg_.cjs +36 -0
  9. package/dist/blockDiagram-VD42YOAC-B4iBhDdw.cjs +122 -0
  10. package/dist/{blockDiagram-VD42YOAC-B2gTo5wW.js → blockDiagram-VD42YOAC-DrRsdznF.js} +911 -920
  11. package/dist/c4Diagram-YG6GDRKO-BRDnNTAH.cjs +10 -0
  12. package/dist/{c4Diagram-YG6GDRKO-dIf_vNCY.js → c4Diagram-YG6GDRKO-Di2rkJ8i.js} +162 -163
  13. package/dist/{channel-klR7o7JB.js → channel-CTeTHv-y.js} +1 -1
  14. package/dist/channel-Dzz86sIh.cjs +1 -0
  15. package/dist/chunk-4BX2VUAB-Ckv-xIp1.cjs +1 -0
  16. package/dist/chunk-4BX2VUAB-Dkr-Egsj.js +8 -0
  17. package/dist/{chunk-55IACEB6-C88Xx0rU.cjs → chunk-55IACEB6-CVnZTCiR.cjs} +1 -1
  18. package/dist/{chunk-55IACEB6-Dd3NjClm.js → chunk-55IACEB6-D_uwi6CC.js} +1 -1
  19. package/dist/{chunk-B4BG7PRW-DLUrgkJI.js → chunk-B4BG7PRW-BipBIVhj.js} +247 -248
  20. package/dist/{chunk-B4BG7PRW-BTU_nPVE.cjs → chunk-B4BG7PRW-Bne1UwNu.cjs} +6 -6
  21. package/dist/{chunk-DI55MBZ5-BwHLqSW9.js → chunk-DI55MBZ5-8tWOlvAD.js} +440 -452
  22. package/dist/chunk-DI55MBZ5-UAAzyEQX.cjs +220 -0
  23. package/dist/{chunk-FMBD7UC4-6dsbMKM7.js → chunk-FMBD7UC4-CLc8_72-.js} +1 -1
  24. package/dist/{chunk-FMBD7UC4-CedTj9g2.cjs → chunk-FMBD7UC4-DsaPsLgZ.cjs} +1 -1
  25. package/dist/chunk-QN33PNHL-BBlw4H4R.cjs +1 -0
  26. package/dist/chunk-QN33PNHL-QKH9jByz.js +19 -0
  27. package/dist/{chunk-QZHKN3VN-CVAEdzef.js → chunk-QZHKN3VN-BPpgPA2g.js} +1 -1
  28. package/dist/{chunk-QZHKN3VN-CU1cLvn7.cjs → chunk-QZHKN3VN-CB9ZTvXU.cjs} +1 -1
  29. package/dist/{chunk-TZMSLE5B-Cc8_PJIq.js → chunk-TZMSLE5B-Coq49FaX.js} +1 -1
  30. package/dist/{chunk-TZMSLE5B-Dy6zxWyY.cjs → chunk-TZMSLE5B-Dl7DiX7D.cjs} +1 -1
  31. package/dist/{classDiagram-v2-WZHVMYZB-D7bjndmT.js → classDiagram-2ON5EDUG-DYaKkEXb.js} +2 -2
  32. package/dist/{classDiagram-2ON5EDUG-CJQWUYqu.cjs → classDiagram-2ON5EDUG-Fsj2z4ej.cjs} +1 -1
  33. package/dist/{classDiagram-2ON5EDUG-D7bjndmT.js → classDiagram-v2-WZHVMYZB-DYaKkEXb.js} +2 -2
  34. package/dist/{classDiagram-v2-WZHVMYZB-CJQWUYqu.cjs → classDiagram-v2-WZHVMYZB-Fsj2z4ej.cjs} +1 -1
  35. package/dist/{clone-7srXemyd.js → clone-Ctm6tjrV.js} +1 -1
  36. package/dist/clone-JAtNXNmq.cjs +1 -0
  37. package/dist/{code-block-37QAKDTI-MRm4xHKr.js → code-block-37QAKDTI-3zaK1Sok.js} +1 -1
  38. package/dist/{code-block-37QAKDTI-BAYBliUK.cjs → code-block-37QAKDTI-UmxtJ5VR.cjs} +1 -1
  39. package/dist/components/graph/dependency-graph.d.ts.map +1 -1
  40. package/dist/components/hierarchy/hierarchy-tree.d.ts +17 -0
  41. package/dist/components/hierarchy/hierarchy-tree.d.ts.map +1 -0
  42. package/dist/components/hierarchy/index.d.ts +2 -0
  43. package/dist/components/hierarchy/index.d.ts.map +1 -0
  44. package/dist/components/index.d.ts +1 -0
  45. package/dist/components/index.d.ts.map +1 -1
  46. package/dist/components/spec/spec-card.d.ts +1 -1
  47. package/dist/components/spec/spec-card.d.ts.map +1 -1
  48. package/dist/components/ui/index.d.ts +3 -3
  49. package/dist/components/ui/index.d.ts.map +1 -1
  50. package/dist/cose-bilkent-S5V4N54A-BMt11jHq.cjs +1 -0
  51. package/dist/{cose-bilkent-S5V4N54A-0O3dLIoy.js → cose-bilkent-S5V4N54A-iUMgKFJZ.js} +281 -281
  52. package/dist/cytoscape.esm-CNUX3VTg.cjs +321 -0
  53. package/dist/{cytoscape.esm-CjI2IsL8.js → cytoscape.esm-Cvf3sx9F.js} +18 -49
  54. package/dist/dagre-6UL2VRFP-CKc2IEbO.js +443 -0
  55. package/dist/dagre-6UL2VRFP-sN44kpPp.cjs +4 -0
  56. package/dist/{diagram-PSM6KHXK-s2xYLlND.js → diagram-PSM6KHXK-DERIvROx.js} +17 -19
  57. package/dist/diagram-PSM6KHXK-Ltn89usT.cjs +24 -0
  58. package/dist/{diagram-QEK2KX5R-D700jvoY.js → diagram-QEK2KX5R-B6CdcylU.js} +10 -14
  59. package/dist/diagram-QEK2KX5R-CDZWBlgA.cjs +43 -0
  60. package/dist/{diagram-S2PKOQOG-BkgBSa1Q.js → diagram-S2PKOQOG-5f_4uCtF.js} +22 -23
  61. package/dist/diagram-S2PKOQOG-D4WcZEo0.cjs +24 -0
  62. package/dist/{erDiagram-Q2GNP2WA-CXv6THpi.js → erDiagram-Q2GNP2WA-CnN7DF_N.js} +73 -74
  63. package/dist/{erDiagram-Q2GNP2WA-DKKIPwgH.cjs → erDiagram-Q2GNP2WA-mIz8VRgG.cjs} +3 -3
  64. package/dist/flowDiagram-NV44I4VS-BwUl8_y0.cjs +162 -0
  65. package/dist/{flowDiagram-NV44I4VS-Dsrv00Gy.js → flowDiagram-NV44I4VS-Dl3ZZj2W.js} +438 -445
  66. package/dist/{ganttDiagram-JELNMOA3-BuwyOUxF.cjs → ganttDiagram-JELNMOA3-Dl_PUPHn.cjs} +1 -1
  67. package/dist/{ganttDiagram-JELNMOA3-CqVYbgbk.js → ganttDiagram-JELNMOA3-q87tSGGF.js} +2 -2
  68. package/dist/{gitGraph-F6HP7TQM-q5owfB75.js → gitGraph-F6HP7TQM-C4DmI2Gg.js} +1 -1
  69. package/dist/{gitGraph-F6HP7TQM-BtoBLEOj.cjs → gitGraph-F6HP7TQM-Cq9d8Pu6.cjs} +1 -1
  70. package/dist/gitGraphDiagram-NY62KEGX-DMhKqh_S.cjs +65 -0
  71. package/dist/gitGraphDiagram-NY62KEGX-NeHUXng4.js +699 -0
  72. package/dist/{graph-CxpBbnBw.cjs → graph-AuIe-DO_.cjs} +1 -1
  73. package/dist/{graph-rt_wscbL.js → graph-Da1z0n_J.js} +2 -2
  74. package/dist/hooks/index.d.ts +1 -0
  75. package/dist/hooks/index.d.ts.map +1 -1
  76. package/dist/hooks/use-spec-sync.d.ts +13 -0
  77. package/dist/hooks/use-spec-sync.d.ts.map +1 -0
  78. package/dist/{index-BsdeQX2F.js → index-B5zgF_S5.js} +30337 -30055
  79. package/dist/index-KEDsBA0n.cjs +2103 -0
  80. package/dist/index.cjs +1 -1
  81. package/dist/index.js +512 -500
  82. package/dist/info-NVLQJR56-A56PvZ_B.js +5 -0
  83. package/dist/{info-NVLQJR56-Ctx23Jwq.cjs → info-NVLQJR56-FWiEuR29.cjs} +1 -1
  84. package/dist/{infoDiagram-WHAUD3N6-Fq8ToFQ6.js → infoDiagram-WHAUD3N6-Cj-s-gtw.js} +2 -2
  85. package/dist/{infoDiagram-WHAUD3N6-ICmXrgfx.cjs → infoDiagram-WHAUD3N6-Dvc-cZjb.cjs} +1 -1
  86. package/dist/{journeyDiagram-XKPGCS4Q-BkYLuV5M.cjs → journeyDiagram-XKPGCS4Q-B54o9W3g.cjs} +1 -1
  87. package/dist/{journeyDiagram-XKPGCS4Q-BzZgPZwu.js → journeyDiagram-XKPGCS4Q-BbXXFBC-.js} +4 -4
  88. package/dist/kanban-definition-3W4ZIXB7-BQfiIWMB.cjs +89 -0
  89. package/dist/kanban-definition-3W4ZIXB7-ClCUbNCO.js +719 -0
  90. package/dist/{layout-CeChnsru.cjs → layout-9b_FTQ6g.cjs} +1 -1
  91. package/dist/{layout-CX9neEHw.js → layout-BoJlbrAK.js} +4 -4
  92. package/dist/lib/hierarchy.d.ts +12 -0
  93. package/dist/lib/hierarchy.d.ts.map +1 -0
  94. package/dist/lib/index.d.ts +1 -0
  95. package/dist/lib/index.d.ts.map +1 -1
  96. package/dist/{linear-CkUVga7d.js → linear-4rmylyIU.js} +1 -1
  97. package/dist/{linear-DLfe3Is-.cjs → linear-FU7lEwDb.cjs} +1 -1
  98. package/dist/{mermaid-4DMBBIKO-DK6bOe0l.cjs → mermaid-4DMBBIKO-CGMd2ylH.cjs} +1 -1
  99. package/dist/mermaid-4DMBBIKO-CNvUKRvV.js +4 -0
  100. package/dist/{mermaid-parser.core-B7VTdQ1C.js → mermaid-parser.core-BbeEQ08m.js} +2740 -2756
  101. package/dist/mermaid-parser.core-CQwGaxt2.cjs +128 -0
  102. package/dist/{min-Ar5ebLd-.js → min-C8aXS73f.js} +2 -2
  103. package/dist/{min-C_bmS8M7.cjs → min-Ddv5U3O-.cjs} +1 -1
  104. package/dist/{mindmap-definition-VGOIOE7T-DeGZNL21.js → mindmap-definition-VGOIOE7T-BRNm-2aJ.js} +166 -169
  105. package/dist/mindmap-definition-VGOIOE7T-Gp-Ji6eO.cjs +68 -0
  106. package/dist/{ordinal-DfAQgscy.js → ordinal-B6-f3MAq.js} +1 -1
  107. package/dist/{packet-BFZMPI3H-DFZzoAsC.js → packet-BFZMPI3H-CJ8lOlJN.js} +1 -1
  108. package/dist/{packet-BFZMPI3H-BVRarKKV.cjs → packet-BFZMPI3H-CpWVF6Ne.cjs} +1 -1
  109. package/dist/pie-7BOR55EZ-BCyVC33Q.js +5 -0
  110. package/dist/{pie-7BOR55EZ-0edBRKAY.cjs → pie-7BOR55EZ-Ceke0LDu.cjs} +1 -1
  111. package/dist/{pieDiagram-ADFJNKIX-C_V2NX6O.js → pieDiagram-ADFJNKIX-BVRqurYx.js} +21 -21
  112. package/dist/{pieDiagram-ADFJNKIX-Ceq-kf3C.cjs → pieDiagram-ADFJNKIX-CwhRxtMH.cjs} +2 -2
  113. package/dist/{quadrantDiagram-AYHSOK5B-B8fSnYQi.js → quadrantDiagram-AYHSOK5B-CcsZBY3e.js} +227 -229
  114. package/dist/quadrantDiagram-AYHSOK5B-DBTVya8p.cjs +7 -0
  115. package/dist/radar-NHE76QYJ-C6zEuLeW.js +5 -0
  116. package/dist/{radar-NHE76QYJ-gAJ22qc7.cjs → radar-NHE76QYJ-CX8DsGdu.cjs} +1 -1
  117. package/dist/{requirementDiagram-UZGBJVZJ-D6BE-Q1l.cjs → requirementDiagram-UZGBJVZJ-5bxQUo0r.cjs} +7 -7
  118. package/dist/{requirementDiagram-UZGBJVZJ-MnXD59Yw.js → requirementDiagram-UZGBJVZJ-CV5SUGj-.js} +186 -188
  119. package/dist/{sankeyDiagram-TZEHDZUN-Dfyu7oJ6.js → sankeyDiagram-TZEHDZUN-BFPvVGcz.js} +186 -186
  120. package/dist/{sankeyDiagram-TZEHDZUN-Dx8_KSIc.cjs → sankeyDiagram-TZEHDZUN-D33DzO8E.cjs} +5 -5
  121. package/dist/{sequenceDiagram-WL72ISMW-D2pgAoWi.js → sequenceDiagram-WL72ISMW-CQ5u3b_o.js} +213 -220
  122. package/dist/{sequenceDiagram-WL72ISMW-CUYHrDfm.cjs → sequenceDiagram-WL72ISMW-DFEVNSSA.cjs} +16 -16
  123. package/dist/{stateDiagram-FKZM4ZOC-CtYt1Ixa.cjs → stateDiagram-FKZM4ZOC-sKqH3kHZ.cjs} +1 -1
  124. package/dist/{stateDiagram-FKZM4ZOC-DYV-na53.js → stateDiagram-FKZM4ZOC-zOb-V3pD.js} +4 -4
  125. package/dist/{stateDiagram-v2-4FDKWEC3-CeSnHO3T.cjs → stateDiagram-v2-4FDKWEC3-DwWb55sM.cjs} +1 -1
  126. package/dist/{stateDiagram-v2-4FDKWEC3-Kp4sxr9o.js → stateDiagram-v2-4FDKWEC3-_Mzc1jVl.js} +2 -2
  127. package/dist/{timeline-definition-IT6M3QCI-621ePKJ0.js → timeline-definition-IT6M3QCI-B2T2QrC5.js} +211 -215
  128. package/dist/timeline-definition-IT6M3QCI-D19MQs5w.cjs +61 -0
  129. package/dist/{treemap-KMMF4GRG-DSNryTu7.cjs → treemap-KMMF4GRG-C7E3CtG7.cjs} +1 -1
  130. package/dist/{treemap-KMMF4GRG-l6HrdCLC.js → treemap-KMMF4GRG-wB3pBnFc.js} +1 -1
  131. package/dist/types/specs.d.ts +2 -0
  132. package/dist/types/specs.d.ts.map +1 -1
  133. package/dist/ui-components.css +1 -1
  134. package/dist/{xychartDiagram-PRI3JC2R-CkfCv2o_.js → xychartDiagram-PRI3JC2R-BSPghzKh.js} +3 -3
  135. package/dist/{xychartDiagram-PRI3JC2R-C2_xziD5.cjs → xychartDiagram-PRI3JC2R-hKFxVf6x.cjs} +1 -1
  136. package/package.json +5 -2
  137. package/dist/architectureDiagram-VXUJARFQ-WCtQIdet.cjs +0 -36
  138. package/dist/blockDiagram-VD42YOAC-CGdaLv7H.cjs +0 -122
  139. package/dist/c4Diagram-YG6GDRKO-DfRXyZHM.cjs +0 -10
  140. package/dist/channel-CMrUjUoZ.cjs +0 -1
  141. package/dist/chunk-4BX2VUAB-BQgzc1Sm.js +0 -9
  142. package/dist/chunk-4BX2VUAB-CO5acanJ.cjs +0 -1
  143. package/dist/chunk-DI55MBZ5-lVvJu2kr.cjs +0 -220
  144. package/dist/chunk-QN33PNHL-DHNejhbC.js +0 -20
  145. package/dist/chunk-QN33PNHL-Dr9ghdFD.cjs +0 -1
  146. package/dist/clone-Chgndk5P.cjs +0 -1
  147. package/dist/cose-bilkent-S5V4N54A-CPai-c_a.cjs +0 -1
  148. package/dist/cytoscape.esm-o9WRfNPd.cjs +0 -331
  149. package/dist/dagre-6UL2VRFP-BqaZre9N.js +0 -446
  150. package/dist/dagre-6UL2VRFP-CeIiJJG5.cjs +0 -4
  151. package/dist/diagram-PSM6KHXK-oD045yZG.cjs +0 -24
  152. package/dist/diagram-QEK2KX5R-VH7_rcp0.cjs +0 -43
  153. package/dist/diagram-S2PKOQOG-CjDpLVdl.cjs +0 -24
  154. package/dist/flowDiagram-NV44I4VS-U52jVnrS.cjs +0 -162
  155. package/dist/gitGraphDiagram-NY62KEGX-DH1I05Ix.cjs +0 -65
  156. package/dist/gitGraphDiagram-NY62KEGX-DOanbk62.js +0 -712
  157. package/dist/index-Cg8ByiK0.cjs +0 -2153
  158. package/dist/info-NVLQJR56-hH82KARZ.js +0 -5
  159. package/dist/kanban-definition-3W4ZIXB7-BV7UYL3n.cjs +0 -89
  160. package/dist/kanban-definition-3W4ZIXB7-CrmrjRAg.js +0 -721
  161. package/dist/mermaid-4DMBBIKO-wnX9ATcq.js +0 -4
  162. package/dist/mermaid-parser.core-DvlzR6J2.cjs +0 -128
  163. package/dist/mindmap-definition-VGOIOE7T-BBqv9TKM.cjs +0 -68
  164. package/dist/pie-7BOR55EZ-zLMdfI8h.js +0 -5
  165. package/dist/quadrantDiagram-AYHSOK5B-BButfYaS.cjs +0 -7
  166. package/dist/radar-NHE76QYJ-DeqJwy76.js +0 -5
  167. package/dist/timeline-definition-IT6M3QCI-4fRZfQpb.cjs +0 -61
@@ -788,7 +788,7 @@ var _o = !0, Uc = console.warn != null, Kc = 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;
@@ -3017,11 +3017,6 @@ var sh = cr({
3017
3017
  [Sa, sd, od, ld, fd, dd, pd, Hd, Xt, Yt, Rs, th, gh, bh, kh, Bh, Ph, Ah].forEach(function(r) {
3018
3018
  be(Dv, r);
3019
3019
  });
3020
- /*!
3021
- Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
3022
- Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
3023
- Licensed under The MIT License (http://opensource.org/licenses/MIT)
3024
- */
3025
3020
  var Bv = 0, Pv = 1, Av = 2, Nr = function(e) {
3026
3021
  if (!(this instanceof Nr)) return new Nr(e);
3027
3022
  this.id = "Thenable/1.0.7", this.state = Bv, this.fulfillValue = void 0, this.rejectReason = void 0, this.onFulfilled = [], this.onRejected = [], this.proxy = {
@@ -3460,7 +3455,7 @@ function Fh() {
3460
3455
  if (pu) return ki;
3461
3456
  pu = 1;
3462
3457
  function r(e, t) {
3463
- return e == null ? void 0 : e[t];
3458
+ return e?.[t];
3464
3459
  }
3465
3460
  return ki = r, ki;
3466
3461
  }
@@ -5785,12 +5780,7 @@ var Kv = function(e) {
5785
5780
  if (a.isParent())
5786
5781
  return a.updateCompoundBounds(), n[e.autoName] || 0;
5787
5782
  var o = a.pstyle(e.name);
5788
- switch (o.strValue) {
5789
- case "label":
5790
- return a.recalculateRenderedStyle(), n.rstyle[e.labelName] || 0;
5791
- default:
5792
- return o.pfValue;
5793
- }
5783
+ return o.strValue === "label" ? (a.recalculateRenderedStyle(), n.rstyle[e.labelName] || 0) : o.pfValue;
5794
5784
  } else
5795
5785
  return 1;
5796
5786
  }, ma["outer" + e.uppercaseName] = function() {
@@ -5890,13 +5880,6 @@ var Kg = qa, Xg = function(e, t) {
5890
5880
  return Yg(this, t.get);
5891
5881
  }, r;
5892
5882
  }, {}), np = be({}, Hg, Ug, Kg, ap);
5893
- /*!
5894
- Event object based on jQuery events, MIT license
5895
-
5896
- https://jquery.org/license/
5897
- https://tldrlegal.com/license/mit-license
5898
- https://github.com/jquery/jquery/blob/master/src/event.js
5899
- */
5900
5883
  var Xv = function(e, t) {
5901
5884
  this.recycle(e, t);
5902
5885
  };
@@ -7553,7 +7536,6 @@ var pp = {
7553
7536
  return e.remove();
7554
7537
  }
7555
7538
  };
7556
- /*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */
7557
7539
  function yp(r, e, t, a) {
7558
7540
  var n = 4, i = 1e-3, s = 1e-7, o = 10, l = 11, u = 1 / (l - 1), v = typeof Float32Array < "u";
7559
7541
  if (arguments.length !== 4)
@@ -7627,7 +7609,6 @@ function yp(r, e, t, a) {
7627
7609
  return k;
7628
7610
  }, T;
7629
7611
  }
7630
- /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */
7631
7612
  var mp = /* @__PURE__ */ (function() {
7632
7613
  function r(a) {
7633
7614
  return -a.tension * a.x - a.friction * a.v;
@@ -13113,33 +13094,23 @@ Ga.findEndpoints = function(r) {
13113
13094
  };
13114
13095
  Ga.getSourceEndpoint = function(r) {
13115
13096
  var e = r[0]._private.rscratch;
13116
- switch (this.recalculateRenderedStyle(r), e.edgeType) {
13117
- case "haystack":
13118
- return {
13119
- x: e.haystackPts[0],
13120
- y: e.haystackPts[1]
13121
- };
13122
- default:
13123
- return {
13124
- x: e.arrowStartX,
13125
- y: e.arrowStartY
13126
- };
13127
- }
13097
+ return this.recalculateRenderedStyle(r), e.edgeType === "haystack" ? {
13098
+ x: e.haystackPts[0],
13099
+ y: e.haystackPts[1]
13100
+ } : {
13101
+ x: e.arrowStartX,
13102
+ y: e.arrowStartY
13103
+ };
13128
13104
  };
13129
13105
  Ga.getTargetEndpoint = function(r) {
13130
13106
  var e = r[0]._private.rscratch;
13131
- switch (this.recalculateRenderedStyle(r), e.edgeType) {
13132
- case "haystack":
13133
- return {
13134
- x: e.haystackPts[2],
13135
- y: e.haystackPts[3]
13136
- };
13137
- default:
13138
- return {
13139
- x: e.arrowEndX,
13140
- y: e.arrowEndY
13141
- };
13142
- }
13107
+ return this.recalculateRenderedStyle(r), e.edgeType === "haystack" ? {
13108
+ x: e.haystackPts[2],
13109
+ y: e.haystackPts[3]
13110
+ } : {
13111
+ x: e.arrowEndX,
13112
+ y: e.arrowEndY
13113
+ };
13143
13114
  };
13144
13115
  var yo = {};
13145
13116
  function ry(r, e, t) {
@@ -14342,7 +14313,7 @@ ia.load = function() {
14342
14313
  };
14343
14314
  fe.emit(me("box")).stdFilter(Pe).select().emit(me("boxselect")), fe.nonempty() && r.redrawHint("eles", !0), r.redraw();
14344
14315
  }
14345
- if (_ != null && _.unactivate(), S.touches[2])
14316
+ if (_?.unactivate(), S.touches[2])
14346
14317
  r.data.bgActivePosistion = void 0, r.redrawHint("select", !0);
14347
14318
  else if (!S.touches[1]) {
14348
14319
  if (!S.touches[0]) {
@@ -15846,7 +15817,6 @@ Lt.drawText = function(r, e, t) {
15846
15817
  case "double":
15847
15818
  r.lineWidth = T / 4, r.setLineDash([]);
15848
15819
  break;
15849
- case "solid":
15850
15820
  default:
15851
15821
  r.setLineDash([]);
15852
15822
  break;
@@ -18231,7 +18201,6 @@ function zf(r, e, t) {
18231
18201
  return Em(Ql(a()), t);
18232
18202
  case "base64":
18233
18203
  return Ql(a());
18234
- case "base64uri":
18235
18204
  default:
18236
18205
  return a();
18237
18206
  }
@@ -0,0 +1,443 @@
1
+ import { _ as w, 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-B5zgF_S5.js";
2
+ import { i as b, G as B } from "./graph-Da1z0n_J.js";
3
+ import { l as I } from "./layout-BoJlbrAK.js";
4
+ import { c as L } from "./clone-Ctm6tjrV.js";
5
+ import { m as A } from "./min-C8aXS73f.js";
6
+ function h(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 b(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), a = e.parent(t), r = { v: t };
21
+ return b(n) || (r.value = n), b(a) || (r.parent = a), r;
22
+ });
23
+ }
24
+ function ne(e) {
25
+ return A(e.edges(), function(t) {
26
+ var n = e.edge(t), a = { v: t.v, w: t.w };
27
+ return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
28
+ });
29
+ }
30
+ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
31
+ y.clear(), J.clear(), d.clear();
32
+ }, "clear"), D = /* @__PURE__ */ w((e, t) => {
33
+ const n = y.get(t) || [];
34
+ return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
35
+ }, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
36
+ const n = y.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) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (i.debug("Tilt, ", t, ",not in descendants"), !1);
38
+ }, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
39
+ i.warn(
40
+ "Copying children of ",
41
+ e,
42
+ "root",
43
+ a,
44
+ "data",
45
+ t.node(e),
46
+ a
47
+ );
48
+ const r = t.children(e) || [];
49
+ e !== a && r.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", r), r.forEach((o) => {
50
+ if (t.children(o).length > 0)
51
+ G(o, t, n, a);
52
+ else {
53
+ const l = t.node(o);
54
+ i.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (i.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (i.debug("Setting parent", o, e), n.setParent(o, e)) : (i.info("In copy ", e, "root", a, "data", t.node(e), a), i.debug(
55
+ "Not Setting parent for node=",
56
+ o,
57
+ "cluster!==rootId",
58
+ e !== a,
59
+ "node!==clusterId",
60
+ o !== e
61
+ ));
62
+ const u = t.edges(o);
63
+ i.debug("Copying Edges", u), u.forEach((c) => {
64
+ i.info("Edge", c);
65
+ const m = t.edge(c.v, c.w, c.name);
66
+ i.info("Edge data", m, a);
67
+ try {
68
+ se(c, a) ? (i.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info(
69
+ "Skipping copy of edge ",
70
+ c.v,
71
+ "-->",
72
+ c.w,
73
+ " rootId: ",
74
+ a,
75
+ " clusterId:",
76
+ e
77
+ );
78
+ } catch (v) {
79
+ i.error(v);
80
+ }
81
+ });
82
+ }
83
+ i.debug("Removing node", o), t.removeNode(o);
84
+ });
85
+ }, "copy"), R = /* @__PURE__ */ w((e, t) => {
86
+ const n = t.children(e);
87
+ let a = [...n];
88
+ for (const r of n)
89
+ J.set(r, e), a = [...a, ...R(r, t)];
90
+ return a;
91
+ }, "extractDescendants"), ie = /* @__PURE__ */ w((e, t, n) => {
92
+ const a = e.edges().filter((c) => c.v === t || c.w === t), r = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = r.map((c) => ({ v: c.v, w: c.w }));
93
+ return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
94
+ }, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
95
+ const a = t.children(e);
96
+ if (i.trace("Searching children of id ", e, a), a.length < 1)
97
+ return e;
98
+ let r;
99
+ for (const o of a) {
100
+ const l = C(o, t, n), u = ie(t, n, l);
101
+ if (l)
102
+ if (u.length > 0)
103
+ r = l;
104
+ else
105
+ return l;
106
+ }
107
+ return r;
108
+ }, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ w((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
+ C(n, e, n)
120
+ ), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
121
+ }), e.nodes().forEach(function(n) {
122
+ const a = e.children(n), r = e.edges();
123
+ a.length > 0 ? (i.debug("Cluster identified", n, y), r.forEach((o) => {
124
+ const l = D(o.v, n), u = D(o.w, n);
125
+ l ^ u && (i.warn("Edge: ", o, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
126
+ })) : i.debug("Not a cluster ", n, y);
127
+ });
128
+ for (let n of d.keys()) {
129
+ const a = d.get(n).id, r = e.parent(a);
130
+ r !== n && d.has(r) && !d.get(r).externalConnections && (d.get(n).id = r);
131
+ }
132
+ e.edges().forEach(function(n) {
133
+ const a = 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 r = n.v, o = n.w;
136
+ if (i.warn(
137
+ "Fix XXX",
138
+ d,
139
+ "ids:",
140
+ n.v,
141
+ n.w,
142
+ "Translating: ",
143
+ d.get(n.v),
144
+ " --- ",
145
+ d.get(n.w)
146
+ ), d.get(n.v) || d.get(n.w)) {
147
+ if (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), r = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), r !== n.v) {
148
+ const l = e.parent(r);
149
+ d.get(l).externalConnections = !0, a.fromCluster = n.v;
150
+ }
151
+ if (o !== n.w) {
152
+ const l = e.parent(o);
153
+ d.get(l).externalConnections = !0, a.toCluster = n.w;
154
+ }
155
+ i.warn("Fix Replacing with XXX", r, o, n.name), e.setEdge(r, o, a, n.name);
156
+ }
157
+ }), i.warn("Adjusted Graph", h(e)), T(e, 0), i.trace(d);
158
+ }, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
159
+ if (i.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
160
+ i.error("Bailing out");
161
+ return;
162
+ }
163
+ let n = e.nodes(), a = !1;
164
+ for (const r of n) {
165
+ const o = e.children(r);
166
+ a = a || o.length > 0;
167
+ }
168
+ if (!a) {
169
+ i.debug("Done, no node has children", e.nodes());
170
+ return;
171
+ }
172
+ i.debug("Nodes = ", n, t);
173
+ for (const r of n)
174
+ if (i.debug(
175
+ "Extracting node",
176
+ r,
177
+ d,
178
+ d.has(r) && !d.get(r).externalConnections,
179
+ !e.parent(r),
180
+ e.node(r),
181
+ e.children("D"),
182
+ " Depth ",
183
+ t
184
+ ), !d.has(r))
185
+ i.debug("Not a cluster", r, t);
186
+ else if (!d.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
187
+ i.warn(
188
+ "Cluster without external connections, without a parent and with children",
189
+ r,
190
+ t
191
+ );
192
+ let l = e.graph().rankdir === "TB" ? "LR" : "TB";
193
+ d.get(r)?.clusterData?.dir && (l = d.get(r).clusterData.dir, i.warn("Fixing dir", d.get(r).clusterData.dir, l));
194
+ const u = new B({
195
+ multigraph: !0,
196
+ compound: !0
197
+ }).setGraph({
198
+ rankdir: l,
199
+ nodesep: 50,
200
+ ranksep: 50,
201
+ marginx: 8,
202
+ marginy: 8
203
+ }).setDefaultEdgeLabel(function() {
204
+ return {};
205
+ });
206
+ i.warn("Old graph before copy", h(e)), G(r, e, u, r), e.setNode(r, {
207
+ clusterNode: !0,
208
+ id: r,
209
+ clusterData: d.get(r).clusterData,
210
+ label: d.get(r).label,
211
+ graph: u
212
+ }), i.warn("New graph after copy node: (", r, ")", h(u)), i.debug("Old graph after copy", h(e));
213
+ } else
214
+ i.warn(
215
+ "Cluster ** ",
216
+ r,
217
+ " **not meeting the criteria !externalConnections:",
218
+ !d.get(r).externalConnections,
219
+ " no parent: ",
220
+ !e.parent(r),
221
+ " children ",
222
+ e.children(r) && e.children(r).length > 0,
223
+ e.children("D"),
224
+ t
225
+ ), i.debug(d);
226
+ n = e.nodes(), i.warn("New list of nodes", n);
227
+ for (const r of n) {
228
+ const o = e.node(r);
229
+ i.warn(" Now next level", r, o), o?.clusterNode && T(o.graph, t + 1);
230
+ }
231
+ }, "extractor"), M = /* @__PURE__ */ w((e, t) => {
232
+ if (t.length === 0)
233
+ return [];
234
+ let n = Object.assign([], t);
235
+ return t.forEach((a) => {
236
+ const r = e.children(a), o = M(e, r);
237
+ n = [...n, ...o];
238
+ }), n;
239
+ }, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, r, o) => {
240
+ i.warn("Graph in recursive render:XAX", h(t), r);
241
+ const l = t.graph().rankdir;
242
+ i.trace("Dir in recursive render - dir:", l);
243
+ const u = e.insert("g").attr("class", "root");
244
+ 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]));
245
+ const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
246
+ await Promise.all(
247
+ t.nodes().map(async function(f) {
248
+ const s = t.node(f);
249
+ if (r !== void 0) {
250
+ const g = JSON.parse(JSON.stringify(r.clusterData));
251
+ i.trace(
252
+ `Setting data for parent cluster XXX
253
+ Node.id = `,
254
+ f,
255
+ `
256
+ data=`,
257
+ g.height,
258
+ `
259
+ Parent cluster`,
260
+ r.height
261
+ ), t.setNode(r.id, g), t.parent(f) || (i.trace("Setting parent", f, r.id), t.setParent(f, r.id, g));
262
+ }
263
+ if (i.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
264
+ i.info("Cluster identified XBX", f, s.width, t.node(f));
265
+ const { ranksep: g, nodesep: p } = t.graph();
266
+ s.graph.setGraph({
267
+ ...s.graph.graph(),
268
+ ranksep: g + 25,
269
+ nodesep: p
270
+ });
271
+ const N = await j(
272
+ X,
273
+ s.graph,
274
+ n,
275
+ a,
276
+ t.node(f),
277
+ o
278
+ ), x = N.elem;
279
+ z(s, x), s.diff = N.diff || 0, i.info(
280
+ "New compound node after recursive render XAX",
281
+ f,
282
+ "width",
283
+ // node,
284
+ s.width,
285
+ "height",
286
+ s.height
287
+ // node.x,
288
+ // node.y
289
+ ), U(x, s);
290
+ } else
291
+ t.children(f).length > 0 ? (i.trace(
292
+ "Cluster - the non recursive path XBX",
293
+ f,
294
+ s.id,
295
+ s,
296
+ s.width,
297
+ "Graph:",
298
+ t
299
+ ), i.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (i.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
300
+ })
301
+ ), await (/* @__PURE__ */ w(async () => {
302
+ const f = t.edges().map(async function(s) {
303
+ const g = t.edge(s.v, s.w, s.name);
304
+ 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(
305
+ "Fix",
306
+ d,
307
+ "ids:",
308
+ s.v,
309
+ s.w,
310
+ "Translating: ",
311
+ d.get(s.v),
312
+ d.get(s.w)
313
+ ), await Z(v, g);
314
+ });
315
+ await Promise.all(f);
316
+ }, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(h(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.info("Graph after layout:", JSON.stringify(h(t)));
317
+ let O = 0, { subGraphTitleTotalMargin: S } = q(o);
318
+ return await Promise.all(
319
+ oe(t).map(async function(f) {
320
+ const s = t.node(f);
321
+ if (i.info(
322
+ "Position XBX => " + f + ": (" + s.x,
323
+ "," + s.y,
324
+ ") width: ",
325
+ s.width,
326
+ " height: ",
327
+ s.height
328
+ ), s?.clusterNode)
329
+ s.y += S, i.info(
330
+ "A tainted cluster node XBX1",
331
+ f,
332
+ s.id,
333
+ s.width,
334
+ s.height,
335
+ s.x,
336
+ s.y,
337
+ t.parent(f)
338
+ ), d.get(s.id).node = s, P(s);
339
+ else if (t.children(f).length > 0) {
340
+ i.info(
341
+ "A pure cluster node XBX1",
342
+ f,
343
+ s.id,
344
+ s.x,
345
+ s.y,
346
+ s.width,
347
+ s.height,
348
+ t.parent(f)
349
+ ), s.height += S, t.node(s.parentId);
350
+ const g = s?.padding / 2 || 0, p = s?.labelBBox?.height || 0, N = p - g || 0;
351
+ i.debug("OffsetY", N, "labelHeight", p, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
352
+ } else {
353
+ const g = t.node(s.parentId);
354
+ s.y += S / 2, i.info(
355
+ "A regular node XBX1 - using the padding",
356
+ s.id,
357
+ "parent",
358
+ s.parentId,
359
+ s.width,
360
+ s.height,
361
+ s.x,
362
+ s.y,
363
+ "offsetY",
364
+ s.offsetY,
365
+ "parent",
366
+ g,
367
+ g?.offsetY,
368
+ s
369
+ ), P(s);
370
+ }
371
+ })
372
+ ), t.edges().forEach(function(f) {
373
+ const s = t.edge(f);
374
+ i.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
375
+ const g = t.node(f.v);
376
+ var p = t.node(f.w);
377
+ const N = Q(m, s, d, n, g, p, a);
378
+ W(s, N);
379
+ }), t.nodes().forEach(function(f) {
380
+ const s = t.node(f);
381
+ i.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
382
+ }), i.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
383
+ }, "recursiveRender"), ue = /* @__PURE__ */ w(async (e, t) => {
384
+ const n = new B({
385
+ multigraph: !0,
386
+ compound: !0
387
+ }).setGraph({
388
+ rankdir: e.direction,
389
+ nodesep: e.config?.nodeSpacing || e.config?.flowchart?.nodeSpacing || e.nodeSpacing,
390
+ ranksep: e.config?.rankSpacing || e.config?.flowchart?.rankSpacing || e.rankSpacing,
391
+ marginx: 8,
392
+ marginy: 8
393
+ }).setDefaultEdgeLabel(function() {
394
+ return {};
395
+ }), a = t.select("g");
396
+ F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
397
+ n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
398
+ }), i.debug("Edges:", e.edges), e.edges.forEach((o) => {
399
+ if (o.start === o.end) {
400
+ const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
401
+ n.setNode(u, {
402
+ domId: u,
403
+ id: u,
404
+ parentId: m.parentId,
405
+ labelStyle: "",
406
+ label: "",
407
+ padding: 0,
408
+ shape: "labelRect",
409
+ // shape: 'rect',
410
+ style: "",
411
+ width: 10,
412
+ height: 10
413
+ }), n.setParent(u, m.parentId), n.setNode(c, {
414
+ domId: c,
415
+ id: c,
416
+ parentId: m.parentId,
417
+ labelStyle: "",
418
+ padding: 0,
419
+ // shape: 'rect',
420
+ shape: "labelRect",
421
+ label: "",
422
+ style: "",
423
+ width: 10,
424
+ height: 10
425
+ }), n.setParent(c, m.parentId);
426
+ const v = structuredClone(o), X = structuredClone(o), E = structuredClone(o);
427
+ v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", E.label = "", m.isGroup && (v.fromCluster = l, E.toCluster = l), E.id = l + "-cyclic-special-2", E.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, E, l + "-cyc<lic-special-2");
428
+ } else
429
+ n.setEdge(o.start, o.end, { ...o }, o.id);
430
+ }), i.warn("Graph at first:", JSON.stringify(h(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(h(n)));
431
+ const r = V();
432
+ await j(
433
+ a,
434
+ n,
435
+ e.type,
436
+ e.diagramId,
437
+ void 0,
438
+ r
439
+ );
440
+ }, "render");
441
+ export {
442
+ ue as render
443
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-KEDsBA0n.cjs"),X=require("./graph-AuIe-DO_.cjs"),G=require("./layout-9b_FTQ6g.cjs"),R=require("./clone-JAtNXNmq.cjs"),O=require("./min-Ddv5U3O-.cjs");function m(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:M(e),edges:j(e)};return X.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),l=e.parent(o),r={v:o};return X.isUndefined(n)||(r.value=n),X.isUndefined(l)||(r.parent=l),r})}function j(e){return O.map(e.edges(),function(o){var n=e.edge(o),l={v:o.v,w:o.w};return X.isUndefined(o.name)||(l.name=o.name),X.isUndefined(n)||(l.value=n),l})}var a=new Map,y=new Map,P=new Map,q=t.__name(()=>{y.clear(),P.clear(),a.clear()},"clear"),_=t.__name((e,o)=>{const n=y.get(o)||[];return t.log.trace("In isDescendant",o," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),F=t.__name((e,o)=>{const n=y.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)||_(e.v,o)||_(e.w,o)||n.includes(e.w):(t.log.debug("Tilt, ",o,",not in descendants"),!1)},"edgeInCluster"),k=t.__name((e,o,n,l)=>{t.log.warn("Copying children of ",e,"root",l,"data",o.node(e),l);const r=o.children(e)||[];e!==l&&r.push(e),t.log.warn("Copying (nodes) clusterId",e,"nodes",r),r.forEach(s=>{if(o.children(s).length>0)k(s,o,n,l);else{const d=o.node(s);t.log.info("cp ",s," to ",l," with parent ",e),n.setNode(s,d),l!==o.parent(s)&&(t.log.warn("Setting parent",s,o.parent(s)),n.setParent(s,o.parent(s))),e!==l&&s!==e?(t.log.debug("Setting parent",s,e),n.setParent(s,e)):(t.log.info("In copy ",e,"root",l,"data",o.node(e),l),t.log.debug("Not Setting parent for node=",s,"cluster!==rootId",e!==l,"node!==clusterId",s!==e));const g=o.edges(s);t.log.debug("Copying Edges",g),g.forEach(c=>{t.log.info("Edge",c);const w=o.edge(c.v,c.w,c.name);t.log.info("Edge data",w,l);try{F(c,l)?(t.log.info("Copying as ",c.v,c.w,w,c.name),n.setEdge(c.v,c.w,w,c.name),t.log.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):t.log.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",l," clusterId:",e)}catch(h){t.log.error(h)}})}t.log.debug("Removing node",s),o.removeNode(s)})},"copy"),B=t.__name((e,o)=>{const n=o.children(e);let l=[...n];for(const r of n)P.set(r,e),l=[...l,...B(r,o)];return l},"extractDescendants"),U=t.__name((e,o,n)=>{const l=e.edges().filter(c=>c.v===o||c.w===o),r=e.edges().filter(c=>c.v===n||c.w===n),s=l.map(c=>({v:c.v===o?n:c.v,w:c.w===o?o:c.w})),d=r.map(c=>({v:c.v,w:c.w}));return s.filter(c=>d.some(w=>c.v===w.v&&c.w===w.w))},"findCommonEdges"),b=t.__name((e,o,n)=>{const l=o.children(e);if(t.log.trace("Searching children of id ",e,l),l.length<1)return e;let r;for(const s of l){const d=b(s,o,n),g=U(o,n,d);if(d)if(g.length>0)r=d;else return d}return r},"findNonClusterChild"),D=t.__name(e=>!a.has(e)||!a.get(e).externalConnections?e:a.has(e)?a.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: ",b(n,e,n)),y.set(n,B(n,e)),a.set(n,{id:b(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const l=e.children(n),r=e.edges();l.length>0?(t.log.debug("Cluster identified",n,y),r.forEach(s=>{const d=_(s.v,n),g=_(s.w,n);d^g&&(t.log.warn("Edge: ",s," leaves cluster ",n),t.log.warn("Descendants of XXX ",n,": ",y.get(n)),a.get(n).externalConnections=!0)})):t.log.debug("Not a cluster ",n,y)});for(let n of a.keys()){const l=a.get(n).id,r=e.parent(l);r!==n&&a.has(r)&&!a.get(r).externalConnections&&(a.get(n).id=r)}e.edges().forEach(function(n){const l=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 r=n.v,s=n.w;if(t.log.warn("Fix XXX",a,"ids:",n.v,n.w,"Translating: ",a.get(n.v)," --- ",a.get(n.w)),a.get(n.v)||a.get(n.w)){if(t.log.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=D(n.v),s=D(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const d=e.parent(r);a.get(d).externalConnections=!0,l.fromCluster=n.v}if(s!==n.w){const d=e.parent(s);a.get(d).externalConnections=!0,l.toCluster=n.w}t.log.warn("Fix Replacing with XXX",r,s,n.name),e.setEdge(r,s,l,n.name)}}),t.log.warn("Adjusted Graph",m(e)),A(e,0),t.log.trace(a)},"adjustClustersAndEdges"),A=t.__name((e,o)=>{if(t.log.warn("extractor - ",o,m(e),e.children("D")),o>10){t.log.error("Bailing out");return}let n=e.nodes(),l=!1;for(const r of n){const s=e.children(r);l=l||s.length>0}if(!l){t.log.debug("Done, no node has children",e.nodes());return}t.log.debug("Nodes = ",n,o);for(const r of n)if(t.log.debug("Extracting node",r,a,a.has(r)&&!a.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",o),!a.has(r))t.log.debug("Not a cluster",r,o);else if(!a.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){t.log.warn("Cluster without external connections, without a parent and with children",r,o);let d=e.graph().rankdir==="TB"?"LR":"TB";a.get(r)?.clusterData?.dir&&(d=a.get(r).clusterData.dir,t.log.warn("Fixing dir",a.get(r).clusterData.dir,d));const g=new X.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",m(e)),k(r,e,g,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:a.get(r).clusterData,label:a.get(r).label,graph:g}),t.log.warn("New graph after copy node: (",r,")",m(g)),t.log.debug("Old graph after copy",m(e))}else t.log.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!a.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),o),t.log.debug(a);n=e.nodes(),t.log.warn("New list of nodes",n);for(const r of n){const s=e.node(r);t.log.warn(" Now next level",r,s),s?.clusterNode&&A(s.graph,o+1)}},"extractor"),J=t.__name((e,o)=>{if(o.length===0)return[];let n=Object.assign([],o);return o.forEach(l=>{const r=e.children(l),s=J(e,r);n=[...n,...s]}),n},"sorter"),H=t.__name(e=>J(e,e.children()),"sortNodesByHierarchy"),T=t.__name(async(e,o,n,l,r,s)=>{t.log.warn("Graph in recursive render:XAX",m(o),r);const d=o.graph().rankdir;t.log.trace("Dir in recursive render - dir:",d);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 c=g.insert("g").attr("class","clusters"),w=g.insert("g").attr("class","edgePaths"),h=g.insert("g").attr("class","edgeLabels"),v=g.insert("g").attr("class","nodes");await Promise.all(o.nodes().map(async function(f){const i=o.node(f);if(r!==void 0){const u=JSON.parse(JSON.stringify(r.clusterData));t.log.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,f,`
3
+ data=`,u.height,`
4
+ Parent cluster`,r.height),o.setNode(r.id,u),o.parent(f)||(t.log.trace("Setting parent",f,r.id),o.setParent(f,r.id,u))}if(t.log.info("(Insert) Node XXX"+f+": "+JSON.stringify(o.node(f))),i?.clusterNode){t.log.info("Cluster identified XBX",f,i.width,o.node(f));const{ranksep:u,nodesep:p}=o.graph();i.graph.setGraph({...i.graph.graph(),ranksep:u+25,nodesep:p});const N=await T(v,i.graph,n,l,o.node(f),s),S=N.elem;t.updateNodeBounds(i,S),i.diff=N.diff||0,t.log.info("New compound node after recursive render XAX",f,"width",i.width,"height",i.height),t.setNodeElem(S,i)}else o.children(f).length>0?(t.log.trace("Cluster - the non recursive path XBX",f,i.id,i,i.width,"Graph:",o),t.log.trace(b(i.id,o)),a.set(i.id,{id:b(i.id,o),node:i})):(t.log.trace("Node - the non recursive path XAX",f,v,o.node(f),d),await t.insertNode(v,o.node(f),{config:s,dir:d}))})),await t.__name(async()=>{const f=o.edges().map(async function(i){const u=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",a,"ids:",i.v,i.w,"Translating: ",a.get(i.v),a.get(i.w)),await t.insertEdgeLabel(h,u)});await Promise.all(f)},"processEdges")(),t.log.info("Graph before layout:",JSON.stringify(m(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(m(o)));let x=0,{subGraphTitleTotalMargin:C}=t.getSubGraphTitleMargins(s);return await Promise.all(H(o).map(async function(f){const i=o.node(f);if(t.log.info("Position XBX => "+f+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i?.clusterNode)i.y+=C,t.log.info("A tainted cluster node XBX1",f,i.id,i.width,i.height,i.x,i.y,o.parent(f)),a.get(i.id).node=i,t.positionNode(i);else if(o.children(f).length>0){t.log.info("A pure cluster node XBX1",f,i.id,i.x,i.y,i.width,i.height,o.parent(f)),i.height+=C,o.node(i.parentId);const u=i?.padding/2||0,p=i?.labelBBox?.height||0,N=p-u||0;t.log.debug("OffsetY",N,"labelHeight",p,"halfPadding",u),await t.insertCluster(c,i),a.get(i.id).node=i}else{const u=o.node(i.parentId);i.y+=C/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",u,u?.offsetY,i),t.positionNode(i)}})),o.edges().forEach(function(f){const i=o.edge(f);t.log.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(i),i),i.points.forEach(S=>S.y+=C/2);const u=o.node(f.v);var p=o.node(f.w);const N=t.insertEdge(w,i,a,n,u,p,l);t.positionEdgeLabel(i,N)}),o.nodes().forEach(function(f){const i=o.node(f);t.log.info(f,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)=>{const n=new X.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),l=o.select("g");t.markers_default(l,e.markers,e.type,e.diagramId),t.clear2(),t.clear$1(),t.clear$2(),q(),e.nodes.forEach(s=>{n.setNode(s.id,{...s}),s.parentId&&n.setParent(s.id,s.parentId)}),t.log.debug("Edges:",e.edges),e.edges.forEach(s=>{if(s.start===s.end){const d=s.start,g=d+"---"+d+"---1",c=d+"---"+d+"---2",w=n.node(d);n.setNode(g,{domId:g,id:g,parentId:w.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(g,w.parentId),n.setNode(c,{domId:c,id:c,parentId:w.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,w.parentId);const h=structuredClone(s),v=structuredClone(s),E=structuredClone(s);h.label="",h.arrowTypeEnd="none",h.id=d+"-cyclic-special-1",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=d+"-cyclic-special-mid",E.label="",w.isGroup&&(h.fromCluster=d,E.toCluster=d),E.id=d+"-cyclic-special-2",E.arrowTypeStart="none",n.setEdge(d,g,h,d+"-cyclic-special-0"),n.setEdge(g,c,v,d+"-cyclic-special-1"),n.setEdge(c,d,E,d+"-cyc<lic-special-2")}else n.setEdge(s.start,s.end,{...s},s.id)}),t.log.warn("Graph at first:",JSON.stringify(m(n))),Y(n),t.log.warn("Graph after XAX:",JSON.stringify(m(n)));const r=t.getConfig2();await T(l,n,e.type,e.diagramId,void 0,r)},"render");exports.render=V;