@layers-app/editor 0.7.45 → 0.7.46

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 (248) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +5 -4
  3. package/dist/index.js +3 -3
  4. package/dist/{layers.dO_EcGnI.js → layers.B88sQYuh.js} +1 -1
  5. package/dist/layers.BgMykHnn.js +154 -0
  6. package/dist/{layers.BNRMPVpZ.js → layers.BtvuN20E.js} +8992 -9643
  7. package/dist/{layers.D7AwxDU3.js → layers.Cfvta__C.js} +1 -1
  8. package/dist/{layers.b9B2NY7n.js → layers.CsQlovyR.js} +2191 -1950
  9. package/dist/layers.Ct1ojjl3.js +1 -0
  10. package/dist/{layers.Cqs6IYG7.js → layers.Hq0pIRX3.js} +24 -24
  11. package/dist/layers.JT_kEFH5.js +129 -0
  12. package/dist/{layers.D10qGvZV.js → layers.NW1lST7i.js} +1 -1
  13. package/dist/layers.pwc3O6Es.js +261 -0
  14. package/package.json +2 -2
  15. package/dist/layers.-kgSm_ki.js +0 -1
  16. package/dist/layers.3H8YMnha.js +0 -960
  17. package/dist/layers.52famHy6.js +0 -1
  18. package/dist/layers.5E21elPk.js +0 -11
  19. package/dist/layers.5VXqgOA9.js +0 -1
  20. package/dist/layers.5VwU1GK1.js +0 -1268
  21. package/dist/layers.7JqFgE4-.js +0 -15
  22. package/dist/layers.7RI58uNS.js +0 -189
  23. package/dist/layers.7SpesQUg.js +0 -40
  24. package/dist/layers.7T_XLunz.js +0 -7
  25. package/dist/layers.8yVEuzdp.js +0 -2238
  26. package/dist/layers.9VxE_IU7.js +0 -6
  27. package/dist/layers.9pNaFvaX.js +0 -1
  28. package/dist/layers.AfB9ZNIL.js +0 -41
  29. package/dist/layers.AwYI6tm5.js +0 -39
  30. package/dist/layers.B-gjjpRn.js +0 -4
  31. package/dist/layers.B09AFCqn.js +0 -37
  32. package/dist/layers.B19hGmey.js +0 -1
  33. package/dist/layers.B1GZzJe5.js +0 -9
  34. package/dist/layers.B1MgjnS3.js +0 -129
  35. package/dist/layers.B3D4g2HH.js +0 -1
  36. package/dist/layers.B4--F20o.js +0 -10
  37. package/dist/layers.B47Vqw3v.js +0 -8
  38. package/dist/layers.B7K7JjK6.js +0 -1510
  39. package/dist/layers.B7Ogzw_9.js +0 -8
  40. package/dist/layers.B9DV1y8l.js +0 -437
  41. package/dist/layers.BAnldxOY.js +0 -61
  42. package/dist/layers.BAtv1CM7.js +0 -1
  43. package/dist/layers.BAuuzKLZ.js +0 -8
  44. package/dist/layers.BBkLpECL.js +0 -41
  45. package/dist/layers.BCFFwcHc.js +0 -8
  46. package/dist/layers.BElVFj7p.js +0 -10
  47. package/dist/layers.BHMGJS6y.js +0 -35
  48. package/dist/layers.BI0na45P.js +0 -39
  49. package/dist/layers.BIeVwYKL.js +0 -1
  50. package/dist/layers.BJDrjORS.js +0 -244
  51. package/dist/layers.BLVqWrAY.js +0 -10
  52. package/dist/layers.BLd2spTm.js +0 -1
  53. package/dist/layers.BMdx5wVt.js +0 -1126
  54. package/dist/layers.BPxT8M1-.js +0 -1619
  55. package/dist/layers.BQ47bUTF.js +0 -207
  56. package/dist/layers.BRQk8xaN.js +0 -52
  57. package/dist/layers.BSTBZrFn.js +0 -1
  58. package/dist/layers.BSd2L4Fm.js +0 -1
  59. package/dist/layers.BT4kTHz7.js +0 -51
  60. package/dist/layers.BaqpKN-R.js +0 -4
  61. package/dist/layers.BbCfEXyj.js +0 -55
  62. package/dist/layers.Bd6ZkqZ7.js +0 -40
  63. package/dist/layers.BdSYcWLH.js +0 -373
  64. package/dist/layers.Be33AcY-.js +0 -1
  65. package/dist/layers.BiIBffqS.js +0 -6
  66. package/dist/layers.BijSGz6X.js +0 -1
  67. package/dist/layers.BioO0hx9.js +0 -10
  68. package/dist/layers.BmE6NOAc.js +0 -41
  69. package/dist/layers.BoRU6N6t.js +0 -1225
  70. package/dist/layers.Boa1dqY1.js +0 -1
  71. package/dist/layers.BpilXLfW.js +0 -6
  72. package/dist/layers.BqYphIWO.js +0 -11
  73. package/dist/layers.Bs1NMWU2.js +0 -9
  74. package/dist/layers.BsKvPJTl.js +0 -10
  75. package/dist/layers.BsZCaVRX.js +0 -22
  76. package/dist/layers.BtKfezUO.js +0 -32
  77. package/dist/layers.BuVXf7W5.js +0 -42
  78. package/dist/layers.BwuvbB4R.js +0 -39
  79. package/dist/layers.BxiXm40L.js +0 -2
  80. package/dist/layers.By8sBqwN.js +0 -116
  81. package/dist/layers.BzGZoEEl.js +0 -10
  82. package/dist/layers.BzLeOHKa.js +0 -796
  83. package/dist/layers.Bz_dhG__.js +0 -39
  84. package/dist/layers.C1KqMlKg.js +0 -1
  85. package/dist/layers.C1i1mw5H.js +0 -39
  86. package/dist/layers.C2RYi1R4.js +0 -9
  87. package/dist/layers.C3J_d41Q.js +0 -1
  88. package/dist/layers.C4I8YhJZ.js +0 -5
  89. package/dist/layers.C5qL4bIV.js +0 -205
  90. package/dist/layers.C6aCloZA.js +0 -38
  91. package/dist/layers.C7u0t-7x.js +0 -1286
  92. package/dist/layers.C8_lu5UH.js +0 -23
  93. package/dist/layers.CAAFE7RU.js +0 -139
  94. package/dist/layers.CB2mPEGO.js +0 -1
  95. package/dist/layers.CBcgiYqo.js +0 -4
  96. package/dist/layers.CCDs3V-r.js +0 -8
  97. package/dist/layers.CDLOFVyh.js +0 -38
  98. package/dist/layers.CGbUBRpT.js +0 -271
  99. package/dist/layers.CHZsXQcr.js +0 -1
  100. package/dist/layers.CIugfnNi.js +0 -3
  101. package/dist/layers.CJjG7mfo.js +0 -122
  102. package/dist/layers.CJuRWDaP.js +0 -4
  103. package/dist/layers.CJx3dksh.js +0 -160
  104. package/dist/layers.CKG-SsM4.js +0 -11
  105. package/dist/layers.CKquYTab.js +0 -1
  106. package/dist/layers.CLVteXPI.js +0 -1
  107. package/dist/layers.CMSKPoUf.js +0 -1
  108. package/dist/layers.CMi59Dge.js +0 -10
  109. package/dist/layers.CPPXzJSG.js +0 -36
  110. package/dist/layers.CQZ1lodE.js +0 -7
  111. package/dist/layers.CQzsYN9o.js +0 -35
  112. package/dist/layers.CRHVKIv6.js +0 -6
  113. package/dist/layers.CSf6dhab.js +0 -6
  114. package/dist/layers.CWNyz0df.js +0 -772
  115. package/dist/layers.CZmZZ456.js +0 -1
  116. package/dist/layers.C_-XV7nk.js +0 -84
  117. package/dist/layers.C_IvrzZ3.js +0 -7
  118. package/dist/layers.Ca9pf4pJ.js +0 -76
  119. package/dist/layers.CbY0jZsb.js +0 -32
  120. package/dist/layers.Cc2rZkMQ.js +0 -1
  121. package/dist/layers.Cd9MRGMA.js +0 -7
  122. package/dist/layers.CexInYJw.js +0 -41
  123. package/dist/layers.CfUjnxzs.js +0 -36
  124. package/dist/layers.CfiPo1zZ.js +0 -10
  125. package/dist/layers.CftSz0vc.js +0 -1
  126. package/dist/layers.Cfv_lKzM.js +0 -10
  127. package/dist/layers.CgV5Zdgg.js +0 -41
  128. package/dist/layers.Cho0M3o5.js +0 -9
  129. package/dist/layers.CiGopRcm.js +0 -1
  130. package/dist/layers.Ck8FKMZm.js +0 -1
  131. package/dist/layers.ClN7_yK6.js +0 -5
  132. package/dist/layers.CmzeQrqF.js +0 -1
  133. package/dist/layers.Cnf9xVrU.js +0 -37
  134. package/dist/layers.Cq1FOBBz.js +0 -1089
  135. package/dist/layers.CqVTtuYm.js +0 -6
  136. package/dist/layers.CtVzpEDj.js +0 -6
  137. package/dist/layers.CvxLmsUR.js +0 -794
  138. package/dist/layers.Cx0MLYpT.js +0 -8
  139. package/dist/layers.CxBPsaPO.js +0 -39
  140. package/dist/layers.Cxm8b7tr.js +0 -39
  141. package/dist/layers.CyodKjZl.js +0 -8
  142. package/dist/layers.Cyzu9PKQ.js +0 -1
  143. package/dist/layers.Cz-fKIJ9.js +0 -36
  144. package/dist/layers.CzhydN8y.js +0 -1
  145. package/dist/layers.D-An1dnI.js +0 -14
  146. package/dist/layers.D-gA0YP7.js +0 -323
  147. package/dist/layers.D0q1Ima3.js +0 -8
  148. package/dist/layers.D0zn4_Mx.js +0 -1
  149. package/dist/layers.D2BUdbOP.js +0 -42
  150. package/dist/layers.D3R9NG6l.js +0 -36
  151. package/dist/layers.D4CL9IrO.js +0 -40
  152. package/dist/layers.D4T8fTcj.js +0 -1223
  153. package/dist/layers.D5rUZxAZ.js +0 -7
  154. package/dist/layers.D6_pquAg.js +0 -5
  155. package/dist/layers.D7jGxypv.js +0 -8
  156. package/dist/layers.D8mu5H7D.js +0 -40
  157. package/dist/layers.D9hwmTsT.js +0 -40
  158. package/dist/layers.DD85x_gL.js +0 -70
  159. package/dist/layers.DEafoGBP.js +0 -276
  160. package/dist/layers.DHntpDKc.js +0 -7
  161. package/dist/layers.DLMNg96A.js +0 -38
  162. package/dist/layers.DLofN-Lu.js +0 -8583
  163. package/dist/layers.DLwuMfdd.js +0 -84
  164. package/dist/layers.DMJTlnQs.js +0 -805
  165. package/dist/layers.DMkBISW1.js +0 -1
  166. package/dist/layers.DN9HoVxI.js +0 -18
  167. package/dist/layers.DN_7Oas1.js +0 -1034
  168. package/dist/layers.DO0LV8uH.js +0 -9
  169. package/dist/layers.DOGjj8Tb.js +0 -9
  170. package/dist/layers.DOU0CUz1.js +0 -9
  171. package/dist/layers.DOrgOHBr.js +0 -1
  172. package/dist/layers.DQ9XoPxf.js +0 -35
  173. package/dist/layers.DRJ1C2cQ.js +0 -907
  174. package/dist/layers.DW4YSj_5.js +0 -425
  175. package/dist/layers.DWZOB_8o.js +0 -48149
  176. package/dist/layers.DXraj6Ay.js +0 -806
  177. package/dist/layers.DZ1kwAKl.js +0 -41
  178. package/dist/layers.DZkyZJBC.js +0 -2966
  179. package/dist/layers.DasUia_A.js +0 -96
  180. package/dist/layers.DbLpb0GU.js +0 -5
  181. package/dist/layers.DbaKVP5e.js +0 -1
  182. package/dist/layers.Des3K8ZW.js +0 -257
  183. package/dist/layers.DfNV-1tq.js +0 -1
  184. package/dist/layers.Dg4R4jUk.js +0 -39
  185. package/dist/layers.DiMecbBf.js +0 -213
  186. package/dist/layers.DjUOC4st.js +0 -16
  187. package/dist/layers.Djrk43ut.js +0 -7
  188. package/dist/layers.DkU_CdUC.js +0 -1
  189. package/dist/layers.DmGGgMLi.js +0 -32
  190. package/dist/layers.DmWCogHY.js +0 -9
  191. package/dist/layers.DmrEOz9f.js +0 -40
  192. package/dist/layers.DoRJikzG.js +0 -33
  193. package/dist/layers.DoUFJmIZ.js +0 -2482
  194. package/dist/layers.DpOQ0SWe.js +0 -41
  195. package/dist/layers.DpTLOdAf.js +0 -2
  196. package/dist/layers.Dpx73nZ5.js +0 -37
  197. package/dist/layers.DrjRMlMd.js +0 -504
  198. package/dist/layers.DsfTLYHN.js +0 -295
  199. package/dist/layers.DtKC3G6H.js +0 -40
  200. package/dist/layers.DtOyZMno.js +0 -42
  201. package/dist/layers.Dv9gkxbE.js +0 -8
  202. package/dist/layers.DvK2O2ur.js +0 -21941
  203. package/dist/layers.DxA6ocdw.js +0 -70
  204. package/dist/layers.Dxw5Sd8s.js +0 -223
  205. package/dist/layers.Dy1naDTQ.js +0 -14
  206. package/dist/layers.Dy44TnYE.js +0 -32
  207. package/dist/layers.DyypgoWd.js +0 -39
  208. package/dist/layers.Dzcm8AcP.js +0 -1583
  209. package/dist/layers.F0RyUduP.js +0 -65
  210. package/dist/layers.F544mK7B.js +0 -41
  211. package/dist/layers.GAckqh_M.js +0 -40
  212. package/dist/layers.HUIM9HzL.js +0 -9
  213. package/dist/layers.HfEMdS1b.js +0 -10
  214. package/dist/layers.JWCLFILJ.js +0 -1
  215. package/dist/layers.MIHL5IVH.js +0 -7
  216. package/dist/layers.N0yl3_Na.js +0 -44
  217. package/dist/layers.NWhpAYeJ.js +0 -198
  218. package/dist/layers.Q2Aadwn9.js +0 -42
  219. package/dist/layers.R8mPlCA0.js +0 -261
  220. package/dist/layers.Vof2qGdM.js +0 -1088
  221. package/dist/layers.W_ErWU4y.js +0 -139
  222. package/dist/layers.WlID94Nt.js +0 -6
  223. package/dist/layers.YY1k0HSU.js +0 -1
  224. package/dist/layers.YjzlfOSN.js +0 -84
  225. package/dist/layers.ZX3I648e.js +0 -934
  226. package/dist/layers.b0h5ZBmD.js +0 -61
  227. package/dist/layers.bPp4y4tJ.js +0 -423
  228. package/dist/layers.bXo5QOKy.js +0 -5
  229. package/dist/layers.bkVgdJRL.js +0 -2
  230. package/dist/layers.d6r5nQuW.js +0 -11
  231. package/dist/layers.dl89lGbj.js +0 -33
  232. package/dist/layers.dswX3xs9.js +0 -1
  233. package/dist/layers.efcYaHoV.js +0 -32
  234. package/dist/layers.fLsBww_F.js +0 -1
  235. package/dist/layers.i1FJeF3y.js +0 -37
  236. package/dist/layers.jU6Z3i2q.js +0 -40
  237. package/dist/layers.k6Lqzy4i.js +0 -8
  238. package/dist/layers.lCpg7dOn.js +0 -21
  239. package/dist/layers.nVP4QDpX.js +0 -118
  240. package/dist/layers.obbaq0Iy.js +0 -42
  241. package/dist/layers.ooKeArD_.js +0 -34
  242. package/dist/layers.pXaWfCQn.js +0 -40
  243. package/dist/layers.pYlF8GU4.js +0 -32
  244. package/dist/layers.qhRg6f--.js +0 -11
  245. package/dist/layers.rNCWSOcA.js +0 -7
  246. package/dist/layers.t1lmm4vP.js +0 -13
  247. package/dist/layers.wEFFSFio.js +0 -21620
  248. package/dist/layers.zAXb9NBT.js +0 -9
@@ -1,1225 +0,0 @@
1
- import { W as se, a6 as ye, d as H, e as Ee, l as S, q as we, j as De, g as he, _ as ve } from "./layers.DLofN-Lu.js";
2
- import Ne from "lodash-es/clone.js";
3
- import { i as ke, a as Ie, b as Oe, p as Te, c as ge, d as ze } from "./layers.Vof2qGdM.js";
4
- import { G as Ce } from "./layers.BJDrjORS.js";
5
- import "./layers.wEFFSFio.js";
6
- import "lodash-es/memoize.js";
7
- import "lodash-es/merge.js";
8
- import "lodash-es/isEmpty.js";
9
- import { c as Ae } from "./layers.DbLpb0GU.js";
10
- import { o as Re } from "./layers.b0h5ZBmD.js";
11
- import { s as Be } from "./layers.D7jGxypv.js";
12
- var le, oe, ee = (function() {
13
- var e = function(D, o, s, i) {
14
- for (s = s || {}, i = D.length; i--; s[D[i]] = o)
15
- ;
16
- return s;
17
- }, a = [1, 7], d = [1, 13], c = [1, 14], n = [1, 15], g = [1, 19], l = [1, 16], f = [1, 17], b = [1, 18], p = [8, 30], x = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], y = [1, 23], T = [1, 24], v = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], N = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], E = [1, 49], L = {
18
- trace: function() {
19
- },
20
- yy: {},
21
- symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, block: 31, NODE_ID: 32, nodeShapeNLabel: 33, dirList: 34, DIR: 35, NODE_DSTART: 36, NODE_DEND: 37, BLOCK_ARROW_START: 38, BLOCK_ARROW_END: 39, classDef: 40, CLASSDEF_ID: 41, CLASSDEF_STYLEOPTS: 42, DEFAULT: 43, class: 44, CLASSENTITY_IDS: 45, STYLECLASS: 46, style: 47, STYLE_ENTITY_IDS: 48, STYLE_DEFINITION_DATA: 49, $accept: 0, $end: 1 },
22
- terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
23
- productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
24
- performAction: function(o, s, i, u, h, t, m) {
25
- var r = t.length - 1;
26
- switch (h) {
27
- case 4:
28
- u.getLogger().debug("Rule: separator (NL) ");
29
- break;
30
- case 5:
31
- u.getLogger().debug("Rule: separator (Space) ");
32
- break;
33
- case 6:
34
- u.getLogger().debug("Rule: separator (EOF) ");
35
- break;
36
- case 7:
37
- u.getLogger().debug("Rule: hierarchy: ", t[r - 1]), u.setHierarchy(t[r - 1]);
38
- break;
39
- case 8:
40
- u.getLogger().debug("Stop NL ");
41
- break;
42
- case 9:
43
- u.getLogger().debug("Stop EOF ");
44
- break;
45
- case 10:
46
- u.getLogger().debug("Stop NL2 ");
47
- break;
48
- case 11:
49
- u.getLogger().debug("Stop EOF2 ");
50
- break;
51
- case 12:
52
- u.getLogger().debug("Rule: statement: ", t[r]), typeof t[r].length == "number" ? this.$ = t[r] : this.$ = [t[r]];
53
- break;
54
- case 13:
55
- u.getLogger().debug("Rule: statement #2: ", t[r - 1]), this.$ = [t[r - 1]].concat(t[r]);
56
- break;
57
- case 14:
58
- u.getLogger().debug("Rule: link: ", t[r], o), this.$ = { edgeTypeStr: t[r], label: "" };
59
- break;
60
- case 15:
61
- u.getLogger().debug("Rule: LABEL link: ", t[r - 3], t[r - 1], t[r]), this.$ = { edgeTypeStr: t[r], label: t[r - 1] };
62
- break;
63
- case 18:
64
- const R = parseInt(t[r]), Y = u.generateId();
65
- this.$ = { id: Y, type: "space", label: "", width: R, children: [] };
66
- break;
67
- case 23:
68
- u.getLogger().debug("Rule: (nodeStatement link node) ", t[r - 2], t[r - 1], t[r], " typestr: ", t[r - 1].edgeTypeStr);
69
- const F = u.edgeStrToEdgeData(t[r - 1].edgeTypeStr);
70
- this.$ = [
71
- { id: t[r - 2].id, label: t[r - 2].label, type: t[r - 2].type, directions: t[r - 2].directions },
72
- { id: t[r - 2].id + "-" + t[r].id, start: t[r - 2].id, end: t[r].id, label: t[r - 1].label, type: "edge", directions: t[r].directions, arrowTypeEnd: F, arrowTypeStart: "arrow_open" },
73
- { id: t[r].id, label: t[r].label, type: u.typeStr2Type(t[r].typeStr), directions: t[r].directions }
74
- ];
75
- break;
76
- case 24:
77
- u.getLogger().debug("Rule: nodeStatement (abc88 node size) ", t[r - 1], t[r]), this.$ = { id: t[r - 1].id, label: t[r - 1].label, type: u.typeStr2Type(t[r - 1].typeStr), directions: t[r - 1].directions, widthInColumns: parseInt(t[r], 10) };
78
- break;
79
- case 25:
80
- u.getLogger().debug("Rule: nodeStatement (node) ", t[r]), this.$ = { id: t[r].id, label: t[r].label, type: u.typeStr2Type(t[r].typeStr), directions: t[r].directions, widthInColumns: 1 };
81
- break;
82
- case 26:
83
- u.getLogger().debug("APA123", this ? this : "na"), u.getLogger().debug("COLUMNS: ", t[r]), this.$ = { type: "column-setting", columns: t[r] === "auto" ? -1 : parseInt(t[r]) };
84
- break;
85
- case 27:
86
- u.getLogger().debug("Rule: id-block statement : ", t[r - 2], t[r - 1]), u.generateId(), this.$ = { ...t[r - 2], type: "composite", children: t[r - 1] };
87
- break;
88
- case 28:
89
- u.getLogger().debug("Rule: blockStatement : ", t[r - 2], t[r - 1], t[r]);
90
- const C = u.generateId();
91
- this.$ = { id: C, type: "composite", label: "", children: t[r - 1] };
92
- break;
93
- case 29:
94
- u.getLogger().debug("Rule: node (NODE_ID separator): ", t[r]), this.$ = { id: t[r] };
95
- break;
96
- case 30:
97
- u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", t[r - 1], t[r]), this.$ = { id: t[r - 1], label: t[r].label, typeStr: t[r].typeStr, directions: t[r].directions };
98
- break;
99
- case 31:
100
- u.getLogger().debug("Rule: dirList: ", t[r]), this.$ = [t[r]];
101
- break;
102
- case 32:
103
- u.getLogger().debug("Rule: dirList: ", t[r - 1], t[r]), this.$ = [t[r - 1]].concat(t[r]);
104
- break;
105
- case 33:
106
- u.getLogger().debug("Rule: nodeShapeNLabel: ", t[r - 2], t[r - 1], t[r]), this.$ = { typeStr: t[r - 2] + t[r], label: t[r - 1] };
107
- break;
108
- case 34:
109
- u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", t[r - 3], t[r - 2], " #3:", t[r - 1], t[r]), this.$ = { typeStr: t[r - 3] + t[r], label: t[r - 2], directions: t[r - 1] };
110
- break;
111
- case 35:
112
- case 36:
113
- this.$ = { type: "classDef", id: t[r - 1].trim(), css: t[r].trim() };
114
- break;
115
- case 37:
116
- this.$ = { type: "applyClass", id: t[r - 1].trim(), styleClass: t[r].trim() };
117
- break;
118
- case 38:
119
- this.$ = { type: "applyStyles", id: t[r - 1].trim(), stylesStr: t[r].trim() };
120
- break;
121
- }
122
- },
123
- table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: d, 29: c, 31: n, 32: g, 40: l, 44: f, 47: b }, { 8: [1, 20] }, e(p, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: a, 28: d, 29: c, 31: n, 32: g, 40: l, 44: f, 47: b }), e(x, [2, 16], { 14: 22, 15: y, 16: T }), e(x, [2, 17]), e(x, [2, 18]), e(x, [2, 19]), e(x, [2, 20]), e(x, [2, 21]), e(x, [2, 22]), e(v, [2, 25], { 27: [1, 25] }), e(x, [2, 26]), { 19: 26, 26: 12, 32: g }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: d, 29: c, 31: n, 32: g, 40: l, 44: f, 47: b }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, e(N, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, e(p, [2, 13]), { 26: 35, 32: g }, { 32: [2, 14] }, { 17: [1, 36] }, e(v, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: y, 16: T, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: d, 29: c, 31: n, 32: g, 40: l, 44: f, 47: b }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, e(N, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(v, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(x, [2, 28]), e(x, [2, 35]), e(x, [2, 36]), e(x, [2, 37]), e(x, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: E }, { 15: [1, 50] }, e(x, [2, 27]), e(N, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: E, 39: [2, 31] }, { 32: [2, 15] }, e(N, [2, 34]), { 39: [2, 32] }],
124
- defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
125
- parseError: function(o, s) {
126
- if (s.recoverable)
127
- this.trace(o);
128
- else {
129
- var i = new Error(o);
130
- throw i.hash = s, i;
131
- }
132
- },
133
- parse: function(o) {
134
- var s = this, i = [0], u = [], h = [null], t = [], m = this.table, r = "", R = 0, Y = 0, F = 2, C = 1, Le = t.slice.call(arguments, 1), w = Object.create(this.lexer), K = { yy: {} };
135
- for (var Z in this.yy)
136
- Object.prototype.hasOwnProperty.call(this.yy, Z) && (K.yy[Z] = this.yy[Z]);
137
- w.setInput(o, K.yy), K.yy.lexer = w, K.yy.parser = this, typeof w.yylloc > "u" && (w.yylloc = {});
138
- var J = w.yylloc;
139
- t.push(J);
140
- var me = w.options && w.options.ranges;
141
- typeof K.yy.parseError == "function" ? this.parseError = K.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
142
- function _e() {
143
- var P;
144
- return P = u.pop() || w.lex() || C, typeof P != "number" && (P instanceof Array && (u = P, P = u.pop()), P = s.symbols_[P] || P), P;
145
- }
146
- for (var I, M, z, Q, W = {}, X, B, ae, G; ; ) {
147
- if (M = i[i.length - 1], this.defaultActions[M] ? z = this.defaultActions[M] : ((I === null || typeof I > "u") && (I = _e()), z = m[M] && m[M][I]), typeof z > "u" || !z.length || !z[0]) {
148
- var $ = "";
149
- G = [];
150
- for (X in m[M])
151
- this.terminals_[X] && X > F && G.push("'" + this.terminals_[X] + "'");
152
- w.showPosition ? $ = "Parse error on line " + (R + 1) + `:
153
- ` + w.showPosition() + `
154
- Expecting ` + G.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : $ = "Parse error on line " + (R + 1) + ": Unexpected " + (I == C ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError($, {
155
- text: w.match,
156
- token: this.terminals_[I] || I,
157
- line: w.yylineno,
158
- loc: J,
159
- expected: G
160
- });
161
- }
162
- if (z[0] instanceof Array && z.length > 1)
163
- throw new Error("Parse Error: multiple actions possible at state: " + M + ", token: " + I);
164
- switch (z[0]) {
165
- case 1:
166
- i.push(I), h.push(w.yytext), t.push(w.yylloc), i.push(z[1]), I = null, Y = w.yyleng, r = w.yytext, R = w.yylineno, J = w.yylloc;
167
- break;
168
- case 2:
169
- if (B = this.productions_[z[1]][1], W.$ = h[h.length - B], W._$ = {
170
- first_line: t[t.length - (B || 1)].first_line,
171
- last_line: t[t.length - 1].last_line,
172
- first_column: t[t.length - (B || 1)].first_column,
173
- last_column: t[t.length - 1].last_column
174
- }, me && (W._$.range = [
175
- t[t.length - (B || 1)].range[0],
176
- t[t.length - 1].range[1]
177
- ]), Q = this.performAction.apply(W, [
178
- r,
179
- Y,
180
- R,
181
- K.yy,
182
- z[1],
183
- h,
184
- t
185
- ].concat(Le)), typeof Q < "u")
186
- return Q;
187
- B && (i = i.slice(0, -1 * B * 2), h = h.slice(0, -1 * B), t = t.slice(0, -1 * B)), i.push(this.productions_[z[1]][0]), h.push(W.$), t.push(W._$), ae = m[i[i.length - 2]][i[i.length - 1]], i.push(ae);
188
- break;
189
- case 3:
190
- return !0;
191
- }
192
- }
193
- return !0;
194
- }
195
- }, A = /* @__PURE__ */ (function() {
196
- var D = {
197
- EOF: 1,
198
- parseError: function(s, i) {
199
- if (this.yy.parser)
200
- this.yy.parser.parseError(s, i);
201
- else
202
- throw new Error(s);
203
- },
204
- // resets the lexer, sets new input
205
- setInput: function(o, s) {
206
- return this.yy = s || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
207
- first_line: 1,
208
- first_column: 0,
209
- last_line: 1,
210
- last_column: 0
211
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
212
- },
213
- // consumes and returns one char from the input
214
- input: function() {
215
- var o = this._input[0];
216
- this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
217
- var s = o.match(/(?:\r\n?|\n).*/g);
218
- return s ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
219
- },
220
- // unshifts one char (or a string) into the input
221
- unput: function(o) {
222
- var s = o.length, i = o.split(/(?:\r\n?|\n)/g);
223
- this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - s), this.offset -= s;
224
- var u = this.match.split(/(?:\r\n?|\n)/g);
225
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), i.length - 1 && (this.yylineno -= i.length - 1);
226
- var h = this.yylloc.range;
227
- return this.yylloc = {
228
- first_line: this.yylloc.first_line,
229
- last_line: this.yylineno + 1,
230
- first_column: this.yylloc.first_column,
231
- last_column: i ? (i.length === u.length ? this.yylloc.first_column : 0) + u[u.length - i.length].length - i[0].length : this.yylloc.first_column - s
232
- }, this.options.ranges && (this.yylloc.range = [h[0], h[0] + this.yyleng - s]), this.yyleng = this.yytext.length, this;
233
- },
234
- // When called from action, caches matched text and appends it on next action
235
- more: function() {
236
- return this._more = !0, this;
237
- },
238
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
239
- reject: function() {
240
- if (this.options.backtrack_lexer)
241
- this._backtrack = !0;
242
- else
243
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
244
- ` + this.showPosition(), {
245
- text: "",
246
- token: null,
247
- line: this.yylineno
248
- });
249
- return this;
250
- },
251
- // retain first n characters of the match
252
- less: function(o) {
253
- this.unput(this.match.slice(o));
254
- },
255
- // displays already matched input, i.e. for error messages
256
- pastInput: function() {
257
- var o = this.matched.substr(0, this.matched.length - this.match.length);
258
- return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
259
- },
260
- // displays upcoming input, i.e. for error messages
261
- upcomingInput: function() {
262
- var o = this.match;
263
- return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
264
- },
265
- // displays the character position where the lexing error occurred, i.e. for error messages
266
- showPosition: function() {
267
- var o = this.pastInput(), s = new Array(o.length + 1).join("-");
268
- return o + this.upcomingInput() + `
269
- ` + s + "^";
270
- },
271
- // test the lexed token: return FALSE when not a match, otherwise return token
272
- test_match: function(o, s) {
273
- var i, u, h;
274
- if (this.options.backtrack_lexer && (h = {
275
- yylineno: this.yylineno,
276
- yylloc: {
277
- first_line: this.yylloc.first_line,
278
- last_line: this.last_line,
279
- first_column: this.yylloc.first_column,
280
- last_column: this.yylloc.last_column
281
- },
282
- yytext: this.yytext,
283
- match: this.match,
284
- matches: this.matches,
285
- matched: this.matched,
286
- yyleng: this.yyleng,
287
- offset: this.offset,
288
- _more: this._more,
289
- _input: this._input,
290
- yy: this.yy,
291
- conditionStack: this.conditionStack.slice(0),
292
- done: this.done
293
- }, this.options.ranges && (h.yylloc.range = this.yylloc.range.slice(0))), u = o[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
294
- first_line: this.yylloc.last_line,
295
- last_line: this.yylineno + 1,
296
- first_column: this.yylloc.last_column,
297
- last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
298
- }, this.yytext += o[0], this.match += o[0], this.matches = o, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(o[0].length), this.matched += o[0], i = this.performAction.call(this, this.yy, this, s, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), i)
299
- return i;
300
- if (this._backtrack) {
301
- for (var t in h)
302
- this[t] = h[t];
303
- return !1;
304
- }
305
- return !1;
306
- },
307
- // return next match in input
308
- next: function() {
309
- if (this.done)
310
- return this.EOF;
311
- this._input || (this.done = !0);
312
- var o, s, i, u;
313
- this._more || (this.yytext = "", this.match = "");
314
- for (var h = this._currentRules(), t = 0; t < h.length; t++)
315
- if (i = this._input.match(this.rules[h[t]]), i && (!s || i[0].length > s[0].length)) {
316
- if (s = i, u = t, this.options.backtrack_lexer) {
317
- if (o = this.test_match(i, h[t]), o !== !1)
318
- return o;
319
- if (this._backtrack) {
320
- s = !1;
321
- continue;
322
- } else
323
- return !1;
324
- } else if (!this.options.flex)
325
- break;
326
- }
327
- return s ? (o = this.test_match(s, h[u]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
328
- ` + this.showPosition(), {
329
- text: "",
330
- token: null,
331
- line: this.yylineno
332
- });
333
- },
334
- // return next match that has a token
335
- lex: function() {
336
- var s = this.next();
337
- return s || this.lex();
338
- },
339
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
340
- begin: function(s) {
341
- this.conditionStack.push(s);
342
- },
343
- // pop the previously active lexer condition state off the condition stack
344
- popState: function() {
345
- var s = this.conditionStack.length - 1;
346
- return s > 0 ? this.conditionStack.pop() : this.conditionStack[0];
347
- },
348
- // produce the lexer rule set which is active for the currently active lexer condition state
349
- _currentRules: function() {
350
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
351
- },
352
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
353
- topState: function(s) {
354
- return s = this.conditionStack.length - 1 - Math.abs(s || 0), s >= 0 ? this.conditionStack[s] : "INITIAL";
355
- },
356
- // alias for begin(condition)
357
- pushState: function(s) {
358
- this.begin(s);
359
- },
360
- // return the number of states currently on the stack
361
- stateStackSize: function() {
362
- return this.conditionStack.length;
363
- },
364
- options: {},
365
- performAction: function(s, i, u, h) {
366
- switch (u) {
367
- case 0:
368
- return 10;
369
- case 1:
370
- return s.getLogger().debug("Found space-block"), 31;
371
- case 2:
372
- return s.getLogger().debug("Found nl-block"), 31;
373
- case 3:
374
- return s.getLogger().debug("Found space-block"), 29;
375
- case 4:
376
- s.getLogger().debug(".", i.yytext);
377
- break;
378
- case 5:
379
- s.getLogger().debug("_", i.yytext);
380
- break;
381
- case 6:
382
- return 5;
383
- case 7:
384
- return i.yytext = -1, 28;
385
- case 8:
386
- return i.yytext = i.yytext.replace(/columns\s+/, ""), s.getLogger().debug("COLUMNS (LEX)", i.yytext), 28;
387
- case 9:
388
- this.pushState("md_string");
389
- break;
390
- case 10:
391
- return "MD_STR";
392
- case 11:
393
- this.popState();
394
- break;
395
- case 12:
396
- this.pushState("string");
397
- break;
398
- case 13:
399
- s.getLogger().debug("LEX: POPPING STR:", i.yytext), this.popState();
400
- break;
401
- case 14:
402
- return s.getLogger().debug("LEX: STR end:", i.yytext), "STR";
403
- case 15:
404
- return i.yytext = i.yytext.replace(/space\:/, ""), s.getLogger().debug("SPACE NUM (LEX)", i.yytext), 21;
405
- case 16:
406
- return i.yytext = "1", s.getLogger().debug("COLUMNS (LEX)", i.yytext), 21;
407
- case 17:
408
- return 43;
409
- case 18:
410
- return "LINKSTYLE";
411
- case 19:
412
- return "INTERPOLATE";
413
- case 20:
414
- return this.pushState("CLASSDEF"), 40;
415
- case 21:
416
- return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
417
- case 22:
418
- return this.popState(), this.pushState("CLASSDEFID"), 41;
419
- case 23:
420
- return this.popState(), 42;
421
- case 24:
422
- return this.pushState("CLASS"), 44;
423
- case 25:
424
- return this.popState(), this.pushState("CLASS_STYLE"), 45;
425
- case 26:
426
- return this.popState(), 46;
427
- case 27:
428
- return this.pushState("STYLE_STMNT"), 47;
429
- case 28:
430
- return this.popState(), this.pushState("STYLE_DEFINITION"), 48;
431
- case 29:
432
- return this.popState(), 49;
433
- case 30:
434
- return this.pushState("acc_title"), "acc_title";
435
- case 31:
436
- return this.popState(), "acc_title_value";
437
- case 32:
438
- return this.pushState("acc_descr"), "acc_descr";
439
- case 33:
440
- return this.popState(), "acc_descr_value";
441
- case 34:
442
- this.pushState("acc_descr_multiline");
443
- break;
444
- case 35:
445
- this.popState();
446
- break;
447
- case 36:
448
- return "acc_descr_multiline_value";
449
- case 37:
450
- return 30;
451
- case 38:
452
- return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
453
- case 39:
454
- return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
455
- case 40:
456
- return this.popState(), s.getLogger().debug("Lex: ))"), "NODE_DEND";
457
- case 41:
458
- return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
459
- case 42:
460
- return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
461
- case 43:
462
- return this.popState(), s.getLogger().debug("Lex: (-"), "NODE_DEND";
463
- case 44:
464
- return this.popState(), s.getLogger().debug("Lex: -)"), "NODE_DEND";
465
- case 45:
466
- return this.popState(), s.getLogger().debug("Lex: (("), "NODE_DEND";
467
- case 46:
468
- return this.popState(), s.getLogger().debug("Lex: ]]"), "NODE_DEND";
469
- case 47:
470
- return this.popState(), s.getLogger().debug("Lex: ("), "NODE_DEND";
471
- case 48:
472
- return this.popState(), s.getLogger().debug("Lex: ])"), "NODE_DEND";
473
- case 49:
474
- return this.popState(), s.getLogger().debug("Lex: /]"), "NODE_DEND";
475
- case 50:
476
- return this.popState(), s.getLogger().debug("Lex: /]"), "NODE_DEND";
477
- case 51:
478
- return this.popState(), s.getLogger().debug("Lex: )]"), "NODE_DEND";
479
- case 52:
480
- return this.popState(), s.getLogger().debug("Lex: )"), "NODE_DEND";
481
- case 53:
482
- return this.popState(), s.getLogger().debug("Lex: ]>"), "NODE_DEND";
483
- case 54:
484
- return this.popState(), s.getLogger().debug("Lex: ]"), "NODE_DEND";
485
- case 55:
486
- return s.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 36;
487
- case 56:
488
- return s.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 36;
489
- case 57:
490
- return s.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 36;
491
- case 58:
492
- return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
493
- case 59:
494
- return s.getLogger().debug("Lex: ((("), this.pushState("NODE"), 36;
495
- case 60:
496
- return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
497
- case 61:
498
- return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
499
- case 62:
500
- return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
501
- case 63:
502
- return s.getLogger().debug("Lexc: >"), this.pushState("NODE"), 36;
503
- case 64:
504
- return s.getLogger().debug("Lexa: (["), this.pushState("NODE"), 36;
505
- case 65:
506
- return s.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
507
- case 66:
508
- return this.pushState("NODE"), 36;
509
- case 67:
510
- return this.pushState("NODE"), 36;
511
- case 68:
512
- return this.pushState("NODE"), 36;
513
- case 69:
514
- return this.pushState("NODE"), 36;
515
- case 70:
516
- return this.pushState("NODE"), 36;
517
- case 71:
518
- return this.pushState("NODE"), 36;
519
- case 72:
520
- return this.pushState("NODE"), 36;
521
- case 73:
522
- return s.getLogger().debug("Lexa: ["), this.pushState("NODE"), 36;
523
- case 74:
524
- return this.pushState("BLOCK_ARROW"), s.getLogger().debug("LEX ARR START"), 38;
525
- case 75:
526
- return s.getLogger().debug("Lex: NODE_ID", i.yytext), 32;
527
- case 76:
528
- return s.getLogger().debug("Lex: EOF", i.yytext), 8;
529
- case 77:
530
- this.pushState("md_string");
531
- break;
532
- case 78:
533
- this.pushState("md_string");
534
- break;
535
- case 79:
536
- return "NODE_DESCR";
537
- case 80:
538
- this.popState();
539
- break;
540
- case 81:
541
- s.getLogger().debug("Lex: Starting string"), this.pushState("string");
542
- break;
543
- case 82:
544
- s.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
545
- break;
546
- case 83:
547
- return s.getLogger().debug("LEX: NODE_DESCR:", i.yytext), "NODE_DESCR";
548
- case 84:
549
- s.getLogger().debug("LEX POPPING"), this.popState();
550
- break;
551
- case 85:
552
- s.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
553
- break;
554
- case 86:
555
- return i.yytext = i.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (right): dir:", i.yytext), "DIR";
556
- case 87:
557
- return i.yytext = i.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (left):", i.yytext), "DIR";
558
- case 88:
559
- return i.yytext = i.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (x):", i.yytext), "DIR";
560
- case 89:
561
- return i.yytext = i.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (y):", i.yytext), "DIR";
562
- case 90:
563
- return i.yytext = i.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (up):", i.yytext), "DIR";
564
- case 91:
565
- return i.yytext = i.yytext.replace(/^,\s*/, ""), s.getLogger().debug("Lex (down):", i.yytext), "DIR";
566
- case 92:
567
- return i.yytext = "]>", s.getLogger().debug("Lex (ARROW_DIR end):", i.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
568
- case 93:
569
- return s.getLogger().debug("Lex: LINK", "#" + i.yytext + "#"), 15;
570
- case 94:
571
- return s.getLogger().debug("Lex: LINK", i.yytext), 15;
572
- case 95:
573
- return s.getLogger().debug("Lex: LINK", i.yytext), 15;
574
- case 96:
575
- return s.getLogger().debug("Lex: LINK", i.yytext), 15;
576
- case 97:
577
- return s.getLogger().debug("Lex: START_LINK", i.yytext), this.pushState("LLABEL"), 16;
578
- case 98:
579
- return s.getLogger().debug("Lex: START_LINK", i.yytext), this.pushState("LLABEL"), 16;
580
- case 99:
581
- return s.getLogger().debug("Lex: START_LINK", i.yytext), this.pushState("LLABEL"), 16;
582
- case 100:
583
- this.pushState("md_string");
584
- break;
585
- case 101:
586
- return s.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
587
- case 102:
588
- return this.popState(), s.getLogger().debug("Lex: LINK", "#" + i.yytext + "#"), 15;
589
- case 103:
590
- return this.popState(), s.getLogger().debug("Lex: LINK", i.yytext), 15;
591
- case 104:
592
- return this.popState(), s.getLogger().debug("Lex: LINK", i.yytext), 15;
593
- case 105:
594
- return s.getLogger().debug("Lex: COLON", i.yytext), i.yytext = i.yytext.slice(1), 27;
595
- }
596
- },
597
- rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
598
- conditions: { STYLE_DEFINITION: { rules: [29], inclusive: !1 }, STYLE_STMNT: { rules: [28], inclusive: !1 }, CLASSDEFID: { rules: [23], inclusive: !1 }, CLASSDEF: { rules: [21, 22], inclusive: !1 }, CLASS_STYLE: { rules: [26], inclusive: !1 }, CLASS: { rules: [25], inclusive: !1 }, LLABEL: { rules: [100, 101, 102, 103, 104], inclusive: !1 }, ARROW_DIR: { rules: [86, 87, 88, 89, 90, 91, 92], inclusive: !1 }, BLOCK_ARROW: { rules: [77, 82, 85], inclusive: !1 }, NODE: { rules: [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], inclusive: !1 }, md_string: { rules: [10, 11, 79, 80], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [13, 14, 83, 84], inclusive: !1 }, acc_descr_multiline: { rules: [35, 36], inclusive: !1 }, acc_descr: { rules: [33], inclusive: !1 }, acc_title: { rules: [31], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], inclusive: !0 } }
599
- };
600
- return D;
601
- })();
602
- L.lexer = A;
603
- function k() {
604
- this.yy = {};
605
- }
606
- return k.prototype = L, L.Parser = k, new k();
607
- })();
608
- ee.parser = ee;
609
- const Pe = ee;
610
- let O = {}, ie = [], j = {};
611
- const ce = "color", ue = "fill", Fe = "bgFill", pe = ",", Ke = he();
612
- let V = {};
613
- const Me = (e) => De.sanitizeText(e, Ke), Ye = function(e, a = "") {
614
- V[e] === void 0 && (V[e] = { id: e, styles: [], textStyles: [] });
615
- const d = V[e];
616
- a != null && a.split(pe).forEach((c) => {
617
- const n = c.replace(/([^;]*);/, "$1").trim();
618
- if (c.match(ce)) {
619
- const l = n.replace(ue, Fe).replace(ce, ue);
620
- d.textStyles.push(l);
621
- }
622
- d.styles.push(n);
623
- });
624
- }, We = function(e, a = "") {
625
- const d = O[e];
626
- a != null && (d.styles = a.split(pe));
627
- }, je = function(e, a) {
628
- e.split(",").forEach(function(d) {
629
- let c = O[d];
630
- if (c === void 0) {
631
- const n = d.trim();
632
- O[n] = { id: n, type: "na", children: [] }, c = O[n];
633
- }
634
- c.classes || (c.classes = []), c.classes.push(a);
635
- });
636
- }, fe = (e, a) => {
637
- const d = e.flat(), c = [];
638
- for (const n of d) {
639
- if (n.label && (n.label = Me(n.label)), n.type === "classDef") {
640
- Ye(n.id, n.css);
641
- continue;
642
- }
643
- if (n.type === "applyClass") {
644
- je(n.id, (n == null ? void 0 : n.styleClass) || "");
645
- continue;
646
- }
647
- if (n.type === "applyStyles") {
648
- n != null && n.stylesStr && We(n.id, n == null ? void 0 : n.stylesStr);
649
- continue;
650
- }
651
- if (n.type === "column-setting")
652
- a.columns = n.columns || -1;
653
- else if (n.type === "edge")
654
- j[n.id] ? j[n.id]++ : j[n.id] = 1, n.id = j[n.id] + "-" + n.id, ie.push(n);
655
- else {
656
- n.label || (n.type === "composite" ? n.label = "" : n.label = n.id);
657
- const g = !O[n.id];
658
- if (g ? O[n.id] = n : (n.type !== "na" && (O[n.id].type = n.type), n.label !== n.id && (O[n.id].label = n.label)), n.children && fe(n.children, n), n.type === "space") {
659
- const l = n.width || 1;
660
- for (let f = 0; f < l; f++) {
661
- const b = Ne(n);
662
- b.id = b.id + "-" + f, O[b.id] = b, c.push(b);
663
- }
664
- } else g && c.push(n);
665
- }
666
- }
667
- a.children = c;
668
- };
669
- let re = [], U = { id: "root", type: "composite", children: [], columns: -1 };
670
- const Ve = () => {
671
- S.debug("Clear called"), we(), U = { id: "root", type: "composite", children: [], columns: -1 }, O = { root: U }, re = [], V = {}, ie = [], j = {};
672
- };
673
- function Ue(e) {
674
- switch (S.debug("typeStr2Type", e), e) {
675
- case "[]":
676
- return "square";
677
- case "()":
678
- return S.debug("we have a round"), "round";
679
- case "(())":
680
- return "circle";
681
- case ">]":
682
- return "rect_left_inv_arrow";
683
- case "{}":
684
- return "diamond";
685
- case "{{}}":
686
- return "hexagon";
687
- case "([])":
688
- return "stadium";
689
- case "[[]]":
690
- return "subroutine";
691
- case "[()]":
692
- return "cylinder";
693
- case "((()))":
694
- return "doublecircle";
695
- case "[//]":
696
- return "lean_right";
697
- case "[\\\\]":
698
- return "lean_left";
699
- case "[/\\]":
700
- return "trapezoid";
701
- case "[\\/]":
702
- return "inv_trapezoid";
703
- case "<[]>":
704
- return "block_arrow";
705
- default:
706
- return "na";
707
- }
708
- }
709
- function Xe(e) {
710
- switch (S.debug("typeStr2Type", e), e) {
711
- case "==":
712
- return "thick";
713
- default:
714
- return "normal";
715
- }
716
- }
717
- function Ge(e) {
718
- switch (e.trim()) {
719
- case "--x":
720
- return "arrow_cross";
721
- case "--o":
722
- return "arrow_circle";
723
- default:
724
- return "arrow_point";
725
- }
726
- }
727
- let de = 0;
728
- const He = () => (de++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + de), qe = (e) => {
729
- U.children = e, fe(e, U), re = U.children;
730
- }, Ze = (e) => {
731
- const a = O[e];
732
- return a ? a.columns ? a.columns : a.children ? a.children.length : -1 : -1;
733
- }, Je = () => [...Object.values(O)], Qe = () => re || [], $e = () => ie, et = (e) => O[e], tt = (e) => {
734
- O[e.id] = e;
735
- }, st = () => console, it = function() {
736
- return V;
737
- }, rt = {
738
- getConfig: () => se().block,
739
- typeStr2Type: Ue,
740
- edgeTypeStr2Type: Xe,
741
- edgeStrToEdgeData: Ge,
742
- getLogger: st,
743
- getBlocksFlat: Je,
744
- getBlocks: Qe,
745
- getEdges: $e,
746
- setHierarchy: qe,
747
- getBlock: et,
748
- setBlock: tt,
749
- getColumns: Ze,
750
- getClasses: it,
751
- clear: Ve,
752
- generateId: He
753
- }, nt = rt, q = (e, a) => {
754
- const d = Ae, c = d(e, "r"), n = d(e, "g"), g = d(e, "b");
755
- return ye(c, n, g, a);
756
- }, at = (e) => `.label {
757
- font-family: ${e.fontFamily};
758
- color: ${e.nodeTextColor || e.textColor};
759
- }
760
- .cluster-label text {
761
- fill: ${e.titleColor};
762
- }
763
- .cluster-label span,p {
764
- color: ${e.titleColor};
765
- }
766
-
767
-
768
-
769
- .label text,span,p {
770
- fill: ${e.nodeTextColor || e.textColor};
771
- color: ${e.nodeTextColor || e.textColor};
772
- }
773
-
774
- .node rect,
775
- .node circle,
776
- .node ellipse,
777
- .node polygon,
778
- .node path {
779
- fill: ${e.mainBkg};
780
- stroke: ${e.nodeBorder};
781
- stroke-width: 1px;
782
- }
783
- .flowchart-label text {
784
- text-anchor: middle;
785
- }
786
- // .flowchart-label .text-outer-tspan {
787
- // text-anchor: middle;
788
- // }
789
- // .flowchart-label .text-inner-tspan {
790
- // text-anchor: start;
791
- // }
792
-
793
- .node .label {
794
- text-align: center;
795
- }
796
- .node.clickable {
797
- cursor: pointer;
798
- }
799
-
800
- .arrowheadPath {
801
- fill: ${e.arrowheadColor};
802
- }
803
-
804
- .edgePath .path {
805
- stroke: ${e.lineColor};
806
- stroke-width: 2.0px;
807
- }
808
-
809
- .flowchart-link {
810
- stroke: ${e.lineColor};
811
- fill: none;
812
- }
813
-
814
- .edgeLabel {
815
- background-color: ${e.edgeLabelBackground};
816
- rect {
817
- opacity: 0.5;
818
- background-color: ${e.edgeLabelBackground};
819
- fill: ${e.edgeLabelBackground};
820
- }
821
- text-align: center;
822
- }
823
-
824
- /* For html labels only */
825
- .labelBkg {
826
- background-color: ${q(e.edgeLabelBackground, 0.5)};
827
- // background-color:
828
- }
829
-
830
- .node .cluster {
831
- // fill: ${q(e.mainBkg, 0.5)};
832
- fill: ${q(e.clusterBkg, 0.5)};
833
- stroke: ${q(e.clusterBorder, 0.2)};
834
- box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
835
- stroke-width: 1px;
836
- }
837
-
838
- .cluster text {
839
- fill: ${e.titleColor};
840
- }
841
-
842
- .cluster span,p {
843
- color: ${e.titleColor};
844
- }
845
- /* .cluster div {
846
- color: ${e.titleColor};
847
- } */
848
-
849
- div.mermaidTooltip {
850
- position: absolute;
851
- text-align: center;
852
- max-width: 200px;
853
- padding: 2px;
854
- font-family: ${e.fontFamily};
855
- font-size: 12px;
856
- background: ${e.tertiaryColor};
857
- border: 1px solid ${e.border2};
858
- border-radius: 2px;
859
- pointer-events: none;
860
- z-index: 100;
861
- }
862
-
863
- .flowchartTitleText {
864
- text-anchor: middle;
865
- font-size: 18px;
866
- fill: ${e.textColor};
867
- }
868
- `, lt = at;
869
- function be(e, a, d = !1) {
870
- var c, n, g;
871
- const l = e;
872
- let f = "default";
873
- (((c = l == null ? void 0 : l.classes) == null ? void 0 : c.length) || 0) > 0 && (f = ((l == null ? void 0 : l.classes) || []).join(" ")), f = f + " flowchart-label";
874
- let b = 0, p = "", x;
875
- switch (l.type) {
876
- case "round":
877
- b = 5, p = "rect";
878
- break;
879
- case "composite":
880
- b = 0, p = "composite", x = 0;
881
- break;
882
- case "square":
883
- p = "rect";
884
- break;
885
- case "diamond":
886
- p = "question";
887
- break;
888
- case "hexagon":
889
- p = "hexagon";
890
- break;
891
- case "block_arrow":
892
- p = "block_arrow";
893
- break;
894
- case "odd":
895
- p = "rect_left_inv_arrow";
896
- break;
897
- case "lean_right":
898
- p = "lean_right";
899
- break;
900
- case "lean_left":
901
- p = "lean_left";
902
- break;
903
- case "trapezoid":
904
- p = "trapezoid";
905
- break;
906
- case "inv_trapezoid":
907
- p = "inv_trapezoid";
908
- break;
909
- case "rect_left_inv_arrow":
910
- p = "rect_left_inv_arrow";
911
- break;
912
- case "circle":
913
- p = "circle";
914
- break;
915
- case "ellipse":
916
- p = "ellipse";
917
- break;
918
- case "stadium":
919
- p = "stadium";
920
- break;
921
- case "subroutine":
922
- p = "subroutine";
923
- break;
924
- case "cylinder":
925
- p = "cylinder";
926
- break;
927
- case "group":
928
- p = "rect";
929
- break;
930
- case "doublecircle":
931
- p = "doublecircle";
932
- break;
933
- default:
934
- p = "rect";
935
- }
936
- const y = ve((l == null ? void 0 : l.styles) || []), T = l.label, v = l.size || { width: 0, height: 0, x: 0, y: 0 };
937
- return {
938
- labelStyle: y.labelStyle,
939
- shape: p,
940
- labelText: T,
941
- rx: b,
942
- ry: b,
943
- class: f,
944
- style: y.style,
945
- id: l.id,
946
- directions: l.directions,
947
- width: v.width,
948
- height: v.height,
949
- x: v.x,
950
- y: v.y,
951
- positioned: d,
952
- intersect: void 0,
953
- type: l.type,
954
- padding: x ?? (((g = (n = se()) == null ? void 0 : n.block) == null ? void 0 : g.padding) || 0)
955
- };
956
- }
957
- async function ot(e, a, d) {
958
- const c = be(a, d, !1);
959
- if (c.type === "group")
960
- return;
961
- const n = await ge(e, c), g = n.node().getBBox(), l = d.getBlock(c.id);
962
- l.size = { width: g.width, height: g.height, x: 0, y: 0, node: n }, d.setBlock(l), n.remove();
963
- }
964
- async function ct(e, a, d) {
965
- const c = be(a, d, !0);
966
- d.getBlock(c.id).type !== "space" && (await ge(e, c), a.intersect = c == null ? void 0 : c.intersect, ze(c));
967
- }
968
- async function ne(e, a, d, c) {
969
- for (const n of a)
970
- await c(e, n, d), n.children && await ne(e, n.children, d, c);
971
- }
972
- async function ut(e, a, d) {
973
- await ne(e, a, d, ot);
974
- }
975
- async function dt(e, a, d) {
976
- await ne(e, a, d, ct);
977
- }
978
- async function ht(e, a, d, c, n) {
979
- const g = new Ce({
980
- multigraph: !0,
981
- compound: !0
982
- });
983
- g.setGraph({
984
- rankdir: "TB",
985
- nodesep: 10,
986
- ranksep: 10,
987
- marginx: 8,
988
- marginy: 8
989
- });
990
- for (const l of d)
991
- l.size && g.setNode(l.id, {
992
- width: l.size.width,
993
- height: l.size.height,
994
- intersect: l.intersect
995
- });
996
- for (const l of a)
997
- if (l.start && l.end) {
998
- const f = c.getBlock(l.start), b = c.getBlock(l.end);
999
- if (f != null && f.size && (b != null && b.size)) {
1000
- const p = f.size, x = b.size, y = [
1001
- { x: p.x, y: p.y },
1002
- { x: p.x + (x.x - p.x) / 2, y: p.y + (x.y - p.y) / 2 },
1003
- { x: x.x, y: x.y }
1004
- ];
1005
- await Ie(
1006
- e,
1007
- { v: l.start, w: l.end, name: l.id },
1008
- {
1009
- ...l,
1010
- arrowTypeEnd: l.arrowTypeEnd,
1011
- arrowTypeStart: l.arrowTypeStart,
1012
- points: y,
1013
- classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
1014
- },
1015
- void 0,
1016
- "block",
1017
- g,
1018
- n
1019
- ), l.label && (await Oe(e, {
1020
- ...l,
1021
- label: l.label,
1022
- labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
1023
- arrowTypeEnd: l.arrowTypeEnd,
1024
- arrowTypeStart: l.arrowTypeStart
1025
- }), await Te(
1026
- { ...l, x: y[1].x, y: y[1].y },
1027
- {
1028
- originalPath: y
1029
- }
1030
- ));
1031
- }
1032
- }
1033
- }
1034
- const _ = ((oe = (le = he()) == null ? void 0 : le.block) == null ? void 0 : oe.padding) || 8;
1035
- function gt(e, a) {
1036
- if (e === 0 || !Number.isInteger(e))
1037
- throw new Error("Columns must be an integer !== 0.");
1038
- if (a < 0 || !Number.isInteger(a))
1039
- throw new Error("Position must be a non-negative integer." + a);
1040
- if (e < 0)
1041
- return { px: a, py: 0 };
1042
- if (e === 1)
1043
- return { px: 0, py: a };
1044
- const d = a % e, c = Math.floor(a / e);
1045
- return { px: d, py: c };
1046
- }
1047
- const pt = (e) => {
1048
- let a = 0, d = 0;
1049
- for (const c of e.children) {
1050
- const { width: n, height: g, x: l, y: f } = c.size || { width: 0, height: 0, x: 0, y: 0 };
1051
- S.debug(
1052
- "getMaxChildSize abc95 child:",
1053
- c.id,
1054
- "width:",
1055
- n,
1056
- "height:",
1057
- g,
1058
- "x:",
1059
- l,
1060
- "y:",
1061
- f,
1062
- c.type
1063
- ), c.type !== "space" && (n > a && (a = n / (e.widthInColumns || 1)), g > d && (d = g));
1064
- }
1065
- return { width: a, height: d };
1066
- };
1067
- function te(e, a, d = 0, c = 0) {
1068
- var n, g, l, f, b, p, x, y, T, v, N;
1069
- S.debug(
1070
- "setBlockSizes abc95 (start)",
1071
- e.id,
1072
- (n = e == null ? void 0 : e.size) == null ? void 0 : n.x,
1073
- "block width =",
1074
- e == null ? void 0 : e.size,
1075
- "sieblingWidth",
1076
- d
1077
- ), (g = e == null ? void 0 : e.size) != null && g.width || (e.size = {
1078
- width: d,
1079
- height: c,
1080
- x: 0,
1081
- y: 0
1082
- });
1083
- let E = 0, L = 0;
1084
- if (((l = e.children) == null ? void 0 : l.length) > 0) {
1085
- for (const h of e.children)
1086
- te(h, a);
1087
- const A = pt(e);
1088
- E = A.width, L = A.height, S.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", E, L);
1089
- for (const h of e.children)
1090
- h.size && (S.debug(
1091
- `abc95 Setting size of children of ${e.id} id=${h.id} ${E} ${L} ${h.size}`
1092
- ), h.size.width = E * (h.widthInColumns || 1) + _ * ((h.widthInColumns || 1) - 1), h.size.height = L, h.size.x = 0, h.size.y = 0, S.debug(
1093
- `abc95 updating size of ${e.id} children child:${h.id} maxWidth:${E} maxHeight:${L}`
1094
- ));
1095
- for (const h of e.children)
1096
- te(h, a, E, L);
1097
- const k = e.columns || -1;
1098
- let D = 0;
1099
- for (const h of e.children)
1100
- D += h.widthInColumns || 1;
1101
- let o = e.children.length;
1102
- k > 0 && k < D && (o = k), e.widthInColumns;
1103
- const s = Math.ceil(D / o);
1104
- let i = o * (E + _) + _, u = s * (L + _) + _;
1105
- if (i < d) {
1106
- S.debug(
1107
- `Detected to small siebling: abc95 ${e.id} sieblingWidth ${d} sieblingHeight ${c} width ${i}`
1108
- ), i = d, u = c;
1109
- const h = (d - o * _ - _) / o, t = (c - s * _ - _) / s;
1110
- S.debug("Size indata abc88", e.id, "childWidth", h, "maxWidth", E), S.debug("Size indata abc88", e.id, "childHeight", t, "maxHeight", L), S.debug("Size indata abc88 xSize", o, "padding", _);
1111
- for (const m of e.children)
1112
- m.size && (m.size.width = h, m.size.height = t, m.size.x = 0, m.size.y = 0);
1113
- }
1114
- if (S.debug(
1115
- `abc95 (finale calc) ${e.id} xSize ${o} ySize ${s} columns ${k}${e.children.length} width=${Math.max(i, ((f = e.size) == null ? void 0 : f.width) || 0)}`
1116
- ), i < (((b = e == null ? void 0 : e.size) == null ? void 0 : b.width) || 0)) {
1117
- i = ((p = e == null ? void 0 : e.size) == null ? void 0 : p.width) || 0;
1118
- const h = k > 0 ? Math.min(e.children.length, k) : e.children.length;
1119
- if (h > 0) {
1120
- const t = (i - h * _ - _) / h;
1121
- S.debug("abc95 (growing to fit) width", e.id, i, (x = e.size) == null ? void 0 : x.width, t);
1122
- for (const m of e.children)
1123
- m.size && (m.size.width = t);
1124
- }
1125
- }
1126
- e.size = {
1127
- width: i,
1128
- height: u,
1129
- x: 0,
1130
- y: 0
1131
- };
1132
- }
1133
- S.debug(
1134
- "setBlockSizes abc94 (done)",
1135
- e.id,
1136
- (y = e == null ? void 0 : e.size) == null ? void 0 : y.x,
1137
- (T = e == null ? void 0 : e.size) == null ? void 0 : T.width,
1138
- (v = e == null ? void 0 : e.size) == null ? void 0 : v.y,
1139
- (N = e == null ? void 0 : e.size) == null ? void 0 : N.height
1140
- );
1141
- }
1142
- function xe(e, a) {
1143
- var d, c, n, g, l, f, b, p, x, y, T, v, N, E, L, A, k;
1144
- S.debug(
1145
- `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(d = e == null ? void 0 : e.size) == null ? void 0 : d.x} y: ${(c = e == null ? void 0 : e.size) == null ? void 0 : c.y} width: ${(n = e == null ? void 0 : e.size) == null ? void 0 : n.width}`
1146
- );
1147
- const D = e.columns || -1;
1148
- if (S.debug("layoutBlocks columns abc95", e.id, "=>", D, e), e.children && // find max width of children
1149
- e.children.length > 0) {
1150
- const o = ((l = (g = e == null ? void 0 : e.children[0]) == null ? void 0 : g.size) == null ? void 0 : l.width) || 0, s = e.children.length * o + (e.children.length - 1) * _;
1151
- S.debug("widthOfChildren 88", s, "posX");
1152
- let i = 0;
1153
- S.debug("abc91 block?.size?.x", e.id, (f = e == null ? void 0 : e.size) == null ? void 0 : f.x);
1154
- let u = (b = e == null ? void 0 : e.size) != null && b.x ? ((p = e == null ? void 0 : e.size) == null ? void 0 : p.x) + (-((x = e == null ? void 0 : e.size) == null ? void 0 : x.width) / 2 || 0) : -_, h = 0;
1155
- for (const t of e.children) {
1156
- const m = e;
1157
- if (!t.size)
1158
- continue;
1159
- const { width: r, height: R } = t.size, { px: Y, py: F } = gt(D, i);
1160
- if (F != h && (h = F, u = (y = e == null ? void 0 : e.size) != null && y.x ? ((T = e == null ? void 0 : e.size) == null ? void 0 : T.x) + (-((v = e == null ? void 0 : e.size) == null ? void 0 : v.width) / 2 || 0) : -_, S.debug("New row in layout for block", e.id, " and child ", t.id, h)), S.debug(
1161
- `abc89 layout blocks (child) id: ${t.id} Pos: ${i} (px, py) ${Y},${F} (${(N = m == null ? void 0 : m.size) == null ? void 0 : N.x},${(E = m == null ? void 0 : m.size) == null ? void 0 : E.y}) parent: ${m.id} width: ${r}${_}`
1162
- ), m.size) {
1163
- const C = r / 2;
1164
- t.size.x = u + _ + C, S.debug(
1165
- `abc91 layout blocks (calc) px, pyid:${t.id} startingPos=X${u} new startingPosX${t.size.x} ${C} padding=${_} width=${r} halfWidth=${C} => x:${t.size.x} y:${t.size.y} ${t.widthInColumns} (width * (child?.w || 1)) / 2 ${r * ((t == null ? void 0 : t.widthInColumns) || 1) / 2}`
1166
- ), u = t.size.x + C, t.size.y = m.size.y - m.size.height / 2 + F * (R + _) + R / 2 + _, S.debug(
1167
- `abc88 layout blocks (calc) px, pyid:${t.id}startingPosX${u}${_}${C}=>x:${t.size.x}y:${t.size.y}${t.widthInColumns}(width * (child?.w || 1)) / 2${r * ((t == null ? void 0 : t.widthInColumns) || 1) / 2}`
1168
- );
1169
- }
1170
- t.children && xe(t), i += (t == null ? void 0 : t.widthInColumns) || 1, S.debug("abc88 columnsPos", t, i);
1171
- }
1172
- }
1173
- S.debug(
1174
- `layout blocks (<==layoutBlocks) ${e.id} x: ${(L = e == null ? void 0 : e.size) == null ? void 0 : L.x} y: ${(A = e == null ? void 0 : e.size) == null ? void 0 : A.y} width: ${(k = e == null ? void 0 : e.size) == null ? void 0 : k.width}`
1175
- );
1176
- }
1177
- function Se(e, { minX: a, minY: d, maxX: c, maxY: n } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1178
- if (e.size && e.id !== "root") {
1179
- const { x: g, y: l, width: f, height: b } = e.size;
1180
- g - f / 2 < a && (a = g - f / 2), l - b / 2 < d && (d = l - b / 2), g + f / 2 > c && (c = g + f / 2), l + b / 2 > n && (n = l + b / 2);
1181
- }
1182
- if (e.children)
1183
- for (const g of e.children)
1184
- ({ minX: a, minY: d, maxX: c, maxY: n } = Se(g, { minX: a, minY: d, maxX: c, maxY: n }));
1185
- return { minX: a, minY: d, maxX: c, maxY: n };
1186
- }
1187
- function ft(e) {
1188
- const a = e.getBlock("root");
1189
- if (!a)
1190
- return;
1191
- te(a, e, 0, 0), xe(a), S.debug("getBlocks", JSON.stringify(a, null, 2));
1192
- const { minX: d, minY: c, maxX: n, maxY: g } = Se(a), l = g - c, f = n - d;
1193
- return { x: d, y: c, width: f, height: l };
1194
- }
1195
- const bt = function(e, a) {
1196
- return a.db.getClasses();
1197
- }, xt = async function(e, a, d, c) {
1198
- const { securityLevel: n, block: g } = se(), l = c.db;
1199
- let f;
1200
- n === "sandbox" && (f = H("#i" + a));
1201
- const b = n === "sandbox" ? H(f.nodes()[0].contentDocument.body) : H("body"), p = n === "sandbox" ? b.select(`[id="${a}"]`) : H(`[id="${a}"]`);
1202
- ke(p, ["point", "circle", "cross"], c.type, a);
1203
- const y = l.getBlocks(), T = l.getBlocksFlat(), v = l.getEdges(), N = p.insert("g").attr("class", "block");
1204
- await ut(N, y, l);
1205
- const E = ft(l);
1206
- if (await dt(N, y, l), await ht(N, v, T, l, a), E) {
1207
- const L = E, A = Math.max(1, Math.round(0.125 * (L.width / L.height))), k = L.height + A + 10, D = L.width + 10, { useMaxWidth: o } = g;
1208
- Ee(p, k, D, !!o), S.debug("Here Bounds", E, L), p.attr(
1209
- "viewBox",
1210
- `${L.x - 5} ${L.y - 5} ${L.width + 10} ${L.height + 10}`
1211
- );
1212
- }
1213
- Re(Be);
1214
- }, St = {
1215
- draw: xt,
1216
- getClasses: bt
1217
- }, Ot = {
1218
- parser: Pe,
1219
- db: nt,
1220
- renderer: St,
1221
- styles: lt
1222
- };
1223
- export {
1224
- Ot as diagram
1225
- };