@fibery/custom-app-text-editor 1.2.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 (105) hide show
  1. package/LICENSE +214 -0
  2. package/README.md +33 -0
  3. package/lib/abnfDiagram-VRR7QNED-BgjOQqEh.js +89 -0
  4. package/lib/arc-Dp0rqagO.js +82 -0
  5. package/lib/architecture-TIHT7OUA-DDwCCw0y.js +3 -0
  6. package/lib/architectureDiagram-ZJ3FMSHR-BucIluTN.js +4129 -0
  7. package/lib/array-CApNbSU9.js +6 -0
  8. package/lib/blockDiagram-677ZJIJ3-CWYuHThP.js +3157 -0
  9. package/lib/c4Diagram-LMCZKHZV-Cr3_W-xe.js +2982 -0
  10. package/lib/channel-Bb7a6w5c.js +5 -0
  11. package/lib/chunk-2Q5K7J3B-CINvUK-A.js +15 -0
  12. package/lib/chunk-32BRIVSS-b-BvyGz0.js +61 -0
  13. package/lib/chunk-52WLFC77-Cf8zEoqs.js +593 -0
  14. package/lib/chunk-5VM5RSS4-Dnx15xMv.js +5 -0
  15. package/lib/chunk-7BUUIJ7U-B018BbRy.js +82 -0
  16. package/lib/chunk-C7G6YPKG-CmOuVFlJ.js +67 -0
  17. package/lib/chunk-EX3LRPZG-LynZw14I.js +2042 -0
  18. package/lib/chunk-HOUHSVGY-Br7ZSMKe.js +275 -0
  19. package/lib/chunk-ICXQ74PX-VqT5WUTt.js +1330 -0
  20. package/lib/chunk-JWPE2WC7-Ch0jmUXM.js +8 -0
  21. package/lib/chunk-KEIR6QF5-RwFi50en.js +21456 -0
  22. package/lib/chunk-MOJQB5TN-rQ4AfTd9.js +490 -0
  23. package/lib/chunk-OGEWGWER-BvF6eV9Q.js +32 -0
  24. package/lib/chunk-PUDLZKDR-BW7SZvCB.js +4135 -0
  25. package/lib/chunk-Q4XR5HBZ-CRgGP3ez.js +1635 -0
  26. package/lib/chunk-RYQCIY6F-CHlASUpG.js +241 -0
  27. package/lib/chunk-V7JOEXUC-OY39ml6X.js +3357 -0
  28. package/lib/chunk-VR4S4FIN-Bk7IFdYB.js +26 -0
  29. package/lib/chunk-WYO6CB5R-MV-yOaop.js +3769 -0
  30. package/lib/chunk-XXDRQBXY-Djd1ChwJ.js +9 -0
  31. package/lib/chunk-Y2CYZVJY-QdJ4V9rh.js +12 -0
  32. package/lib/chunk-ZGVPDNZ5-l81xl1BI.js +3738 -0
  33. package/lib/classDiagram-OUVF2IWQ--wRzSvLt.js +30 -0
  34. package/lib/classDiagram-v2-EOCWNBFH-ChMCdPO-.js +30 -0
  35. package/lib/cose-bilkent-JH36ORCC-CyVZn5M3.js +2254 -0
  36. package/lib/custom-app-text-editor.css +2 -0
  37. package/lib/custom-app-text-editor.js +81102 -0
  38. package/lib/cynefin-VYW2F7L2-CMgnLl46.js +3 -0
  39. package/lib/cynefinDiagram-TSTJHNR4-988Y73wV.js +355 -0
  40. package/lib/cytoscape.esm-DMXbtFI-.js +18145 -0
  41. package/lib/dagre-Dmarb1s8.js +1699 -0
  42. package/lib/dagre-VKFMJZFB-Bf-pz2Lx.js +328 -0
  43. package/lib/defaultLocale-A87O3snN.js +198 -0
  44. package/lib/diagram-FQU43EPY-BT8WeVzc.js +432 -0
  45. package/lib/diagram-G47NLZAW-vZ2XG37l.js +527 -0
  46. package/lib/diagram-NH7WQ7WH-CH0IfHB0.js +134 -0
  47. package/lib/diagram-OA4YK3LP-BgwQcJfp.js +300 -0
  48. package/lib/diagram-WEI45ONY-Cd3sVPil.js +214 -0
  49. package/lib/dist-PGS6ynRO.js +59 -0
  50. package/lib/ebnfDiagram-CCIWWBDH-CwBFb2Fm.js +100 -0
  51. package/lib/erDiagram-Q63AITRT-BshRACvj.js +1727 -0
  52. package/lib/eventmodeling-45OFAUF4-BDhzj03B.js +3 -0
  53. package/lib/flowDiagram-23GEKE2U-C3zDgFvZ.js +16 -0
  54. package/lib/ganttDiagram-NO4QXBWP-BD5PiE8x.js +3073 -0
  55. package/lib/gitGraph-TEB2WS4Q-DJA_hE4G.js +3 -0
  56. package/lib/gitGraphDiagram-IHSO6WYX-BAhccBh3.js +733 -0
  57. package/lib/graphlib-DglfpsVp.js +1267 -0
  58. package/lib/index.browser-Dv9K8IAp.js +26 -0
  59. package/lib/info-DKCQHKI2-BD_vOCz6.js +3 -0
  60. package/lib/infoDiagram-FWYZ7A6U-CGZnf03G.js +20 -0
  61. package/lib/init-sjaVZO3f.js +13 -0
  62. package/lib/ishikawaDiagram-FXEZZL3T-PFfVM0NO.js +719 -0
  63. package/lib/journeyDiagram-5HDEW3XC-CRGz7dcx.js +884 -0
  64. package/lib/kanban-definition-HUTT4EX6-BBH4Yn5e.js +974 -0
  65. package/lib/line-CJQicKfr.js +34 -0
  66. package/lib/linear-B9Cv96-J.js +288 -0
  67. package/lib/map-C7KALUOH.js +241 -0
  68. package/lib/mermaid-parser.core-BupC9XGF.js +638 -0
  69. package/lib/mermaid-renderer-Cp0xusfR.js +2425 -0
  70. package/lib/mindmap-definition-LN4V7U3C-CWL1sg0K.js +978 -0
  71. package/lib/ordinal-CNQzPcrr.js +65 -0
  72. package/lib/packet-7NZHBO7P-CgBlALV1.js +3 -0
  73. package/lib/path-DVvH25eQ.js +84 -0
  74. package/lib/pegDiagram-2B236MQR-BKv8dTtv.js +94 -0
  75. package/lib/pie-RZYD4A2V-CryPC-P_.js +3 -0
  76. package/lib/pieDiagram-ENE6RG2P-CXeFg_cL.js +203 -0
  77. package/lib/quadrantDiagram-ABIIQ3AL-v_u3aC8Y.js +2001 -0
  78. package/lib/radar-I7S5WNFK-DgzJDRy3.js +3 -0
  79. package/lib/railroad-3IZDKUUU-DFp3mbpB.js +3 -0
  80. package/lib/railroad-abnf-AHOZXSZD-BRjidKH0.js +3 -0
  81. package/lib/railroad-ebnf-EBAXGLYW-PgrDWact.js +3 -0
  82. package/lib/railroad-peg-LSFZ7HO6-CMKir81Y.js +3 -0
  83. package/lib/railroadDiagram-RFXS5EU6-mEC9tVS-.js +76 -0
  84. package/lib/requirementDiagram-TGXJPOKE-BAEzI7V4.js +2223 -0
  85. package/lib/rolldown-runtime-DArdT4gl.js +23 -0
  86. package/lib/rough.esm-B2w_aYoc.js +1361 -0
  87. package/lib/sankeyDiagram-HTMAVEWB-Dbu-sl2E.js +972 -0
  88. package/lib/sequenceDiagram-DBY2YBRQ-DCuWmWHX.js +4156 -0
  89. package/lib/sizeCapture-X5ZJPWSS-BEIM84He.js +46 -0
  90. package/lib/src-DQbL46sB.js +2139 -0
  91. package/lib/src-DuuHKEe6.js +704 -0
  92. package/lib/stateDiagram-2N3HPSRC-fs9QmDMR.js +220 -0
  93. package/lib/stateDiagram-v2-6OUMAXLB-wWxYbttN.js +30 -0
  94. package/lib/swimlanes-5IMT3BWC-QaXUd9db.js +5069 -0
  95. package/lib/swimlanesDiagram-G3AALYLV-BtGToCzH.js +30 -0
  96. package/lib/timeline-definition-FHXFAJF6-CAsyJrsw.js +1069 -0
  97. package/lib/treeView-QDETBFTQ-DVp4aTZQ.js +3 -0
  98. package/lib/treemap-6X3UGDF4-BbBnHMHJ.js +3 -0
  99. package/lib/types.d.ts +44 -0
  100. package/lib/v4-CZv9Hsqq.js +33 -0
  101. package/lib/vennDiagram-L72KCM5P-C87u0gjr.js +1880 -0
  102. package/lib/wardley-OPB4EBWU-B-RXhnoN.js +3 -0
  103. package/lib/wardleyDiagram-EHGQE667-BxviBDl_.js +645 -0
  104. package/lib/xychartDiagram-FW5EYKEG-BQQhanuH.js +2098 -0
  105. package/package.json +29 -0
@@ -0,0 +1,432 @@
1
+ import { T as e } from "./chunk-KEIR6QF5-RwFi50en.js";
2
+ import { n as t } from "./mermaid-parser.core-BupC9XGF.js";
3
+ import { n } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
4
+ import { m as r, p as i } from "./src-DQbL46sB.js";
5
+ import { H as a, K as o, U as s, Y as c, a as l, b as u, f as d, v as f, w as p, x as m, y as h, z as g } from "./chunk-WYO6CB5R-MV-yOaop.js";
6
+ import { _, i as ee, t as te } from "./chunk-ICXQ74PX-VqT5WUTt.js";
7
+ import { t as ne } from "./chunk-JWPE2WC7-Ch0jmUXM.js";
8
+ //#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-FQU43EPY.mjs
9
+ var v = "position frame", y = "frame positioned", b = "position relation", x = "relation positioned", re = /* @__PURE__ */ n(function(e) {
10
+ r.debug("options str", e);
11
+ }, "setOptions"), ie = /* @__PURE__ */ n(function() {
12
+ return {};
13
+ }, "getOptions"), ae = /* @__PURE__ */ n(function() {
14
+ S(), l();
15
+ }, "clear");
16
+ function S() {
17
+ C = {};
18
+ }
19
+ n(S, "reset");
20
+ var oe = d.eventmodeling, se = /* @__PURE__ */ n(() => ee({
21
+ ...oe,
22
+ ...u().eventmodeling
23
+ }), "getConfig"), C = {};
24
+ function w() {
25
+ let e = ce, { ast: t } = C, n = D();
26
+ if (!t) throw Error("No data for EventModel");
27
+ return t.frames.forEach((i, a) => {
28
+ let o = P(i, t.dataEntities, n);
29
+ e = J(e, {
30
+ $kind: v,
31
+ index: a,
32
+ frame: i,
33
+ textProps: o
34
+ });
35
+ let s;
36
+ V(i) ? (r.debug("source frame", i.sourceFrames), s = t.frames.filter((e) => i.sourceFrames.some((t) => t.$refText === e.name)), s.forEach((t) => {
37
+ e = J(e, {
38
+ $kind: b,
39
+ index: a,
40
+ frame: i,
41
+ sourceFrame: t
42
+ });
43
+ })) : e = J(e, {
44
+ $kind: b,
45
+ index: a,
46
+ frame: i
47
+ });
48
+ }), e = {
49
+ ...e,
50
+ sortedSwimlanesArray: R(e.swimlanes)
51
+ }, e;
52
+ }
53
+ n(w, "getState");
54
+ function T(e) {
55
+ C.ast = e;
56
+ }
57
+ n(T, "setAst");
58
+ var E = {
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 D() {
82
+ return E;
83
+ }
84
+ n(D, "getDiagramProps");
85
+ var ce = {
86
+ boxes: [],
87
+ swimlanes: {},
88
+ relations: [],
89
+ maxR: 0,
90
+ sortedSwimlanesArray: []
91
+ };
92
+ function O(e) {
93
+ let t = e.split(".");
94
+ if (t.length === 2) return t[0];
95
+ }
96
+ n(O, "extractNamespace");
97
+ function k(e) {
98
+ let t = e.split(".");
99
+ return t.length === 2 ? t[1] : e;
100
+ }
101
+ n(k, "extractName");
102
+ function A(e, t) {
103
+ if (!(!t || t.length === 0)) return Object.values(e).find((e) => e.namespace === t);
104
+ }
105
+ n(A, "findSwimlaneByNamespace");
106
+ function j(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
+ n(j, "findNextAvailableIndex");
113
+ function M(e, t) {
114
+ let n = O(e.entityIdentifier), r = A(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 || E.labelUiAutomation
121
+ } : n ? {
122
+ index: j(t, 0, 100),
123
+ label: E.labelUiAutomationPrefix + n
124
+ } : {
125
+ index: 0,
126
+ label: E.labelUiAutomation
127
+ };
128
+ case "rmo":
129
+ case "readmodel":
130
+ case "cmd":
131
+ case "command": return r ? {
132
+ index: r.index,
133
+ label: r.namespace || E.labelCommandReadModel
134
+ } : n ? {
135
+ index: j(t, 100, 200),
136
+ label: E.labelCommandReadModelPrefix + n
137
+ } : {
138
+ index: 100,
139
+ label: E.labelCommandReadModel
140
+ };
141
+ default: return r ? {
142
+ index: r.index,
143
+ label: r.namespace || E.labelEvents
144
+ } : n ? {
145
+ index: j(t, 200, 300),
146
+ label: E.labelEventsPrefix + n
147
+ } : {
148
+ index: 200,
149
+ label: E.labelEvents
150
+ };
151
+ }
152
+ }
153
+ n(M, "calculateSwimlaneProps");
154
+ function N(e) {
155
+ let { themeVariables: t } = u();
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
+ n(N, "calculateEntityVisualProps");
188
+ function P(e, t, n) {
189
+ let i = u(), a = g(k(e.entityIdentifier) ?? "", i), o, s = {
190
+ fontSize: 16,
191
+ fontWeight: 700,
192
+ fontFamily: "\"trebuchet ms\", verdana, arial, sans-serif",
193
+ joinWith: "<br/>"
194
+ }, c = `<b>${_(a, n.textMaxWidth, s)}</b>`;
195
+ if (e.dataInlineValue && (o = e.dataInlineValue, o = o.substring(o.indexOf("{") + 1), o = o.substring(0, o.lastIndexOf("}") - 1), o = g(o, i), o = _(o, n.textMaxWidth, s), o = o.replaceAll(" ", "&nbsp;")), e.dataReference) {
196
+ let r = t.find((t) => t.name === e.dataReference?.$refText);
197
+ r && (o = r.dataBlockValue, o = o.substring(o.indexOf("{\n") + 2), o = o.substring(0, o.lastIndexOf("}") - 1), o = g(o, i), o = _(o, n.textMaxWidth, s), o = o.replaceAll(" ", "&nbsp;"), o += "<br/>");
198
+ }
199
+ let l = o !== void 0;
200
+ l && (c += `<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${o}</code>`);
201
+ let d = {
202
+ fontSize: s.fontSize,
203
+ fontWeight: s.fontWeight,
204
+ fontFamily: s.fontFamily
205
+ }, f = te(c, d), p = l ? f.width / 3 : f.width, m = {
206
+ content: c,
207
+ width: p,
208
+ height: f.height
209
+ };
210
+ return r.debug(`[${e.name}] ${e.entityIdentifier} text`, m), m;
211
+ }
212
+ n(P, "calculateTextProps");
213
+ function F(e, t) {
214
+ let n = t, r = N(n.frame), i = {
215
+ width: n.textProps.width + 2 * E.boxTextPadding,
216
+ height: n.textProps.height + 2 * E.boxTextPadding
217
+ };
218
+ return [{
219
+ $kind: y,
220
+ frame: n.frame,
221
+ index: n.index,
222
+ visual: r,
223
+ dimension: i,
224
+ textProps: n.textProps
225
+ }];
226
+ }
227
+ n(F, "decidePositionFrame");
228
+ function I(e, t, n) {
229
+ return t === void 0 ? E.contentStartX : t.index === e.index && e.r ? e.r + E.boxPadding : n === void 0 ? E.contentStartX : n.r - E.boxOverlap + E.boxPadding;
230
+ }
231
+ n(I, "calculateX");
232
+ function L(e, t) {
233
+ let n = [...e.map((e) => e.r), t];
234
+ return Math.max(...n);
235
+ }
236
+ n(L, "calculateMaxRight");
237
+ function R(e) {
238
+ return Object.values(e).sort((e, t) => e.index - t.index);
239
+ }
240
+ n(R, "sortedSwimlanesArray");
241
+ function z(e, t) {
242
+ let n = t, r = M(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 * E.swimlaneMinHeight + E.swimlaneGap,
248
+ height: E.swimlaneMinHeight,
249
+ maxHeight: E.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(E.boxMinWidth, Math.min(E.boxMaxWidth, n.dimension.width)) + 2 * E.boxPadding,
253
+ height: Math.max(E.boxMinHeight, Math.min(E.boxMaxHeight, n.dimension.height)) + 2 * E.boxPadding
254
+ }, c = I(i, o, a), l = c + s.width + E.boxPadding, u = L(Object.values(e.swimlanes), l);
255
+ i.r = c + s.width, i.maxHeight = Math.max(i.maxHeight, s.height), i.height = Math.max(E.swimlaneMinHeight, i.maxHeight) + 2 * E.swimlanePadding;
256
+ let d = {
257
+ x: c,
258
+ y: E.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 = R(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 + E.swimlaneGap;
282
+ }
283
+ return f;
284
+ }
285
+ n(z, "evolveFramePositioned");
286
+ function B(e, t) {
287
+ return e === 0 && t.sourceFrames.length === 0;
288
+ }
289
+ n(B, "isFirstFrame");
290
+ function V(e) {
291
+ return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
292
+ }
293
+ n(V, "hasSourceFrame");
294
+ function H(e, t) {
295
+ if (t != null) return e.find((e) => e.frame.name === t.name);
296
+ }
297
+ n(H, "findBoxByFrame");
298
+ function U(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
+ n(U, "findBoxByLineIndex");
305
+ function W(t, n) {
306
+ let r = n;
307
+ if (e(r.frame) || B(r.index, r.frame)) return [];
308
+ let i = H(t.boxes, r.frame);
309
+ if (i === void 0) throw Error(`Target box not found for frame ${r.frame.name}`);
310
+ let a;
311
+ return a = r.sourceFrame ? H(t.boxes, r.sourceFrame) : U(t.boxes, i.swimlane.index, r.index - 1), a === void 0 ? [] : [{
312
+ $kind: x,
313
+ frame: r.frame,
314
+ index: r.index,
315
+ sourceBox: a,
316
+ targetBox: i
317
+ }];
318
+ }
319
+ n(W, "decidePositionRelation");
320
+ function G(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
+ n(G, "evolveRelationPositioned");
343
+ var le = {
344
+ [v]: F,
345
+ [b]: W
346
+ }, ue = {
347
+ [y]: z,
348
+ [x]: G
349
+ };
350
+ function K(e, t) {
351
+ let n = le[t.$kind];
352
+ if (n == null) return [];
353
+ let i = n(e, t);
354
+ return r.debug("decided events", i), i;
355
+ }
356
+ n(K, "decide");
357
+ function q(e, t) {
358
+ let n = t.reduce((e, t) => {
359
+ let n = ue[t.$kind];
360
+ return n == null ? e : n(e, t);
361
+ }, e);
362
+ return r.debug("evolve events", {
363
+ state: e,
364
+ newState: n,
365
+ events: t
366
+ }), n;
367
+ }
368
+ n(q, "evolve");
369
+ function J(e, t) {
370
+ return q(e, K(e, t));
371
+ }
372
+ n(J, "dispatch");
373
+ var Y = {
374
+ getConfig: se,
375
+ setOptions: re,
376
+ getOptions: ie,
377
+ clear: ae,
378
+ setAccTitle: s,
379
+ getAccTitle: h,
380
+ getAccDescription: f,
381
+ setAccDescription: a,
382
+ setDiagramTitle: o,
383
+ getDiagramTitle: p,
384
+ setAst: T,
385
+ getDiagramProps: D,
386
+ getState: w
387
+ }, de = { parse: /* @__PURE__ */ n(async (e) => {
388
+ let n = await t("eventmodeling", e);
389
+ r.debug(n), Y.setAst(n), ne(n, Y);
390
+ }, "parse") }, fe = m()?.eventmodeling;
391
+ function X(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
+ n(X, "renderD3Box");
398
+ function Z(e, t) {
399
+ return e > t;
400
+ }
401
+ n(Z, "dirUpwards");
402
+ function Q(e, t, n, i) {
403
+ return (a) => {
404
+ let o = a.sourceBox.swimlane.y + t.swimlanePadding, s = a.targetBox.swimlane.y + t.swimlanePadding, c = Z(o, s), l = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, u = a.targetBox.x + a.targetBox.dimension.width / 3, d, f;
405
+ r.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
+ e.append("path").attr("class", "em-relation").attr("fill", a.visual.fill).attr("stroke", p).attr("stroke-width", "1").attr("marker-end", `url(#${n})`).attr("d", `M${l} ${d} L${u} ${f}`);
411
+ };
412
+ }
413
+ n(Q, "renderD3Relation");
414
+ function $(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
+ n($, "renderD3Swimlane");
421
+ var pe = {
422
+ parser: de,
423
+ db: Y,
424
+ renderer: { draw: /* @__PURE__ */ n(function(e, t, n, a) {
425
+ if (r.debug("in eventmodeling renderer", e + "\n", "id:", t, n), !fe) throw Error("EventModeling config not found");
426
+ let o = a.db, { themeVariables: s, eventmodeling: l } = m(), u = i(`[id="${t}"]`), d = o.getDiagramProps(), f = o.getState(), p = `em-arrowhead-${t}`, h = s.emArrowhead ?? "#000000";
427
+ f.sortedSwimlanesArray.forEach($(u, f.maxR, d, s)), f.boxes.forEach(X(u, d)), f.relations.forEach(Q(u, d, p, s)), u.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", h), c(void 0, u, l?.padding ?? 30, l?.useMaxWidth);
428
+ }, "draw") },
429
+ styles: /* @__PURE__ */ n((e) => "", "getStyles")
430
+ };
431
+ //#endregion
432
+ export { pe as diagram };