@nxgt/material 1.13.0 → 1.16.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 (150) hide show
  1. package/README.md +4 -0
  2. package/dist/abnfDiagram-O67JEVCF-mm89LXw2.js +89 -0
  3. package/dist/architecture-7GRP2DOG-DDr0RGVC.js +3 -0
  4. package/dist/architectureDiagram-NJMV4G6O-CGoA5SIv.js +4146 -0
  5. package/dist/array-CApNbSU9.js +6 -0
  6. package/dist/blockDiagram-BEXU5L5S-Dq8gitB4.js +1946 -0
  7. package/dist/c4Diagram-YGBWAQC7-DO_alqIu.js +2990 -0
  8. package/dist/channel-1fT-W0NS.js +5 -0
  9. package/dist/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
  10. package/dist/chunk-3FUC2YCW-C3yD2fMw.js +364 -0
  11. package/dist/chunk-5DYCD2WN-Dn2jrYde.js +37 -0
  12. package/dist/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
  13. package/dist/chunk-6AEJRKK7-JyfUnUEu.js +10 -0
  14. package/dist/chunk-742MDFTN-BbWkrtj2.js +275 -0
  15. package/dist/chunk-7INBJB4K-C3x7JNTG.js +4487 -0
  16. package/dist/chunk-7M6MHVWA-Cc7UTu4b.js +4256 -0
  17. package/dist/chunk-7PRAP22T-C8rsGRvH.js +67 -0
  18. package/dist/chunk-DUW6YSOI-BdOla2G8.js +10 -0
  19. package/dist/chunk-FOHPRMQF-Crq0JMf2.js +21388 -0
  20. package/dist/chunk-GNY47TPC-d-Bi8r0p.js +75 -0
  21. package/dist/chunk-GTNCS2PH-CTS015lZ.js +490 -0
  22. package/dist/chunk-GWA4HPMP-B4pgM-E1.js +61 -0
  23. package/dist/chunk-J5ZVWO5B-CYzz6Pq8.js +12 -0
  24. package/dist/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
  25. package/dist/chunk-LNGE3PJU-CiGrDO_F.js +1513 -0
  26. package/dist/chunk-MBY4JIJT-Dg6AeftH.js +1847 -0
  27. package/dist/chunk-NETBCI7D-TXZM0vKz.js +236 -0
  28. package/dist/chunk-O7XYJQB3-md6vjVm4.js +3922 -0
  29. package/dist/chunk-UA2S7LBM-DQTYPe9y.js +363 -0
  30. package/dist/chunk-WEXAMYUT-DmKWJz6y.js +26 -0
  31. package/dist/chunk-XXDRQBXY-C9XIYQdM.js +9 -0
  32. package/dist/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
  33. package/dist/chunk-Z7XXMR3K-BoDf6lxl.js +677 -0
  34. package/dist/chunk-ZIGJFQKS-CP5430fN.js +663 -0
  35. package/dist/classDiagram-v2-NBCMYWYE-6KoTmufe.js +3397 -0
  36. package/dist/components.js +3 -3
  37. package/dist/cose-bilkent-JH36ORCC-CejnZl_t.js +2251 -0
  38. package/dist/cynefin-OW5HDTMX-B8HVdZhp.js +3 -0
  39. package/dist/cynefinDiagram-VND7K2PF-DZnc0dlm.js +349 -0
  40. package/dist/cytoscape.esm-_jXi1N4y.js +18151 -0
  41. package/dist/dagre-6A5THRUB-cuS57NO5.js +2192 -0
  42. package/dist/diagram-22UHCM2B-zQSFmH0t.js +5084 -0
  43. package/dist/diagram-3UASUU5V-D45Fgu1j.js +724 -0
  44. package/dist/diagram-ATOU4E4O-YMtQnlqd.js +432 -0
  45. package/dist/diagram-CDSNMT55-DP7UmEW1.js +301 -0
  46. package/dist/diagram-MLGK6HIB-WvSqrTRC.js +134 -0
  47. package/dist/diagram-MPIPVDR6-C2F3__mt.js +214 -0
  48. package/dist/dist-1DdJvBEt.js +50 -0
  49. package/dist/{dist-BGGDEbJ3.js → dist-DppLdkXt.js} +2 -2
  50. package/dist/dnd.js +2 -2
  51. package/dist/ebnfDiagram-ZINNZB2B-BZC6cSiy.js +100 -0
  52. package/dist/elk-276RUBZZ-7DJf1MEV.js +47598 -0
  53. package/dist/erDiagram-OPXOYQCR-YKlEVEF0.js +1970 -0
  54. package/dist/eventmodeling-NTZA5JFV-C1CEo-26.js +3 -0
  55. package/dist/flowDiagram-KWPJA3E3-DyLvzIlg.js +17 -0
  56. package/dist/ganttDiagram-FUAMR5RP-KIaOrYOF.js +2928 -0
  57. package/dist/gitGraph-4MIJSDKK-BTeCS_5q.js +3 -0
  58. package/dist/gitGraphDiagram-X574FWY7-DpFW-7JE.js +729 -0
  59. package/dist/graphlib-DFaO_iIU.js +372 -0
  60. package/dist/{hooks-DReKyuyc.js → hooks-C5xy0u03.js} +1 -1
  61. package/dist/hooks.js +1 -1
  62. package/dist/{i18n-DtDrodl8.js → i18n-Cech9IAc.js} +314 -841
  63. package/dist/i18n.js +1 -1
  64. package/dist/info-A6RAGUB7-BvtuPd9C.js +3 -0
  65. package/dist/infoDiagram-VRGFBTTK-H3F-BCnu.js +20 -0
  66. package/dist/init-Buj1GKRa.js +27 -0
  67. package/dist/isArrayLikeObject-VG1KOJ3m.js +539 -0
  68. package/dist/ishikawaDiagram-OU5B5YK6-DgQDmcF3.js +719 -0
  69. package/dist/journeyDiagram-ZHPQQLJL-CanDOlfn.js +884 -0
  70. package/dist/kanban-definition-PNTS6WVX-DmnUgxgb.js +976 -0
  71. package/dist/katex-BMQ6LGsM.js +21962 -0
  72. package/dist/lib/components/index.d.ts +4 -0
  73. package/dist/lib/components/ui/chat/chat-composer-mentions.d.ts +8 -0
  74. package/dist/lib/components/ui/chat/chat-composer.d.ts +5 -1
  75. package/dist/lib/components/ui/chat/chat-markdown.d.ts +2 -2
  76. package/dist/lib/components/ui/emoji/emoji-list.d.ts +5 -0
  77. package/dist/lib/components/ui/emoji/emoji-picker.d.ts +7 -0
  78. package/dist/lib/components/ui/emoji/emoji.utils.d.ts +2 -0
  79. package/dist/lib/components/ui/emoji/emoji.utils.test.d.ts +1 -0
  80. package/dist/lib/components/ui/emoji/index.d.ts +4 -0
  81. package/dist/lib/components/ui/emoji/types.d.ts +6 -0
  82. package/dist/lib/components/ui/entity-header.stories.d.ts +1 -0
  83. package/dist/lib/components/ui/kanban/kanban.stories.d.ts +1 -0
  84. package/dist/lib/components/ui/markdown/index.d.ts +3 -0
  85. package/dist/lib/components/ui/markdown/markdown.d.ts +7 -0
  86. package/dist/lib/components/ui/markdown/markdown.stories.d.ts +14 -0
  87. package/dist/lib/components/ui/markdown/markdown.test.d.ts +1 -0
  88. package/dist/lib/components/ui/markdown/markdown.utils.d.ts +1 -0
  89. package/dist/lib/components/ui/markdown/mermaid.lazy.d.ts +12 -0
  90. package/dist/lib/components/ui/markdown/partials/markdown-code.d.ts +2 -0
  91. package/dist/lib/components/ui/markdown/partials/mermaid-diagram.d.ts +4 -0
  92. package/dist/lib/components/ui/mentions/index.d.ts +3 -0
  93. package/dist/lib/components/ui/mentions/mention-list.d.ts +8 -0
  94. package/dist/lib/components/ui/mentions/mentions.utils.d.ts +7 -0
  95. package/dist/lib/components/ui/mentions/mentions.utils.test.d.ts +1 -0
  96. package/dist/lib/components/ui/mentions/types.d.ts +7 -0
  97. package/dist/lib/components/ui/rich-text-editor/extensions/mention/mention-list.d.ts +12 -1
  98. package/dist/lib/components/ui/terminal/index.d.ts +2 -0
  99. package/dist/lib/components/ui/terminal/terminal.d.ts +11 -0
  100. package/dist/lib/components/ui/terminal/terminal.stories.d.ts +14 -0
  101. package/dist/lib/components/ui/terminal/terminal.utils.d.ts +5 -0
  102. package/dist/lib/components/ui/terminal/terminal.utils.test.d.ts +1 -0
  103. package/dist/lib/i18n/resources/en/index.d.ts +7 -0
  104. package/dist/lib/i18n/resources/en/material.json.d.ts +7 -0
  105. package/dist/lib/i18n/resources/fr/index.d.ts +7 -0
  106. package/dist/lib/i18n/resources/fr/material.json.d.ts +7 -0
  107. package/dist/lib/i18n/resources/index.d.ts +14 -0
  108. package/dist/lib/i18n/translator.d.ts +1 -1
  109. package/dist/{lib-CD3tyuc8.js → lib-Bbw5QPoj.js} +472 -471
  110. package/dist/lib.js +2 -2
  111. package/dist/{main-r84Yresa.js → main-BjDU9FDM.js} +59393 -30376
  112. package/dist/main.js +6 -6
  113. package/dist/material.css +1 -1
  114. package/dist/math-C5EhTgJw.js +10 -0
  115. package/dist/mermaid-parser.core-Cz-MfB4Z.js +638 -0
  116. package/dist/mermaid.core-BI1sunfX.js +1096 -0
  117. package/dist/mindmap-definition-NLK3R4M7-DW0BIU_q.js +1008 -0
  118. package/dist/ordinal-DuP05kVQ.js +65 -0
  119. package/dist/packet-AYTQ26CC-CshIswP8.js +3 -0
  120. package/dist/path-Cjou0lUh.js +85 -0
  121. package/dist/pegDiagram-GJSIUBJH-CJIx0u4M.js +94 -0
  122. package/dist/pie-WAS4IAKB-CYs22y4X.js +3 -0
  123. package/dist/pieDiagram-5QR66LMP-zAhv5fKz.js +157 -0
  124. package/dist/quadrantDiagram-O4NWA36T-CO4n_yQo.js +2001 -0
  125. package/dist/radar-RG4KPBEZ-BOJKjbGv.js +3 -0
  126. package/dist/railroad-74A4TZTK-Dt1BmUkI.js +3 -0
  127. package/dist/railroad-abnf-HS5TGJTU-Cs9GMUMY.js +3 -0
  128. package/dist/railroad-ebnf-LZEXJU2U-D4y0fXoW.js +3 -0
  129. package/dist/railroad-peg-WCYAUIDC-D2f_ZNR5.js +3 -0
  130. package/dist/railroadDiagram-XR7U4H2S-B8iV7mfe.js +76 -0
  131. package/dist/requirementDiagram-PLB6GJNP-CGoX1NrW.js +2228 -0
  132. package/dist/rough.esm-rcMoXTJj.js +1352 -0
  133. package/dist/sankeyDiagram-IPEJSGJF-DdSM2wiI.js +962 -0
  134. package/dist/sequenceDiagram-PO4LG4MO-CCRqF5XO.js +4200 -0
  135. package/dist/sizeCapture-INFHLROL-CHXIsPO_.js +46 -0
  136. package/dist/src-B4npqWNl.js +1775 -0
  137. package/dist/stateDiagram-v2-GCMORJYK-CQTX5ks8.js +2143 -0
  138. package/dist/step-B6KjpKgN.js +706 -0
  139. package/dist/string-B-ZWXCs2.js +392 -0
  140. package/dist/swimlanes-2SLR337P-C2NNOb5n.js +4763 -0
  141. package/dist/swimlanesDiagram-TC7HE7FX-CPsqPrbP.js +28 -0
  142. package/dist/timeline-definition-EJHVYXUP-DuxGHv-N.js +1073 -0
  143. package/dist/treeView-Q6P3EWNA-BrJylG9N.js +3 -0
  144. package/dist/treemap-WGGIJYW6-DpIZuqbj.js +3 -0
  145. package/dist/usecaseDiagram-POWQR4AR-cuAeIBW3.js +9932 -0
  146. package/dist/vennDiagram-UO4OBE2U-DLwBSAnC.js +1880 -0
  147. package/dist/wardley-WFR3VGLG-CbwdAAbH.js +3 -0
  148. package/dist/wardleyDiagram-VNRHLVJA-D7IZU6vu.js +645 -0
  149. package/dist/xychartDiagram-PMCCYNJV-BDOFv_xK.js +2167 -0
  150. package/package.json +7 -1
@@ -0,0 +1,432 @@
1
+ import { n as e, t } from "./src-B4npqWNl.js";
2
+ import { _ as n, i as r, t as i } from "./chunk-ZIGJFQKS-CP5430fN.js";
3
+ import { T as a } from "./chunk-FOHPRMQF-Crq0JMf2.js";
4
+ import { n as o } from "./mermaid-parser.core-Cz-MfB4Z.js";
5
+ import { n as s } from "./chunk-Y2CYZVJY-i11wjrBe.js";
6
+ import { H as c, U as l, X as u, a as d, b as f, f as p, q as m, v as h, w as g, x as _, y as ee, z as v } from "./chunk-O7XYJQB3-md6vjVm4.js";
7
+ import { t as te } from "./chunk-JWPE2WC7-Ccb0QaC8.js";
8
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-ATOU4E4O.mjs
9
+ var y = "position frame", b = "frame positioned", x = "position relation", S = "relation positioned", ne = /* @__PURE__ */ s(function(t) {
10
+ e.debug("options str", t);
11
+ }, "setOptions"), re = /* @__PURE__ */ s(function() {
12
+ return {};
13
+ }, "getOptions"), ie = /* @__PURE__ */ s(function() {
14
+ C(), d();
15
+ }, "clear");
16
+ function C() {
17
+ w = {};
18
+ }
19
+ s(C, "reset");
20
+ var ae = p.eventmodeling, oe = /* @__PURE__ */ s(() => r({
21
+ ...ae,
22
+ ...f().eventmodeling
23
+ }), "getConfig"), w = {};
24
+ function T() {
25
+ let t = se, { ast: n } = w, r = O();
26
+ if (!n) throw Error("No data for EventModel");
27
+ return n.frames.forEach((i, a) => {
28
+ let o = F(i, n.dataEntities, r);
29
+ t = Y(t, {
30
+ $kind: y,
31
+ index: a,
32
+ frame: i,
33
+ textProps: o
34
+ });
35
+ let s;
36
+ H(i) ? (e.debug("source frame", i.sourceFrames), s = n.frames.filter((e) => i.sourceFrames.some((t) => t.$refText === e.name)), s.forEach((e) => {
37
+ t = Y(t, {
38
+ $kind: x,
39
+ index: a,
40
+ frame: i,
41
+ sourceFrame: e
42
+ });
43
+ })) : t = Y(t, {
44
+ $kind: x,
45
+ index: a,
46
+ frame: i
47
+ });
48
+ }), t = {
49
+ ...t,
50
+ sortedSwimlanesArray: z(t.swimlanes)
51
+ }, t;
52
+ }
53
+ s(T, "getState");
54
+ function E(e) {
55
+ w.ast = e;
56
+ }
57
+ s(E, "setAst");
58
+ var D = {
59
+ swimlaneMinHeight: 70,
60
+ swimlanePadding: 15,
61
+ swimlaneGap: 10,
62
+ boxPadding: 10,
63
+ boxOverlap: 90,
64
+ boxDefaultY: 0,
65
+ boxMinWidth: 80,
66
+ boxMaxWidth: 450,
67
+ boxMinHeight: 80,
68
+ boxMaxHeight: 750,
69
+ contentStartX: 250,
70
+ textMaxWidth: 430,
71
+ boxTextFontWeight: "bold",
72
+ boxTextPadding: 10,
73
+ swimlaneTextFontWeight: "bold",
74
+ labelUiAutomation: "UI/Automation",
75
+ labelUiAutomationPrefix: "UI/A: ",
76
+ labelCommandReadModel: "Command/Read Model",
77
+ labelCommandReadModelPrefix: "C/RM: ",
78
+ labelEvents: "Events",
79
+ labelEventsPrefix: "Stream: "
80
+ };
81
+ function O() {
82
+ return D;
83
+ }
84
+ s(O, "getDiagramProps");
85
+ var se = {
86
+ boxes: [],
87
+ swimlanes: {},
88
+ relations: [],
89
+ maxR: 0,
90
+ sortedSwimlanesArray: []
91
+ };
92
+ function k(e) {
93
+ let t = e.split(".");
94
+ if (t.length === 2) return t[0];
95
+ }
96
+ s(k, "extractNamespace");
97
+ function A(e) {
98
+ let t = e.split(".");
99
+ return t.length === 2 ? t[1] : e;
100
+ }
101
+ s(A, "extractName");
102
+ function j(e, t) {
103
+ if (!(!t || t.length === 0)) return Object.values(e).find((e) => e.namespace === t);
104
+ }
105
+ s(j, "findSwimlaneByNamespace");
106
+ function M(e, t, n) {
107
+ return Math.max(t, ...Object.keys(e).filter((e) => {
108
+ let r = Number.parseInt(e);
109
+ return r > t && r < n;
110
+ }).map((e) => Number.parseInt(e))) + 1;
111
+ }
112
+ s(M, "findNextAvailableIndex");
113
+ function N(e, t) {
114
+ let n = k(e.entityIdentifier), r = j(t, n);
115
+ switch (e.modelEntityType) {
116
+ case "ui":
117
+ case "pcr":
118
+ case "processor": return r ? {
119
+ index: r.index,
120
+ label: r.namespace || D.labelUiAutomation
121
+ } : n ? {
122
+ index: M(t, 0, 100),
123
+ label: D.labelUiAutomationPrefix + n
124
+ } : {
125
+ index: 0,
126
+ label: D.labelUiAutomation
127
+ };
128
+ case "rmo":
129
+ case "readmodel":
130
+ case "cmd":
131
+ case "command": return r ? {
132
+ index: r.index,
133
+ label: r.namespace || D.labelCommandReadModel
134
+ } : n ? {
135
+ index: M(t, 100, 200),
136
+ label: D.labelCommandReadModelPrefix + n
137
+ } : {
138
+ index: 100,
139
+ label: D.labelCommandReadModel
140
+ };
141
+ default: return r ? {
142
+ index: r.index,
143
+ label: r.namespace || D.labelEvents
144
+ } : n ? {
145
+ index: M(t, 200, 300),
146
+ label: D.labelEventsPrefix + n
147
+ } : {
148
+ index: 200,
149
+ label: D.labelEvents
150
+ };
151
+ }
152
+ }
153
+ s(N, "calculateSwimlaneProps");
154
+ function P(e) {
155
+ let { themeVariables: t } = f();
156
+ switch (e.modelEntityType) {
157
+ case "ui": return {
158
+ fill: t.emUiFill ?? "white",
159
+ stroke: t.emUiStroke ?? "#dbdada"
160
+ };
161
+ case "pcr":
162
+ case "processor": return {
163
+ fill: t.emProcessorFill ?? "#edb3f6",
164
+ stroke: t.emProcessorStroke ?? "#b88cbf"
165
+ };
166
+ case "rmo":
167
+ case "readmodel": return {
168
+ fill: t.emReadModelFill ?? "#d3f1a2",
169
+ stroke: t.emReadModelStroke ?? "#a3b732"
170
+ };
171
+ case "cmd":
172
+ case "command": return {
173
+ fill: t.emCommandFill ?? "#bcd6fe",
174
+ stroke: t.emCommandStroke ?? "#679ac3"
175
+ };
176
+ case "evt":
177
+ case "event": return {
178
+ fill: t.emEventFill ?? "#ffb778",
179
+ stroke: t.emEventStroke ?? "#c19a0f"
180
+ };
181
+ default: return {
182
+ fill: "red",
183
+ stroke: "black"
184
+ };
185
+ }
186
+ }
187
+ s(P, "calculateEntityVisualProps");
188
+ function F(t, r, a) {
189
+ let o = f(), s = v(A(t.entityIdentifier) ?? "", o), c, l = {
190
+ fontSize: 16,
191
+ fontWeight: 700,
192
+ fontFamily: "\"trebuchet ms\", verdana, arial, sans-serif",
193
+ joinWith: "<br/>"
194
+ }, u = `<b>${n(s, a.textMaxWidth, l)}</b>`;
195
+ if (t.dataInlineValue && (c = t.dataInlineValue, c = c.substring(c.indexOf("{") + 1), c = c.substring(0, c.lastIndexOf("}") - 1), c = v(c, o), c = n(c, a.textMaxWidth, l), c = c.replaceAll(" ", "&nbsp;")), t.dataReference) {
196
+ let e = r.find((e) => e.name === t.dataReference?.$refText);
197
+ e && (c = e.dataBlockValue, c = c.substring(c.indexOf("{\n") + 2), c = c.substring(0, c.lastIndexOf("}") - 1), c = v(c, o), c = n(c, a.textMaxWidth, l), c = c.replaceAll(" ", "&nbsp;"), c += "<br/>");
198
+ }
199
+ let d = c !== void 0;
200
+ d && (u += `<br/><br/><code style="text-align: left; display: block;max-width:${a.textMaxWidth}px">${c}</code>`);
201
+ let p = {
202
+ fontSize: l.fontSize,
203
+ fontWeight: l.fontWeight,
204
+ fontFamily: l.fontFamily
205
+ }, m = i(u, p), h = d ? m.width / 3 : m.width, g = {
206
+ content: u,
207
+ width: h,
208
+ height: m.height
209
+ };
210
+ return e.debug(`[${t.name}] ${t.entityIdentifier} text`, g), g;
211
+ }
212
+ s(F, "calculateTextProps");
213
+ function I(e, t) {
214
+ let n = t, r = P(n.frame), i = {
215
+ width: n.textProps.width + 2 * D.boxTextPadding,
216
+ height: n.textProps.height + 2 * D.boxTextPadding
217
+ };
218
+ return [{
219
+ $kind: b,
220
+ frame: n.frame,
221
+ index: n.index,
222
+ visual: r,
223
+ dimension: i,
224
+ textProps: n.textProps
225
+ }];
226
+ }
227
+ s(I, "decidePositionFrame");
228
+ function L(e, t, n) {
229
+ return t === void 0 ? D.contentStartX : t.index === e.index && e.r ? e.r + D.boxPadding : n === void 0 ? D.contentStartX : n.r - D.boxOverlap + D.boxPadding;
230
+ }
231
+ s(L, "calculateX");
232
+ function R(e, t) {
233
+ let n = [...e.map((e) => e.r), t];
234
+ return Math.max(...n);
235
+ }
236
+ s(R, "calculateMaxRight");
237
+ function z(e) {
238
+ return Object.values(e).sort((e, t) => e.index - t.index);
239
+ }
240
+ s(z, "sortedSwimlanesArray");
241
+ function B(e, t) {
242
+ let n = t, r = N(n.frame, e.swimlanes), i;
243
+ i = r.index in e.swimlanes ? e.swimlanes[r.index] : {
244
+ index: r.index,
245
+ label: r.label,
246
+ r: 0,
247
+ y: r.index * D.swimlaneMinHeight + D.swimlaneGap,
248
+ height: D.swimlaneMinHeight,
249
+ maxHeight: D.swimlaneMinHeight
250
+ };
251
+ let a = e.boxes.length > 0 ? e.boxes[e.boxes.length - 1] : void 0, o = e.previousSwimlaneNumber === void 0 ? void 0 : e.swimlanes[e.previousSwimlaneNumber], s = {
252
+ width: Math.max(D.boxMinWidth, Math.min(D.boxMaxWidth, n.dimension.width)) + 2 * D.boxPadding,
253
+ height: Math.max(D.boxMinHeight, Math.min(D.boxMaxHeight, n.dimension.height)) + 2 * D.boxPadding
254
+ }, c = L(i, o, a), l = c + s.width + D.boxPadding, u = R(Object.values(e.swimlanes), l);
255
+ i.r = c + s.width, i.maxHeight = Math.max(i.maxHeight, s.height), i.height = Math.max(D.swimlaneMinHeight, i.maxHeight) + 2 * D.swimlanePadding;
256
+ let d = {
257
+ x: c,
258
+ y: D.swimlanePadding + i.y,
259
+ r: l,
260
+ dimension: s,
261
+ leftSibling: !1,
262
+ swimlane: i,
263
+ visual: n.visual,
264
+ text: n.textProps.content,
265
+ frame: n.frame,
266
+ index: n.index
267
+ }, f = {
268
+ ...e,
269
+ boxes: [...e.boxes, d],
270
+ swimlanes: {
271
+ ...e.swimlanes,
272
+ [`${i.index}`]: i
273
+ },
274
+ previousSwimlaneNumber: r.index,
275
+ previousFrame: n.frame,
276
+ maxR: u
277
+ }, p = z(f.swimlanes);
278
+ p.length > 0 && (p[0].y = 0);
279
+ for (let e = 1; e < p.length; e++) {
280
+ let t = p[e], n = p[e - 1];
281
+ t.y = n.y + n.height + D.swimlaneGap;
282
+ }
283
+ return f;
284
+ }
285
+ s(B, "evolveFramePositioned");
286
+ function V(e, t) {
287
+ return e === 0 && t.sourceFrames.length === 0;
288
+ }
289
+ s(V, "isFirstFrame");
290
+ function H(e) {
291
+ return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
292
+ }
293
+ s(H, "hasSourceFrame");
294
+ function U(e, t) {
295
+ if (t != null) return e.find((e) => e.frame.name === t.name);
296
+ }
297
+ s(U, "findBoxByFrame");
298
+ function W(e, t, n) {
299
+ if (!(n < 0)) for (let r = n; r >= 0; r--) {
300
+ let n = e[r];
301
+ if (n.swimlane.index !== t) return n;
302
+ }
303
+ }
304
+ s(W, "findBoxByLineIndex");
305
+ function G(e, t) {
306
+ let n = t;
307
+ if (a(n.frame) || V(n.index, n.frame)) return [];
308
+ let r = U(e.boxes, n.frame);
309
+ if (r === void 0) throw Error(`Target box not found for frame ${n.frame.name}`);
310
+ let i;
311
+ return i = n.sourceFrame ? U(e.boxes, n.sourceFrame) : W(e.boxes, r.swimlane.index, n.index - 1), i === void 0 ? [] : [{
312
+ $kind: S,
313
+ frame: n.frame,
314
+ index: n.index,
315
+ sourceBox: i,
316
+ targetBox: r
317
+ }];
318
+ }
319
+ s(G, "decidePositionRelation");
320
+ function K(e, t) {
321
+ let n = t, r = {
322
+ visual: {
323
+ fill: "none",
324
+ stroke: "#000"
325
+ },
326
+ source: {
327
+ x: n.sourceBox.x,
328
+ y: n.sourceBox.y
329
+ },
330
+ target: {
331
+ x: n.targetBox.x,
332
+ y: n.targetBox.y
333
+ },
334
+ sourceBox: n.sourceBox,
335
+ targetBox: n.targetBox
336
+ };
337
+ return {
338
+ ...e,
339
+ relations: [...e.relations, r]
340
+ };
341
+ }
342
+ s(K, "evolveRelationPositioned");
343
+ var ce = {
344
+ [y]: I,
345
+ [x]: G
346
+ }, le = {
347
+ [b]: B,
348
+ [S]: K
349
+ };
350
+ function q(t, n) {
351
+ let r = ce[n.$kind];
352
+ if (r == null) return [];
353
+ let i = r(t, n);
354
+ return e.debug("decided events", i), i;
355
+ }
356
+ s(q, "decide");
357
+ function J(t, n) {
358
+ let r = n.reduce((e, t) => {
359
+ let n = le[t.$kind];
360
+ return n == null ? e : n(e, t);
361
+ }, t);
362
+ return e.debug("evolve events", {
363
+ state: t,
364
+ newState: r,
365
+ events: n
366
+ }), r;
367
+ }
368
+ s(J, "evolve");
369
+ function Y(e, t) {
370
+ return J(e, q(e, t));
371
+ }
372
+ s(Y, "dispatch");
373
+ var X = {
374
+ getConfig: oe,
375
+ setOptions: ne,
376
+ getOptions: re,
377
+ clear: ie,
378
+ setAccTitle: l,
379
+ getAccTitle: ee,
380
+ getAccDescription: h,
381
+ setAccDescription: c,
382
+ setDiagramTitle: m,
383
+ getDiagramTitle: g,
384
+ setAst: E,
385
+ getDiagramProps: O,
386
+ getState: T
387
+ }, ue = { parse: /* @__PURE__ */ s(async (t) => {
388
+ let n = await o("eventmodeling", t);
389
+ e.debug(n), X.setAst(n), te(n, X);
390
+ }, "parse") }, de = _()?.eventmodeling;
391
+ function Z(e, t) {
392
+ return (n) => {
393
+ let r = n.swimlane.y + t.swimlanePadding, i = e.append("g").attr("class", "em-box");
394
+ i.append("rect").attr("x", n.x).attr("y", r).attr("rx", "3").attr("width", n.dimension.width).attr("height", n.dimension.height).attr("stroke", n.visual.stroke).attr("fill", n.visual.fill), i.append("foreignObject").attr("x", n.x + t.boxPadding).attr("y", r + 10).attr("width", n.dimension.width - 2 * t.boxPadding).attr("height", n.dimension.height - 2 * t.boxPadding).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%").append("span").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").html(n.text);
395
+ };
396
+ }
397
+ s(Z, "renderD3Box");
398
+ function Q(e, t) {
399
+ return e > t;
400
+ }
401
+ s(Q, "dirUpwards");
402
+ function $(t, n, r, i) {
403
+ return (a) => {
404
+ let o = a.sourceBox.swimlane.y + n.swimlanePadding, s = a.targetBox.swimlane.y + n.swimlanePadding, c = Q(o, s), l = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, u = a.targetBox.x + a.targetBox.dimension.width / 3, d, f;
405
+ e.debug(`rendering relation up=${c} for `, {
406
+ sourceBox: a.sourceBox,
407
+ targetBox: a.targetBox
408
+ }), c ? (d = o, f = s + a.targetBox.dimension.height) : (d = o + a.sourceBox.dimension.height, f = s);
409
+ let p = i.emRelationStroke ?? a.visual.stroke;
410
+ t.append("path").attr("class", "em-relation").attr("fill", a.visual.fill).attr("stroke", p).attr("stroke-width", "1").attr("marker-end", `url(#${r})`).attr("d", `M${l} ${d} L${u} ${f}`);
411
+ };
412
+ }
413
+ s($, "renderD3Relation");
414
+ function fe(e, t, n, r) {
415
+ return (i) => {
416
+ let a = e.append("g").attr("class", "em-swimlane"), o = r.emSwimlaneBackgroundOdd ?? "rgb(250,250,250)", s = r.emSwimlaneBackgroundStroke ?? "rgb(240,240,240)";
417
+ a.append("rect").attr("x", 0).attr("y", i.y).attr("rx", "3").attr("width", t + n.swimlanePadding).attr("height", i.height).attr("fill", o).attr("stroke", s), a.append("text").attr("font-weight", n.swimlaneTextFontWeight).attr("x", 30).attr("y", i.y + 30).text(i.label);
418
+ };
419
+ }
420
+ s(fe, "renderD3Swimlane");
421
+ var pe = {
422
+ parser: ue,
423
+ db: X,
424
+ renderer: { draw: /* @__PURE__ */ s(function(n, r, i, a) {
425
+ if (e.debug("in eventmodeling renderer", n + "\n", "id:", r, i), !de) throw Error("EventModeling config not found");
426
+ let o = a.db, { themeVariables: s, eventmodeling: c } = _(), l = t(`[id="${r}"]`), d = o.getDiagramProps(), f = o.getState(), p = `em-arrowhead-${r}`, m = s.emArrowhead ?? "#000000";
427
+ f.sortedSwimlanesArray.forEach(fe(l, f.maxR, d, s)), f.boxes.forEach(Z(l, d)), f.relations.forEach($(l, d, p, s)), l.append("defs").append("marker").attr("id", p).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", m), u(void 0, l, c?.padding ?? 30, c?.useMaxWidth);
428
+ }, "draw") },
429
+ styles: /* @__PURE__ */ s((e) => "", "getStyles")
430
+ };
431
+ //#endregion
432
+ export { pe as diagram };