@layers-app/editor 0.0.21 → 0.0.23

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 (242) hide show
  1. package/README.md +47 -2
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +195 -2
  4. package/dist/index.js +2 -2
  5. package/dist/layers.-RxAm5pH.js +795 -0
  6. package/dist/layers.-rS-aTo2.js +33 -0
  7. package/dist/layers.2ODaB2Pd.js +8 -0
  8. package/dist/layers.5BbX0Xoz.js +769 -0
  9. package/dist/layers.7JqFgE4-.js +15 -0
  10. package/dist/layers.9QK1wiQj.js +1 -0
  11. package/dist/layers.9pNaFvaX.js +1 -0
  12. package/dist/layers.B-6oGNjd.js +40 -0
  13. package/dist/layers.B-ie1_cm.js +6 -0
  14. package/dist/layers.B0EkntbT.js +32 -0
  15. package/dist/layers.B0pdr1hX.js +1619 -0
  16. package/dist/layers.B19hGmey.js +1 -0
  17. package/dist/layers.B39TZ2WV.js +11 -0
  18. package/dist/layers.B3odqoHb.js +9 -0
  19. package/dist/layers.B64g6Zx2.js +1 -0
  20. package/dist/layers.B6UkAKu5.js +434 -0
  21. package/dist/layers.B8i9d7Qz.js +192 -0
  22. package/dist/layers.B9NSFeaj.js +35 -0
  23. package/dist/layers.B9zrmkst.js +11 -0
  24. package/dist/layers.BAtv1CM7.js +1 -0
  25. package/dist/layers.BBB7YGK1.js +3 -0
  26. package/dist/layers.BBU3ik5q.js +51 -0
  27. package/dist/layers.BBwDvE6l.js +9122 -0
  28. package/dist/layers.BCFHxkpM.js +6 -0
  29. package/dist/layers.BD5uUnI2.js +1265 -0
  30. package/dist/layers.BDhuxbhX.js +44 -0
  31. package/dist/layers.BDxQSquK.js +10 -0
  32. package/dist/layers.BEE5yqs5.js +9 -0
  33. package/dist/layers.BFLg4UGe.js +8 -0
  34. package/dist/layers.BFOl7cA-.js +41 -0
  35. package/dist/layers.BHDiP2sq.js +21836 -0
  36. package/dist/layers.BIDnkNut.js +1510 -0
  37. package/dist/layers.BIVmclKv.js +41 -0
  38. package/dist/layers.BIeVwYKL.js +1 -0
  39. package/dist/layers.BJMMuP5r.js +9 -0
  40. package/dist/layers.BK01wvsE.js +10 -0
  41. package/dist/layers.BLB-feoT.js +8 -0
  42. package/dist/layers.BLSqqbWP.js +207 -0
  43. package/dist/layers.BO3dqWyO.js +10 -0
  44. package/dist/layers.BPe9NQzP.js +2963 -0
  45. package/dist/layers.BPnpanwd.js +39 -0
  46. package/dist/layers.BQLZhz6B.js +6 -0
  47. package/dist/layers.BST6tR9a.js +4 -0
  48. package/dist/layers.BSTBZrFn.js +1 -0
  49. package/dist/layers.BUSnd1Ro.js +5 -0
  50. package/dist/layers.BUkDq4ln.js +84 -0
  51. package/dist/layers.BUsBCyiL.js +202 -0
  52. package/dist/layers.BXGiOI1Z.js +7 -0
  53. package/dist/layers.BYVHkqLR.js +39 -0
  54. package/dist/layers.BYzN4Zxz.js +7 -0
  55. package/dist/layers.BZcZF6Ct.js +41 -0
  56. package/dist/layers.B_Hf0SF-.js +1359 -0
  57. package/dist/{layers.BYmCD0mp.js → layers.Ba97nTEK.js} +1 -1
  58. package/dist/layers.Bbl6qitU.js +40 -0
  59. package/dist/layers.BdanmQPF.js +11 -0
  60. package/dist/layers.Bfd5bOAD.js +37 -0
  61. package/dist/layers.BhM2iCwB.js +5 -0
  62. package/dist/layers.BjZInKjA.js +2 -0
  63. package/dist/layers.Bk2PdkMX.js +10 -0
  64. package/dist/layers.BkMfeJ9R.js +41 -0
  65. package/dist/layers.BkjjkAwW.js +2 -0
  66. package/dist/layers.Blho0qwc.js +1 -0
  67. package/dist/layers.BoabOlrX.js +36 -0
  68. package/dist/layers.BpXiFzvR.js +36 -0
  69. package/dist/layers.BpilXLfW.js +6 -0
  70. package/dist/layers.BuQ1nJmP.js +1 -0
  71. package/dist/layers.Bv0tGvGl.js +40 -0
  72. package/dist/layers.BvZFIFgz.js +9 -0
  73. package/dist/layers.BwfB_nzW.js +8 -0
  74. package/dist/layers.Bwpn7zKE.js +9 -0
  75. package/dist/layers.Bz0ApNUe.js +70 -0
  76. package/dist/layers.C-G7-Jg3.js +7 -0
  77. package/dist/layers.C0bumYdC.js +7 -0
  78. package/dist/layers.C1KhBpGU.js +7 -0
  79. package/dist/layers.C3K_Whht.js +42 -0
  80. package/dist/layers.C51kZnWr.js +37 -0
  81. package/dist/layers.C5rttXXy.js +10 -0
  82. package/dist/{layers.CKC0lJDn.js → layers.C5uR7AiN.js} +1 -1
  83. package/dist/layers.C6Rn8zoI.js +42 -0
  84. package/dist/layers.C7lIplJU.js +247 -0
  85. package/dist/layers.CBXpUMze.js +96 -0
  86. package/dist/layers.CCRe_IA7.js +36 -0
  87. package/dist/{layers.CFJiIrku.js → layers.CClfR9Rs.js} +14180 -12682
  88. package/dist/layers.CDLdte-o.js +9 -0
  89. package/dist/layers.CDzPpnhN.js +52 -0
  90. package/dist/layers.CEXVJbhn.js +8 -0
  91. package/dist/layers.CGX7Piy7.js +1 -0
  92. package/dist/layers.CGc04km7.js +42 -0
  93. package/dist/layers.CH23k4XD.js +6 -0
  94. package/dist/layers.CHHqQlm1.js +9 -0
  95. package/dist/layers.CHZsXQcr.js +1 -0
  96. package/dist/layers.CMS1o_sE.js +40 -0
  97. package/dist/layers.CO4NHmK3.js +40 -0
  98. package/dist/layers.COAF7f8g.js +1 -0
  99. package/dist/layers.CPV5PaJ7.js +33 -0
  100. package/dist/layers.CPqqkX8Z.js +23 -0
  101. package/dist/layers.CQXDzk5h.js +1 -0
  102. package/dist/layers.CQv0GMRl.js +1 -0
  103. package/dist/layers.CR10RAJi.js +116 -0
  104. package/dist/layers.CR4riLSc.js +2235 -0
  105. package/dist/layers.CSjWzlk9.js +1 -0
  106. package/dist/layers.CTmkjIN6.js +5 -0
  107. package/dist/layers.CZMy0ug4.js +6 -0
  108. package/dist/layers.CZh7NZyl.js +42 -0
  109. package/dist/layers.C_dOgKfE.js +10 -0
  110. package/dist/layers.CcJ28sUd.js +9 -0
  111. package/dist/layers.CeMe5scF.js +1 -0
  112. package/dist/layers.CeVpKhli.js +122 -0
  113. package/dist/layers.Ch7C0MR9.js +39 -0
  114. package/dist/layers.ChAMqLmE.js +160 -0
  115. package/dist/layers.ChJyurjQ.js +7 -0
  116. package/dist/layers.ChPHYv68.js +41 -0
  117. package/dist/layers.ChykDTOy.js +11 -0
  118. package/dist/layers.Ci0QS82_.js +1 -0
  119. package/dist/layers.Ci0x4aAi.js +139 -0
  120. package/dist/layers.CiNAQOA-.js +50 -0
  121. package/dist/layers.Ck0iJfoW.js +39 -0
  122. package/dist/layers.Ckbp-T9r.js +32 -0
  123. package/dist/layers.Cl9Tl2nd.js +1 -0
  124. package/dist/layers.ClQj75nc.js +11 -0
  125. package/dist/layers.ClaqpFnu.js +233 -0
  126. package/dist/layers.CmHSmrZm.js +40 -0
  127. package/dist/layers.Cn6OfRlw.js +40 -0
  128. package/dist/layers.CnD3z0eZ.js +8 -0
  129. package/dist/layers.CnloMtKN.js +268 -0
  130. package/dist/layers.Cp82yltX.js +32 -0
  131. package/dist/layers.CphCG076.js +6 -0
  132. package/dist/layers.CqM3rL4-.js +5 -0
  133. package/dist/layers.CqVTtuYm.js +6 -0
  134. package/dist/layers.CvJxfPxo.js +9 -0
  135. package/dist/layers.CwPFdFUT.js +34 -0
  136. package/dist/layers.Cx14IKzN.js +4 -0
  137. package/dist/layers.Cxmncz59.js +32 -0
  138. package/dist/layers.D-ZYFolm.js +1 -0
  139. package/dist/layers.D0zn4_Mx.js +1 -0
  140. package/dist/layers.D18RSmmQ.js +7 -0
  141. package/dist/layers.D1cZq8tq.js +373 -0
  142. package/dist/layers.D2q8ZYi2.js +425 -0
  143. package/dist/layers.D2vOkfMK.js +38 -0
  144. package/dist/layers.D3Hkinja.js +5 -0
  145. package/dist/layers.D4fGb2cV.js +1272 -0
  146. package/dist/layers.D68FZk66.js +39 -0
  147. package/dist/layers.D7HvMBb6.js +39 -0
  148. package/dist/layers.D7jGxypv.js +8 -0
  149. package/dist/layers.D90-hSDT.js +4 -0
  150. package/dist/layers.D9A031XO.js +803 -0
  151. package/dist/layers.DARK07JA.js +42 -0
  152. package/dist/layers.DAx0hT2g.js +32 -0
  153. package/dist/layers.DCvUAfE1.js +40 -0
  154. package/dist/layers.DDRgaMwu.js +10 -0
  155. package/dist/layers.DEfJs03Z.js +1 -0
  156. package/dist/layers.DElpVOY-.js +8 -0
  157. package/dist/layers.DFd9A85i.js +14 -0
  158. package/dist/layers.DGZUGztZ.js +220 -0
  159. package/dist/layers.DHbdkCCU.js +38 -0
  160. package/dist/layers.DIrkcLlA.js +790 -0
  161. package/dist/layers.DKPzrygv.js +1 -0
  162. package/dist/layers.DK_t52oS.js +1126 -0
  163. package/dist/layers.DLwuMfdd.js +84 -0
  164. package/dist/layers.DMkBISW1.js +1 -0
  165. package/dist/layers.DMvWe0pJ.js +7 -0
  166. package/dist/layers.DN9HoVxI.js +18 -0
  167. package/dist/layers.DO-G3uLL.js +8 -0
  168. package/dist/layers.DOrgOHBr.js +1 -0
  169. package/dist/layers.DQCPMqIN.js +9 -0
  170. package/dist/layers.DTDpNGfk.js +1 -0
  171. package/dist/layers.DXTPaWjN.js +37 -0
  172. package/dist/layers.DXaSAlDN.js +13 -0
  173. package/dist/layers.DYx3Ot6h.js +139 -0
  174. package/dist/layers.D_MU5WlI.js +40 -0
  175. package/dist/layers.DalYdEkL.js +19 -0
  176. package/dist/layers.DbaKVP5e.js +1 -0
  177. package/dist/layers.Dbuivk7d.js +36 -0
  178. package/dist/layers.DdTLZZKb.js +48146 -0
  179. package/dist/layers.DeB3waPT.js +8 -0
  180. package/dist/layers.Dg8Wbn90.js +35 -0
  181. package/dist/layers.DhiFm4jW.js +10 -0
  182. package/dist/layers.DhzTwBn5.js +37 -0
  183. package/dist/layers.DjUOC4st.js +16 -0
  184. package/dist/layers.Dk9dbz6F.js +118 -0
  185. package/dist/layers.Dklz2JqP.js +41 -0
  186. package/dist/layers.Dol0x5Jd.js +61 -0
  187. package/dist/layers.DrtkQKK7.js +1 -0
  188. package/dist/layers.Ds95POLS.js +1 -0
  189. package/dist/layers.DsAtBUs-.js +1283 -0
  190. package/dist/layers.DtoCH9Nn.js +1 -0
  191. package/dist/layers.DwLw5o0M.js +38 -0
  192. package/dist/layers.DxA6ocdw.js +70 -0
  193. package/dist/layers.DxGDxkXA.js +164 -0
  194. package/dist/layers.Dxrm0nEM.js +2479 -0
  195. package/dist/layers.Dy1naDTQ.js +14 -0
  196. package/dist/layers.Dyor8Hot.js +186 -0
  197. package/dist/layers.Dyqg_e4P.js +41 -0
  198. package/dist/layers.DzaH7mDC.js +65 -0
  199. package/dist/layers.Dzc83sE7.js +1 -0
  200. package/dist/layers.FstVqdQC.js +804 -0
  201. package/dist/layers.HcI9cOEd.js +1089 -0
  202. package/dist/layers.I-MG0ir4.js +21461 -0
  203. package/dist/layers.I5-pSyca.js +1 -0
  204. package/dist/layers.JWCLFILJ.js +1 -0
  205. package/dist/layers.LOjND5R4.js +320 -0
  206. package/dist/{layers.BKFthpnI.js → layers.L_XjkGw6.js} +24 -24
  207. package/dist/layers.Lhl12ohc.js +1 -0
  208. package/dist/layers.N4wL2Xyj.js +1083 -0
  209. package/dist/layers.OEP2K3db.js +4 -0
  210. package/dist/layers.PO65UmTA.js +10 -0
  211. package/dist/layers.PhLwHKUM.js +40 -0
  212. package/dist/layers.Tatx7z0m.js +55 -0
  213. package/dist/layers.UbqG2dp_.js +10 -0
  214. package/dist/layers.WsdOSV4y.js +2 -0
  215. package/dist/{layers.C99LCymA.js → layers.Y41CVpLS.js} +70 -70
  216. package/dist/layers.Ym7pRGM7.js +84 -0
  217. package/dist/layers.b0h5ZBmD.js +61 -0
  218. package/dist/layers.c_QDfgff.js +257 -0
  219. package/dist/layers.cp645rbn.js +7 -0
  220. package/dist/layers.dqI-yLmM.js +41 -0
  221. package/dist/layers.fTcEk1do.js +261 -0
  222. package/dist/layers.gRKbOYG-.js +960 -0
  223. package/dist/layers.gaT5_-NN.js +32 -0
  224. package/dist/layers.gzGcAwbO.js +904 -0
  225. package/dist/layers.h0tSRttU.js +1 -0
  226. package/dist/layers.hkFN-BS0.js +39 -0
  227. package/dist/layers.iw01AOuQ.js +931 -0
  228. package/dist/layers.k2UyvrHI.js +35 -0
  229. package/dist/layers.kY3ZYtED.js +1 -0
  230. package/dist/layers.kthR742N.js +39 -0
  231. package/dist/layers.lCpg7dOn.js +21 -0
  232. package/dist/layers.lLRqycMO.js +39 -0
  233. package/dist/layers.oFAtdeQ1.js +501 -0
  234. package/dist/layers.p9hSNB6N.js +1 -0
  235. package/dist/layers.paz6tc0L.js +1034 -0
  236. package/dist/layers.rRMBW9ET.js +1580 -0
  237. package/dist/layers.tbRLuldN.js +1 -0
  238. package/dist/layers.x6Qk2Mwl.js +8 -0
  239. package/dist/layers.x6ioP3u0.js +423 -0
  240. package/dist/layers.za1sylgg.js +11692 -0
  241. package/package.json +6 -5
  242. package/dist/layers.F7W7VvW1.js +0 -164
@@ -0,0 +1,1083 @@
1
+ import { l as g, r as lt, g as b, t as H, d as E, u as j, i as q, v as Q } from "./layers.BBwDvE6l.js";
2
+ import { c as st } from "./layers.BPe9NQzP.js";
3
+ import { l as ct } from "./layers.-rS-aTo2.js";
4
+ const ht = (e, t, a, i) => {
5
+ t.forEach((l) => {
6
+ wt[l](e, a, i);
7
+ });
8
+ }, ot = (e, t, a) => {
9
+ g.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
10
+ }, yt = (e, t, a) => {
11
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
12
+ }, ft = (e, t, a) => {
13
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
14
+ }, pt = (e, t, a) => {
15
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
16
+ }, dt = (e, t, a) => {
17
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
18
+ }, xt = (e, t, a) => {
19
+ e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
20
+ }, gt = (e, t, a) => {
21
+ e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
22
+ }, ut = (e, t, a) => {
23
+ e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
24
+ }, bt = (e, t, a) => {
25
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
26
+ }, wt = {
27
+ extension: ot,
28
+ composition: yt,
29
+ aggregation: ft,
30
+ dependency: pt,
31
+ lollipop: dt,
32
+ point: xt,
33
+ circle: gt,
34
+ cross: ut,
35
+ barb: bt
36
+ }, hr = ht;
37
+ function mt(e, t) {
38
+ t && e.attr("style", t);
39
+ }
40
+ function kt(e) {
41
+ const t = E(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), a = t.append("xhtml:div"), i = e.label, l = e.isNode ? "nodeLabel" : "edgeLabel";
42
+ return a.html(
43
+ '<span class="' + l + '" ' + (e.labelStyle ? 'style="' + e.labelStyle + '"' : "") + ">" + i + "</span>"
44
+ ), mt(a, e.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap"), a.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node();
45
+ }
46
+ const vt = (e, t, a, i) => {
47
+ let l = e || "";
48
+ if (typeof l == "object" && (l = l[0]), H(b().flowchart.htmlLabels)) {
49
+ l = l.replace(/\\n|\n/g, "<br />"), g.debug("vertexText" + l);
50
+ const r = {
51
+ isNode: i,
52
+ label: Q(l).replace(
53
+ /fa[blrs]?:fa-[\w-]+/g,
54
+ // cspell: disable-line
55
+ (n) => `<i class='${n.replace(":", " ")}'></i>`
56
+ ),
57
+ labelStyle: t.replace("fill:", "color:")
58
+ };
59
+ return kt(r);
60
+ } else {
61
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
62
+ r.setAttribute("style", t.replace("color:", "fill:"));
63
+ let s = [];
64
+ typeof l == "string" ? s = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? s = l : s = [];
65
+ for (const n of s) {
66
+ const c = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
67
+ c.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), c.setAttribute("dy", "1em"), c.setAttribute("x", "0"), a ? c.setAttribute("class", "title-row") : c.setAttribute("class", "row"), c.textContent = n.trim(), r.appendChild(c);
68
+ }
69
+ return r;
70
+ }
71
+ }, R = vt, M = async (e, t, a, i) => {
72
+ let l;
73
+ const r = t.useHtmlLabels || H(b().flowchart.htmlLabels);
74
+ a ? l = a : l = "node default";
75
+ const s = e.insert("g").attr("class", l).attr("id", t.domId || t.id), n = s.insert("g").attr("class", "label").attr("style", t.labelStyle);
76
+ let c;
77
+ t.labelText === void 0 ? c = "" : c = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
78
+ const o = n.node();
79
+ let h;
80
+ t.labelType === "markdown" ? h = st(n, q(Q(c), b()), {
81
+ useHtmlLabels: r,
82
+ width: t.width || b().flowchart.wrappingWidth,
83
+ classes: "markdown-node-label"
84
+ }) : h = o.appendChild(
85
+ R(
86
+ q(Q(c), b()),
87
+ t.labelStyle,
88
+ !1,
89
+ i
90
+ )
91
+ );
92
+ let y = h.getBBox();
93
+ const p = t.padding / 2;
94
+ if (H(b().flowchart.htmlLabels)) {
95
+ const f = h.children[0], x = E(h), k = f.getElementsByTagName("img");
96
+ if (k) {
97
+ const d = c.replace(/<img[^>]*>/g, "").trim() === "";
98
+ await Promise.all(
99
+ [...k].map(
100
+ (u) => new Promise((S) => {
101
+ function B() {
102
+ if (u.style.display = "flex", u.style.flexDirection = "column", d) {
103
+ const C = b().fontSize ? b().fontSize : window.getComputedStyle(document.body).fontSize, D = parseInt(C, 10) * 5 + "px";
104
+ u.style.minWidth = D, u.style.maxWidth = D;
105
+ } else
106
+ u.style.width = "100%";
107
+ S(u);
108
+ }
109
+ setTimeout(() => {
110
+ u.complete && B();
111
+ }), u.addEventListener("error", B), u.addEventListener("load", B);
112
+ })
113
+ )
114
+ );
115
+ }
116
+ y = f.getBoundingClientRect(), x.attr("width", y.width), x.attr("height", y.height);
117
+ }
118
+ return r ? n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : n.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), n.insert("rect", ":first-child"), { shapeSvg: s, bbox: y, halfPadding: p, label: n };
119
+ }, m = (e, t) => {
120
+ const a = t.node().getBBox();
121
+ e.width = a.width, e.height = a.height;
122
+ };
123
+ function I(e, t, a, i) {
124
+ return e.insert("polygon", ":first-child").attr(
125
+ "points",
126
+ i.map(function(l) {
127
+ return l.x + "," + l.y;
128
+ }).join(" ")
129
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
130
+ }
131
+ function Lt(e, t) {
132
+ return e.intersect(t);
133
+ }
134
+ function it(e, t, a, i) {
135
+ var l = e.x, r = e.y, s = l - i.x, n = r - i.y, c = Math.sqrt(t * t * n * n + a * a * s * s), o = Math.abs(t * a * s / c);
136
+ i.x < l && (o = -o);
137
+ var h = Math.abs(t * a * n / c);
138
+ return i.y < r && (h = -h), { x: l + o, y: r + h };
139
+ }
140
+ function St(e, t, a) {
141
+ return it(e, t, t, a);
142
+ }
143
+ function Mt(e, t, a, i) {
144
+ var l, r, s, n, c, o, h, y, p, f, x, k, d, u, S;
145
+ if (l = t.y - e.y, s = e.x - t.x, c = t.x * e.y - e.x * t.y, p = l * a.x + s * a.y + c, f = l * i.x + s * i.y + c, !(p !== 0 && f !== 0 && J(p, f)) && (r = i.y - a.y, n = a.x - i.x, o = i.x * a.y - a.x * i.y, h = r * e.x + n * e.y + o, y = r * t.x + n * t.y + o, !(h !== 0 && y !== 0 && J(h, y)) && (x = l * n - r * s, x !== 0)))
146
+ return k = Math.abs(x / 2), d = s * o - n * c, u = d < 0 ? (d - k) / x : (d + k) / x, d = r * c - l * o, S = d < 0 ? (d - k) / x : (d + k) / x, { x: u, y: S };
147
+ }
148
+ function J(e, t) {
149
+ return e * t > 0;
150
+ }
151
+ function Tt(e, t, a) {
152
+ var i = e.x, l = e.y, r = [], s = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
153
+ typeof t.forEach == "function" ? t.forEach(function(x) {
154
+ s = Math.min(s, x.x), n = Math.min(n, x.y);
155
+ }) : (s = Math.min(s, t.x), n = Math.min(n, t.y));
156
+ for (var c = i - e.width / 2 - s, o = l - e.height / 2 - n, h = 0; h < t.length; h++) {
157
+ var y = t[h], p = t[h < t.length - 1 ? h + 1 : 0], f = Mt(
158
+ e,
159
+ a,
160
+ { x: c + y.x, y: o + y.y },
161
+ { x: c + p.x, y: o + p.y }
162
+ );
163
+ f && r.push(f);
164
+ }
165
+ return r.length ? (r.length > 1 && r.sort(function(x, k) {
166
+ var d = x.x - a.x, u = x.y - a.y, S = Math.sqrt(d * d + u * u), B = k.x - a.x, C = k.y - a.y, X = Math.sqrt(B * B + C * C);
167
+ return S < X ? -1 : S === X ? 0 : 1;
168
+ }), r[0]) : e;
169
+ }
170
+ const Bt = (e, t) => {
171
+ var a = e.x, i = e.y, l = t.x - a, r = t.y - i, s = e.width / 2, n = e.height / 2, c, o;
172
+ return Math.abs(r) * s > Math.abs(l) * n ? (r < 0 && (n = -n), c = r === 0 ? 0 : n * l / r, o = n) : (l < 0 && (s = -s), c = s, o = l === 0 ? 0 : s * r / l), { x: a + c, y: i + o };
173
+ }, Et = Bt, w = {
174
+ node: Lt,
175
+ circle: St,
176
+ ellipse: it,
177
+ polygon: Tt,
178
+ rect: Et
179
+ }, Ct = async (e, t) => {
180
+ t.useHtmlLabels || b().flowchart.htmlLabels || (t.centerLabel = !0);
181
+ const { shapeSvg: i, bbox: l, halfPadding: r } = await M(
182
+ e,
183
+ t,
184
+ "node " + t.classes,
185
+ !0
186
+ );
187
+ g.info("Classes = ", t.classes);
188
+ const s = i.insert("rect", ":first-child");
189
+ return s.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - r).attr("y", -l.height / 2 - r).attr("width", l.width + t.padding).attr("height", l.height + t.padding), m(t, s), t.intersect = function(n) {
190
+ return w.rect(t, n);
191
+ }, i;
192
+ }, $t = Ct, _t = (e) => {
193
+ const t = /* @__PURE__ */ new Set();
194
+ for (const a of e)
195
+ switch (a) {
196
+ case "x":
197
+ t.add("right"), t.add("left");
198
+ break;
199
+ case "y":
200
+ t.add("up"), t.add("down");
201
+ break;
202
+ default:
203
+ t.add(a);
204
+ break;
205
+ }
206
+ return t;
207
+ }, Rt = (e, t, a) => {
208
+ const i = _t(e), l = 2, r = t.height + 2 * a.padding, s = r / l, n = t.width + 2 * s + a.padding, c = a.padding / 2;
209
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
210
+ // Bottom
211
+ { x: 0, y: 0 },
212
+ { x: s, y: 0 },
213
+ { x: n / 2, y: 2 * c },
214
+ { x: n - s, y: 0 },
215
+ { x: n, y: 0 },
216
+ // Right
217
+ { x: n, y: -r / 3 },
218
+ { x: n + 2 * c, y: -r / 2 },
219
+ { x: n, y: -2 * r / 3 },
220
+ { x: n, y: -r },
221
+ // Top
222
+ { x: n - s, y: -r },
223
+ { x: n / 2, y: -r - 2 * c },
224
+ { x: s, y: -r },
225
+ // Left
226
+ { x: 0, y: -r },
227
+ { x: 0, y: -2 * r / 3 },
228
+ { x: -2 * c, y: -r / 2 },
229
+ { x: 0, y: -r / 3 }
230
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
231
+ { x: s, y: 0 },
232
+ { x: n - s, y: 0 },
233
+ { x: n, y: -r / 2 },
234
+ { x: n - s, y: -r },
235
+ { x: s, y: -r },
236
+ { x: 0, y: -r / 2 }
237
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
238
+ { x: 0, y: 0 },
239
+ { x: s, y: -r },
240
+ { x: n - s, y: -r },
241
+ { x: n, y: 0 }
242
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
243
+ { x: 0, y: 0 },
244
+ { x: n, y: -s },
245
+ { x: n, y: -r + s },
246
+ { x: 0, y: -r }
247
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
248
+ { x: n, y: 0 },
249
+ { x: 0, y: -s },
250
+ { x: 0, y: -r + s },
251
+ { x: n, y: -r }
252
+ ] : i.has("right") && i.has("left") ? [
253
+ { x: s, y: 0 },
254
+ { x: s, y: -c },
255
+ { x: n - s, y: -c },
256
+ { x: n - s, y: 0 },
257
+ { x: n, y: -r / 2 },
258
+ { x: n - s, y: -r },
259
+ { x: n - s, y: -r + c },
260
+ { x: s, y: -r + c },
261
+ { x: s, y: -r },
262
+ { x: 0, y: -r / 2 }
263
+ ] : i.has("up") && i.has("down") ? [
264
+ // Bottom center
265
+ { x: n / 2, y: 0 },
266
+ // Left pont of bottom arrow
267
+ { x: 0, y: -c },
268
+ { x: s, y: -c },
269
+ // Left top over vertical section
270
+ { x: s, y: -r + c },
271
+ { x: 0, y: -r + c },
272
+ // Top of arrow
273
+ { x: n / 2, y: -r },
274
+ { x: n, y: -r + c },
275
+ // Top of right vertical bar
276
+ { x: n - s, y: -r + c },
277
+ { x: n - s, y: -c },
278
+ { x: n, y: -c }
279
+ ] : i.has("right") && i.has("up") ? [
280
+ { x: 0, y: 0 },
281
+ { x: n, y: -s },
282
+ { x: 0, y: -r }
283
+ ] : i.has("right") && i.has("down") ? [
284
+ { x: 0, y: 0 },
285
+ { x: n, y: 0 },
286
+ { x: 0, y: -r }
287
+ ] : i.has("left") && i.has("up") ? [
288
+ { x: n, y: 0 },
289
+ { x: 0, y: -s },
290
+ { x: n, y: -r }
291
+ ] : i.has("left") && i.has("down") ? [
292
+ { x: n, y: 0 },
293
+ { x: 0, y: 0 },
294
+ { x: n, y: -r }
295
+ ] : i.has("right") ? [
296
+ { x: s, y: -c },
297
+ { x: s, y: -c },
298
+ { x: n - s, y: -c },
299
+ { x: n - s, y: 0 },
300
+ { x: n, y: -r / 2 },
301
+ { x: n - s, y: -r },
302
+ { x: n - s, y: -r + c },
303
+ // top left corner of arrow
304
+ { x: s, y: -r + c },
305
+ { x: s, y: -r + c }
306
+ ] : i.has("left") ? [
307
+ { x: s, y: 0 },
308
+ { x: s, y: -c },
309
+ // Two points, the right corners
310
+ { x: n - s, y: -c },
311
+ { x: n - s, y: -r + c },
312
+ { x: s, y: -r + c },
313
+ { x: s, y: -r },
314
+ { x: 0, y: -r / 2 }
315
+ ] : i.has("up") ? [
316
+ // Bottom center
317
+ { x: s, y: -c },
318
+ // Left top over vertical section
319
+ { x: s, y: -r + c },
320
+ { x: 0, y: -r + c },
321
+ // Top of arrow
322
+ { x: n / 2, y: -r },
323
+ { x: n, y: -r + c },
324
+ // Top of right vertical bar
325
+ { x: n - s, y: -r + c },
326
+ { x: n - s, y: -c }
327
+ ] : i.has("down") ? [
328
+ // Bottom center
329
+ { x: n / 2, y: 0 },
330
+ // Left pont of bottom arrow
331
+ { x: 0, y: -c },
332
+ { x: s, y: -c },
333
+ // Left top over vertical section
334
+ { x: s, y: -r + c },
335
+ { x: n - s, y: -r + c },
336
+ { x: n - s, y: -c },
337
+ { x: n, y: -c }
338
+ ] : [{ x: 0, y: 0 }];
339
+ }, K = (e) => e ? " " + e : "", _ = (e, t) => `node default${K(e.classes)} ${K(
340
+ e.class
341
+ )}`, P = async (e, t) => {
342
+ const { shapeSvg: a, bbox: i } = await M(
343
+ e,
344
+ t,
345
+ _(t),
346
+ !0
347
+ ), l = i.width + t.padding, r = i.height + t.padding, s = l + r, n = [
348
+ { x: s / 2, y: 0 },
349
+ { x: s, y: -s / 2 },
350
+ { x: s / 2, y: -s },
351
+ { x: 0, y: -s / 2 }
352
+ ];
353
+ g.info("Question main (Circle)");
354
+ const c = I(a, s, s, n);
355
+ return c.attr("style", t.style), m(t, c), t.intersect = function(o) {
356
+ return g.warn("Intersect called"), w.polygon(t, n, o);
357
+ }, a;
358
+ }, Ht = (e, t) => {
359
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
360
+ { x: 0, y: i / 2 },
361
+ { x: i / 2, y: 0 },
362
+ { x: 0, y: -28 / 2 },
363
+ { x: -28 / 2, y: 0 }
364
+ ];
365
+ return a.insert("polygon", ":first-child").attr(
366
+ "points",
367
+ l.map(function(s) {
368
+ return s.x + "," + s.y;
369
+ }).join(" ")
370
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(s) {
371
+ return w.circle(t, 14, s);
372
+ }, a;
373
+ }, It = async (e, t) => {
374
+ const { shapeSvg: a, bbox: i } = await M(
375
+ e,
376
+ t,
377
+ _(t),
378
+ !0
379
+ ), l = 4, r = i.height + t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = [
380
+ { x: s, y: 0 },
381
+ { x: n - s, y: 0 },
382
+ { x: n, y: -r / 2 },
383
+ { x: n - s, y: -r },
384
+ { x: s, y: -r },
385
+ { x: 0, y: -r / 2 }
386
+ ], o = I(a, n, r, c);
387
+ return o.attr("style", t.style), m(t, o), t.intersect = function(h) {
388
+ return w.polygon(t, c, h);
389
+ }, a;
390
+ }, Nt = async (e, t) => {
391
+ const { shapeSvg: a, bbox: i } = await M(e, t, void 0, !0), l = 2, r = i.height + 2 * t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = Rt(t.directions, i, t), o = I(a, n, r, c);
392
+ return o.attr("style", t.style), m(t, o), t.intersect = function(h) {
393
+ return w.polygon(t, c, h);
394
+ }, a;
395
+ }, Ot = async (e, t) => {
396
+ const { shapeSvg: a, bbox: i } = await M(
397
+ e,
398
+ t,
399
+ _(t),
400
+ !0
401
+ ), l = i.width + t.padding, r = i.height + t.padding, s = [
402
+ { x: -r / 2, y: 0 },
403
+ { x: l, y: 0 },
404
+ { x: l, y: -r },
405
+ { x: -r / 2, y: -r },
406
+ { x: 0, y: -r / 2 }
407
+ ];
408
+ return I(a, l, r, s).attr("style", t.style), t.width = l + r, t.height = r, t.intersect = function(c) {
409
+ return w.polygon(t, s, c);
410
+ }, a;
411
+ }, Wt = async (e, t) => {
412
+ const { shapeSvg: a, bbox: i } = await M(e, t, _(t), !0), l = i.width + t.padding, r = i.height + t.padding, s = [
413
+ { x: -2 * r / 6, y: 0 },
414
+ { x: l - r / 6, y: 0 },
415
+ { x: l + 2 * r / 6, y: -r },
416
+ { x: r / 6, y: -r }
417
+ ], n = I(a, l, r, s);
418
+ return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
419
+ return w.polygon(t, s, c);
420
+ }, a;
421
+ }, Xt = async (e, t) => {
422
+ const { shapeSvg: a, bbox: i } = await M(
423
+ e,
424
+ t,
425
+ _(t),
426
+ !0
427
+ ), l = i.width + t.padding, r = i.height + t.padding, s = [
428
+ { x: 2 * r / 6, y: 0 },
429
+ { x: l + r / 6, y: 0 },
430
+ { x: l - 2 * r / 6, y: -r },
431
+ { x: -r / 6, y: -r }
432
+ ], n = I(a, l, r, s);
433
+ return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
434
+ return w.polygon(t, s, c);
435
+ }, a;
436
+ }, Yt = async (e, t) => {
437
+ const { shapeSvg: a, bbox: i } = await M(
438
+ e,
439
+ t,
440
+ _(t),
441
+ !0
442
+ ), l = i.width + t.padding, r = i.height + t.padding, s = [
443
+ { x: -2 * r / 6, y: 0 },
444
+ { x: l + 2 * r / 6, y: 0 },
445
+ { x: l - r / 6, y: -r },
446
+ { x: r / 6, y: -r }
447
+ ], n = I(a, l, r, s);
448
+ return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
449
+ return w.polygon(t, s, c);
450
+ }, a;
451
+ }, Dt = async (e, t) => {
452
+ const { shapeSvg: a, bbox: i } = await M(
453
+ e,
454
+ t,
455
+ _(t),
456
+ !0
457
+ ), l = i.width + t.padding, r = i.height + t.padding, s = [
458
+ { x: r / 6, y: 0 },
459
+ { x: l - r / 6, y: 0 },
460
+ { x: l + 2 * r / 6, y: -r },
461
+ { x: -2 * r / 6, y: -r }
462
+ ], n = I(a, l, r, s);
463
+ return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
464
+ return w.polygon(t, s, c);
465
+ }, a;
466
+ }, At = async (e, t) => {
467
+ const { shapeSvg: a, bbox: i } = await M(
468
+ e,
469
+ t,
470
+ _(t),
471
+ !0
472
+ ), l = i.width + t.padding, r = i.height + t.padding, s = [
473
+ { x: 0, y: 0 },
474
+ { x: l + r / 2, y: 0 },
475
+ { x: l, y: -r / 2 },
476
+ { x: l + r / 2, y: -r },
477
+ { x: 0, y: -r }
478
+ ], n = I(a, l, r, s);
479
+ return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
480
+ return w.polygon(t, s, c);
481
+ }, a;
482
+ }, jt = async (e, t) => {
483
+ const { shapeSvg: a, bbox: i } = await M(
484
+ e,
485
+ t,
486
+ _(t),
487
+ !0
488
+ ), l = i.width + t.padding, r = l / 2, s = r / (2.5 + l / 50), n = i.height + s + t.padding, c = "M 0," + s + " a " + r + "," + s + " 0,0,0 " + l + " 0 a " + r + "," + s + " 0,0,0 " + -l + " 0 l 0," + n + " a " + r + "," + s + " 0,0,0 " + l + " 0 l 0," + -n, o = a.attr("label-offset-y", s).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + s) + ")");
489
+ return m(t, o), t.intersect = function(h) {
490
+ const y = w.rect(t, h), p = y.x - t.x;
491
+ if (r != 0 && (Math.abs(p) < t.width / 2 || Math.abs(p) == t.width / 2 && Math.abs(y.y - t.y) > t.height / 2 - s)) {
492
+ let f = s * s * (1 - p * p / (r * r));
493
+ f != 0 && (f = Math.sqrt(f)), f = s - f, h.y - t.y > 0 && (f = -f), y.y += f;
494
+ }
495
+ return y;
496
+ }, a;
497
+ }, Ut = async (e, t) => {
498
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await M(
499
+ e,
500
+ t,
501
+ "node " + t.classes + " " + t.class,
502
+ !0
503
+ ), r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, o = t.positioned ? -n / 2 : -i.height / 2 - l;
504
+ if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) {
505
+ const h = new Set(Object.keys(t.props));
506
+ t.props.borders && (V(r, t.props.borders, s, n), h.delete("borders")), h.forEach((y) => {
507
+ g.warn(`Unknown node property ${y}`);
508
+ });
509
+ }
510
+ return m(t, r), t.intersect = function(h) {
511
+ return w.rect(t, h);
512
+ }, a;
513
+ }, zt = async (e, t) => {
514
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await M(
515
+ e,
516
+ t,
517
+ "node " + t.classes,
518
+ !0
519
+ ), r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, o = t.positioned ? -n / 2 : -i.height / 2 - l;
520
+ if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) {
521
+ const h = new Set(Object.keys(t.props));
522
+ t.props.borders && (V(r, t.props.borders, s, n), h.delete("borders")), h.forEach((y) => {
523
+ g.warn(`Unknown node property ${y}`);
524
+ });
525
+ }
526
+ return m(t, r), t.intersect = function(h) {
527
+ return w.rect(t, h);
528
+ }, a;
529
+ }, Zt = async (e, t) => {
530
+ const { shapeSvg: a } = await M(e, t, "label", !0);
531
+ g.trace("Classes = ", t.class);
532
+ const i = a.insert("rect", ":first-child"), l = 0, r = 0;
533
+ if (i.attr("width", l).attr("height", r), a.attr("class", "label edgeLabel"), t.props) {
534
+ const s = new Set(Object.keys(t.props));
535
+ t.props.borders && (V(i, t.props.borders, l, r), s.delete("borders")), s.forEach((n) => {
536
+ g.warn(`Unknown node property ${n}`);
537
+ });
538
+ }
539
+ return m(t, i), t.intersect = function(s) {
540
+ return w.rect(t, s);
541
+ }, a;
542
+ };
543
+ function V(e, t, a, i) {
544
+ const l = [], r = (n) => {
545
+ l.push(n, 0);
546
+ }, s = (n) => {
547
+ l.push(0, n);
548
+ };
549
+ t.includes("t") ? (g.debug("add top border"), r(a)) : s(a), t.includes("r") ? (g.debug("add right border"), r(i)) : s(i), t.includes("b") ? (g.debug("add bottom border"), r(a)) : s(a), t.includes("l") ? (g.debug("add left border"), r(i)) : s(i), e.attr("stroke-dasharray", l.join(" "));
550
+ }
551
+ const Gt = (e, t) => {
552
+ let a;
553
+ t.classes ? a = "node " + t.classes : a = "node default";
554
+ const i = e.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), r = i.insert("line"), s = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
555
+ let c = "";
556
+ typeof n == "object" ? c = n[0] : c = n, g.info("Label text abc79", c, n, typeof n == "object");
557
+ const o = s.node().appendChild(R(c, t.labelStyle, !0, !0));
558
+ let h = { width: 0, height: 0 };
559
+ if (H(b().flowchart.htmlLabels)) {
560
+ const k = o.children[0], d = E(o);
561
+ h = k.getBoundingClientRect(), d.attr("width", h.width), d.attr("height", h.height);
562
+ }
563
+ g.info("Text 2", n);
564
+ const y = n.slice(1, n.length);
565
+ let p = o.getBBox();
566
+ const f = s.node().appendChild(
567
+ R(y.join ? y.join("<br/>") : y, t.labelStyle, !0, !0)
568
+ );
569
+ if (H(b().flowchart.htmlLabels)) {
570
+ const k = f.children[0], d = E(f);
571
+ h = k.getBoundingClientRect(), d.attr("width", h.width), d.attr("height", h.height);
572
+ }
573
+ const x = t.padding / 2;
574
+ return E(f).attr(
575
+ "transform",
576
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
577
+ (h.width > p.width ? 0 : (p.width - h.width) / 2) + ", " + (p.height + x + 5) + ")"
578
+ ), E(o).attr(
579
+ "transform",
580
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
581
+ (h.width < p.width ? 0 : -(p.width - h.width) / 2) + ", 0)"
582
+ ), h = s.node().getBBox(), s.attr(
583
+ "transform",
584
+ "translate(" + -h.width / 2 + ", " + (-h.height / 2 - x + 3) + ")"
585
+ ), l.attr("class", "outer title-state").attr("x", -h.width / 2 - x).attr("y", -h.height / 2 - x).attr("width", h.width + t.padding).attr("height", h.height + t.padding), r.attr("class", "divider").attr("x1", -h.width / 2 - x).attr("x2", h.width / 2 + x).attr("y1", -h.height / 2 - x + p.height + x).attr("y2", -h.height / 2 - x + p.height + x), m(t, l), t.intersect = function(k) {
586
+ return w.rect(t, k);
587
+ }, i;
588
+ }, Ft = async (e, t) => {
589
+ const { shapeSvg: a, bbox: i } = await M(
590
+ e,
591
+ t,
592
+ _(t),
593
+ !0
594
+ ), l = i.height + t.padding, r = i.width + l / 4 + t.padding, s = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -r / 2).attr("y", -l / 2).attr("width", r).attr("height", l);
595
+ return m(t, s), t.intersect = function(n) {
596
+ return w.rect(t, n);
597
+ }, a;
598
+ }, Qt = async (e, t) => {
599
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await M(
600
+ e,
601
+ t,
602
+ _(t),
603
+ !0
604
+ ), r = a.insert("circle", ":first-child");
605
+ return r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), g.info("Circle main"), m(t, r), t.intersect = function(s) {
606
+ return g.info("Circle intersect", t, i.width / 2 + l, s), w.circle(t, i.width / 2 + l, s);
607
+ }, a;
608
+ }, Vt = async (e, t) => {
609
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await M(
610
+ e,
611
+ t,
612
+ _(t),
613
+ !0
614
+ ), r = 5, s = a.insert("g", ":first-child"), n = s.insert("circle"), c = s.insert("circle");
615
+ return s.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + r).attr("width", i.width + t.padding + r * 2).attr("height", i.height + t.padding + r * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), g.info("DoubleCircle main"), m(t, n), t.intersect = function(o) {
616
+ return g.info("DoubleCircle intersect", t, i.width / 2 + l + r, o), w.circle(t, i.width / 2 + l + r, o);
617
+ }, a;
618
+ }, qt = async (e, t) => {
619
+ const { shapeSvg: a, bbox: i } = await M(
620
+ e,
621
+ t,
622
+ _(t),
623
+ !0
624
+ ), l = i.width + t.padding, r = i.height + t.padding, s = [
625
+ { x: 0, y: 0 },
626
+ { x: l, y: 0 },
627
+ { x: l, y: -r },
628
+ { x: 0, y: -r },
629
+ { x: 0, y: 0 },
630
+ { x: -8, y: 0 },
631
+ { x: l + 8, y: 0 },
632
+ { x: l + 8, y: -r },
633
+ { x: -8, y: -r },
634
+ { x: -8, y: 0 }
635
+ ], n = I(a, l, r, s);
636
+ return n.attr("style", t.style), m(t, n), t.intersect = function(c) {
637
+ return w.polygon(t, s, c);
638
+ }, a;
639
+ }, Jt = (e, t) => {
640
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child");
641
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), m(t, i), t.intersect = function(l) {
642
+ return w.circle(t, 7, l);
643
+ }, a;
644
+ }, tt = (e, t, a) => {
645
+ const i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
646
+ let l = 70, r = 10;
647
+ a === "LR" && (l = 10, r = 70);
648
+ const s = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * r / 2).attr("width", l).attr("height", r).attr("class", "fork-join");
649
+ return m(t, s), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
650
+ return w.rect(t, n);
651
+ }, i;
652
+ }, Kt = (e, t) => {
653
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child"), l = a.insert("circle", ":first-child");
654
+ return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), m(t, l), t.intersect = function(r) {
655
+ return w.circle(t, 7, r);
656
+ }, a;
657
+ }, Pt = (e, t) => {
658
+ const a = t.padding / 2, i = 4, l = 8;
659
+ let r;
660
+ t.classes ? r = "node " + t.classes : r = "node default";
661
+ const s = e.insert("g").attr("class", r).attr("id", t.domId || t.id), n = s.insert("rect", ":first-child"), c = s.insert("line"), o = s.insert("line");
662
+ let h = 0, y = i;
663
+ const p = s.insert("g").attr("class", "label");
664
+ let f = 0;
665
+ const x = t.classData.annotations && t.classData.annotations[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", d = p.node().appendChild(R(k, t.labelStyle, !0, !0));
666
+ let u = d.getBBox();
667
+ if (H(b().flowchart.htmlLabels)) {
668
+ const v = d.children[0], L = E(d);
669
+ u = v.getBoundingClientRect(), L.attr("width", u.width), L.attr("height", u.height);
670
+ }
671
+ t.classData.annotations[0] && (y += u.height + i, h += u.width);
672
+ let S = t.classData.label;
673
+ t.classData.type !== void 0 && t.classData.type !== "" && (b().flowchart.htmlLabels ? S += "&lt;" + t.classData.type + "&gt;" : S += "<" + t.classData.type + ">");
674
+ const B = p.node().appendChild(R(S, t.labelStyle, !0, !0));
675
+ E(B).attr("class", "classTitle");
676
+ let C = B.getBBox();
677
+ if (H(b().flowchart.htmlLabels)) {
678
+ const v = B.children[0], L = E(B);
679
+ C = v.getBoundingClientRect(), L.attr("width", C.width), L.attr("height", C.height);
680
+ }
681
+ y += C.height + i, C.width > h && (h = C.width);
682
+ const X = [];
683
+ t.classData.members.forEach((v) => {
684
+ const L = v.getDisplayDetails();
685
+ let W = L.displayText;
686
+ b().flowchart.htmlLabels && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
687
+ const N = p.node().appendChild(
688
+ R(
689
+ W,
690
+ L.cssStyle ? L.cssStyle : t.labelStyle,
691
+ !0,
692
+ !0
693
+ )
694
+ );
695
+ let $ = N.getBBox();
696
+ if (H(b().flowchart.htmlLabels)) {
697
+ const F = N.children[0], A = E(N);
698
+ $ = F.getBoundingClientRect(), A.attr("width", $.width), A.attr("height", $.height);
699
+ }
700
+ $.width > h && (h = $.width), y += $.height + i, X.push(N);
701
+ }), y += l;
702
+ const D = [];
703
+ if (t.classData.methods.forEach((v) => {
704
+ const L = v.getDisplayDetails();
705
+ let W = L.displayText;
706
+ b().flowchart.htmlLabels && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
707
+ const N = p.node().appendChild(
708
+ R(
709
+ W,
710
+ L.cssStyle ? L.cssStyle : t.labelStyle,
711
+ !0,
712
+ !0
713
+ )
714
+ );
715
+ let $ = N.getBBox();
716
+ if (H(b().flowchart.htmlLabels)) {
717
+ const F = N.children[0], A = E(N);
718
+ $ = F.getBoundingClientRect(), A.attr("width", $.width), A.attr("height", $.height);
719
+ }
720
+ $.width > h && (h = $.width), y += $.height + i, D.push(N);
721
+ }), y += l, x) {
722
+ let v = (h - u.width) / 2;
723
+ E(d).attr(
724
+ "transform",
725
+ "translate( " + (-1 * h / 2 + v) + ", " + -1 * y / 2 + ")"
726
+ ), f = u.height + i;
727
+ }
728
+ let nt = (h - C.width) / 2;
729
+ return E(B).attr(
730
+ "transform",
731
+ "translate( " + (-1 * h / 2 + nt) + ", " + (-1 * y / 2 + f) + ")"
732
+ ), f += C.height + i, c.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + f).attr("y2", -y / 2 - a + l + f), f += l, X.forEach((v) => {
733
+ E(v).attr(
734
+ "transform",
735
+ "translate( " + -h / 2 + ", " + (-1 * y / 2 + f + l / 2) + ")"
736
+ );
737
+ const L = v == null ? void 0 : v.getBBox();
738
+ f += ((L == null ? void 0 : L.height) ?? 0) + i;
739
+ }), f += l, o.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + f).attr("y2", -y / 2 - a + l + f), f += l, D.forEach((v) => {
740
+ E(v).attr(
741
+ "transform",
742
+ "translate( " + -h / 2 + ", " + (-1 * y / 2 + f) + ")"
743
+ );
744
+ const L = v == null ? void 0 : v.getBBox();
745
+ f += ((L == null ? void 0 : L.height) ?? 0) + i;
746
+ }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - a).attr("y", -(y / 2) - a).attr("width", h + t.padding).attr("height", y + t.padding), m(t, n), t.intersect = function(v) {
747
+ return w.rect(t, v);
748
+ }, s;
749
+ }, rt = {
750
+ rhombus: P,
751
+ composite: zt,
752
+ question: P,
753
+ rect: Ut,
754
+ labelRect: Zt,
755
+ rectWithTitle: Gt,
756
+ choice: Ht,
757
+ circle: Qt,
758
+ doublecircle: Vt,
759
+ stadium: Ft,
760
+ hexagon: It,
761
+ block_arrow: Nt,
762
+ rect_left_inv_arrow: Ot,
763
+ lean_right: Wt,
764
+ lean_left: Xt,
765
+ trapezoid: Yt,
766
+ inv_trapezoid: Dt,
767
+ rect_right_inv_arrow: At,
768
+ cylinder: jt,
769
+ start: Jt,
770
+ end: Kt,
771
+ note: $t,
772
+ subroutine: qt,
773
+ fork: tt,
774
+ join: tt,
775
+ class_box: Pt
776
+ };
777
+ let Y = {};
778
+ const or = async (e, t, a) => {
779
+ let i, l;
780
+ if (t.link) {
781
+ let r;
782
+ b().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", r), l = await rt[t.shape](i, t, a);
783
+ } else
784
+ l = await rt[t.shape](e, t, a), i = l;
785
+ return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), i.attr("data-node", "true"), i.attr("data-id", t.id), Y[t.id] = i, t.haveCallback && Y[t.id].attr("class", Y[t.id].attr("class") + " clickable"), i;
786
+ }, yr = (e, t) => {
787
+ Y[t.id] = e;
788
+ }, fr = () => {
789
+ Y = {};
790
+ }, pr = (e) => {
791
+ const t = Y[e.id];
792
+ g.trace(
793
+ "Transforming node",
794
+ e.diff,
795
+ e,
796
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
797
+ );
798
+ const a = 8, i = e.diff || 0;
799
+ return e.clusterNode ? t.attr(
800
+ "transform",
801
+ "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
802
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i;
803
+ }, tr = ({
804
+ flowchart: e
805
+ }) => {
806
+ var t, a;
807
+ const i = ((t = e == null ? void 0 : e.subGraphTitleMargin) == null ? void 0 : t.top) ?? 0, l = ((a = e == null ? void 0 : e.subGraphTitleMargin) == null ? void 0 : a.bottom) ?? 0, r = i + l;
808
+ return {
809
+ subGraphTitleTopMargin: i,
810
+ subGraphTitleBottomMargin: l,
811
+ subGraphTitleTotalMargin: r
812
+ };
813
+ }, O = {
814
+ aggregation: 18,
815
+ extension: 18,
816
+ composition: 18,
817
+ dependency: 6,
818
+ lollipop: 13.5,
819
+ arrow_point: 5.3
820
+ };
821
+ function U(e, t) {
822
+ if (e === void 0 || t === void 0)
823
+ return { angle: 0, deltaX: 0, deltaY: 0 };
824
+ e = Z(e), t = Z(t);
825
+ const [a, i] = [e.x, e.y], [l, r] = [t.x, t.y], s = l - a, n = r - i;
826
+ return { angle: Math.atan(n / s), deltaX: s, deltaY: n };
827
+ }
828
+ const Z = (e) => Array.isArray(e) ? { x: e[0], y: e[1] } : e, rr = (e) => ({
829
+ x: function(t, a, i) {
830
+ let l = 0;
831
+ if (a === 0 && Object.hasOwn(O, e.arrowTypeStart)) {
832
+ const { angle: r, deltaX: s } = U(i[0], i[1]);
833
+ l = O[e.arrowTypeStart] * Math.cos(r) * (s >= 0 ? 1 : -1);
834
+ } else if (a === i.length - 1 && Object.hasOwn(O, e.arrowTypeEnd)) {
835
+ const { angle: r, deltaX: s } = U(
836
+ i[i.length - 1],
837
+ i[i.length - 2]
838
+ );
839
+ l = O[e.arrowTypeEnd] * Math.cos(r) * (s >= 0 ? 1 : -1);
840
+ }
841
+ return Z(t).x + l;
842
+ },
843
+ y: function(t, a, i) {
844
+ let l = 0;
845
+ if (a === 0 && Object.hasOwn(O, e.arrowTypeStart)) {
846
+ const { angle: r, deltaY: s } = U(i[0], i[1]);
847
+ l = O[e.arrowTypeStart] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1);
848
+ } else if (a === i.length - 1 && Object.hasOwn(O, e.arrowTypeEnd)) {
849
+ const { angle: r, deltaY: s } = U(
850
+ i[i.length - 1],
851
+ i[i.length - 2]
852
+ );
853
+ l = O[e.arrowTypeEnd] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1);
854
+ }
855
+ return Z(t).y + l;
856
+ }
857
+ }), ar = (e, t, a, i, l) => {
858
+ t.arrowTypeStart && at(e, "start", t.arrowTypeStart, a, i, l), t.arrowTypeEnd && at(e, "end", t.arrowTypeEnd, a, i, l);
859
+ }, er = {
860
+ arrow_cross: "cross",
861
+ arrow_point: "point",
862
+ arrow_barb: "barb",
863
+ arrow_circle: "circle",
864
+ aggregation: "aggregation",
865
+ extension: "extension",
866
+ composition: "composition",
867
+ dependency: "dependency",
868
+ lollipop: "lollipop"
869
+ }, at = (e, t, a, i, l, r) => {
870
+ const s = er[a];
871
+ if (!s) {
872
+ g.warn(`Unknown arrow type: ${a}`);
873
+ return;
874
+ }
875
+ const n = t === "start" ? "Start" : "End";
876
+ e.attr(`marker-${t}`, `url(${i}#${l}_${r}-${s}${n})`);
877
+ };
878
+ let G = {}, T = {};
879
+ const dr = () => {
880
+ G = {}, T = {};
881
+ }, xr = (e, t) => {
882
+ const a = H(b().flowchart.htmlLabels), i = t.labelType === "markdown" ? st(e, t.label, {
883
+ style: t.labelStyle,
884
+ useHtmlLabels: a,
885
+ addSvgBackground: !0
886
+ }) : R(t.label, t.labelStyle), l = e.insert("g").attr("class", "edgeLabel"), r = l.insert("g").attr("class", "label");
887
+ r.node().appendChild(i);
888
+ let s = i.getBBox();
889
+ if (a) {
890
+ const c = i.children[0], o = E(i);
891
+ s = c.getBoundingClientRect(), o.attr("width", s.width), o.attr("height", s.height);
892
+ }
893
+ r.attr("transform", "translate(" + -s.width / 2 + ", " + -s.height / 2 + ")"), G[t.id] = l, t.width = s.width, t.height = s.height;
894
+ let n;
895
+ if (t.startLabelLeft) {
896
+ const c = R(t.startLabelLeft, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
897
+ n = h.node().appendChild(c);
898
+ const y = c.getBBox();
899
+ h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startLeft = o, z(n, t.startLabelLeft);
900
+ }
901
+ if (t.startLabelRight) {
902
+ const c = R(t.startLabelRight, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
903
+ n = o.node().appendChild(c), h.node().appendChild(c);
904
+ const y = c.getBBox();
905
+ h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startRight = o, z(n, t.startLabelRight);
906
+ }
907
+ if (t.endLabelLeft) {
908
+ const c = R(t.endLabelLeft, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
909
+ n = h.node().appendChild(c);
910
+ const y = c.getBBox();
911
+ h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), o.node().appendChild(c), T[t.id] || (T[t.id] = {}), T[t.id].endLeft = o, z(n, t.endLabelLeft);
912
+ }
913
+ if (t.endLabelRight) {
914
+ const c = R(t.endLabelRight, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), h = o.insert("g").attr("class", "inner");
915
+ n = h.node().appendChild(c);
916
+ const y = c.getBBox();
917
+ h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), o.node().appendChild(c), T[t.id] || (T[t.id] = {}), T[t.id].endRight = o, z(n, t.endLabelRight);
918
+ }
919
+ return i;
920
+ };
921
+ function z(e, t) {
922
+ b().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
923
+ }
924
+ const gr = (e, t) => {
925
+ g.debug("Moving label abc88 ", e.id, e.label, G[e.id], t);
926
+ let a = t.updatedPath ? t.updatedPath : t.originalPath;
927
+ const i = b(), { subGraphTitleTotalMargin: l } = tr(i);
928
+ if (e.label) {
929
+ const r = G[e.id];
930
+ let s = e.x, n = e.y;
931
+ if (a) {
932
+ const c = j.calcLabelPosition(a);
933
+ g.debug(
934
+ "Moving label " + e.label + " from (",
935
+ s,
936
+ ",",
937
+ n,
938
+ ") to (",
939
+ c.x,
940
+ ",",
941
+ c.y,
942
+ ") abc88"
943
+ ), t.updatedPath && (s = c.x, n = c.y);
944
+ }
945
+ r.attr("transform", `translate(${s}, ${n + l / 2})`);
946
+ }
947
+ if (e.startLabelLeft) {
948
+ const r = T[e.id].startLeft;
949
+ let s = e.x, n = e.y;
950
+ if (a) {
951
+ const c = j.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
952
+ s = c.x, n = c.y;
953
+ }
954
+ r.attr("transform", `translate(${s}, ${n})`);
955
+ }
956
+ if (e.startLabelRight) {
957
+ const r = T[e.id].startRight;
958
+ let s = e.x, n = e.y;
959
+ if (a) {
960
+ const c = j.calcTerminalLabelPosition(
961
+ e.arrowTypeStart ? 10 : 0,
962
+ "start_right",
963
+ a
964
+ );
965
+ s = c.x, n = c.y;
966
+ }
967
+ r.attr("transform", `translate(${s}, ${n})`);
968
+ }
969
+ if (e.endLabelLeft) {
970
+ const r = T[e.id].endLeft;
971
+ let s = e.x, n = e.y;
972
+ if (a) {
973
+ const c = j.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
974
+ s = c.x, n = c.y;
975
+ }
976
+ r.attr("transform", `translate(${s}, ${n})`);
977
+ }
978
+ if (e.endLabelRight) {
979
+ const r = T[e.id].endRight;
980
+ let s = e.x, n = e.y;
981
+ if (a) {
982
+ const c = j.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
983
+ s = c.x, n = c.y;
984
+ }
985
+ r.attr("transform", `translate(${s}, ${n})`);
986
+ }
987
+ }, sr = (e, t) => {
988
+ const a = e.x, i = e.y, l = Math.abs(t.x - a), r = Math.abs(t.y - i), s = e.width / 2, n = e.height / 2;
989
+ return l >= s || r >= n;
990
+ }, ir = (e, t, a) => {
991
+ g.debug(`intersection calc abc89:
992
+ outsidePoint: ${JSON.stringify(t)}
993
+ insidePoint : ${JSON.stringify(a)}
994
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
995
+ const i = e.x, l = e.y, r = Math.abs(i - a.x), s = e.width / 2;
996
+ let n = a.x < t.x ? s - r : s + r;
997
+ const c = e.height / 2, o = Math.abs(t.y - a.y), h = Math.abs(t.x - a.x);
998
+ if (Math.abs(l - t.y) * s > Math.abs(i - t.x) * c) {
999
+ let y = a.y < t.y ? t.y - c - l : l - c - t.y;
1000
+ n = h * y / o;
1001
+ const p = {
1002
+ x: a.x < t.x ? a.x + n : a.x - h + n,
1003
+ y: a.y < t.y ? a.y + o - y : a.y - o + y
1004
+ };
1005
+ return n === 0 && (p.x = t.x, p.y = t.y), h === 0 && (p.x = t.x), o === 0 && (p.y = t.y), g.debug(`abc89 topp/bott calc, Q ${o}, q ${y}, R ${h}, r ${n}`, p), p;
1006
+ } else {
1007
+ a.x < t.x ? n = t.x - s - i : n = i - s - t.x;
1008
+ let y = o * n / h, p = a.x < t.x ? a.x + h - n : a.x - h + n, f = a.y < t.y ? a.y + y : a.y - y;
1009
+ return g.debug(`sides calc abc89, Q ${o}, q ${y}, R ${h}, r ${n}`, { _x: p, _y: f }), n === 0 && (p = t.x, f = t.y), h === 0 && (p = t.x), o === 0 && (f = t.y), { x: p, y: f };
1010
+ }
1011
+ }, et = (e, t) => {
1012
+ g.debug("abc88 cutPathAtIntersect", e, t);
1013
+ let a = [], i = e[0], l = !1;
1014
+ return e.forEach((r) => {
1015
+ if (!sr(t, r) && !l) {
1016
+ const s = ir(t, i, r);
1017
+ let n = !1;
1018
+ a.forEach((c) => {
1019
+ n = n || c.x === s.x && c.y === s.y;
1020
+ }), a.some((c) => c.x === s.x && c.y === s.y) || a.push(s), l = !0;
1021
+ } else
1022
+ i = r, l || a.push(r);
1023
+ }), a;
1024
+ }, ur = function(e, t, a, i, l, r, s) {
1025
+ let n = a.points;
1026
+ g.debug("abc88 InsertEdge: edge=", a, "e=", t);
1027
+ let c = !1;
1028
+ const o = r.node(t.v);
1029
+ var h = r.node(t.w);
1030
+ h != null && h.intersect && (o != null && o.intersect) && (n = n.slice(1, a.points.length - 1), n.unshift(o.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), a.toCluster && (g.debug("to cluster abc88", i[a.toCluster]), n = et(a.points, i[a.toCluster].node), c = !0), a.fromCluster && (g.debug("from cluster abc88", i[a.fromCluster]), n = et(n.reverse(), i[a.fromCluster].node).reverse(), c = !0);
1031
+ const y = n.filter((C) => !Number.isNaN(C.y));
1032
+ let p = lt;
1033
+ a.curve && (l === "graph" || l === "flowchart") && (p = a.curve);
1034
+ const { x: f, y: x } = rr(a), k = ct().x(f).y(x).curve(p);
1035
+ let d;
1036
+ switch (a.thickness) {
1037
+ case "normal":
1038
+ d = "edge-thickness-normal";
1039
+ break;
1040
+ case "thick":
1041
+ d = "edge-thickness-thick";
1042
+ break;
1043
+ case "invisible":
1044
+ d = "edge-thickness-thick";
1045
+ break;
1046
+ default:
1047
+ d = "";
1048
+ }
1049
+ switch (a.pattern) {
1050
+ case "solid":
1051
+ d += " edge-pattern-solid";
1052
+ break;
1053
+ case "dotted":
1054
+ d += " edge-pattern-dotted";
1055
+ break;
1056
+ case "dashed":
1057
+ d += " edge-pattern-dashed";
1058
+ break;
1059
+ }
1060
+ const u = e.append("path").attr("d", k(y)).attr("id", a.id).attr("class", " " + d + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1061
+ let S = "";
1062
+ (b().flowchart.arrowMarkerAbsolute || b().state.arrowMarkerAbsolute) && (S = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, S = S.replace(/\(/g, "\\("), S = S.replace(/\)/g, "\\)")), ar(u, a, S, s, l);
1063
+ let B = {};
1064
+ return c && (B.updatedPath = n), B.originalPath = a.points, B;
1065
+ };
1066
+ export {
1067
+ or as a,
1068
+ xr as b,
1069
+ ur as c,
1070
+ gr as d,
1071
+ Et as e,
1072
+ R as f,
1073
+ tr as g,
1074
+ fr as h,
1075
+ hr as i,
1076
+ dr as j,
1077
+ rr as k,
1078
+ M as l,
1079
+ ar as m,
1080
+ pr as p,
1081
+ yr as s,
1082
+ m as u
1083
+ };