for-humanity 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +16 -16
  4. package/dist/cli.css +2 -968
  5. package/dist/cli.js +92 -2318
  6. package/dist/config.js +1 -0
  7. package/dist/constant/copy.d.ts +100 -0
  8. package/dist/constant/site.d.ts +20 -0
  9. package/dist/constant/status.d.ts +19 -0
  10. package/dist/copy-C1uzvEnr.js +103 -0
  11. package/dist/group-path-XAThmzvC.js +10 -0
  12. package/dist/load-site-CbpLEhwu.js +2379 -0
  13. package/dist/logger-Dv1i9xSV.js +9 -0
  14. package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
  15. package/dist/mermaid/chunk--TN-qHgG.js +2 -0
  16. package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
  17. package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
  18. package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
  19. package/dist/mermaid/chunk-6HLei9i0.js +84 -0
  20. package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
  21. package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
  22. package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
  23. package/dist/mermaid/chunk-B--pNBQF.js +884 -0
  24. package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
  25. package/dist/mermaid/chunk-B58sEIY_.js +14 -0
  26. package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
  27. package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
  28. package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
  29. package/dist/mermaid/chunk-BKri0qr7.js +89 -0
  30. package/dist/mermaid/chunk-BL404pH5.js +26 -0
  31. package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
  32. package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
  33. package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
  34. package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
  35. package/dist/mermaid/chunk-BariMtWr.js +3020 -0
  36. package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
  37. package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
  38. package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
  39. package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
  40. package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
  41. package/dist/mermaid/chunk-BvVehae3.js +5069 -0
  42. package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
  43. package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
  44. package/dist/mermaid/chunk-CApNbSU9.js +6 -0
  45. package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
  46. package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
  47. package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
  48. package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
  49. package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
  50. package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
  51. package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
  52. package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
  53. package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
  54. package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
  55. package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
  56. package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
  57. package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
  58. package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
  59. package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
  60. package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
  61. package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
  62. package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
  63. package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
  64. package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
  65. package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
  66. package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
  67. package/dist/mermaid/chunk-CuYekbSv.js +2 -0
  68. package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
  69. package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
  70. package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
  71. package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
  72. package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
  73. package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
  74. package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
  75. package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
  76. package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
  77. package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
  78. package/dist/mermaid/chunk-DU69_VcF.js +363 -0
  79. package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
  80. package/dist/mermaid/chunk-DZe-4kde.js +20 -0
  81. package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
  82. package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
  83. package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
  84. package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
  85. package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
  86. package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
  87. package/dist/mermaid/chunk-DqGhppWe.js +2 -0
  88. package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
  89. package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
  90. package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
  91. package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
  92. package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
  93. package/dist/mermaid/chunk-KuPYb48V.js +275 -0
  94. package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
  95. package/dist/mermaid/chunk-MbInCS_6.js +28 -0
  96. package/dist/mermaid/chunk-MexOLyKV.js +355 -0
  97. package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
  98. package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
  99. package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
  100. package/dist/mermaid/chunk-TftHqGLg.js +490 -0
  101. package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
  102. package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
  103. package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
  104. package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
  105. package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
  106. package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
  107. package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
  108. package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
  109. package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
  110. package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
  111. package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
  112. package/dist/mermaid/chunk-yBz-vst0.js +976 -0
  113. package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
  114. package/dist/run-site-command-C80YoNOe.js +129 -0
  115. package/dist/site-config-bllORGpm.js +90 -0
  116. package/dist/site.js +1 -0
  117. package/dist/start-dev-server-C4_Lu1nZ.js +176 -0
  118. package/dist/to-change-queue-DbEnZGNK.js +34 -0
  119. package/dist/to-error-message-pF6_7wGK.js +16 -0
  120. package/dist/type/group-path.d.ts +7 -0
  121. package/dist/type/site-config.d.ts +57 -0
  122. package/package.json +34 -17
  123. package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
  124. package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
  125. package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
  126. package/src/component/widget/navigation/_constant/locale.ts +0 -9
  127. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
  128. package/src/component/widget/navigation/_constant/navigation.ts +0 -9
  129. package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
  130. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
  131. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
  132. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
  133. package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
  134. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
  135. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
  136. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
  137. package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
  138. package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
  139. package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
  140. package/src/component/widget/navigation/_type/doc-group.ts +0 -24
  141. package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
  142. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
  143. package/src/component/widget/navigation/_type/toc-group.ts +0 -39
  144. package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
  145. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
  146. package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
  147. package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
  148. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
  149. package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
  150. package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
  151. package/src/component/widget/navigation/wg-navigation.css +0 -282
  152. package/src/component/widget/navigation/wg-navigation.tsx +0 -420
  153. package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
  154. package/src/component/widget/prose/_constant/section.ts +0 -7
  155. package/src/component/widget/prose/_constant/status.ts +0 -9
  156. package/src/component/widget/prose/_function/has-block-content.ts +0 -30
  157. package/src/component/widget/prose/_function/rehype-head.ts +0 -31
  158. package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
  159. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
  160. package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
  161. package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
  162. package/src/component/widget/prose/_function/remark-flow.ts +0 -26
  163. package/src/component/widget/prose/_function/remark-links.ts +0 -33
  164. package/src/component/widget/prose/_function/remark-parts.ts +0 -26
  165. package/src/component/widget/prose/_function/remark-status.ts +0 -59
  166. package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
  167. package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
  168. package/src/component/widget/prose/wg-prose.css +0 -484
  169. package/src/component/widget/prose/wg-prose.tsx +0 -43
  170. package/src/component/widget/shell/wg-shell.css +0 -63
  171. package/src/component/widget/shell/wg-shell.tsx +0 -88
  172. package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
  173. package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
  174. package/src/constant/asset.ts +0 -63
  175. package/src/constant/copy.ts +0 -133
  176. package/src/constant/doc.ts +0 -13
  177. package/src/constant/font.ts +0 -34
  178. package/src/constant/site.ts +0 -24
  179. package/src/constant/status.ts +0 -15
  180. package/src/entry/browser/browser.tsx +0 -22
  181. package/src/entry/cli/_constant/cli.ts +0 -19
  182. package/src/entry/cli/_constant/crawling.ts +0 -14
  183. package/src/entry/cli/_constant/snippet.ts +0 -21
  184. package/src/entry/cli/_function/create-app.tsx +0 -57
  185. package/src/entry/cli/_function/create-dev-app.ts +0 -87
  186. package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
  187. package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
  188. package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
  189. package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
  190. package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -91
  191. package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
  192. package/src/entry/cli/_function/read-docs.ts +0 -128
  193. package/src/entry/cli/_function/read-home.ts +0 -32
  194. package/src/entry/cli/_function/to-crawling-app.ts +0 -42
  195. package/src/entry/cli/cli.test.ts +0 -804
  196. package/src/entry/cli/cli.ts +0 -206
  197. package/src/env.d.ts +0 -6
  198. package/src/page/doc/pg-doc.tsx +0 -35
  199. package/src/page/home/pg-home.tsx +0 -40
  200. package/src/store/navigation/create-navigation-stores.test.ts +0 -74
  201. package/src/store/navigation/create-navigation-stores.ts +0 -59
  202. package/src/store/navigation/navigation-state.ts +0 -36
  203. package/src/store/navigation/navigation-storage.ts +0 -9
  204. package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
  205. package/src/style/base.css +0 -28
  206. package/src/style/token.css +0 -188
  207. package/src/type/doc-content.ts +0 -15
  208. package/src/type/doc-data.ts +0 -38
  209. package/src/type/doc-file-data.ts +0 -21
  210. package/src/type/doc-heading.ts +0 -17
  211. package/src/type/doc-outline.ts +0 -16
  212. package/src/type/doc-section.ts +0 -9
  213. package/src/type/doc.ts +0 -20
  214. package/src/type/group-path.ts +0 -7
  215. package/src/type/site-assets.ts +0 -25
  216. package/src/type/site-config.ts +0 -73
  217. package/src/type/vfile-data.d.ts +0 -10
  218. package/src/util/async/to-change-queue.test.ts +0 -58
  219. package/src/util/async/to-change-queue.ts +0 -43
  220. package/src/util/dom/find-hash-target.ts +0 -18
  221. package/src/util/dom/reveal-hash-target.ts +0 -15
  222. package/src/util/error/to-error-message.ts +0 -10
  223. package/src/util/file/to-asset-path.ts +0 -26
  224. package/src/util/font/to-font-css.test.ts +0 -41
  225. package/src/util/font/to-font-css.ts +0 -28
  226. package/src/util/mermaid/render-flow.js +0 -321
@@ -0,0 +1,1009 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { O as n, b as r, f as i, it as a, nt as o, tt as s, y as c, z as l } from "./chunk-MFVRUoO0.js";
4
+ import "./chunk-K7Myuj2-.js";
5
+ import "./chunk-Bok8z-Yo.js";
6
+ import "./chunk-KuPYb48V.js";
7
+ import "./chunk-_a9EZE1v.js";
8
+ import "./chunk-DORnIAsy.js";
9
+ import "./chunk-CLgRAtOz.js";
10
+ import "./chunk-DU69_VcF.js";
11
+ import "./chunk-DpuxlyL_.js";
12
+ import { r as u, t as d } from "./chunk-BB8uZHwY.js";
13
+ import { t as f } from "./chunk-CCM2AH-C.js";
14
+ import { t as p } from "./chunk-BL404pH5.js";
15
+ //#region node_modules/.pnpm/uuid@14.0.3/node_modules/uuid/dist/stringify.js
16
+ var m = [];
17
+ for (let e = 0; e < 256; ++e) m.push((e + 256).toString(16).slice(1));
18
+ function h(e, t = 0) {
19
+ return (m[e[t + 0]] + m[e[t + 1]] + m[e[t + 2]] + m[e[t + 3]] + "-" + m[e[t + 4]] + m[e[t + 5]] + "-" + m[e[t + 6]] + m[e[t + 7]] + "-" + m[e[t + 8]] + m[e[t + 9]] + "-" + m[e[t + 10]] + m[e[t + 11]] + m[e[t + 12]] + m[e[t + 13]] + m[e[t + 14]] + m[e[t + 15]]).toLowerCase();
20
+ }
21
+ //#endregion
22
+ //#region node_modules/.pnpm/uuid@14.0.3/node_modules/uuid/dist/rng.js
23
+ var g = /* @__PURE__ */ new Uint8Array(16);
24
+ function _() {
25
+ return crypto.getRandomValues(g);
26
+ }
27
+ //#endregion
28
+ //#region node_modules/.pnpm/uuid@14.0.3/node_modules/uuid/dist/v4.js
29
+ function v(e, t, n) {
30
+ return !t && !e && crypto.randomUUID ? crypto.randomUUID() : y(e, t, n);
31
+ }
32
+ function y(e, t, n) {
33
+ e ||= {};
34
+ let r = e.random ?? e.rng?.() ?? _();
35
+ if (r.length < 16) throw Error("Random bytes length must be >= 16");
36
+ if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
37
+ if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
38
+ for (let e = 0; e < 16; ++e) t[n + e] = r[e];
39
+ return t;
40
+ }
41
+ return h(r);
42
+ }
43
+ //#endregion
44
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-6OY57UG3.mjs
45
+ var b = (function() {
46
+ var e = /* @__PURE__ */ t(function(e, t, n, r) {
47
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
48
+ return n;
49
+ }, "o"), n = [1, 4], r = [1, 13], i = [1, 12], a = [1, 15], o = [1, 16], s = [1, 20], c = [1, 19], l = [
50
+ 6,
51
+ 7,
52
+ 8
53
+ ], u = [1, 26], d = [1, 24], f = [1, 25], p = [
54
+ 6,
55
+ 7,
56
+ 11
57
+ ], m = [
58
+ 1,
59
+ 6,
60
+ 13,
61
+ 15,
62
+ 16,
63
+ 19,
64
+ 22
65
+ ], h = [1, 33], g = [1, 34], _ = [
66
+ 1,
67
+ 6,
68
+ 7,
69
+ 11,
70
+ 13,
71
+ 15,
72
+ 16,
73
+ 19,
74
+ 22
75
+ ], v = {
76
+ trace: /* @__PURE__ */ t(function() {}, "trace"),
77
+ yy: {},
78
+ symbols_: {
79
+ error: 2,
80
+ start: 3,
81
+ mindMap: 4,
82
+ spaceLines: 5,
83
+ SPACELINE: 6,
84
+ NL: 7,
85
+ MINDMAP: 8,
86
+ document: 9,
87
+ stop: 10,
88
+ EOF: 11,
89
+ statement: 12,
90
+ SPACELIST: 13,
91
+ node: 14,
92
+ ICON: 15,
93
+ CLASS: 16,
94
+ nodeWithId: 17,
95
+ nodeWithoutId: 18,
96
+ NODE_DSTART: 19,
97
+ NODE_DESCR: 20,
98
+ NODE_DEND: 21,
99
+ NODE_ID: 22,
100
+ $accept: 0,
101
+ $end: 1
102
+ },
103
+ terminals_: {
104
+ 2: "error",
105
+ 6: "SPACELINE",
106
+ 7: "NL",
107
+ 8: "MINDMAP",
108
+ 11: "EOF",
109
+ 13: "SPACELIST",
110
+ 15: "ICON",
111
+ 16: "CLASS",
112
+ 19: "NODE_DSTART",
113
+ 20: "NODE_DESCR",
114
+ 21: "NODE_DEND",
115
+ 22: "NODE_ID"
116
+ },
117
+ productions_: [
118
+ 0,
119
+ [3, 1],
120
+ [3, 2],
121
+ [5, 1],
122
+ [5, 2],
123
+ [5, 2],
124
+ [4, 2],
125
+ [4, 3],
126
+ [10, 1],
127
+ [10, 1],
128
+ [10, 1],
129
+ [10, 2],
130
+ [10, 2],
131
+ [9, 3],
132
+ [9, 2],
133
+ [12, 2],
134
+ [12, 2],
135
+ [12, 2],
136
+ [12, 1],
137
+ [12, 1],
138
+ [12, 1],
139
+ [12, 1],
140
+ [12, 1],
141
+ [14, 1],
142
+ [14, 1],
143
+ [18, 3],
144
+ [17, 1],
145
+ [17, 4]
146
+ ],
147
+ performAction: /* @__PURE__ */ t(function(e, t, n, r, i, a, o) {
148
+ var s = a.length - 1;
149
+ switch (i) {
150
+ case 6:
151
+ case 7: return r;
152
+ case 8:
153
+ r.getLogger().trace("Stop NL ");
154
+ break;
155
+ case 9:
156
+ r.getLogger().trace("Stop EOF ");
157
+ break;
158
+ case 11:
159
+ r.getLogger().trace("Stop NL2 ");
160
+ break;
161
+ case 12:
162
+ r.getLogger().trace("Stop EOF2 ");
163
+ break;
164
+ case 15:
165
+ r.getLogger().info("Node: ", a[s].id), r.addNode(a[s - 1].length, a[s].id, a[s].descr, a[s].type);
166
+ break;
167
+ case 16:
168
+ r.getLogger().trace("Icon: ", a[s]), r.decorateNode({ icon: a[s] });
169
+ break;
170
+ case 17:
171
+ case 21:
172
+ r.decorateNode({ class: a[s] });
173
+ break;
174
+ case 18:
175
+ r.getLogger().trace("SPACELIST");
176
+ break;
177
+ case 19:
178
+ r.getLogger().trace("Node: ", a[s].id), r.addNode(0, a[s].id, a[s].descr, a[s].type);
179
+ break;
180
+ case 20:
181
+ r.decorateNode({ icon: a[s] });
182
+ break;
183
+ case 25:
184
+ r.getLogger().trace("node found ..", a[s - 2]), this.$ = {
185
+ id: a[s - 1],
186
+ descr: a[s - 1],
187
+ type: r.getType(a[s - 2], a[s])
188
+ };
189
+ break;
190
+ case 26:
191
+ this.$ = {
192
+ id: a[s],
193
+ descr: a[s],
194
+ type: r.nodeType.DEFAULT
195
+ };
196
+ break;
197
+ case 27: r.getLogger().trace("node found ..", a[s - 3]), this.$ = {
198
+ id: a[s - 3],
199
+ descr: a[s - 1],
200
+ type: r.getType(a[s - 2], a[s])
201
+ };
202
+ }
203
+ }, "anonymous"),
204
+ table: [
205
+ {
206
+ 3: 1,
207
+ 4: 2,
208
+ 5: 3,
209
+ 6: [1, 5],
210
+ 8: n
211
+ },
212
+ { 1: [3] },
213
+ { 1: [2, 1] },
214
+ {
215
+ 4: 6,
216
+ 6: [1, 7],
217
+ 7: [1, 8],
218
+ 8: n
219
+ },
220
+ {
221
+ 6: r,
222
+ 7: [1, 10],
223
+ 9: 9,
224
+ 12: 11,
225
+ 13: i,
226
+ 14: 14,
227
+ 15: a,
228
+ 16: o,
229
+ 17: 17,
230
+ 18: 18,
231
+ 19: s,
232
+ 22: c
233
+ },
234
+ e(l, [2, 3]),
235
+ { 1: [2, 2] },
236
+ e(l, [2, 4]),
237
+ e(l, [2, 5]),
238
+ {
239
+ 1: [2, 6],
240
+ 6: r,
241
+ 12: 21,
242
+ 13: i,
243
+ 14: 14,
244
+ 15: a,
245
+ 16: o,
246
+ 17: 17,
247
+ 18: 18,
248
+ 19: s,
249
+ 22: c
250
+ },
251
+ {
252
+ 6: r,
253
+ 9: 22,
254
+ 12: 11,
255
+ 13: i,
256
+ 14: 14,
257
+ 15: a,
258
+ 16: o,
259
+ 17: 17,
260
+ 18: 18,
261
+ 19: s,
262
+ 22: c
263
+ },
264
+ {
265
+ 6: u,
266
+ 7: d,
267
+ 10: 23,
268
+ 11: f
269
+ },
270
+ e(p, [2, 22], {
271
+ 17: 17,
272
+ 18: 18,
273
+ 14: 27,
274
+ 15: [1, 28],
275
+ 16: [1, 29],
276
+ 19: s,
277
+ 22: c
278
+ }),
279
+ e(p, [2, 18]),
280
+ e(p, [2, 19]),
281
+ e(p, [2, 20]),
282
+ e(p, [2, 21]),
283
+ e(p, [2, 23]),
284
+ e(p, [2, 24]),
285
+ e(p, [2, 26], { 19: [1, 30] }),
286
+ { 20: [1, 31] },
287
+ {
288
+ 6: u,
289
+ 7: d,
290
+ 10: 32,
291
+ 11: f
292
+ },
293
+ {
294
+ 1: [2, 7],
295
+ 6: r,
296
+ 12: 21,
297
+ 13: i,
298
+ 14: 14,
299
+ 15: a,
300
+ 16: o,
301
+ 17: 17,
302
+ 18: 18,
303
+ 19: s,
304
+ 22: c
305
+ },
306
+ e(m, [2, 14], {
307
+ 7: h,
308
+ 11: g
309
+ }),
310
+ e(_, [2, 8]),
311
+ e(_, [2, 9]),
312
+ e(_, [2, 10]),
313
+ e(p, [2, 15]),
314
+ e(p, [2, 16]),
315
+ e(p, [2, 17]),
316
+ { 20: [1, 35] },
317
+ { 21: [1, 36] },
318
+ e(m, [2, 13], {
319
+ 7: h,
320
+ 11: g
321
+ }),
322
+ e(_, [2, 11]),
323
+ e(_, [2, 12]),
324
+ { 21: [1, 37] },
325
+ e(p, [2, 25]),
326
+ e(p, [2, 27])
327
+ ],
328
+ defaultActions: {
329
+ 2: [2, 1],
330
+ 6: [2, 2]
331
+ },
332
+ parseError: /* @__PURE__ */ t(function(e, t) {
333
+ if (t.recoverable) this.trace(e);
334
+ else {
335
+ var n = Error(e);
336
+ throw n.hash = t, n;
337
+ }
338
+ }, "parseError"),
339
+ parse: /* @__PURE__ */ t(function(e) {
340
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
341
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
342
+ h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
343
+ var v = h.yylloc;
344
+ o.push(v);
345
+ var y = h.options && h.options.ranges;
346
+ this.parseError = typeof g.yy.parseError == "function" ? g.yy.parseError : Object.getPrototypeOf(this).parseError;
347
+ function b(e) {
348
+ r.length -= 2 * e, a.length -= e, o.length -= e;
349
+ }
350
+ t(b, "popStack");
351
+ function x() {
352
+ var e = i.pop() || h.lex() || p;
353
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
354
+ }
355
+ t(x, "lex");
356
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
357
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
358
+ var M = "";
359
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
360
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
361
+ text: h.match,
362
+ token: this.terminals_[S] || S,
363
+ line: h.yylineno,
364
+ loc: v,
365
+ expected: j
366
+ });
367
+ }
368
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
369
+ switch (T[0]) {
370
+ case 1:
371
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
372
+ break;
373
+ case 2:
374
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
375
+ first_line: o[o.length - (k || 1)].first_line,
376
+ last_line: o[o.length - 1].last_line,
377
+ first_column: o[o.length - (k || 1)].first_column,
378
+ last_column: o[o.length - 1].last_column
379
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
380
+ c,
381
+ u,
382
+ l,
383
+ g.yy,
384
+ T[1],
385
+ a,
386
+ o
387
+ ].concat(m)), E !== void 0) return E;
388
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
389
+ break;
390
+ case 3: return !0;
391
+ }
392
+ }
393
+ return !0;
394
+ }, "parse")
395
+ };
396
+ v.lexer = /* @__PURE__ */ (function() {
397
+ return {
398
+ EOF: 1,
399
+ parseError: /* @__PURE__ */ t(function(e, t) {
400
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
401
+ else throw Error(e);
402
+ }, "parseError"),
403
+ setInput: /* @__PURE__ */ t(function(e, t) {
404
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
405
+ first_line: 1,
406
+ first_column: 0,
407
+ last_line: 1,
408
+ last_column: 0
409
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
410
+ }, "setInput"),
411
+ input: /* @__PURE__ */ t(function() {
412
+ var e = this._input[0];
413
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
414
+ }, "input"),
415
+ unput: /* @__PURE__ */ t(function(e) {
416
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
417
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
418
+ var r = this.match.split(/(?:\r\n?|\n)/g);
419
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
420
+ var i = this.yylloc.range;
421
+ return this.yylloc = {
422
+ first_line: this.yylloc.first_line,
423
+ last_line: this.yylineno + 1,
424
+ first_column: this.yylloc.first_column,
425
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
426
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
427
+ }, "unput"),
428
+ more: /* @__PURE__ */ t(function() {
429
+ return this._more = !0, this;
430
+ }, "more"),
431
+ reject: /* @__PURE__ */ t(function() {
432
+ if (this.options.backtrack_lexer) this._backtrack = !0;
433
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
434
+ text: "",
435
+ token: null,
436
+ line: this.yylineno
437
+ });
438
+ return this;
439
+ }, "reject"),
440
+ less: /* @__PURE__ */ t(function(e) {
441
+ this.unput(this.match.slice(e));
442
+ }, "less"),
443
+ pastInput: /* @__PURE__ */ t(function() {
444
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
445
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
446
+ }, "pastInput"),
447
+ upcomingInput: /* @__PURE__ */ t(function() {
448
+ var e = this.match;
449
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
450
+ }, "upcomingInput"),
451
+ showPosition: /* @__PURE__ */ t(function() {
452
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
453
+ return e + this.upcomingInput() + "\n" + t + "^";
454
+ }, "showPosition"),
455
+ test_match: /* @__PURE__ */ t(function(e, t) {
456
+ var n, r, i;
457
+ if (this.options.backtrack_lexer && (i = {
458
+ yylineno: this.yylineno,
459
+ yylloc: {
460
+ first_line: this.yylloc.first_line,
461
+ last_line: this.last_line,
462
+ first_column: this.yylloc.first_column,
463
+ last_column: this.yylloc.last_column
464
+ },
465
+ yytext: this.yytext,
466
+ match: this.match,
467
+ matches: this.matches,
468
+ matched: this.matched,
469
+ yyleng: this.yyleng,
470
+ offset: this.offset,
471
+ _more: this._more,
472
+ _input: this._input,
473
+ yy: this.yy,
474
+ conditionStack: this.conditionStack.slice(0),
475
+ done: this.done
476
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
477
+ first_line: this.yylloc.last_line,
478
+ last_line: this.yylineno + 1,
479
+ first_column: this.yylloc.last_column,
480
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
481
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
482
+ if (this._backtrack) {
483
+ for (var a in i) this[a] = i[a];
484
+ return !1;
485
+ }
486
+ return !1;
487
+ }, "test_match"),
488
+ next: /* @__PURE__ */ t(function() {
489
+ if (this.done) return this.EOF;
490
+ this._input || (this.done = !0);
491
+ var e, t, n, r;
492
+ this._more || (this.yytext = "", this.match = "");
493
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
494
+ if (t = n, r = a, this.options.backtrack_lexer) {
495
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
496
+ if (this._backtrack) {
497
+ t = !1;
498
+ continue;
499
+ }
500
+ return !1;
501
+ }
502
+ if (!this.options.flex) break;
503
+ }
504
+ return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
505
+ text: "",
506
+ token: null,
507
+ line: this.yylineno
508
+ });
509
+ }, "next"),
510
+ lex: /* @__PURE__ */ t(function() {
511
+ return this.next() || this.lex();
512
+ }, "lex"),
513
+ begin: /* @__PURE__ */ t(function(e) {
514
+ this.conditionStack.push(e);
515
+ }, "begin"),
516
+ popState: /* @__PURE__ */ t(function() {
517
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
518
+ }, "popState"),
519
+ _currentRules: /* @__PURE__ */ t(function() {
520
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
521
+ }, "_currentRules"),
522
+ topState: /* @__PURE__ */ t(function(e) {
523
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
524
+ }, "topState"),
525
+ pushState: /* @__PURE__ */ t(function(e) {
526
+ this.begin(e);
527
+ }, "pushState"),
528
+ stateStackSize: /* @__PURE__ */ t(function() {
529
+ return this.conditionStack.length;
530
+ }, "stateStackSize"),
531
+ options: { "case-insensitive": !0 },
532
+ performAction: /* @__PURE__ */ t(function(e, t, n, r) {
533
+ switch (n) {
534
+ case 0: return e.getLogger().trace("Found comment", t.yytext), 6;
535
+ case 1: return 8;
536
+ case 2:
537
+ this.begin("CLASS");
538
+ break;
539
+ case 3: return this.popState(), 16;
540
+ case 4:
541
+ this.popState();
542
+ break;
543
+ case 5:
544
+ e.getLogger().trace("Begin icon"), this.begin("ICON");
545
+ break;
546
+ case 6: return e.getLogger().trace("SPACELINE"), 6;
547
+ case 7: return 7;
548
+ case 8: return 15;
549
+ case 9:
550
+ e.getLogger().trace("end icon"), this.popState();
551
+ break;
552
+ case 10: return e.getLogger().trace("Exploding node"), this.begin("NODE"), 19;
553
+ case 11: return e.getLogger().trace("Cloud"), this.begin("NODE"), 19;
554
+ case 12: return e.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19;
555
+ case 13: return e.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19;
556
+ case 14: return this.begin("NODE"), 19;
557
+ case 15: return this.begin("NODE"), 19;
558
+ case 16: return this.begin("NODE"), 19;
559
+ case 17: return this.begin("NODE"), 19;
560
+ case 18: return 13;
561
+ case 19: return 22;
562
+ case 20: return 11;
563
+ case 21:
564
+ this.begin("NSTR2");
565
+ break;
566
+ case 22: return "NODE_DESCR";
567
+ case 23:
568
+ this.popState();
569
+ break;
570
+ case 24:
571
+ e.getLogger().trace("Starting NSTR"), this.begin("NSTR");
572
+ break;
573
+ case 25: return e.getLogger().trace("description:", t.yytext), "NODE_DESCR";
574
+ case 26:
575
+ this.popState();
576
+ break;
577
+ case 27: return this.popState(), e.getLogger().trace("node end ))"), "NODE_DEND";
578
+ case 28: return this.popState(), e.getLogger().trace("node end )"), "NODE_DEND";
579
+ case 29: return this.popState(), e.getLogger().trace("node end ...", t.yytext), "NODE_DEND";
580
+ case 30: return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND";
581
+ case 31: return this.popState(), e.getLogger().trace("node end (-"), "NODE_DEND";
582
+ case 32: return this.popState(), e.getLogger().trace("node end (-"), "NODE_DEND";
583
+ case 33: return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND";
584
+ case 34: return this.popState(), e.getLogger().trace("node end (("), "NODE_DEND";
585
+ case 35: return e.getLogger().trace("Long description:", t.yytext), 20;
586
+ case 36: return e.getLogger().trace("Long description:", t.yytext), 20;
587
+ }
588
+ }, "anonymous"),
589
+ rules: [
590
+ /^(?:\s*%%.*)/i,
591
+ /^(?:mindmap\b)/i,
592
+ /^(?::::)/i,
593
+ /^(?:.+)/i,
594
+ /^(?:\n)/i,
595
+ /^(?:::icon\()/i,
596
+ /^(?:[\s]+[\n])/i,
597
+ /^(?:[\n]+)/i,
598
+ /^(?:[^\)]+)/i,
599
+ /^(?:\))/i,
600
+ /^(?:-\))/i,
601
+ /^(?:\(-)/i,
602
+ /^(?:\)\))/i,
603
+ /^(?:\))/i,
604
+ /^(?:\(\()/i,
605
+ /^(?:\{\{)/i,
606
+ /^(?:\()/i,
607
+ /^(?:\[)/i,
608
+ /^(?:[\s]+)/i,
609
+ /^(?:[^\(\[\n\)\{\}]+)/i,
610
+ /^(?:$)/i,
611
+ /^(?:["][`])/i,
612
+ /^(?:[^`"]+)/i,
613
+ /^(?:[`]["])/i,
614
+ /^(?:["])/i,
615
+ /^(?:[^"]+)/i,
616
+ /^(?:["])/i,
617
+ /^(?:[\)]\))/i,
618
+ /^(?:[\)])/i,
619
+ /^(?:[\]])/i,
620
+ /^(?:\}\})/i,
621
+ /^(?:\(-)/i,
622
+ /^(?:-\))/i,
623
+ /^(?:\(\()/i,
624
+ /^(?:\()/i,
625
+ /^(?:[^\)\]\(\}]+)/i,
626
+ /^(?:.+(?!\(\())/i
627
+ ],
628
+ conditions: {
629
+ CLASS: {
630
+ rules: [3, 4],
631
+ inclusive: !1
632
+ },
633
+ ICON: {
634
+ rules: [8, 9],
635
+ inclusive: !1
636
+ },
637
+ NSTR2: {
638
+ rules: [22, 23],
639
+ inclusive: !1
640
+ },
641
+ NSTR: {
642
+ rules: [25, 26],
643
+ inclusive: !1
644
+ },
645
+ NODE: {
646
+ rules: [
647
+ 21,
648
+ 24,
649
+ 27,
650
+ 28,
651
+ 29,
652
+ 30,
653
+ 31,
654
+ 32,
655
+ 33,
656
+ 34,
657
+ 35,
658
+ 36
659
+ ],
660
+ inclusive: !1
661
+ },
662
+ INITIAL: {
663
+ rules: [
664
+ 0,
665
+ 1,
666
+ 2,
667
+ 5,
668
+ 6,
669
+ 7,
670
+ 10,
671
+ 11,
672
+ 12,
673
+ 13,
674
+ 14,
675
+ 15,
676
+ 16,
677
+ 17,
678
+ 18,
679
+ 19,
680
+ 20
681
+ ],
682
+ inclusive: !0
683
+ }
684
+ }
685
+ };
686
+ })();
687
+ function y() {
688
+ this.yy = {};
689
+ }
690
+ return t(y, "Parser"), y.prototype = v, v.Parser = y, new y();
691
+ })();
692
+ b.parser = b;
693
+ var x = b, S = 12, C = {
694
+ DEFAULT: 0,
695
+ NO_BORDER: 0,
696
+ ROUNDED_RECT: 1,
697
+ RECT: 2,
698
+ CIRCLE: 3,
699
+ CLOUD: 4,
700
+ BANG: 5,
701
+ HEXAGON: 6
702
+ }, w = class {
703
+ constructor() {
704
+ this.nodes = [], this.count = 0, this.elements = {}, this.getLogger = this.getLogger.bind(this), this.nodeType = C, this.clear(), this.getType = this.getType.bind(this), this.getElementById = this.getElementById.bind(this), this.getParent = this.getParent.bind(this), this.getMindmap = this.getMindmap.bind(this), this.addNode = this.addNode.bind(this), this.decorateNode = this.decorateNode.bind(this);
705
+ }
706
+ static {
707
+ t(this, "MindmapDB");
708
+ }
709
+ clear() {
710
+ this.nodes = [], this.count = 0, this.elements = {}, this.baseLevel = void 0;
711
+ }
712
+ getParent(e) {
713
+ for (let t = this.nodes.length - 1; t >= 0; t--) if (this.nodes[t].level < e) return this.nodes[t];
714
+ return null;
715
+ }
716
+ getMindmap() {
717
+ return this.nodes.length > 0 ? this.nodes[0] : null;
718
+ }
719
+ addNode(t, n, a, o) {
720
+ e.info("addNode", t, n, a, o);
721
+ let s = !1;
722
+ this.nodes.length === 0 ? (this.baseLevel = t, t = 0, s = !0) : this.baseLevel !== void 0 && (t -= this.baseLevel, s = !1);
723
+ let c = r(), u = c.mindmap?.padding ?? i.mindmap.padding;
724
+ switch (o) {
725
+ case this.nodeType.ROUNDED_RECT:
726
+ case this.nodeType.RECT:
727
+ case this.nodeType.HEXAGON: u *= 2;
728
+ }
729
+ let d = {
730
+ id: this.count++,
731
+ nodeId: l(n, c),
732
+ level: t,
733
+ descr: l(a, c),
734
+ type: o,
735
+ children: [],
736
+ width: c.mindmap?.maxNodeWidth ?? i.mindmap.maxNodeWidth,
737
+ padding: u,
738
+ isRoot: s
739
+ }, f = this.getParent(t);
740
+ if (f) f.children.push(d), this.nodes.push(d);
741
+ else if (s) this.nodes.push(d);
742
+ else throw Error(`There can be only one root. No parent could be found for ("${d.descr}")`);
743
+ }
744
+ getType(t, n) {
745
+ switch (e.debug("In get type", t, n), t) {
746
+ case "[": return this.nodeType.RECT;
747
+ case "(": return n === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
748
+ case "((": return this.nodeType.CIRCLE;
749
+ case ")": return this.nodeType.CLOUD;
750
+ case "))": return this.nodeType.BANG;
751
+ case "{{": return this.nodeType.HEXAGON;
752
+ default: return this.nodeType.DEFAULT;
753
+ }
754
+ }
755
+ setElementForId(e, t) {
756
+ this.elements[e] = t;
757
+ }
758
+ getElementById(e) {
759
+ return this.elements[e];
760
+ }
761
+ decorateNode(e) {
762
+ if (!e) return;
763
+ let t = r(), n = this.nodes[this.nodes.length - 1];
764
+ e.icon && (n.icon = l(e.icon, t)), e.class && (n.class = l(e.class, t));
765
+ }
766
+ type2Str(e) {
767
+ switch (e) {
768
+ case this.nodeType.DEFAULT: return "no-border";
769
+ case this.nodeType.RECT: return "rect";
770
+ case this.nodeType.ROUNDED_RECT: return "rounded-rect";
771
+ case this.nodeType.CIRCLE: return "circle";
772
+ case this.nodeType.CLOUD: return "cloud";
773
+ case this.nodeType.BANG: return "bang";
774
+ case this.nodeType.HEXAGON: return "hexgon";
775
+ default: return "no-border";
776
+ }
777
+ }
778
+ assignSections(e, t, n = 0, r = !1) {
779
+ if (e.section = e.level === 0 ? void 0 : r ? (n - 1) % (S - 1) : t, e.children) for (let [i, a] of e.children.entries()) {
780
+ let o = e.level === 0 ? i % (S - 1) : t;
781
+ this.assignSections(a, o, n + 1, r);
782
+ }
783
+ }
784
+ flattenNodes(e, n) {
785
+ let i = r(), a = ["mindmap-node"];
786
+ e.isRoot === !0 ? a.push("section-root", "section--1") : e.section !== void 0 && a.push(`section-${e.section}`), e.class && a.push(e.class);
787
+ let o = a.join(" "), s = /* @__PURE__ */ t((e) => {
788
+ let t = (i.theme?.toLowerCase() ?? "").includes("redux");
789
+ switch (e) {
790
+ case C.CIRCLE: return "mindmapCircle";
791
+ case C.RECT: return "rect";
792
+ case C.ROUNDED_RECT: return "rounded";
793
+ case C.CLOUD: return "cloud";
794
+ case C.BANG: return "bang";
795
+ case C.HEXAGON: return "hexagon";
796
+ case C.DEFAULT: return t ? "rounded" : "defaultMindmapNode";
797
+ case C.NO_BORDER:
798
+ default: return "rect";
799
+ }
800
+ }, "getShapeFromType"), c = {
801
+ id: e.id.toString(),
802
+ domId: "node_" + e.id.toString(),
803
+ label: e.descr,
804
+ labelType: "markdown",
805
+ isGroup: !1,
806
+ shape: s(e.type),
807
+ width: e.width,
808
+ height: e.height ?? 0,
809
+ padding: e.padding,
810
+ cssClasses: o,
811
+ cssStyles: [],
812
+ centerLabel: !0,
813
+ look: i.look,
814
+ icon: e.icon,
815
+ x: e.x,
816
+ y: e.y,
817
+ level: e.level,
818
+ nodeId: e.nodeId,
819
+ type: e.type,
820
+ section: e.section
821
+ };
822
+ if (n.push(c), e.children) for (let t of e.children) this.flattenNodes(t, n);
823
+ }
824
+ generateEdges(e, t) {
825
+ if (!e.children) return;
826
+ let n = r();
827
+ for (let r of e.children) {
828
+ let i = "edge";
829
+ r.section !== void 0 && (i += ` section-edge-${r.section}`);
830
+ let a = e.level + 1;
831
+ i += ` edge-depth-${a}`;
832
+ let o = {
833
+ id: `edge_${e.id}_${r.id}`,
834
+ start: e.id.toString(),
835
+ end: r.id.toString(),
836
+ type: "normal",
837
+ curve: "basis",
838
+ thickness: "normal",
839
+ look: n.look,
840
+ classes: i,
841
+ depth: e.level,
842
+ section: r.section
843
+ };
844
+ t.push(o), this.generateEdges(r, t);
845
+ }
846
+ }
847
+ getData() {
848
+ let t = this.getMindmap(), i = r(), a = n().layout !== void 0, o = i;
849
+ if (a || (o.layout = "cose-bilkent"), !t) return {
850
+ nodes: [],
851
+ edges: [],
852
+ config: o
853
+ };
854
+ e.debug("getData: mindmapRoot", t, i), this.assignSections(t, void 0, 0, i.mindmap?.colorBy === "depth");
855
+ let s = [], c = [];
856
+ this.flattenNodes(t, s), this.generateEdges(t, c), e.debug(`getData: processed ${s.length} nodes and ${c.length} edges`);
857
+ let l = /* @__PURE__ */ new Map();
858
+ for (let e of s) l.set(e.id, {
859
+ shape: e.shape,
860
+ width: e.width,
861
+ height: e.height,
862
+ padding: e.padding
863
+ });
864
+ return {
865
+ nodes: s,
866
+ edges: c,
867
+ config: o,
868
+ rootNode: t,
869
+ markers: ["point"],
870
+ direction: "TB",
871
+ nodeSpacing: 50,
872
+ rankSpacing: 50,
873
+ shapes: Object.fromEntries(l),
874
+ type: "mindmap",
875
+ diagramId: "mindmap-" + v()
876
+ };
877
+ }
878
+ getLogger() {
879
+ return e;
880
+ }
881
+ }, T = { draw: /* @__PURE__ */ t(async (t, n, r, a) => {
882
+ e.debug("Rendering mindmap diagram\n" + t);
883
+ let o = a.db, s = o.getData(), l = f(n, s.config.securityLevel);
884
+ if (s.type = a.type, s.layoutAlgorithm = d(s.config.layout, { fallback: "cose-bilkent" }), s.diagramId = n, !o.getMindmap()) return;
885
+ s.nodes.forEach((e) => {
886
+ e.shape === "rounded" ? (e.radius = 15, e.taper = 15, e.stroke = "none", e.width = 0, e.padding = 15) : e.shape === "circle" ? e.padding = 10 : e.shape === "rect" ? (e.width = 0, e.padding = 10) : e.shape === "hexagon" && (e.width = 0, e.height = 0);
887
+ }), await u(s, l);
888
+ let { themeVariables: m } = c(), { useGradient: h, gradientStart: g, gradientStop: _ } = m;
889
+ if (h && g && _) {
890
+ let e = l.attr("id"), t = l.append("defs").append("linearGradient").attr("id", `${e}-gradient`).attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
891
+ t.append("stop").attr("offset", "0%").attr("stop-color", g).attr("stop-opacity", 1), t.append("stop").attr("offset", "100%").attr("stop-color", _).attr("stop-opacity", 1);
892
+ }
893
+ p(l, s.config.mindmap?.padding ?? i.mindmap.padding, "mindmapDiagram", s.config.mindmap?.useMaxWidth ?? i.mindmap.useMaxWidth);
894
+ }, "draw") }, E = /* @__PURE__ */ t((e) => {
895
+ let { theme: t, look: n } = e, r = "";
896
+ for (let t = 0; t < e.THEME_COLOR_LIMIT; t++) e["lineColor" + t] = e["lineColor" + t] || e["cScaleInv" + t], a(e["lineColor" + t]) ? e["lineColor" + t] = o(e["lineColor" + t], 20) : e["lineColor" + t] = s(e["lineColor" + t], 20);
897
+ for (let i = 0; i < e.THEME_COLOR_LIMIT; i++) {
898
+ let a = "" + (n === "neo" ? Math.max(10 - (i - 1) * 2, 2) : 17 - 3 * i), o = t === "redux" || t === "redux-dark" ? e.nodeBorder : e["cScaleLabel" + (t === "neutral" ? 1 : i)];
899
+ r += `
900
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} polygon, .section-${i - 1} path {
901
+ fill: ${e["cScale" + i]};
902
+ }
903
+ .section-${i - 1} text {
904
+ fill: ${e["cScaleLabel" + i]};
905
+ }
906
+ .section-${i - 1} span {
907
+ color: ${e["cScaleLabel" + i]};
908
+ }
909
+ .node-icon-${i - 1} {
910
+ font-size: 40px;
911
+ color: ${e["cScaleLabel" + i]};
912
+ }
913
+ .section-edge-${i - 1}{
914
+ stroke: ${e["cScale" + i]};
915
+ }
916
+ .edge-depth-${i - 1}{
917
+ stroke-width: ${a};
918
+ }
919
+ .section-${i - 1} line {
920
+ stroke: ${e["cScaleInv" + i]} ;
921
+ stroke-width: 3;
922
+ }
923
+
924
+ .disabled, .disabled circle, .disabled text {
925
+ fill: lightgray;
926
+ }
927
+ .disabled text {
928
+ fill: #efefef;
929
+ }
930
+ [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
931
+ fill: ${t === "redux" || t === "redux-dark" || t === "neutral" ? e.mainBkg : e["cScale" + i]};
932
+ stroke: ${t === "redux" || t === "redux-dark" ? e.nodeBorder : e["cScale" + i]};
933
+ stroke-width: ${e.strokeWidth ?? 2}px;
934
+ }
935
+ [data-look="neo"].section-edge-${i - 1}{
936
+ stroke: ${t?.includes("redux") || t === "neo-dark" ? e.nodeBorder : e["cScale" + i]};
937
+ }
938
+ [data-look="neo"].mindmap-node.section-${i - 1} text, [data-look="neo"].mindmap-node.section-${i - 1} span {
939
+ fill: ${o};
940
+ color: ${o};
941
+ }
942
+ `;
943
+ }
944
+ return r;
945
+ }, "genSections"), D = /* @__PURE__ */ t((e, t, n) => {
946
+ let r = "";
947
+ for (let i = 0; i < e; i++) r += `
948
+ [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
949
+ stroke: url(${t}-gradient);
950
+ fill: ${n};
951
+ }
952
+ .section-${i - 1} line {
953
+ stroke-width: 0;
954
+ }`;
955
+ return r;
956
+ }, "genGradient"), O = {
957
+ get db() {
958
+ return new w();
959
+ },
960
+ renderer: T,
961
+ parser: x,
962
+ styles: /* @__PURE__ */ t((e) => {
963
+ let { theme: t } = e, n = e.svgId, r = t?.includes("redux") ? e.nodeBorder : e["cScaleLabel" + +(t === "neutral")], i = e.dropShadow ? e.dropShadow.replace("url(#drop-shadow)", `url(${n}-drop-shadow)`) : "none";
964
+ return `
965
+ .edge {
966
+ stroke-width: 3;
967
+ }
968
+ ${E(e)}
969
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
970
+ fill: ${e.git0};
971
+ }
972
+ .section-root text {
973
+ fill: ${e.gitBranchLabel0};
974
+ }
975
+ .section-root span {
976
+ color: ${t?.includes("redux") ? e.nodeBorder : e.gitBranchLabel0};
977
+ }
978
+ .icon-container {
979
+ height:100%;
980
+ display: flex;
981
+ justify-content: center;
982
+ align-items: center;
983
+ }
984
+ .edge {
985
+ fill: none;
986
+ }
987
+ .mindmap-node-label {
988
+ dy: 1em;
989
+ alignment-baseline: middle;
990
+ text-anchor: middle;
991
+ dominant-baseline: middle;
992
+ text-align: center;
993
+ }
994
+ [data-look="neo"].mindmap-node {
995
+ filter: ${i};
996
+ }
997
+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
998
+ fill: ${t?.includes("redux") ? e.mainBkg : e.git0};
999
+ }
1000
+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan, [data-look="neo"].mindmap-node.section-root span {
1001
+ fill: ${r};
1002
+ color: ${r};
1003
+ }
1004
+ ${e.useGradient && n && e.mainBkg ? D(e.THEME_COLOR_LIMIT, n, e.mainBkg) : ""}
1005
+ `;
1006
+ }, "getStyles")
1007
+ };
1008
+ //#endregion
1009
+ export { O as diagram };