@aiquants/markdown 1.6.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/{abnfDiagram-VRR7QNED-DVICL1SS.cjs → abnfDiagram-VRR7QNED-BKvRUGcR.cjs} +2 -2
  2. package/dist/{abnfDiagram-VRR7QNED-DVICL1SS.cjs.map → abnfDiagram-VRR7QNED-BKvRUGcR.cjs.map} +1 -1
  3. package/dist/{abnfDiagram-VRR7QNED-RZnm_ZZC.js → abnfDiagram-VRR7QNED-C-27Yna6.js} +4 -4
  4. package/dist/{abnfDiagram-VRR7QNED-RZnm_ZZC.js.map → abnfDiagram-VRR7QNED-C-27Yna6.js.map} +1 -1
  5. package/dist/{arc-BmnitkkN.cjs → arc-CUOoCqkh.cjs} +2 -2
  6. package/dist/{arc-BmnitkkN.cjs.map → arc-CUOoCqkh.cjs.map} +1 -1
  7. package/dist/{arc-C-DBDbuo.js → arc-UxDDNW0x.js} +2 -2
  8. package/dist/{arc-C-DBDbuo.js.map → arc-UxDDNW0x.js.map} +1 -1
  9. package/dist/{architectureDiagram-ZJ3FMSHR-_FBgGrSC.js → architectureDiagram-ZJ3FMSHR-Ch5Nf0Ae.js} +3 -3
  10. package/dist/{architectureDiagram-ZJ3FMSHR-_FBgGrSC.js.map → architectureDiagram-ZJ3FMSHR-Ch5Nf0Ae.js.map} +1 -1
  11. package/dist/{architectureDiagram-ZJ3FMSHR-CCAJeMnU.cjs → architectureDiagram-ZJ3FMSHR-kO8dZQKK.cjs} +2 -2
  12. package/dist/{architectureDiagram-ZJ3FMSHR-CCAJeMnU.cjs.map → architectureDiagram-ZJ3FMSHR-kO8dZQKK.cjs.map} +1 -1
  13. package/dist/{blockDiagram-677ZJIJ3-W3Ryiu2c.cjs → blockDiagram-677ZJIJ3-BbjxBeAD.cjs} +2 -2
  14. package/dist/{blockDiagram-677ZJIJ3-W3Ryiu2c.cjs.map → blockDiagram-677ZJIJ3-BbjxBeAD.cjs.map} +1 -1
  15. package/dist/{blockDiagram-677ZJIJ3-CLkOcrVQ.js → blockDiagram-677ZJIJ3-CuCBVVNa.js} +4 -4
  16. package/dist/{blockDiagram-677ZJIJ3-CLkOcrVQ.js.map → blockDiagram-677ZJIJ3-CuCBVVNa.js.map} +1 -1
  17. package/dist/{c4Diagram-LMCZKHZV-FhSkJ7-q.js → c4Diagram-LMCZKHZV-BdJV5ivG.js} +3 -3
  18. package/dist/{c4Diagram-LMCZKHZV-FhSkJ7-q.js.map → c4Diagram-LMCZKHZV-BdJV5ivG.js.map} +1 -1
  19. package/dist/{c4Diagram-LMCZKHZV-B--cDHXw.cjs → c4Diagram-LMCZKHZV-BgTfc_W8.cjs} +2 -2
  20. package/dist/{c4Diagram-LMCZKHZV-B--cDHXw.cjs.map → c4Diagram-LMCZKHZV-BgTfc_W8.cjs.map} +1 -1
  21. package/dist/channel-BaZK7NhX.js +6 -0
  22. package/dist/{channel-B6gYWXtQ.js.map → channel-BaZK7NhX.js.map} +1 -1
  23. package/dist/channel-DcZBUEY6.cjs +2 -0
  24. package/dist/{channel-CZceKK2b.cjs.map → channel-DcZBUEY6.cjs.map} +1 -1
  25. package/dist/{chunk-2Q5K7J3B-CLA9LZQs.js → chunk-2Q5K7J3B-CSlHTmMh.js} +2 -2
  26. package/dist/{chunk-2Q5K7J3B-CLA9LZQs.js.map → chunk-2Q5K7J3B-CSlHTmMh.js.map} +1 -1
  27. package/dist/{chunk-2Q5K7J3B-UoZ4tiIj.cjs → chunk-2Q5K7J3B-D9s6eCoM.cjs} +2 -2
  28. package/dist/{chunk-2Q5K7J3B-UoZ4tiIj.cjs.map → chunk-2Q5K7J3B-D9s6eCoM.cjs.map} +1 -1
  29. package/dist/{chunk-32BRIVSS-CrDpazxa.js → chunk-32BRIVSS-CXH5EQUk.js} +2 -2
  30. package/dist/{chunk-32BRIVSS-CrDpazxa.js.map → chunk-32BRIVSS-CXH5EQUk.js.map} +1 -1
  31. package/dist/{chunk-32BRIVSS-CyUS1-2x.cjs → chunk-32BRIVSS-D2F2B9TZ.cjs} +2 -2
  32. package/dist/{chunk-32BRIVSS-CyUS1-2x.cjs.map → chunk-32BRIVSS-D2F2B9TZ.cjs.map} +1 -1
  33. package/dist/{chunk-5VM5RSS4-DnTlok-Z.js → chunk-5VM5RSS4-BhTMtA9l.js} +2 -2
  34. package/dist/{chunk-5VM5RSS4-DnTlok-Z.js.map → chunk-5VM5RSS4-BhTMtA9l.js.map} +1 -1
  35. package/dist/{chunk-5VM5RSS4-DCM2evxn.cjs → chunk-5VM5RSS4-CxjaLXsB.cjs} +2 -2
  36. package/dist/{chunk-5VM5RSS4-DCM2evxn.cjs.map → chunk-5VM5RSS4-CxjaLXsB.cjs.map} +1 -1
  37. package/dist/{chunk-EX3LRPZG-CDcYLfTb.cjs → chunk-EX3LRPZG-BCQ_eMbL.cjs} +2 -2
  38. package/dist/{chunk-EX3LRPZG-CDcYLfTb.cjs.map → chunk-EX3LRPZG-BCQ_eMbL.cjs.map} +1 -1
  39. package/dist/{chunk-EX3LRPZG-BXZN3BP6.js → chunk-EX3LRPZG-BOcBE4jP.js} +5 -5
  40. package/dist/{chunk-EX3LRPZG-BXZN3BP6.js.map → chunk-EX3LRPZG-BOcBE4jP.js.map} +1 -1
  41. package/dist/{chunk-JWPE2WC7-BOZsBb5v.js → chunk-JWPE2WC7-C20BXRVN.js} +2 -2
  42. package/dist/{chunk-JWPE2WC7-BOZsBb5v.js.map → chunk-JWPE2WC7-C20BXRVN.js.map} +1 -1
  43. package/dist/{chunk-JWPE2WC7-u2Y2E01t.cjs → chunk-JWPE2WC7-CLCAyxUO.cjs} +2 -2
  44. package/dist/{chunk-JWPE2WC7-u2Y2E01t.cjs.map → chunk-JWPE2WC7-CLCAyxUO.cjs.map} +1 -1
  45. package/dist/{chunk-MOJQB5TN-CODLoYka.js → chunk-MOJQB5TN-B_C5dwTy.js} +2 -2
  46. package/dist/{chunk-MOJQB5TN-CODLoYka.js.map → chunk-MOJQB5TN-B_C5dwTy.js.map} +1 -1
  47. package/dist/{chunk-MOJQB5TN-D9XmnzfN.cjs → chunk-MOJQB5TN-Bbpbi357.cjs} +2 -2
  48. package/dist/{chunk-MOJQB5TN-D9XmnzfN.cjs.map → chunk-MOJQB5TN-Bbpbi357.cjs.map} +1 -1
  49. package/dist/{chunk-PUDLZKDR-Vzafz0p_.js → chunk-PUDLZKDR-C0EKSRvH.js} +7 -7
  50. package/dist/{chunk-PUDLZKDR-Vzafz0p_.js.map → chunk-PUDLZKDR-C0EKSRvH.js.map} +1 -1
  51. package/dist/{chunk-PUDLZKDR-DIlJh7gW.cjs → chunk-PUDLZKDR-Cpp-nasK.cjs} +2 -2
  52. package/dist/{chunk-PUDLZKDR-DIlJh7gW.cjs.map → chunk-PUDLZKDR-Cpp-nasK.cjs.map} +1 -1
  53. package/dist/{chunk-RYQCIY6F-D7RgZ_ri.js → chunk-RYQCIY6F-BuIkG6A2.js} +2 -2
  54. package/dist/{chunk-RYQCIY6F-D7RgZ_ri.js.map → chunk-RYQCIY6F-BuIkG6A2.js.map} +1 -1
  55. package/dist/{chunk-RYQCIY6F-BgbNR_-2.cjs → chunk-RYQCIY6F-he5fUSYo.cjs} +2 -2
  56. package/dist/{chunk-RYQCIY6F-BgbNR_-2.cjs.map → chunk-RYQCIY6F-he5fUSYo.cjs.map} +1 -1
  57. package/dist/{chunk-V7JOEXUC-BtRbpCVo.cjs → chunk-V7JOEXUC-BcBXzffo.cjs} +2 -2
  58. package/dist/{chunk-V7JOEXUC-BtRbpCVo.cjs.map → chunk-V7JOEXUC-BcBXzffo.cjs.map} +1 -1
  59. package/dist/{chunk-V7JOEXUC-Csiot9oO.js → chunk-V7JOEXUC-DWnZRQBl.js} +6 -6
  60. package/dist/{chunk-V7JOEXUC-Csiot9oO.js.map → chunk-V7JOEXUC-DWnZRQBl.js.map} +1 -1
  61. package/dist/{chunk-VR4S4FIN-DH6f42Mu.js → chunk-VR4S4FIN-BWCLM0a0.js} +2 -2
  62. package/dist/{chunk-VR4S4FIN-DH6f42Mu.js.map → chunk-VR4S4FIN-BWCLM0a0.js.map} +1 -1
  63. package/dist/{chunk-VR4S4FIN-y0SDmoh2.cjs → chunk-VR4S4FIN-Bd3wwAe8.cjs} +2 -2
  64. package/dist/{chunk-VR4S4FIN-y0SDmoh2.cjs.map → chunk-VR4S4FIN-Bd3wwAe8.cjs.map} +1 -1
  65. package/dist/{chunk-XXDRQBXY-rC42S5QT.cjs → chunk-XXDRQBXY-C2UaLfce.cjs} +2 -2
  66. package/dist/{chunk-XXDRQBXY-rC42S5QT.cjs.map → chunk-XXDRQBXY-C2UaLfce.cjs.map} +1 -1
  67. package/dist/{chunk-XXDRQBXY-Csac6tCf.js → chunk-XXDRQBXY-qt9x9red.js} +2 -2
  68. package/dist/{chunk-XXDRQBXY-Csac6tCf.js.map → chunk-XXDRQBXY-qt9x9red.js.map} +1 -1
  69. package/dist/{classDiagram-OUVF2IWQ-Dd9EcDqY.js → classDiagram-OUVF2IWQ-B0lJPbAq.js} +3 -3
  70. package/dist/{classDiagram-OUVF2IWQ-Dd9EcDqY.js.map → classDiagram-OUVF2IWQ-B0lJPbAq.js.map} +1 -1
  71. package/dist/{classDiagram-OUVF2IWQ-Vq3KKBUy.cjs → classDiagram-OUVF2IWQ-BoGCNSIO.cjs} +2 -2
  72. package/dist/{classDiagram-OUVF2IWQ-Vq3KKBUy.cjs.map → classDiagram-OUVF2IWQ-BoGCNSIO.cjs.map} +1 -1
  73. package/dist/{classDiagram-v2-EOCWNBFH-Dd9EcDqY.js → classDiagram-v2-EOCWNBFH-B0lJPbAq.js} +3 -3
  74. package/dist/{classDiagram-v2-EOCWNBFH-Dd9EcDqY.js.map → classDiagram-v2-EOCWNBFH-B0lJPbAq.js.map} +1 -1
  75. package/dist/{classDiagram-v2-EOCWNBFH-Vq3KKBUy.cjs → classDiagram-v2-EOCWNBFH-BoGCNSIO.cjs} +2 -2
  76. package/dist/{classDiagram-v2-EOCWNBFH-Vq3KKBUy.cjs.map → classDiagram-v2-EOCWNBFH-BoGCNSIO.cjs.map} +1 -1
  77. package/dist/{cose-bilkent-JH36ORCC-BAYFBSur.js → cose-bilkent-JH36ORCC-BXH9dl_0.js} +2 -2
  78. package/dist/{cose-bilkent-JH36ORCC-BAYFBSur.js.map → cose-bilkent-JH36ORCC-BXH9dl_0.js.map} +1 -1
  79. package/dist/{cose-bilkent-JH36ORCC-CsHaaKi1.cjs → cose-bilkent-JH36ORCC-DRBzHIcA.cjs} +2 -2
  80. package/dist/{cose-bilkent-JH36ORCC-CsHaaKi1.cjs.map → cose-bilkent-JH36ORCC-DRBzHIcA.cjs.map} +1 -1
  81. package/dist/{cynefinDiagram-TSTJHNR4-CSZqIj_l.js → cynefinDiagram-TSTJHNR4-2jnqksgG.js} +3 -3
  82. package/dist/{cynefinDiagram-TSTJHNR4-CSZqIj_l.js.map → cynefinDiagram-TSTJHNR4-2jnqksgG.js.map} +1 -1
  83. package/dist/{cynefinDiagram-TSTJHNR4-BEPBV57_.cjs → cynefinDiagram-TSTJHNR4-Ge9B88rS.cjs} +2 -2
  84. package/dist/{cynefinDiagram-TSTJHNR4-BEPBV57_.cjs.map → cynefinDiagram-TSTJHNR4-Ge9B88rS.cjs.map} +1 -1
  85. package/dist/{dagre-VKFMJZFB-D9fBL_yM.js → dagre-VKFMJZFB-BqLynzOx.js} +3 -3
  86. package/dist/{dagre-VKFMJZFB-D9fBL_yM.js.map → dagre-VKFMJZFB-BqLynzOx.js.map} +1 -1
  87. package/dist/{dagre-VKFMJZFB-BlRE-U3S.cjs → dagre-VKFMJZFB-C7QheUvc.cjs} +2 -2
  88. package/dist/{dagre-VKFMJZFB-BlRE-U3S.cjs.map → dagre-VKFMJZFB-C7QheUvc.cjs.map} +1 -1
  89. package/dist/{diagram-FQU43EPY-Di26xB9f.cjs → diagram-FQU43EPY-CSPyECaU.cjs} +2 -2
  90. package/dist/{diagram-FQU43EPY-Di26xB9f.cjs.map → diagram-FQU43EPY-CSPyECaU.cjs.map} +1 -1
  91. package/dist/{diagram-FQU43EPY-DPR8KMs9.js → diagram-FQU43EPY-DUwsAw4u.js} +3 -3
  92. package/dist/{diagram-FQU43EPY-DPR8KMs9.js.map → diagram-FQU43EPY-DUwsAw4u.js.map} +1 -1
  93. package/dist/{diagram-G47NLZAW-71hjWkYs.cjs → diagram-G47NLZAW-BaP0Lyg0.cjs} +2 -2
  94. package/dist/{diagram-G47NLZAW-71hjWkYs.cjs.map → diagram-G47NLZAW-BaP0Lyg0.cjs.map} +1 -1
  95. package/dist/{diagram-G47NLZAW-BfL1Ut0H.js → diagram-G47NLZAW-h09HILJg.js} +4 -4
  96. package/dist/{diagram-G47NLZAW-BfL1Ut0H.js.map → diagram-G47NLZAW-h09HILJg.js.map} +1 -1
  97. package/dist/{diagram-NH7WQ7WH-BjJctDxT.js → diagram-NH7WQ7WH-BE3XRcGY.js} +3 -3
  98. package/dist/{diagram-NH7WQ7WH-BjJctDxT.js.map → diagram-NH7WQ7WH-BE3XRcGY.js.map} +1 -1
  99. package/dist/{diagram-NH7WQ7WH-B4uTamuE.cjs → diagram-NH7WQ7WH-DyJw7-Gl.cjs} +2 -2
  100. package/dist/{diagram-NH7WQ7WH-B4uTamuE.cjs.map → diagram-NH7WQ7WH-DyJw7-Gl.cjs.map} +1 -1
  101. package/dist/{diagram-OA4YK3LP-BoFOwiXF.js → diagram-OA4YK3LP-BfAM9MZv.js} +4 -4
  102. package/dist/{diagram-OA4YK3LP-BoFOwiXF.js.map → diagram-OA4YK3LP-BfAM9MZv.js.map} +1 -1
  103. package/dist/{diagram-OA4YK3LP-C1ORbLEL.cjs → diagram-OA4YK3LP-DqYpt5F6.cjs} +2 -2
  104. package/dist/{diagram-OA4YK3LP-C1ORbLEL.cjs.map → diagram-OA4YK3LP-DqYpt5F6.cjs.map} +1 -1
  105. package/dist/{diagram-WEI45ONY-COXEDGCZ.js → diagram-WEI45ONY-DtFOpBM4.js} +3 -3
  106. package/dist/{diagram-WEI45ONY-COXEDGCZ.js.map → diagram-WEI45ONY-DtFOpBM4.js.map} +1 -1
  107. package/dist/{diagram-WEI45ONY-BzuHWp9D.cjs → diagram-WEI45ONY-fz5dqgqy.cjs} +2 -2
  108. package/dist/{diagram-WEI45ONY-BzuHWp9D.cjs.map → diagram-WEI45ONY-fz5dqgqy.cjs.map} +1 -1
  109. package/dist/{ebnfDiagram-CCIWWBDH-N0w7QwtK.js → ebnfDiagram-CCIWWBDH-CyKVhKIb.js} +4 -4
  110. package/dist/{ebnfDiagram-CCIWWBDH-N0w7QwtK.js.map → ebnfDiagram-CCIWWBDH-CyKVhKIb.js.map} +1 -1
  111. package/dist/{ebnfDiagram-CCIWWBDH-DE7OPvSn.cjs → ebnfDiagram-CCIWWBDH-Haez4su4.cjs} +2 -2
  112. package/dist/{ebnfDiagram-CCIWWBDH-DE7OPvSn.cjs.map → ebnfDiagram-CCIWWBDH-Haez4su4.cjs.map} +1 -1
  113. package/dist/{erDiagram-Q63AITRT-CqsM_S0E.js → erDiagram-Q63AITRT-9hM3kPUW.js} +5 -5
  114. package/dist/{erDiagram-Q63AITRT-CqsM_S0E.js.map → erDiagram-Q63AITRT-9hM3kPUW.js.map} +1 -1
  115. package/dist/{erDiagram-Q63AITRT-KvBvwG4T.cjs → erDiagram-Q63AITRT-BGEWGa_b.cjs} +2 -2
  116. package/dist/{erDiagram-Q63AITRT-KvBvwG4T.cjs.map → erDiagram-Q63AITRT-BGEWGa_b.cjs.map} +1 -1
  117. package/dist/{extractHeadings-BiNpEj-K.js → extractHeadings-BH0T7P4n.js} +3834 -3824
  118. package/dist/{extractHeadings-BiNpEj-K.js.map → extractHeadings-BH0T7P4n.js.map} +1 -1
  119. package/dist/{extractHeadings-vnYM8Eet.cjs → extractHeadings-BsiIYa_e.cjs} +62 -62
  120. package/dist/{extractHeadings-vnYM8Eet.cjs.map → extractHeadings-BsiIYa_e.cjs.map} +1 -1
  121. package/dist/flowDiagram-23GEKE2U-B9LX4RXy.cjs +2 -0
  122. package/dist/flowDiagram-23GEKE2U-B9LX4RXy.cjs.map +1 -0
  123. package/dist/flowDiagram-23GEKE2U-Dk7STu-u.js +8 -0
  124. package/dist/flowDiagram-23GEKE2U-Dk7STu-u.js.map +1 -0
  125. package/dist/{ganttDiagram-NO4QXBWP-DvdToLYa.cjs → ganttDiagram-NO4QXBWP-4BbeHi64.cjs} +2 -2
  126. package/dist/{ganttDiagram-NO4QXBWP-DvdToLYa.cjs.map → ganttDiagram-NO4QXBWP-4BbeHi64.cjs.map} +1 -1
  127. package/dist/{ganttDiagram-NO4QXBWP-C2P9ON6O.js → ganttDiagram-NO4QXBWP-DtM5HL0C.js} +3 -3
  128. package/dist/{ganttDiagram-NO4QXBWP-C2P9ON6O.js.map → ganttDiagram-NO4QXBWP-DtM5HL0C.js.map} +1 -1
  129. package/dist/{gitGraphDiagram-IHSO6WYX-BkZsK9Hm.cjs → gitGraphDiagram-IHSO6WYX-D1NSh545.cjs} +2 -2
  130. package/dist/{gitGraphDiagram-IHSO6WYX-BkZsK9Hm.cjs.map → gitGraphDiagram-IHSO6WYX-D1NSh545.cjs.map} +1 -1
  131. package/dist/{gitGraphDiagram-IHSO6WYX-DVSslxqP.js → gitGraphDiagram-IHSO6WYX-DFSd1OPO.js} +4 -4
  132. package/dist/{gitGraphDiagram-IHSO6WYX-DVSslxqP.js.map → gitGraphDiagram-IHSO6WYX-DFSd1OPO.js.map} +1 -1
  133. package/dist/index.cjs +1 -1
  134. package/dist/index.client.cjs +1 -1
  135. package/dist/index.client.js +1 -1
  136. package/dist/index.js +1 -1
  137. package/dist/{infoDiagram-FWYZ7A6U-Cd3TPtAG.cjs → infoDiagram-FWYZ7A6U-4wrBBE6X.cjs} +2 -2
  138. package/dist/{infoDiagram-FWYZ7A6U-Cd3TPtAG.cjs.map → infoDiagram-FWYZ7A6U-4wrBBE6X.cjs.map} +1 -1
  139. package/dist/{infoDiagram-FWYZ7A6U-vPnKgn2w.js → infoDiagram-FWYZ7A6U-ZRUjO8nW.js} +2 -2
  140. package/dist/{infoDiagram-FWYZ7A6U-vPnKgn2w.js.map → infoDiagram-FWYZ7A6U-ZRUjO8nW.js.map} +1 -1
  141. package/dist/{ishikawaDiagram-FXEZZL3T-CR9ySQXh.cjs → ishikawaDiagram-FXEZZL3T-DE9GPbED.cjs} +2 -2
  142. package/dist/{ishikawaDiagram-FXEZZL3T-CR9ySQXh.cjs.map → ishikawaDiagram-FXEZZL3T-DE9GPbED.cjs.map} +1 -1
  143. package/dist/{ishikawaDiagram-FXEZZL3T-BkgUhFd7.js → ishikawaDiagram-FXEZZL3T-DNgqlFhZ.js} +2 -2
  144. package/dist/{ishikawaDiagram-FXEZZL3T-BkgUhFd7.js.map → ishikawaDiagram-FXEZZL3T-DNgqlFhZ.js.map} +1 -1
  145. package/dist/{journeyDiagram-5HDEW3XC-CeLukjGs.js → journeyDiagram-5HDEW3XC-BXlXmDhR.js} +5 -5
  146. package/dist/{journeyDiagram-5HDEW3XC-CeLukjGs.js.map → journeyDiagram-5HDEW3XC-BXlXmDhR.js.map} +1 -1
  147. package/dist/{journeyDiagram-5HDEW3XC-C_kouMqJ.cjs → journeyDiagram-5HDEW3XC-jcXDYbA9.cjs} +2 -2
  148. package/dist/{journeyDiagram-5HDEW3XC-C_kouMqJ.cjs.map → journeyDiagram-5HDEW3XC-jcXDYbA9.cjs.map} +1 -1
  149. package/dist/{kanban-definition-HUTT4EX6-B7sK7KKo.js → kanban-definition-HUTT4EX6-C9IdgWIg.js} +3 -3
  150. package/dist/{kanban-definition-HUTT4EX6-B7sK7KKo.js.map → kanban-definition-HUTT4EX6-C9IdgWIg.js.map} +1 -1
  151. package/dist/{kanban-definition-HUTT4EX6-C72m9SkW.cjs → kanban-definition-HUTT4EX6-D5_pDh9h.cjs} +2 -2
  152. package/dist/{kanban-definition-HUTT4EX6-C72m9SkW.cjs.map → kanban-definition-HUTT4EX6-D5_pDh9h.cjs.map} +1 -1
  153. package/dist/{linear-DA8CNisd.js → linear-CTibpBci.js} +2 -2
  154. package/dist/{linear-DA8CNisd.js.map → linear-CTibpBci.js.map} +1 -1
  155. package/dist/{linear-BgdXLHZt.cjs → linear-DDWdtbxq.cjs} +2 -2
  156. package/dist/{linear-BgdXLHZt.cjs.map → linear-DDWdtbxq.cjs.map} +1 -1
  157. package/dist/{mindmap-definition-LN4V7U3C-C7YrqUCf.js → mindmap-definition-LN4V7U3C-CXaKAu6n.js} +4 -4
  158. package/dist/{mindmap-definition-LN4V7U3C-C7YrqUCf.js.map → mindmap-definition-LN4V7U3C-CXaKAu6n.js.map} +1 -1
  159. package/dist/{mindmap-definition-LN4V7U3C-CirMzlY5.cjs → mindmap-definition-LN4V7U3C-gBn938NF.cjs} +2 -2
  160. package/dist/{mindmap-definition-LN4V7U3C-CirMzlY5.cjs.map → mindmap-definition-LN4V7U3C-gBn938NF.cjs.map} +1 -1
  161. package/dist/{pegDiagram-2B236MQR-DpzcFesN.js → pegDiagram-2B236MQR-BiQyejnD.js} +4 -4
  162. package/dist/{pegDiagram-2B236MQR-DpzcFesN.js.map → pegDiagram-2B236MQR-BiQyejnD.js.map} +1 -1
  163. package/dist/{pegDiagram-2B236MQR-BWo1kluM.cjs → pegDiagram-2B236MQR-fR_9AvHk.cjs} +2 -2
  164. package/dist/{pegDiagram-2B236MQR-BWo1kluM.cjs.map → pegDiagram-2B236MQR-fR_9AvHk.cjs.map} +1 -1
  165. package/dist/{pieDiagram-ENE6RG2P-iRoOiNc4.cjs → pieDiagram-ENE6RG2P-BZtqlfyU.cjs} +2 -2
  166. package/dist/{pieDiagram-ENE6RG2P-iRoOiNc4.cjs.map → pieDiagram-ENE6RG2P-BZtqlfyU.cjs.map} +1 -1
  167. package/dist/{pieDiagram-ENE6RG2P-B6RHvEHE.js → pieDiagram-ENE6RG2P-CZTZpVqy.js} +4 -4
  168. package/dist/{pieDiagram-ENE6RG2P-B6RHvEHE.js.map → pieDiagram-ENE6RG2P-CZTZpVqy.js.map} +1 -1
  169. package/dist/{quadrantDiagram-ABIIQ3AL-9Gb8LEQi.js → quadrantDiagram-ABIIQ3AL-ByHTxHrm.js} +3 -3
  170. package/dist/{quadrantDiagram-ABIIQ3AL-9Gb8LEQi.js.map → quadrantDiagram-ABIIQ3AL-ByHTxHrm.js.map} +1 -1
  171. package/dist/{quadrantDiagram-ABIIQ3AL-DKbTOjNz.cjs → quadrantDiagram-ABIIQ3AL-CC5w4CkE.cjs} +2 -2
  172. package/dist/{quadrantDiagram-ABIIQ3AL-DKbTOjNz.cjs.map → quadrantDiagram-ABIIQ3AL-CC5w4CkE.cjs.map} +1 -1
  173. package/dist/{railroadDiagram-RFXS5EU6-CXgCaCb_.js → railroadDiagram-RFXS5EU6-C99zfAzl.js} +4 -4
  174. package/dist/{railroadDiagram-RFXS5EU6-CXgCaCb_.js.map → railroadDiagram-RFXS5EU6-C99zfAzl.js.map} +1 -1
  175. package/dist/{railroadDiagram-RFXS5EU6-SOxzO7C3.cjs → railroadDiagram-RFXS5EU6-_YckPr2T.cjs} +2 -2
  176. package/dist/{railroadDiagram-RFXS5EU6-SOxzO7C3.cjs.map → railroadDiagram-RFXS5EU6-_YckPr2T.cjs.map} +1 -1
  177. package/dist/{requirementDiagram-TGXJPOKE-B6RQ9Kpp.cjs → requirementDiagram-TGXJPOKE-BCeWSLF4.cjs} +2 -2
  178. package/dist/{requirementDiagram-TGXJPOKE-B6RQ9Kpp.cjs.map → requirementDiagram-TGXJPOKE-BCeWSLF4.cjs.map} +1 -1
  179. package/dist/{requirementDiagram-TGXJPOKE-DbSm2ehr.js → requirementDiagram-TGXJPOKE-DBzuXzE9.js} +4 -4
  180. package/dist/{requirementDiagram-TGXJPOKE-DbSm2ehr.js.map → requirementDiagram-TGXJPOKE-DBzuXzE9.js.map} +1 -1
  181. package/dist/{sankeyDiagram-HTMAVEWB-BNqZ6R3H.js → sankeyDiagram-HTMAVEWB-ChQ2ozXn.js} +2 -2
  182. package/dist/{sankeyDiagram-HTMAVEWB-BNqZ6R3H.js.map → sankeyDiagram-HTMAVEWB-ChQ2ozXn.js.map} +1 -1
  183. package/dist/{sankeyDiagram-HTMAVEWB-DgGDy2eG.cjs → sankeyDiagram-HTMAVEWB-DQOfpr04.cjs} +2 -2
  184. package/dist/{sankeyDiagram-HTMAVEWB-DgGDy2eG.cjs.map → sankeyDiagram-HTMAVEWB-DQOfpr04.cjs.map} +1 -1
  185. package/dist/{sequenceDiagram-DBY2YBRQ-Bf3EtJcL.js → sequenceDiagram-DBY2YBRQ-CCzsdQ__.js} +4 -4
  186. package/dist/{sequenceDiagram-DBY2YBRQ-Bf3EtJcL.js.map → sequenceDiagram-DBY2YBRQ-CCzsdQ__.js.map} +1 -1
  187. package/dist/{sequenceDiagram-DBY2YBRQ-BuKDthxK.cjs → sequenceDiagram-DBY2YBRQ-D2R8WWiq.cjs} +2 -2
  188. package/dist/{sequenceDiagram-DBY2YBRQ-BuKDthxK.cjs.map → sequenceDiagram-DBY2YBRQ-D2R8WWiq.cjs.map} +1 -1
  189. package/dist/{sizeCapture-X5ZJPWSS-CNWx6elV.js → sizeCapture-X5ZJPWSS-9Q2RBacx.js} +2 -2
  190. package/dist/{sizeCapture-X5ZJPWSS-CNWx6elV.js.map → sizeCapture-X5ZJPWSS-9Q2RBacx.js.map} +1 -1
  191. package/dist/{sizeCapture-X5ZJPWSS-NRqA0pmT.cjs → sizeCapture-X5ZJPWSS-CedNWC9b.cjs} +2 -2
  192. package/dist/{sizeCapture-X5ZJPWSS-NRqA0pmT.cjs.map → sizeCapture-X5ZJPWSS-CedNWC9b.cjs.map} +1 -1
  193. package/dist/src/components/MarkdownRenderer.d.ts +31 -1
  194. package/dist/src/components/MarkdownRenderer.d.ts.map +1 -1
  195. package/dist/src/components/MarkdownViewer.d.ts +9 -1
  196. package/dist/src/components/MarkdownViewer.d.ts.map +1 -1
  197. package/dist/src/index.client.d.ts +1 -1
  198. package/dist/src/index.client.d.ts.map +1 -1
  199. package/dist/{stateDiagram-2N3HPSRC-DqhvonPY.cjs → stateDiagram-2N3HPSRC-BFjEDzN5.cjs} +2 -2
  200. package/dist/{stateDiagram-2N3HPSRC-DqhvonPY.cjs.map → stateDiagram-2N3HPSRC-BFjEDzN5.cjs.map} +1 -1
  201. package/dist/{stateDiagram-2N3HPSRC-Bdphi4r-.js → stateDiagram-2N3HPSRC-DVXBUdgS.js} +3 -3
  202. package/dist/{stateDiagram-2N3HPSRC-Bdphi4r-.js.map → stateDiagram-2N3HPSRC-DVXBUdgS.js.map} +1 -1
  203. package/dist/{stateDiagram-v2-6OUMAXLB-p9rvsC9-.cjs → stateDiagram-v2-6OUMAXLB-BpxIqbgw.cjs} +2 -2
  204. package/dist/{stateDiagram-v2-6OUMAXLB-p9rvsC9-.cjs.map → stateDiagram-v2-6OUMAXLB-BpxIqbgw.cjs.map} +1 -1
  205. package/dist/{stateDiagram-v2-6OUMAXLB-DdB47j1a.js → stateDiagram-v2-6OUMAXLB-etkgI8XE.js} +3 -3
  206. package/dist/{stateDiagram-v2-6OUMAXLB-DdB47j1a.js.map → stateDiagram-v2-6OUMAXLB-etkgI8XE.js.map} +1 -1
  207. package/dist/{swimlanes-5IMT3BWC-JZVn9oCR.cjs → swimlanes-5IMT3BWC-ByyaHYdJ.cjs} +2 -2
  208. package/dist/{swimlanes-5IMT3BWC-JZVn9oCR.cjs.map → swimlanes-5IMT3BWC-ByyaHYdJ.cjs.map} +1 -1
  209. package/dist/{swimlanes-5IMT3BWC-BMZk0Lp2.js → swimlanes-5IMT3BWC-CRF_hU5-.js} +4 -4
  210. package/dist/{swimlanes-5IMT3BWC-BMZk0Lp2.js.map → swimlanes-5IMT3BWC-CRF_hU5-.js.map} +1 -1
  211. package/dist/{swimlanesDiagram-G3AALYLV-DxEegQkl.cjs → swimlanesDiagram-G3AALYLV-DmAVTn1y.cjs} +2 -2
  212. package/dist/{swimlanesDiagram-G3AALYLV-DxEegQkl.cjs.map → swimlanesDiagram-G3AALYLV-DmAVTn1y.cjs.map} +1 -1
  213. package/dist/{swimlanesDiagram-G3AALYLV-DNhrqmqB.js → swimlanesDiagram-G3AALYLV-qE56wCfv.js} +3 -3
  214. package/dist/{swimlanesDiagram-G3AALYLV-DNhrqmqB.js.map → swimlanesDiagram-G3AALYLV-qE56wCfv.js.map} +1 -1
  215. package/dist/{timeline-definition-FHXFAJF6-BjxOaDZF.cjs → timeline-definition-FHXFAJF6-CYpydtqC.cjs} +2 -2
  216. package/dist/{timeline-definition-FHXFAJF6-BjxOaDZF.cjs.map → timeline-definition-FHXFAJF6-CYpydtqC.cjs.map} +1 -1
  217. package/dist/{timeline-definition-FHXFAJF6-C4kHuqGr.js → timeline-definition-FHXFAJF6-U6tU13YO.js} +3 -3
  218. package/dist/{timeline-definition-FHXFAJF6-C4kHuqGr.js.map → timeline-definition-FHXFAJF6-U6tU13YO.js.map} +1 -1
  219. package/dist/{vennDiagram-L72KCM5P-nQ40EeIj.cjs → vennDiagram-L72KCM5P-CfbVR5CF.cjs} +2 -2
  220. package/dist/{vennDiagram-L72KCM5P-nQ40EeIj.cjs.map → vennDiagram-L72KCM5P-CfbVR5CF.cjs.map} +1 -1
  221. package/dist/{vennDiagram-L72KCM5P-faE6oCYZ.js → vennDiagram-L72KCM5P-q79Xn7UV.js} +2 -2
  222. package/dist/{vennDiagram-L72KCM5P-faE6oCYZ.js.map → vennDiagram-L72KCM5P-q79Xn7UV.js.map} +1 -1
  223. package/dist/{wardleyDiagram-EHGQE667-COQa-JdJ.js → wardleyDiagram-EHGQE667-BG3W74MX.js} +3 -3
  224. package/dist/{wardleyDiagram-EHGQE667-COQa-JdJ.js.map → wardleyDiagram-EHGQE667-BG3W74MX.js.map} +1 -1
  225. package/dist/{wardleyDiagram-EHGQE667-ByYfznTT.cjs → wardleyDiagram-EHGQE667-CSJ22zfj.cjs} +2 -2
  226. package/dist/{wardleyDiagram-EHGQE667-ByYfznTT.cjs.map → wardleyDiagram-EHGQE667-CSJ22zfj.cjs.map} +1 -1
  227. package/dist/{xychartDiagram-FW5EYKEG-D7FhqNeM.js → xychartDiagram-FW5EYKEG-BISI4a7c.js} +3 -3
  228. package/dist/{xychartDiagram-FW5EYKEG-D7FhqNeM.js.map → xychartDiagram-FW5EYKEG-BISI4a7c.js.map} +1 -1
  229. package/dist/{xychartDiagram-FW5EYKEG-BHBIM0-w.cjs → xychartDiagram-FW5EYKEG-Df8hBgvh.cjs} +2 -2
  230. package/dist/{xychartDiagram-FW5EYKEG-BHBIM0-w.cjs.map → xychartDiagram-FW5EYKEG-Df8hBgvh.cjs.map} +1 -1
  231. package/package.json +1 -1
  232. package/dist/channel-B6gYWXtQ.js +0 -6
  233. package/dist/channel-CZceKK2b.cjs +0 -2
  234. package/dist/flowDiagram-23GEKE2U-BNIQEPQk.cjs +0 -2
  235. package/dist/flowDiagram-23GEKE2U-BNIQEPQk.cjs.map +0 -1
  236. package/dist/flowDiagram-23GEKE2U-Cu3z7Hd2.js +0 -8
  237. package/dist/flowDiagram-23GEKE2U-Cu3z7Hd2.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { _ as u, a1 as i } from "./extractHeadings-BiNpEj-K.js";
1
+ import { _ as u, a1 as i } from "./extractHeadings-BH0T7P4n.js";
2
2
  import { i as m, G as y } from "./graph-DAHC4kPm.js";
3
3
  import { b as _, m as X } from "./map-DRdzG8Ho.js";
4
4
  var j = 4;
@@ -311,4 +311,4 @@ export {
311
311
  W as s,
312
312
  C as w
313
313
  };
314
- //# sourceMappingURL=chunk-RYQCIY6F-D7RgZ_ri.js.map
314
+ //# sourceMappingURL=chunk-RYQCIY6F-BuIkG6A2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-RYQCIY6F-D7RgZ_ri.js","sources":["../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/clone.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/json.js","../../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-RYQCIY6F.mjs"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\n/**\n * @import { NodeID, EdgeObj, GraphOptions } from './graph.js';\n */\n\nexport { write, read };\n\n/**\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n *\n * @typedef {object} GraphJSON\n * @property {Required<GraphOptions>} options - The options used to create the graph.\n * @property {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} nodes - The nodes in the graph.\n * @property {Array<EdgeObj & { value?: EdgeLabel }>} edges - The edges in the graph.\n * @property {GraphLabel} [value] - The graph's value, if any.\n */\n\n/**\n * Creates a JSON representation of the graph that can be serialized to a\n * string with\n * [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).\n * The graph can later be restored using {@link read}.\n *\n * @example\n *\n * ```js\n * var g = new graphlib.Graph();\n * g.setNode(\"a\", { label: \"node a\" });\n * g.setNode(\"b\", { label: \"node b\" });\n * g.setEdge(\"a\", \"b\", { label: \"edge a->b\" });\n * graphlib.json.write(g);\n * // Returns the object:\n * //\n * // {\n * // \"options\": {\n * // \"directed\": true,\n * // \"multigraph\": false,\n * // \"compound\": false\n * // },\n * // \"nodes\": [\n * // { \"v\": \"a\", \"value\": { \"label\": \"node a\" } },\n * // { \"v\": \"b\", \"value\": { \"label\": \"node b\" } }\n * // ],\n * // \"edges\": [\n * // { \"v\": \"a\", \"w\": \"b\", \"value\": { \"label\": \"edge a->b\" } }\n * // ]\n * // }\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {Graph<GraphLabel, NodeLabel, EdgeLabel>} g - The graph to serialize.\n * @returns {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} The JSON representation of the graph.\n */\nfunction write(g) {\n /** @type {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} */\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\n/**\n * @template NodeLabel - Label of a node.\n *\n * @param {Graph<unknown, NodeLabel, unknown>} g - The graph to serialize.\n * @returns {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} The nodes in the graph.\n */\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n /** @type {{ v: NodeID; value?: NodeLabel; parent?: NodeID }} */\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\n/**\n * @template EdgeLabel - Label of a node.\n *\n * @param {Graph<unknown, unknown, EdgeLabel>} g - The graph to serialize.\n * @returns {Array<EdgeObj & { value?: EdgeLabel }>} The edges in the graph.\n */\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n /** @type {EdgeObj & { value?: EdgeLabel }} */\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\n/**\n * Takes JSON as input and returns the graph representation.\n *\n * @example\n *\n * For example, if we have serialized the graph in {@link write}\n * to a string named `str`, we can restore it to a graph as follows:\n *\n * ```js\n * var g2 = graphlib.json.read(JSON.parse(str));\n * // or, in order to copy the graph\n * var g3 = graphlib.json.read(graphlib.json.write(g))\n *\n * g2.nodes();\n * // ['a', 'b']\n * g2.edges()\n * // [ { v: 'a', w: 'b' } ]\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} json - The JSON representation of the graph.\n * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} The restored graph.\n */\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n","import {\n log\n} from \"./chunk-X3CZISLH.mjs\";\nimport {\n __name\n} from \"./chunk-Y2CYZVJY.mjs\";\n\n// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport * as graphlibJson from \"dagre-d3-es/src/graphlib/json.js\";\nvar clusterDb = /* @__PURE__ */ new Map();\nvar descendants = /* @__PURE__ */ new Map();\nvar parents = /* @__PURE__ */ new Map();\nvar clear = /* @__PURE__ */ __name(() => {\n descendants.clear();\n parents.clear();\n clusterDb.clear();\n}, \"clear\");\nvar isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {\n const ancestorDescendants = descendants.get(ancestorId) || [];\n log.trace(\"In isDescendant\", ancestorId, \" \", id, \" = \", ancestorDescendants.includes(id));\n return ancestorDescendants.includes(id);\n}, \"isDescendant\");\nvar edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {\n const clusterDescendants = descendants.get(clusterId) || [];\n log.info(\"Descendants of \", clusterId, \" is \", clusterDescendants);\n log.info(\"Edge is \", edge);\n if (edge.v === clusterId || edge.w === clusterId) {\n return false;\n }\n if (!clusterDescendants) {\n log.debug(\"Tilt, \", clusterId, \",not in descendants\");\n return false;\n }\n return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);\n}, \"edgeInCluster\");\nvar copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {\n log.warn(\n \"Copying children of \",\n clusterId,\n \"root\",\n rootId,\n \"data\",\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n log.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn(\"Setting parent\", node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n if (clusterId !== rootId && node !== clusterId) {\n log.debug(\"Setting parent\", node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n log.debug(\n \"Not Setting parent for node=\",\n node,\n \"cluster!==rootId\",\n clusterId !== rootId,\n \"node!==clusterId\",\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug(\"Copying Edges\", edges);\n edges.forEach((edge) => {\n log.info(\"Edge\", edge);\n const data2 = graph.edge(edge.v, edge.w, edge.name);\n log.info(\"Edge data\", data2, rootId);\n try {\n if (edgeInCluster(edge, rootId)) {\n const rootDescendants = descendants.get(rootId) || [];\n const vIn = rootDescendants.includes(edge.v) || isDescendant(edge.v, rootId) || edge.v === rootId;\n const wIn = rootDescendants.includes(edge.w) || isDescendant(edge.w, rootId) || edge.w === rootId;\n if (vIn && wIn) {\n log.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n log.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n const newV = vIn ? rootId : edge.v;\n const newW = wIn ? rootId : edge.w;\n log.info(\"Rebinding cross-boundary edge as \", newV, newW, data2, edge.name);\n graph.setEdge(newV, newW, data2, edge.name);\n }\n } else {\n log.info(\n \"Skipping copy of edge \",\n edge.v,\n \"-->\",\n edge.w,\n \" rootId: \",\n rootId,\n \" clusterId:\",\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug(\"Removing node\", node);\n graph.removeNode(node);\n });\n}, \"copy\");\nvar extractDescendants = /* @__PURE__ */ __name((id, graph) => {\n const children = graph.children(id);\n let res = [...children];\n for (const child of children) {\n parents.set(child, id);\n res = [...res, ...extractDescendants(child, graph)];\n }\n return res;\n}, \"extractDescendants\");\nvar findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {\n const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);\n const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);\n const edges1Prim = edges1.map((edge) => {\n return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };\n });\n const edges2Prim = edges2.map((edge) => {\n return { v: edge.v, w: edge.w };\n });\n const result = edges1Prim.filter((edgeIn1) => {\n return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);\n });\n return result;\n}, \"findCommonEdges\");\nvar findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {\n const children = graph.children(id);\n log.trace(\"Searching children of id \", id, children);\n if (children.length < 1) {\n return id;\n }\n let reserve;\n for (const child of children) {\n const _id = findNonClusterChild(child, graph, clusterId);\n const commonEdges = findCommonEdges(graph, clusterId, _id);\n if (_id) {\n if (commonEdges.length > 0) {\n reserve = _id;\n } else {\n return _id;\n }\n }\n }\n return reserve;\n}, \"findNonClusterChild\");\nvar getAnchorId = /* @__PURE__ */ __name((id) => {\n if (!clusterDb.has(id)) {\n return id;\n }\n if (!clusterDb.get(id).externalConnections) {\n return id;\n }\n if (clusterDb.has(id)) {\n return clusterDb.get(id).id;\n }\n return id;\n}, \"getAnchorId\");\nvar adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {\n if (!graph || depth > 10) {\n log.debug(\"Opting out, no graph \");\n return;\n } else {\n log.debug(\"Opting in, graph \");\n }\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n \"Cluster identified\",\n id,\n \" Replacement id in edges: \",\n findNonClusterChild(id, graph, id)\n );\n descendants.set(id, extractDescendants(id, graph));\n clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });\n }\n });\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug(\"Cluster identified\", id, descendants);\n edges.forEach((edge) => {\n const d1 = isDescendant(edge.v, id);\n const d2 = isDescendant(edge.w, id);\n if (d1 ^ d2) {\n log.warn(\"Edge: \", edge, \" leaves cluster \", id);\n log.warn(\"Descendants of XXX \", id, \": \", descendants.get(id));\n clusterDb.get(id).externalConnections = true;\n }\n });\n } else {\n log.debug(\"Not a cluster \", id, descendants);\n }\n });\n for (let id of clusterDb.keys()) {\n const nonClusterChild = clusterDb.get(id).id;\n const parent = graph.parent(nonClusterChild);\n if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {\n clusterDb.get(id).id = parent;\n }\n const hasDirectOutgoingEdge = graph.edges().some((edge) => edge.v === id);\n if (nonClusterChild && clusterDb.get(id)?.externalConnections && hasDirectOutgoingEdge && isNodeInExtractableCluster(graph, nonClusterChild, id)) {\n const safeAnchor = findSafeAnchorNode(graph, id, graph.parent(nonClusterChild));\n if (safeAnchor) {\n clusterDb.get(id).id = safeAnchor;\n }\n }\n }\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n let v = e.v;\n let w = e.w;\n log.warn(\n \"Fix XXX\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n \" --- \",\n clusterDb.get(e.w)\n );\n if (clusterDb.get(e.v) || clusterDb.get(e.w)) {\n log.warn(\"Fixing and trying - removing XXX\", e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) {\n const parent = graph.parent(v);\n clusterDb.get(parent).externalConnections = true;\n edge.fromCluster = e.v;\n }\n if (w !== e.w) {\n const parent = graph.parent(w);\n clusterDb.get(parent).externalConnections = true;\n edge.toCluster = e.w;\n }\n log.warn(\"Fix Replacing with XXX\", v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn(\"Adjusted Graph\", graphlibJson.write(graph));\n extractor(graph, 0);\n log.trace(clusterDb);\n}, \"adjustClustersAndEdges\");\nvar extractor = /* @__PURE__ */ __name((graph, depth) => {\n log.warn(\"extractor - \", depth, graphlibJson.write(graph), graph.children(\"D\"));\n if (depth > 10) {\n log.error(\"Bailing out\");\n return;\n }\n let nodes = graph.nodes();\n let hasChildren = false;\n for (const node of nodes) {\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n if (!hasChildren) {\n log.debug(\"Done, no node has children\", graph.nodes());\n return;\n }\n log.debug(\"Nodes = \", nodes, depth);\n for (const node of nodes) {\n log.debug(\n \"Extracting node\",\n node,\n clusterDb,\n clusterDb.has(node) && !clusterDb.get(node).externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children(\"D\"),\n \" Depth \",\n depth\n );\n if (!clusterDb.has(node)) {\n log.debug(\"Not a cluster\", node, depth);\n } else if (clusterDb.get(node)?.clusterData?.explicitDir && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\"Cluster with explicit dir, creating subgraph for children\", node, depth);\n const dir = clusterDb.get(node).clusterData.dir;\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.warn(\n \"Subgraph for cluster with explicit dir created:\",\n node,\n graphlibJson.write(clusterGraph)\n );\n } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\n \"Cluster without external connections, without a parent and with children\",\n node,\n depth\n );\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n if (clusterDb.get(node)?.clusterData?.dir) {\n dir = clusterDb.get(node).clusterData.dir;\n log.warn(\"Fixing dir\", clusterDb.get(node).clusterData.dir, dir);\n }\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.debug(\"Old graph after copy\", graphlibJson.write(graph));\n } else {\n log.warn(\n \"Cluster ** \",\n node,\n \" **not meeting the criteria !externalConnections:\",\n !clusterDb.get(node).externalConnections,\n \" no parent: \",\n !graph.parent(node),\n \" children \",\n graph.children(node) && graph.children(node).length > 0,\n graph.children(\"D\"),\n depth\n );\n log.debug(clusterDb);\n }\n }\n nodes = graph.nodes();\n log.warn(\"New list of nodes\", nodes);\n for (const node of nodes) {\n const data = graph.node(node);\n log.warn(\" Now next level\", node, data);\n if (data?.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n}, \"extractor\");\nvar sorter = /* @__PURE__ */ __name((graph, nodes) => {\n if (nodes.length === 0) {\n return [];\n }\n let result = Object.assign([], nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = [...result, ...sorted];\n });\n return result;\n}, \"sorter\");\nvar sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), \"sortNodesByHierarchy\");\nvar isNodeInExtractableCluster = /* @__PURE__ */ __name((graph, node, rootId) => {\n let parent = graph.parent(node);\n while (parent && parent !== rootId) {\n const cluster = clusterDb.get(parent);\n if (cluster && !cluster.externalConnections) {\n return true;\n }\n parent = graph.parent(parent);\n }\n return false;\n}, \"isNodeInExtractableCluster\");\nvar findSafeAnchorNode = /* @__PURE__ */ __name((graph, clusterId, excludedCluster) => {\n const children = graph.children(clusterId) ?? [];\n for (const child of children) {\n if (child === excludedCluster || isDescendant(child, excludedCluster)) {\n continue;\n }\n const candidate = findNonClusterChild(child, graph, clusterId);\n if (!candidate) {\n continue;\n }\n if (!isNodeInExtractableCluster(graph, candidate, clusterId)) {\n return candidate;\n }\n }\n return null;\n}, \"findSafeAnchorNode\");\n\nexport {\n clusterDb,\n clear,\n findNonClusterChild,\n adjustClustersAndEdges,\n sortNodesByHierarchy\n};\n"],"names":["CLONE_SYMBOLS_FLAG","clone","value","baseClone","write","g","json","writeNodes","writeEdges","_.isUndefined","_.clone","_.map","v","nodeValue","parent","node","e","edgeValue","edge","clusterDb","descendants","parents","clear","__name","isDescendant","id","ancestorId","ancestorDescendants","log","edgeInCluster","clusterId","clusterDescendants","copy","graph","newGraph","rootId","nodes","data","edges","data2","rootDescendants","vIn","wIn","newV","newW","extractDescendants","children","res","child","findCommonEdges","id1","id2","edges1","edges2","edges1Prim","edges2Prim","edgeIn1","findNonClusterChild","reserve","_id","commonEdges","getAnchorId","adjustClustersAndEdges","depth","d1","d2","nonClusterChild","hasDirectOutgoingEdge","isNodeInExtractableCluster","safeAnchor","findSafeAnchorNode","w","graphlibJson.write","extractor","hasChildren","dir","clusterGraph","graphlib.Graph","clusterNodeData","sorter","result","sorted","sortNodesByHierarchy","cluster","excludedCluster","candidate"],"mappings":";;;AAGA,IAAIA,IAAqB;AA4BzB,SAASC,EAAMC,GAAO;AACpB,SAAOC,EAAUD,GAAOF,CAAkB;AAC5C;AC0BA,SAASI,EAAMC,GAAG;AAEhB,MAAIC,IAAO;AAAA,IACT,SAAS;AAAA,MACP,UAAUD,EAAE,WAAU;AAAA,MACtB,YAAYA,EAAE,aAAY;AAAA,MAC1B,UAAUA,EAAE,WAAU;AAAA,IAC5B;AAAA,IACI,OAAOE,EAAWF,CAAC;AAAA,IACnB,OAAOG,EAAWH,CAAC;AAAA,EACvB;AACE,SAAKI,EAAcJ,EAAE,MAAK,CAAE,MAC1BC,EAAK,QAAQI,EAAQL,EAAE,MAAK,CAAE,IAEzBC;AACT;AAQA,SAASC,EAAWF,GAAG;AACrB,SAAOM,EAAMN,EAAE,MAAK,GAAI,SAAUO,GAAG;AACnC,QAAIC,IAAYR,EAAE,KAAKO,CAAC,GACpBE,IAAST,EAAE,OAAOO,CAAC,GAEnBG,IAAO,E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GAAGC,CAAM;AAAA,EAChC,CAAC,GACMD;AACT,GAAG,QAAQ,GACPE,IAAuC,gBAAA3D,EAAO,CAACU,MAAU8C,EAAO9C,GAAOA,EAAM,SAAQ,CAAE,GAAG,sBAAsB,GAChHmC,IAA6C,gBAAA7C,EAAO,CAACU,GAAOlB,GAAMoB,MAAW;AAC/E,MAAIrB,IAASmB,EAAM,OAAOlB,CAAI;AAC9B,SAAOD,KAAUA,MAAWqB,KAAQ;AAClC,UAAMgD,IAAUhE,EAAU,IAAIL,CAAM;AACpC,QAAIqE,KAAW,CAACA,EAAQ;AACtB,aAAO;AAET,IAAArE,IAASmB,EAAM,OAAOnB,CAAM;AAAA,EAC9B;AACA,SAAO;AACT,GAAG,4BAA4B,GAC3BwD,IAAqC,gBAAA/C,EAAO,CAACU,GAAOH,GAAWsD,MAAoB;AACrF,QAAMtC,IAAWb,EAAM,SAASH,CAAS,KAAK,CAAA;AAC9C,aAAWkB,KAASF,GAAU;AAC5B,QAAIE,MAAUoC,KAAmB5D,EAAawB,GAAOoC,CAAe;AAClE;AAEF,UAAMC,IAAY5B,EAAoBT,GAAOf,GAAOH,CAAS;AAC7D,QAAKuD,KAGD,CAACjB,EAA2BnC,GAAOoD,GAAWvD,CAAS;AACzD,aAAOuD;AAAA,EAEX;AACA,SAAO;AACT,GAAG,oBAAoB;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"chunk-RYQCIY6F-BuIkG6A2.js","sources":["../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/clone.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/json.js","../../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-RYQCIY6F.mjs"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\n/**\n * @import { NodeID, EdgeObj, GraphOptions } from './graph.js';\n */\n\nexport { write, read };\n\n/**\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n *\n * @typedef {object} GraphJSON\n * @property {Required<GraphOptions>} options - The options used to create the graph.\n * @property {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} nodes - The nodes in the graph.\n * @property {Array<EdgeObj & { value?: EdgeLabel }>} edges - The edges in the graph.\n * @property {GraphLabel} [value] - The graph's value, if any.\n */\n\n/**\n * Creates a JSON representation of the graph that can be serialized to a\n * string with\n * [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).\n * The graph can later be restored using {@link read}.\n *\n * @example\n *\n * ```js\n * var g = new graphlib.Graph();\n * g.setNode(\"a\", { label: \"node a\" });\n * g.setNode(\"b\", { label: \"node b\" });\n * g.setEdge(\"a\", \"b\", { label: \"edge a->b\" });\n * graphlib.json.write(g);\n * // Returns the object:\n * //\n * // {\n * // \"options\": {\n * // \"directed\": true,\n * // \"multigraph\": false,\n * // \"compound\": false\n * // },\n * // \"nodes\": [\n * // { \"v\": \"a\", \"value\": { \"label\": \"node a\" } },\n * // { \"v\": \"b\", \"value\": { \"label\": \"node b\" } }\n * // ],\n * // \"edges\": [\n * // { \"v\": \"a\", \"w\": \"b\", \"value\": { \"label\": \"edge a->b\" } }\n * // ]\n * // }\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {Graph<GraphLabel, NodeLabel, EdgeLabel>} g - The graph to serialize.\n * @returns {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} The JSON representation of the graph.\n */\nfunction write(g) {\n /** @type {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} */\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\n/**\n * @template NodeLabel - Label of a node.\n *\n * @param {Graph<unknown, NodeLabel, unknown>} g - The graph to serialize.\n * @returns {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} The nodes in the graph.\n */\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n /** @type {{ v: NodeID; value?: NodeLabel; parent?: NodeID }} */\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\n/**\n * @template EdgeLabel - Label of a node.\n *\n * @param {Graph<unknown, unknown, EdgeLabel>} g - The graph to serialize.\n * @returns {Array<EdgeObj & { value?: EdgeLabel }>} The edges in the graph.\n */\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n /** @type {EdgeObj & { value?: EdgeLabel }} */\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\n/**\n * Takes JSON as input and returns the graph representation.\n *\n * @example\n *\n * For example, if we have serialized the graph in {@link write}\n * to a string named `str`, we can restore it to a graph as follows:\n *\n * ```js\n * var g2 = graphlib.json.read(JSON.parse(str));\n * // or, in order to copy the graph\n * var g3 = graphlib.json.read(graphlib.json.write(g))\n *\n * g2.nodes();\n * // ['a', 'b']\n * g2.edges()\n * // [ { v: 'a', w: 'b' } ]\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} json - The JSON representation of the graph.\n * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} The restored graph.\n */\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n","import {\n log\n} from \"./chunk-X3CZISLH.mjs\";\nimport {\n __name\n} from \"./chunk-Y2CYZVJY.mjs\";\n\n// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport * as graphlibJson from \"dagre-d3-es/src/graphlib/json.js\";\nvar clusterDb = /* @__PURE__ */ new Map();\nvar descendants = /* @__PURE__ */ new Map();\nvar parents = /* @__PURE__ */ new Map();\nvar clear = /* @__PURE__ */ __name(() => {\n descendants.clear();\n parents.clear();\n clusterDb.clear();\n}, \"clear\");\nvar isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {\n const ancestorDescendants = descendants.get(ancestorId) || [];\n log.trace(\"In isDescendant\", ancestorId, \" \", id, \" = \", ancestorDescendants.includes(id));\n return ancestorDescendants.includes(id);\n}, \"isDescendant\");\nvar edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {\n const clusterDescendants = descendants.get(clusterId) || [];\n log.info(\"Descendants of \", clusterId, \" is \", clusterDescendants);\n log.info(\"Edge is \", edge);\n if (edge.v === clusterId || edge.w === clusterId) {\n return false;\n }\n if (!clusterDescendants) {\n log.debug(\"Tilt, \", clusterId, \",not in descendants\");\n return false;\n }\n return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);\n}, \"edgeInCluster\");\nvar copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {\n log.warn(\n \"Copying children of \",\n clusterId,\n \"root\",\n rootId,\n \"data\",\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n log.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn(\"Setting parent\", node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n if (clusterId !== rootId && node !== clusterId) {\n log.debug(\"Setting parent\", node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n log.debug(\n \"Not Setting parent for node=\",\n node,\n \"cluster!==rootId\",\n clusterId !== rootId,\n \"node!==clusterId\",\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug(\"Copying Edges\", edges);\n edges.forEach((edge) => {\n log.info(\"Edge\", edge);\n const data2 = graph.edge(edge.v, edge.w, edge.name);\n log.info(\"Edge data\", data2, rootId);\n try {\n if (edgeInCluster(edge, rootId)) {\n const rootDescendants = descendants.get(rootId) || [];\n const vIn = rootDescendants.includes(edge.v) || isDescendant(edge.v, rootId) || edge.v === rootId;\n const wIn = rootDescendants.includes(edge.w) || isDescendant(edge.w, rootId) || edge.w === rootId;\n if (vIn && wIn) {\n log.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n log.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n const newV = vIn ? rootId : edge.v;\n const newW = wIn ? rootId : edge.w;\n log.info(\"Rebinding cross-boundary edge as \", newV, newW, data2, edge.name);\n graph.setEdge(newV, newW, data2, edge.name);\n }\n } else {\n log.info(\n \"Skipping copy of edge \",\n edge.v,\n \"-->\",\n edge.w,\n \" rootId: \",\n rootId,\n \" clusterId:\",\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug(\"Removing node\", node);\n graph.removeNode(node);\n });\n}, \"copy\");\nvar extractDescendants = /* @__PURE__ */ __name((id, graph) => {\n const children = graph.children(id);\n let res = [...children];\n for (const child of children) {\n parents.set(child, id);\n res = [...res, ...extractDescendants(child, graph)];\n }\n return res;\n}, \"extractDescendants\");\nvar findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {\n const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);\n const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);\n const edges1Prim = edges1.map((edge) => {\n return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };\n });\n const edges2Prim = edges2.map((edge) => {\n return { v: edge.v, w: edge.w };\n });\n const result = edges1Prim.filter((edgeIn1) => {\n return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);\n });\n return result;\n}, \"findCommonEdges\");\nvar findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {\n const children = graph.children(id);\n log.trace(\"Searching children of id \", id, children);\n if (children.length < 1) {\n return id;\n }\n let reserve;\n for (const child of children) {\n const _id = findNonClusterChild(child, graph, clusterId);\n const commonEdges = findCommonEdges(graph, clusterId, _id);\n if (_id) {\n if (commonEdges.length > 0) {\n reserve = _id;\n } else {\n return _id;\n }\n }\n }\n return reserve;\n}, \"findNonClusterChild\");\nvar getAnchorId = /* @__PURE__ */ __name((id) => {\n if (!clusterDb.has(id)) {\n return id;\n }\n if (!clusterDb.get(id).externalConnections) {\n return id;\n }\n if (clusterDb.has(id)) {\n return clusterDb.get(id).id;\n }\n return id;\n}, \"getAnchorId\");\nvar adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {\n if (!graph || depth > 10) {\n log.debug(\"Opting out, no graph \");\n return;\n } else {\n log.debug(\"Opting in, graph \");\n }\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n \"Cluster identified\",\n id,\n \" Replacement id in edges: \",\n findNonClusterChild(id, graph, id)\n );\n descendants.set(id, extractDescendants(id, graph));\n clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });\n }\n });\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug(\"Cluster identified\", id, descendants);\n edges.forEach((edge) => {\n const d1 = isDescendant(edge.v, id);\n const d2 = isDescendant(edge.w, id);\n if (d1 ^ d2) {\n log.warn(\"Edge: \", edge, \" leaves cluster \", id);\n log.warn(\"Descendants of XXX \", id, \": \", descendants.get(id));\n clusterDb.get(id).externalConnections = true;\n }\n });\n } else {\n log.debug(\"Not a cluster \", id, descendants);\n }\n });\n for (let id of clusterDb.keys()) {\n const nonClusterChild = clusterDb.get(id).id;\n const parent = graph.parent(nonClusterChild);\n if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {\n clusterDb.get(id).id = parent;\n }\n const hasDirectOutgoingEdge = graph.edges().some((edge) => edge.v === id);\n if (nonClusterChild && clusterDb.get(id)?.externalConnections && hasDirectOutgoingEdge && isNodeInExtractableCluster(graph, nonClusterChild, id)) {\n const safeAnchor = findSafeAnchorNode(graph, id, graph.parent(nonClusterChild));\n if (safeAnchor) {\n clusterDb.get(id).id = safeAnchor;\n }\n }\n }\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n let v = e.v;\n let w = e.w;\n log.warn(\n \"Fix XXX\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n \" --- \",\n clusterDb.get(e.w)\n );\n if (clusterDb.get(e.v) || clusterDb.get(e.w)) {\n log.warn(\"Fixing and trying - removing XXX\", e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) {\n const parent = graph.parent(v);\n clusterDb.get(parent).externalConnections = true;\n edge.fromCluster = e.v;\n }\n if (w !== e.w) {\n const parent = graph.parent(w);\n clusterDb.get(parent).externalConnections = true;\n edge.toCluster = e.w;\n }\n log.warn(\"Fix Replacing with XXX\", v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn(\"Adjusted Graph\", graphlibJson.write(graph));\n extractor(graph, 0);\n log.trace(clusterDb);\n}, \"adjustClustersAndEdges\");\nvar extractor = /* @__PURE__ */ __name((graph, depth) => {\n log.warn(\"extractor - \", depth, graphlibJson.write(graph), graph.children(\"D\"));\n if (depth > 10) {\n log.error(\"Bailing out\");\n return;\n }\n let nodes = graph.nodes();\n let hasChildren = false;\n for (const node of nodes) {\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n if (!hasChildren) {\n log.debug(\"Done, no node has children\", graph.nodes());\n return;\n }\n log.debug(\"Nodes = \", nodes, depth);\n for (const node of nodes) {\n log.debug(\n \"Extracting node\",\n node,\n clusterDb,\n clusterDb.has(node) && !clusterDb.get(node).externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children(\"D\"),\n \" Depth \",\n depth\n );\n if (!clusterDb.has(node)) {\n log.debug(\"Not a cluster\", node, depth);\n } else if (clusterDb.get(node)?.clusterData?.explicitDir && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\"Cluster with explicit dir, creating subgraph for children\", node, depth);\n const dir = clusterDb.get(node).clusterData.dir;\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.warn(\n \"Subgraph for cluster with explicit dir created:\",\n node,\n graphlibJson.write(clusterGraph)\n );\n } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\n \"Cluster without external connections, without a parent and with children\",\n node,\n depth\n );\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n if (clusterDb.get(node)?.clusterData?.dir) {\n dir = clusterDb.get(node).clusterData.dir;\n log.warn(\"Fixing dir\", clusterDb.get(node).clusterData.dir, dir);\n }\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.debug(\"Old graph after copy\", graphlibJson.write(graph));\n } else {\n log.warn(\n \"Cluster ** \",\n node,\n \" **not meeting the criteria !externalConnections:\",\n !clusterDb.get(node).externalConnections,\n \" no parent: \",\n !graph.parent(node),\n \" children \",\n graph.children(node) && graph.children(node).length > 0,\n graph.children(\"D\"),\n depth\n );\n log.debug(clusterDb);\n }\n }\n nodes = graph.nodes();\n log.warn(\"New list of nodes\", nodes);\n for (const node of nodes) {\n const data = graph.node(node);\n log.warn(\" Now next level\", node, data);\n if (data?.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n}, \"extractor\");\nvar sorter = /* @__PURE__ */ __name((graph, nodes) => {\n if (nodes.length === 0) {\n return [];\n }\n let result = Object.assign([], nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = [...result, ...sorted];\n });\n return result;\n}, \"sorter\");\nvar sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), \"sortNodesByHierarchy\");\nvar isNodeInExtractableCluster = /* @__PURE__ */ __name((graph, node, rootId) => {\n let parent = graph.parent(node);\n while (parent && parent !== rootId) {\n const cluster = clusterDb.get(parent);\n if (cluster && !cluster.externalConnections) {\n return true;\n }\n parent = graph.parent(parent);\n }\n return false;\n}, \"isNodeInExtractableCluster\");\nvar findSafeAnchorNode = /* @__PURE__ */ __name((graph, clusterId, excludedCluster) => {\n const children = graph.children(clusterId) ?? [];\n for (const child of children) {\n if (child === excludedCluster || isDescendant(child, excludedCluster)) {\n continue;\n }\n const candidate = findNonClusterChild(child, graph, clusterId);\n if (!candidate) {\n continue;\n }\n if (!isNodeInExtractableCluster(graph, candidate, clusterId)) {\n return candidate;\n }\n }\n return null;\n}, \"findSafeAnchorNode\");\n\nexport {\n clusterDb,\n clear,\n findNonClusterChild,\n adjustClustersAndEdges,\n sortNodesByHierarchy\n};\n"],"names":["CLONE_SYMBOLS_FLAG","clone","value","baseClone","write","g","json","writeNodes","writeEdges","_.isUndefined","_.clone","_.map","v","nodeValue","parent","node","e","edgeValue","edge","clusterDb","descendants","parents","clear","__name","isDescendant","id","ancestorId","ancestorDescendants","log","edgeInCluster","clusterId","clusterDescendants","copy","graph","newGraph","rootId","nodes","data","edges","data2","rootDescendants","vIn","wIn","newV","newW","extractDescendants","children","res","child","findCommonEdges","id1","id2","edges1","edges2","edges1Prim","edges2Prim","edgeIn1","findNonClusterChild","reserve","_id","commonEdges","getAnchorId","adjustClustersAndEdges","depth","d1","d2","nonClusterChild","hasDirectOutgoingEdge","isNodeInExtractableCluster","safeAnchor","findSafeAnchorNode","w","graphlibJson.write","extractor","hasChildren","dir","clusterGraph","graphlib.Graph","clusterNodeData","sorter","result","sorted","sortNodesByHierarchy","cluster","excludedCluster","candidate"],"mappings":";;;AAGA,IAAIA,IAAqB;AA4BzB,SAASC,EAAMC,GAAO;AACpB,SAAOC,EAAUD,GAAOF,CAAkB;AAC5C;AC0BA,SAASI,EAAMC,GAAG;AAEhB,MAAIC,IAAO;AAAA,IACT,SAAS;AAAA,MACP,UAAUD,EAAE,WAAU;AAAA,MACtB,YAAYA,EAAE,aAAY;AAAA,MAC1B,UAAUA,EAAE,WAAU;AAAA,IAC5B;AAAA,IACI,OAAOE,EAAWF,CAAC;AAAA,IACnB,OAAOG,EAAWH,CAAC;AAAA,EACvB;AACE,SAAKI,EAAcJ,EAAE,MAAK,CAAE,MAC1BC,EAAK,QAAQI,EAAQL,EAAE,MAAK,CAAE,IAEzBC;AACT;AAQA,SAASC,EAAWF,GAAG;AACrB,SAAOM,EAAMN,EAAE,MAAK,GAAI,SAAUO,GAAG;AACnC,QAAIC,IAAYR,EAAE,KAAKO,CAAC,GACpBE,IAAST,EAAE,OAAOO,CAAC,GAEnBG,IAAO,EAAE,GAAGH,EAAC;AACjB,WAAKH,EAAcI,CAAS,MAC1BE,EAAK,QAAQF,IAEVJ,EAAcK,CAAM,MACvBC,EAAK,SAASD,IAETC;AAAA,EACT,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Q,CAAE,GAAG,sBAAsB,GAChHmC,IAA6C,gBAAA7C,EAAO,CAACU,GAAOlB,GAAMoB,MAAW;AAC/E,MAAIrB,IAASmB,EAAM,OAAOlB,CAAI;AAC9B,SAAOD,KAAUA,MAAWqB,KAAQ;AAClC,UAAMgD,IAAUhE,EAAU,IAAIL,CAAM;AACpC,QAAIqE,KAAW,CAACA,EAAQ;AACtB,aAAO;AAET,IAAArE,IAASmB,EAAM,OAAOnB,CAAM;AAAA,EAC9B;AACA,SAAO;AACT,GAAG,4BAA4B,GAC3BwD,IAAqC,gBAAA/C,EAAO,CAACU,GAAOH,GAAWsD,MAAoB;AACrF,QAAMtC,IAAWb,EAAM,SAASH,CAAS,KAAK,CAAA;AAC9C,aAAWkB,KAASF,GAAU;AAC5B,QAAIE,MAAUoC,KAAmB5D,EAAawB,GAAOoC,CAAe;AAClE;AAEF,UAAMC,IAAY5B,EAAoBT,GAAOf,GAAOH,CAAS;AAC7D,QAAKuD,KAGD,CAACjB,EAA2BnC,GAAOoD,GAAWvD,CAAS;AACzD,aAAOuD;AAAA,EAEX;AACA,SAAO;AACT,GAAG,oBAAoB;","x_google_ignoreList":[0,1,2]}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("./extractHeadings-vnYM8Eet.cjs"),g=require("./graph-BgRih2Qv.cjs"),E=require("./map-BvScllSQ.cjs");var k=4;function B(e){return E.baseClone(e,k)}function v(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:j(e),edges:L(e)};return g.isUndefined(e.graph())||(r.value=B(e.graph())),r}function j(e){return E.map(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return g.isUndefined(n)||(t.value=n),g.isUndefined(s)||(t.parent=s),t})}function L(e){return E.map(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return g.isUndefined(r.name)||(s.name=r.name),g.isUndefined(n)||(s.value=n),s})}var a=new Map,d=new Map,y=new Map,p=o.__name(()=>{d.clear(),y.clear(),a.clear()},"clear"),w=o.__name((e,r)=>{const n=d.get(r)||[];return o.log.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),F=o.__name((e,r)=>{const n=d.get(r)||[];return o.log.info("Descendants of ",r," is ",n),o.log.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||w(e.v,r)||w(e.w,r)||n.includes(e.w):(o.log.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),D=o.__name((e,r,n,s)=>{o.log.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),o.log.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(i=>{if(r.children(i).length>0)D(i,r,n,s);else{const c=r.node(i);o.log.info("cp ",i," to ",s," with parent ",e),n.setNode(i,c),s!==r.parent(i)&&(o.log.warn("Setting parent",i,r.parent(i)),n.setParent(i,r.parent(i))),e!==s&&i!==e?(o.log.debug("Setting parent",i,e),n.setParent(i,e)):(o.log.info("In copy ",e,"root",s,"data",r.node(e),s),o.log.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==s,"node!==clusterId",i!==e));const u=r.edges(i);o.log.debug("Copying Edges",u),u.forEach(l=>{o.log.info("Edge",l);const f=r.edge(l.v,l.w,l.name);o.log.info("Edge data",f,s);try{if(F(l,s)){const C=d.get(s)||[],b=C.includes(l.v)||w(l.v,s)||l.v===s,_=C.includes(l.w)||w(l.w,s)||l.w===s;if(b&&_)o.log.info("Copying as ",l.v,l.w,f,l.name),n.setEdge(l.v,l.w,f,l.name),o.log.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const x=b?s:l.v,h=_?s:l.w;o.log.info("Rebinding cross-boundary edge as ",x,h,f,l.name),r.setEdge(x,h,f,l.name)}}else o.log.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",s," clusterId:",e)}catch(C){o.log.error(C)}})}o.log.debug("Removing node",i),r.removeNode(i)})},"copy"),S=o.__name((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)y.set(t,e),s=[...s,...S(t,r)];return s},"extractDescendants"),M=o.__name((e,r,n)=>{const s=e.edges().filter(l=>l.v===r||l.w===r),t=e.edges().filter(l=>l.v===n||l.w===n),i=s.map(l=>({v:l.v===r?n:l.v,w:l.w===r?r:l.w})),c=t.map(l=>({v:l.v,w:l.w}));return i.filter(l=>c.some(f=>l.v===f.v&&l.w===f.w))},"findCommonEdges"),m=o.__name((e,r,n)=>{const s=r.children(e);if(o.log.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const i of s){const c=m(i,r,n),u=M(r,n,c);if(c)if(u.length>0)t=c;else return c}return t},"findNonClusterChild"),N=o.__name(e=>!a.has(e)||!a.get(e).externalConnections?e:a.has(e)?a.get(e).id:e,"getAnchorId"),R=o.__name((e,r)=>{if(!e||r>10){o.log.debug("Opting out, no graph ");return}else o.log.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(o.log.warn("Cluster identified",n," Replacement id in edges: ",m(n,e,n)),d.set(n,S(n,e)),a.set(n,{id:m(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(o.log.debug("Cluster identified",n,d),t.forEach(i=>{const c=w(i.v,n),u=w(i.w,n);c^u&&(o.log.warn("Edge: ",i," leaves cluster ",n),o.log.warn("Descendants of XXX ",n,": ",d.get(n)),a.get(n).externalConnections=!0)})):o.log.debug("Not a cluster ",n,d)});for(let n of a.keys()){const s=a.get(n).id,t=e.parent(s);t!==n&&a.has(t)&&!a.get(t).externalConnections&&(a.get(n).id=t);const i=e.edges().some(c=>c.v===n);if(s&&a.get(n)?.externalConnections&&i&&O(e,s,n)){const c=H(e,n,e.parent(s));c&&(a.get(n).id=c)}}e.edges().forEach(function(n){const s=e.edge(n);o.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),o.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,i=n.w;if(o.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(o.log.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=N(n.v),i=N(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const c=e.parent(t);a.get(c).externalConnections=!0,s.fromCluster=n.v}if(i!==n.w){const c=e.parent(i);a.get(c).externalConnections=!0,s.toCluster=n.w}o.log.warn("Fix Replacing with XXX",t,i,n.name),e.setEdge(t,i,s,n.name)}}),o.log.warn("Adjusted Graph",v(e)),X(e,0),o.log.trace(a)},"adjustClustersAndEdges"),X=o.__name((e,r)=>{if(o.log.warn("extractor - ",r,v(e),e.children("D")),r>10){o.log.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const i=e.children(t);s=s||i.length>0}if(!s){o.log.debug("Done, no node has children",e.nodes());return}o.log.debug("Nodes = ",n,r);for(const t of n)if(o.log.debug("Extracting node",t,a,a.has(t)&&!a.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!a.has(t))o.log.debug("Not a cluster",t,r);else if(a.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){o.log.warn("Cluster with explicit dir, creating subgraph for children",t,r);const i=a.get(t).clusterData.dir,c=new g.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});D(t,e,c,t);const u=e.node(t)||{};e.setNode(t,{...u,clusterNode:!0,id:t,clusterData:a.get(t).clusterData,label:a.get(t).label,graph:c}),o.log.warn("Subgraph for cluster with explicit dir created:",t,v(c))}else if(!a.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){o.log.warn("Cluster without external connections, without a parent and with children",t,r);let c=e.graph().rankdir==="TB"?"LR":"TB";a.get(t)?.clusterData?.dir&&(c=a.get(t).clusterData.dir,o.log.warn("Fixing dir",a.get(t).clusterData.dir,c));const u=new g.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});D(t,e,u,t);const l=e.node(t)||{};e.setNode(t,{...l,clusterNode:!0,id:t,clusterData:a.get(t).clusterData,label:a.get(t).label,graph:u}),o.log.debug("Old graph after copy",v(e))}else o.log.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!a.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),o.log.debug(a);n=e.nodes(),o.log.warn("New list of nodes",n);for(const t of n){const i=e.node(t);o.log.warn(" Now next level",t,i),i?.clusterNode&&X(i.graph,r+1)}},"extractor"),A=o.__name((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),i=A(e,t);n=[...n,...i]}),n},"sorter"),U=o.__name(e=>A(e,e.children()),"sortNodesByHierarchy"),O=o.__name((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=a.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),H=o.__name((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||w(t,n))continue;const i=m(t,e,r);if(i&&!O(e,i,r))return i}return null},"findSafeAnchorNode");exports.adjustClustersAndEdges=R;exports.clear=p;exports.clusterDb=a;exports.findNonClusterChild=m;exports.sortNodesByHierarchy=U;exports.write=v;
2
- //# sourceMappingURL=chunk-RYQCIY6F-BgbNR_-2.cjs.map
1
+ "use strict";const o=require("./extractHeadings-BsiIYa_e.cjs"),g=require("./graph-BgRih2Qv.cjs"),E=require("./map-BvScllSQ.cjs");var k=4;function B(e){return E.baseClone(e,k)}function v(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:j(e),edges:L(e)};return g.isUndefined(e.graph())||(r.value=B(e.graph())),r}function j(e){return E.map(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return g.isUndefined(n)||(t.value=n),g.isUndefined(s)||(t.parent=s),t})}function L(e){return E.map(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return g.isUndefined(r.name)||(s.name=r.name),g.isUndefined(n)||(s.value=n),s})}var a=new Map,d=new Map,y=new Map,p=o.__name(()=>{d.clear(),y.clear(),a.clear()},"clear"),w=o.__name((e,r)=>{const n=d.get(r)||[];return o.log.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),F=o.__name((e,r)=>{const n=d.get(r)||[];return o.log.info("Descendants of ",r," is ",n),o.log.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||w(e.v,r)||w(e.w,r)||n.includes(e.w):(o.log.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),D=o.__name((e,r,n,s)=>{o.log.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),o.log.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(i=>{if(r.children(i).length>0)D(i,r,n,s);else{const c=r.node(i);o.log.info("cp ",i," to ",s," with parent ",e),n.setNode(i,c),s!==r.parent(i)&&(o.log.warn("Setting parent",i,r.parent(i)),n.setParent(i,r.parent(i))),e!==s&&i!==e?(o.log.debug("Setting parent",i,e),n.setParent(i,e)):(o.log.info("In copy ",e,"root",s,"data",r.node(e),s),o.log.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==s,"node!==clusterId",i!==e));const u=r.edges(i);o.log.debug("Copying Edges",u),u.forEach(l=>{o.log.info("Edge",l);const f=r.edge(l.v,l.w,l.name);o.log.info("Edge data",f,s);try{if(F(l,s)){const C=d.get(s)||[],b=C.includes(l.v)||w(l.v,s)||l.v===s,_=C.includes(l.w)||w(l.w,s)||l.w===s;if(b&&_)o.log.info("Copying as ",l.v,l.w,f,l.name),n.setEdge(l.v,l.w,f,l.name),o.log.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const x=b?s:l.v,h=_?s:l.w;o.log.info("Rebinding cross-boundary edge as ",x,h,f,l.name),r.setEdge(x,h,f,l.name)}}else o.log.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",s," clusterId:",e)}catch(C){o.log.error(C)}})}o.log.debug("Removing node",i),r.removeNode(i)})},"copy"),S=o.__name((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)y.set(t,e),s=[...s,...S(t,r)];return s},"extractDescendants"),M=o.__name((e,r,n)=>{const s=e.edges().filter(l=>l.v===r||l.w===r),t=e.edges().filter(l=>l.v===n||l.w===n),i=s.map(l=>({v:l.v===r?n:l.v,w:l.w===r?r:l.w})),c=t.map(l=>({v:l.v,w:l.w}));return i.filter(l=>c.some(f=>l.v===f.v&&l.w===f.w))},"findCommonEdges"),m=o.__name((e,r,n)=>{const s=r.children(e);if(o.log.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const i of s){const c=m(i,r,n),u=M(r,n,c);if(c)if(u.length>0)t=c;else return c}return t},"findNonClusterChild"),N=o.__name(e=>!a.has(e)||!a.get(e).externalConnections?e:a.has(e)?a.get(e).id:e,"getAnchorId"),R=o.__name((e,r)=>{if(!e||r>10){o.log.debug("Opting out, no graph ");return}else o.log.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(o.log.warn("Cluster identified",n," Replacement id in edges: ",m(n,e,n)),d.set(n,S(n,e)),a.set(n,{id:m(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(o.log.debug("Cluster identified",n,d),t.forEach(i=>{const c=w(i.v,n),u=w(i.w,n);c^u&&(o.log.warn("Edge: ",i," leaves cluster ",n),o.log.warn("Descendants of XXX ",n,": ",d.get(n)),a.get(n).externalConnections=!0)})):o.log.debug("Not a cluster ",n,d)});for(let n of a.keys()){const s=a.get(n).id,t=e.parent(s);t!==n&&a.has(t)&&!a.get(t).externalConnections&&(a.get(n).id=t);const i=e.edges().some(c=>c.v===n);if(s&&a.get(n)?.externalConnections&&i&&O(e,s,n)){const c=H(e,n,e.parent(s));c&&(a.get(n).id=c)}}e.edges().forEach(function(n){const s=e.edge(n);o.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),o.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,i=n.w;if(o.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(o.log.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=N(n.v),i=N(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const c=e.parent(t);a.get(c).externalConnections=!0,s.fromCluster=n.v}if(i!==n.w){const c=e.parent(i);a.get(c).externalConnections=!0,s.toCluster=n.w}o.log.warn("Fix Replacing with XXX",t,i,n.name),e.setEdge(t,i,s,n.name)}}),o.log.warn("Adjusted Graph",v(e)),X(e,0),o.log.trace(a)},"adjustClustersAndEdges"),X=o.__name((e,r)=>{if(o.log.warn("extractor - ",r,v(e),e.children("D")),r>10){o.log.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const i=e.children(t);s=s||i.length>0}if(!s){o.log.debug("Done, no node has children",e.nodes());return}o.log.debug("Nodes = ",n,r);for(const t of n)if(o.log.debug("Extracting node",t,a,a.has(t)&&!a.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!a.has(t))o.log.debug("Not a cluster",t,r);else if(a.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){o.log.warn("Cluster with explicit dir, creating subgraph for children",t,r);const i=a.get(t).clusterData.dir,c=new g.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});D(t,e,c,t);const u=e.node(t)||{};e.setNode(t,{...u,clusterNode:!0,id:t,clusterData:a.get(t).clusterData,label:a.get(t).label,graph:c}),o.log.warn("Subgraph for cluster with explicit dir created:",t,v(c))}else if(!a.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){o.log.warn("Cluster without external connections, without a parent and with children",t,r);let c=e.graph().rankdir==="TB"?"LR":"TB";a.get(t)?.clusterData?.dir&&(c=a.get(t).clusterData.dir,o.log.warn("Fixing dir",a.get(t).clusterData.dir,c));const u=new g.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});D(t,e,u,t);const l=e.node(t)||{};e.setNode(t,{...l,clusterNode:!0,id:t,clusterData:a.get(t).clusterData,label:a.get(t).label,graph:u}),o.log.debug("Old graph after copy",v(e))}else o.log.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!a.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),o.log.debug(a);n=e.nodes(),o.log.warn("New list of nodes",n);for(const t of n){const i=e.node(t);o.log.warn(" Now next level",t,i),i?.clusterNode&&X(i.graph,r+1)}},"extractor"),A=o.__name((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),i=A(e,t);n=[...n,...i]}),n},"sorter"),U=o.__name(e=>A(e,e.children()),"sortNodesByHierarchy"),O=o.__name((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=a.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),H=o.__name((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||w(t,n))continue;const i=m(t,e,r);if(i&&!O(e,i,r))return i}return null},"findSafeAnchorNode");exports.adjustClustersAndEdges=R;exports.clear=p;exports.clusterDb=a;exports.findNonClusterChild=m;exports.sortNodesByHierarchy=U;exports.write=v;
2
+ //# sourceMappingURL=chunk-RYQCIY6F-he5fUSYo.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-RYQCIY6F-BgbNR_-2.cjs","sources":["../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/clone.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/json.js","../../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-RYQCIY6F.mjs"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\n/**\n * @import { NodeID, EdgeObj, GraphOptions } from './graph.js';\n */\n\nexport { write, read };\n\n/**\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n *\n * @typedef {object} GraphJSON\n * @property {Required<GraphOptions>} options - The options used to create the graph.\n * @property {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} nodes - The nodes in the graph.\n * @property {Array<EdgeObj & { value?: EdgeLabel }>} edges - The edges in the graph.\n * @property {GraphLabel} [value] - The graph's value, if any.\n */\n\n/**\n * Creates a JSON representation of the graph that can be serialized to a\n * string with\n * [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).\n * The graph can later be restored using {@link read}.\n *\n * @example\n *\n * ```js\n * var g = new graphlib.Graph();\n * g.setNode(\"a\", { label: \"node a\" });\n * g.setNode(\"b\", { label: \"node b\" });\n * g.setEdge(\"a\", \"b\", { label: \"edge a->b\" });\n * graphlib.json.write(g);\n * // Returns the object:\n * //\n * // {\n * // \"options\": {\n * // \"directed\": true,\n * // \"multigraph\": false,\n * // \"compound\": false\n * // },\n * // \"nodes\": [\n * // { \"v\": \"a\", \"value\": { \"label\": \"node a\" } },\n * // { \"v\": \"b\", \"value\": { \"label\": \"node b\" } }\n * // ],\n * // \"edges\": [\n * // { \"v\": \"a\", \"w\": \"b\", \"value\": { \"label\": \"edge a->b\" } }\n * // ]\n * // }\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {Graph<GraphLabel, NodeLabel, EdgeLabel>} g - The graph to serialize.\n * @returns {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} The JSON representation of the graph.\n */\nfunction write(g) {\n /** @type {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} */\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\n/**\n * @template NodeLabel - Label of a node.\n *\n * @param {Graph<unknown, NodeLabel, unknown>} g - The graph to serialize.\n * @returns {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} The nodes in the graph.\n */\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n /** @type {{ v: NodeID; value?: NodeLabel; parent?: NodeID }} */\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\n/**\n * @template EdgeLabel - Label of a node.\n *\n * @param {Graph<unknown, unknown, EdgeLabel>} g - The graph to serialize.\n * @returns {Array<EdgeObj & { value?: EdgeLabel }>} The edges in the graph.\n */\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n /** @type {EdgeObj & { value?: EdgeLabel }} */\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\n/**\n * Takes JSON as input and returns the graph representation.\n *\n * @example\n *\n * For example, if we have serialized the graph in {@link write}\n * to a string named `str`, we can restore it to a graph as follows:\n *\n * ```js\n * var g2 = graphlib.json.read(JSON.parse(str));\n * // or, in order to copy the graph\n * var g3 = graphlib.json.read(graphlib.json.write(g))\n *\n * g2.nodes();\n * // ['a', 'b']\n * g2.edges()\n * // [ { v: 'a', w: 'b' } ]\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} json - The JSON representation of the graph.\n * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} The restored graph.\n */\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n","import {\n log\n} from \"./chunk-X3CZISLH.mjs\";\nimport {\n __name\n} from \"./chunk-Y2CYZVJY.mjs\";\n\n// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport * as graphlibJson from \"dagre-d3-es/src/graphlib/json.js\";\nvar clusterDb = /* @__PURE__ */ new Map();\nvar descendants = /* @__PURE__ */ new Map();\nvar parents = /* @__PURE__ */ new Map();\nvar clear = /* @__PURE__ */ __name(() => {\n descendants.clear();\n parents.clear();\n clusterDb.clear();\n}, \"clear\");\nvar isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {\n const ancestorDescendants = descendants.get(ancestorId) || [];\n log.trace(\"In isDescendant\", ancestorId, \" \", id, \" = \", ancestorDescendants.includes(id));\n return ancestorDescendants.includes(id);\n}, \"isDescendant\");\nvar edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {\n const clusterDescendants = descendants.get(clusterId) || [];\n log.info(\"Descendants of \", clusterId, \" is \", clusterDescendants);\n log.info(\"Edge is \", edge);\n if (edge.v === clusterId || edge.w === clusterId) {\n return false;\n }\n if (!clusterDescendants) {\n log.debug(\"Tilt, \", clusterId, \",not in descendants\");\n return false;\n }\n return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);\n}, \"edgeInCluster\");\nvar copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {\n log.warn(\n \"Copying children of \",\n clusterId,\n \"root\",\n rootId,\n \"data\",\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n log.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn(\"Setting parent\", node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n if (clusterId !== rootId && node !== clusterId) {\n log.debug(\"Setting parent\", node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n log.debug(\n \"Not Setting parent for node=\",\n node,\n \"cluster!==rootId\",\n clusterId !== rootId,\n \"node!==clusterId\",\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug(\"Copying Edges\", edges);\n edges.forEach((edge) => {\n log.info(\"Edge\", edge);\n const data2 = graph.edge(edge.v, edge.w, edge.name);\n log.info(\"Edge data\", data2, rootId);\n try {\n if (edgeInCluster(edge, rootId)) {\n const rootDescendants = descendants.get(rootId) || [];\n const vIn = rootDescendants.includes(edge.v) || isDescendant(edge.v, rootId) || edge.v === rootId;\n const wIn = rootDescendants.includes(edge.w) || isDescendant(edge.w, rootId) || edge.w === rootId;\n if (vIn && wIn) {\n log.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n log.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n const newV = vIn ? rootId : edge.v;\n const newW = wIn ? rootId : edge.w;\n log.info(\"Rebinding cross-boundary edge as \", newV, newW, data2, edge.name);\n graph.setEdge(newV, newW, data2, edge.name);\n }\n } else {\n log.info(\n \"Skipping copy of edge \",\n edge.v,\n \"-->\",\n edge.w,\n \" rootId: \",\n rootId,\n \" clusterId:\",\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug(\"Removing node\", node);\n graph.removeNode(node);\n });\n}, \"copy\");\nvar extractDescendants = /* @__PURE__ */ __name((id, graph) => {\n const children = graph.children(id);\n let res = [...children];\n for (const child of children) {\n parents.set(child, id);\n res = [...res, ...extractDescendants(child, graph)];\n }\n return res;\n}, \"extractDescendants\");\nvar findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {\n const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);\n const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);\n const edges1Prim = edges1.map((edge) => {\n return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };\n });\n const edges2Prim = edges2.map((edge) => {\n return { v: edge.v, w: edge.w };\n });\n const result = edges1Prim.filter((edgeIn1) => {\n return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);\n });\n return result;\n}, \"findCommonEdges\");\nvar findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {\n const children = graph.children(id);\n log.trace(\"Searching children of id \", id, children);\n if (children.length < 1) {\n return id;\n }\n let reserve;\n for (const child of children) {\n const _id = findNonClusterChild(child, graph, clusterId);\n const commonEdges = findCommonEdges(graph, clusterId, _id);\n if (_id) {\n if (commonEdges.length > 0) {\n reserve = _id;\n } else {\n return _id;\n }\n }\n }\n return reserve;\n}, \"findNonClusterChild\");\nvar getAnchorId = /* @__PURE__ */ __name((id) => {\n if (!clusterDb.has(id)) {\n return id;\n }\n if (!clusterDb.get(id).externalConnections) {\n return id;\n }\n if (clusterDb.has(id)) {\n return clusterDb.get(id).id;\n }\n return id;\n}, \"getAnchorId\");\nvar adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {\n if (!graph || depth > 10) {\n log.debug(\"Opting out, no graph \");\n return;\n } else {\n log.debug(\"Opting in, graph \");\n }\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n \"Cluster identified\",\n id,\n \" Replacement id in edges: \",\n findNonClusterChild(id, graph, id)\n );\n descendants.set(id, extractDescendants(id, graph));\n clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });\n }\n });\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug(\"Cluster identified\", id, descendants);\n edges.forEach((edge) => {\n const d1 = isDescendant(edge.v, id);\n const d2 = isDescendant(edge.w, id);\n if (d1 ^ d2) {\n log.warn(\"Edge: \", edge, \" leaves cluster \", id);\n log.warn(\"Descendants of XXX \", id, \": \", descendants.get(id));\n clusterDb.get(id).externalConnections = true;\n }\n });\n } else {\n log.debug(\"Not a cluster \", id, descendants);\n }\n });\n for (let id of clusterDb.keys()) {\n const nonClusterChild = clusterDb.get(id).id;\n const parent = graph.parent(nonClusterChild);\n if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {\n clusterDb.get(id).id = parent;\n }\n const hasDirectOutgoingEdge = graph.edges().some((edge) => edge.v === id);\n if (nonClusterChild && clusterDb.get(id)?.externalConnections && hasDirectOutgoingEdge && isNodeInExtractableCluster(graph, nonClusterChild, id)) {\n const safeAnchor = findSafeAnchorNode(graph, id, graph.parent(nonClusterChild));\n if (safeAnchor) {\n clusterDb.get(id).id = safeAnchor;\n }\n }\n }\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n let v = e.v;\n let w = e.w;\n log.warn(\n \"Fix XXX\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n \" --- \",\n clusterDb.get(e.w)\n );\n if (clusterDb.get(e.v) || clusterDb.get(e.w)) {\n log.warn(\"Fixing and trying - removing XXX\", e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) {\n const parent = graph.parent(v);\n clusterDb.get(parent).externalConnections = true;\n edge.fromCluster = e.v;\n }\n if (w !== e.w) {\n const parent = graph.parent(w);\n clusterDb.get(parent).externalConnections = true;\n edge.toCluster = e.w;\n }\n log.warn(\"Fix Replacing with XXX\", v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn(\"Adjusted Graph\", graphlibJson.write(graph));\n extractor(graph, 0);\n log.trace(clusterDb);\n}, \"adjustClustersAndEdges\");\nvar extractor = /* @__PURE__ */ __name((graph, depth) => {\n log.warn(\"extractor - \", depth, graphlibJson.write(graph), graph.children(\"D\"));\n if (depth > 10) {\n log.error(\"Bailing out\");\n return;\n }\n let nodes = graph.nodes();\n let hasChildren = false;\n for (const node of nodes) {\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n if (!hasChildren) {\n log.debug(\"Done, no node has children\", graph.nodes());\n return;\n }\n log.debug(\"Nodes = \", nodes, depth);\n for (const node of nodes) {\n log.debug(\n \"Extracting node\",\n node,\n clusterDb,\n clusterDb.has(node) && !clusterDb.get(node).externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children(\"D\"),\n \" Depth \",\n depth\n );\n if (!clusterDb.has(node)) {\n log.debug(\"Not a cluster\", node, depth);\n } else if (clusterDb.get(node)?.clusterData?.explicitDir && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\"Cluster with explicit dir, creating subgraph for children\", node, depth);\n const dir = clusterDb.get(node).clusterData.dir;\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.warn(\n \"Subgraph for cluster with explicit dir created:\",\n node,\n graphlibJson.write(clusterGraph)\n );\n } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\n \"Cluster without external connections, without a parent and with children\",\n node,\n depth\n );\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n if (clusterDb.get(node)?.clusterData?.dir) {\n dir = clusterDb.get(node).clusterData.dir;\n log.warn(\"Fixing dir\", clusterDb.get(node).clusterData.dir, dir);\n }\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.debug(\"Old graph after copy\", graphlibJson.write(graph));\n } else {\n log.warn(\n \"Cluster ** \",\n node,\n \" **not meeting the criteria !externalConnections:\",\n !clusterDb.get(node).externalConnections,\n \" no parent: \",\n !graph.parent(node),\n \" children \",\n graph.children(node) && graph.children(node).length > 0,\n graph.children(\"D\"),\n depth\n );\n log.debug(clusterDb);\n }\n }\n nodes = graph.nodes();\n log.warn(\"New list of nodes\", nodes);\n for (const node of nodes) {\n const data = graph.node(node);\n log.warn(\" Now next level\", node, data);\n if (data?.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n}, \"extractor\");\nvar sorter = /* @__PURE__ */ __name((graph, nodes) => {\n if (nodes.length === 0) {\n return [];\n }\n let result = Object.assign([], nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = [...result, ...sorted];\n });\n return result;\n}, \"sorter\");\nvar sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), \"sortNodesByHierarchy\");\nvar isNodeInExtractableCluster = /* @__PURE__ */ __name((graph, node, rootId) => {\n let parent = graph.parent(node);\n while (parent && parent !== rootId) {\n const cluster = clusterDb.get(parent);\n if (cluster && !cluster.externalConnections) {\n return true;\n }\n parent = graph.parent(parent);\n }\n return false;\n}, \"isNodeInExtractableCluster\");\nvar findSafeAnchorNode = /* @__PURE__ */ __name((graph, clusterId, excludedCluster) => {\n const children = graph.children(clusterId) ?? [];\n for (const child of children) {\n if (child === excludedCluster || isDescendant(child, excludedCluster)) {\n continue;\n }\n const candidate = findNonClusterChild(child, graph, clusterId);\n if (!candidate) {\n continue;\n }\n if (!isNodeInExtractableCluster(graph, candidate, clusterId)) {\n return candidate;\n }\n }\n return null;\n}, \"findSafeAnchorNode\");\n\nexport {\n clusterDb,\n clear,\n findNonClusterChild,\n adjustClustersAndEdges,\n sortNodesByHierarchy\n};\n"],"names":["CLONE_SYMBOLS_FLAG","clone","value","baseClone","write","g","json","writeNodes","writeEdges","_.isUndefined","_.clone","_.map","v","nodeValue","parent","node","e","edgeValue","edge","clusterDb","descendants","parents","clear","__name","isDescendant","id","ancestorId","ancestorDescendants","log","edgeInCluster","clusterId","clusterDescendants","copy","graph","newGraph","rootId","nodes","data","edges","data2","rootDescendants","vIn","wIn","newV","newW","extractDescendants","children","res","child","findCommonEdges","id1","id2","edges1","edges2","edges1Prim","edges2Prim","edgeIn1","findNonClusterChild","reserve","_id","commonEdges","getAnchorId","adjustClustersAndEdges","depth","d1","d2","nonClusterChild","hasDirectOutgoingEdge","isNodeInExtractableCluster","safeAnchor","findSafeAnchorNode","w","graphlibJson.write","extractor","hasChildren","dir","clusterGraph","graphlib.Graph","clusterNodeData","sorter","result","sorted","sortNodesByHierarchy","cluster","excludedCluster","candidate"],"mappings":"iIAGA,IAAIA,EAAqB,EA4BzB,SAASC,EAAMC,EAAO,CACpB,OAAOC,EAAAA,UAAUD,EAAOF,CAAkB,CAC5C,CC0BA,SAASI,EAAMC,EAAG,CAEhB,IAAIC,EAAO,CACT,QAAS,CACP,SAAUD,EAAE,WAAU,EACtB,WAAYA,EAAE,aAAY,EAC1B,SAAUA,EAAE,WAAU,CAC5B,EACI,MAAOE,EAAWF,CAAC,EACnB,MAAOG,EAAWH,CAAC,CACvB,EACE,OAAKI,EAAAA,YAAcJ,EAAE,MAAK,CAAE,IAC1BC,EAAK,MAAQI,EAAQL,EAAE,MAAK,CAAE,G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EAAOoC,CAAe,EAClE,SAEF,MAAMC,EAAY5B,EAAoBT,EAAOf,EAAOH,CAAS,EAC7D,GAAKuD,GAGD,CAACjB,EAA2BnC,EAAOoD,EAAWvD,CAAS,EACzD,OAAOuD,CAEX,CACA,OAAO,IACT,EAAG,oBAAoB","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"chunk-RYQCIY6F-he5fUSYo.cjs","sources":["../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/clone.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/json.js","../../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-RYQCIY6F.mjs"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\n/**\n * @import { NodeID, EdgeObj, GraphOptions } from './graph.js';\n */\n\nexport { write, read };\n\n/**\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n *\n * @typedef {object} GraphJSON\n * @property {Required<GraphOptions>} options - The options used to create the graph.\n * @property {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} nodes - The nodes in the graph.\n * @property {Array<EdgeObj & { value?: EdgeLabel }>} edges - The edges in the graph.\n * @property {GraphLabel} [value] - The graph's value, if any.\n */\n\n/**\n * Creates a JSON representation of the graph that can be serialized to a\n * string with\n * [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).\n * The graph can later be restored using {@link read}.\n *\n * @example\n *\n * ```js\n * var g = new graphlib.Graph();\n * g.setNode(\"a\", { label: \"node a\" });\n * g.setNode(\"b\", { label: \"node b\" });\n * g.setEdge(\"a\", \"b\", { label: \"edge a->b\" });\n * graphlib.json.write(g);\n * // Returns the object:\n * //\n * // {\n * // \"options\": {\n * // \"directed\": true,\n * // \"multigraph\": false,\n * // \"compound\": false\n * // },\n * // \"nodes\": [\n * // { \"v\": \"a\", \"value\": { \"label\": \"node a\" } },\n * // { \"v\": \"b\", \"value\": { \"label\": \"node b\" } }\n * // ],\n * // \"edges\": [\n * // { \"v\": \"a\", \"w\": \"b\", \"value\": { \"label\": \"edge a->b\" } }\n * // ]\n * // }\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {Graph<GraphLabel, NodeLabel, EdgeLabel>} g - The graph to serialize.\n * @returns {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} The JSON representation of the graph.\n */\nfunction write(g) {\n /** @type {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} */\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\n/**\n * @template NodeLabel - Label of a node.\n *\n * @param {Graph<unknown, NodeLabel, unknown>} g - The graph to serialize.\n * @returns {Array<{ v: NodeID; value?: NodeLabel; parent?: NodeID }>} The nodes in the graph.\n */\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n /** @type {{ v: NodeID; value?: NodeLabel; parent?: NodeID }} */\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\n/**\n * @template EdgeLabel - Label of a node.\n *\n * @param {Graph<unknown, unknown, EdgeLabel>} g - The graph to serialize.\n * @returns {Array<EdgeObj & { value?: EdgeLabel }>} The edges in the graph.\n */\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n /** @type {EdgeObj & { value?: EdgeLabel }} */\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\n/**\n * Takes JSON as input and returns the graph representation.\n *\n * @example\n *\n * For example, if we have serialized the graph in {@link write}\n * to a string named `str`, we can restore it to a graph as follows:\n *\n * ```js\n * var g2 = graphlib.json.read(JSON.parse(str));\n * // or, in order to copy the graph\n * var g3 = graphlib.json.read(graphlib.json.write(g))\n *\n * g2.nodes();\n * // ['a', 'b']\n * g2.edges()\n * // [ { v: 'a', w: 'b' } ]\n * ```\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * @template [EdgeLabel=any] - Label of an edge.\n * @param {GraphJSON<GraphLabel, NodeLabel, EdgeLabel>} json - The JSON representation of the graph.\n * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} The restored graph.\n */\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n","import {\n log\n} from \"./chunk-X3CZISLH.mjs\";\nimport {\n __name\n} from \"./chunk-Y2CYZVJY.mjs\";\n\n// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport * as graphlibJson from \"dagre-d3-es/src/graphlib/json.js\";\nvar clusterDb = /* @__PURE__ */ new Map();\nvar descendants = /* @__PURE__ */ new Map();\nvar parents = /* @__PURE__ */ new Map();\nvar clear = /* @__PURE__ */ __name(() => {\n descendants.clear();\n parents.clear();\n clusterDb.clear();\n}, \"clear\");\nvar isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {\n const ancestorDescendants = descendants.get(ancestorId) || [];\n log.trace(\"In isDescendant\", ancestorId, \" \", id, \" = \", ancestorDescendants.includes(id));\n return ancestorDescendants.includes(id);\n}, \"isDescendant\");\nvar edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {\n const clusterDescendants = descendants.get(clusterId) || [];\n log.info(\"Descendants of \", clusterId, \" is \", clusterDescendants);\n log.info(\"Edge is \", edge);\n if (edge.v === clusterId || edge.w === clusterId) {\n return false;\n }\n if (!clusterDescendants) {\n log.debug(\"Tilt, \", clusterId, \",not in descendants\");\n return false;\n }\n return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);\n}, \"edgeInCluster\");\nvar copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {\n log.warn(\n \"Copying children of \",\n clusterId,\n \"root\",\n rootId,\n \"data\",\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n log.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn(\"Setting parent\", node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n if (clusterId !== rootId && node !== clusterId) {\n log.debug(\"Setting parent\", node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n log.debug(\n \"Not Setting parent for node=\",\n node,\n \"cluster!==rootId\",\n clusterId !== rootId,\n \"node!==clusterId\",\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug(\"Copying Edges\", edges);\n edges.forEach((edge) => {\n log.info(\"Edge\", edge);\n const data2 = graph.edge(edge.v, edge.w, edge.name);\n log.info(\"Edge data\", data2, rootId);\n try {\n if (edgeInCluster(edge, rootId)) {\n const rootDescendants = descendants.get(rootId) || [];\n const vIn = rootDescendants.includes(edge.v) || isDescendant(edge.v, rootId) || edge.v === rootId;\n const wIn = rootDescendants.includes(edge.w) || isDescendant(edge.w, rootId) || edge.w === rootId;\n if (vIn && wIn) {\n log.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n log.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n const newV = vIn ? rootId : edge.v;\n const newW = wIn ? rootId : edge.w;\n log.info(\"Rebinding cross-boundary edge as \", newV, newW, data2, edge.name);\n graph.setEdge(newV, newW, data2, edge.name);\n }\n } else {\n log.info(\n \"Skipping copy of edge \",\n edge.v,\n \"-->\",\n edge.w,\n \" rootId: \",\n rootId,\n \" clusterId:\",\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug(\"Removing node\", node);\n graph.removeNode(node);\n });\n}, \"copy\");\nvar extractDescendants = /* @__PURE__ */ __name((id, graph) => {\n const children = graph.children(id);\n let res = [...children];\n for (const child of children) {\n parents.set(child, id);\n res = [...res, ...extractDescendants(child, graph)];\n }\n return res;\n}, \"extractDescendants\");\nvar findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {\n const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);\n const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);\n const edges1Prim = edges1.map((edge) => {\n return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };\n });\n const edges2Prim = edges2.map((edge) => {\n return { v: edge.v, w: edge.w };\n });\n const result = edges1Prim.filter((edgeIn1) => {\n return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);\n });\n return result;\n}, \"findCommonEdges\");\nvar findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {\n const children = graph.children(id);\n log.trace(\"Searching children of id \", id, children);\n if (children.length < 1) {\n return id;\n }\n let reserve;\n for (const child of children) {\n const _id = findNonClusterChild(child, graph, clusterId);\n const commonEdges = findCommonEdges(graph, clusterId, _id);\n if (_id) {\n if (commonEdges.length > 0) {\n reserve = _id;\n } else {\n return _id;\n }\n }\n }\n return reserve;\n}, \"findNonClusterChild\");\nvar getAnchorId = /* @__PURE__ */ __name((id) => {\n if (!clusterDb.has(id)) {\n return id;\n }\n if (!clusterDb.get(id).externalConnections) {\n return id;\n }\n if (clusterDb.has(id)) {\n return clusterDb.get(id).id;\n }\n return id;\n}, \"getAnchorId\");\nvar adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {\n if (!graph || depth > 10) {\n log.debug(\"Opting out, no graph \");\n return;\n } else {\n log.debug(\"Opting in, graph \");\n }\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n \"Cluster identified\",\n id,\n \" Replacement id in edges: \",\n findNonClusterChild(id, graph, id)\n );\n descendants.set(id, extractDescendants(id, graph));\n clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });\n }\n });\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug(\"Cluster identified\", id, descendants);\n edges.forEach((edge) => {\n const d1 = isDescendant(edge.v, id);\n const d2 = isDescendant(edge.w, id);\n if (d1 ^ d2) {\n log.warn(\"Edge: \", edge, \" leaves cluster \", id);\n log.warn(\"Descendants of XXX \", id, \": \", descendants.get(id));\n clusterDb.get(id).externalConnections = true;\n }\n });\n } else {\n log.debug(\"Not a cluster \", id, descendants);\n }\n });\n for (let id of clusterDb.keys()) {\n const nonClusterChild = clusterDb.get(id).id;\n const parent = graph.parent(nonClusterChild);\n if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {\n clusterDb.get(id).id = parent;\n }\n const hasDirectOutgoingEdge = graph.edges().some((edge) => edge.v === id);\n if (nonClusterChild && clusterDb.get(id)?.externalConnections && hasDirectOutgoingEdge && isNodeInExtractableCluster(graph, nonClusterChild, id)) {\n const safeAnchor = findSafeAnchorNode(graph, id, graph.parent(nonClusterChild));\n if (safeAnchor) {\n clusterDb.get(id).id = safeAnchor;\n }\n }\n }\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n let v = e.v;\n let w = e.w;\n log.warn(\n \"Fix XXX\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n \" --- \",\n clusterDb.get(e.w)\n );\n if (clusterDb.get(e.v) || clusterDb.get(e.w)) {\n log.warn(\"Fixing and trying - removing XXX\", e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) {\n const parent = graph.parent(v);\n clusterDb.get(parent).externalConnections = true;\n edge.fromCluster = e.v;\n }\n if (w !== e.w) {\n const parent = graph.parent(w);\n clusterDb.get(parent).externalConnections = true;\n edge.toCluster = e.w;\n }\n log.warn(\"Fix Replacing with XXX\", v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn(\"Adjusted Graph\", graphlibJson.write(graph));\n extractor(graph, 0);\n log.trace(clusterDb);\n}, \"adjustClustersAndEdges\");\nvar extractor = /* @__PURE__ */ __name((graph, depth) => {\n log.warn(\"extractor - \", depth, graphlibJson.write(graph), graph.children(\"D\"));\n if (depth > 10) {\n log.error(\"Bailing out\");\n return;\n }\n let nodes = graph.nodes();\n let hasChildren = false;\n for (const node of nodes) {\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n if (!hasChildren) {\n log.debug(\"Done, no node has children\", graph.nodes());\n return;\n }\n log.debug(\"Nodes = \", nodes, depth);\n for (const node of nodes) {\n log.debug(\n \"Extracting node\",\n node,\n clusterDb,\n clusterDb.has(node) && !clusterDb.get(node).externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children(\"D\"),\n \" Depth \",\n depth\n );\n if (!clusterDb.has(node)) {\n log.debug(\"Not a cluster\", node, depth);\n } else if (clusterDb.get(node)?.clusterData?.explicitDir && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\"Cluster with explicit dir, creating subgraph for children\", node, depth);\n const dir = clusterDb.get(node).clusterData.dir;\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.warn(\n \"Subgraph for cluster with explicit dir created:\",\n node,\n graphlibJson.write(clusterGraph)\n );\n } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\n \"Cluster without external connections, without a parent and with children\",\n node,\n depth\n );\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n if (clusterDb.get(node)?.clusterData?.dir) {\n dir = clusterDb.get(node).clusterData.dir;\n log.warn(\"Fixing dir\", clusterDb.get(node).clusterData.dir, dir);\n }\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n copy(node, graph, clusterGraph, node);\n const clusterNodeData = graph.node(node) || {};\n graph.setNode(node, {\n ...clusterNodeData,\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.debug(\"Old graph after copy\", graphlibJson.write(graph));\n } else {\n log.warn(\n \"Cluster ** \",\n node,\n \" **not meeting the criteria !externalConnections:\",\n !clusterDb.get(node).externalConnections,\n \" no parent: \",\n !graph.parent(node),\n \" children \",\n graph.children(node) && graph.children(node).length > 0,\n graph.children(\"D\"),\n depth\n );\n log.debug(clusterDb);\n }\n }\n nodes = graph.nodes();\n log.warn(\"New list of nodes\", nodes);\n for (const node of nodes) {\n const data = graph.node(node);\n log.warn(\" Now next level\", node, data);\n if (data?.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n}, \"extractor\");\nvar sorter = /* @__PURE__ */ __name((graph, nodes) => {\n if (nodes.length === 0) {\n return [];\n }\n let result = Object.assign([], nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = [...result, ...sorted];\n });\n return result;\n}, \"sorter\");\nvar sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), \"sortNodesByHierarchy\");\nvar isNodeInExtractableCluster = /* @__PURE__ */ __name((graph, node, rootId) => {\n let parent = graph.parent(node);\n while (parent && parent !== rootId) {\n const cluster = clusterDb.get(parent);\n if (cluster && !cluster.externalConnections) {\n return true;\n }\n parent = graph.parent(parent);\n }\n return false;\n}, \"isNodeInExtractableCluster\");\nvar findSafeAnchorNode = /* @__PURE__ */ __name((graph, clusterId, excludedCluster) => {\n const children = graph.children(clusterId) ?? [];\n for (const child of children) {\n if (child === excludedCluster || isDescendant(child, excludedCluster)) {\n continue;\n }\n const candidate = findNonClusterChild(child, graph, clusterId);\n if (!candidate) {\n continue;\n }\n if (!isNodeInExtractableCluster(graph, candidate, clusterId)) {\n return candidate;\n }\n }\n return null;\n}, \"findSafeAnchorNode\");\n\nexport {\n clusterDb,\n clear,\n findNonClusterChild,\n adjustClustersAndEdges,\n sortNodesByHierarchy\n};\n"],"names":["CLONE_SYMBOLS_FLAG","clone","value","baseClone","write","g","json","writeNodes","writeEdges","_.isUndefined","_.clone","_.map","v","nodeValue","parent","node","e","edgeValue","edge","clusterDb","descendants","parents","clear","__name","isDescendant","id","ancestorId","ancestorDescendants","log","edgeInCluster","clusterId","clusterDescendants","copy","graph","newGraph","rootId","nodes","data","edges","data2","rootDescendants","vIn","wIn","newV","newW","extractDescendants","children","res","child","findCommonEdges","id1","id2","edges1","edges2","edges1Prim","edges2Prim","edgeIn1","findNonClusterChild","reserve","_id","commonEdges","getAnchorId","adjustClustersAndEdges","depth","d1","d2","nonClusterChild","hasDirectOutgoingEdge","isNodeInExtractableCluster","safeAnchor","findSafeAnchorNode","w","graphlibJson.write","extractor","hasChildren","dir","clusterGraph","graphlib.Graph","clusterNodeData","sorter","result","sorted","sortNodesByHierarchy","cluster","excludedCluster","candidate"],"mappings":"iIAGA,IAAIA,EAAqB,EA4BzB,SAASC,EAAMC,EAAO,CACpB,OAAOC,EAAAA,UAAUD,EAAOF,CAAkB,CAC5C,CC0BA,SAASI,EAAMC,EAAG,CAEhB,IAAIC,E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ETrE,EAASmB,EAAM,OAAOnB,CAAM,CAC9B,CACA,MAAO,EACT,EAAG,4BAA4B,EAC3BwD,EAAqC/C,EAAAA,OAAO,CAACU,EAAOH,EAAWsD,IAAoB,CACrF,MAAMtC,EAAWb,EAAM,SAASH,CAAS,GAAK,CAAA,EAC9C,UAAWkB,KAASF,EAAU,CAC5B,GAAIE,IAAUoC,GAAmB5D,EAAawB,EAAOoC,CAAe,EAClE,SAEF,MAAMC,EAAY5B,EAAoBT,EAAOf,EAAOH,CAAS,EAC7D,GAAKuD,GAGD,CAACjB,EAA2BnC,EAAOoD,EAAWvD,CAAS,EACzD,OAAOuD,CAEX,CACA,OAAO,IACT,EAAG,oBAAoB","x_google_ignoreList":[0,1,2]}
@@ -1,4 +1,4 @@
1
- "use strict";const He=require("./chunk-5VM5RSS4-DCM2evxn.cjs"),Je=require("./chunk-XXDRQBXY-rC42S5QT.cjs"),Ze=require("./chunk-VR4S4FIN-y0SDmoh2.cjs"),r=require("./extractHeadings-vnYM8Eet.cjs"),$e=require("./chunk-32BRIVSS-CyUS1-2x.cjs"),et=require("dompurify");var xe=(function(){var s=r.__name(function(v,h,d,f){for(d=d||{},f=v.length;f--;d[v[f]]=h);return d},"o"),i=[1,18],a=[1,19],n=[1,20],u=[1,41],o=[1,26],l=[1,42],p=[1,24],g=[1,25],m=[1,32],S=[1,33],de=[1,34],b=[1,45],pe=[1,35],fe=[1,36],Ae=[1,37],me=[1,38],ge=[1,27],Ce=[1,28],be=[1,29],ke=[1,30],Ee=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Te=[1,9],A=[1,8,9],J=[1,58],Z=[1,59],$=[1,60],ee=[1,61],te=[1,62],ye=[1,63],_e=[1,64],F=[1,8,9,41],ve=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],se=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ie=[13,60,86,100,102,103],G=[13,60,73,74,86,100,102,103],Ie=[13,60,68,69,70,71,72,86,100,102,103],ae=[1,103],U=[1,121],z=[1,117],Y=[1,113],K=[1,119],Q=[1,114],W=[1,115],q=[1,116],X=[1,118],j=[1,120],Oe=[22,50,60,61,82,86,87,88,89,90],we=[1,128],ne=[12,39],De=[1,8,9,39,41,44,46],re=[1,8,9,22],Ve=[1,153],Pe=[1,8,9,61],L=[1,8,9,22,50,60,61,82,86,87,88,89,90],Fe={trace:r.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:r.__name(function(h,d,f,c,C,e,H){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:c.addRelation(e[t]);break;case 20:e[t-1].title=c.cleanupLabel(e[t]),c.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),c.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),c.setAccDescription(this.$);break;case 34:c.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),c.popNamespace();break;case 35:c.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),c.popNamespace();break;case 36:this.$=c.addNamespace(e[t]);break;case 37:this.$=c.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:c.setCssClass(e[t-2],e[t]);break;case 49:c.addMembers(e[t-3],e[t-1]);break;case 51:c.setCssClass(e[t-5],e[t-3]),c.addMembers(e[t-5],e[t-1]);break;case 52:c.addAnnotation(e[t-3],e[t-1]);break;case 53:c.addAnnotation(e[t-6],e[t-4]),c.addMembers(e[t-6],e[t-1]);break;case 54:c.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],c.addClass(e[t]);break;case 56:this.$=e[t-1],c.addClass(e[t-1]),c.setClassLabel(e[t-1],e[t]);break;case 60:c.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:c.addMember(e[t-1],c.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=c.addNote(e[t],e[t-1]);break;case 72:this.$=c.addNote(e[t]);break;case 73:this.$=e[t-2],c.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:c.setDirection("TB");break;case 77:c.setDirection("BT");break;case 78:c.setDirection("RL");break;case 79:c.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=c.relationType.AGGREGATION;break;case 85:this.$=c.relationType.EXTENSION;break;case 86:this.$=c.relationType.COMPOSITION;break;case 87:this.$=c.relationType.DEPENDENCY;break;case 88:this.$=c.relationType.LOLLIPOP;break;case 89:this.$=c.lineType.LINE;break;case 90:this.$=c.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],c.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],c.setClickEvent(e[t-2],e[t-1]),c.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],c.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],c.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],c.setLink(e[t-2],e[t-1]),c.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],c.setLink(e[t-3],e[t-2],e[t]),c.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],c.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],c.setClickEvent(e[t-3],e[t-2],e[t-1]),c.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],c.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],c.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],c.setLink(e[t-3],e[t-1]),c.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],c.setLink(e[t-4],e[t-2],e[t]),c.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],c.setCssStyle(e[t-1],e[t]);break;case 106:c.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:u,43:23,46:o,48:l,51:p,52:g,54:m,56:S,57:de,60:b,62:pe,63:fe,64:Ae,65:me,75:ge,76:Ce,78:be,82:ke,83:Ee,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Te,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:J,69:Z,70:$,71:ee,72:te,73:ye,74:_e}),{39:[1,65]},s(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:ve,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(se,[2,133]),s(se,[2,134]),s(se,[2,135]),s(se,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Te,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:u,46:o,48:l,51:p,52:g,54:m,56:S,57:de,60:b,62:pe,63:fe,64:Ae,65:me,75:ge,76:Ce,78:be,82:ke,83:Ee,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:u,43:23,46:o,48:l,51:p,52:g,54:m,56:S,57:de,60:b,62:pe,63:fe,64:Ae,65:me,75:ge,76:Ce,78:be,82:ke,83:Ee,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:J,69:Z,70:$,71:ee,72:te,73:ye,74:_e},s(A,[2,64]),{67:93,73:ye,74:_e},s(ie,[2,83],{66:94,68:J,69:Z,70:$,71:ee,72:te}),s(G,[2,84]),s(G,[2,85]),s(G,[2,86]),s(G,[2,87]),s(G,[2,88]),s(Ie,[2,89]),s(Ie,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:u,43:23,48:l,54:m,56:S},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ae},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:U,50:z,59:110,60:Y,82:K,84:111,85:112,86:Q,87:W,88:q,89:X,90:j},{60:[1,122]},{13:ve,55:123},s(F,[2,72]),s(F,[2,138]),{22:U,50:z,59:124,60:Y,61:[1,125],82:K,84:111,85:112,86:Q,87:W,88:q,89:X,90:j},s(Oe,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(P,[2,16]),s(P,[2,17]),s(P,[2,18]),{11:127,12:we,39:[2,36]},s(ne,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(ne,[2,10]),s(De,[2,55],{11:131,12:we}),s(Te,[2,7]),{9:[1,132]},s(re,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(ie,[2,82],{66:136,68:J,69:Z,70:$,71:ee,72:te}),s(ie,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:u,43:23,48:l,54:m,56:S},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(F,[2,48],{39:[1,142]}),{41:[1,143]},s(F,[2,50]),{41:[2,61],45:144,51:ae},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:Ve}),s(Pe,[2,107],{85:154,22:U,50:z,60:Y,82:K,86:Q,87:W,88:q,89:X,90:j}),s(L,[2,109]),s(L,[2,111]),s(L,[2,112]),s(L,[2,113]),s(L,[2,114]),s(L,[2,115]),s(L,[2,116]),s(L,[2,117]),s(L,[2,118]),s(L,[2,119]),s(A,[2,106]),s(F,[2,71]),s(A,[2,73],{61:Ve}),{60:[1,155]},s(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(ne,[2,12]),s(De,[2,56]),{1:[2,4]},s(re,[2,69]),s(re,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(ie,[2,80]),s(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:u,43:23,48:l,54:m,56:S},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:u,43:23,48:l,54:m,56:S},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:u,43:23,48:l,54:m,56:S},{45:163,51:ae},s(F,[2,49]),{41:[2,62]},s(F,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:U,50:z,60:Y,82:K,84:169,85:112,86:Q,87:W,88:q,89:X,90:j},s(L,[2,110]),s(Oe,[2,75]),{14:[1,170]},s(ne,[2,11]),s(re,[2,70]),s(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ae},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Pe,[2,108],{85:154,22:U,50:z,60:Y,82:K,86:Q,87:W,88:q,89:X,90:j}),s(De,[2,8]),s(F,[2,51]),{41:[1,175]},s(F,[2,54]),s(A,[2,104]),s(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:r.__name(function(h,d){if(d.recoverable)this.trace(h);else{var f=new Error(h);throw f.hash=d,f}},"parseError"),parse:r.__name(function(h){var d=this,f=[0],c=[],C=[null],e=[],H=this.table,t="",le=0,Me=0,We=2,Re=1,qe=e.slice.call(arguments,1),_=Object.create(this.lexer),O={yy:{}};for(var Be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Be)&&(O.yy[Be]=this.yy[Be]);_.setInput(h,O.yy),O.yy.lexer=_,O.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Se=_.yylloc;e.push(Se);var Xe=_.options&&_.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(B){f.length=f.length-2*B,C.length=C.length-B,e.length=e.length-B}r.__name(je,"popStack");function Ge(){var B;return B=c.pop()||_.lex()||Re,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=d.symbols_[B]||B),B}r.__name(Ge,"lex");for(var D,w,N,Ne,M={},ce,x,Ue,oe;;){if(w=f[f.length-1],this.defaultActions[w]?N=this.defaultActions[w]:((D===null||typeof D>"u")&&(D=Ge()),N=H[w]&&H[w][D]),typeof N>"u"||!N.length||!N[0]){var Le="";oe=[];for(ce in H[w])this.terminals_[ce]&&ce>We&&oe.push("'"+this.terminals_[ce]+"'");_.showPosition?Le="Parse error on line "+(le+1)+`:
1
+ "use strict";const He=require("./chunk-5VM5RSS4-CxjaLXsB.cjs"),Je=require("./chunk-XXDRQBXY-C2UaLfce.cjs"),Ze=require("./chunk-VR4S4FIN-Bd3wwAe8.cjs"),r=require("./extractHeadings-BsiIYa_e.cjs"),$e=require("./chunk-32BRIVSS-D2F2B9TZ.cjs"),et=require("dompurify");var xe=(function(){var s=r.__name(function(v,h,d,f){for(d=d||{},f=v.length;f--;d[v[f]]=h);return d},"o"),i=[1,18],a=[1,19],n=[1,20],u=[1,41],o=[1,26],l=[1,42],p=[1,24],g=[1,25],m=[1,32],S=[1,33],de=[1,34],b=[1,45],pe=[1,35],fe=[1,36],Ae=[1,37],me=[1,38],ge=[1,27],Ce=[1,28],be=[1,29],ke=[1,30],Ee=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Te=[1,9],A=[1,8,9],J=[1,58],Z=[1,59],$=[1,60],ee=[1,61],te=[1,62],ye=[1,63],_e=[1,64],F=[1,8,9,41],ve=[1,77],P=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],se=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ie=[13,60,86,100,102,103],G=[13,60,73,74,86,100,102,103],Ie=[13,60,68,69,70,71,72,86,100,102,103],ae=[1,103],U=[1,121],z=[1,117],Y=[1,113],K=[1,119],Q=[1,114],W=[1,115],q=[1,116],X=[1,118],j=[1,120],Oe=[22,50,60,61,82,86,87,88,89,90],we=[1,128],ne=[12,39],De=[1,8,9,39,41,44,46],re=[1,8,9,22],Ve=[1,153],Pe=[1,8,9,61],L=[1,8,9,22,50,60,61,82,86,87,88,89,90],Fe={trace:r.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:r.__name(function(h,d,f,c,C,e,H){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:c.addRelation(e[t]);break;case 20:e[t-1].title=c.cleanupLabel(e[t]),c.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),c.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),c.setAccDescription(this.$);break;case 34:c.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),c.popNamespace();break;case 35:c.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),c.popNamespace();break;case 36:this.$=c.addNamespace(e[t]);break;case 37:this.$=c.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:c.setCssClass(e[t-2],e[t]);break;case 49:c.addMembers(e[t-3],e[t-1]);break;case 51:c.setCssClass(e[t-5],e[t-3]),c.addMembers(e[t-5],e[t-1]);break;case 52:c.addAnnotation(e[t-3],e[t-1]);break;case 53:c.addAnnotation(e[t-6],e[t-4]),c.addMembers(e[t-6],e[t-1]);break;case 54:c.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],c.addClass(e[t]);break;case 56:this.$=e[t-1],c.addClass(e[t-1]),c.setClassLabel(e[t-1],e[t]);break;case 60:c.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:c.addMember(e[t-1],c.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=c.addNote(e[t],e[t-1]);break;case 72:this.$=c.addNote(e[t]);break;case 73:this.$=e[t-2],c.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:c.setDirection("TB");break;case 77:c.setDirection("BT");break;case 78:c.setDirection("RL");break;case 79:c.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=c.relationType.AGGREGATION;break;case 85:this.$=c.relationType.EXTENSION;break;case 86:this.$=c.relationType.COMPOSITION;break;case 87:this.$=c.relationType.DEPENDENCY;break;case 88:this.$=c.relationType.LOLLIPOP;break;case 89:this.$=c.lineType.LINE;break;case 90:this.$=c.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],c.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],c.setClickEvent(e[t-2],e[t-1]),c.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],c.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],c.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],c.setLink(e[t-2],e[t-1]),c.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],c.setLink(e[t-3],e[t-2],e[t]),c.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],c.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],c.setClickEvent(e[t-3],e[t-2],e[t-1]),c.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],c.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],c.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],c.setLink(e[t-3],e[t-1]),c.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],c.setLink(e[t-4],e[t-2],e[t]),c.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],c.setCssStyle(e[t-1],e[t]);break;case 106:c.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:u,43:23,46:o,48:l,51:p,52:g,54:m,56:S,57:de,60:b,62:pe,63:fe,64:Ae,65:me,75:ge,76:Ce,78:be,82:ke,83:Ee,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Te,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:J,69:Z,70:$,71:ee,72:te,73:ye,74:_e}),{39:[1,65]},s(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:ve,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(P,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(P,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(se,[2,133]),s(se,[2,134]),s(se,[2,135]),s(se,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Te,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:u,46:o,48:l,51:p,52:g,54:m,56:S,57:de,60:b,62:pe,63:fe,64:Ae,65:me,75:ge,76:Ce,78:be,82:ke,83:Ee,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:u,43:23,46:o,48:l,51:p,52:g,54:m,56:S,57:de,60:b,62:pe,63:fe,64:Ae,65:me,75:ge,76:Ce,78:be,82:ke,83:Ee,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:J,69:Z,70:$,71:ee,72:te,73:ye,74:_e},s(A,[2,64]),{67:93,73:ye,74:_e},s(ie,[2,83],{66:94,68:J,69:Z,70:$,71:ee,72:te}),s(G,[2,84]),s(G,[2,85]),s(G,[2,86]),s(G,[2,87]),s(G,[2,88]),s(Ie,[2,89]),s(Ie,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:u,43:23,48:l,54:m,56:S},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ae},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:U,50:z,59:110,60:Y,82:K,84:111,85:112,86:Q,87:W,88:q,89:X,90:j},{60:[1,122]},{13:ve,55:123},s(F,[2,72]),s(F,[2,138]),{22:U,50:z,59:124,60:Y,61:[1,125],82:K,84:111,85:112,86:Q,87:W,88:q,89:X,90:j},s(Oe,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(P,[2,16]),s(P,[2,17]),s(P,[2,18]),{11:127,12:we,39:[2,36]},s(ne,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(ne,[2,10]),s(De,[2,55],{11:131,12:we}),s(Te,[2,7]),{9:[1,132]},s(re,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(ie,[2,82],{66:136,68:J,69:Z,70:$,71:ee,72:te}),s(ie,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:u,43:23,48:l,54:m,56:S},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(F,[2,48],{39:[1,142]}),{41:[1,143]},s(F,[2,50]),{41:[2,61],45:144,51:ae},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:Ve}),s(Pe,[2,107],{85:154,22:U,50:z,60:Y,82:K,86:Q,87:W,88:q,89:X,90:j}),s(L,[2,109]),s(L,[2,111]),s(L,[2,112]),s(L,[2,113]),s(L,[2,114]),s(L,[2,115]),s(L,[2,116]),s(L,[2,117]),s(L,[2,118]),s(L,[2,119]),s(A,[2,106]),s(F,[2,71]),s(A,[2,73],{61:Ve}),{60:[1,155]},s(P,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(ne,[2,12]),s(De,[2,56]),{1:[2,4]},s(re,[2,69]),s(re,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(ie,[2,80]),s(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:u,43:23,48:l,54:m,56:S},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:u,43:23,48:l,54:m,56:S},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:u,43:23,48:l,54:m,56:S},{45:163,51:ae},s(F,[2,49]),{41:[2,62]},s(F,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:U,50:z,60:Y,82:K,84:169,85:112,86:Q,87:W,88:q,89:X,90:j},s(L,[2,110]),s(Oe,[2,75]),{14:[1,170]},s(ne,[2,11]),s(re,[2,70]),s(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ae},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Pe,[2,108],{85:154,22:U,50:z,60:Y,82:K,86:Q,87:W,88:q,89:X,90:j}),s(De,[2,8]),s(F,[2,51]),{41:[1,175]},s(F,[2,54]),s(A,[2,104]),s(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:r.__name(function(h,d){if(d.recoverable)this.trace(h);else{var f=new Error(h);throw f.hash=d,f}},"parseError"),parse:r.__name(function(h){var d=this,f=[0],c=[],C=[null],e=[],H=this.table,t="",le=0,Me=0,We=2,Re=1,qe=e.slice.call(arguments,1),_=Object.create(this.lexer),O={yy:{}};for(var Be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Be)&&(O.yy[Be]=this.yy[Be]);_.setInput(h,O.yy),O.yy.lexer=_,O.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Se=_.yylloc;e.push(Se);var Xe=_.options&&_.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(B){f.length=f.length-2*B,C.length=C.length-B,e.length=e.length-B}r.__name(je,"popStack");function Ge(){var B;return B=c.pop()||_.lex()||Re,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=d.symbols_[B]||B),B}r.__name(Ge,"lex");for(var D,w,N,Ne,M={},ce,x,Ue,oe;;){if(w=f[f.length-1],this.defaultActions[w]?N=this.defaultActions[w]:((D===null||typeof D>"u")&&(D=Ge()),N=H[w]&&H[w][D]),typeof N>"u"||!N.length||!N[0]){var Le="";oe=[];for(ce in H[w])this.terminals_[ce]&&ce>We&&oe.push("'"+this.terminals_[ce]+"'");_.showPosition?Le="Parse error on line "+(le+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+oe.join(", ")+", got '"+(this.terminals_[D]||D)+"'":Le="Parse error on line "+(le+1)+": Unexpected "+(D==Re?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(Le,{text:_.match,token:this.terminals_[D]||D,line:_.yylineno,loc:Se,expected:oe})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+D);switch(N[0]){case 1:f.push(D),C.push(_.yytext),e.push(_.yylloc),f.push(N[1]),D=null,Me=_.yyleng,t=_.yytext,le=_.yylineno,Se=_.yylloc;break;case 2:if(x=this.productions_[N[1]][1],M.$=C[C.length-x],M._$={first_line:e[e.length-(x||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(x||1)].first_column,last_column:e[e.length-1].last_column},Xe&&(M._$.range=[e[e.length-(x||1)].range[0],e[e.length-1].range[1]]),Ne=this.performAction.apply(M,[t,Me,le,O.yy,N[1],C,e].concat(qe)),typeof Ne<"u")return Ne;x&&(f=f.slice(0,-1*x*2),C=C.slice(0,-1*x),e=e.slice(0,-1*x)),f.push(this.productions_[N[1]][0]),C.push(M.$),e.push(M._$),Ue=H[f[f.length-2]][f[f.length-1]],f.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var v={EOF:1,parseError:r.__name(function(d,f){if(this.yy.parser)this.yy.parser.parseError(d,f);else throw new Error(d)},"parseError"),setInput:r.__name(function(h,d){return this.yy=d||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r.__name(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var d=h.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:r.__name(function(h){var d=h.length,f=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===c.length?this.yylloc.first_column:0)+c[c.length-f.length].length-f[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:r.__name(function(){return this._more=!0,this},"more"),reject:r.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r.__name(function(h){this.unput(this.match.slice(h))},"less"),pastInput:r.__name(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r.__name(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r.__name(function(){var h=this.pastInput(),d=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
@@ -204,4 +204,4 @@ g.classGroup line {
204
204
  }
205
205
  ${He.getIconStyles()}
206
206
  `,"getStyles"),at=it,nt=r.__name((s,i="TB")=>{if(!s.doc)return i;let a=i;for(const n of s.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),rt=r.__name(function(s,i){return i.db.getClasses()},"getClasses"),ut=r.__name(async function(s,i,a,n){r.log.info("REF0:"),r.log.info("Drawing class diagram (v3)",i);const{securityLevel:u,state:o,layout:l}=r.getConfig2();n.db.setDiagramId(i);const p=n.db.getData(),g=Je.getDiagramElement(i,u);p.type=n.type,p.layoutAlgorithm=r.getRegisteredLayoutAlgorithm(l),p.nodeSpacing=o?.nodeSpacing||50,p.rankSpacing=o?.rankSpacing||50,p.markers=["aggregation","extension","composition","dependency","lollipop"],p.diagramId=i,await r.render(p,g);const m=8;r.utils_default.insertTitle(g,"classDiagramTitleText",o?.titleTopMargin??25,n.db.getDiagramTitle()),Ze.setupViewPortForSVG(g,m,"classDiagram",o?.useMaxWidth??!0)},"draw"),lt={getClasses:rt,draw:ut,getDir:nt};exports.ClassDB=st;exports.classDiagram_default=tt;exports.classRenderer_v3_unified_default=lt;exports.styles_default=at;
207
- //# sourceMappingURL=chunk-V7JOEXUC-BtRbpCVo.cjs.map
207
+ //# sourceMappingURL=chunk-V7JOEXUC-BcBXzffo.cjs.map