@spteck/react-controls-v2 2.3.91 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/LocalizationProvider-BbfcY9z3.cjs +2 -0
  2. package/dist/{LocalizationProvider-te5iu_6z.js → LocalizationProvider-CvSHuk0e.js} +46 -46
  3. package/dist/{ar-Blifx2MN.js → ar-BPzd6WER.js} +1 -1
  4. package/dist/ar-CBSdRr5Q.cjs +2 -0
  5. package/dist/az-DoZjCfF0.cjs +2 -0
  6. package/dist/{az-CMhDjtnj.js → az-MWX-WDgc.js} +1 -1
  7. package/dist/{bg-C96WirSv.js → bg-CvRGS4sF.js} +1 -1
  8. package/dist/bg-DI8UD_HF.cjs +2 -0
  9. package/dist/bs-DQhZlEEo.cjs +2 -0
  10. package/dist/{bs-_St1wBE_.js → bs-aXQgChJT.js} +1 -1
  11. package/dist/{ca-QlLcV4wf.js → ca-BCXCXzgh.js} +1 -1
  12. package/dist/ca-DSC32tOX.cjs +2 -0
  13. package/dist/components/dropDownField/IOption.d.ts +2 -0
  14. package/dist/components/iconButton/IconButtonProps.d.ts +2 -0
  15. package/dist/cs-B0C33FJt.cjs +2 -0
  16. package/dist/{cs-MrS2bH7F.js → cs-VHWnqXwJ.js} +1 -1
  17. package/dist/cy-BNabORao.cjs +2 -0
  18. package/dist/{cy-BX97Tgwk.js → cy-qF-aNCW-.js} +1 -1
  19. package/dist/da-BmgXTEXm.cjs +2 -0
  20. package/dist/{da-BnewPPrh.js → da-rR5TnSBw.js} +1 -1
  21. package/dist/de-B4w38-0d.cjs +2 -0
  22. package/dist/{de-BSZuzGTL.js → de-DbeDjRNp.js} +1 -1
  23. package/dist/el-Cgk6VsxL.cjs +2 -0
  24. package/dist/{el-DrOk3N7-.js → el-DDeD6FiX.js} +1 -1
  25. package/dist/es-3ugMIZuA.cjs +2 -0
  26. package/dist/{es-CGqzubZ2.js → es-dvKffn6Q.js} +1 -1
  27. package/dist/et-CIIzxbat.cjs +2 -0
  28. package/dist/{et-DGqkocuq.js → et-DgZFBtK7.js} +1 -1
  29. package/dist/eu-BUNUOJ7E.cjs +2 -0
  30. package/dist/{eu-DEo7fdTW.js → eu-C6r1_PRy.js} +1 -1
  31. package/dist/{fi-DxErwnd5.js → fi-CzOKgmjK.js} +1 -1
  32. package/dist/fi-q6BFPHtt.cjs +2 -0
  33. package/dist/fr-BEnCZ733.cjs +2 -0
  34. package/dist/{fr-zrtSZX0o.js → fr-D0cDkdbn.js} +1 -1
  35. package/dist/{ga-CbHxGc9_.js → ga-0A7ndSzw.js} +1 -1
  36. package/dist/ga-BXyKTnJr.cjs +2 -0
  37. package/dist/{gl--w0P3RY4.js → gl-BNwj4XAu.js} +1 -1
  38. package/dist/gl-DR1C-hSi.cjs +2 -0
  39. package/dist/{he-DY19lzWp.js → he-BPiZ6D5h.js} +1 -1
  40. package/dist/he-OD1Ex2Fw.cjs +2 -0
  41. package/dist/{hi-CFSsoO_8.js → hi-CSgtp9Yg.js} +1 -1
  42. package/dist/hi-Dt9FvBmh.cjs +2 -0
  43. package/dist/{hr-DIRJ1Z8e.js → hr-CDSSj52Q.js} +1 -1
  44. package/dist/hr-DMzwNhar.cjs +2 -0
  45. package/dist/hu-Bc-rChfV.cjs +2 -0
  46. package/dist/{hu-DqYPRWZh.js → hu-TDJYiDOB.js} +1 -1
  47. package/dist/{id-Dgj7SUCi.js → id-B3IF5pnh.js} +1 -1
  48. package/dist/id-CwndN9HH.cjs +2 -0
  49. package/dist/index.cjs +105 -114
  50. package/dist/index.js +6162 -18503
  51. package/dist/{it-QdChHqVN.js → it-BLET318M.js} +1 -1
  52. package/dist/it-DaYS5Vil.cjs +2 -0
  53. package/dist/ja-BYA2LXHy.cjs +2 -0
  54. package/dist/{ja-BNS0BbY-.js → ja-NxwXLaKV.js} +1 -1
  55. package/dist/{kk-Dhkax68h.js → kk-CceJcjtl.js} +1 -1
  56. package/dist/kk-Ctrvuqlz.cjs +2 -0
  57. package/dist/{ko-heRMHZWp.js → ko-cS_OE967.js} +1 -1
  58. package/dist/ko-evIcpTG8.cjs +2 -0
  59. package/dist/lt-CYTLGgh6.cjs +2 -0
  60. package/dist/{lt-Decqbo8S.js → lt-CZ-kk_5b.js} +1 -1
  61. package/dist/{lv-wZASv0Lw.js → lv-BTvPpEjc.js} +1 -1
  62. package/dist/lv-COjitD3w.cjs +2 -0
  63. package/dist/mk-B-LF5gVL.cjs +2 -0
  64. package/dist/{mk-BTsLGTJT.js → mk-CSSyI3El.js} +1 -1
  65. package/dist/ms-CzEvkib0.cjs +2 -0
  66. package/dist/{ms-C0cVNwky.js → ms-Dz5JnKJ1.js} +1 -1
  67. package/dist/nb-B1KWSX94.cjs +2 -0
  68. package/dist/{nb-DGX4q4tS.js → nb-DkgTg1et.js} +1 -1
  69. package/dist/{nl-CnXZa8tZ.js → nl-CQ5eoxw2.js} +1 -1
  70. package/dist/nl-knWqo2aX.cjs +2 -0
  71. package/dist/{pl-DbIdTNpg.js → pl-BQJfOizT.js} +1 -1
  72. package/dist/pl-Ce6dq53t.cjs +2 -0
  73. package/dist/providers.cjs +1 -1
  74. package/dist/providers.js +1 -1
  75. package/dist/pt-BVqTnGkF.cjs +2 -0
  76. package/dist/{pt-CcKYweQk.js → pt-b0p7DoD0.js} +1 -1
  77. package/dist/ro-DqJMfhmX.cjs +2 -0
  78. package/dist/{ro-C-8tiqgA.js → ro-sbBtUVJV.js} +1 -1
  79. package/dist/ru-Dm2NAQyK.cjs +2 -0
  80. package/dist/{ru-Dhnz96q2.js → ru-ofzbka6D.js} +1 -1
  81. package/dist/sk-BNe6CHG-.cjs +2 -0
  82. package/dist/{sk-BU-Z5EsC.js → sk-BtpdNCPC.js} +1 -1
  83. package/dist/{sl-CcfjJFxo.js → sl-B4GsKLu6.js} +1 -1
  84. package/dist/sl-BKmEUGyu.cjs +2 -0
  85. package/dist/{sr-S53unrLA.js → sr-C76YVpkQ.js} +1 -1
  86. package/dist/sr-Dwya5lwF.cjs +2 -0
  87. package/dist/sv-BGL2G9Vm.cjs +2 -0
  88. package/dist/{sv-BiJrVfZr.js → sv-PesX57cX.js} +1 -1
  89. package/dist/{th-vQ7LQ7nD.js → th-CbCNOBnR.js} +1 -1
  90. package/dist/th-DEv6shFI.cjs +2 -0
  91. package/dist/{tr-C5RrNGLz.js → tr-B0TPxXKS.js} +1 -1
  92. package/dist/tr-BB-QonGE.cjs +2 -0
  93. package/dist/uk-B-3fLKpR.cjs +2 -0
  94. package/dist/{uk-WGCFH0fY.js → uk-_9cNoBNe.js} +1 -1
  95. package/dist/{vi-Waa7HkXq.js → vi-B8SfqLW6.js} +1 -1
  96. package/dist/vi-Dx6pJ0ir.cjs +2 -0
  97. package/dist/zh-DD0ml2HG.cjs +2 -0
  98. package/dist/{zh-BmUS7Wn_.js → zh-DqHnbp6B.js} +1 -1
  99. package/package.json +6 -3
  100. package/dist/LocalizationProvider-B6NxHbu2.cjs +0 -2
  101. package/dist/_arrayEach-BuSFKyFt.js +0 -54
  102. package/dist/_arrayEach-ChR-TejB.cjs +0 -2
  103. package/dist/_getTag-BRuLtYrv.js +0 -28
  104. package/dist/_getTag-D6VVyrEu.cjs +0 -2
  105. package/dist/ar-ip3bGOX3.cjs +0 -2
  106. package/dist/arc-4yb49ncY.js +0 -82
  107. package/dist/arc-djsA8IT0.cjs +0 -2
  108. package/dist/architecture-PBZL5I3N-CvTfVLFi.js +0 -3
  109. package/dist/architecture-PBZL5I3N-wZIE3ggH.cjs +0 -1
  110. package/dist/architectureDiagram-2XIMDMQ5-DFEvJNx1.cjs +0 -37
  111. package/dist/architectureDiagram-2XIMDMQ5-g-HotzpG.js +0 -4047
  112. package/dist/array-BNB_vRFv.cjs +0 -2
  113. package/dist/array-DP0duYiO.js +0 -8
  114. package/dist/az-CyVLdUDz.cjs +0 -2
  115. package/dist/bg-Bexoz3hL.cjs +0 -2
  116. package/dist/blockDiagram-WCTKOSBZ-DWgb5Ghz.js +0 -3165
  117. package/dist/blockDiagram-WCTKOSBZ-Dl04FBAy.cjs +0 -133
  118. package/dist/bs-MMcvhwLv.cjs +0 -2
  119. package/dist/c4Diagram-IC4MRINW-ClZvialQ.js +0 -2966
  120. package/dist/c4Diagram-IC4MRINW-ZFE2cGZP.cjs +0 -11
  121. package/dist/ca-BspMSeHN.cjs +0 -2
  122. package/dist/channel-2Bqnb1FY.js +0 -7
  123. package/dist/channel-5_aP1EVB.cjs +0 -2
  124. package/dist/chunk-4BX2VUAB-B5Va_oZz.js +0 -10
  125. package/dist/chunk-4BX2VUAB-BWDW-gYk.cjs +0 -2
  126. package/dist/chunk-55IACEB6-4ind_ByS.cjs +0 -2
  127. package/dist/chunk-55IACEB6-Pcyz_aR_.js +0 -10
  128. package/dist/chunk-7E7YKBS2-Sw9_w4gt.cjs +0 -2
  129. package/dist/chunk-7E7YKBS2-VHdgsed6.js +0 -25
  130. package/dist/chunk-7R4GIKGN-BKoqTTU_.cjs +0 -81
  131. package/dist/chunk-7R4GIKGN-CaQJ0QBF.js +0 -2598
  132. package/dist/chunk-C72U2L5F-CCvi6jiy.cjs +0 -2
  133. package/dist/chunk-C72U2L5F-MjJQTOMh.js +0 -25
  134. package/dist/chunk-D-IZpNpi.cjs +0 -1
  135. package/dist/chunk-EGIJ26TM-Bffl84Wq.cjs +0 -2
  136. package/dist/chunk-EGIJ26TM-DLMAfvpZ.js +0 -25
  137. package/dist/chunk-FMBD7UC4-BvqqU04Z.cjs +0 -16
  138. package/dist/chunk-FMBD7UC4-xjRtkFXe.js +0 -7
  139. package/dist/chunk-GEFDOKGD-BNgT40Ex.js +0 -1302
  140. package/dist/chunk-GEFDOKGD-BOwd6Jqp.cjs +0 -3
  141. package/dist/chunk-GLR3WWYH-DdNAJNRC.cjs +0 -2
  142. package/dist/chunk-GLR3WWYH-kyo6BUtq.js +0 -43
  143. package/dist/chunk-HHEYEP7N-DO1AYIZw.js +0 -11
  144. package/dist/chunk-HHEYEP7N-pdmgQZzP.cjs +0 -2
  145. package/dist/chunk-JSJVCQXG-Ci0seBb4.cjs +0 -2
  146. package/dist/chunk-JSJVCQXG-DowfYWcD.js +0 -62
  147. package/dist/chunk-KX2RTZJC-BJeOHReu.cjs +0 -2
  148. package/dist/chunk-KX2RTZJC-D-bUTSNy.js +0 -27
  149. package/dist/chunk-KYZI473N-DEPuSXaW.js +0 -3436
  150. package/dist/chunk-KYZI473N-DzBMFOER.cjs +0 -54
  151. package/dist/chunk-L3YUKLVL-BDGCTzmy.js +0 -25
  152. package/dist/chunk-L3YUKLVL-BZ17sqh5.cjs +0 -2
  153. package/dist/chunk-MX3YWQON-CAsnAj2e.js +0 -82
  154. package/dist/chunk-MX3YWQON-DulrBJdn.cjs +0 -2
  155. package/dist/chunk-NBPlniwU.js +0 -23
  156. package/dist/chunk-NQ4KR5QH-BJBAT2kM.cjs +0 -221
  157. package/dist/chunk-NQ4KR5QH-DFem-ORD.js +0 -2004
  158. package/dist/chunk-O4XLMI2P-BQF7MAo7.cjs +0 -8
  159. package/dist/chunk-O4XLMI2P-DA4TPzPG.js +0 -513
  160. package/dist/chunk-OZEHJAEY-CAiiXJUP.cjs +0 -2
  161. package/dist/chunk-OZEHJAEY-D7SX2SbR.js +0 -66
  162. package/dist/chunk-PQ6SQG4A-BZnW4-Sd.cjs +0 -2
  163. package/dist/chunk-PQ6SQG4A-ObFGkauo.js +0 -69
  164. package/dist/chunk-PU5JKC2W-BM5NPS-q.js +0 -1887
  165. package/dist/chunk-PU5JKC2W-eRU8wnTH.cjs +0 -71
  166. package/dist/chunk-QZHKN3VN-Dhli_tM0.cjs +0 -2
  167. package/dist/chunk-QZHKN3VN-x258g6EH.js +0 -17
  168. package/dist/chunk-R5LLSJPH-CNTEucEd.cjs +0 -2
  169. package/dist/chunk-R5LLSJPH-Gt27ml2m.js +0 -37
  170. package/dist/chunk-WL4C6EOR-CQXw6d0l.cjs +0 -190
  171. package/dist/chunk-WL4C6EOR-DuM6QmqM.js +0 -3196
  172. package/dist/chunk-XIRO2GV7-CswC9CO8.cjs +0 -2
  173. package/dist/chunk-XIRO2GV7-DXlO8X82.js +0 -32
  174. package/dist/chunk-XPW4576I-Bpsr4SZJ.js +0 -1148
  175. package/dist/chunk-XPW4576I-C68T-WIW.cjs +0 -33
  176. package/dist/chunk-XZSTWKYB-DJv9rEVU.cjs +0 -95
  177. package/dist/chunk-XZSTWKYB-jD9M1izK.js +0 -16132
  178. package/dist/chunk-YBOYWFTD-B6CeuteH.js +0 -34
  179. package/dist/chunk-YBOYWFTD-CiLW6HW_.cjs +0 -2
  180. package/dist/classDiagram-VBA2DB6C-Us0kuDfz.cjs +0 -2
  181. package/dist/classDiagram-VBA2DB6C-VOsE3gN0.js +0 -31
  182. package/dist/classDiagram-v2-RAHNMMFH-BWsm3ea6.cjs +0 -2
  183. package/dist/classDiagram-v2-RAHNMMFH-DPqMNfOz.js +0 -31
  184. package/dist/cose-bilkent-S5V4N54A-CKhwzobJ.js +0 -2252
  185. package/dist/cose-bilkent-S5V4N54A-DmyaRQ6l.cjs +0 -2
  186. package/dist/cs-FZSeHYld.cjs +0 -2
  187. package/dist/cy-CzQmM2lQ.cjs +0 -2
  188. package/dist/cytoscape.esm-CcJAI0wG.cjs +0 -322
  189. package/dist/cytoscape.esm-D9EjU25_.js +0 -18102
  190. package/dist/da-CexFt-Oj.cjs +0 -2
  191. package/dist/dagre-CpEPaL3r.cjs +0 -2
  192. package/dist/dagre-Dd8wCGc6.js +0 -1305
  193. package/dist/dagre-KLK3FWXG-BpxkjvB3.js +0 -294
  194. package/dist/dagre-KLK3FWXG-DIznPQl_.cjs +0 -5
  195. package/dist/de-B68HwuYu.cjs +0 -2
  196. package/dist/defaultLocale-CYOzCjwh.js +0 -203
  197. package/dist/defaultLocale-DSgylVA1.cjs +0 -2
  198. package/dist/diagram-E7M64L7V-dXqTi77U.cjs +0 -25
  199. package/dist/diagram-E7M64L7V-oX07GVAD.js +0 -529
  200. package/dist/diagram-IFDJBPK2-CriVAAmI.cjs +0 -44
  201. package/dist/diagram-IFDJBPK2-lCNF06_S.js +0 -215
  202. package/dist/diagram-P4PSJMXO-TfwVJh4S.js +0 -135
  203. package/dist/diagram-P4PSJMXO-k7F0lH6Q.cjs +0 -25
  204. package/dist/dist-CV9Ez7cn.js +0 -52
  205. package/dist/dist-DVthN7lF.cjs +0 -2
  206. package/dist/el-DQc4jSMd.cjs +0 -2
  207. package/dist/erDiagram-INFDFZHY-CDt3mOSU.cjs +0 -71
  208. package/dist/erDiagram-INFDFZHY-Ds_R2Ds4.js +0 -1668
  209. package/dist/es-DI8Y4Bv1.cjs +0 -2
  210. package/dist/et-DfaryKvp.cjs +0 -2
  211. package/dist/eu-BVOSXciF.cjs +0 -2
  212. package/dist/fi-C5L-OzaI.cjs +0 -2
  213. package/dist/flowDiagram-PKNHOUZH-7XJG07fo.cjs +0 -163
  214. package/dist/flowDiagram-PKNHOUZH-CkeYebJ5.js +0 -4163
  215. package/dist/fr-yFvjqx8B.cjs +0 -2
  216. package/dist/ga-6mVQhlWi.cjs +0 -2
  217. package/dist/ganttDiagram-A5KZAMGK-Bbck1pyM.cjs +0 -293
  218. package/dist/ganttDiagram-A5KZAMGK-CFT3Xn_r.js +0 -3074
  219. package/dist/gitGraph-HDMCJU4V-BKE04oIl.js +0 -3
  220. package/dist/gitGraph-HDMCJU4V-C9GYfOYb.cjs +0 -1
  221. package/dist/gitGraphDiagram-K3NZZRJ6-CXz9SHBX.js +0 -627
  222. package/dist/gitGraphDiagram-K3NZZRJ6-Dt4D-ig1.cjs +0 -66
  223. package/dist/gl-BJzJe1sq.cjs +0 -2
  224. package/dist/graphlib-CPo7oIsu.js +0 -223
  225. package/dist/graphlib-CmUS4Qin.cjs +0 -2
  226. package/dist/he-B3Bw3qr0.cjs +0 -2
  227. package/dist/hi-kofL-mD8.cjs +0 -2
  228. package/dist/hr-CDxqA9Jm.cjs +0 -2
  229. package/dist/hu-Defen_75.cjs +0 -2
  230. package/dist/id-DcwMRgmX.cjs +0 -2
  231. package/dist/identity-6JlhFhuM.cjs +0 -2
  232. package/dist/identity-C1jKsMoW.js +0 -395
  233. package/dist/info-3K5VOQVL-DfN_3mKd.js +0 -3
  234. package/dist/info-3K5VOQVL-d6J9FY0_.cjs +0 -1
  235. package/dist/infoDiagram-LFFYTUFH-Bp9btqnA.cjs +0 -3
  236. package/dist/infoDiagram-LFFYTUFH-DnvgRFnx.js +0 -21
  237. package/dist/init-BAFZAp9S.cjs +0 -2
  238. package/dist/init-m0TwgR4W.js +0 -17
  239. package/dist/isEmpty-BTp1uKIj.cjs +0 -2
  240. package/dist/isEmpty-uXVYZZYe.js +0 -17
  241. package/dist/ishikawaDiagram-PHBUUO56-DLaOkz38.js +0 -719
  242. package/dist/ishikawaDiagram-PHBUUO56-DmqObwMZ.cjs +0 -71
  243. package/dist/it-D5nM6KCi.cjs +0 -2
  244. package/dist/ja-BtuHirv7.cjs +0 -2
  245. package/dist/journeyDiagram-4ABVD52K-Cv0DbLMi.cjs +0 -140
  246. package/dist/journeyDiagram-4ABVD52K-DYmmcNK4.js +0 -885
  247. package/dist/kanban-definition-K7BYSVSG-BdQLAMeB.cjs +0 -90
  248. package/dist/kanban-definition-K7BYSVSG-CLEYqSz5.js +0 -973
  249. package/dist/katex-B-Nju2J8.js +0 -22002
  250. package/dist/katex-WY67Rp7A.cjs +0 -266
  251. package/dist/kk-BSl8IqgQ.cjs +0 -2
  252. package/dist/ko-eplb1GD0.cjs +0 -2
  253. package/dist/line-CbEBKCYr.js +0 -36
  254. package/dist/line-DqSdvtRR.cjs +0 -2
  255. package/dist/linear-DvLDpS6A.cjs +0 -2
  256. package/dist/linear-Eb79THx6.js +0 -291
  257. package/dist/lt-DsYAWFbF.cjs +0 -2
  258. package/dist/lv-DHmTjCb8.cjs +0 -2
  259. package/dist/maplibre-gl-qSrG75fp.js +0 -33003
  260. package/dist/maplibre-gl-tm_pVdmb.cjs +0 -757
  261. package/dist/math-DR9t6ixc.cjs +0 -2
  262. package/dist/math-DyURnvXC.js +0 -12
  263. package/dist/mermaid-parser.core-BdTB9qx-.js +0 -61
  264. package/dist/mermaid-parser.core-BlzF5RRD.cjs +0 -4
  265. package/dist/mindmap-definition-YRQLILUH-CzcVgr-U.js +0 -966
  266. package/dist/mindmap-definition-YRQLILUH-zWN_YXC3.cjs +0 -69
  267. package/dist/mk-CCV_308U.cjs +0 -2
  268. package/dist/ms-CH83xVYN.cjs +0 -2
  269. package/dist/nb-DZ-DlwcL.cjs +0 -2
  270. package/dist/nl-Xdf-A19i.cjs +0 -2
  271. package/dist/ordinal-BAWGEQkf.js +0 -67
  272. package/dist/ordinal-CL2X4e2C.cjs +0 -2
  273. package/dist/packet-RMMSAZCW-Bek1stRX.cjs +0 -1
  274. package/dist/packet-RMMSAZCW-DUN6t9lN.js +0 -3
  275. package/dist/path-Bt6guLtL.cjs +0 -2
  276. package/dist/path-DSzKK8fH.js +0 -87
  277. package/dist/pie-UPGHQEXC-DjqNO54R.js +0 -3
  278. package/dist/pie-UPGHQEXC-pJq6_YgE.cjs +0 -1
  279. package/dist/pieDiagram-SKSYHLDU-Ba-c0fRA.cjs +0 -31
  280. package/dist/pieDiagram-SKSYHLDU-ya07MTY-.js +0 -167
  281. package/dist/pl-BStql1S-.cjs +0 -2
  282. package/dist/pt-Dk4jELuZ.cjs +0 -2
  283. package/dist/quadrantDiagram-337W2JSQ-CQQEVC49.cjs +0 -8
  284. package/dist/quadrantDiagram-337W2JSQ-Dp_QyIEO.js +0 -1976
  285. package/dist/radar-KQ55EAFF-Bid2hXXI.cjs +0 -1
  286. package/dist/radar-KQ55EAFF-C6zhEkCz.js +0 -3
  287. package/dist/requirementDiagram-Z7DCOOCP-CRl2914V.js +0 -2203
  288. package/dist/requirementDiagram-Z7DCOOCP-CeMYhXEm.cjs +0 -74
  289. package/dist/ro-BvhMyTKh.cjs +0 -2
  290. package/dist/rough.esm-BjJ_weyP.cjs +0 -2
  291. package/dist/rough.esm-DBHP55VQ.js +0 -1354
  292. package/dist/ru-BQosng8l.cjs +0 -2
  293. package/dist/sankeyDiagram-WA2Y5GQK-BFrF47Iv.js +0 -922
  294. package/dist/sankeyDiagram-WA2Y5GQK-DDfjtQ4G.cjs +0 -11
  295. package/dist/sequenceDiagram-2WXFIKYE-B-zWyr9f.cjs +0 -146
  296. package/dist/sequenceDiagram-2WXFIKYE-BAd8OVlz.js +0 -4111
  297. package/dist/sk-BhA7UeAk.cjs +0 -2
  298. package/dist/sl-6Mczv4jG.cjs +0 -2
  299. package/dist/sr-CxObZdu0.cjs +0 -2
  300. package/dist/src-DFxq-N5I.cjs +0 -2
  301. package/dist/src-Dm6r9c7l.js +0 -2148
  302. package/dist/stateDiagram-RAJIS63D-C-tfqeC-.js +0 -219
  303. package/dist/stateDiagram-RAJIS63D-C1Aj8vJQ.cjs +0 -2
  304. package/dist/stateDiagram-v2-FVOUBMTO-C-w53gXL.js +0 -29
  305. package/dist/stateDiagram-v2-FVOUBMTO-VoIE_KVn.cjs +0 -2
  306. package/dist/sv-BfiunVuX.cjs +0 -2
  307. package/dist/th-BqLGltZi.cjs +0 -2
  308. package/dist/timeline-definition-YZTLITO2-CE1y2S_r.js +0 -832
  309. package/dist/timeline-definition-YZTLITO2-D8aFfnYE.cjs +0 -62
  310. package/dist/tr-Brwl4o_Z.cjs +0 -2
  311. package/dist/treemap-KZPCXAKY-D2v0uStP.cjs +0 -1
  312. package/dist/treemap-KZPCXAKY-DLE_f1Bk.js +0 -3
  313. package/dist/uk-CV49TRvS.cjs +0 -2
  314. package/dist/vennDiagram-LZ73GAT5-BSpVMORX.js +0 -1860
  315. package/dist/vennDiagram-LZ73GAT5-DvnB0e7u.cjs +0 -35
  316. package/dist/vi-JzM7bjn_.cjs +0 -2
  317. package/dist/xychartDiagram-JWTSCODW-0qbVGrDs.cjs +0 -8
  318. package/dist/xychartDiagram-JWTSCODW-DpIry-th.js +0 -2043
  319. package/dist/zh-DEm0SGzZ.cjs +0 -2
@@ -1,4047 +0,0 @@
1
- import { s as e, t } from "./chunk-NBPlniwU.js";
2
- import { g as n, h as r, p as i } from "./src-Dm6r9c7l.js";
3
- import { B as a, C as o, K as s, L as c, V as l, W as u, _ as d, a as f, b as p, d as m, v as h, y as g } from "./chunk-7R4GIKGN-CaQJ0QBF.js";
4
- import { r as _, s as v } from "./chunk-GEFDOKGD-BNgT40Ex.js";
5
- import { t as y } from "./chunk-HHEYEP7N-DO1AYIZw.js";
6
- import { a as b, i as x, n as S, r as C } from "./chunk-PU5JKC2W-BM5NPS-q.js";
7
- import { t as w } from "./chunk-4BX2VUAB-B5Va_oZz.js";
8
- import { t as T } from "./mermaid-parser.core-BdTB9qx-.js";
9
- import { t as E } from "./cytoscape.esm-D9EjU25_.js";
10
- //#region node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.js
11
- var D = /* @__PURE__ */ t(((e, t) => {
12
- (function(n, r) {
13
- typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.layoutBase = r() : n.layoutBase = r();
14
- })(e, function() {
15
- return (function(e) {
16
- var t = {};
17
- function n(r) {
18
- if (t[r]) return t[r].exports;
19
- var i = t[r] = {
20
- i: r,
21
- l: !1,
22
- exports: {}
23
- };
24
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
25
- }
26
- return n.m = e, n.c = t, n.i = function(e) {
27
- return e;
28
- }, n.d = function(e, t, r) {
29
- n.o(e, t) || Object.defineProperty(e, t, {
30
- configurable: !1,
31
- enumerable: !0,
32
- get: r
33
- });
34
- }, n.n = function(e) {
35
- var t = e && e.__esModule ? function() {
36
- return e.default;
37
- } : function() {
38
- return e;
39
- };
40
- return n.d(t, "a", t), t;
41
- }, n.o = function(e, t) {
42
- return Object.prototype.hasOwnProperty.call(e, t);
43
- }, n.p = "", n(n.s = 28);
44
- })([
45
- (function(e, t, n) {
46
- function r() {}
47
- r.QUALITY = 1, r.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, r.DEFAULT_INCREMENTAL = !1, r.DEFAULT_ANIMATION_ON_LAYOUT = !0, r.DEFAULT_ANIMATION_DURING_LAYOUT = !1, r.DEFAULT_ANIMATION_PERIOD = 50, r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, r.DEFAULT_GRAPH_MARGIN = 15, r.NODE_DIMENSIONS_INCLUDE_LABELS = !1, r.SIMPLE_NODE_SIZE = 40, r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2, r.EMPTY_COMPOUND_NODE_SIZE = 40, r.MIN_EDGE_LENGTH = 1, r.WORLD_BOUNDARY = 1e6, r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3, r.WORLD_CENTER_X = 1200, r.WORLD_CENTER_Y = 900, e.exports = r;
48
- }),
49
- (function(e, t, n) {
50
- var r = n(2), i = n(8), a = n(9);
51
- function o(e, t, n) {
52
- r.call(this, n), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = n, this.bendpoints = [], this.source = e, this.target = t;
53
- }
54
- for (var s in o.prototype = Object.create(r.prototype), r) o[s] = r[s];
55
- o.prototype.getSource = function() {
56
- return this.source;
57
- }, o.prototype.getTarget = function() {
58
- return this.target;
59
- }, o.prototype.isInterGraph = function() {
60
- return this.isInterGraph;
61
- }, o.prototype.getLength = function() {
62
- return this.length;
63
- }, o.prototype.isOverlapingSourceAndTarget = function() {
64
- return this.isOverlapingSourceAndTarget;
65
- }, o.prototype.getBendpoints = function() {
66
- return this.bendpoints;
67
- }, o.prototype.getLca = function() {
68
- return this.lca;
69
- }, o.prototype.getSourceInLca = function() {
70
- return this.sourceInLca;
71
- }, o.prototype.getTargetInLca = function() {
72
- return this.targetInLca;
73
- }, o.prototype.getOtherEnd = function(e) {
74
- if (this.source === e) return this.target;
75
- if (this.target === e) return this.source;
76
- throw "Node is not incident with this edge";
77
- }, o.prototype.getOtherEndInGraph = function(e, t) {
78
- for (var n = this.getOtherEnd(e), r = t.getGraphManager().getRoot();;) {
79
- if (n.getOwner() == t) return n;
80
- if (n.getOwner() == r) break;
81
- n = n.getOwner().getParent();
82
- }
83
- return null;
84
- }, o.prototype.updateLength = function() {
85
- var e = [
86
- ,
87
- ,
88
- ,
89
- ,
90
- ];
91
- this.isOverlapingSourceAndTarget = i.getIntersection(this.target.getRect(), this.source.getRect(), e), this.isOverlapingSourceAndTarget || (this.lengthX = e[0] - e[2], this.lengthY = e[1] - e[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
92
- }, o.prototype.updateLengthSimple = function() {
93
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
94
- }, e.exports = o;
95
- }),
96
- (function(e, t, n) {
97
- function r(e) {
98
- this.vGraphObject = e;
99
- }
100
- e.exports = r;
101
- }),
102
- (function(e, t, n) {
103
- var r = n(2), i = n(10), a = n(13), o = n(0), s = n(16), c = n(5);
104
- function l(e, t, n, o) {
105
- n == null && o == null && (o = t), r.call(this, o), e.graphManager != null && (e = e.graphManager), this.estimatedSize = i.MIN_VALUE, this.inclusionTreeDepth = i.MAX_VALUE, this.vGraphObject = o, this.edges = [], this.graphManager = e, n != null && t != null ? this.rect = new a(t.x, t.y, n.width, n.height) : this.rect = new a();
106
- }
107
- for (var u in l.prototype = Object.create(r.prototype), r) l[u] = r[u];
108
- l.prototype.getEdges = function() {
109
- return this.edges;
110
- }, l.prototype.getChild = function() {
111
- return this.child;
112
- }, l.prototype.getOwner = function() {
113
- return this.owner;
114
- }, l.prototype.getWidth = function() {
115
- return this.rect.width;
116
- }, l.prototype.setWidth = function(e) {
117
- this.rect.width = e;
118
- }, l.prototype.getHeight = function() {
119
- return this.rect.height;
120
- }, l.prototype.setHeight = function(e) {
121
- this.rect.height = e;
122
- }, l.prototype.getCenterX = function() {
123
- return this.rect.x + this.rect.width / 2;
124
- }, l.prototype.getCenterY = function() {
125
- return this.rect.y + this.rect.height / 2;
126
- }, l.prototype.getCenter = function() {
127
- return new c(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
128
- }, l.prototype.getLocation = function() {
129
- return new c(this.rect.x, this.rect.y);
130
- }, l.prototype.getRect = function() {
131
- return this.rect;
132
- }, l.prototype.getDiagonal = function() {
133
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
134
- }, l.prototype.getHalfTheDiagonal = function() {
135
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
136
- }, l.prototype.setRect = function(e, t) {
137
- this.rect.x = e.x, this.rect.y = e.y, this.rect.width = t.width, this.rect.height = t.height;
138
- }, l.prototype.setCenter = function(e, t) {
139
- this.rect.x = e - this.rect.width / 2, this.rect.y = t - this.rect.height / 2;
140
- }, l.prototype.setLocation = function(e, t) {
141
- this.rect.x = e, this.rect.y = t;
142
- }, l.prototype.moveBy = function(e, t) {
143
- this.rect.x += e, this.rect.y += t;
144
- }, l.prototype.getEdgeListToNode = function(e) {
145
- var t = [], n = this;
146
- return n.edges.forEach(function(r) {
147
- if (r.target == e) {
148
- if (r.source != n) throw "Incorrect edge source!";
149
- t.push(r);
150
- }
151
- }), t;
152
- }, l.prototype.getEdgesBetween = function(e) {
153
- var t = [], n = this;
154
- return n.edges.forEach(function(r) {
155
- if (!(r.source == n || r.target == n)) throw "Incorrect edge source and/or target";
156
- (r.target == e || r.source == e) && t.push(r);
157
- }), t;
158
- }, l.prototype.getNeighborsList = function() {
159
- var e = /* @__PURE__ */ new Set(), t = this;
160
- return t.edges.forEach(function(n) {
161
- if (n.source == t) e.add(n.target);
162
- else {
163
- if (n.target != t) throw "Incorrect incidency!";
164
- e.add(n.source);
165
- }
166
- }), e;
167
- }, l.prototype.withChildren = function() {
168
- var e = /* @__PURE__ */ new Set(), t, n;
169
- if (e.add(this), this.child != null) for (var r = this.child.getNodes(), i = 0; i < r.length; i++) t = r[i], n = t.withChildren(), n.forEach(function(t) {
170
- e.add(t);
171
- });
172
- return e;
173
- }, l.prototype.getNoOfChildren = function() {
174
- var e = 0, t;
175
- if (this.child == null) e = 1;
176
- else for (var n = this.child.getNodes(), r = 0; r < n.length; r++) t = n[r], e += t.getNoOfChildren();
177
- return e == 0 && (e = 1), e;
178
- }, l.prototype.getEstimatedSize = function() {
179
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
180
- return this.estimatedSize;
181
- }, l.prototype.calcEstimatedSize = function() {
182
- return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
183
- }, l.prototype.scatter = function() {
184
- var e, t, n = -o.INITIAL_WORLD_BOUNDARY, r = o.INITIAL_WORLD_BOUNDARY;
185
- e = o.WORLD_CENTER_X + s.nextDouble() * (r - n) + n;
186
- var i = -o.INITIAL_WORLD_BOUNDARY, a = o.INITIAL_WORLD_BOUNDARY;
187
- t = o.WORLD_CENTER_Y + s.nextDouble() * (a - i) + i, this.rect.x = e, this.rect.y = t;
188
- }, l.prototype.updateBounds = function() {
189
- if (this.getChild() == null) throw "assert failed";
190
- if (this.getChild().getNodes().length != 0) {
191
- var e = this.getChild();
192
- if (e.updateBounds(!0), this.rect.x = e.getLeft(), this.rect.y = e.getTop(), this.setWidth(e.getRight() - e.getLeft()), this.setHeight(e.getBottom() - e.getTop()), o.NODE_DIMENSIONS_INCLUDE_LABELS) {
193
- var t = e.getRight() - e.getLeft(), n = e.getBottom() - e.getTop();
194
- this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(t + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > t ? (this.rect.x -= (this.labelWidth - t) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(t + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(n + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > n ? (this.rect.y -= (this.labelHeight - n) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(n + this.labelHeight));
195
- }
196
- }
197
- }, l.prototype.getInclusionTreeDepth = function() {
198
- if (this.inclusionTreeDepth == i.MAX_VALUE) throw "assert failed";
199
- return this.inclusionTreeDepth;
200
- }, l.prototype.transform = function(e) {
201
- var t = this.rect.x;
202
- t > o.WORLD_BOUNDARY ? t = o.WORLD_BOUNDARY : t < -o.WORLD_BOUNDARY && (t = -o.WORLD_BOUNDARY);
203
- var n = this.rect.y;
204
- n > o.WORLD_BOUNDARY ? n = o.WORLD_BOUNDARY : n < -o.WORLD_BOUNDARY && (n = -o.WORLD_BOUNDARY);
205
- var r = new c(t, n), i = e.inverseTransformPoint(r);
206
- this.setLocation(i.x, i.y);
207
- }, l.prototype.getLeft = function() {
208
- return this.rect.x;
209
- }, l.prototype.getRight = function() {
210
- return this.rect.x + this.rect.width;
211
- }, l.prototype.getTop = function() {
212
- return this.rect.y;
213
- }, l.prototype.getBottom = function() {
214
- return this.rect.y + this.rect.height;
215
- }, l.prototype.getParent = function() {
216
- return this.owner == null ? null : this.owner.getParent();
217
- }, e.exports = l;
218
- }),
219
- (function(e, t, n) {
220
- var r = n(0);
221
- function i() {}
222
- for (var a in r) i[a] = r[a];
223
- i.MAX_ITERATIONS = 2500, i.DEFAULT_EDGE_LENGTH = 50, i.DEFAULT_SPRING_STRENGTH = .45, i.DEFAULT_REPULSION_STRENGTH = 4500, i.DEFAULT_GRAVITY_STRENGTH = .4, i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, i.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, i.DEFAULT_COOLING_FACTOR_INCREMENTAL = .3, i.COOLING_ADAPTATION_FACTOR = .33, i.ADAPTATION_LOWER_NODE_LIMIT = 1e3, i.ADAPTATION_UPPER_NODE_LIMIT = 5e3, i.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, i.MAX_NODE_DISPLACEMENT = i.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, i.MIN_REPULSION_DIST = i.DEFAULT_EDGE_LENGTH / 10, i.CONVERGENCE_CHECK_PERIOD = 100, i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = .1, i.MIN_EDGE_LENGTH = 1, i.GRID_CALCULATION_CHECK_PERIOD = 10, e.exports = i;
224
- }),
225
- (function(e, t, n) {
226
- function r(e, t) {
227
- e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
228
- }
229
- r.prototype.getX = function() {
230
- return this.x;
231
- }, r.prototype.getY = function() {
232
- return this.y;
233
- }, r.prototype.setX = function(e) {
234
- this.x = e;
235
- }, r.prototype.setY = function(e) {
236
- this.y = e;
237
- }, r.prototype.getDifference = function(e) {
238
- return new DimensionD(this.x - e.x, this.y - e.y);
239
- }, r.prototype.getCopy = function() {
240
- return new r(this.x, this.y);
241
- }, r.prototype.translate = function(e) {
242
- return this.x += e.width, this.y += e.height, this;
243
- }, e.exports = r;
244
- }),
245
- (function(e, t, n) {
246
- var r = n(2), i = n(10), a = n(0), o = n(7), s = n(3), c = n(1), l = n(13), u = n(12), d = n(11);
247
- function f(e, t, n) {
248
- r.call(this, n), this.estimatedSize = i.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = e, t != null && t instanceof o ? this.graphManager = t : t != null && t instanceof Layout && (this.graphManager = t.graphManager);
249
- }
250
- for (var p in f.prototype = Object.create(r.prototype), r) f[p] = r[p];
251
- f.prototype.getNodes = function() {
252
- return this.nodes;
253
- }, f.prototype.getEdges = function() {
254
- return this.edges;
255
- }, f.prototype.getGraphManager = function() {
256
- return this.graphManager;
257
- }, f.prototype.getParent = function() {
258
- return this.parent;
259
- }, f.prototype.getLeft = function() {
260
- return this.left;
261
- }, f.prototype.getRight = function() {
262
- return this.right;
263
- }, f.prototype.getTop = function() {
264
- return this.top;
265
- }, f.prototype.getBottom = function() {
266
- return this.bottom;
267
- }, f.prototype.isConnected = function() {
268
- return this.isConnected;
269
- }, f.prototype.add = function(e, t, n) {
270
- if (t == null && n == null) {
271
- var r = e;
272
- if (this.graphManager == null) throw "Graph has no graph mgr!";
273
- if (this.getNodes().indexOf(r) > -1) throw "Node already in graph!";
274
- return r.owner = this, this.getNodes().push(r), r;
275
- } else {
276
- var i = e;
277
- if (!(this.getNodes().indexOf(t) > -1 && this.getNodes().indexOf(n) > -1)) throw "Source or target not in graph!";
278
- if (!(t.owner == n.owner && t.owner == this)) throw "Both owners must be this graph!";
279
- return t.owner == n.owner ? (i.source = t, i.target = n, i.isInterGraph = !1, this.getEdges().push(i), t.edges.push(i), n != t && n.edges.push(i), i) : null;
280
- }
281
- }, f.prototype.remove = function(e) {
282
- var t = e;
283
- if (e instanceof s) {
284
- if (t == null) throw "Node is null!";
285
- if (!(t.owner != null && t.owner == this)) throw "Owner graph is invalid!";
286
- if (this.graphManager == null) throw "Owner graph manager is invalid!";
287
- for (var n = t.edges.slice(), r, i = n.length, a = 0; a < i; a++) r = n[a], r.isInterGraph ? this.graphManager.remove(r) : r.source.owner.remove(r);
288
- var o = this.nodes.indexOf(t);
289
- if (o == -1) throw "Node not in owner node list!";
290
- this.nodes.splice(o, 1);
291
- } else if (e instanceof c) {
292
- var r = e;
293
- if (r == null) throw "Edge is null!";
294
- if (!(r.source != null && r.target != null)) throw "Source and/or target is null!";
295
- if (!(r.source.owner != null && r.target.owner != null && r.source.owner == this && r.target.owner == this)) throw "Source and/or target owner is invalid!";
296
- var l = r.source.edges.indexOf(r), u = r.target.edges.indexOf(r);
297
- if (!(l > -1 && u > -1)) throw "Source and/or target doesn't know this edge!";
298
- r.source.edges.splice(l, 1), r.target != r.source && r.target.edges.splice(u, 1);
299
- var o = r.source.owner.getEdges().indexOf(r);
300
- if (o == -1) throw "Not in owner's edge list!";
301
- r.source.owner.getEdges().splice(o, 1);
302
- }
303
- }, f.prototype.updateLeftTop = function() {
304
- for (var e = i.MAX_VALUE, t = i.MAX_VALUE, n, r, a, o = this.getNodes(), s = o.length, c = 0; c < s; c++) {
305
- var l = o[c];
306
- n = l.getTop(), r = l.getLeft(), e > n && (e = n), t > r && (t = r);
307
- }
308
- return e == i.MAX_VALUE ? null : (a = o[0].getParent().paddingLeft == null ? this.margin : o[0].getParent().paddingLeft, this.left = t - a, this.top = e - a, new u(this.left, this.top));
309
- }, f.prototype.updateBounds = function(e) {
310
- for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d, f = this.nodes, p = f.length, m = 0; m < p; m++) {
311
- var h = f[m];
312
- e && h.child != null && h.updateBounds(), o = h.getLeft(), s = h.getRight(), c = h.getTop(), u = h.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
313
- }
314
- var g = new l(t, r, n - t, a - r);
315
- t == i.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), d = f[0].getParent().paddingLeft == null ? this.margin : f[0].getParent().paddingLeft, this.left = g.x - d, this.right = g.x + g.width + d, this.top = g.y - d, this.bottom = g.y + g.height + d;
316
- }, f.calculateBounds = function(e) {
317
- for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d = e.length, f = 0; f < d; f++) {
318
- var p = e[f];
319
- o = p.getLeft(), s = p.getRight(), c = p.getTop(), u = p.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
320
- }
321
- return new l(t, r, n - t, a - r);
322
- }, f.prototype.getInclusionTreeDepth = function() {
323
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
324
- }, f.prototype.getEstimatedSize = function() {
325
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
326
- return this.estimatedSize;
327
- }, f.prototype.calcEstimatedSize = function() {
328
- for (var e = 0, t = this.nodes, n = t.length, r = 0; r < n; r++) {
329
- var i = t[r];
330
- e += i.calcEstimatedSize();
331
- }
332
- return e == 0 ? this.estimatedSize = a.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = e / Math.sqrt(this.nodes.length), this.estimatedSize;
333
- }, f.prototype.updateConnected = function() {
334
- var e = this;
335
- if (this.nodes.length == 0) {
336
- this.isConnected = !0;
337
- return;
338
- }
339
- var t = new d(), n = /* @__PURE__ */ new Set(), r = this.nodes[0], i, a;
340
- for (r.withChildren().forEach(function(e) {
341
- t.push(e), n.add(e);
342
- }); t.length !== 0;) {
343
- r = t.shift(), i = r.getEdges();
344
- for (var o = i.length, s = 0; s < o; s++) a = i[s].getOtherEndInGraph(r, this), a != null && !n.has(a) && a.withChildren().forEach(function(e) {
345
- t.push(e), n.add(e);
346
- });
347
- }
348
- if (this.isConnected = !1, n.size >= this.nodes.length) {
349
- var c = 0;
350
- n.forEach(function(t) {
351
- t.owner == e && c++;
352
- }), c == this.nodes.length && (this.isConnected = !0);
353
- }
354
- }, e.exports = f;
355
- }),
356
- (function(e, t, n) {
357
- var r, i = n(1);
358
- function a(e) {
359
- r = n(6), this.layout = e, this.graphs = [], this.edges = [];
360
- }
361
- a.prototype.addRoot = function() {
362
- var e = this.layout.newGraph(), t = this.layout.newNode(null), n = this.add(e, t);
363
- return this.setRootGraph(n), this.rootGraph;
364
- }, a.prototype.add = function(e, t, n, r, i) {
365
- if (n == null && r == null && i == null) {
366
- if (e == null) throw "Graph is null!";
367
- if (t == null) throw "Parent node is null!";
368
- if (this.graphs.indexOf(e) > -1) throw "Graph already in this graph mgr!";
369
- if (this.graphs.push(e), e.parent != null) throw "Already has a parent!";
370
- if (t.child != null) throw "Already has a child!";
371
- return e.parent = t, t.child = e, e;
372
- } else {
373
- i = n, r = t, n = e;
374
- var a = r.getOwner(), o = i.getOwner();
375
- if (!(a != null && a.getGraphManager() == this)) throw "Source not in this graph mgr!";
376
- if (!(o != null && o.getGraphManager() == this)) throw "Target not in this graph mgr!";
377
- if (a == o) return n.isInterGraph = !1, a.add(n, r, i);
378
- if (n.isInterGraph = !0, n.source = r, n.target = i, this.edges.indexOf(n) > -1) throw "Edge already in inter-graph edge list!";
379
- if (this.edges.push(n), !(n.source != null && n.target != null)) throw "Edge source and/or target is null!";
380
- if (!(n.source.edges.indexOf(n) == -1 && n.target.edges.indexOf(n) == -1)) throw "Edge already in source and/or target incidency list!";
381
- return n.source.edges.push(n), n.target.edges.push(n), n;
382
- }
383
- }, a.prototype.remove = function(e) {
384
- if (e instanceof r) {
385
- var t = e;
386
- if (t.getGraphManager() != this) throw "Graph not in this graph mgr";
387
- if (!(t == this.rootGraph || t.parent != null && t.parent.graphManager == this)) throw "Invalid parent node!";
388
- var n = [];
389
- n = n.concat(t.getEdges());
390
- for (var a, o = n.length, s = 0; s < o; s++) a = n[s], t.remove(a);
391
- var c = [];
392
- c = c.concat(t.getNodes());
393
- var l;
394
- o = c.length;
395
- for (var s = 0; s < o; s++) l = c[s], t.remove(l);
396
- t == this.rootGraph && this.setRootGraph(null);
397
- var u = this.graphs.indexOf(t);
398
- this.graphs.splice(u, 1), t.parent = null;
399
- } else if (e instanceof i) {
400
- if (a = e, a == null) throw "Edge is null!";
401
- if (!a.isInterGraph) throw "Not an inter-graph edge!";
402
- if (!(a.source != null && a.target != null)) throw "Source and/or target is null!";
403
- if (!(a.source.edges.indexOf(a) != -1 && a.target.edges.indexOf(a) != -1)) throw "Source and/or target doesn't know this edge!";
404
- var u = a.source.edges.indexOf(a);
405
- if (a.source.edges.splice(u, 1), u = a.target.edges.indexOf(a), a.target.edges.splice(u, 1), !(a.source.owner != null && a.source.owner.getGraphManager() != null)) throw "Edge owner graph or owner graph manager is null!";
406
- if (a.source.owner.getGraphManager().edges.indexOf(a) == -1) throw "Not in owner graph manager's edge list!";
407
- var u = a.source.owner.getGraphManager().edges.indexOf(a);
408
- a.source.owner.getGraphManager().edges.splice(u, 1);
409
- }
410
- }, a.prototype.updateBounds = function() {
411
- this.rootGraph.updateBounds(!0);
412
- }, a.prototype.getGraphs = function() {
413
- return this.graphs;
414
- }, a.prototype.getAllNodes = function() {
415
- if (this.allNodes == null) {
416
- for (var e = [], t = this.getGraphs(), n = t.length, r = 0; r < n; r++) e = e.concat(t[r].getNodes());
417
- this.allNodes = e;
418
- }
419
- return this.allNodes;
420
- }, a.prototype.resetAllNodes = function() {
421
- this.allNodes = null;
422
- }, a.prototype.resetAllEdges = function() {
423
- this.allEdges = null;
424
- }, a.prototype.resetAllNodesToApplyGravitation = function() {
425
- this.allNodesToApplyGravitation = null;
426
- }, a.prototype.getAllEdges = function() {
427
- if (this.allEdges == null) {
428
- var e = [], t = this.getGraphs();
429
- t.length;
430
- for (var n = 0; n < t.length; n++) e = e.concat(t[n].getEdges());
431
- e = e.concat(this.edges), this.allEdges = e;
432
- }
433
- return this.allEdges;
434
- }, a.prototype.getAllNodesToApplyGravitation = function() {
435
- return this.allNodesToApplyGravitation;
436
- }, a.prototype.setAllNodesToApplyGravitation = function(e) {
437
- if (this.allNodesToApplyGravitation != null) throw "assert failed";
438
- this.allNodesToApplyGravitation = e;
439
- }, a.prototype.getRoot = function() {
440
- return this.rootGraph;
441
- }, a.prototype.setRootGraph = function(e) {
442
- if (e.getGraphManager() != this) throw "Root not in this graph mgr!";
443
- this.rootGraph = e, e.parent ??= this.layout.newNode("Root node");
444
- }, a.prototype.getLayout = function() {
445
- return this.layout;
446
- }, a.prototype.isOneAncestorOfOther = function(e, t) {
447
- if (!(e != null && t != null)) throw "assert failed";
448
- if (e == t) return !0;
449
- var n = e.getOwner(), r;
450
- do {
451
- if (r = n.getParent(), r == null) break;
452
- if (r == t) return !0;
453
- if (n = r.getOwner(), n == null) break;
454
- } while (!0);
455
- n = t.getOwner();
456
- do {
457
- if (r = n.getParent(), r == null) break;
458
- if (r == e) return !0;
459
- if (n = r.getOwner(), n == null) break;
460
- } while (!0);
461
- return !1;
462
- }, a.prototype.calcLowestCommonAncestors = function() {
463
- for (var e, t, n, r, i, a = this.getAllEdges(), o = a.length, s = 0; s < o; s++) {
464
- if (e = a[s], t = e.source, n = e.target, e.lca = null, e.sourceInLca = t, e.targetInLca = n, t == n) {
465
- e.lca = t.getOwner();
466
- continue;
467
- }
468
- for (r = t.getOwner(); e.lca == null;) {
469
- for (e.targetInLca = n, i = n.getOwner(); e.lca == null;) {
470
- if (i == r) {
471
- e.lca = i;
472
- break;
473
- }
474
- if (i == this.rootGraph) break;
475
- if (e.lca != null) throw "assert failed";
476
- e.targetInLca = i.getParent(), i = e.targetInLca.getOwner();
477
- }
478
- if (r == this.rootGraph) break;
479
- e.lca ?? (e.sourceInLca = r.getParent(), r = e.sourceInLca.getOwner());
480
- }
481
- if (e.lca == null) throw "assert failed";
482
- }
483
- }, a.prototype.calcLowestCommonAncestor = function(e, t) {
484
- if (e == t) return e.getOwner();
485
- var n = e.getOwner();
486
- do {
487
- if (n == null) break;
488
- var r = t.getOwner();
489
- do {
490
- if (r == null) break;
491
- if (r == n) return r;
492
- r = r.getParent().getOwner();
493
- } while (!0);
494
- n = n.getParent().getOwner();
495
- } while (!0);
496
- return n;
497
- }, a.prototype.calcInclusionTreeDepths = function(e, t) {
498
- e == null && t == null && (e = this.rootGraph, t = 1);
499
- for (var n, r = e.getNodes(), i = r.length, a = 0; a < i; a++) n = r[a], n.inclusionTreeDepth = t, n.child != null && this.calcInclusionTreeDepths(n.child, t + 1);
500
- }, a.prototype.includesInvalidEdge = function() {
501
- for (var e, t = [], n = this.edges.length, r = 0; r < n; r++) e = this.edges[r], this.isOneAncestorOfOther(e.source, e.target) && t.push(e);
502
- for (var r = 0; r < t.length; r++) this.remove(t[r]);
503
- return !1;
504
- }, e.exports = a;
505
- }),
506
- (function(e, t, n) {
507
- var r = n(12);
508
- function i() {}
509
- i.calcSeparationAmount = function(e, t, n, r) {
510
- if (!e.intersects(t)) throw "assert failed";
511
- var i = [, ,];
512
- this.decideDirectionsForOverlappingNodes(e, t, i), n[0] = Math.min(e.getRight(), t.getRight()) - Math.max(e.x, t.x), n[1] = Math.min(e.getBottom(), t.getBottom()) - Math.max(e.y, t.y), e.getX() <= t.getX() && e.getRight() >= t.getRight() ? n[0] += Math.min(t.getX() - e.getX(), e.getRight() - t.getRight()) : t.getX() <= e.getX() && t.getRight() >= e.getRight() && (n[0] += Math.min(e.getX() - t.getX(), t.getRight() - e.getRight())), e.getY() <= t.getY() && e.getBottom() >= t.getBottom() ? n[1] += Math.min(t.getY() - e.getY(), e.getBottom() - t.getBottom()) : t.getY() <= e.getY() && t.getBottom() >= e.getBottom() && (n[1] += Math.min(e.getY() - t.getY(), t.getBottom() - e.getBottom()));
513
- var a = Math.abs((t.getCenterY() - e.getCenterY()) / (t.getCenterX() - e.getCenterX()));
514
- t.getCenterY() === e.getCenterY() && t.getCenterX() === e.getCenterX() && (a = 1);
515
- var o = a * n[0], s = n[1] / a;
516
- n[0] < s ? s = n[0] : o = n[1], n[0] = -1 * i[0] * (s / 2 + r), n[1] = -1 * i[1] * (o / 2 + r);
517
- }, i.decideDirectionsForOverlappingNodes = function(e, t, n) {
518
- e.getCenterX() < t.getCenterX() ? n[0] = -1 : n[0] = 1, e.getCenterY() < t.getCenterY() ? n[1] = -1 : n[1] = 1;
519
- }, i.getIntersection2 = function(e, t, n) {
520
- var r = e.getCenterX(), i = e.getCenterY(), a = t.getCenterX(), o = t.getCenterY();
521
- if (e.intersects(t)) return n[0] = r, n[1] = i, n[2] = a, n[3] = o, !0;
522
- var s = e.getX(), c = e.getY(), l = e.getRight(), u = e.getX(), d = e.getBottom(), f = e.getRight(), p = e.getWidthHalf(), m = e.getHeightHalf(), h = t.getX(), g = t.getY(), _ = t.getRight(), v = t.getX(), y = t.getBottom(), b = t.getRight(), x = t.getWidthHalf(), S = t.getHeightHalf(), C = !1, w = !1;
523
- if (r === a) {
524
- if (i > o) return n[0] = r, n[1] = c, n[2] = a, n[3] = y, !1;
525
- if (i < o) return n[0] = r, n[1] = d, n[2] = a, n[3] = g, !1;
526
- } else if (i === o) {
527
- if (r > a) return n[0] = s, n[1] = i, n[2] = _, n[3] = o, !1;
528
- if (r < a) return n[0] = l, n[1] = i, n[2] = h, n[3] = o, !1;
529
- } else {
530
- var T = e.height / e.width, E = t.height / t.width, D = (o - i) / (a - r), O = void 0, k = void 0, A = void 0, j = void 0, M = void 0, N = void 0;
531
- if (-T === D ? r > a ? (n[0] = u, n[1] = d, C = !0) : (n[0] = l, n[1] = c, C = !0) : T === D && (r > a ? (n[0] = s, n[1] = c, C = !0) : (n[0] = f, n[1] = d, C = !0)), -E === D ? a > r ? (n[2] = v, n[3] = y, w = !0) : (n[2] = _, n[3] = g, w = !0) : E === D && (a > r ? (n[2] = h, n[3] = g, w = !0) : (n[2] = b, n[3] = y, w = !0)), C && w) return !1;
532
- if (r > a ? i > o ? (O = this.getCardinalDirection(T, D, 4), k = this.getCardinalDirection(E, D, 2)) : (O = this.getCardinalDirection(-T, D, 3), k = this.getCardinalDirection(-E, D, 1)) : i > o ? (O = this.getCardinalDirection(-T, D, 1), k = this.getCardinalDirection(-E, D, 3)) : (O = this.getCardinalDirection(T, D, 2), k = this.getCardinalDirection(E, D, 4)), !C) switch (O) {
533
- case 1:
534
- j = c, A = r + -m / D, n[0] = A, n[1] = j;
535
- break;
536
- case 2:
537
- A = f, j = i + p * D, n[0] = A, n[1] = j;
538
- break;
539
- case 3:
540
- j = d, A = r + m / D, n[0] = A, n[1] = j;
541
- break;
542
- case 4:
543
- A = u, j = i + -p * D, n[0] = A, n[1] = j;
544
- break;
545
- }
546
- if (!w) switch (k) {
547
- case 1:
548
- N = g, M = a + -S / D, n[2] = M, n[3] = N;
549
- break;
550
- case 2:
551
- M = b, N = o + x * D, n[2] = M, n[3] = N;
552
- break;
553
- case 3:
554
- N = y, M = a + S / D, n[2] = M, n[3] = N;
555
- break;
556
- case 4:
557
- M = v, N = o + -x * D, n[2] = M, n[3] = N;
558
- break;
559
- }
560
- }
561
- return !1;
562
- }, i.getCardinalDirection = function(e, t, n) {
563
- return e > t ? n : 1 + n % 4;
564
- }, i.getIntersection = function(e, t, n, i) {
565
- if (i == null) return this.getIntersection2(e, t, n);
566
- var a = e.x, o = e.y, s = t.x, c = t.y, l = n.x, u = n.y, d = i.x, f = i.y, p = void 0, m = void 0, h = void 0, g = void 0, _ = void 0, v = void 0, y = void 0, b = void 0, x = void 0;
567
- return h = c - o, _ = a - s, y = s * o - a * c, g = f - u, v = l - d, b = d * u - l * f, x = h * v - g * _, x === 0 ? null : (p = (_ * b - v * y) / x, m = (g * y - h * b) / x, new r(p, m));
568
- }, i.angleOfVector = function(e, t, n, r) {
569
- var i = void 0;
570
- return e === n ? i = r < t ? this.ONE_AND_HALF_PI : this.HALF_PI : (i = Math.atan((r - t) / (n - e)), n < e ? i += Math.PI : r < t && (i += this.TWO_PI)), i;
571
- }, i.doIntersect = function(e, t, n, r) {
572
- var i = e.x, a = e.y, o = t.x, s = t.y, c = n.x, l = n.y, u = r.x, d = r.y, f = (o - i) * (d - l) - (u - c) * (s - a);
573
- if (f === 0) return !1;
574
- var p = ((d - l) * (u - i) + (c - u) * (d - a)) / f, m = ((a - s) * (u - i) + (o - i) * (d - a)) / f;
575
- return 0 < p && p < 1 && 0 < m && m < 1;
576
- }, i.findCircleLineIntersections = function(e, t, n, r, i, a, o) {
577
- var s = (n - e) * (n - e) + (r - t) * (r - t), c = 2 * ((e - i) * (n - e) + (t - a) * (r - t)), l = (e - i) * (e - i) + (t - a) * (t - a) - o * o;
578
- if (c * c - 4 * s * l >= 0) {
579
- var u = (-c + Math.sqrt(c * c - 4 * s * l)) / (2 * s), d = (-c - Math.sqrt(c * c - 4 * s * l)) / (2 * s);
580
- return u >= 0 && u <= 1 ? [u] : d >= 0 && d <= 1 ? [d] : null;
581
- } else return null;
582
- }, i.HALF_PI = .5 * Math.PI, i.ONE_AND_HALF_PI = 1.5 * Math.PI, i.TWO_PI = 2 * Math.PI, i.THREE_PI = 3 * Math.PI, e.exports = i;
583
- }),
584
- (function(e, t, n) {
585
- function r() {}
586
- r.sign = function(e) {
587
- return e > 0 ? 1 : e < 0 ? -1 : 0;
588
- }, r.floor = function(e) {
589
- return e < 0 ? Math.ceil(e) : Math.floor(e);
590
- }, r.ceil = function(e) {
591
- return e < 0 ? Math.floor(e) : Math.ceil(e);
592
- }, e.exports = r;
593
- }),
594
- (function(e, t, n) {
595
- function r() {}
596
- r.MAX_VALUE = 2147483647, r.MIN_VALUE = -2147483648, e.exports = r;
597
- }),
598
- (function(e, t, n) {
599
- var r = function() {
600
- function e(e, t) {
601
- for (var n = 0; n < t.length; n++) {
602
- var r = t[n];
603
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
604
- }
605
- }
606
- return function(t, n, r) {
607
- return n && e(t.prototype, n), r && e(t, r), t;
608
- };
609
- }();
610
- function i(e, t) {
611
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
612
- }
613
- var a = function(e) {
614
- return {
615
- value: e,
616
- next: null,
617
- prev: null
618
- };
619
- }, o = function(e, t, n, r) {
620
- return e === null ? r.head = t : e.next = t, n === null ? r.tail = t : n.prev = t, t.prev = e, t.next = n, r.length++, t;
621
- }, s = function(e, t) {
622
- var n = e.prev, r = e.next;
623
- return n === null ? t.head = r : n.next = r, r === null ? t.tail = n : r.prev = n, e.prev = e.next = null, t.length--, e;
624
- };
625
- e.exports = function() {
626
- function e(t) {
627
- var n = this;
628
- i(this, e), this.length = 0, this.head = null, this.tail = null, t?.forEach(function(e) {
629
- return n.push(e);
630
- });
631
- }
632
- return r(e, [
633
- {
634
- key: "size",
635
- value: function() {
636
- return this.length;
637
- }
638
- },
639
- {
640
- key: "insertBefore",
641
- value: function(e, t) {
642
- return o(t.prev, a(e), t, this);
643
- }
644
- },
645
- {
646
- key: "insertAfter",
647
- value: function(e, t) {
648
- return o(t, a(e), t.next, this);
649
- }
650
- },
651
- {
652
- key: "insertNodeBefore",
653
- value: function(e, t) {
654
- return o(t.prev, e, t, this);
655
- }
656
- },
657
- {
658
- key: "insertNodeAfter",
659
- value: function(e, t) {
660
- return o(t, e, t.next, this);
661
- }
662
- },
663
- {
664
- key: "push",
665
- value: function(e) {
666
- return o(this.tail, a(e), null, this);
667
- }
668
- },
669
- {
670
- key: "unshift",
671
- value: function(e) {
672
- return o(null, a(e), this.head, this);
673
- }
674
- },
675
- {
676
- key: "remove",
677
- value: function(e) {
678
- return s(e, this);
679
- }
680
- },
681
- {
682
- key: "pop",
683
- value: function() {
684
- return s(this.tail, this).value;
685
- }
686
- },
687
- {
688
- key: "popNode",
689
- value: function() {
690
- return s(this.tail, this);
691
- }
692
- },
693
- {
694
- key: "shift",
695
- value: function() {
696
- return s(this.head, this).value;
697
- }
698
- },
699
- {
700
- key: "shiftNode",
701
- value: function() {
702
- return s(this.head, this);
703
- }
704
- },
705
- {
706
- key: "get_object_at",
707
- value: function(e) {
708
- if (e <= this.length()) {
709
- for (var t = 1, n = this.head; t < e;) n = n.next, t++;
710
- return n.value;
711
- }
712
- }
713
- },
714
- {
715
- key: "set_object_at",
716
- value: function(e, t) {
717
- if (e <= this.length()) {
718
- for (var n = 1, r = this.head; n < e;) r = r.next, n++;
719
- r.value = t;
720
- }
721
- }
722
- }
723
- ]), e;
724
- }();
725
- }),
726
- (function(e, t, n) {
727
- function r(e, t, n) {
728
- this.x = null, this.y = null, e == null && t == null && n == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && n == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && n == null && (n = e, this.x = n.x, this.y = n.y);
729
- }
730
- r.prototype.getX = function() {
731
- return this.x;
732
- }, r.prototype.getY = function() {
733
- return this.y;
734
- }, r.prototype.getLocation = function() {
735
- return new r(this.x, this.y);
736
- }, r.prototype.setLocation = function(e, t, n) {
737
- e.constructor.name == "Point" && t == null && n == null ? (n = e, this.setLocation(n.x, n.y)) : typeof e == "number" && typeof t == "number" && n == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + .5), this.y = Math.floor(t + .5)));
738
- }, r.prototype.move = function(e, t) {
739
- this.x = e, this.y = t;
740
- }, r.prototype.translate = function(e, t) {
741
- this.x += e, this.y += t;
742
- }, r.prototype.equals = function(e) {
743
- if (e.constructor.name == "Point") {
744
- var t = e;
745
- return this.x == t.x && this.y == t.y;
746
- }
747
- return this == e;
748
- }, r.prototype.toString = function() {
749
- return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
750
- }, e.exports = r;
751
- }),
752
- (function(e, t, n) {
753
- function r(e, t, n, r) {
754
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && n != null && r != null && (this.x = e, this.y = t, this.width = n, this.height = r);
755
- }
756
- r.prototype.getX = function() {
757
- return this.x;
758
- }, r.prototype.setX = function(e) {
759
- this.x = e;
760
- }, r.prototype.getY = function() {
761
- return this.y;
762
- }, r.prototype.setY = function(e) {
763
- this.y = e;
764
- }, r.prototype.getWidth = function() {
765
- return this.width;
766
- }, r.prototype.setWidth = function(e) {
767
- this.width = e;
768
- }, r.prototype.getHeight = function() {
769
- return this.height;
770
- }, r.prototype.setHeight = function(e) {
771
- this.height = e;
772
- }, r.prototype.getRight = function() {
773
- return this.x + this.width;
774
- }, r.prototype.getBottom = function() {
775
- return this.y + this.height;
776
- }, r.prototype.intersects = function(e) {
777
- return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
778
- }, r.prototype.getCenterX = function() {
779
- return this.x + this.width / 2;
780
- }, r.prototype.getMinX = function() {
781
- return this.getX();
782
- }, r.prototype.getMaxX = function() {
783
- return this.getX() + this.width;
784
- }, r.prototype.getCenterY = function() {
785
- return this.y + this.height / 2;
786
- }, r.prototype.getMinY = function() {
787
- return this.getY();
788
- }, r.prototype.getMaxY = function() {
789
- return this.getY() + this.height;
790
- }, r.prototype.getWidthHalf = function() {
791
- return this.width / 2;
792
- }, r.prototype.getHeightHalf = function() {
793
- return this.height / 2;
794
- }, e.exports = r;
795
- }),
796
- (function(e, t, n) {
797
- var r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
798
- return typeof e;
799
- } : function(e) {
800
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
801
- };
802
- function i() {}
803
- i.lastID = 0, i.createID = function(e) {
804
- return i.isPrimitive(e) ? e : e.uniqueID == null ? (e.uniqueID = i.getString(), i.lastID++, e.uniqueID) : e.uniqueID;
805
- }, i.getString = function(e) {
806
- return e ??= i.lastID, "Object#" + e;
807
- }, i.isPrimitive = function(e) {
808
- var t = e === void 0 ? "undefined" : r(e);
809
- return e == null || t != "object" && t != "function";
810
- }, e.exports = i;
811
- }),
812
- (function(e, t, n) {
813
- function r(e) {
814
- if (Array.isArray(e)) {
815
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
816
- return n;
817
- } else return Array.from(e);
818
- }
819
- var i = n(0), a = n(7), o = n(3), s = n(1), c = n(6), l = n(5), u = n(17), d = n(29);
820
- function f(e) {
821
- d.call(this), this.layoutQuality = i.QUALITY, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = i.DEFAULT_INCREMENTAL, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, e != null && (this.isRemoteUse = e);
822
- }
823
- f.RANDOM_SEED = 1, f.prototype = Object.create(d.prototype), f.prototype.getGraphManager = function() {
824
- return this.graphManager;
825
- }, f.prototype.getAllNodes = function() {
826
- return this.graphManager.getAllNodes();
827
- }, f.prototype.getAllEdges = function() {
828
- return this.graphManager.getAllEdges();
829
- }, f.prototype.getAllNodesToApplyGravitation = function() {
830
- return this.graphManager.getAllNodesToApplyGravitation();
831
- }, f.prototype.newGraphManager = function() {
832
- var e = new a(this);
833
- return this.graphManager = e, e;
834
- }, f.prototype.newGraph = function(e) {
835
- return new c(null, this.graphManager, e);
836
- }, f.prototype.newNode = function(e) {
837
- return new o(this.graphManager, e);
838
- }, f.prototype.newEdge = function(e) {
839
- return new s(null, null, e);
840
- }, f.prototype.checkLayoutSuccess = function() {
841
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
842
- }, f.prototype.runLayout = function() {
843
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
844
- var e = this.checkLayoutSuccess() ? !1 : this.layout();
845
- return i.ANIMATE === "during" ? !1 : (e && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, e);
846
- }, f.prototype.doPostLayout = function() {
847
- this.incremental || this.transform(), this.update();
848
- }, f.prototype.update2 = function() {
849
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
850
- for (var e = this.graphManager.getAllEdges(), t = 0; t < e.length; t++) e[t];
851
- for (var n = this.graphManager.getRoot().getNodes(), t = 0; t < n.length; t++) n[t];
852
- this.update(this.graphManager.getRoot());
853
- }
854
- }, f.prototype.update = function(e) {
855
- if (e == null) this.update2();
856
- else if (e instanceof o) {
857
- var t = e;
858
- if (t.getChild() != null) for (var n = t.getChild().getNodes(), r = 0; r < n.length; r++) update(n[r]);
859
- t.vGraphObject != null && t.vGraphObject.update(t);
860
- } else if (e instanceof s) {
861
- var i = e;
862
- i.vGraphObject != null && i.vGraphObject.update(i);
863
- } else if (e instanceof c) {
864
- var a = e;
865
- a.vGraphObject != null && a.vGraphObject.update(a);
866
- }
867
- }, f.prototype.initParameters = function() {
868
- this.isSubLayout || (this.layoutQuality = i.QUALITY, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = i.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
869
- }, f.prototype.transform = function(e) {
870
- if (e == null) this.transform(new l(0, 0));
871
- else {
872
- var t = new u(), n = this.graphManager.getRoot().updateLeftTop();
873
- if (n != null) {
874
- t.setWorldOrgX(e.x), t.setWorldOrgY(e.y), t.setDeviceOrgX(n.x), t.setDeviceOrgY(n.y);
875
- for (var r = this.getAllNodes(), i, a = 0; a < r.length; a++) i = r[a], i.transform(t);
876
- }
877
- }
878
- }, f.prototype.positionNodesRandomly = function(e) {
879
- if (e == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
880
- else for (var t, n, r = e.getNodes(), i = 0; i < r.length; i++) t = r[i], n = t.getChild(), n == null || n.getNodes().length == 0 ? t.scatter() : (this.positionNodesRandomly(n), t.updateBounds());
881
- }, f.prototype.getFlatForest = function() {
882
- for (var e = [], t = !0, n = this.graphManager.getRoot().getNodes(), i = !0, a = 0; a < n.length; a++) n[a].getChild() != null && (i = !1);
883
- if (!i) return e;
884
- var o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map(), l = [];
885
- for (l = l.concat(n); l.length > 0 && t;) {
886
- for (s.push(l[0]); s.length > 0 && t;) {
887
- var u = s[0];
888
- s.splice(0, 1), o.add(u);
889
- for (var d = u.getEdges(), a = 0; a < d.length; a++) {
890
- var f = d[a].getOtherEnd(u);
891
- if (c.get(u) != f) if (!o.has(f)) s.push(f), c.set(f, u);
892
- else {
893
- t = !1;
894
- break;
895
- }
896
- }
897
- }
898
- if (!t) e = [];
899
- else {
900
- var p = [].concat(r(o));
901
- e.push(p);
902
- for (var a = 0; a < p.length; a++) {
903
- var m = p[a], h = l.indexOf(m);
904
- h > -1 && l.splice(h, 1);
905
- }
906
- o = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
907
- }
908
- }
909
- return e;
910
- }, f.prototype.createDummyNodesForBendpoints = function(e) {
911
- for (var t = [], n = e.source, r = this.graphManager.calcLowestCommonAncestor(e.source, e.target), i = 0; i < e.bendpoints.length; i++) {
912
- var a = this.newNode(null);
913
- a.setRect(new Point(0, 0), new Dimension(1, 1)), r.add(a);
914
- var o = this.newEdge(null);
915
- this.graphManager.add(o, n, a), t.add(a), n = a;
916
- }
917
- var o = this.newEdge(null);
918
- return this.graphManager.add(o, n, e.target), this.edgeToDummyNodes.set(e, t), e.isInterGraph() ? this.graphManager.remove(e) : r.remove(e), t;
919
- }, f.prototype.createBendpointsFromDummyNodes = function() {
920
- var e = [];
921
- e = e.concat(this.graphManager.getAllEdges()), e = [].concat(r(this.edgeToDummyNodes.keys()), e);
922
- for (var t = 0; t < e.length; t++) {
923
- var n = e[t];
924
- if (n.bendpoints.length > 0) {
925
- for (var i = this.edgeToDummyNodes.get(n), a = 0; a < i.length; a++) {
926
- var o = i[a], s = new l(o.getCenterX(), o.getCenterY()), c = n.bendpoints.get(a);
927
- c.x = s.x, c.y = s.y, o.getOwner().remove(o);
928
- }
929
- this.graphManager.add(n, n.source, n.target);
930
- }
931
- }
932
- }, f.transform = function(e, t, n, r) {
933
- if (n != null && r != null) {
934
- var i = t;
935
- if (e <= 50) {
936
- var a = t / n;
937
- i -= (t - a) / 50 * (50 - e);
938
- } else {
939
- var o = t * r;
940
- i += (o - t) / 50 * (e - 50);
941
- }
942
- return i;
943
- } else {
944
- var s, c;
945
- return e <= 50 ? (s = 9 * t / 500, c = t / 10) : (s = 9 * t / 50, c = -8 * t), s * e + c;
946
- }
947
- }, f.findCenterOfTree = function(e) {
948
- var t = [];
949
- t = t.concat(e);
950
- var n = [], r = /* @__PURE__ */ new Map(), i = !1, a = null;
951
- (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
952
- for (var o = 0; o < t.length; o++) {
953
- var s = t[o], c = s.getNeighborsList().size;
954
- r.set(s, s.getNeighborsList().size), c == 1 && n.push(s);
955
- }
956
- var l = [];
957
- for (l = l.concat(n); !i;) {
958
- var u = [];
959
- u = u.concat(l), l = [];
960
- for (var o = 0; o < t.length; o++) {
961
- var s = t[o], d = t.indexOf(s);
962
- d >= 0 && t.splice(d, 1), s.getNeighborsList().forEach(function(e) {
963
- if (n.indexOf(e) < 0) {
964
- var t = r.get(e) - 1;
965
- t == 1 && l.push(e), r.set(e, t);
966
- }
967
- });
968
- }
969
- n = n.concat(l), (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
970
- }
971
- return a;
972
- }, f.prototype.setGraphManager = function(e) {
973
- this.graphManager = e;
974
- }, e.exports = f;
975
- }),
976
- (function(e, t, n) {
977
- function r() {}
978
- r.seed = 1, r.x = 0, r.nextDouble = function() {
979
- return r.x = Math.sin(r.seed++) * 1e4, r.x - Math.floor(r.x);
980
- }, e.exports = r;
981
- }),
982
- (function(e, t, n) {
983
- var r = n(5);
984
- function i(e, t) {
985
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
986
- }
987
- i.prototype.getWorldOrgX = function() {
988
- return this.lworldOrgX;
989
- }, i.prototype.setWorldOrgX = function(e) {
990
- this.lworldOrgX = e;
991
- }, i.prototype.getWorldOrgY = function() {
992
- return this.lworldOrgY;
993
- }, i.prototype.setWorldOrgY = function(e) {
994
- this.lworldOrgY = e;
995
- }, i.prototype.getWorldExtX = function() {
996
- return this.lworldExtX;
997
- }, i.prototype.setWorldExtX = function(e) {
998
- this.lworldExtX = e;
999
- }, i.prototype.getWorldExtY = function() {
1000
- return this.lworldExtY;
1001
- }, i.prototype.setWorldExtY = function(e) {
1002
- this.lworldExtY = e;
1003
- }, i.prototype.getDeviceOrgX = function() {
1004
- return this.ldeviceOrgX;
1005
- }, i.prototype.setDeviceOrgX = function(e) {
1006
- this.ldeviceOrgX = e;
1007
- }, i.prototype.getDeviceOrgY = function() {
1008
- return this.ldeviceOrgY;
1009
- }, i.prototype.setDeviceOrgY = function(e) {
1010
- this.ldeviceOrgY = e;
1011
- }, i.prototype.getDeviceExtX = function() {
1012
- return this.ldeviceExtX;
1013
- }, i.prototype.setDeviceExtX = function(e) {
1014
- this.ldeviceExtX = e;
1015
- }, i.prototype.getDeviceExtY = function() {
1016
- return this.ldeviceExtY;
1017
- }, i.prototype.setDeviceExtY = function(e) {
1018
- this.ldeviceExtY = e;
1019
- }, i.prototype.transformX = function(e) {
1020
- var t = 0, n = this.lworldExtX;
1021
- return n != 0 && (t = this.ldeviceOrgX + (e - this.lworldOrgX) * this.ldeviceExtX / n), t;
1022
- }, i.prototype.transformY = function(e) {
1023
- var t = 0, n = this.lworldExtY;
1024
- return n != 0 && (t = this.ldeviceOrgY + (e - this.lworldOrgY) * this.ldeviceExtY / n), t;
1025
- }, i.prototype.inverseTransformX = function(e) {
1026
- var t = 0, n = this.ldeviceExtX;
1027
- return n != 0 && (t = this.lworldOrgX + (e - this.ldeviceOrgX) * this.lworldExtX / n), t;
1028
- }, i.prototype.inverseTransformY = function(e) {
1029
- var t = 0, n = this.ldeviceExtY;
1030
- return n != 0 && (t = this.lworldOrgY + (e - this.ldeviceOrgY) * this.lworldExtY / n), t;
1031
- }, i.prototype.inverseTransformPoint = function(e) {
1032
- return new r(this.inverseTransformX(e.x), this.inverseTransformY(e.y));
1033
- }, e.exports = i;
1034
- }),
1035
- (function(e, t, n) {
1036
- function r(e) {
1037
- if (Array.isArray(e)) {
1038
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
1039
- return n;
1040
- } else return Array.from(e);
1041
- }
1042
- var i = n(15), a = n(4), o = n(0), s = n(8), c = n(9);
1043
- function l() {
1044
- i.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1045
- }
1046
- for (var u in l.prototype = Object.create(i.prototype), i) l[u] = i[u];
1047
- l.prototype.initParameters = function() {
1048
- i.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1049
- }, l.prototype.calcIdealEdgeLengths = function() {
1050
- for (var e, t, n, r, i, s, c, l = this.getGraphManager().getAllEdges(), u = 0; u < l.length; u++) e = l[u], t = e.idealLength, e.isInterGraph && (r = e.getSource(), i = e.getTarget(), s = e.getSourceInLca().getEstimatedSize(), c = e.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (e.idealLength += s + c - 2 * o.SIMPLE_NODE_SIZE), n = e.getLca().getInclusionTreeDepth(), e.idealLength += t * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (r.getInclusionTreeDepth() + i.getInclusionTreeDepth() - 2 * n));
1051
- }, l.prototype.initSpringEmbedder = function() {
1052
- var e = this.getAllNodes().length;
1053
- this.incremental ? (e > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (e > a.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1054
- }, l.prototype.calcSpringForces = function() {
1055
- for (var e = this.getAllEdges(), t, n = 0; n < e.length; n++) t = e[n], this.calcSpringForce(t, t.idealLength);
1056
- }, l.prototype.calcRepulsionForces = function() {
1057
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n, r, i, o, s = this.getAllNodes(), c;
1058
- if (this.useFRGridVariant) for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && e && this.updateGrid(), c = /* @__PURE__ */ new Set(), n = 0; n < s.length; n++) i = s[n], this.calculateRepulsionForceOfANode(i, c, e, t), c.add(i);
1059
- else for (n = 0; n < s.length; n++) for (i = s[n], r = n + 1; r < s.length; r++) o = s[r], i.getOwner() == o.getOwner() && this.calcRepulsionForce(i, o);
1060
- }, l.prototype.calcGravitationalForces = function() {
1061
- for (var e, t = this.getAllNodesToApplyGravitation(), n = 0; n < t.length; n++) e = t[n], this.calcGravitationalForce(e);
1062
- }, l.prototype.moveNodes = function() {
1063
- for (var e = this.getAllNodes(), t, n = 0; n < e.length; n++) t = e[n], t.move();
1064
- }, l.prototype.calcSpringForce = function(e, t) {
1065
- var n = e.getSource(), r = e.getTarget(), i, a, o, s;
1066
- if (this.uniformLeafNodeSizes && n.getChild() == null && r.getChild() == null) e.updateLengthSimple();
1067
- else if (e.updateLength(), e.isOverlapingSourceAndTarget) return;
1068
- i = e.getLength(), i != 0 && (a = e.edgeElasticity * (i - t), o = a * (e.lengthX / i), s = a * (e.lengthY / i), n.springForceX += o, n.springForceY += s, r.springForceX -= o, r.springForceY -= s);
1069
- }, l.prototype.calcRepulsionForce = function(e, t) {
1070
- var n = e.getRect(), r = t.getRect(), i = [, ,], o = [
1071
- ,
1072
- ,
1073
- ,
1074
- ,
1075
- ], l, u, d, f, p, m, h;
1076
- if (n.intersects(r)) {
1077
- s.calcSeparationAmount(n, r, i, a.DEFAULT_EDGE_LENGTH / 2), m = 2 * i[0], h = 2 * i[1];
1078
- var g = e.noOfChildren * t.noOfChildren / (e.noOfChildren + t.noOfChildren);
1079
- e.repulsionForceX -= g * m, e.repulsionForceY -= g * h, t.repulsionForceX += g * m, t.repulsionForceY += g * h;
1080
- } else this.uniformLeafNodeSizes && e.getChild() == null && t.getChild() == null ? (l = r.getCenterX() - n.getCenterX(), u = r.getCenterY() - n.getCenterY()) : (s.getIntersection(n, r, o), l = o[2] - o[0], u = o[3] - o[1]), Math.abs(l) < a.MIN_REPULSION_DIST && (l = c.sign(l) * a.MIN_REPULSION_DIST), Math.abs(u) < a.MIN_REPULSION_DIST && (u = c.sign(u) * a.MIN_REPULSION_DIST), d = l * l + u * u, f = Math.sqrt(d), p = (e.nodeRepulsion / 2 + t.nodeRepulsion / 2) * e.noOfChildren * t.noOfChildren / d, m = p * l / f, h = p * u / f, e.repulsionForceX -= m, e.repulsionForceY -= h, t.repulsionForceX += m, t.repulsionForceY += h;
1081
- }, l.prototype.calcGravitationalForce = function(e) {
1082
- var t = e.getOwner(), n = (t.getRight() + t.getLeft()) / 2, r = (t.getTop() + t.getBottom()) / 2, i = e.getCenterX() - n, a = e.getCenterY() - r, o = Math.abs(i) + e.getWidth() / 2, s = Math.abs(a) + e.getHeight() / 2, c;
1083
- e.getOwner() == this.graphManager.getRoot() ? (c = t.getEstimatedSize() * this.gravityRangeFactor, (o > c || s > c) && (e.gravitationForceX = -this.gravityConstant * i, e.gravitationForceY = -this.gravityConstant * a)) : (c = t.getEstimatedSize() * this.compoundGravityRangeFactor, (o > c || s > c) && (e.gravitationForceX = -this.gravityConstant * i * this.compoundGravityConstant, e.gravitationForceY = -this.gravityConstant * a * this.compoundGravityConstant));
1084
- }, l.prototype.isConverged = function() {
1085
- var e, t = !1;
1086
- return this.totalIterations > this.maxIterations / 3 && (t = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), e = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, e || t;
1087
- }, l.prototype.animate = function() {
1088
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1089
- }, l.prototype.calcNoOfChildrenForAllNodes = function() {
1090
- for (var e, t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) e = t[n], e.noOfChildren = e.getNoOfChildren();
1091
- }, l.prototype.calcGrid = function(e) {
1092
- var t = 0, n = 0;
1093
- t = parseInt(Math.ceil((e.getRight() - e.getLeft()) / this.repulsionRange)), n = parseInt(Math.ceil((e.getBottom() - e.getTop()) / this.repulsionRange));
1094
- for (var r = Array(t), i = 0; i < t; i++) r[i] = Array(n);
1095
- for (var i = 0; i < t; i++) for (var a = 0; a < n; a++) r[i][a] = [];
1096
- return r;
1097
- }, l.prototype.addNodeToGrid = function(e, t, n) {
1098
- var r = 0, i = 0, a = 0, o = 0;
1099
- r = parseInt(Math.floor((e.getRect().x - t) / this.repulsionRange)), i = parseInt(Math.floor((e.getRect().width + e.getRect().x - t) / this.repulsionRange)), a = parseInt(Math.floor((e.getRect().y - n) / this.repulsionRange)), o = parseInt(Math.floor((e.getRect().height + e.getRect().y - n) / this.repulsionRange));
1100
- for (var s = r; s <= i; s++) for (var c = a; c <= o; c++) this.grid[s][c].push(e), e.setGridCoordinates(r, i, a, o);
1101
- }, l.prototype.updateGrid = function() {
1102
- var e, t, n = this.getAllNodes();
1103
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), e = 0; e < n.length; e++) t = n[e], this.addNodeToGrid(t, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1104
- }, l.prototype.calculateRepulsionForceOfANode = function(e, t, n, i) {
1105
- if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && n || i) {
1106
- var o = /* @__PURE__ */ new Set();
1107
- e.surrounding = [];
1108
- for (var s, c = this.grid, l = e.startX - 1; l < e.finishX + 2; l++) for (var u = e.startY - 1; u < e.finishY + 2; u++) if (!(l < 0 || u < 0 || l >= c.length || u >= c[0].length)) {
1109
- for (var d = 0; d < c[l][u].length; d++) if (s = c[l][u][d], !(e.getOwner() != s.getOwner() || e == s) && !t.has(s) && !o.has(s)) {
1110
- var f = Math.abs(e.getCenterX() - s.getCenterX()) - (e.getWidth() / 2 + s.getWidth() / 2), p = Math.abs(e.getCenterY() - s.getCenterY()) - (e.getHeight() / 2 + s.getHeight() / 2);
1111
- f <= this.repulsionRange && p <= this.repulsionRange && o.add(s);
1112
- }
1113
- }
1114
- e.surrounding = [].concat(r(o));
1115
- }
1116
- for (l = 0; l < e.surrounding.length; l++) this.calcRepulsionForce(e, e.surrounding[l]);
1117
- }, l.prototype.calcRepulsionRange = function() {
1118
- return 0;
1119
- }, e.exports = l;
1120
- }),
1121
- (function(e, t, n) {
1122
- var r = n(1), i = n(4);
1123
- function a(e, t, n) {
1124
- r.call(this, e, t, n), this.idealLength = i.DEFAULT_EDGE_LENGTH, this.edgeElasticity = i.DEFAULT_SPRING_STRENGTH;
1125
- }
1126
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1127
- e.exports = a;
1128
- }),
1129
- (function(e, t, n) {
1130
- var r = n(3), i = n(4);
1131
- function a(e, t, n, a) {
1132
- r.call(this, e, t, n, a), this.nodeRepulsion = i.DEFAULT_REPULSION_STRENGTH, this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
1133
- }
1134
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1135
- a.prototype.setGridCoordinates = function(e, t, n, r) {
1136
- this.startX = e, this.finishX = t, this.startY = n, this.finishY = r;
1137
- }, e.exports = a;
1138
- }),
1139
- (function(e, t, n) {
1140
- function r(e, t) {
1141
- this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1142
- }
1143
- r.prototype.getWidth = function() {
1144
- return this.width;
1145
- }, r.prototype.setWidth = function(e) {
1146
- this.width = e;
1147
- }, r.prototype.getHeight = function() {
1148
- return this.height;
1149
- }, r.prototype.setHeight = function(e) {
1150
- this.height = e;
1151
- }, e.exports = r;
1152
- }),
1153
- (function(e, t, n) {
1154
- var r = n(14);
1155
- function i() {
1156
- this.map = {}, this.keys = [];
1157
- }
1158
- i.prototype.put = function(e, t) {
1159
- var n = r.createID(e);
1160
- this.contains(n) || (this.map[n] = t, this.keys.push(e));
1161
- }, i.prototype.contains = function(e) {
1162
- return r.createID(e), this.map[e] != null;
1163
- }, i.prototype.get = function(e) {
1164
- var t = r.createID(e);
1165
- return this.map[t];
1166
- }, i.prototype.keySet = function() {
1167
- return this.keys;
1168
- }, e.exports = i;
1169
- }),
1170
- (function(e, t, n) {
1171
- var r = n(14);
1172
- function i() {
1173
- this.set = {};
1174
- }
1175
- i.prototype.add = function(e) {
1176
- var t = r.createID(e);
1177
- this.contains(t) || (this.set[t] = e);
1178
- }, i.prototype.remove = function(e) {
1179
- delete this.set[r.createID(e)];
1180
- }, i.prototype.clear = function() {
1181
- this.set = {};
1182
- }, i.prototype.contains = function(e) {
1183
- return this.set[r.createID(e)] == e;
1184
- }, i.prototype.isEmpty = function() {
1185
- return this.size() === 0;
1186
- }, i.prototype.size = function() {
1187
- return Object.keys(this.set).length;
1188
- }, i.prototype.addAllTo = function(e) {
1189
- for (var t = Object.keys(this.set), n = t.length, r = 0; r < n; r++) e.push(this.set[t[r]]);
1190
- }, i.prototype.size = function() {
1191
- return Object.keys(this.set).length;
1192
- }, i.prototype.addAll = function(e) {
1193
- for (var t = e.length, n = 0; n < t; n++) {
1194
- var r = e[n];
1195
- this.add(r);
1196
- }
1197
- }, e.exports = i;
1198
- }),
1199
- (function(e, t, n) {
1200
- function r() {}
1201
- r.multMat = function(e, t) {
1202
- for (var n = [], r = 0; r < e.length; r++) {
1203
- n[r] = [];
1204
- for (var i = 0; i < t[0].length; i++) {
1205
- n[r][i] = 0;
1206
- for (var a = 0; a < e[0].length; a++) n[r][i] += e[r][a] * t[a][i];
1207
- }
1208
- }
1209
- return n;
1210
- }, r.transpose = function(e) {
1211
- for (var t = [], n = 0; n < e[0].length; n++) {
1212
- t[n] = [];
1213
- for (var r = 0; r < e.length; r++) t[n][r] = e[r][n];
1214
- }
1215
- return t;
1216
- }, r.multCons = function(e, t) {
1217
- for (var n = [], r = 0; r < e.length; r++) n[r] = e[r] * t;
1218
- return n;
1219
- }, r.minusOp = function(e, t) {
1220
- for (var n = [], r = 0; r < e.length; r++) n[r] = e[r] - t[r];
1221
- return n;
1222
- }, r.dotProduct = function(e, t) {
1223
- for (var n = 0, r = 0; r < e.length; r++) n += e[r] * t[r];
1224
- return n;
1225
- }, r.mag = function(e) {
1226
- return Math.sqrt(this.dotProduct(e, e));
1227
- }, r.normalize = function(e) {
1228
- for (var t = [], n = this.mag(e), r = 0; r < e.length; r++) t[r] = e[r] / n;
1229
- return t;
1230
- }, r.multGamma = function(e) {
1231
- for (var t = [], n = 0, r = 0; r < e.length; r++) n += e[r];
1232
- n *= -1 / e.length;
1233
- for (var i = 0; i < e.length; i++) t[i] = n + e[i];
1234
- return t;
1235
- }, r.multL = function(e, t, n) {
1236
- for (var r = [], i = [], a = [], o = 0; o < t[0].length; o++) {
1237
- for (var s = 0, c = 0; c < t.length; c++) s += -.5 * t[c][o] * e[c];
1238
- i[o] = s;
1239
- }
1240
- for (var l = 0; l < n.length; l++) {
1241
- for (var u = 0, d = 0; d < n.length; d++) u += n[l][d] * i[d];
1242
- a[l] = u;
1243
- }
1244
- for (var f = 0; f < t.length; f++) {
1245
- for (var p = 0, m = 0; m < t[0].length; m++) p += t[f][m] * a[m];
1246
- r[f] = p;
1247
- }
1248
- return r;
1249
- }, e.exports = r;
1250
- }),
1251
- (function(e, t, n) {
1252
- var r = function() {
1253
- function e(e, t) {
1254
- for (var n = 0; n < t.length; n++) {
1255
- var r = t[n];
1256
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1257
- }
1258
- }
1259
- return function(t, n, r) {
1260
- return n && e(t.prototype, n), r && e(t, r), t;
1261
- };
1262
- }();
1263
- function i(e, t) {
1264
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1265
- }
1266
- var a = n(11);
1267
- e.exports = function() {
1268
- function e(t, n) {
1269
- i(this, e), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1270
- var r = void 0;
1271
- r = t instanceof a ? t.size() : t.length, this._quicksort(t, 0, r - 1);
1272
- }
1273
- return r(e, [
1274
- {
1275
- key: "_quicksort",
1276
- value: function(e, t, n) {
1277
- if (t < n) {
1278
- var r = this._partition(e, t, n);
1279
- this._quicksort(e, t, r), this._quicksort(e, r + 1, n);
1280
- }
1281
- }
1282
- },
1283
- {
1284
- key: "_partition",
1285
- value: function(e, t, n) {
1286
- for (var r = this._get(e, t), i = t, a = n;;) {
1287
- for (; this.compareFunction(r, this._get(e, a));) a--;
1288
- for (; this.compareFunction(this._get(e, i), r);) i++;
1289
- if (i < a) this._swap(e, i, a), i++, a--;
1290
- else return a;
1291
- }
1292
- }
1293
- },
1294
- {
1295
- key: "_get",
1296
- value: function(e, t) {
1297
- return e instanceof a ? e.get_object_at(t) : e[t];
1298
- }
1299
- },
1300
- {
1301
- key: "_set",
1302
- value: function(e, t, n) {
1303
- e instanceof a ? e.set_object_at(t, n) : e[t] = n;
1304
- }
1305
- },
1306
- {
1307
- key: "_swap",
1308
- value: function(e, t, n) {
1309
- var r = this._get(e, t);
1310
- this._set(e, t, this._get(e, n)), this._set(e, n, r);
1311
- }
1312
- },
1313
- {
1314
- key: "_defaultCompareFunction",
1315
- value: function(e, t) {
1316
- return t > e;
1317
- }
1318
- }
1319
- ]), e;
1320
- }();
1321
- }),
1322
- (function(e, t, n) {
1323
- function r() {}
1324
- r.svd = function(e) {
1325
- this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = e.length, this.n = e[0].length;
1326
- var t = Math.min(this.m, this.n);
1327
- this.s = function(e) {
1328
- for (var t = []; e-- > 0;) t.push(0);
1329
- return t;
1330
- }(Math.min(this.m + 1, this.n)), this.U = function(e) {
1331
- return function e(t) {
1332
- if (t.length == 0) return 0;
1333
- for (var n = [], r = 0; r < t[0]; r++) n.push(e(t.slice(1)));
1334
- return n;
1335
- }(e);
1336
- }([this.m, t]), this.V = function(e) {
1337
- return function e(t) {
1338
- if (t.length == 0) return 0;
1339
- for (var n = [], r = 0; r < t[0]; r++) n.push(e(t.slice(1)));
1340
- return n;
1341
- }(e);
1342
- }([this.n, this.n]);
1343
- for (var n = function(e) {
1344
- for (var t = []; e-- > 0;) t.push(0);
1345
- return t;
1346
- }(this.n), i = function(e) {
1347
- for (var t = []; e-- > 0;) t.push(0);
1348
- return t;
1349
- }(this.m), a = !0, o = !0, s = Math.min(this.m - 1, this.n), c = Math.max(0, Math.min(this.n - 2, this.m)), l = 0; l < Math.max(s, c); l++) {
1350
- if (l < s) {
1351
- this.s[l] = 0;
1352
- for (var u = l; u < this.m; u++) this.s[l] = r.hypot(this.s[l], e[u][l]);
1353
- if (this.s[l] !== 0) {
1354
- e[l][l] < 0 && (this.s[l] = -this.s[l]);
1355
- for (var d = l; d < this.m; d++) e[d][l] /= this.s[l];
1356
- e[l][l] += 1;
1357
- }
1358
- this.s[l] = -this.s[l];
1359
- }
1360
- for (var f = l + 1; f < this.n; f++) {
1361
- if (function(e, t) {
1362
- return e && t;
1363
- }(l < s, this.s[l] !== 0)) {
1364
- for (var p = 0, m = l; m < this.m; m++) p += e[m][l] * e[m][f];
1365
- p = -p / e[l][l];
1366
- for (var h = l; h < this.m; h++) e[h][f] += p * e[h][l];
1367
- }
1368
- n[f] = e[l][f];
1369
- }
1370
- if (function(e, t) {
1371
- return e && t;
1372
- }(a, l < s)) for (var g = l; g < this.m; g++) this.U[g][l] = e[g][l];
1373
- if (l < c) {
1374
- n[l] = 0;
1375
- for (var _ = l + 1; _ < this.n; _++) n[l] = r.hypot(n[l], n[_]);
1376
- if (n[l] !== 0) {
1377
- n[l + 1] < 0 && (n[l] = -n[l]);
1378
- for (var v = l + 1; v < this.n; v++) n[v] /= n[l];
1379
- n[l + 1] += 1;
1380
- }
1381
- if (n[l] = -n[l], function(e, t) {
1382
- return e && t;
1383
- }(l + 1 < this.m, n[l] !== 0)) {
1384
- for (var y = l + 1; y < this.m; y++) i[y] = 0;
1385
- for (var b = l + 1; b < this.n; b++) for (var x = l + 1; x < this.m; x++) i[x] += n[b] * e[x][b];
1386
- for (var S = l + 1; S < this.n; S++) for (var C = -n[S] / n[l + 1], w = l + 1; w < this.m; w++) e[w][S] += C * i[w];
1387
- }
1388
- if (o) for (var T = l + 1; T < this.n; T++) this.V[T][l] = n[T];
1389
- }
1390
- }
1391
- var E = Math.min(this.n, this.m + 1);
1392
- if (s < this.n && (this.s[s] = e[s][s]), this.m < E && (this.s[E - 1] = 0), c + 1 < E && (n[c] = e[c][E - 1]), n[E - 1] = 0, a) {
1393
- for (var D = s; D < t; D++) {
1394
- for (var O = 0; O < this.m; O++) this.U[O][D] = 0;
1395
- this.U[D][D] = 1;
1396
- }
1397
- for (var k = s - 1; k >= 0; k--) if (this.s[k] !== 0) {
1398
- for (var A = k + 1; A < t; A++) {
1399
- for (var j = 0, M = k; M < this.m; M++) j += this.U[M][k] * this.U[M][A];
1400
- j = -j / this.U[k][k];
1401
- for (var N = k; N < this.m; N++) this.U[N][A] += j * this.U[N][k];
1402
- }
1403
- for (var P = k; P < this.m; P++) this.U[P][k] = -this.U[P][k];
1404
- this.U[k][k] = 1 + this.U[k][k];
1405
- for (var F = 0; F < k - 1; F++) this.U[F][k] = 0;
1406
- } else {
1407
- for (var I = 0; I < this.m; I++) this.U[I][k] = 0;
1408
- this.U[k][k] = 1;
1409
- }
1410
- }
1411
- if (o) for (var L = this.n - 1; L >= 0; L--) {
1412
- if (function(e, t) {
1413
- return e && t;
1414
- }(L < c, n[L] !== 0)) for (var R = L + 1; R < t; R++) {
1415
- for (var z = 0, B = L + 1; B < this.n; B++) z += this.V[B][L] * this.V[B][R];
1416
- z = -z / this.V[L + 1][L];
1417
- for (var V = L + 1; V < this.n; V++) this.V[V][R] += z * this.V[V][L];
1418
- }
1419
- for (var ee = 0; ee < this.n; ee++) this.V[ee][L] = 0;
1420
- this.V[L][L] = 1;
1421
- }
1422
- for (var te = E - 1, H = 0, ne = 2 ** -52, re = 2 ** -966; E > 0;) {
1423
- var U = void 0, W = void 0;
1424
- for (U = E - 2; U >= -1 && U !== -1; U--) if (Math.abs(n[U]) <= re + ne * (Math.abs(this.s[U]) + Math.abs(this.s[U + 1]))) {
1425
- n[U] = 0;
1426
- break;
1427
- }
1428
- if (U === E - 2) W = 4;
1429
- else {
1430
- var G = void 0;
1431
- for (G = E - 1; G >= U && G !== U; G--) {
1432
- var ie = (G === E ? 0 : Math.abs(n[G])) + (G === U + 1 ? 0 : Math.abs(n[G - 1]));
1433
- if (Math.abs(this.s[G]) <= re + ne * ie) {
1434
- this.s[G] = 0;
1435
- break;
1436
- }
1437
- }
1438
- G === U ? W = 3 : G === E - 1 ? W = 1 : (W = 2, U = G);
1439
- }
1440
- switch (U++, W) {
1441
- case 1:
1442
- var K = n[E - 2];
1443
- n[E - 2] = 0;
1444
- for (var q = E - 2; q >= U; q--) {
1445
- var J = r.hypot(this.s[q], K), Y = this.s[q] / J, ae = K / J;
1446
- if (this.s[q] = J, q !== U && (K = -ae * n[q - 1], n[q - 1] = Y * n[q - 1]), o) for (var X = 0; X < this.n; X++) J = Y * this.V[X][q] + ae * this.V[X][E - 1], this.V[X][E - 1] = -ae * this.V[X][q] + Y * this.V[X][E - 1], this.V[X][q] = J;
1447
- }
1448
- break;
1449
- case 2:
1450
- var oe = n[U - 1];
1451
- n[U - 1] = 0;
1452
- for (var Z = U; Z < E; Z++) {
1453
- var se = r.hypot(this.s[Z], oe), ce = this.s[Z] / se, le = oe / se;
1454
- if (this.s[Z] = se, oe = -le * n[Z], n[Z] = ce * n[Z], a) for (var ue = 0; ue < this.m; ue++) se = ce * this.U[ue][Z] + le * this.U[ue][U - 1], this.U[ue][U - 1] = -le * this.U[ue][Z] + ce * this.U[ue][U - 1], this.U[ue][Z] = se;
1455
- }
1456
- break;
1457
- case 3:
1458
- var de = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[E - 1]), Math.abs(this.s[E - 2])), Math.abs(n[E - 2])), Math.abs(this.s[U])), Math.abs(n[U])), fe = this.s[E - 1] / de, pe = this.s[E - 2] / de, me = n[E - 2] / de, he = this.s[U] / de, ge = n[U] / de, _e = ((pe + fe) * (pe - fe) + me * me) / 2, ve = fe * me * (fe * me), ye = 0;
1459
- (function(e, t) {
1460
- return e || t;
1461
- })(_e !== 0, ve !== 0) && (ye = Math.sqrt(_e * _e + ve), _e < 0 && (ye = -ye), ye = ve / (_e + ye));
1462
- for (var be = (he + fe) * (he - fe) + ye, xe = he * ge, Q = U; Q < E - 1; Q++) {
1463
- var $ = r.hypot(be, xe), Se = be / $, Ce = xe / $;
1464
- if (Q !== U && (n[Q - 1] = $), be = Se * this.s[Q] + Ce * n[Q], n[Q] = Se * n[Q] - Ce * this.s[Q], xe = Ce * this.s[Q + 1], this.s[Q + 1] = Se * this.s[Q + 1], o) for (var we = 0; we < this.n; we++) $ = Se * this.V[we][Q] + Ce * this.V[we][Q + 1], this.V[we][Q + 1] = -Ce * this.V[we][Q] + Se * this.V[we][Q + 1], this.V[we][Q] = $;
1465
- if ($ = r.hypot(be, xe), Se = be / $, Ce = xe / $, this.s[Q] = $, be = Se * n[Q] + Ce * this.s[Q + 1], this.s[Q + 1] = -Ce * n[Q] + Se * this.s[Q + 1], xe = Ce * n[Q + 1], n[Q + 1] = Se * n[Q + 1], a && Q < this.m - 1) for (var Te = 0; Te < this.m; Te++) $ = Se * this.U[Te][Q] + Ce * this.U[Te][Q + 1], this.U[Te][Q + 1] = -Ce * this.U[Te][Q] + Se * this.U[Te][Q + 1], this.U[Te][Q] = $;
1466
- }
1467
- n[E - 2] = be, H += 1;
1468
- break;
1469
- case 4:
1470
- if (this.s[U] <= 0 && (this.s[U] = this.s[U] < 0 ? -this.s[U] : 0, o)) for (var Ee = 0; Ee <= te; Ee++) this.V[Ee][U] = -this.V[Ee][U];
1471
- for (; U < te && !(this.s[U] >= this.s[U + 1]);) {
1472
- var De = this.s[U];
1473
- if (this.s[U] = this.s[U + 1], this.s[U + 1] = De, o && U < this.n - 1) for (var Oe = 0; Oe < this.n; Oe++) De = this.V[Oe][U + 1], this.V[Oe][U + 1] = this.V[Oe][U], this.V[Oe][U] = De;
1474
- if (a && U < this.m - 1) for (var ke = 0; ke < this.m; ke++) De = this.U[ke][U + 1], this.U[ke][U + 1] = this.U[ke][U], this.U[ke][U] = De;
1475
- U++;
1476
- }
1477
- H = 0, E--;
1478
- break;
1479
- }
1480
- }
1481
- return {
1482
- U: this.U,
1483
- V: this.V,
1484
- S: this.s
1485
- };
1486
- }, r.hypot = function(e, t) {
1487
- var n = void 0;
1488
- return Math.abs(e) > Math.abs(t) ? (n = t / e, n = Math.abs(e) * Math.sqrt(1 + n * n)) : t == 0 ? n = 0 : (n = e / t, n = Math.abs(t) * Math.sqrt(1 + n * n)), n;
1489
- }, e.exports = r;
1490
- }),
1491
- (function(e, t, n) {
1492
- var r = function() {
1493
- function e(e, t) {
1494
- for (var n = 0; n < t.length; n++) {
1495
- var r = t[n];
1496
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1497
- }
1498
- }
1499
- return function(t, n, r) {
1500
- return n && e(t.prototype, n), r && e(t, r), t;
1501
- };
1502
- }();
1503
- function i(e, t) {
1504
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1505
- }
1506
- e.exports = function() {
1507
- function e(t, n) {
1508
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1509
- i(this, e), this.sequence1 = t, this.sequence2 = n, this.match_score = r, this.mismatch_penalty = a, this.gap_penalty = o, this.iMax = t.length + 1, this.jMax = n.length + 1, this.grid = Array(this.iMax);
1510
- for (var s = 0; s < this.iMax; s++) {
1511
- this.grid[s] = Array(this.jMax);
1512
- for (var c = 0; c < this.jMax; c++) this.grid[s][c] = 0;
1513
- }
1514
- this.tracebackGrid = Array(this.iMax);
1515
- for (var l = 0; l < this.iMax; l++) {
1516
- this.tracebackGrid[l] = Array(this.jMax);
1517
- for (var u = 0; u < this.jMax; u++) this.tracebackGrid[l][u] = [
1518
- null,
1519
- null,
1520
- null
1521
- ];
1522
- }
1523
- this.alignments = [], this.score = -1, this.computeGrids();
1524
- }
1525
- return r(e, [
1526
- {
1527
- key: "getScore",
1528
- value: function() {
1529
- return this.score;
1530
- }
1531
- },
1532
- {
1533
- key: "getAlignments",
1534
- value: function() {
1535
- return this.alignments;
1536
- }
1537
- },
1538
- {
1539
- key: "computeGrids",
1540
- value: function() {
1541
- for (var e = 1; e < this.jMax; e++) this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [
1542
- !1,
1543
- !1,
1544
- !0
1545
- ];
1546
- for (var t = 1; t < this.iMax; t++) this.grid[t][0] = this.grid[t - 1][0] + this.gap_penalty, this.tracebackGrid[t][0] = [
1547
- !1,
1548
- !0,
1549
- !1
1550
- ];
1551
- for (var n = 1; n < this.iMax; n++) for (var r = 1; r < this.jMax; r++) {
1552
- var i = void 0;
1553
- i = this.sequence1[n - 1] === this.sequence2[r - 1] ? this.grid[n - 1][r - 1] + this.match_score : this.grid[n - 1][r - 1] + this.mismatch_penalty;
1554
- var a = this.grid[n - 1][r] + this.gap_penalty, o = this.grid[n][r - 1] + this.gap_penalty, s = [
1555
- i,
1556
- a,
1557
- o
1558
- ], c = this.arrayAllMaxIndexes(s);
1559
- this.grid[n][r] = s[c[0]], this.tracebackGrid[n][r] = [
1560
- c.includes(0),
1561
- c.includes(1),
1562
- c.includes(2)
1563
- ];
1564
- }
1565
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1566
- }
1567
- },
1568
- {
1569
- key: "alignmentTraceback",
1570
- value: function() {
1571
- var e = [];
1572
- for (e.push({
1573
- pos: [this.sequence1.length, this.sequence2.length],
1574
- seq1: "",
1575
- seq2: ""
1576
- }); e[0];) {
1577
- var t = e[0], n = this.tracebackGrid[t.pos[0]][t.pos[1]];
1578
- n[0] && e.push({
1579
- pos: [t.pos[0] - 1, t.pos[1] - 1],
1580
- seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1581
- seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1582
- }), n[1] && e.push({
1583
- pos: [t.pos[0] - 1, t.pos[1]],
1584
- seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1585
- seq2: "-" + t.seq2
1586
- }), n[2] && e.push({
1587
- pos: [t.pos[0], t.pos[1] - 1],
1588
- seq1: "-" + t.seq1,
1589
- seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1590
- }), t.pos[0] === 0 && t.pos[1] === 0 && this.alignments.push({
1591
- sequence1: t.seq1,
1592
- sequence2: t.seq2
1593
- }), e.shift();
1594
- }
1595
- return this.alignments;
1596
- }
1597
- },
1598
- {
1599
- key: "getAllIndexes",
1600
- value: function(e, t) {
1601
- for (var n = [], r = -1; (r = e.indexOf(t, r + 1)) !== -1;) n.push(r);
1602
- return n;
1603
- }
1604
- },
1605
- {
1606
- key: "arrayAllMaxIndexes",
1607
- value: function(e) {
1608
- return this.getAllIndexes(e, Math.max.apply(null, e));
1609
- }
1610
- }
1611
- ]), e;
1612
- }();
1613
- }),
1614
- (function(e, t, n) {
1615
- var r = function() {};
1616
- r.FDLayout = n(18), r.FDLayoutConstants = n(4), r.FDLayoutEdge = n(19), r.FDLayoutNode = n(20), r.DimensionD = n(21), r.HashMap = n(22), r.HashSet = n(23), r.IGeometry = n(8), r.IMath = n(9), r.Integer = n(10), r.Point = n(12), r.PointD = n(5), r.RandomSeed = n(16), r.RectangleD = n(13), r.Transform = n(17), r.UniqueIDGeneretor = n(14), r.Quicksort = n(25), r.LinkedList = n(11), r.LGraphObject = n(2), r.LGraph = n(6), r.LEdge = n(1), r.LGraphManager = n(7), r.LNode = n(3), r.Layout = n(15), r.LayoutConstants = n(0), r.NeedlemanWunsch = n(27), r.Matrix = n(24), r.SVD = n(26), e.exports = r;
1617
- }),
1618
- (function(e, t, n) {
1619
- function r() {
1620
- this.listeners = [];
1621
- }
1622
- var i = r.prototype;
1623
- i.addListener = function(e, t) {
1624
- this.listeners.push({
1625
- event: e,
1626
- callback: t
1627
- });
1628
- }, i.removeListener = function(e, t) {
1629
- for (var n = this.listeners.length; n >= 0; n--) {
1630
- var r = this.listeners[n];
1631
- r.event === e && r.callback === t && this.listeners.splice(n, 1);
1632
- }
1633
- }, i.emit = function(e, t) {
1634
- for (var n = 0; n < this.listeners.length; n++) {
1635
- var r = this.listeners[n];
1636
- e === r.event && r.callback(t);
1637
- }
1638
- }, e.exports = r;
1639
- })
1640
- ]);
1641
- });
1642
- })), O = /* @__PURE__ */ t(((e, t) => {
1643
- (function(n, r) {
1644
- typeof e == "object" && typeof t == "object" ? t.exports = r(D()) : typeof define == "function" && define.amd ? define(["layout-base"], r) : typeof e == "object" ? e.coseBase = r(D()) : n.coseBase = r(n.layoutBase);
1645
- })(e, function(e) {
1646
- return (() => {
1647
- var t = {
1648
- 45: ((e, t, n) => {
1649
- var r = {};
1650
- r.layoutBase = n(551), r.CoSEConstants = n(806), r.CoSEEdge = n(767), r.CoSEGraph = n(880), r.CoSEGraphManager = n(578), r.CoSELayout = n(765), r.CoSENode = n(991), r.ConstraintHandler = n(902), e.exports = r;
1651
- }),
1652
- 806: ((e, t, n) => {
1653
- var r = n(551).FDLayoutConstants;
1654
- function i() {}
1655
- for (var a in r) i[a] = r[a];
1656
- i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, i.ENFORCE_CONSTRAINTS = !0, i.APPLY_LAYOUT = !0, i.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, i.TREE_REDUCTION_ON_INCREMENTAL = !0, i.PURE_INCREMENTAL = i.DEFAULT_INCREMENTAL, e.exports = i;
1657
- }),
1658
- 767: ((e, t, n) => {
1659
- var r = n(551).FDLayoutEdge;
1660
- function i(e, t, n) {
1661
- r.call(this, e, t, n);
1662
- }
1663
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1664
- e.exports = i;
1665
- }),
1666
- 880: ((e, t, n) => {
1667
- var r = n(551).LGraph;
1668
- function i(e, t, n) {
1669
- r.call(this, e, t, n);
1670
- }
1671
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1672
- e.exports = i;
1673
- }),
1674
- 578: ((e, t, n) => {
1675
- var r = n(551).LGraphManager;
1676
- function i(e) {
1677
- r.call(this, e);
1678
- }
1679
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1680
- e.exports = i;
1681
- }),
1682
- 765: ((e, t, n) => {
1683
- var r = n(551).FDLayout, i = n(578), a = n(880), o = n(991), s = n(767), c = n(806), l = n(902), u = n(551).FDLayoutConstants, d = n(551).LayoutConstants, f = n(551).Point, p = n(551).PointD, m = n(551).DimensionD, h = n(551).Layout, g = n(551).Integer, _ = n(551).IGeometry, v = n(551).LGraph, y = n(551).Transform, b = n(551).LinkedList;
1684
- function x() {
1685
- r.call(this), this.toBeTiled = {}, this.constraints = {};
1686
- }
1687
- for (var S in x.prototype = Object.create(r.prototype), r) x[S] = r[S];
1688
- x.prototype.newGraphManager = function() {
1689
- var e = new i(this);
1690
- return this.graphManager = e, e;
1691
- }, x.prototype.newGraph = function(e) {
1692
- return new a(null, this.graphManager, e);
1693
- }, x.prototype.newNode = function(e) {
1694
- return new o(this.graphManager, e);
1695
- }, x.prototype.newEdge = function(e) {
1696
- return new s(null, null, e);
1697
- }, x.prototype.initParameters = function() {
1698
- r.prototype.initParameters.call(this, arguments), this.isSubLayout || (c.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = c.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = u.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = u.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = u.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
1699
- }, x.prototype.initSpringEmbedder = function() {
1700
- r.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / u.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = .04, this.coolingAdjuster = 1;
1701
- }, x.prototype.layout = function() {
1702
- return d.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1703
- }, x.prototype.classicLayout = function() {
1704
- if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), !this.incremental) {
1705
- var e = this.getFlatForest();
1706
- if (e.length > 0) this.positionNodesRadially(e);
1707
- else {
1708
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1709
- var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1710
- return t.has(e);
1711
- });
1712
- this.graphManager.setAllNodesToApplyGravitation(n), this.positionNodesRandomly();
1713
- }
1714
- } else if (c.TREE_REDUCTION_ON_INCREMENTAL) {
1715
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1716
- var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1717
- return t.has(e);
1718
- });
1719
- this.graphManager.setAllNodesToApplyGravitation(n);
1720
- }
1721
- return Object.keys(this.constraints).length > 0 && (l.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), c.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
1722
- }, x.prototype.tick = function() {
1723
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1724
- else return !0;
1725
- if (this.totalIterations % u.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1726
- if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1727
- else return !0;
1728
- this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - this.coolingCycle ** +(Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
1729
- }
1730
- if (this.isTreeGrowing) {
1731
- if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
1732
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1733
- var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
1734
- return e.has(t);
1735
- });
1736
- this.graphManager.setAllNodesToApplyGravitation(t), this.graphManager.updateBounds(), this.updateGrid(), c.PURE_INCREMENTAL ? this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1737
- } else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1738
- this.growTreeIterations++;
1739
- }
1740
- if (this.isGrowthFinished) {
1741
- if (this.isConverged()) return !0;
1742
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), c.PURE_INCREMENTAL ? this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1743
- }
1744
- var n = !this.isTreeGrowing && !this.isGrowthFinished, r = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1745
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(n, r), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1746
- }, x.prototype.getPositionsData = function() {
1747
- for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) {
1748
- var r = e[n].rect, i = e[n].id;
1749
- t[i] = {
1750
- id: i,
1751
- x: r.getCenterX(),
1752
- y: r.getCenterY(),
1753
- w: r.width,
1754
- h: r.height
1755
- };
1756
- }
1757
- return t;
1758
- }, x.prototype.runSpringEmbedder = function() {
1759
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1760
- var e = !1;
1761
- if (u.ANIMATE === "during") this.emit("layoutstarted");
1762
- else {
1763
- for (; !e;) e = this.tick();
1764
- this.graphManager.updateBounds();
1765
- }
1766
- }, x.prototype.moveNodes = function() {
1767
- for (var e = this.getAllNodes(), t, n = 0; n < e.length; n++) t = e[n], t.calculateDisplacement();
1768
- Object.keys(this.constraints).length > 0 && this.updateDisplacements();
1769
- for (var n = 0; n < e.length; n++) t = e[n], t.move();
1770
- }, x.prototype.initConstraintVariables = function() {
1771
- var e = this;
1772
- this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
1773
- for (var t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) {
1774
- var r = t[n];
1775
- this.idToNodeMap.set(r.id, r);
1776
- }
1777
- var i = function t(n) {
1778
- for (var r = n.getChild().getNodes(), i, a = 0, o = 0; o < r.length; o++) i = r[o], i.getChild() == null ? e.fixedNodeSet.has(i.id) && (a += 100) : a += t(i);
1779
- return a;
1780
- };
1781
- if (this.constraints.fixedNodeConstraint) {
1782
- this.constraints.fixedNodeConstraint.forEach(function(t) {
1783
- e.fixedNodeSet.add(t.nodeId);
1784
- });
1785
- for (var t = this.graphManager.getAllNodes(), r, n = 0; n < t.length; n++) if (r = t[n], r.getChild() != null) {
1786
- var a = i(r);
1787
- a > 0 && (r.fixedNodeWeight = a);
1788
- }
1789
- }
1790
- if (this.constraints.relativePlacementConstraint) {
1791
- var o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1792
- if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(t) {
1793
- e.fixedNodesOnHorizontal.add(t), e.fixedNodesOnVertical.add(t);
1794
- }), this.constraints.alignmentConstraint) {
1795
- if (this.constraints.alignmentConstraint.vertical) for (var l = this.constraints.alignmentConstraint.vertical, n = 0; n < l.length; n++) this.dummyToNodeForVerticalAlignment.set("dummy" + n, []), l[n].forEach(function(t) {
1796
- o.set(t, "dummy" + n), e.dummyToNodeForVerticalAlignment.get("dummy" + n).push(t), e.fixedNodeSet.has(t) && e.fixedNodesOnHorizontal.add("dummy" + n);
1797
- });
1798
- if (this.constraints.alignmentConstraint.horizontal) for (var u = this.constraints.alignmentConstraint.horizontal, n = 0; n < u.length; n++) this.dummyToNodeForHorizontalAlignment.set("dummy" + n, []), u[n].forEach(function(t) {
1799
- s.set(t, "dummy" + n), e.dummyToNodeForHorizontalAlignment.get("dummy" + n).push(t), e.fixedNodeSet.has(t) && e.fixedNodesOnVertical.add("dummy" + n);
1800
- });
1801
- }
1802
- if (c.RELAX_MOVEMENT_ON_CONSTRAINTS) this.shuffle = function(e) {
1803
- var t, n, r;
1804
- for (r = e.length - 1; r >= 2 * e.length / 3; r--) t = Math.floor(Math.random() * (r + 1)), n = e[r], e[r] = e[t], e[t] = n;
1805
- return e;
1806
- }, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(t) {
1807
- if (t.left) {
1808
- var n = o.has(t.left) ? o.get(t.left) : t.left, r = o.has(t.right) ? o.get(t.right) : t.right;
1809
- e.nodesInRelativeHorizontal.includes(n) || (e.nodesInRelativeHorizontal.push(n), e.nodeToRelativeConstraintMapHorizontal.set(n, []), e.dummyToNodeForVerticalAlignment.has(n) ? e.nodeToTempPositionMapHorizontal.set(n, e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()) : e.nodeToTempPositionMapHorizontal.set(n, e.idToNodeMap.get(n).getCenterX())), e.nodesInRelativeHorizontal.includes(r) || (e.nodesInRelativeHorizontal.push(r), e.nodeToRelativeConstraintMapHorizontal.set(r, []), e.dummyToNodeForVerticalAlignment.has(r) ? e.nodeToTempPositionMapHorizontal.set(r, e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()) : e.nodeToTempPositionMapHorizontal.set(r, e.idToNodeMap.get(r).getCenterX())), e.nodeToRelativeConstraintMapHorizontal.get(n).push({
1810
- right: r,
1811
- gap: t.gap
1812
- }), e.nodeToRelativeConstraintMapHorizontal.get(r).push({
1813
- left: n,
1814
- gap: t.gap
1815
- });
1816
- } else {
1817
- var i = s.has(t.top) ? s.get(t.top) : t.top, a = s.has(t.bottom) ? s.get(t.bottom) : t.bottom;
1818
- e.nodesInRelativeVertical.includes(i) || (e.nodesInRelativeVertical.push(i), e.nodeToRelativeConstraintMapVertical.set(i, []), e.dummyToNodeForHorizontalAlignment.has(i) ? e.nodeToTempPositionMapVertical.set(i, e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()) : e.nodeToTempPositionMapVertical.set(i, e.idToNodeMap.get(i).getCenterY())), e.nodesInRelativeVertical.includes(a) || (e.nodesInRelativeVertical.push(a), e.nodeToRelativeConstraintMapVertical.set(a, []), e.dummyToNodeForHorizontalAlignment.has(a) ? e.nodeToTempPositionMapVertical.set(a, e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()) : e.nodeToTempPositionMapVertical.set(a, e.idToNodeMap.get(a).getCenterY())), e.nodeToRelativeConstraintMapVertical.get(i).push({
1819
- bottom: a,
1820
- gap: t.gap
1821
- }), e.nodeToRelativeConstraintMapVertical.get(a).push({
1822
- top: i,
1823
- gap: t.gap
1824
- });
1825
- }
1826
- });
1827
- else {
1828
- var d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1829
- this.constraints.relativePlacementConstraint.forEach(function(e) {
1830
- if (e.left) {
1831
- var t = o.has(e.left) ? o.get(e.left) : e.left, n = o.has(e.right) ? o.get(e.right) : e.right;
1832
- d.has(t) ? d.get(t).push(n) : d.set(t, [n]), d.has(n) ? d.get(n).push(t) : d.set(n, [t]);
1833
- } else {
1834
- var r = s.has(e.top) ? s.get(e.top) : e.top, i = s.has(e.bottom) ? s.get(e.bottom) : e.bottom;
1835
- f.has(r) ? f.get(r).push(i) : f.set(r, [i]), f.has(i) ? f.get(i).push(r) : f.set(i, [r]);
1836
- }
1837
- });
1838
- var p = function(e, t) {
1839
- var n = [], r = [], i = new b(), a = /* @__PURE__ */ new Set(), o = 0;
1840
- return e.forEach(function(s, c) {
1841
- if (!a.has(c)) {
1842
- n[o] = [], r[o] = !1;
1843
- var l = c;
1844
- for (i.push(l), a.add(l), n[o].push(l); i.length != 0;) l = i.shift(), t.has(l) && (r[o] = !0), e.get(l).forEach(function(e) {
1845
- a.has(e) || (i.push(e), a.add(e), n[o].push(e));
1846
- });
1847
- o++;
1848
- }
1849
- }), {
1850
- components: n,
1851
- isFixed: r
1852
- };
1853
- }, m = p(d, e.fixedNodesOnHorizontal);
1854
- this.componentsOnHorizontal = m.components, this.fixedComponentsOnHorizontal = m.isFixed;
1855
- var h = p(f, e.fixedNodesOnVertical);
1856
- this.componentsOnVertical = h.components, this.fixedComponentsOnVertical = h.isFixed;
1857
- }
1858
- }
1859
- }, x.prototype.updateDisplacements = function() {
1860
- var e = this;
1861
- if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(t) {
1862
- var n = e.idToNodeMap.get(t.nodeId);
1863
- n.displacementX = 0, n.displacementY = 0;
1864
- }), this.constraints.alignmentConstraint) {
1865
- if (this.constraints.alignmentConstraint.vertical) for (var t = this.constraints.alignmentConstraint.vertical, n = 0; n < t.length; n++) {
1866
- for (var r = 0, i = 0; i < t[n].length; i++) {
1867
- if (this.fixedNodeSet.has(t[n][i])) {
1868
- r = 0;
1869
- break;
1870
- }
1871
- r += this.idToNodeMap.get(t[n][i]).displacementX;
1872
- }
1873
- for (var a = r / t[n].length, i = 0; i < t[n].length; i++) this.idToNodeMap.get(t[n][i]).displacementX = a;
1874
- }
1875
- if (this.constraints.alignmentConstraint.horizontal) for (var o = this.constraints.alignmentConstraint.horizontal, n = 0; n < o.length; n++) {
1876
- for (var s = 0, i = 0; i < o[n].length; i++) {
1877
- if (this.fixedNodeSet.has(o[n][i])) {
1878
- s = 0;
1879
- break;
1880
- }
1881
- s += this.idToNodeMap.get(o[n][i]).displacementY;
1882
- }
1883
- for (var l = s / o[n].length, i = 0; i < o[n].length; i++) this.idToNodeMap.get(o[n][i]).displacementY = l;
1884
- }
1885
- }
1886
- if (this.constraints.relativePlacementConstraint) if (c.RELAX_MOVEMENT_ON_CONSTRAINTS) this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(t) {
1887
- if (!e.fixedNodesOnHorizontal.has(t)) {
1888
- var n = 0;
1889
- n = e.dummyToNodeForVerticalAlignment.has(t) ? e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(t)[0]).displacementX : e.idToNodeMap.get(t).displacementX, e.nodeToRelativeConstraintMapHorizontal.get(t).forEach(function(r) {
1890
- if (r.right) {
1891
- var i = e.nodeToTempPositionMapHorizontal.get(r.right) - e.nodeToTempPositionMapHorizontal.get(t) - n;
1892
- i < r.gap && (n -= r.gap - i);
1893
- } else {
1894
- var i = e.nodeToTempPositionMapHorizontal.get(t) - e.nodeToTempPositionMapHorizontal.get(r.left) + n;
1895
- i < r.gap && (n += r.gap - i);
1896
- }
1897
- }), e.nodeToTempPositionMapHorizontal.set(t, e.nodeToTempPositionMapHorizontal.get(t) + n), e.dummyToNodeForVerticalAlignment.has(t) ? e.dummyToNodeForVerticalAlignment.get(t).forEach(function(t) {
1898
- e.idToNodeMap.get(t).displacementX = n;
1899
- }) : e.idToNodeMap.get(t).displacementX = n;
1900
- }
1901
- }), this.nodesInRelativeVertical.forEach(function(t) {
1902
- if (!e.fixedNodesOnHorizontal.has(t)) {
1903
- var n = 0;
1904
- n = e.dummyToNodeForHorizontalAlignment.has(t) ? e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(t)[0]).displacementY : e.idToNodeMap.get(t).displacementY, e.nodeToRelativeConstraintMapVertical.get(t).forEach(function(r) {
1905
- if (r.bottom) {
1906
- var i = e.nodeToTempPositionMapVertical.get(r.bottom) - e.nodeToTempPositionMapVertical.get(t) - n;
1907
- i < r.gap && (n -= r.gap - i);
1908
- } else {
1909
- var i = e.nodeToTempPositionMapVertical.get(t) - e.nodeToTempPositionMapVertical.get(r.top) + n;
1910
- i < r.gap && (n += r.gap - i);
1911
- }
1912
- }), e.nodeToTempPositionMapVertical.set(t, e.nodeToTempPositionMapVertical.get(t) + n), e.dummyToNodeForHorizontalAlignment.has(t) ? e.dummyToNodeForHorizontalAlignment.get(t).forEach(function(t) {
1913
- e.idToNodeMap.get(t).displacementY = n;
1914
- }) : e.idToNodeMap.get(t).displacementY = n;
1915
- }
1916
- });
1917
- else {
1918
- for (var n = 0; n < this.componentsOnHorizontal.length; n++) {
1919
- var u = this.componentsOnHorizontal[n];
1920
- if (this.fixedComponentsOnHorizontal[n]) for (var i = 0; i < u.length; i++) this.dummyToNodeForVerticalAlignment.has(u[i]) ? this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t) {
1921
- e.idToNodeMap.get(t).displacementX = 0;
1922
- }) : this.idToNodeMap.get(u[i]).displacementX = 0;
1923
- else {
1924
- for (var d = 0, f = 0, i = 0; i < u.length; i++) if (this.dummyToNodeForVerticalAlignment.has(u[i])) {
1925
- var p = this.dummyToNodeForVerticalAlignment.get(u[i]);
1926
- d += p.length * this.idToNodeMap.get(p[0]).displacementX, f += p.length;
1927
- } else d += this.idToNodeMap.get(u[i]).displacementX, f++;
1928
- for (var m = d / f, i = 0; i < u.length; i++) this.dummyToNodeForVerticalAlignment.has(u[i]) ? this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t) {
1929
- e.idToNodeMap.get(t).displacementX = m;
1930
- }) : this.idToNodeMap.get(u[i]).displacementX = m;
1931
- }
1932
- }
1933
- for (var n = 0; n < this.componentsOnVertical.length; n++) {
1934
- var u = this.componentsOnVertical[n];
1935
- if (this.fixedComponentsOnVertical[n]) for (var i = 0; i < u.length; i++) this.dummyToNodeForHorizontalAlignment.has(u[i]) ? this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t) {
1936
- e.idToNodeMap.get(t).displacementY = 0;
1937
- }) : this.idToNodeMap.get(u[i]).displacementY = 0;
1938
- else {
1939
- for (var d = 0, f = 0, i = 0; i < u.length; i++) if (this.dummyToNodeForHorizontalAlignment.has(u[i])) {
1940
- var p = this.dummyToNodeForHorizontalAlignment.get(u[i]);
1941
- d += p.length * this.idToNodeMap.get(p[0]).displacementY, f += p.length;
1942
- } else d += this.idToNodeMap.get(u[i]).displacementY, f++;
1943
- for (var m = d / f, i = 0; i < u.length; i++) this.dummyToNodeForHorizontalAlignment.has(u[i]) ? this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t) {
1944
- e.idToNodeMap.get(t).displacementY = m;
1945
- }) : this.idToNodeMap.get(u[i]).displacementY = m;
1946
- }
1947
- }
1948
- }
1949
- }, x.prototype.calculateNodesToApplyGravitationTo = function() {
1950
- var e = [], t, n = this.graphManager.getGraphs(), r = n.length, i;
1951
- for (i = 0; i < r; i++) t = n[i], t.updateConnected(), t.isConnected || (e = e.concat(t.getNodes()));
1952
- return e;
1953
- }, x.prototype.createBendpoints = function() {
1954
- var e = [];
1955
- e = e.concat(this.graphManager.getAllEdges());
1956
- var t = /* @__PURE__ */ new Set(), n;
1957
- for (n = 0; n < e.length; n++) {
1958
- var r = e[n];
1959
- if (!t.has(r)) {
1960
- var i = r.getSource(), a = r.getTarget();
1961
- if (i == a) r.getBendpoints().push(new p()), r.getBendpoints().push(new p()), this.createDummyNodesForBendpoints(r), t.add(r);
1962
- else {
1963
- var o = [];
1964
- if (o = o.concat(i.getEdgeListToNode(a)), o = o.concat(a.getEdgeListToNode(i)), !t.has(o[0])) {
1965
- if (o.length > 1) {
1966
- var s;
1967
- for (s = 0; s < o.length; s++) {
1968
- var c = o[s];
1969
- c.getBendpoints().push(new p()), this.createDummyNodesForBendpoints(c);
1970
- }
1971
- }
1972
- o.forEach(function(e) {
1973
- t.add(e);
1974
- });
1975
- }
1976
- }
1977
- }
1978
- if (t.size == e.length) break;
1979
- }
1980
- }, x.prototype.positionNodesRadially = function(e) {
1981
- for (var t = new f(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new p(0, 0), s = 0; s < e.length; s++) {
1982
- s % n == 0 && (a = 0, i = r, s != 0 && (i += c.DEFAULT_COMPONENT_SEPERATION), r = 0);
1983
- var l = e[s], u = h.findCenterOfTree(l);
1984
- t.x = a, t.y = i, o = x.radialLayout(l, u, t), o.y > r && (r = Math.floor(o.y)), a = Math.floor(o.x + c.DEFAULT_COMPONENT_SEPERATION);
1985
- }
1986
- this.transform(new p(d.WORLD_CENTER_X - o.x / 2, d.WORLD_CENTER_Y - o.y / 2));
1987
- }, x.radialLayout = function(e, t, n) {
1988
- var r = Math.max(this.maxDiagonalInTree(e), c.DEFAULT_RADIAL_SEPARATION);
1989
- x.branchRadialLayout(t, null, 0, 359, 0, r);
1990
- var i = v.calculateBounds(e), a = new y();
1991
- a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y);
1992
- for (var o = 0; o < e.length; o++) e[o].transform(a);
1993
- var s = new p(i.getMaxX(), i.getMaxY());
1994
- return a.inverseTransformPoint(s);
1995
- }, x.branchRadialLayout = function(e, t, n, r, i, a) {
1996
- var o = (r - n + 1) / 2;
1997
- o < 0 && (o += 180);
1998
- var s = (o + n) % 360 * _.TWO_PI / 360, c = i * Math.cos(s), l = i * Math.sin(s);
1999
- e.setCenter(c, l);
2000
- var u = [];
2001
- u = u.concat(e.getEdges());
2002
- var d = u.length;
2003
- t != null && d--;
2004
- for (var f = 0, p = u.length, m, h = e.getEdgesBetween(t); h.length > 1;) {
2005
- var g = h[0];
2006
- h.splice(0, 1);
2007
- var v = u.indexOf(g);
2008
- v >= 0 && u.splice(v, 1), p--, d--;
2009
- }
2010
- m = t == null ? 0 : (u.indexOf(h[0]) + 1) % p;
2011
- for (var y = Math.abs(r - n) / d, b = m; f != d; b = ++b % p) {
2012
- var S = u[b].getOtherEnd(e);
2013
- if (S != t) {
2014
- var C = (n + f * y) % 360, w = (C + y) % 360;
2015
- x.branchRadialLayout(S, e, C, w, i + a, a), f++;
2016
- }
2017
- }
2018
- }, x.maxDiagonalInTree = function(e) {
2019
- for (var t = g.MIN_VALUE, n = 0; n < e.length; n++) {
2020
- var r = e[n].getDiagonal();
2021
- r > t && (t = r);
2022
- }
2023
- return t;
2024
- }, x.prototype.calcRepulsionRange = function() {
2025
- return 2 * (this.level + 1) * this.idealEdgeLength;
2026
- }, x.prototype.groupZeroDegreeMembers = function() {
2027
- var e = this, t = {};
2028
- this.memberGroups = {}, this.idToDummyNode = {};
2029
- for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) {
2030
- var a = r[i], s = a.getParent();
2031
- this.getNodeDegreeWithChildren(a) === 0 && (s.id == null || !this.getToBeTiled(s)) && n.push(a);
2032
- }
2033
- for (var i = 0; i < n.length; i++) {
2034
- var a = n[i], c = a.getParent().id;
2035
- t[c] === void 0 && (t[c] = []), t[c] = t[c].concat(a);
2036
- }
2037
- Object.keys(t).forEach(function(n) {
2038
- if (t[n].length > 1) {
2039
- var r = "DummyCompound_" + n;
2040
- e.memberGroups[r] = t[n];
2041
- var i = t[n][0].getParent(), a = new o(e.graphManager);
2042
- a.id = r, a.paddingLeft = i.paddingLeft || 0, a.paddingRight = i.paddingRight || 0, a.paddingBottom = i.paddingBottom || 0, a.paddingTop = i.paddingTop || 0, e.idToDummyNode[r] = a;
2043
- var s = e.getGraphManager().add(e.newGraph(), a), c = i.getChild();
2044
- c.add(a);
2045
- for (var l = 0; l < t[n].length; l++) {
2046
- var u = t[n][l];
2047
- c.remove(u), s.add(u);
2048
- }
2049
- }
2050
- });
2051
- }, x.prototype.clearCompounds = function() {
2052
- var e = {}, t = {};
2053
- this.performDFSOnCompounds();
2054
- for (var n = 0; n < this.compoundOrder.length; n++) t[this.compoundOrder[n].id] = this.compoundOrder[n], e[this.compoundOrder[n].id] = [].concat(this.compoundOrder[n].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[n].getChild()), this.compoundOrder[n].child = null;
2055
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t);
2056
- }, x.prototype.clearZeroDegreeMembers = function() {
2057
- var e = this, t = this.tiledZeroDegreePack = [];
2058
- Object.keys(this.memberGroups).forEach(function(n) {
2059
- var r = e.idToDummyNode[n];
2060
- if (t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight), r.rect.width = t[n].width, r.rect.height = t[n].height, r.setCenter(t[n].centerX, t[n].centerY), r.labelMarginLeft = 0, r.labelMarginTop = 0, c.NODE_DIMENSIONS_INCLUDE_LABELS) {
2061
- var i = r.rect.width, a = r.rect.height;
2062
- r.labelWidth && (r.labelPosHorizontal == "left" ? (r.rect.x -= r.labelWidth, r.setWidth(i + r.labelWidth), r.labelMarginLeft = r.labelWidth) : r.labelPosHorizontal == "center" && r.labelWidth > i ? (r.rect.x -= (r.labelWidth - i) / 2, r.setWidth(r.labelWidth), r.labelMarginLeft = (r.labelWidth - i) / 2) : r.labelPosHorizontal == "right" && r.setWidth(i + r.labelWidth)), r.labelHeight && (r.labelPosVertical == "top" ? (r.rect.y -= r.labelHeight, r.setHeight(a + r.labelHeight), r.labelMarginTop = r.labelHeight) : r.labelPosVertical == "center" && r.labelHeight > a ? (r.rect.y -= (r.labelHeight - a) / 2, r.setHeight(r.labelHeight), r.labelMarginTop = (r.labelHeight - a) / 2) : r.labelPosVertical == "bottom" && r.setHeight(a + r.labelHeight));
2063
- }
2064
- });
2065
- }, x.prototype.repopulateCompounds = function() {
2066
- for (var e = this.compoundOrder.length - 1; e >= 0; e--) {
2067
- var t = this.compoundOrder[e], n = t.id, r = t.paddingLeft, i = t.paddingTop, a = t.labelMarginLeft, o = t.labelMarginTop;
2068
- this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i, a, o);
2069
- }
2070
- }, x.prototype.repopulateZeroDegreeMembers = function() {
2071
- var e = this, t = this.tiledZeroDegreePack;
2072
- Object.keys(t).forEach(function(n) {
2073
- var r = e.idToDummyNode[n], i = r.paddingLeft, a = r.paddingTop, o = r.labelMarginLeft, s = r.labelMarginTop;
2074
- e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a, o, s);
2075
- });
2076
- }, x.prototype.getToBeTiled = function(e) {
2077
- var t = e.id;
2078
- if (this.toBeTiled[t] != null) return this.toBeTiled[t];
2079
- var n = e.getChild();
2080
- if (n == null) return this.toBeTiled[t] = !1, !1;
2081
- for (var r = n.getNodes(), i = 0; i < r.length; i++) {
2082
- var a = r[i];
2083
- if (this.getNodeDegree(a) > 0) return this.toBeTiled[t] = !1, !1;
2084
- if (a.getChild() == null) {
2085
- this.toBeTiled[a.id] = !1;
2086
- continue;
2087
- }
2088
- if (!this.getToBeTiled(a)) return this.toBeTiled[t] = !1, !1;
2089
- }
2090
- return this.toBeTiled[t] = !0, !0;
2091
- }, x.prototype.getNodeDegree = function(e) {
2092
- e.id;
2093
- for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) {
2094
- var i = t[r];
2095
- i.getSource().id !== i.getTarget().id && (n += 1);
2096
- }
2097
- return n;
2098
- }, x.prototype.getNodeDegreeWithChildren = function(e) {
2099
- var t = this.getNodeDegree(e);
2100
- if (e.getChild() == null) return t;
2101
- for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) {
2102
- var i = n[r];
2103
- t += this.getNodeDegreeWithChildren(i);
2104
- }
2105
- return t;
2106
- }, x.prototype.performDFSOnCompounds = function() {
2107
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2108
- }, x.prototype.fillCompexOrderByDFS = function(e) {
2109
- for (var t = 0; t < e.length; t++) {
2110
- var n = e[t];
2111
- n.getChild() != null && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n);
2112
- }
2113
- }, x.prototype.adjustLocations = function(e, t, n, r, i, a, o) {
2114
- t += r + a, n += i + o;
2115
- for (var s = t, c = 0; c < e.rows.length; c++) {
2116
- var l = e.rows[c];
2117
- t = s;
2118
- for (var u = 0, d = 0; d < l.length; d++) {
2119
- var f = l[d];
2120
- f.rect.x = t, f.rect.y = n, t += f.rect.width + e.horizontalPadding, f.rect.height > u && (u = f.rect.height);
2121
- }
2122
- n += u + e.verticalPadding;
2123
- }
2124
- }, x.prototype.tileCompoundMembers = function(e, t) {
2125
- var n = this;
2126
- this.tiledMemberPack = [], Object.keys(e).forEach(function(r) {
2127
- var i = t[r];
2128
- if (n.tiledMemberPack[r] = n.tileNodes(e[r], i.paddingLeft + i.paddingRight), i.rect.width = n.tiledMemberPack[r].width, i.rect.height = n.tiledMemberPack[r].height, i.setCenter(n.tiledMemberPack[r].centerX, n.tiledMemberPack[r].centerY), i.labelMarginLeft = 0, i.labelMarginTop = 0, c.NODE_DIMENSIONS_INCLUDE_LABELS) {
2129
- var a = i.rect.width, o = i.rect.height;
2130
- i.labelWidth && (i.labelPosHorizontal == "left" ? (i.rect.x -= i.labelWidth, i.setWidth(a + i.labelWidth), i.labelMarginLeft = i.labelWidth) : i.labelPosHorizontal == "center" && i.labelWidth > a ? (i.rect.x -= (i.labelWidth - a) / 2, i.setWidth(i.labelWidth), i.labelMarginLeft = (i.labelWidth - a) / 2) : i.labelPosHorizontal == "right" && i.setWidth(a + i.labelWidth)), i.labelHeight && (i.labelPosVertical == "top" ? (i.rect.y -= i.labelHeight, i.setHeight(o + i.labelHeight), i.labelMarginTop = i.labelHeight) : i.labelPosVertical == "center" && i.labelHeight > o ? (i.rect.y -= (i.labelHeight - o) / 2, i.setHeight(i.labelHeight), i.labelMarginTop = (i.labelHeight - o) / 2) : i.labelPosVertical == "bottom" && i.setHeight(o + i.labelHeight));
2131
- }
2132
- });
2133
- }, x.prototype.tileNodes = function(e, t) {
2134
- var n = this.tileNodesByFavoringDim(e, t, !0), r = this.tileNodesByFavoringDim(e, t, !1), i = this.getOrgRatio(n);
2135
- return this.getOrgRatio(r) < i ? r : n;
2136
- }, x.prototype.getOrgRatio = function(e) {
2137
- var t = e.width / e.height;
2138
- return t < 1 && (t = 1 / t), t;
2139
- }, x.prototype.calcIdealRowWidth = function(e, t) {
2140
- var n = c.TILING_PADDING_VERTICAL, r = c.TILING_PADDING_HORIZONTAL, i = e.length, a = 0, o = 0, s = 0;
2141
- e.forEach(function(e) {
2142
- a += e.getWidth(), o += e.getHeight(), e.getWidth() > s && (s = e.getWidth());
2143
- });
2144
- var l = a / i, u = o / i, d = (n - r) ** 2 + 4 * (l + r) * (u + n) * i, f = (r - n + Math.sqrt(d)) / (2 * (l + r)), p;
2145
- t ? (p = Math.ceil(f), p == f && p++) : p = Math.floor(f);
2146
- var m = p * (l + r) - r;
2147
- return s > m && (m = s), m += r * 2, m;
2148
- }, x.prototype.tileNodesByFavoringDim = function(e, t, n) {
2149
- var r = c.TILING_PADDING_VERTICAL, i = c.TILING_PADDING_HORIZONTAL, a = c.TILING_COMPARE_BY, o = {
2150
- rows: [],
2151
- rowWidth: [],
2152
- rowHeight: [],
2153
- width: 0,
2154
- height: t,
2155
- verticalPadding: r,
2156
- horizontalPadding: i,
2157
- centerX: 0,
2158
- centerY: 0
2159
- };
2160
- a && (o.idealRowWidth = this.calcIdealRowWidth(e, n));
2161
- var s = function(e) {
2162
- return e.rect.width * e.rect.height;
2163
- }, l = function(e, t) {
2164
- return s(t) - s(e);
2165
- };
2166
- e.sort(function(e, t) {
2167
- var n = l;
2168
- return o.idealRowWidth ? (n = a, n(e.id, t.id)) : n(e, t);
2169
- });
2170
- for (var u = 0, d = 0, f = 0; f < e.length; f++) {
2171
- var p = e[f];
2172
- u += p.getCenterX(), d += p.getCenterY();
2173
- }
2174
- o.centerX = u / e.length, o.centerY = d / e.length;
2175
- for (var f = 0; f < e.length; f++) {
2176
- var p = e[f];
2177
- if (o.rows.length == 0) this.insertNodeToRow(o, p, 0, t);
2178
- else if (this.canAddHorizontal(o, p.rect.width, p.rect.height)) {
2179
- var m = o.rows.length - 1;
2180
- o.idealRowWidth || (m = this.getShortestRowIndex(o)), this.insertNodeToRow(o, p, m, t);
2181
- } else this.insertNodeToRow(o, p, o.rows.length, t);
2182
- this.shiftToLastRow(o);
2183
- }
2184
- return o;
2185
- }, x.prototype.insertNodeToRow = function(e, t, n, r) {
2186
- var i = r;
2187
- n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0));
2188
- var a = e.rowWidth[n] + t.rect.width;
2189
- e.rows[n].length > 0 && (a += e.horizontalPadding), e.rowWidth[n] = a, e.width < a && (e.width = a);
2190
- var o = t.rect.height;
2191
- n > 0 && (o += e.verticalPadding);
2192
- var s = 0;
2193
- o > e.rowHeight[n] && (s = e.rowHeight[n], e.rowHeight[n] = o, s = e.rowHeight[n] - s), e.height += s, e.rows[n].push(t);
2194
- }, x.prototype.getShortestRowIndex = function(e) {
2195
- for (var t = -1, n = Number.MAX_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] < n && (t = r, n = e.rowWidth[r]);
2196
- return t;
2197
- }, x.prototype.getLongestRowIndex = function(e) {
2198
- for (var t = -1, n = Number.MIN_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] > n && (t = r, n = e.rowWidth[r]);
2199
- return t;
2200
- }, x.prototype.canAddHorizontal = function(e, t, n) {
2201
- if (e.idealRowWidth) {
2202
- var r = e.rows.length - 1;
2203
- return e.rowWidth[r] + t + e.horizontalPadding <= e.idealRowWidth;
2204
- }
2205
- var i = this.getShortestRowIndex(e);
2206
- if (i < 0) return !0;
2207
- var a = e.rowWidth[i];
2208
- if (a + e.horizontalPadding + t <= e.width) return !0;
2209
- var o = 0;
2210
- e.rowHeight[i] < n && i > 0 && (o = n + e.verticalPadding - e.rowHeight[i]);
2211
- var s = e.width - a >= t + e.horizontalPadding ? (e.height + o) / (a + t + e.horizontalPadding) : (e.height + o) / e.width;
2212
- o = n + e.verticalPadding;
2213
- var c = e.width < t ? (e.height + o) / t : (e.height + o) / e.width;
2214
- return c < 1 && (c = 1 / c), s < 1 && (s = 1 / s), s < c;
2215
- }, x.prototype.shiftToLastRow = function(e) {
2216
- var t = this.getLongestRowIndex(e), n = e.rowWidth.length - 1, r = e.rows[t], i = r[r.length - 1], a = i.width + e.horizontalPadding;
2217
- if (e.width - e.rowWidth[n] > a && t != n) {
2218
- r.splice(-1, 1), e.rows[n].push(i), e.rowWidth[t] = e.rowWidth[t] - a, e.rowWidth[n] = e.rowWidth[n] + a, e.width = e.rowWidth[instance.getLongestRowIndex(e)];
2219
- for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height);
2220
- t > 0 && (o += e.verticalPadding);
2221
- var c = e.rowHeight[t] + e.rowHeight[n];
2222
- e.rowHeight[t] = o, e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding);
2223
- var l = e.rowHeight[t] + e.rowHeight[n];
2224
- e.height += l - c, this.shiftToLastRow(e);
2225
- }
2226
- }, x.prototype.tilingPreLayout = function() {
2227
- c.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2228
- }, x.prototype.tilingPostLayout = function() {
2229
- c.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2230
- }, x.prototype.reduceTrees = function() {
2231
- for (var e = [], t = !0, n; t;) {
2232
- var r = this.graphManager.getAllNodes(), i = [];
2233
- t = !1;
2234
- for (var a = 0; a < r.length; a++) if (n = r[a], n.getEdges().length == 1 && !n.getEdges()[0].isInterGraph && n.getChild() == null) {
2235
- if (c.PURE_INCREMENTAL) {
2236
- var o = n.getEdges()[0].getOtherEnd(n), s = new m(n.getCenterX() - o.getCenterX(), n.getCenterY() - o.getCenterY());
2237
- i.push([
2238
- n,
2239
- n.getEdges()[0],
2240
- n.getOwner(),
2241
- s
2242
- ]);
2243
- } else i.push([
2244
- n,
2245
- n.getEdges()[0],
2246
- n.getOwner()
2247
- ]);
2248
- t = !0;
2249
- }
2250
- if (t == 1) {
2251
- for (var l = [], u = 0; u < i.length; u++) i[u][0].getEdges().length == 1 && (l.push(i[u]), i[u][0].getOwner().remove(i[u][0]));
2252
- e.push(l), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2253
- }
2254
- }
2255
- this.prunedNodesAll = e;
2256
- }, x.prototype.growTree = function(e) {
2257
- for (var t = e[e.length - 1], n, r = 0; r < t.length; r++) n = t[r], this.findPlaceforPrunedNode(n), n[2].add(n[0]), n[2].add(n[1], n[1].source, n[1].target);
2258
- e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2259
- }, x.prototype.findPlaceforPrunedNode = function(e) {
2260
- var t, n, r = e[0];
2261
- if (n = r == e[1].source ? e[1].target : e[1].source, c.PURE_INCREMENTAL) r.setCenter(n.getCenterX() + e[3].getWidth(), n.getCenterY() + e[3].getHeight());
2262
- else {
2263
- var i = n.startX, a = n.finishX, o = n.startY, s = n.finishY, l = [
2264
- 0,
2265
- 0,
2266
- 0,
2267
- 0
2268
- ];
2269
- if (o > 0) for (var d = i; d <= a; d++) l[0] += this.grid[d][o - 1].length + this.grid[d][o].length - 1;
2270
- if (a < this.grid.length - 1) for (var d = o; d <= s; d++) l[1] += this.grid[a + 1][d].length + this.grid[a][d].length - 1;
2271
- if (s < this.grid[0].length - 1) for (var d = i; d <= a; d++) l[2] += this.grid[d][s + 1].length + this.grid[d][s].length - 1;
2272
- if (i > 0) for (var d = o; d <= s; d++) l[3] += this.grid[i - 1][d].length + this.grid[i][d].length - 1;
2273
- for (var f = g.MAX_VALUE, p, m, h = 0; h < l.length; h++) l[h] < f ? (f = l[h], p = 1, m = h) : l[h] == f && p++;
2274
- if (p == 3 && f == 0) l[0] == 0 && l[1] == 0 && l[2] == 0 ? t = 1 : l[0] == 0 && l[1] == 0 && l[3] == 0 ? t = 0 : l[0] == 0 && l[2] == 0 && l[3] == 0 ? t = 3 : l[1] == 0 && l[2] == 0 && l[3] == 0 && (t = 2);
2275
- else if (p == 2 && f == 0) {
2276
- var _ = Math.floor(Math.random() * 2);
2277
- t = l[0] == 0 && l[1] == 0 ? _ == 0 ? 0 : 1 : l[0] == 0 && l[2] == 0 ? _ == 0 ? 0 : 2 : l[0] == 0 && l[3] == 0 ? _ == 0 ? 0 : 3 : l[1] == 0 && l[2] == 0 ? _ == 0 ? 1 : 2 : l[1] == 0 && l[3] == 0 ? _ == 0 ? 1 : 3 : _ == 0 ? 2 : 3;
2278
- } else if (p == 4 && f == 0) {
2279
- var _ = Math.floor(Math.random() * 4);
2280
- t = _;
2281
- } else t = m;
2282
- t == 0 ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - u.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) : t == 1 ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + u.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) : t == 2 ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + u.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) : r.setCenter(n.getCenterX() - n.getWidth() / 2 - u.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY());
2283
- }
2284
- }, e.exports = x;
2285
- }),
2286
- 991: ((e, t, n) => {
2287
- var r = n(551).FDLayoutNode, i = n(551).IMath;
2288
- function a(e, t, n, i) {
2289
- r.call(this, e, t, n, i);
2290
- }
2291
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
2292
- a.prototype.calculateDisplacement = function() {
2293
- var e = this.graphManager.getLayout();
2294
- this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2295
- }, a.prototype.propogateDisplacementToChildren = function(e, t) {
2296
- for (var n = this.getChild().getNodes(), r, i = 0; i < n.length; i++) r = n[i], r.getChild() == null ? (r.displacementX += e, r.displacementY += t) : r.propogateDisplacementToChildren(e, t);
2297
- }, a.prototype.move = function() {
2298
- var e = this.graphManager.getLayout();
2299
- (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), e.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY)), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
2300
- }, a.prototype.setPred1 = function(e) {
2301
- this.pred1 = e;
2302
- }, a.prototype.getPred1 = function() {
2303
- return pred1;
2304
- }, a.prototype.getPred2 = function() {
2305
- return pred2;
2306
- }, a.prototype.setNext = function(e) {
2307
- this.next = e;
2308
- }, a.prototype.getNext = function() {
2309
- return next;
2310
- }, a.prototype.setProcessed = function(e) {
2311
- this.processed = e;
2312
- }, a.prototype.isProcessed = function() {
2313
- return processed;
2314
- }, e.exports = a;
2315
- }),
2316
- 902: ((e, t, n) => {
2317
- function r(e) {
2318
- if (Array.isArray(e)) {
2319
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
2320
- return n;
2321
- } else return Array.from(e);
2322
- }
2323
- var i = n(806), a = n(551).LinkedList, o = n(551).Matrix, s = n(551).SVD;
2324
- function c() {}
2325
- c.handleConstraints = function(e) {
2326
- var t = {};
2327
- t.fixedNodeConstraint = e.constraints.fixedNodeConstraint, t.alignmentConstraint = e.constraints.alignmentConstraint, t.relativePlacementConstraint = e.constraints.relativePlacementConstraint;
2328
- for (var n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = [], u = [], d = e.getAllNodes(), f = 0, p = 0; p < d.length; p++) {
2329
- var m = d[p];
2330
- m.getChild() ?? (c.set(m.id, f++), l.push(m.getCenterX()), u.push(m.getCenterY()), n.set(m.id, m));
2331
- }
2332
- t.relativePlacementConstraint && t.relativePlacementConstraint.forEach(function(e) {
2333
- !e.gap && e.gap != 0 && (e.left ? e.gap = i.DEFAULT_EDGE_LENGTH + n.get(e.left).getWidth() / 2 + n.get(e.right).getWidth() / 2 : e.gap = i.DEFAULT_EDGE_LENGTH + n.get(e.top).getHeight() / 2 + n.get(e.bottom).getHeight() / 2);
2334
- });
2335
- var h = function(e, t) {
2336
- return {
2337
- x: e.x - t.x,
2338
- y: e.y - t.y
2339
- };
2340
- }, g = function(e) {
2341
- var t = 0, n = 0;
2342
- return e.forEach(function(e) {
2343
- t += l[c.get(e)], n += u[c.get(e)];
2344
- }), {
2345
- x: t / e.size,
2346
- y: n / e.size
2347
- };
2348
- }, _ = function(e, t, n, i, o) {
2349
- function s(e, t) {
2350
- var n = new Set(e), r = !0, i = !1, a = void 0;
2351
- try {
2352
- for (var o = t[Symbol.iterator](), s; !(r = (s = o.next()).done); r = !0) {
2353
- var c = s.value;
2354
- n.add(c);
2355
- }
2356
- } catch (e) {
2357
- i = !0, a = e;
2358
- } finally {
2359
- try {
2360
- !r && o.return && o.return();
2361
- } finally {
2362
- if (i) throw a;
2363
- }
2364
- }
2365
- return n;
2366
- }
2367
- var d = /* @__PURE__ */ new Map();
2368
- e.forEach(function(e, t) {
2369
- d.set(t, 0);
2370
- }), e.forEach(function(e, t) {
2371
- e.forEach(function(e) {
2372
- d.set(e.id, d.get(e.id) + 1);
2373
- });
2374
- });
2375
- var f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = new a();
2376
- d.forEach(function(e, r) {
2377
- e == 0 ? (m.push(r), n || (t == "horizontal" ? f.set(r, c.has(r) ? l[c.get(r)] : i.get(r)) : f.set(r, c.has(r) ? u[c.get(r)] : i.get(r)))) : f.set(r, -Infinity), n && p.set(r, new Set([r]));
2378
- }), n && o.forEach(function(e) {
2379
- var r = [];
2380
- if (e.forEach(function(e) {
2381
- n.has(e) && r.push(e);
2382
- }), r.length > 0) {
2383
- var a = 0;
2384
- r.forEach(function(e) {
2385
- t == "horizontal" ? (f.set(e, c.has(e) ? l[c.get(e)] : i.get(e)), a += f.get(e)) : (f.set(e, c.has(e) ? u[c.get(e)] : i.get(e)), a += f.get(e));
2386
- }), a /= r.length, e.forEach(function(e) {
2387
- n.has(e) || f.set(e, a);
2388
- });
2389
- } else {
2390
- var o = 0;
2391
- e.forEach(function(e) {
2392
- t == "horizontal" ? o += c.has(e) ? l[c.get(e)] : i.get(e) : o += c.has(e) ? u[c.get(e)] : i.get(e);
2393
- }), o /= e.length, e.forEach(function(e) {
2394
- f.set(e, o);
2395
- });
2396
- }
2397
- });
2398
- for (var h = function() {
2399
- var r = m.shift();
2400
- e.get(r).forEach(function(e) {
2401
- if (f.get(e.id) < f.get(r) + e.gap) if (n && n.has(e.id)) {
2402
- var a = void 0;
2403
- if (a = t == "horizontal" ? c.has(e.id) ? l[c.get(e.id)] : i.get(e.id) : c.has(e.id) ? u[c.get(e.id)] : i.get(e.id), f.set(e.id, a), a < f.get(r) + e.gap) {
2404
- var o = f.get(r) + e.gap - a;
2405
- p.get(r).forEach(function(e) {
2406
- f.set(e, f.get(e) - o);
2407
- });
2408
- }
2409
- } else f.set(e.id, f.get(r) + e.gap);
2410
- d.set(e.id, d.get(e.id) - 1), d.get(e.id) == 0 && m.push(e.id), n && p.set(e.id, s(p.get(r), p.get(e.id)));
2411
- });
2412
- }; m.length != 0;) h();
2413
- if (n) {
2414
- var g = /* @__PURE__ */ new Set();
2415
- e.forEach(function(e, t) {
2416
- e.length == 0 && g.add(t);
2417
- });
2418
- var _ = [];
2419
- p.forEach(function(e, t) {
2420
- if (g.has(t)) {
2421
- var i = !1, a = !0, o = !1, s = void 0;
2422
- try {
2423
- for (var c = e[Symbol.iterator](), l; !(a = (l = c.next()).done); a = !0) {
2424
- var u = l.value;
2425
- n.has(u) && (i = !0);
2426
- }
2427
- } catch (e) {
2428
- o = !0, s = e;
2429
- } finally {
2430
- try {
2431
- !a && c.return && c.return();
2432
- } finally {
2433
- if (o) throw s;
2434
- }
2435
- }
2436
- if (!i) {
2437
- var d = !1, f = void 0;
2438
- _.forEach(function(t, n) {
2439
- t.has([].concat(r(e))[0]) && (d = !0, f = n);
2440
- }), d ? e.forEach(function(e) {
2441
- _[f].add(e);
2442
- }) : _.push(new Set(e));
2443
- }
2444
- }
2445
- }), _.forEach(function(e, n) {
2446
- var r = Infinity, a = Infinity, o = -Infinity, s = -Infinity, d = !0, p = !1, m = void 0;
2447
- try {
2448
- for (var h = e[Symbol.iterator](), g; !(d = (g = h.next()).done); d = !0) {
2449
- var _ = g.value, v = void 0;
2450
- v = t == "horizontal" ? c.has(_) ? l[c.get(_)] : i.get(_) : c.has(_) ? u[c.get(_)] : i.get(_);
2451
- var y = f.get(_);
2452
- v < r && (r = v), v > o && (o = v), y < a && (a = y), y > s && (s = y);
2453
- }
2454
- } catch (e) {
2455
- p = !0, m = e;
2456
- } finally {
2457
- try {
2458
- !d && h.return && h.return();
2459
- } finally {
2460
- if (p) throw m;
2461
- }
2462
- }
2463
- var b = (r + o) / 2 - (a + s) / 2, x = !0, S = !1, C = void 0;
2464
- try {
2465
- for (var w = e[Symbol.iterator](), T; !(x = (T = w.next()).done); x = !0) {
2466
- var E = T.value;
2467
- f.set(E, f.get(E) + b);
2468
- }
2469
- } catch (e) {
2470
- S = !0, C = e;
2471
- } finally {
2472
- try {
2473
- !x && w.return && w.return();
2474
- } finally {
2475
- if (S) throw C;
2476
- }
2477
- }
2478
- });
2479
- }
2480
- return f;
2481
- }, v = function(e) {
2482
- var t = 0, n = 0, r = 0, i = 0;
2483
- if (e.forEach(function(e) {
2484
- e.left ? l[c.get(e.left)] - l[c.get(e.right)] >= 0 ? t++ : n++ : u[c.get(e.top)] - u[c.get(e.bottom)] >= 0 ? r++ : i++;
2485
- }), t > n && r > i) for (var a = 0; a < c.size; a++) l[a] = -1 * l[a], u[a] = -1 * u[a];
2486
- else if (t > n) for (var o = 0; o < c.size; o++) l[o] = -1 * l[o];
2487
- else if (r > i) for (var s = 0; s < c.size; s++) u[s] = -1 * u[s];
2488
- }, y = function(e) {
2489
- var t = [], n = new a(), r = /* @__PURE__ */ new Set(), i = 0;
2490
- return e.forEach(function(a, o) {
2491
- if (!r.has(o)) {
2492
- t[i] = [];
2493
- var s = o;
2494
- for (n.push(s), r.add(s), t[i].push(s); n.length != 0;) s = n.shift(), e.get(s).forEach(function(e) {
2495
- r.has(e.id) || (n.push(e.id), r.add(e.id), t[i].push(e.id));
2496
- });
2497
- i++;
2498
- }
2499
- }), t;
2500
- }, b = function(e) {
2501
- var t = /* @__PURE__ */ new Map();
2502
- return e.forEach(function(e, n) {
2503
- t.set(n, []);
2504
- }), e.forEach(function(e, n) {
2505
- e.forEach(function(e) {
2506
- t.get(n).push(e), t.get(e.id).push({
2507
- id: n,
2508
- gap: e.gap,
2509
- direction: e.direction
2510
- });
2511
- });
2512
- }), t;
2513
- }, x = function(e) {
2514
- var t = /* @__PURE__ */ new Map();
2515
- return e.forEach(function(e, n) {
2516
- t.set(n, []);
2517
- }), e.forEach(function(e, n) {
2518
- e.forEach(function(e) {
2519
- t.get(e.id).push({
2520
- id: n,
2521
- gap: e.gap,
2522
- direction: e.direction
2523
- });
2524
- });
2525
- }), t;
2526
- }, S = [], C = [], w = !1, T = !1, E = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), k = [];
2527
- if (t.fixedNodeConstraint && t.fixedNodeConstraint.forEach(function(e) {
2528
- E.add(e.nodeId);
2529
- }), t.relativePlacementConstraint && (t.relativePlacementConstraint.forEach(function(e) {
2530
- e.left ? (D.has(e.left) ? D.get(e.left).push({
2531
- id: e.right,
2532
- gap: e.gap,
2533
- direction: "horizontal"
2534
- }) : D.set(e.left, [{
2535
- id: e.right,
2536
- gap: e.gap,
2537
- direction: "horizontal"
2538
- }]), D.has(e.right) || D.set(e.right, [])) : (D.has(e.top) ? D.get(e.top).push({
2539
- id: e.bottom,
2540
- gap: e.gap,
2541
- direction: "vertical"
2542
- }) : D.set(e.top, [{
2543
- id: e.bottom,
2544
- gap: e.gap,
2545
- direction: "vertical"
2546
- }]), D.has(e.bottom) || D.set(e.bottom, []));
2547
- }), O = b(D), k = y(O)), i.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2548
- if (t.fixedNodeConstraint && t.fixedNodeConstraint.length > 1) t.fixedNodeConstraint.forEach(function(e, t) {
2549
- S[t] = [e.position.x, e.position.y], C[t] = [l[c.get(e.nodeId)], u[c.get(e.nodeId)]];
2550
- }), w = !0;
2551
- else if (t.alignmentConstraint) (function() {
2552
- var e = 0;
2553
- if (t.alignmentConstraint.vertical) {
2554
- for (var n = t.alignmentConstraint.vertical, i = function(t) {
2555
- var i = /* @__PURE__ */ new Set();
2556
- n[t].forEach(function(e) {
2557
- i.add(e);
2558
- });
2559
- var a = new Set([].concat(r(i)).filter(function(e) {
2560
- return E.has(e);
2561
- })), o = void 0;
2562
- o = a.size > 0 ? l[c.get(a.values().next().value)] : g(i).x, n[t].forEach(function(t) {
2563
- S[e] = [o, u[c.get(t)]], C[e] = [l[c.get(t)], u[c.get(t)]], e++;
2564
- });
2565
- }, a = 0; a < n.length; a++) i(a);
2566
- w = !0;
2567
- }
2568
- if (t.alignmentConstraint.horizontal) {
2569
- for (var o = t.alignmentConstraint.horizontal, s = function(t) {
2570
- var n = /* @__PURE__ */ new Set();
2571
- o[t].forEach(function(e) {
2572
- n.add(e);
2573
- });
2574
- var i = new Set([].concat(r(n)).filter(function(e) {
2575
- return E.has(e);
2576
- })), a = void 0;
2577
- a = i.size > 0 ? l[c.get(i.values().next().value)] : g(n).y, o[t].forEach(function(t) {
2578
- S[e] = [l[c.get(t)], a], C[e] = [l[c.get(t)], u[c.get(t)]], e++;
2579
- });
2580
- }, d = 0; d < o.length; d++) s(d);
2581
- w = !0;
2582
- }
2583
- t.relativePlacementConstraint && (T = !0);
2584
- })();
2585
- else if (t.relativePlacementConstraint) {
2586
- for (var A = 0, j = 0, M = 0; M < k.length; M++) k[M].length > A && (A = k[M].length, j = M);
2587
- if (A < O.size / 2) v(t.relativePlacementConstraint), w = !1, T = !1;
2588
- else {
2589
- var N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), F = [];
2590
- k[j].forEach(function(e) {
2591
- D.get(e).forEach(function(t) {
2592
- t.direction == "horizontal" ? (N.has(e) ? N.get(e).push(t) : N.set(e, [t]), N.has(t.id) || N.set(t.id, []), F.push({
2593
- left: e,
2594
- right: t.id
2595
- })) : (P.has(e) ? P.get(e).push(t) : P.set(e, [t]), P.has(t.id) || P.set(t.id, []), F.push({
2596
- top: e,
2597
- bottom: t.id
2598
- }));
2599
- });
2600
- }), v(F), T = !1;
2601
- var I = _(N, "horizontal"), L = _(P, "vertical");
2602
- k[j].forEach(function(e, t) {
2603
- C[t] = [l[c.get(e)], u[c.get(e)]], S[t] = [], I.has(e) ? S[t][0] = I.get(e) : S[t][0] = l[c.get(e)], L.has(e) ? S[t][1] = L.get(e) : S[t][1] = u[c.get(e)];
2604
- }), w = !0;
2605
- }
2606
- }
2607
- if (w) {
2608
- for (var R = void 0, z = o.transpose(S), B = o.transpose(C), V = 0; V < z.length; V++) z[V] = o.multGamma(z[V]), B[V] = o.multGamma(B[V]);
2609
- var ee = o.multMat(z, o.transpose(B)), te = s.svd(ee);
2610
- R = o.multMat(te.V, o.transpose(te.U));
2611
- for (var H = 0; H < c.size; H++) {
2612
- var ne = [l[H], u[H]], re = [R[0][0], R[1][0]], U = [R[0][1], R[1][1]];
2613
- l[H] = o.dotProduct(ne, re), u[H] = o.dotProduct(ne, U);
2614
- }
2615
- T && v(t.relativePlacementConstraint);
2616
- }
2617
- }
2618
- if (i.ENFORCE_CONSTRAINTS) {
2619
- if (t.fixedNodeConstraint && t.fixedNodeConstraint.length > 0) {
2620
- var W = {
2621
- x: 0,
2622
- y: 0
2623
- };
2624
- t.fixedNodeConstraint.forEach(function(e, t) {
2625
- var n = {
2626
- x: l[c.get(e.nodeId)],
2627
- y: u[c.get(e.nodeId)]
2628
- }, r = e.position, i = h(r, n);
2629
- W.x += i.x, W.y += i.y;
2630
- }), W.x /= t.fixedNodeConstraint.length, W.y /= t.fixedNodeConstraint.length, l.forEach(function(e, t) {
2631
- l[t] += W.x;
2632
- }), u.forEach(function(e, t) {
2633
- u[t] += W.y;
2634
- }), t.fixedNodeConstraint.forEach(function(e) {
2635
- l[c.get(e.nodeId)] = e.position.x, u[c.get(e.nodeId)] = e.position.y;
2636
- });
2637
- }
2638
- if (t.alignmentConstraint) {
2639
- if (t.alignmentConstraint.vertical) for (var G = t.alignmentConstraint.vertical, ie = function(e) {
2640
- var t = /* @__PURE__ */ new Set();
2641
- G[e].forEach(function(e) {
2642
- t.add(e);
2643
- });
2644
- var n = new Set([].concat(r(t)).filter(function(e) {
2645
- return E.has(e);
2646
- })), i = void 0;
2647
- i = n.size > 0 ? l[c.get(n.values().next().value)] : g(t).x, t.forEach(function(e) {
2648
- E.has(e) || (l[c.get(e)] = i);
2649
- });
2650
- }, K = 0; K < G.length; K++) ie(K);
2651
- if (t.alignmentConstraint.horizontal) for (var q = t.alignmentConstraint.horizontal, J = function(e) {
2652
- var t = /* @__PURE__ */ new Set();
2653
- q[e].forEach(function(e) {
2654
- t.add(e);
2655
- });
2656
- var n = new Set([].concat(r(t)).filter(function(e) {
2657
- return E.has(e);
2658
- })), i = void 0;
2659
- i = n.size > 0 ? u[c.get(n.values().next().value)] : g(t).y, t.forEach(function(e) {
2660
- E.has(e) || (u[c.get(e)] = i);
2661
- });
2662
- }, Y = 0; Y < q.length; Y++) J(Y);
2663
- }
2664
- t.relativePlacementConstraint && (function() {
2665
- var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
2666
- if (E.forEach(function(e) {
2667
- s.add(e), d.add(e);
2668
- }), t.alignmentConstraint) {
2669
- if (t.alignmentConstraint.vertical) for (var f = t.alignmentConstraint.vertical, p = function(t) {
2670
- r.set("dummy" + t, []), f[t].forEach(function(n) {
2671
- e.set(n, "dummy" + t), r.get("dummy" + t).push(n), E.has(n) && s.add("dummy" + t);
2672
- }), a.set("dummy" + t, l[c.get(f[t][0])]);
2673
- }, m = 0; m < f.length; m++) p(m);
2674
- if (t.alignmentConstraint.horizontal) for (var h = t.alignmentConstraint.horizontal, g = function(e) {
2675
- i.set("dummy" + e, []), h[e].forEach(function(t) {
2676
- n.set(t, "dummy" + e), i.get("dummy" + e).push(t), E.has(t) && d.add("dummy" + e);
2677
- }), o.set("dummy" + e, u[c.get(h[e][0])]);
2678
- }, v = 0; v < h.length; v++) g(v);
2679
- }
2680
- var S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), w = function(t) {
2681
- D.get(t).forEach(function(r) {
2682
- var i = void 0, a = void 0;
2683
- r.direction == "horizontal" ? (i = e.get(t) ? e.get(t) : t, a = e.get(r.id) ? {
2684
- id: e.get(r.id),
2685
- gap: r.gap,
2686
- direction: r.direction
2687
- } : r, S.has(i) ? S.get(i).push(a) : S.set(i, [a]), S.has(a.id) || S.set(a.id, [])) : (i = n.get(t) ? n.get(t) : t, a = n.get(r.id) ? {
2688
- id: n.get(r.id),
2689
- gap: r.gap,
2690
- direction: r.direction
2691
- } : r, C.has(i) ? C.get(i).push(a) : C.set(i, [a]), C.has(a.id) || C.set(a.id, []));
2692
- });
2693
- }, T = !0, O = !1, k = void 0;
2694
- try {
2695
- for (var A = D.keys()[Symbol.iterator](), j; !(T = (j = A.next()).done); T = !0) {
2696
- var M = j.value;
2697
- w(M);
2698
- }
2699
- } catch (e) {
2700
- O = !0, k = e;
2701
- } finally {
2702
- try {
2703
- !T && A.return && A.return();
2704
- } finally {
2705
- if (O) throw k;
2706
- }
2707
- }
2708
- var N = b(S), P = b(C), F = y(N), I = y(P), L = x(S), R = x(C), z = [], B = [];
2709
- F.forEach(function(e, t) {
2710
- z[t] = [], e.forEach(function(e) {
2711
- L.get(e).length == 0 && z[t].push(e);
2712
- });
2713
- }), I.forEach(function(e, t) {
2714
- B[t] = [], e.forEach(function(e) {
2715
- R.get(e).length == 0 && B[t].push(e);
2716
- });
2717
- });
2718
- var V = _(S, "horizontal", s, a, z), ee = _(C, "vertical", d, o, B), te = function(e) {
2719
- r.get(e) ? r.get(e).forEach(function(t) {
2720
- l[c.get(t)] = V.get(e);
2721
- }) : l[c.get(e)] = V.get(e);
2722
- }, H = !0, ne = !1, re = void 0;
2723
- try {
2724
- for (var U = V.keys()[Symbol.iterator](), W; !(H = (W = U.next()).done); H = !0) {
2725
- var G = W.value;
2726
- te(G);
2727
- }
2728
- } catch (e) {
2729
- ne = !0, re = e;
2730
- } finally {
2731
- try {
2732
- !H && U.return && U.return();
2733
- } finally {
2734
- if (ne) throw re;
2735
- }
2736
- }
2737
- var ie = function(e) {
2738
- i.get(e) ? i.get(e).forEach(function(t) {
2739
- u[c.get(t)] = ee.get(e);
2740
- }) : u[c.get(e)] = ee.get(e);
2741
- }, K = !0, q = !1, J = void 0;
2742
- try {
2743
- for (var Y = ee.keys()[Symbol.iterator](), ae; !(K = (ae = Y.next()).done); K = !0) {
2744
- var G = ae.value;
2745
- ie(G);
2746
- }
2747
- } catch (e) {
2748
- q = !0, J = e;
2749
- } finally {
2750
- try {
2751
- !K && Y.return && Y.return();
2752
- } finally {
2753
- if (q) throw J;
2754
- }
2755
- }
2756
- })();
2757
- }
2758
- for (var ae = 0; ae < d.length; ae++) {
2759
- var X = d[ae];
2760
- X.getChild() ?? X.setCenter(l[c.get(X.id)], u[c.get(X.id)]);
2761
- }
2762
- }, e.exports = c;
2763
- }),
2764
- 551: ((t) => {
2765
- t.exports = e;
2766
- })
2767
- }, n = {};
2768
- function r(e) {
2769
- var i = n[e];
2770
- if (i !== void 0) return i.exports;
2771
- var a = n[e] = { exports: {} };
2772
- return t[e](a, a.exports, r), a.exports;
2773
- }
2774
- return r(45);
2775
- })();
2776
- });
2777
- })), k = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
2778
- (function(n, r) {
2779
- typeof e == "object" && typeof t == "object" ? t.exports = r(O()) : typeof define == "function" && define.amd ? define(["cose-base"], r) : typeof e == "object" ? e.cytoscapeFcose = r(O()) : n.cytoscapeFcose = r(n.coseBase);
2780
- })(e, function(e) {
2781
- return (() => {
2782
- var t = {
2783
- 658: ((e) => {
2784
- e.exports = Object.assign == null ? function(e) {
2785
- return [...arguments].slice(1).forEach(function(t) {
2786
- Object.keys(t).forEach(function(n) {
2787
- return e[n] = t[n];
2788
- });
2789
- }), e;
2790
- } : Object.assign.bind(Object);
2791
- }),
2792
- 548: ((e, t, n) => {
2793
- var r = function() {
2794
- function e(e, t) {
2795
- var n = [], r = !0, i = !1, a = void 0;
2796
- try {
2797
- for (var o = e[Symbol.iterator](), s; !(r = (s = o.next()).done) && (n.push(s.value), !(t && n.length === t)); r = !0);
2798
- } catch (e) {
2799
- i = !0, a = e;
2800
- } finally {
2801
- try {
2802
- !r && o.return && o.return();
2803
- } finally {
2804
- if (i) throw a;
2805
- }
2806
- }
2807
- return n;
2808
- }
2809
- return function(t, n) {
2810
- if (Array.isArray(t)) return t;
2811
- if (Symbol.iterator in Object(t)) return e(t, n);
2812
- throw TypeError("Invalid attempt to destructure non-iterable instance");
2813
- };
2814
- }(), i = n(140).layoutBase.LinkedList, a = {};
2815
- a.getTopMostNodes = function(e) {
2816
- for (var t = {}, n = 0; n < e.length; n++) t[e[n].id()] = !0;
2817
- return e.filter(function(e, n) {
2818
- typeof e == "number" && (e = n);
2819
- for (var r = e.parent()[0]; r != null;) {
2820
- if (t[r.id()]) return !1;
2821
- r = r.parent()[0];
2822
- }
2823
- return !0;
2824
- });
2825
- }, a.connectComponents = function(e, t, n, r) {
2826
- var a = new i(), o = /* @__PURE__ */ new Set(), s = [], c = void 0, l = void 0, u = void 0, d = !1, f = 1, p = [], m = [], h = function() {
2827
- var r = e.collection();
2828
- m.push(r);
2829
- var i = n[0], h = e.collection();
2830
- h.merge(i).merge(i.descendants().intersection(t)), s.push(i), h.forEach(function(e) {
2831
- a.push(e), o.add(e), r.merge(e);
2832
- });
2833
- for (var g = function() {
2834
- i = a.shift();
2835
- var l = e.collection();
2836
- i.neighborhood().nodes().forEach(function(e) {
2837
- t.intersection(i.edgesWith(e)).length > 0 && l.merge(e);
2838
- });
2839
- for (var u = 0; u < l.length; u++) {
2840
- var d = l[u];
2841
- c = n.intersection(d.union(d.ancestors())), c != null && !o.has(c[0]) && c.union(c.descendants()).forEach(function(e) {
2842
- a.push(e), o.add(e), r.merge(e), n.has(e) && s.push(e);
2843
- });
2844
- }
2845
- }; a.length != 0;) g();
2846
- if (r.forEach(function(e) {
2847
- t.intersection(e.connectedEdges()).forEach(function(e) {
2848
- r.has(e.source()) && r.has(e.target()) && r.merge(e);
2849
- });
2850
- }), s.length == n.length && (d = !0), !d || d && f > 1) {
2851
- l = s[0], u = l.connectedEdges().length, s.forEach(function(e) {
2852
- e.connectedEdges().length < u && (u = e.connectedEdges().length, l = e);
2853
- }), p.push(l.id());
2854
- var _ = e.collection();
2855
- _.merge(s[0]), s.forEach(function(e) {
2856
- _.merge(e);
2857
- }), s = [], n = n.difference(_), f++;
2858
- }
2859
- };
2860
- do
2861
- h();
2862
- while (!d);
2863
- return r && p.length > 0 && r.set("dummy" + (r.size + 1), p), m;
2864
- }, a.relocateComponent = function(e, t, n) {
2865
- if (!n.fixedNodeConstraint) {
2866
- var i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
2867
- if (n.quality == "draft") {
2868
- var c = !0, l = !1, u = void 0;
2869
- try {
2870
- for (var d = t.nodeIndexes[Symbol.iterator](), f; !(c = (f = d.next()).done); c = !0) {
2871
- var p = f.value, m = r(p, 2), h = m[0], g = m[1], _ = n.cy.getElementById(h);
2872
- if (_) {
2873
- var v = _.boundingBox(), y = t.xCoords[g] - v.w / 2, b = t.xCoords[g] + v.w / 2, x = t.yCoords[g] - v.h / 2, S = t.yCoords[g] + v.h / 2;
2874
- y < i && (i = y), b > a && (a = b), x < o && (o = x), S > s && (s = S);
2875
- }
2876
- }
2877
- } catch (e) {
2878
- l = !0, u = e;
2879
- } finally {
2880
- try {
2881
- !c && d.return && d.return();
2882
- } finally {
2883
- if (l) throw u;
2884
- }
2885
- }
2886
- var C = e.x - (a + i) / 2, w = e.y - (s + o) / 2;
2887
- t.xCoords = t.xCoords.map(function(e) {
2888
- return e + C;
2889
- }), t.yCoords = t.yCoords.map(function(e) {
2890
- return e + w;
2891
- });
2892
- } else {
2893
- Object.keys(t).forEach(function(e) {
2894
- var n = t[e], r = n.getRect().x, c = n.getRect().x + n.getRect().width, l = n.getRect().y, u = n.getRect().y + n.getRect().height;
2895
- r < i && (i = r), c > a && (a = c), l < o && (o = l), u > s && (s = u);
2896
- });
2897
- var T = e.x - (a + i) / 2, E = e.y - (s + o) / 2;
2898
- Object.keys(t).forEach(function(e) {
2899
- var n = t[e];
2900
- n.setCenter(n.getCenterX() + T, n.getCenterY() + E);
2901
- });
2902
- }
2903
- }
2904
- }, a.calcBoundingBox = function(e, t, n, r) {
2905
- for (var i = 2 ** 53 - 1, a = -(2 ** 53 - 1), o = 2 ** 53 - 1, s = -(2 ** 53 - 1), c = void 0, l = void 0, u = void 0, d = void 0, f = e.descendants().not(":parent"), p = f.length, m = 0; m < p; m++) {
2906
- var h = f[m];
2907
- c = t[r.get(h.id())] - h.width() / 2, l = t[r.get(h.id())] + h.width() / 2, u = n[r.get(h.id())] - h.height() / 2, d = n[r.get(h.id())] + h.height() / 2, i > c && (i = c), a < l && (a = l), o > u && (o = u), s < d && (s = d);
2908
- }
2909
- var g = {};
2910
- return g.topLeftX = i, g.topLeftY = o, g.width = a - i, g.height = s - o, g;
2911
- }, a.calcParentsWithoutChildren = function(e, t) {
2912
- var n = e.collection();
2913
- return t.nodes(":parent").forEach(function(e) {
2914
- var t = !1;
2915
- e.children().forEach(function(e) {
2916
- e.css("display") != "none" && (t = !0);
2917
- }), t || n.merge(e);
2918
- }), n;
2919
- }, e.exports = a;
2920
- }),
2921
- 816: ((e, t, n) => {
2922
- var r = n(548), i = n(140).CoSELayout, a = n(140).CoSENode, o = n(140).layoutBase.PointD, s = n(140).layoutBase.DimensionD, c = n(140).layoutBase.LayoutConstants, l = n(140).layoutBase.FDLayoutConstants, u = n(140).CoSEConstants;
2923
- e.exports = { coseLayout: function(e, t) {
2924
- var n = e.cy, d = e.eles, f = d.nodes(), p = d.edges(), m = void 0, h = void 0, g = void 0, _ = {};
2925
- e.randomize && (m = t.nodeIndexes, h = t.xCoords, g = t.yCoords);
2926
- var v = function(e) {
2927
- return typeof e == "function";
2928
- }, y = function(e, t) {
2929
- return v(e) ? e(t) : e;
2930
- }, b = r.calcParentsWithoutChildren(n, d), x = function e(t, n, i, c) {
2931
- for (var l = n.length, u = 0; u < l; u++) {
2932
- var d = n[u], f = null;
2933
- d.intersection(b).length == 0 && (f = d.children());
2934
- var p = void 0, v = d.layoutDimensions({ nodeDimensionsIncludeLabels: c.nodeDimensionsIncludeLabels });
2935
- if (d.outerWidth() != null && d.outerHeight() != null) if (c.randomize) if (!d.isParent()) p = t.add(new a(i.graphManager, new o(h[m.get(d.id())] - v.w / 2, g[m.get(d.id())] - v.h / 2), new s(parseFloat(v.w), parseFloat(v.h))));
2936
- else {
2937
- var x = r.calcBoundingBox(d, h, g, m);
2938
- p = d.intersection(b).length == 0 ? t.add(new a(i.graphManager, new o(x.topLeftX, x.topLeftY), new s(x.width, x.height))) : t.add(new a(i.graphManager, new o(x.topLeftX, x.topLeftY), new s(parseFloat(v.w), parseFloat(v.h))));
2939
- }
2940
- else p = t.add(new a(i.graphManager, new o(d.position("x") - v.w / 2, d.position("y") - v.h / 2), new s(parseFloat(v.w), parseFloat(v.h))));
2941
- else p = t.add(new a(this.graphManager));
2942
- if (p.id = d.data("id"), p.nodeRepulsion = y(c.nodeRepulsion, d), p.paddingLeft = parseInt(d.css("padding")), p.paddingTop = parseInt(d.css("padding")), p.paddingRight = parseInt(d.css("padding")), p.paddingBottom = parseInt(d.css("padding")), c.nodeDimensionsIncludeLabels && (p.labelWidth = d.boundingBox({
2943
- includeLabels: !0,
2944
- includeNodes: !1,
2945
- includeOverlays: !1
2946
- }).w, p.labelHeight = d.boundingBox({
2947
- includeLabels: !0,
2948
- includeNodes: !1,
2949
- includeOverlays: !1
2950
- }).h, p.labelPosVertical = d.css("text-valign"), p.labelPosHorizontal = d.css("text-halign")), _[d.data("id")] = p, isNaN(p.rect.x) && (p.rect.x = 0), isNaN(p.rect.y) && (p.rect.y = 0), f != null && f.length > 0) {
2951
- var S = void 0;
2952
- S = i.getGraphManager().add(i.newGraph(), p), e(S, f, i, c);
2953
- }
2954
- }
2955
- }, S = function(t, n, r) {
2956
- for (var i = 0, a = 0, o = 0; o < r.length; o++) {
2957
- var s = r[o], c = _[s.data("source")], d = _[s.data("target")];
2958
- if (c && d && c !== d && c.getEdgesBetween(d).length == 0) {
2959
- var f = n.add(t.newEdge(), c, d);
2960
- f.id = s.id(), f.idealLength = y(e.idealEdgeLength, s), f.edgeElasticity = y(e.edgeElasticity, s), i += f.idealLength, a++;
2961
- }
2962
- }
2963
- e.idealEdgeLength != null && (a > 0 ? u.DEFAULT_EDGE_LENGTH = l.DEFAULT_EDGE_LENGTH = i / a : v(e.idealEdgeLength) ? u.DEFAULT_EDGE_LENGTH = l.DEFAULT_EDGE_LENGTH = 50 : u.DEFAULT_EDGE_LENGTH = l.DEFAULT_EDGE_LENGTH = e.idealEdgeLength, u.MIN_REPULSION_DIST = l.MIN_REPULSION_DIST = l.DEFAULT_EDGE_LENGTH / 10, u.DEFAULT_RADIAL_SEPARATION = l.DEFAULT_EDGE_LENGTH);
2964
- }, C = function(e, t) {
2965
- t.fixedNodeConstraint && (e.constraints.fixedNodeConstraint = t.fixedNodeConstraint), t.alignmentConstraint && (e.constraints.alignmentConstraint = t.alignmentConstraint), t.relativePlacementConstraint && (e.constraints.relativePlacementConstraint = t.relativePlacementConstraint);
2966
- };
2967
- e.nestingFactor != null && (u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.nestingFactor), e.gravity != null && (u.DEFAULT_GRAVITY_STRENGTH = l.DEFAULT_GRAVITY_STRENGTH = e.gravity), e.numIter != null && (u.MAX_ITERATIONS = l.MAX_ITERATIONS = e.numIter), e.gravityRange != null && (u.DEFAULT_GRAVITY_RANGE_FACTOR = l.DEFAULT_GRAVITY_RANGE_FACTOR = e.gravityRange), e.gravityCompound != null && (u.DEFAULT_COMPOUND_GRAVITY_STRENGTH = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.gravityCompound), e.gravityRangeCompound != null && (u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.gravityRangeCompound), e.initialEnergyOnIncremental != null && (u.DEFAULT_COOLING_FACTOR_INCREMENTAL = l.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.initialEnergyOnIncremental), e.tilingCompareBy != null && (u.TILING_COMPARE_BY = e.tilingCompareBy), e.quality == "proof" ? c.QUALITY = 2 : c.QUALITY = 0, u.NODE_DIMENSIONS_INCLUDE_LABELS = l.NODE_DIMENSIONS_INCLUDE_LABELS = c.NODE_DIMENSIONS_INCLUDE_LABELS = e.nodeDimensionsIncludeLabels, u.DEFAULT_INCREMENTAL = l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = !e.randomize, u.ANIMATE = l.ANIMATE = c.ANIMATE = e.animate, u.TILE = e.tile, u.TILING_PADDING_VERTICAL = typeof e.tilingPaddingVertical == "function" ? e.tilingPaddingVertical.call() : e.tilingPaddingVertical, u.TILING_PADDING_HORIZONTAL = typeof e.tilingPaddingHorizontal == "function" ? e.tilingPaddingHorizontal.call() : e.tilingPaddingHorizontal, u.DEFAULT_INCREMENTAL = l.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = !0, u.PURE_INCREMENTAL = !e.randomize, c.DEFAULT_UNIFORM_LEAF_NODE_SIZES = e.uniformNodeDimensions, e.step == "transformed" && (u.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, u.ENFORCE_CONSTRAINTS = !1, u.APPLY_LAYOUT = !1), e.step == "enforced" && (u.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, u.ENFORCE_CONSTRAINTS = !0, u.APPLY_LAYOUT = !1), e.step == "cose" && (u.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, u.ENFORCE_CONSTRAINTS = !1, u.APPLY_LAYOUT = !0), e.step == "all" && (e.randomize ? u.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : u.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, u.ENFORCE_CONSTRAINTS = !0, u.APPLY_LAYOUT = !0), e.fixedNodeConstraint || e.alignmentConstraint || e.relativePlacementConstraint ? u.TREE_REDUCTION_ON_INCREMENTAL = !1 : u.TREE_REDUCTION_ON_INCREMENTAL = !0;
2968
- var w = new i(), T = w.newGraphManager();
2969
- return x(T.addRoot(), r.getTopMostNodes(f), w, e), S(w, T, p), C(w, e), w.runLayout(), _;
2970
- } };
2971
- }),
2972
- 212: ((e, t, n) => {
2973
- var r = function() {
2974
- function e(e, t) {
2975
- for (var n = 0; n < t.length; n++) {
2976
- var r = t[n];
2977
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
2978
- }
2979
- }
2980
- return function(t, n, r) {
2981
- return n && e(t.prototype, n), r && e(t, r), t;
2982
- };
2983
- }();
2984
- function i(e, t) {
2985
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
2986
- }
2987
- var a = n(658), o = n(548), s = n(657).spectralLayout, c = n(816).coseLayout, l = Object.freeze({
2988
- quality: "default",
2989
- randomize: !0,
2990
- animate: !0,
2991
- animationDuration: 1e3,
2992
- animationEasing: void 0,
2993
- fit: !0,
2994
- padding: 30,
2995
- nodeDimensionsIncludeLabels: !1,
2996
- uniformNodeDimensions: !1,
2997
- packComponents: !0,
2998
- step: "all",
2999
- samplingType: !0,
3000
- sampleSize: 25,
3001
- nodeSeparation: 75,
3002
- piTol: 1e-7,
3003
- nodeRepulsion: function(e) {
3004
- return 4500;
3005
- },
3006
- idealEdgeLength: function(e) {
3007
- return 50;
3008
- },
3009
- edgeElasticity: function(e) {
3010
- return .45;
3011
- },
3012
- nestingFactor: .1,
3013
- gravity: .25,
3014
- numIter: 2500,
3015
- tile: !0,
3016
- tilingCompareBy: void 0,
3017
- tilingPaddingVertical: 10,
3018
- tilingPaddingHorizontal: 10,
3019
- gravityRangeCompound: 1.5,
3020
- gravityCompound: 1,
3021
- gravityRange: 3.8,
3022
- initialEnergyOnIncremental: .3,
3023
- fixedNodeConstraint: void 0,
3024
- alignmentConstraint: void 0,
3025
- relativePlacementConstraint: void 0,
3026
- ready: function() {},
3027
- stop: function() {}
3028
- });
3029
- e.exports = function() {
3030
- function e(t) {
3031
- i(this, e), this.options = a({}, l, t);
3032
- }
3033
- return r(e, [{
3034
- key: "run",
3035
- value: function() {
3036
- var e = this, t = this.options, n = t.cy, r = t.eles, i = [], a = [], l = void 0, u = [];
3037
- t.fixedNodeConstraint && (!Array.isArray(t.fixedNodeConstraint) || t.fixedNodeConstraint.length == 0) && (t.fixedNodeConstraint = void 0), t.alignmentConstraint && (t.alignmentConstraint.vertical && (!Array.isArray(t.alignmentConstraint.vertical) || t.alignmentConstraint.vertical.length == 0) && (t.alignmentConstraint.vertical = void 0), t.alignmentConstraint.horizontal && (!Array.isArray(t.alignmentConstraint.horizontal) || t.alignmentConstraint.horizontal.length == 0) && (t.alignmentConstraint.horizontal = void 0)), t.relativePlacementConstraint && (!Array.isArray(t.relativePlacementConstraint) || t.relativePlacementConstraint.length == 0) && (t.relativePlacementConstraint = void 0), (t.fixedNodeConstraint || t.alignmentConstraint || t.relativePlacementConstraint) && (t.tile = !1, t.packComponents = !1);
3038
- var d = void 0, f = !1;
3039
- if (n.layoutUtilities && t.packComponents && (d = n.layoutUtilities("get"), d ||= n.layoutUtilities(), f = !0), r.nodes().length > 0) if (f) {
3040
- var p = o.getTopMostNodes(t.eles.nodes());
3041
- if (l = o.connectComponents(n, t.eles, p), l.forEach(function(e) {
3042
- var t = e.boundingBox();
3043
- u.push({
3044
- x: t.x1 + t.w / 2,
3045
- y: t.y1 + t.h / 2
3046
- });
3047
- }), t.randomize && l.forEach(function(e) {
3048
- t.eles = e, i.push(s(t));
3049
- }), t.quality == "default" || t.quality == "proof") {
3050
- var m = n.collection();
3051
- if (t.tile) {
3052
- var h = /* @__PURE__ */ new Map(), g = [], _ = [], v = 0, y = {
3053
- nodeIndexes: h,
3054
- xCoords: g,
3055
- yCoords: _
3056
- }, b = [];
3057
- if (l.forEach(function(e, t) {
3058
- e.edges().length == 0 && (e.nodes().forEach(function(t, n) {
3059
- m.merge(e.nodes()[n]), t.isParent() || (y.nodeIndexes.set(e.nodes()[n].id(), v++), y.xCoords.push(e.nodes()[0].position().x), y.yCoords.push(e.nodes()[0].position().y));
3060
- }), b.push(t));
3061
- }), m.length > 1) {
3062
- var x = m.boundingBox();
3063
- u.push({
3064
- x: x.x1 + x.w / 2,
3065
- y: x.y1 + x.h / 2
3066
- }), l.push(m), i.push(y);
3067
- for (var S = b.length - 1; S >= 0; S--) l.splice(b[S], 1), i.splice(b[S], 1), u.splice(b[S], 1);
3068
- }
3069
- }
3070
- l.forEach(function(e, n) {
3071
- t.eles = e, a.push(c(t, i[n])), o.relocateComponent(u[n], a[n], t);
3072
- });
3073
- } else l.forEach(function(e, n) {
3074
- o.relocateComponent(u[n], i[n], t);
3075
- });
3076
- var C = /* @__PURE__ */ new Set();
3077
- if (l.length > 1) {
3078
- var w = [], T = r.filter(function(e) {
3079
- return e.css("display") == "none";
3080
- });
3081
- l.forEach(function(e, n) {
3082
- var r = void 0;
3083
- if (t.quality == "draft" && (r = i[n].nodeIndexes), e.nodes().not(T).length > 0) {
3084
- var s = {};
3085
- s.edges = [], s.nodes = [];
3086
- var c = void 0;
3087
- e.nodes().not(T).forEach(function(e) {
3088
- if (t.quality == "draft") if (!e.isParent()) c = r.get(e.id()), s.nodes.push({
3089
- x: i[n].xCoords[c] - e.boundingbox().w / 2,
3090
- y: i[n].yCoords[c] - e.boundingbox().h / 2,
3091
- width: e.boundingbox().w,
3092
- height: e.boundingbox().h
3093
- });
3094
- else {
3095
- var l = o.calcBoundingBox(e, i[n].xCoords, i[n].yCoords, r);
3096
- s.nodes.push({
3097
- x: l.topLeftX,
3098
- y: l.topLeftY,
3099
- width: l.width,
3100
- height: l.height
3101
- });
3102
- }
3103
- else a[n][e.id()] && s.nodes.push({
3104
- x: a[n][e.id()].getLeft(),
3105
- y: a[n][e.id()].getTop(),
3106
- width: a[n][e.id()].getWidth(),
3107
- height: a[n][e.id()].getHeight()
3108
- });
3109
- }), e.edges().forEach(function(e) {
3110
- var c = e.source(), l = e.target();
3111
- if (c.css("display") != "none" && l.css("display") != "none") if (t.quality == "draft") {
3112
- var u = r.get(c.id()), d = r.get(l.id()), f = [], p = [];
3113
- if (c.isParent()) {
3114
- var m = o.calcBoundingBox(c, i[n].xCoords, i[n].yCoords, r);
3115
- f.push(m.topLeftX + m.width / 2), f.push(m.topLeftY + m.height / 2);
3116
- } else f.push(i[n].xCoords[u]), f.push(i[n].yCoords[u]);
3117
- if (l.isParent()) {
3118
- var h = o.calcBoundingBox(l, i[n].xCoords, i[n].yCoords, r);
3119
- p.push(h.topLeftX + h.width / 2), p.push(h.topLeftY + h.height / 2);
3120
- } else p.push(i[n].xCoords[d]), p.push(i[n].yCoords[d]);
3121
- s.edges.push({
3122
- startX: f[0],
3123
- startY: f[1],
3124
- endX: p[0],
3125
- endY: p[1]
3126
- });
3127
- } else a[n][c.id()] && a[n][l.id()] && s.edges.push({
3128
- startX: a[n][c.id()].getCenterX(),
3129
- startY: a[n][c.id()].getCenterY(),
3130
- endX: a[n][l.id()].getCenterX(),
3131
- endY: a[n][l.id()].getCenterY()
3132
- });
3133
- }), s.nodes.length > 0 && (w.push(s), C.add(n));
3134
- }
3135
- });
3136
- var E = d.packComponents(w, t.randomize).shifts;
3137
- if (t.quality == "draft") i.forEach(function(e, t) {
3138
- var n = e.xCoords.map(function(e) {
3139
- return e + E[t].dx;
3140
- }), r = e.yCoords.map(function(e) {
3141
- return e + E[t].dy;
3142
- });
3143
- e.xCoords = n, e.yCoords = r;
3144
- });
3145
- else {
3146
- var D = 0;
3147
- C.forEach(function(e) {
3148
- Object.keys(a[e]).forEach(function(t) {
3149
- var n = a[e][t];
3150
- n.setCenter(n.getCenterX() + E[D].dx, n.getCenterY() + E[D].dy);
3151
- }), D++;
3152
- });
3153
- }
3154
- }
3155
- } else {
3156
- var O = t.eles.boundingBox();
3157
- if (u.push({
3158
- x: O.x1 + O.w / 2,
3159
- y: O.y1 + O.h / 2
3160
- }), t.randomize) {
3161
- var k = s(t);
3162
- i.push(k);
3163
- }
3164
- t.quality == "default" || t.quality == "proof" ? (a.push(c(t, i[0])), o.relocateComponent(u[0], a[0], t)) : o.relocateComponent(u[0], i[0], t);
3165
- }
3166
- var A = function(e, n) {
3167
- if (t.quality == "default" || t.quality == "proof") {
3168
- typeof e == "number" && (e = n);
3169
- var r = void 0, o = void 0, s = e.data("id");
3170
- return a.forEach(function(e) {
3171
- s in e && (r = {
3172
- x: e[s].getRect().getCenterX(),
3173
- y: e[s].getRect().getCenterY()
3174
- }, o = e[s]);
3175
- }), t.nodeDimensionsIncludeLabels && (o.labelWidth && (o.labelPosHorizontal == "left" ? r.x += o.labelWidth / 2 : o.labelPosHorizontal == "right" && (r.x -= o.labelWidth / 2)), o.labelHeight && (o.labelPosVertical == "top" ? r.y += o.labelHeight / 2 : o.labelPosVertical == "bottom" && (r.y -= o.labelHeight / 2))), r ??= {
3176
- x: e.position("x"),
3177
- y: e.position("y")
3178
- }, {
3179
- x: r.x,
3180
- y: r.y
3181
- };
3182
- } else {
3183
- var c = void 0;
3184
- return i.forEach(function(t) {
3185
- var n = t.nodeIndexes.get(e.id());
3186
- n != null && (c = {
3187
- x: t.xCoords[n],
3188
- y: t.yCoords[n]
3189
- });
3190
- }), c ??= {
3191
- x: e.position("x"),
3192
- y: e.position("y")
3193
- }, {
3194
- x: c.x,
3195
- y: c.y
3196
- };
3197
- }
3198
- };
3199
- if (t.quality == "default" || t.quality == "proof" || t.randomize) {
3200
- var j = o.calcParentsWithoutChildren(n, r), M = r.filter(function(e) {
3201
- return e.css("display") == "none";
3202
- });
3203
- t.eles = r.not(M), r.nodes().not(":parent").not(M).layoutPositions(e, t, A), j.length > 0 && j.forEach(function(e) {
3204
- e.position(A(e));
3205
- });
3206
- } else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
3207
- }
3208
- }]), e;
3209
- }();
3210
- }),
3211
- 657: ((e, t, n) => {
3212
- var r = n(548), i = n(140).layoutBase.Matrix, a = n(140).layoutBase.SVD;
3213
- e.exports = { spectralLayout: function(e) {
3214
- var t = e.cy, n = e.eles, o = n.nodes(), s = n.nodes(":parent"), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = [], f = [], p = [], m = [], h = [], g = [], _ = [], v = [], y = void 0, b = 1e8, x = 1e-9, S = e.piTol, C = e.samplingType, w = e.nodeSeparation, T = void 0, E = function() {
3215
- for (var e = 0, t = 0, n = !1; t < T;) {
3216
- e = Math.floor(Math.random() * y), n = !1;
3217
- for (var r = 0; r < t; r++) if (m[r] == e) {
3218
- n = !0;
3219
- break;
3220
- }
3221
- if (!n) m[t] = e, t++;
3222
- else continue;
3223
- }
3224
- }, D = function(e, t, n) {
3225
- for (var r = [], i = 0, a = 0, o = 0, s = void 0, c = [], u = 0, f = 1, p = 0; p < y; p++) c[p] = b;
3226
- for (r[a] = e, c[e] = 0; a >= i;) {
3227
- o = r[i++];
3228
- for (var m = d[o], _ = 0; _ < m.length; _++) s = l.get(m[_]), c[s] == b && (c[s] = c[o] + 1, r[++a] = s);
3229
- g[o][t] = c[o] * w;
3230
- }
3231
- if (n) {
3232
- for (var v = 0; v < y; v++) g[v][t] < h[v] && (h[v] = g[v][t]);
3233
- for (var x = 0; x < y; x++) h[x] > u && (u = h[x], f = x);
3234
- }
3235
- return f;
3236
- }, O = function(e) {
3237
- var t = void 0;
3238
- if (e) {
3239
- t = Math.floor(Math.random() * y);
3240
- for (var n = 0; n < y; n++) h[n] = b;
3241
- for (var r = 0; r < T; r++) m[r] = t, t = D(t, r, e);
3242
- } else {
3243
- E();
3244
- for (var i = 0; i < T; i++) D(m[i], i, e, !1);
3245
- }
3246
- for (var a = 0; a < y; a++) for (var o = 0; o < T; o++) g[a][o] *= g[a][o];
3247
- for (var s = 0; s < T; s++) _[s] = [];
3248
- for (var c = 0; c < T; c++) for (var l = 0; l < T; l++) _[c][l] = g[m[l]][c];
3249
- }, k = function() {
3250
- for (var e = a.svd(_), t = e.S, n = e.U, r = e.V, o = t[0] * t[0] * t[0], s = [], c = 0; c < T; c++) {
3251
- s[c] = [];
3252
- for (var l = 0; l < T; l++) s[c][l] = 0, c == l && (s[c][l] = t[c] / (t[c] * t[c] + o / (t[c] * t[c])));
3253
- }
3254
- v = i.multMat(i.multMat(r, s), i.transpose(n));
3255
- }, A = function() {
3256
- for (var e = void 0, t = void 0, n = [], r = [], a = [], o = [], s = 0; s < y; s++) n[s] = Math.random(), r[s] = Math.random();
3257
- n = i.normalize(n), r = i.normalize(r);
3258
- for (var c = 0, l = x, u = x, d = void 0;;) {
3259
- c++;
3260
- for (var m = 0; m < y; m++) a[m] = n[m];
3261
- if (n = i.multGamma(i.multL(i.multGamma(a), g, v)), e = i.dotProduct(a, n), n = i.normalize(n), l = i.dotProduct(a, n), d = Math.abs(l / u), d <= 1 + S && d >= 1) break;
3262
- u = l;
3263
- }
3264
- for (var h = 0; h < y; h++) a[h] = n[h];
3265
- for (c = 0, u = x;;) {
3266
- c++;
3267
- for (var _ = 0; _ < y; _++) o[_] = r[_];
3268
- if (o = i.minusOp(o, i.multCons(a, i.dotProduct(a, o))), r = i.multGamma(i.multL(i.multGamma(o), g, v)), t = i.dotProduct(o, r), r = i.normalize(r), l = i.dotProduct(o, r), d = Math.abs(l / u), d <= 1 + S && d >= 1) break;
3269
- u = l;
3270
- }
3271
- for (var b = 0; b < y; b++) o[b] = r[b];
3272
- f = i.multCons(a, Math.sqrt(Math.abs(e))), p = i.multCons(o, Math.sqrt(Math.abs(t)));
3273
- };
3274
- r.connectComponents(t, n, r.getTopMostNodes(o), c), s.forEach(function(e) {
3275
- r.connectComponents(t, n, r.getTopMostNodes(e.descendants().intersection(n)), c);
3276
- });
3277
- for (var j = 0, M = 0; M < o.length; M++) o[M].isParent() || l.set(o[M].id(), j++);
3278
- var N = !0, P = !1, F = void 0;
3279
- try {
3280
- for (var I = c.keys()[Symbol.iterator](), L; !(N = (L = I.next()).done); N = !0) {
3281
- var R = L.value;
3282
- l.set(R, j++);
3283
- }
3284
- } catch (e) {
3285
- P = !0, F = e;
3286
- } finally {
3287
- try {
3288
- !N && I.return && I.return();
3289
- } finally {
3290
- if (P) throw F;
3291
- }
3292
- }
3293
- for (var z = 0; z < l.size; z++) d[z] = [];
3294
- s.forEach(function(e) {
3295
- for (var t = e.children().intersection(n); t.nodes(":childless").length == 0;) t = t.nodes()[0].children().intersection(n);
3296
- var r = 0, i = t.nodes(":childless")[0].connectedEdges().length;
3297
- t.nodes(":childless").forEach(function(e, t) {
3298
- e.connectedEdges().length < i && (i = e.connectedEdges().length, r = t);
3299
- }), u.set(e.id(), t.nodes(":childless")[r].id());
3300
- }), o.forEach(function(e) {
3301
- var t = void 0;
3302
- t = e.isParent() ? l.get(u.get(e.id())) : l.get(e.id()), e.neighborhood().nodes().forEach(function(r) {
3303
- n.intersection(e.edgesWith(r)).length > 0 && (r.isParent() ? d[t].push(u.get(r.id())) : d[t].push(r.id()));
3304
- });
3305
- });
3306
- var B = function(e) {
3307
- var n = l.get(e), r = void 0;
3308
- c.get(e).forEach(function(i) {
3309
- r = t.getElementById(i).isParent() ? u.get(i) : i, d[n].push(r), d[l.get(r)].push(e);
3310
- });
3311
- }, V = !0, ee = !1, te = void 0;
3312
- try {
3313
- for (var H = c.keys()[Symbol.iterator](), ne; !(V = (ne = H.next()).done); V = !0) {
3314
- var re = ne.value;
3315
- B(re);
3316
- }
3317
- } catch (e) {
3318
- ee = !0, te = e;
3319
- } finally {
3320
- try {
3321
- !V && H.return && H.return();
3322
- } finally {
3323
- if (ee) throw te;
3324
- }
3325
- }
3326
- y = l.size;
3327
- var U = void 0;
3328
- if (y > 2) {
3329
- T = y < e.sampleSize ? y : e.sampleSize;
3330
- for (var W = 0; W < y; W++) g[W] = [];
3331
- for (var G = 0; G < T; G++) v[G] = [];
3332
- return e.quality == "draft" || e.step == "all" ? (O(C), k(), A(), U = {
3333
- nodeIndexes: l,
3334
- xCoords: f,
3335
- yCoords: p
3336
- }) : (l.forEach(function(e, n) {
3337
- f.push(t.getElementById(n).position("x")), p.push(t.getElementById(n).position("y"));
3338
- }), U = {
3339
- nodeIndexes: l,
3340
- xCoords: f,
3341
- yCoords: p
3342
- }), U;
3343
- } else {
3344
- var ie = l.keys(), K = t.getElementById(ie.next().value), q = K.position(), J = K.outerWidth();
3345
- if (f.push(q.x), p.push(q.y), y == 2) {
3346
- var Y = t.getElementById(ie.next().value).outerWidth();
3347
- f.push(q.x + J / 2 + Y / 2 + e.idealEdgeLength), p.push(q.y);
3348
- }
3349
- return U = {
3350
- nodeIndexes: l,
3351
- xCoords: f,
3352
- yCoords: p
3353
- }, U;
3354
- }
3355
- } };
3356
- }),
3357
- 579: ((e, t, n) => {
3358
- var r = n(212), i = function(e) {
3359
- e && e("layout", "fcose", r);
3360
- };
3361
- typeof cytoscape < "u" && i(cytoscape), e.exports = i;
3362
- }),
3363
- 140: ((t) => {
3364
- t.exports = e;
3365
- })
3366
- }, n = {};
3367
- function r(e) {
3368
- var i = n[e];
3369
- if (i !== void 0) return i.exports;
3370
- var a = n[e] = { exports: {} };
3371
- return t[e](a, a.exports, r), a.exports;
3372
- }
3373
- return r(579);
3374
- })();
3375
- });
3376
- })))(), 1), A = {
3377
- L: "left",
3378
- R: "right",
3379
- T: "top",
3380
- B: "bottom"
3381
- }, j = {
3382
- L: /* @__PURE__ */ r((e) => `${e},${e / 2} 0,${e} 0,0`, "L"),
3383
- R: /* @__PURE__ */ r((e) => `0,${e / 2} ${e},0 ${e},${e}`, "R"),
3384
- T: /* @__PURE__ */ r((e) => `0,0 ${e},0 ${e / 2},${e}`, "T"),
3385
- B: /* @__PURE__ */ r((e) => `${e / 2},0 ${e},${e} 0,${e}`, "B")
3386
- }, M = {
3387
- L: /* @__PURE__ */ r((e, t) => e - t + 2, "L"),
3388
- R: /* @__PURE__ */ r((e, t) => e - 2, "R"),
3389
- T: /* @__PURE__ */ r((e, t) => e - t + 2, "T"),
3390
- B: /* @__PURE__ */ r((e, t) => e - 2, "B")
3391
- }, N = /* @__PURE__ */ r(function(e) {
3392
- return F(e) ? e === "L" ? "R" : "L" : e === "T" ? "B" : "T";
3393
- }, "getOppositeArchitectureDirection"), P = /* @__PURE__ */ r(function(e) {
3394
- let t = e;
3395
- return t === "L" || t === "R" || t === "T" || t === "B";
3396
- }, "isArchitectureDirection"), F = /* @__PURE__ */ r(function(e) {
3397
- let t = e;
3398
- return t === "L" || t === "R";
3399
- }, "isArchitectureDirectionX"), I = /* @__PURE__ */ r(function(e) {
3400
- let t = e;
3401
- return t === "T" || t === "B";
3402
- }, "isArchitectureDirectionY"), L = /* @__PURE__ */ r(function(e, t) {
3403
- let n = F(e) && I(t), r = I(e) && F(t);
3404
- return n || r;
3405
- }, "isArchitectureDirectionXY"), R = /* @__PURE__ */ r(function(e) {
3406
- let t = e[0], n = e[1], r = F(t) && I(n), i = I(t) && F(n);
3407
- return r || i;
3408
- }, "isArchitecturePairXY"), z = /* @__PURE__ */ r(function(e) {
3409
- return e !== "LL" && e !== "RR" && e !== "TT" && e !== "BB";
3410
- }, "isValidArchitectureDirectionPair"), B = /* @__PURE__ */ r(function(e, t) {
3411
- let n = `${e}${t}`;
3412
- return z(n) ? n : void 0;
3413
- }, "getArchitectureDirectionPair"), V = /* @__PURE__ */ r(function([e, t], n) {
3414
- let r = n[0], i = n[1];
3415
- return F(r) ? I(i) ? [e + (r === "L" ? -1 : 1), t + (i === "T" ? 1 : -1)] : [e + (r === "L" ? -1 : 1), t] : F(i) ? [e + (i === "L" ? 1 : -1), t + (r === "T" ? 1 : -1)] : [e, t + (r === "T" ? 1 : -1)];
3416
- }, "shiftPositionByArchitectureDirectionPair"), ee = /* @__PURE__ */ r(function(e) {
3417
- return e === "LT" || e === "TL" ? [1, 1] : e === "BL" || e === "LB" ? [1, -1] : e === "BR" || e === "RB" ? [-1, -1] : [-1, 1];
3418
- }, "getArchitectureDirectionXYFactors"), te = /* @__PURE__ */ r(function(e, t) {
3419
- return L(e, t) ? "bend" : F(e) ? "horizontal" : "vertical";
3420
- }, "getArchitectureDirectionAlignment"), H = /* @__PURE__ */ r(function(e) {
3421
- return e.type === "service";
3422
- }, "isArchitectureService"), ne = /* @__PURE__ */ r(function(e) {
3423
- return e.type === "junction";
3424
- }, "isArchitectureJunction"), re = /* @__PURE__ */ r((e) => e.data(), "edgeData"), U = /* @__PURE__ */ r((e) => e.data(), "nodeData"), W = m.architecture, G = class {
3425
- constructor() {
3426
- this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.elements = {}, this.setAccTitle = l, this.getAccTitle = h, this.setDiagramTitle = u, this.getDiagramTitle = o, this.getAccDescription = d, this.setAccDescription = a, this.clear();
3427
- }
3428
- static {
3429
- r(this, "ArchitectureDB");
3430
- }
3431
- clear() {
3432
- this.nodes = {}, this.groups = {}, this.edges = [], this.registeredIds = {}, this.dataStructures = void 0, this.elements = {}, f();
3433
- }
3434
- addService({ id: e, icon: t, in: n, title: r, iconText: i }) {
3435
- if (this.registeredIds[e] !== void 0) throw Error(`The service id [${e}] is already in use by another ${this.registeredIds[e]}`);
3436
- if (n !== void 0) {
3437
- if (e === n) throw Error(`The service [${e}] cannot be placed within itself`);
3438
- if (this.registeredIds[n] === void 0) throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);
3439
- if (this.registeredIds[n] === "node") throw Error(`The service [${e}]'s parent is not a group`);
3440
- }
3441
- this.registeredIds[e] = "node", this.nodes[e] = {
3442
- id: e,
3443
- type: "service",
3444
- icon: t,
3445
- iconText: i,
3446
- title: r,
3447
- edges: [],
3448
- in: n
3449
- };
3450
- }
3451
- getServices() {
3452
- return Object.values(this.nodes).filter(H);
3453
- }
3454
- addJunction({ id: e, in: t }) {
3455
- if (this.registeredIds[e] !== void 0) throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds[e]}`);
3456
- if (t !== void 0) {
3457
- if (e === t) throw Error(`The junction [${e}] cannot be placed within itself`);
3458
- if (this.registeredIds[t] === void 0) throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);
3459
- if (this.registeredIds[t] === "node") throw Error(`The junction [${e}]'s parent is not a group`);
3460
- }
3461
- this.registeredIds[e] = "node", this.nodes[e] = {
3462
- id: e,
3463
- type: "junction",
3464
- edges: [],
3465
- in: t
3466
- };
3467
- }
3468
- getJunctions() {
3469
- return Object.values(this.nodes).filter(ne);
3470
- }
3471
- getNodes() {
3472
- return Object.values(this.nodes);
3473
- }
3474
- getNode(e) {
3475
- return this.nodes[e] ?? null;
3476
- }
3477
- addGroup({ id: e, icon: t, in: n, title: r }) {
3478
- if (this.registeredIds?.[e] !== void 0) throw Error(`The group id [${e}] is already in use by another ${this.registeredIds[e]}`);
3479
- if (n !== void 0) {
3480
- if (e === n) throw Error(`The group [${e}] cannot be placed within itself`);
3481
- if (this.registeredIds?.[n] === void 0) throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);
3482
- if (this.registeredIds?.[n] === "node") throw Error(`The group [${e}]'s parent is not a group`);
3483
- }
3484
- this.registeredIds[e] = "group", this.groups[e] = {
3485
- id: e,
3486
- icon: t,
3487
- title: r,
3488
- in: n
3489
- };
3490
- }
3491
- getGroups() {
3492
- return Object.values(this.groups);
3493
- }
3494
- addEdge({ lhsId: e, rhsId: t, lhsDir: n, rhsDir: r, lhsInto: i, rhsInto: a, lhsGroup: o, rhsGroup: s, title: c }) {
3495
- if (!P(n)) throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);
3496
- if (!P(r)) throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);
3497
- if (this.nodes[e] === void 0 && this.groups[e] === void 0) throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);
3498
- if (this.nodes[t] === void 0 && this.groups[t] === void 0) throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);
3499
- let l = this.nodes[e].in, u = this.nodes[t].in;
3500
- if (o && l && u && l == u) throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
3501
- if (s && l && u && l == u) throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);
3502
- let d = {
3503
- lhsId: e,
3504
- lhsDir: n,
3505
- lhsInto: i,
3506
- lhsGroup: o,
3507
- rhsId: t,
3508
- rhsDir: r,
3509
- rhsInto: a,
3510
- rhsGroup: s,
3511
- title: c
3512
- };
3513
- this.edges.push(d), this.nodes[e] && this.nodes[t] && (this.nodes[e].edges.push(this.edges[this.edges.length - 1]), this.nodes[t].edges.push(this.edges[this.edges.length - 1]));
3514
- }
3515
- getEdges() {
3516
- return this.edges;
3517
- }
3518
- getDataStructures() {
3519
- if (this.dataStructures === void 0) {
3520
- let e = {}, t = Object.entries(this.nodes).reduce((t, [n, r]) => (t[n] = r.edges.reduce((t, r) => {
3521
- let i = this.getNode(r.lhsId)?.in, a = this.getNode(r.rhsId)?.in;
3522
- if (i && a && i !== a) {
3523
- let t = te(r.lhsDir, r.rhsDir);
3524
- t !== "bend" && (e[i] ??= {}, e[i][a] = t, e[a] ??= {}, e[a][i] = t);
3525
- }
3526
- if (r.lhsId === n) {
3527
- let e = B(r.lhsDir, r.rhsDir);
3528
- e && (t[e] = r.rhsId);
3529
- } else {
3530
- let e = B(r.rhsDir, r.lhsDir);
3531
- e && (t[e] = r.lhsId);
3532
- }
3533
- return t;
3534
- }, {}), t), {}), n = Object.keys(t)[0], i = { [n]: 1 }, a = Object.keys(t).reduce((e, t) => t === n ? e : {
3535
- ...e,
3536
- [t]: 1
3537
- }, {}), o = /* @__PURE__ */ r((e) => {
3538
- let n = { [e]: [0, 0] }, r = [e];
3539
- for (; r.length > 0;) {
3540
- let e = r.shift();
3541
- if (e) {
3542
- i[e] = 1, delete a[e];
3543
- let o = t[e], [s, c] = n[e];
3544
- Object.entries(o).forEach(([e, t]) => {
3545
- i[t] || (n[t] = V([s, c], e), r.push(t));
3546
- });
3547
- }
3548
- }
3549
- return n;
3550
- }, "BFS"), s = [o(n)];
3551
- for (; Object.keys(a).length > 0;) s.push(o(Object.keys(a)[0]));
3552
- this.dataStructures = {
3553
- adjList: t,
3554
- spatialMaps: s,
3555
- groupAlignments: e
3556
- };
3557
- }
3558
- return this.dataStructures;
3559
- }
3560
- setElementForId(e, t) {
3561
- this.elements[e] = t;
3562
- }
3563
- getElementById(e) {
3564
- return this.elements[e];
3565
- }
3566
- getConfig() {
3567
- return _({
3568
- ...W,
3569
- ...g().architecture
3570
- });
3571
- }
3572
- getConfigField(e) {
3573
- return this.getConfig()[e];
3574
- }
3575
- }, ie = /* @__PURE__ */ r((e, t) => {
3576
- w(e, t), e.groups.map((e) => t.addGroup(e)), e.services.map((e) => t.addService({
3577
- ...e,
3578
- type: "service"
3579
- })), e.junctions.map((e) => t.addJunction({
3580
- ...e,
3581
- type: "junction"
3582
- })), e.edges.map((e) => t.addEdge(e));
3583
- }, "populateDb"), K = {
3584
- parser: { yy: void 0 },
3585
- parse: /* @__PURE__ */ r(async (e) => {
3586
- let t = await T("architecture", e);
3587
- n.debug(t);
3588
- let r = K.parser?.yy;
3589
- if (!(r instanceof G)) throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");
3590
- ie(t, r);
3591
- }, "parse")
3592
- }, q = /* @__PURE__ */ r((e) => `
3593
- .edge {
3594
- stroke-width: ${e.archEdgeWidth};
3595
- stroke: ${e.archEdgeColor};
3596
- fill: none;
3597
- }
3598
-
3599
- .arrow {
3600
- fill: ${e.archEdgeArrowColor};
3601
- }
3602
-
3603
- .node-bkg {
3604
- fill: none;
3605
- stroke: ${e.archGroupBorderColor};
3606
- stroke-width: ${e.archGroupBorderWidth};
3607
- stroke-dasharray: 8;
3608
- }
3609
- .node-icon-text {
3610
- display: flex;
3611
- align-items: center;
3612
- }
3613
-
3614
- .node-icon-text > div {
3615
- color: #fff;
3616
- margin: 1px;
3617
- height: fit-content;
3618
- text-align: center;
3619
- overflow: hidden;
3620
- display: -webkit-box;
3621
- -webkit-box-orient: vertical;
3622
- }
3623
- `, "getStyles"), J = /* @__PURE__ */ r((e) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`, "wrapIcon"), Y = {
3624
- prefix: "mermaid-architecture",
3625
- height: 80,
3626
- width: 80,
3627
- icons: {
3628
- database: { body: J("<path id=\"b\" data-name=\"4\" d=\"m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><path id=\"c\" data-name=\"3\" d=\"m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><path id=\"d\" data-name=\"2\" d=\"m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse id=\"e\" data-name=\"1\" cx=\"40\" cy=\"22.14\" rx=\"20\" ry=\"7.14\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"20\" y1=\"57.86\" x2=\"20\" y2=\"22.14\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"60\" y1=\"57.86\" x2=\"60\" y2=\"22.14\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/>") },
3629
- server: { body: J("<rect x=\"17.5\" y=\"17.5\" width=\"45\" height=\"45\" rx=\"2\" ry=\"2\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"17.5\" y1=\"32.5\" x2=\"62.5\" y2=\"32.5\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"17.5\" y1=\"47.5\" x2=\"62.5\" y2=\"47.5\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><g><path d=\"m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z\" style=\"fill: #fff; stroke-width: 0px;\"/><path d=\"m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10;\"/></g><g><path d=\"m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z\" style=\"fill: #fff; stroke-width: 0px;\"/><path d=\"m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10;\"/></g><g><path d=\"m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z\" style=\"fill: #fff; stroke-width: 0px;\"/><path d=\"m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10;\"/></g><g><circle cx=\"32.5\" cy=\"25\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/><circle cx=\"27.5\" cy=\"25\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/><circle cx=\"22.5\" cy=\"25\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/></g><g><circle cx=\"32.5\" cy=\"40\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/><circle cx=\"27.5\" cy=\"40\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/><circle cx=\"22.5\" cy=\"40\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/></g><g><circle cx=\"32.5\" cy=\"55\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/><circle cx=\"27.5\" cy=\"55\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/><circle cx=\"22.5\" cy=\"55\" r=\".75\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10;\"/></g>") },
3630
- disk: { body: J("<rect x=\"20\" y=\"15\" width=\"40\" height=\"50\" rx=\"1\" ry=\"1\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse cx=\"24\" cy=\"19.17\" rx=\".8\" ry=\".83\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse cx=\"56\" cy=\"19.17\" rx=\".8\" ry=\".83\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse cx=\"24\" cy=\"60.83\" rx=\".8\" ry=\".83\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse cx=\"56\" cy=\"60.83\" rx=\".8\" ry=\".83\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse cx=\"40\" cy=\"33.75\" rx=\"14\" ry=\"14.58\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><ellipse cx=\"40\" cy=\"33.75\" rx=\"4\" ry=\"4.17\" style=\"fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><path d=\"m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z\" style=\"fill: #fff; stroke-width: 0px;\"/>") },
3631
- internet: { body: J("<circle cx=\"40\" cy=\"40\" r=\"22.5\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"40\" y1=\"17.5\" x2=\"40\" y2=\"62.5\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"17.5\" y1=\"40\" x2=\"62.5\" y2=\"40\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><path d=\"m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><path d=\"m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"19.75\" y1=\"30.1\" x2=\"60.25\" y2=\"30.1\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/><line x1=\"19.75\" y1=\"49.9\" x2=\"60.25\" y2=\"49.9\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/>") },
3632
- cloud: { body: J("<path d=\"m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z\" style=\"fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;\"/>") },
3633
- unknown: b,
3634
- blank: { body: J("") }
3635
- }
3636
- }, ae = /* @__PURE__ */ r(async function(e, t, n) {
3637
- let r = n.getConfigField("padding"), i = n.getConfigField("iconSize"), a = i / 2, o = i / 6, s = o / 2;
3638
- await Promise.all(t.edges().map(async (t) => {
3639
- let { source: i, sourceDir: c, sourceArrow: l, sourceGroup: u, target: d, targetDir: f, targetArrow: m, targetGroup: h, label: g } = re(t), { x: _, y } = t[0].sourceEndpoint(), { x: b, y: x } = t[0].midpoint(), { x: C, y: w } = t[0].targetEndpoint(), T = r + 4;
3640
- if (u && (F(c) ? _ += c === "L" ? -T : T : y += c === "T" ? -T : T + 18), h && (F(f) ? C += f === "L" ? -T : T : w += f === "T" ? -T : T + 18), !u && n.getNode(i)?.type === "junction" && (F(c) ? _ += c === "L" ? a : -a : y += c === "T" ? a : -a), !h && n.getNode(d)?.type === "junction" && (F(f) ? C += f === "L" ? a : -a : w += f === "T" ? a : -a), t[0]._private.rscratch) {
3641
- let t = e.insert("g");
3642
- if (t.insert("path").attr("d", `M ${_},${y} L ${b},${x} L${C},${w} `).attr("class", "edge").attr("id", v(i, d, { prefix: "L" })), l) {
3643
- let e = F(c) ? M[c](_, o) : _ - s, n = I(c) ? M[c](y, o) : y - s;
3644
- t.insert("polygon").attr("points", j[c](o)).attr("transform", `translate(${e},${n})`).attr("class", "arrow");
3645
- }
3646
- if (m) {
3647
- let e = F(f) ? M[f](C, o) : C - s, n = I(f) ? M[f](w, o) : w - s;
3648
- t.insert("polygon").attr("points", j[f](o)).attr("transform", `translate(${e},${n})`).attr("class", "arrow");
3649
- }
3650
- if (g) {
3651
- let e = L(c, f) ? "XY" : F(c) ? "X" : "Y", n = 0;
3652
- n = e === "X" ? Math.abs(_ - C) : e === "Y" ? Math.abs(y - w) / 1.5 : Math.abs(_ - C) / 2;
3653
- let r = t.append("g");
3654
- if (await S(r, g, {
3655
- useHtmlLabels: !1,
3656
- width: n,
3657
- classes: "architecture-service-label"
3658
- }, p()), r.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), e === "X") r.attr("transform", "translate(" + b + ", " + x + ")");
3659
- else if (e === "Y") r.attr("transform", "translate(" + b + ", " + x + ") rotate(-90)");
3660
- else if (e === "XY") {
3661
- let e = B(c, f);
3662
- if (e && R(e)) {
3663
- let t = r.node().getBoundingClientRect(), [n, i] = ee(e);
3664
- r.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * n * i * 45})`);
3665
- let a = r.node().getBoundingClientRect();
3666
- r.attr("transform", `
3667
- translate(${b}, ${x - t.height / 2})
3668
- translate(${n * a.width / 2}, ${i * a.height / 2})
3669
- rotate(${-1 * n * i * 45}, 0, ${t.height / 2})
3670
- `);
3671
- }
3672
- }
3673
- }
3674
- }
3675
- }));
3676
- }, "drawEdges"), X = /* @__PURE__ */ r(async function(e, t, n) {
3677
- let r = n.getConfigField("padding") * .75, i = n.getConfigField("fontSize"), a = n.getConfigField("iconSize") / 2;
3678
- await Promise.all(t.nodes().map(async (t) => {
3679
- let o = U(t);
3680
- if (o.type === "group") {
3681
- let { h: s, w: c, x1: l, y1: u } = t.boundingBox(), d = e.append("rect");
3682
- d.attr("id", `group-${o.id}`).attr("x", l + a).attr("y", u + a).attr("width", c).attr("height", s).attr("class", "node-bkg");
3683
- let f = e.append("g"), m = l, h = u;
3684
- if (o.icon) {
3685
- let e = f.append("g");
3686
- e.html(`<g>${await C(o.icon, {
3687
- height: r,
3688
- width: r,
3689
- fallbackPrefix: Y.prefix
3690
- })}</g>`), e.attr("transform", "translate(" + (m + a + 1) + ", " + (h + a + 1) + ")"), m += r, h += i / 2 - 1 - 2;
3691
- }
3692
- if (o.label) {
3693
- let e = f.append("g");
3694
- await S(e, o.label, {
3695
- useHtmlLabels: !1,
3696
- width: c,
3697
- classes: "architecture-service-label"
3698
- }, p()), e.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), e.attr("transform", "translate(" + (m + a + 4) + ", " + (h + a + 2) + ")");
3699
- }
3700
- n.setElementForId(o.id, d);
3701
- }
3702
- }));
3703
- }, "drawGroups"), oe = /* @__PURE__ */ r(async function(e, t, n) {
3704
- let r = p();
3705
- for (let i of n) {
3706
- let n = t.append("g"), a = e.getConfigField("iconSize");
3707
- if (i.title) {
3708
- let e = n.append("g");
3709
- await S(e, i.title, {
3710
- useHtmlLabels: !1,
3711
- width: a * 1.5,
3712
- classes: "architecture-service-label"
3713
- }, r), e.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), e.attr("transform", "translate(" + a / 2 + ", " + a + ")");
3714
- }
3715
- let o = n.append("g");
3716
- if (i.icon) o.html(`<g>${await C(i.icon, {
3717
- height: a,
3718
- width: a,
3719
- fallbackPrefix: Y.prefix
3720
- })}</g>`);
3721
- else if (i.iconText) {
3722
- o.html(`<g>${await C("blank", {
3723
- height: a,
3724
- width: a,
3725
- fallbackPrefix: Y.prefix
3726
- })}</g>`);
3727
- let e = o.append("g").append("foreignObject").attr("width", a).attr("height", a).append("div").attr("class", "node-icon-text").attr("style", `height: ${a}px;`).append("div").html(c(i.iconText, r)), t = parseInt(window.getComputedStyle(e.node(), null).getPropertyValue("font-size").replace(/\D/g, "")) ?? 16;
3728
- e.attr("style", `-webkit-line-clamp: ${Math.floor((a - 2) / t)};`);
3729
- } else o.append("path").attr("class", "node-bkg").attr("id", "node-" + i.id).attr("d", `M0,${a} V5 Q0,0 5,0 H${a - 5} Q${a},0 ${a},5 V${a} Z`);
3730
- n.attr("id", `service-${i.id}`).attr("class", "architecture-service");
3731
- let { width: s, height: l } = n.node().getBBox();
3732
- i.width = s, i.height = l, e.setElementForId(i.id, n);
3733
- }
3734
- return 0;
3735
- }, "drawServices"), Z = /* @__PURE__ */ r(function(e, t, n) {
3736
- n.forEach((n) => {
3737
- let r = t.append("g"), i = e.getConfigField("iconSize");
3738
- r.append("g").append("rect").attr("id", "node-" + n.id).attr("fill-opacity", "0").attr("width", i).attr("height", i), r.attr("class", "architecture-junction");
3739
- let { width: a, height: o } = r._groups[0][0].getBBox();
3740
- r.width = a, r.height = o, e.setElementForId(n.id, r);
3741
- });
3742
- }, "drawJunctions");
3743
- x([{
3744
- name: Y.prefix,
3745
- icons: Y
3746
- }]), E.use(k.default);
3747
- function se(e, t, n) {
3748
- e.forEach((e) => {
3749
- t.add({
3750
- group: "nodes",
3751
- data: {
3752
- type: "service",
3753
- id: e.id,
3754
- icon: e.icon,
3755
- label: e.title,
3756
- parent: e.in,
3757
- width: n.getConfigField("iconSize"),
3758
- height: n.getConfigField("iconSize")
3759
- },
3760
- classes: "node-service"
3761
- });
3762
- });
3763
- }
3764
- r(se, "addServices");
3765
- function ce(e, t, n) {
3766
- e.forEach((e) => {
3767
- t.add({
3768
- group: "nodes",
3769
- data: {
3770
- type: "junction",
3771
- id: e.id,
3772
- parent: e.in,
3773
- width: n.getConfigField("iconSize"),
3774
- height: n.getConfigField("iconSize")
3775
- },
3776
- classes: "node-junction"
3777
- });
3778
- });
3779
- }
3780
- r(ce, "addJunctions");
3781
- function le(e, t) {
3782
- t.nodes().map((t) => {
3783
- let n = U(t);
3784
- n.type !== "group" && (n.x = t.position().x, n.y = t.position().y, e.getElementById(n.id).attr("transform", "translate(" + (n.x || 0) + "," + (n.y || 0) + ")"));
3785
- });
3786
- }
3787
- r(le, "positionNodes");
3788
- function ue(e, t) {
3789
- e.forEach((e) => {
3790
- t.add({
3791
- group: "nodes",
3792
- data: {
3793
- type: "group",
3794
- id: e.id,
3795
- icon: e.icon,
3796
- label: e.title,
3797
- parent: e.in
3798
- },
3799
- classes: "node-group"
3800
- });
3801
- });
3802
- }
3803
- r(ue, "addGroups");
3804
- function de(e, t) {
3805
- e.forEach((e) => {
3806
- let { lhsId: n, rhsId: r, lhsInto: i, lhsGroup: a, rhsInto: o, lhsDir: s, rhsDir: c, rhsGroup: l, title: u } = e, d = L(e.lhsDir, e.rhsDir) ? "segments" : "straight", f = {
3807
- id: `${n}-${r}`,
3808
- label: u,
3809
- source: n,
3810
- sourceDir: s,
3811
- sourceArrow: i,
3812
- sourceGroup: a,
3813
- sourceEndpoint: s === "L" ? "0 50%" : s === "R" ? "100% 50%" : s === "T" ? "50% 0" : "50% 100%",
3814
- target: r,
3815
- targetDir: c,
3816
- targetArrow: o,
3817
- targetGroup: l,
3818
- targetEndpoint: c === "L" ? "0 50%" : c === "R" ? "100% 50%" : c === "T" ? "50% 0" : "50% 100%"
3819
- };
3820
- t.add({
3821
- group: "edges",
3822
- data: f,
3823
- classes: d
3824
- });
3825
- });
3826
- }
3827
- r(de, "addEdges");
3828
- function fe(e, t, n) {
3829
- let i = /* @__PURE__ */ r((e, t) => Object.entries(e).reduce((e, [r, i]) => {
3830
- let a = 0, o = Object.entries(i);
3831
- if (o.length === 1) return e[r] = o[0][1], e;
3832
- for (let i = 0; i < o.length - 1; i++) for (let s = i + 1; s < o.length; s++) {
3833
- let [c, l] = o[i], [u, d] = o[s];
3834
- if (n[c]?.[u] === t) e[r] ??= [], e[r] = [
3835
- ...e[r],
3836
- ...l,
3837
- ...d
3838
- ];
3839
- else if (c === "default" || u === "default") e[r] ??= [], e[r] = [
3840
- ...e[r],
3841
- ...l,
3842
- ...d
3843
- ];
3844
- else {
3845
- let t = `${r}-${a++}`;
3846
- e[t] = l;
3847
- let n = `${r}-${a++}`;
3848
- e[n] = d;
3849
- }
3850
- }
3851
- return e;
3852
- }, {}), "flattenAlignments"), [a, o] = t.map((t) => {
3853
- let n = {}, r = {};
3854
- return Object.entries(t).forEach(([t, [i, a]]) => {
3855
- let o = e.getNode(t)?.in ?? "default";
3856
- n[a] ??= {}, n[a][o] ??= [], n[a][o].push(t), r[i] ??= {}, r[i][o] ??= [], r[i][o].push(t);
3857
- }), {
3858
- horiz: Object.values(i(n, "horizontal")).filter((e) => e.length > 1),
3859
- vert: Object.values(i(r, "vertical")).filter((e) => e.length > 1)
3860
- };
3861
- }).reduce(([e, t], { horiz: n, vert: r }) => [[...e, ...n], [...t, ...r]], [[], []]);
3862
- return {
3863
- horizontal: a,
3864
- vertical: o
3865
- };
3866
- }
3867
- r(fe, "getAlignments");
3868
- function pe(e, t) {
3869
- let n = [], i = /* @__PURE__ */ r((e) => `${e[0]},${e[1]}`, "posToStr"), a = /* @__PURE__ */ r((e) => e.split(",").map((e) => parseInt(e)), "strToPos");
3870
- return e.forEach((e) => {
3871
- let r = Object.fromEntries(Object.entries(e).map(([e, t]) => [i(t), e])), o = [i([0, 0])], s = {}, c = {
3872
- L: [-1, 0],
3873
- R: [1, 0],
3874
- T: [0, 1],
3875
- B: [0, -1]
3876
- };
3877
- for (; o.length > 0;) {
3878
- let e = o.shift();
3879
- if (e) {
3880
- s[e] = 1;
3881
- let l = r[e];
3882
- if (l) {
3883
- let u = a(e);
3884
- Object.entries(c).forEach(([e, a]) => {
3885
- let c = i([u[0] + a[0], u[1] + a[1]]), d = r[c];
3886
- d && !s[c] && (o.push(c), n.push({
3887
- [A[e]]: d,
3888
- [A[N(e)]]: l,
3889
- gap: 1.5 * t.getConfigField("iconSize")
3890
- }));
3891
- });
3892
- }
3893
- }
3894
- }
3895
- }), n;
3896
- }
3897
- r(pe, "getRelativeConstraints");
3898
- function me(e, t, a, o, s, { spatialMaps: c, groupAlignments: l }) {
3899
- return new Promise((u) => {
3900
- let d = i("body").append("div").attr("id", "cy").attr("style", "display:none"), f = E({
3901
- container: document.getElementById("cy"),
3902
- style: [
3903
- {
3904
- selector: "edge",
3905
- style: {
3906
- "curve-style": "straight",
3907
- label: "data(label)",
3908
- "source-endpoint": "data(sourceEndpoint)",
3909
- "target-endpoint": "data(targetEndpoint)"
3910
- }
3911
- },
3912
- {
3913
- selector: "edge.segments",
3914
- style: {
3915
- "curve-style": "segments",
3916
- "segment-weights": "0",
3917
- "segment-distances": [.5],
3918
- "edge-distances": "endpoints",
3919
- "source-endpoint": "data(sourceEndpoint)",
3920
- "target-endpoint": "data(targetEndpoint)"
3921
- }
3922
- },
3923
- {
3924
- selector: "node",
3925
- style: { "compound-sizing-wrt-labels": "include" }
3926
- },
3927
- {
3928
- selector: "node[label]",
3929
- style: {
3930
- "text-valign": "bottom",
3931
- "text-halign": "center",
3932
- "font-size": `${s.getConfigField("fontSize")}px`
3933
- }
3934
- },
3935
- {
3936
- selector: ".node-service",
3937
- style: {
3938
- label: "data(label)",
3939
- width: "data(width)",
3940
- height: "data(height)"
3941
- }
3942
- },
3943
- {
3944
- selector: ".node-junction",
3945
- style: {
3946
- width: "data(width)",
3947
- height: "data(height)"
3948
- }
3949
- },
3950
- {
3951
- selector: ".node-group",
3952
- style: { padding: `${s.getConfigField("padding")}px` }
3953
- }
3954
- ],
3955
- layout: {
3956
- name: "grid",
3957
- boundingBox: {
3958
- x1: 0,
3959
- x2: 100,
3960
- y1: 0,
3961
- y2: 100
3962
- }
3963
- }
3964
- });
3965
- d.remove(), ue(a, f), se(e, f, s), ce(t, f, s), de(o, f);
3966
- let p = fe(s, c, l), m = pe(c, s), h = f.layout({
3967
- name: "fcose",
3968
- quality: "proof",
3969
- styleEnabled: !1,
3970
- animate: !1,
3971
- nodeDimensionsIncludeLabels: !1,
3972
- idealEdgeLength(e) {
3973
- let [t, n] = e.connectedNodes(), { parent: r } = U(t), { parent: i } = U(n);
3974
- return r === i ? 1.5 * s.getConfigField("iconSize") : .5 * s.getConfigField("iconSize");
3975
- },
3976
- edgeElasticity(e) {
3977
- let [t, n] = e.connectedNodes(), { parent: r } = U(t), { parent: i } = U(n);
3978
- return r === i ? .45 : .001;
3979
- },
3980
- alignmentConstraint: p,
3981
- relativePlacementConstraint: m
3982
- });
3983
- h.one("layoutstop", () => {
3984
- function e(e, t, n, r) {
3985
- let i, a, { x: o, y: s } = e, { x: c, y: l } = t;
3986
- a = (r - s + (o - n) * (s - l) / (o - c)) / Math.sqrt(1 + ((s - l) / (o - c)) ** 2), i = Math.sqrt((r - s) ** 2 + (n - o) ** 2 - a ** 2);
3987
- let u = Math.sqrt((c - o) ** 2 + (l - s) ** 2);
3988
- i /= u;
3989
- let d = (c - o) * (r - s) - (l - s) * (n - o);
3990
- switch (!0) {
3991
- case d >= 0:
3992
- d = 1;
3993
- break;
3994
- case d < 0:
3995
- d = -1;
3996
- break;
3997
- }
3998
- let f = (c - o) * (n - o) + (l - s) * (r - s);
3999
- switch (!0) {
4000
- case f >= 0:
4001
- f = 1;
4002
- break;
4003
- case f < 0:
4004
- f = -1;
4005
- break;
4006
- }
4007
- return a = Math.abs(a) * d, i *= f, {
4008
- distances: a,
4009
- weights: i
4010
- };
4011
- }
4012
- r(e, "getSegmentWeights"), f.startBatch();
4013
- for (let t of Object.values(f.edges())) if (t.data?.()) {
4014
- let { x: n, y: r } = t.source().position(), { x: i, y: a } = t.target().position();
4015
- if (n !== i && r !== a) {
4016
- let n = t.sourceEndpoint(), r = t.targetEndpoint(), { sourceDir: i } = re(t), [a, o] = I(i) ? [n.x, r.y] : [r.x, n.y], { weights: s, distances: c } = e(n, r, a, o);
4017
- t.style("segment-distances", c), t.style("segment-weights", s);
4018
- }
4019
- }
4020
- f.endBatch(), h.run();
4021
- }), h.run(), f.ready((e) => {
4022
- n.info("Ready", e), u(f);
4023
- });
4024
- });
4025
- }
4026
- r(me, "layoutArchitecture");
4027
- var he = {
4028
- parser: K,
4029
- get db() {
4030
- return new G();
4031
- },
4032
- renderer: { draw: /* @__PURE__ */ r(async (e, t, n, r) => {
4033
- let i = r.db, a = i.getServices(), o = i.getJunctions(), c = i.getGroups(), l = i.getEdges(), u = i.getDataStructures(), d = y(t), f = d.append("g");
4034
- f.attr("class", "architecture-edges");
4035
- let p = d.append("g");
4036
- p.attr("class", "architecture-services");
4037
- let m = d.append("g");
4038
- m.attr("class", "architecture-groups"), await oe(i, p, a), Z(i, p, o);
4039
- let h = await me(a, o, c, l, i, u);
4040
- await ae(f, h, i), await X(m, h, i), le(i, h), s(void 0, d, i.getConfigField("padding"), i.getConfigField("useMaxWidth"));
4041
- }, "draw") },
4042
- styles: q
4043
- };
4044
- //#endregion
4045
- export { he as diagram };
4046
-
4047
- //# sourceMappingURL=architectureDiagram-2XIMDMQ5-g-HotzpG.js.map