@aranzatech/diagrams-bpmn 0.1.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 (53) hide show
  1. package/dist/chunk-23B2IGK5.js +24 -0
  2. package/dist/chunk-23B2IGK5.js.map +1 -0
  3. package/dist/chunk-3AFZDIMQ.js +286 -0
  4. package/dist/chunk-3AFZDIMQ.js.map +1 -0
  5. package/dist/chunk-4OAEWYYU.js +579 -0
  6. package/dist/chunk-4OAEWYYU.js.map +1 -0
  7. package/dist/chunk-57LA2WSJ.js +476 -0
  8. package/dist/chunk-57LA2WSJ.js.map +1 -0
  9. package/dist/chunk-6TUC5QX5.js +491 -0
  10. package/dist/chunk-6TUC5QX5.js.map +1 -0
  11. package/dist/chunk-MLUJKUTG.js +86 -0
  12. package/dist/chunk-MLUJKUTG.js.map +1 -0
  13. package/dist/chunk-NXMUX67A.js +1443 -0
  14. package/dist/chunk-NXMUX67A.js.map +1 -0
  15. package/dist/edges/index.cjs +300 -0
  16. package/dist/edges/index.cjs.map +1 -0
  17. package/dist/edges/index.d.cts +17 -0
  18. package/dist/edges/index.d.ts +17 -0
  19. package/dist/edges/index.js +4 -0
  20. package/dist/edges/index.js.map +1 -0
  21. package/dist/elements/index.cjs +587 -0
  22. package/dist/elements/index.cjs.map +1 -0
  23. package/dist/elements/index.d.cts +20 -0
  24. package/dist/elements/index.d.ts +20 -0
  25. package/dist/elements/index.js +4 -0
  26. package/dist/elements/index.js.map +1 -0
  27. package/dist/index.cjs +3442 -0
  28. package/dist/index.cjs.map +1 -0
  29. package/dist/index.d.cts +67 -0
  30. package/dist/index.d.ts +67 -0
  31. package/dist/index.js +45 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/nodes/index.cjs +1487 -0
  34. package/dist/nodes/index.cjs.map +1 -0
  35. package/dist/nodes/index.d.cts +45 -0
  36. package/dist/nodes/index.d.ts +45 -0
  37. package/dist/nodes/index.js +4 -0
  38. package/dist/nodes/index.js.map +1 -0
  39. package/dist/simulation/index.cjs +483 -0
  40. package/dist/simulation/index.cjs.map +1 -0
  41. package/dist/simulation/index.d.cts +62 -0
  42. package/dist/simulation/index.d.ts +62 -0
  43. package/dist/simulation/index.js +3 -0
  44. package/dist/simulation/index.js.map +1 -0
  45. package/dist/types-CxzazgBX.d.cts +111 -0
  46. package/dist/types-CxzazgBX.d.ts +111 -0
  47. package/dist/xml/index.cjs +1068 -0
  48. package/dist/xml/index.cjs.map +1 -0
  49. package/dist/xml/index.d.cts +24 -0
  50. package/dist/xml/index.d.ts +24 -0
  51. package/dist/xml/index.js +4 -0
  52. package/dist/xml/index.js.map +1 -0
  53. package/package.json +84 -0
@@ -0,0 +1,1487 @@
1
+ 'use strict';
2
+
3
+ var react = require('@xyflow/react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/nodes/shared/BpmnHandles.tsx
7
+ var ALL_POSITIONS = [
8
+ react.Position.Top,
9
+ react.Position.Right,
10
+ react.Position.Bottom,
11
+ react.Position.Left
12
+ ];
13
+ var HANDLE_STYLE = {
14
+ width: 8,
15
+ height: 8,
16
+ background: "#8c8c8c",
17
+ border: "1.5px solid #fff"
18
+ };
19
+ function BpmnHandles({ variant = "all" }) {
20
+ const src = variant === "all" || variant === "source";
21
+ const tgt = variant === "all" || variant === "target";
22
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23
+ tgt && ALL_POSITIONS.map((position) => /* @__PURE__ */ jsxRuntime.jsx(
24
+ react.Handle,
25
+ {
26
+ type: "target",
27
+ position,
28
+ id: `target-${position}`,
29
+ style: HANDLE_STYLE
30
+ },
31
+ `target-${position}`
32
+ )),
33
+ src && ALL_POSITIONS.map((position) => /* @__PURE__ */ jsxRuntime.jsx(
34
+ react.Handle,
35
+ {
36
+ type: "source",
37
+ position,
38
+ id: `source-${position}`,
39
+ style: HANDLE_STYLE
40
+ },
41
+ `source-${position}`
42
+ ))
43
+ ] });
44
+ }
45
+
46
+ // src/nodes/shared/theme.ts
47
+ var BPMN_THEME = {
48
+ fill: "#ffffff",
49
+ stroke: "#404040",
50
+ strokeSelected: "#1a56db",
51
+ strokeWidth: 1.5,
52
+ strokeWidthSelected: 2.5,
53
+ fontFamily: "Inter, system-ui, sans-serif",
54
+ fontSize: 11,
55
+ labelColor: "#1a1a1a"};
56
+ function resolveStroke(selected, override) {
57
+ if (selected) return BPMN_THEME.strokeSelected;
58
+ return override ?? BPMN_THEME.stroke;
59
+ }
60
+ function resolveStrokeWidth(selected) {
61
+ return selected ? BPMN_THEME.strokeWidthSelected : BPMN_THEME.strokeWidth;
62
+ }
63
+ var EXTERNAL_STYLE = {
64
+ position: "absolute",
65
+ top: "100%",
66
+ left: "50%",
67
+ transform: "translateX(-50%)",
68
+ marginTop: 4,
69
+ fontSize: BPMN_THEME.fontSize,
70
+ fontFamily: BPMN_THEME.fontFamily,
71
+ color: BPMN_THEME.labelColor,
72
+ textAlign: "center",
73
+ whiteSpace: "nowrap",
74
+ maxWidth: 100,
75
+ overflow: "hidden",
76
+ textOverflow: "ellipsis",
77
+ pointerEvents: "none",
78
+ lineHeight: 1.3
79
+ };
80
+ var INTERNAL_STYLE = {
81
+ fontSize: BPMN_THEME.fontSize,
82
+ fontFamily: BPMN_THEME.fontFamily,
83
+ color: BPMN_THEME.labelColor,
84
+ textAlign: "center",
85
+ lineHeight: 1.3,
86
+ overflow: "hidden",
87
+ wordBreak: "break-word"
88
+ };
89
+ function BpmnLabel({ children, external = false, style }) {
90
+ if (!children) return null;
91
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...external ? EXTERNAL_STYLE : INTERNAL_STYLE, ...style }, children });
92
+ }
93
+ function pentagon(r) {
94
+ const pts = Array.from({ length: 5 }, (_, i) => {
95
+ const a = (i * 72 - 90) * (Math.PI / 180);
96
+ return `${(r * Math.cos(a)).toFixed(2)},${(r * Math.sin(a)).toFixed(2)}`;
97
+ });
98
+ return `M ${pts.join(" L ")} Z`;
99
+ }
100
+ function EventMarker({ cx, cy, trigger, filled = false, stroke, bg, r = 10 }) {
101
+ const s = r * 0.6;
102
+ const f = filled ? stroke : "none";
103
+ const sw = 1.4;
104
+ if (trigger === "none" || !trigger) return null;
105
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx},${cy})`, strokeLinecap: "round", strokeLinejoin: "round", children: [
106
+ trigger === "message" && /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: f, stroke, strokeWidth: sw, children: [
107
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: -s, y: -s * 0.65, width: s * 2, height: s * 1.3, rx: 0.5 }),
108
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { fill: "none", points: `${-s},${-s * 0.65} 0,${s * 0.2} ${s},${-s * 0.65}` })
109
+ ] }),
110
+ trigger === "timer" && /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: f, stroke, strokeWidth: sw, children: [
111
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { r: s, fill: bg, stroke, strokeWidth: sw }),
112
+ Array.from({ length: 12 }, (_, i) => {
113
+ const a = (i * 30 - 90) * (Math.PI / 180);
114
+ const len = i % 3 === 0 ? 0.25 : 0.15;
115
+ const x1 = Math.cos(a) * s * 0.75;
116
+ const y1 = Math.sin(a) * s * 0.75;
117
+ const x2 = Math.cos(a) * s * (0.75 + len);
118
+ const y2 = Math.sin(a) * s * (0.75 + len);
119
+ return /* @__PURE__ */ jsxRuntime.jsx("line", { x1, y1, x2, y2, stroke, strokeWidth: sw * 0.8 }, i);
120
+ }),
121
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 0, y1: 0, x2: 0, y2: -s * 0.5, stroke, strokeWidth: sw }),
122
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 0, y1: 0, x2: s * 0.4, y2: 0, stroke, strokeWidth: sw })
123
+ ] }),
124
+ trigger === "error" && /* @__PURE__ */ jsxRuntime.jsx(
125
+ "path",
126
+ {
127
+ d: `M ${s * 0.35},${-s} L ${-s * 0.15},${-s * 0.05} L ${s * 0.35},${s * 0.05} L ${-s * 0.35},${s} L ${s * 0.15},${s * 0.05} L ${-s * 0.35},${-s * 0.05} Z`,
128
+ fill: f,
129
+ stroke,
130
+ strokeWidth: sw
131
+ }
132
+ ),
133
+ trigger === "escalation" && /* @__PURE__ */ jsxRuntime.jsx(
134
+ "path",
135
+ {
136
+ d: `M 0,${-s} L ${s * 0.8},${s * 0.7} L 0,${s * 0.2} L ${-s * 0.8},${s * 0.7} Z`,
137
+ fill: f,
138
+ stroke,
139
+ strokeWidth: sw
140
+ }
141
+ ),
142
+ trigger === "conditional" && // Three horizontal lines (document/list)
143
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: sw, fill: "none", children: [
144
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: -s * 0.75, y: -s * 0.9, width: s * 1.5, height: s * 1.8, rx: 1, fill: bg, stroke, strokeWidth: sw }),
145
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.45, y1: -s * 0.4, x2: s * 0.45, y2: -s * 0.4 }),
146
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.45, y1: 0, x2: s * 0.45, y2: 0 }),
147
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.45, y1: s * 0.4, x2: s * 0.45, y2: s * 0.4 })
148
+ ] }),
149
+ trigger === "link" && // Arrow pointing right
150
+ /* @__PURE__ */ jsxRuntime.jsx(
151
+ "path",
152
+ {
153
+ d: `M ${-s * 0.9},${-s * 0.35} L ${s * 0.1},${-s * 0.35} L ${s * 0.1},${-s * 0.65} L ${s},0 L ${s * 0.1},${s * 0.65} L ${s * 0.1},${s * 0.35} L ${-s * 0.9},${s * 0.35} Z`,
154
+ fill: f,
155
+ stroke,
156
+ strokeWidth: sw
157
+ }
158
+ ),
159
+ trigger === "compensation" && // Two left-pointing chevrons <<
160
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: f, stroke, strokeWidth: sw, children: [
161
+ /* @__PURE__ */ jsxRuntime.jsx(
162
+ "polyline",
163
+ {
164
+ fill: f,
165
+ strokeLinejoin: "round",
166
+ points: `${s * 0.5},${-s * 0.7} ${-s * 0.1},0 ${s * 0.5},${s * 0.7}`
167
+ }
168
+ ),
169
+ /* @__PURE__ */ jsxRuntime.jsx(
170
+ "polyline",
171
+ {
172
+ fill: f,
173
+ strokeLinejoin: "round",
174
+ points: `${s},${-s * 0.7} ${s * 0.4},0 ${s},${s * 0.7}`
175
+ }
176
+ ),
177
+ filled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
178
+ /* @__PURE__ */ jsxRuntime.jsx("polygon", { fill: stroke, points: `${s * 0.5},${-s * 0.7} ${-s * 0.1},0 ${s * 0.5},${s * 0.7}` }),
179
+ /* @__PURE__ */ jsxRuntime.jsx("polygon", { fill: stroke, points: `${s},${-s * 0.7} ${s * 0.4},0 ${s},${s * 0.7}` })
180
+ ] })
181
+ ] }),
182
+ trigger === "signal" && /* @__PURE__ */ jsxRuntime.jsx(
183
+ "polygon",
184
+ {
185
+ points: `0,${-s} ${s * 0.9},${s * 0.7} ${-s * 0.9},${s * 0.7}`,
186
+ fill: f,
187
+ stroke,
188
+ strokeWidth: sw
189
+ }
190
+ ),
191
+ trigger === "cancel" && // X mark
192
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: sw * 1.5, strokeLinecap: "round", fill: "none", children: [
193
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.7, y1: -s * 0.7, x2: s * 0.7, y2: s * 0.7 }),
194
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: s * 0.7, y1: -s * 0.7, x2: -s * 0.7, y2: s * 0.7 })
195
+ ] }),
196
+ trigger === "terminate" && /* @__PURE__ */ jsxRuntime.jsx("circle", { r: s * 0.8, fill: stroke, stroke, strokeWidth: sw }),
197
+ trigger === "multiple" && /* @__PURE__ */ jsxRuntime.jsx("path", { d: pentagon(s * 0.9), fill: f, stroke, strokeWidth: sw }),
198
+ trigger === "parallelMultiple" && /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: sw * 1.5, strokeLinecap: "round", fill: "none", children: [
199
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 0, y1: -s * 0.8, x2: 0, y2: s * 0.8 }),
200
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.8, y1: 0, x2: s * 0.8, y2: 0 })
201
+ ] })
202
+ ] });
203
+ }
204
+ var SIZE = 36;
205
+ var CX = SIZE / 2;
206
+ var R = CX - 2;
207
+ function StartEventNode({ data, selected }) {
208
+ const d = data;
209
+ const stroke = resolveStroke(selected, d.color?.stroke);
210
+ const sw = resolveStrokeWidth(selected);
211
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
212
+ const trigger = d.trigger ?? "none";
213
+ const dashArray = d.isNonInterrupting ? "4 2" : void 0;
214
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: SIZE, height: SIZE, position: "relative" }, children: [
215
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: SIZE, height: SIZE, style: { overflow: "visible", display: "block" }, children: [
216
+ /* @__PURE__ */ jsxRuntime.jsx(
217
+ "circle",
218
+ {
219
+ cx: CX,
220
+ cy: CX,
221
+ r: R,
222
+ fill,
223
+ stroke,
224
+ strokeWidth: sw,
225
+ strokeDasharray: dashArray
226
+ }
227
+ ),
228
+ /* @__PURE__ */ jsxRuntime.jsx(EventMarker, { cx: CX, cy: CX, trigger, filled: false, stroke, bg: fill, r: R * 0.55 })
229
+ ] }),
230
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "source" }),
231
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
232
+ ] });
233
+ }
234
+ var SIZE2 = 36;
235
+ var CX2 = SIZE2 / 2;
236
+ var R2 = CX2 - 2;
237
+ function EndEventNode({ data, selected }) {
238
+ const d = data;
239
+ const stroke = resolveStroke(selected, d.color?.stroke);
240
+ const sw = resolveStrokeWidth(selected);
241
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
242
+ const trigger = d.trigger ?? "none";
243
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: SIZE2, height: SIZE2, position: "relative" }, children: [
244
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: SIZE2, height: SIZE2, style: { overflow: "visible", display: "block" }, children: [
245
+ /* @__PURE__ */ jsxRuntime.jsx(
246
+ "circle",
247
+ {
248
+ cx: CX2,
249
+ cy: CX2,
250
+ r: R2,
251
+ fill,
252
+ stroke,
253
+ strokeWidth: sw + 2
254
+ }
255
+ ),
256
+ /* @__PURE__ */ jsxRuntime.jsx(EventMarker, { cx: CX2, cy: CX2, trigger, filled: true, stroke, bg: fill, r: R2 * 0.55 })
257
+ ] }),
258
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "target" }),
259
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
260
+ ] });
261
+ }
262
+ var SIZE3 = 36;
263
+ var CX3 = SIZE3 / 2;
264
+ var R_OUTER = CX3 - 2;
265
+ var R_INNER = R_OUTER - 3;
266
+ var ICON_R = R_INNER * 0.65;
267
+ function IntermediateCatchEventNode({ data, selected }) {
268
+ const d = data;
269
+ const stroke = resolveStroke(selected, d.color?.stroke);
270
+ const sw = resolveStrokeWidth(selected);
271
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
272
+ const trigger = d.trigger ?? "none";
273
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: SIZE3, height: SIZE3, position: "relative" }, children: [
274
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: SIZE3, height: SIZE3, style: { overflow: "visible", display: "block" }, children: [
275
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: CX3, cy: CX3, r: R_OUTER, fill, stroke, strokeWidth: sw }),
276
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: CX3, cy: CX3, r: R_INNER, fill: "none", stroke, strokeWidth: sw }),
277
+ /* @__PURE__ */ jsxRuntime.jsx(EventMarker, { cx: CX3, cy: CX3, trigger, filled: false, stroke, bg: fill, r: ICON_R })
278
+ ] }),
279
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
280
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
281
+ ] });
282
+ }
283
+ function IntermediateThrowEventNode({ data, selected }) {
284
+ const d = data;
285
+ const stroke = resolveStroke(selected, d.color?.stroke);
286
+ const sw = resolveStrokeWidth(selected);
287
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
288
+ const trigger = d.trigger ?? "none";
289
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: SIZE3, height: SIZE3, position: "relative" }, children: [
290
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: SIZE3, height: SIZE3, style: { overflow: "visible", display: "block" }, children: [
291
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: CX3, cy: CX3, r: R_OUTER, fill, stroke, strokeWidth: sw }),
292
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: CX3, cy: CX3, r: R_INNER, fill: stroke, stroke, strokeWidth: sw }),
293
+ /* @__PURE__ */ jsxRuntime.jsx(EventMarker, { cx: CX3, cy: CX3, trigger, filled: true, stroke: fill, bg: stroke, r: ICON_R })
294
+ ] }),
295
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
296
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
297
+ ] });
298
+ }
299
+ function BoundaryEventNode({ data, selected }) {
300
+ const d = data;
301
+ const stroke = resolveStroke(selected, d.color?.stroke);
302
+ const sw = resolveStrokeWidth(selected);
303
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
304
+ const trigger = d.trigger ?? "none";
305
+ const dashArray = d.isNonInterrupting ? "4 2" : void 0;
306
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: SIZE3, height: SIZE3, position: "relative" }, children: [
307
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: SIZE3, height: SIZE3, style: { overflow: "visible", display: "block" }, children: [
308
+ /* @__PURE__ */ jsxRuntime.jsx(
309
+ "circle",
310
+ {
311
+ cx: CX3,
312
+ cy: CX3,
313
+ r: R_OUTER,
314
+ fill,
315
+ stroke,
316
+ strokeWidth: sw,
317
+ strokeDasharray: dashArray
318
+ }
319
+ ),
320
+ /* @__PURE__ */ jsxRuntime.jsx(
321
+ "circle",
322
+ {
323
+ cx: CX3,
324
+ cy: CX3,
325
+ r: R_INNER,
326
+ fill: "none",
327
+ stroke,
328
+ strokeWidth: sw,
329
+ strokeDasharray: dashArray
330
+ }
331
+ ),
332
+ /* @__PURE__ */ jsxRuntime.jsx(EventMarker, { cx: CX3, cy: CX3, trigger, filled: false, stroke, bg: fill, r: ICON_R })
333
+ ] }),
334
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "source" }),
335
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
336
+ ] });
337
+ }
338
+ function TaskIcon({ type, size = 14, color = "#404040" }) {
339
+ const s = size;
340
+ const c = color;
341
+ switch (type) {
342
+ case "UserTask":
343
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: [
344
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "5", r: "3", stroke: c, strokeWidth: "1.5" }),
345
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 14c0-3.3 2.7-6 6-6s6 2.7 6 6", stroke: c, strokeWidth: "1.5", strokeLinecap: "round" })
346
+ ] });
347
+ case "ServiceTask":
348
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: [
349
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "2.5", stroke: c, strokeWidth: "1.5" }),
350
+ /* @__PURE__ */ jsxRuntime.jsx(
351
+ "path",
352
+ {
353
+ d: "M8 1v2M8 13v2M1 8h2M13 8h2M3.2 3.2l1.4 1.4M11.4 11.4l1.4 1.4M3.2 12.8l1.4-1.4M11.4 4.6l1.4-1.4",
354
+ stroke: c,
355
+ strokeWidth: "1.5",
356
+ strokeLinecap: "round"
357
+ }
358
+ )
359
+ ] });
360
+ case "ScriptTask":
361
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: [
362
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "2", width: "10", height: "12", rx: "1", stroke: c, strokeWidth: "1.5" }),
363
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 6h4M6 9h4M6 12h2", stroke: c, strokeWidth: "1.5", strokeLinecap: "round" })
364
+ ] });
365
+ case "ManualTask":
366
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
367
+ "path",
368
+ {
369
+ d: "M5 10V6a1 1 0 0 1 2 0v2a1 1 0 0 1 2 0v1a1 1 0 0 1 2 0v2c0 1.7-1.3 3-3 3H6a3 3 0 0 1-3-3V9.5",
370
+ stroke: c,
371
+ strokeWidth: "1.5",
372
+ strokeLinecap: "round",
373
+ strokeLinejoin: "round"
374
+ }
375
+ ) });
376
+ case "BusinessRuleTask":
377
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: [
378
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "3", width: "12", height: "10", rx: "1", stroke: c, strokeWidth: "1.5" }),
379
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 7h12M6 3v10", stroke: c, strokeWidth: "1.5" })
380
+ ] });
381
+ case "ReceiveTask":
382
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: [
383
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2", y: "4", width: "12", height: "8", rx: "1", stroke: c, strokeWidth: "1.5" }),
384
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 4l6 5 6-5", stroke: c, strokeWidth: "1.5", strokeLinecap: "round" })
385
+ ] });
386
+ case "SendTask":
387
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: c, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4zm1 0l5 4.5L13 4H3z" }) });
388
+ case "CallActivity":
389
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: s, height: s, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "5", width: "10", height: "6", rx: "1", stroke: c, strokeWidth: "2" }) });
390
+ default:
391
+ return null;
392
+ }
393
+ }
394
+ var MARKER_SIZE = 12;
395
+ var GAP = 3;
396
+ function TaskMarkers({ markers, stroke, size = MARKER_SIZE }) {
397
+ if (!markers || markers.length === 0) return null;
398
+ const total = markers.length * size + (markers.length - 1) * GAP;
399
+ return /* @__PURE__ */ jsxRuntime.jsx(
400
+ "div",
401
+ {
402
+ style: {
403
+ position: "absolute",
404
+ bottom: 5,
405
+ left: "50%",
406
+ transform: "translateX(-50%)",
407
+ display: "flex",
408
+ alignItems: "center",
409
+ gap: GAP,
410
+ width: total
411
+ },
412
+ children: markers.map((m) => /* @__PURE__ */ jsxRuntime.jsx(MarkerIcon, { marker: m, stroke, size }, m))
413
+ }
414
+ );
415
+ }
416
+ function MarkerIcon({ marker, stroke, size }) {
417
+ const s = size / 2;
418
+ const sw = 1.3;
419
+ return /* @__PURE__ */ jsxRuntime.jsxs(
420
+ "svg",
421
+ {
422
+ width: size,
423
+ height: size,
424
+ viewBox: `${-s} ${-s} ${size} ${size}`,
425
+ style: { overflow: "visible", display: "block" },
426
+ children: [
427
+ marker === "loop" && // Circular arrow (↻)
428
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke, strokeWidth: sw, strokeLinecap: "round", children: [
429
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: `M 0,${-s * 0.85} A ${s * 0.85},${s * 0.85} 0 1 1 ${s * 0.6},${s * 0.6}` }),
430
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: `${s * 0.2},${s * 0.9} ${s * 0.6},${s * 0.6} ${s * 0.95},${s}` })
431
+ ] }),
432
+ marker === "parallelMultiple" && // Three vertical bars |||
433
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: sw, strokeLinecap: "round", children: [
434
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.55, y1: -s * 0.75, x2: -s * 0.55, y2: s * 0.75 }),
435
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 0, y1: -s * 0.75, x2: 0, y2: s * 0.75 }),
436
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: s * 0.55, y1: -s * 0.75, x2: s * 0.55, y2: s * 0.75 })
437
+ ] }),
438
+ marker === "sequentialMultiple" && // Three horizontal bars ≡
439
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: sw, strokeLinecap: "round", children: [
440
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.75, y1: -s * 0.55, x2: s * 0.75, y2: -s * 0.55 }),
441
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.75, y1: 0, x2: s * 0.75, y2: 0 }),
442
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: -s * 0.75, y1: s * 0.55, x2: s * 0.75, y2: s * 0.55 })
443
+ ] }),
444
+ marker === "compensation" && // Two left-pointing triangles <<
445
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: stroke, stroke, strokeWidth: 0.5, strokeLinejoin: "round", children: [
446
+ /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: `${s * 0.4},${-s * 0.7} ${-s * 0.2},0 ${s * 0.4},${s * 0.7}` }),
447
+ /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: `${s},${-s * 0.7} ${s * 0.4},0 ${s},${s * 0.7}` })
448
+ ] })
449
+ ]
450
+ }
451
+ );
452
+ }
453
+ function AdhocMarker({ stroke, size = MARKER_SIZE }) {
454
+ return /* @__PURE__ */ jsxRuntime.jsx(
455
+ "div",
456
+ {
457
+ style: {
458
+ position: "absolute",
459
+ bottom: 5,
460
+ left: "50%",
461
+ transform: "translateX(-50%)",
462
+ color: stroke,
463
+ fontSize: size,
464
+ lineHeight: 1,
465
+ fontFamily: "serif",
466
+ userSelect: "none"
467
+ },
468
+ children: "~"
469
+ }
470
+ );
471
+ }
472
+ function TaskNode({ data, selected }) {
473
+ const d = data;
474
+ const stroke = resolveStroke(selected, d.color?.stroke);
475
+ const sw = resolveStrokeWidth(selected);
476
+ const hasMarkers = d.markers && d.markers.length > 0;
477
+ const borderWidth = d.elementType === "CallActivity" ? sw + 2 : sw;
478
+ return /* @__PURE__ */ jsxRuntime.jsxs(
479
+ "div",
480
+ {
481
+ style: {
482
+ width: "100%",
483
+ height: "100%",
484
+ background: d.color?.fill ?? BPMN_THEME.fill,
485
+ border: `${borderWidth}px solid ${stroke}`,
486
+ borderRadius: 6,
487
+ boxSizing: "border-box",
488
+ display: "flex",
489
+ flexDirection: "column",
490
+ alignItems: "center",
491
+ justifyContent: "center",
492
+ padding: hasMarkers ? "4px 8px 22px" : "4px 8px",
493
+ position: "relative",
494
+ fontFamily: BPMN_THEME.fontFamily
495
+ },
496
+ children: [
497
+ d.elementType && d.elementType !== "Task" && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "absolute", top: 5, left: 5 }, children: /* @__PURE__ */ jsxRuntime.jsx(TaskIcon, { type: d.elementType, size: 14, color: stroke }) }),
498
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { style: { width: "100%" }, children: d.label ?? d.elementType }),
499
+ d.priority && /* @__PURE__ */ jsxRuntime.jsx(
500
+ "div",
501
+ {
502
+ title: d.priority,
503
+ style: {
504
+ position: "absolute",
505
+ top: 5,
506
+ right: 5,
507
+ width: 8,
508
+ height: 8,
509
+ borderRadius: "50%",
510
+ background: PRIORITY_COLOR[d.priority]
511
+ }
512
+ }
513
+ ),
514
+ hasMarkers && /* @__PURE__ */ jsxRuntime.jsx(TaskMarkers, { markers: d.markers, stroke }),
515
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" })
516
+ ]
517
+ }
518
+ );
519
+ }
520
+ var PRIORITY_COLOR = {
521
+ critical: "#ef4444",
522
+ high: "#f97316",
523
+ medium: "#eab308",
524
+ low: "#22c55e"
525
+ };
526
+ var SIZE4 = 50;
527
+ var H = SIZE4 / 2;
528
+ var DIAMOND = `${H},2 ${SIZE4 - 2},${H} ${H},${SIZE4 - 2} 2,${H}`;
529
+ function GatewaySymbol({ type, stroke }) {
530
+ const c = H;
531
+ switch (type) {
532
+ case "ExclusiveGateway":
533
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: "2.5", strokeLinecap: "round", children: [
534
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c - 7, y1: c - 7, x2: c + 7, y2: c + 7 }),
535
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c + 7, y1: c - 7, x2: c - 7, y2: c + 7 })
536
+ ] });
537
+ case "InclusiveGateway":
538
+ return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: c, cy: c, r: 8, fill: "none", stroke, strokeWidth: "2" });
539
+ case "ParallelGateway":
540
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: "2.5", strokeLinecap: "round", children: [
541
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c, y1: c - 9, x2: c, y2: c + 9 }),
542
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c - 9, y1: c, x2: c + 9, y2: c })
543
+ ] });
544
+ case "EventBasedGateway":
545
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
546
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: c, cy: c, r: 9, fill: "none", stroke, strokeWidth: "1.5" }),
547
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: c, cy: c, r: 6, fill: "none", stroke, strokeWidth: "1.2" }),
548
+ /* @__PURE__ */ jsxRuntime.jsx(
549
+ "polygon",
550
+ {
551
+ points: `${c},${c - 5.5} ${c + 5.2},${c - 1.7} ${c + 3.2},${c + 4.8} ${c - 3.2},${c + 4.8} ${c - 5.2},${c - 1.7}`,
552
+ fill: "none",
553
+ stroke,
554
+ strokeWidth: "1.4",
555
+ strokeLinejoin: "round"
556
+ }
557
+ )
558
+ ] });
559
+ case "ComplexGateway":
560
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: "2", strokeLinecap: "round", children: [
561
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c, y1: c - 9, x2: c, y2: c + 9 }),
562
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c - 9, y1: c, x2: c + 9, y2: c }),
563
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c - 6, y1: c - 6, x2: c + 6, y2: c + 6 }),
564
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: c + 6, y1: c - 6, x2: c - 6, y2: c + 6 })
565
+ ] });
566
+ default:
567
+ return null;
568
+ }
569
+ }
570
+ function GatewayNode({ data, selected }) {
571
+ const d = data;
572
+ const stroke = resolveStroke(selected, d.color?.stroke);
573
+ const sw = resolveStrokeWidth(selected);
574
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: SIZE4, height: SIZE4, position: "relative" }, children: [
575
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: SIZE4, height: SIZE4, style: { overflow: "visible", display: "block" }, children: [
576
+ /* @__PURE__ */ jsxRuntime.jsx(
577
+ "polygon",
578
+ {
579
+ points: DIAMOND,
580
+ fill: d.color?.fill ?? BPMN_THEME.fill,
581
+ stroke,
582
+ strokeWidth: sw
583
+ }
584
+ ),
585
+ /* @__PURE__ */ jsxRuntime.jsx(GatewaySymbol, { type: d.elementType, stroke })
586
+ ] }),
587
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
588
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
589
+ ] });
590
+ }
591
+ function SubProcessNode({ data, selected }) {
592
+ const d = data;
593
+ const stroke = resolveStroke(selected, d.color?.stroke);
594
+ const sw = resolveStrokeWidth(selected);
595
+ const variant = d.subProcessVariant ?? "embedded";
596
+ const isExpanded = d.isExpanded ?? true;
597
+ const hasMarkers = d.markers && d.markers.length > 0;
598
+ const borderStyle = variant === "event" ? "dashed" : "solid";
599
+ return /* @__PURE__ */ jsxRuntime.jsxs(
600
+ "div",
601
+ {
602
+ style: {
603
+ width: "100%",
604
+ height: "100%",
605
+ background: d.color?.fill ?? "#f8faff",
606
+ border: `${sw}px ${borderStyle} ${stroke}`,
607
+ borderRadius: 6,
608
+ boxSizing: "border-box",
609
+ position: "relative",
610
+ fontFamily: BPMN_THEME.fontFamily
611
+ },
612
+ children: [
613
+ variant === "transaction" && /* @__PURE__ */ jsxRuntime.jsx(
614
+ "div",
615
+ {
616
+ style: {
617
+ position: "absolute",
618
+ inset: 4,
619
+ border: `${sw}px solid ${stroke}`,
620
+ borderRadius: 4,
621
+ pointerEvents: "none"
622
+ }
623
+ }
624
+ ),
625
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { style: { padding: "4px 8px" }, children: d.label }),
626
+ !isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
627
+ "div",
628
+ {
629
+ "aria-label": "collapsed-subprocess-marker",
630
+ style: {
631
+ position: "absolute",
632
+ bottom: 6,
633
+ left: "50%",
634
+ transform: "translateX(-50%)",
635
+ width: 16,
636
+ height: 16,
637
+ border: `1.5px solid ${stroke}`,
638
+ borderRadius: 2,
639
+ display: "flex",
640
+ alignItems: "center",
641
+ justifyContent: "center",
642
+ fontSize: 12,
643
+ color: stroke,
644
+ background: BPMN_THEME.fill,
645
+ zIndex: 1
646
+ },
647
+ children: "+"
648
+ }
649
+ ),
650
+ variant === "adhoc" && /* @__PURE__ */ jsxRuntime.jsx(AdhocMarker, { stroke }),
651
+ hasMarkers && /* @__PURE__ */ jsxRuntime.jsx(TaskMarkers, { markers: d.markers, stroke }),
652
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" })
653
+ ]
654
+ }
655
+ );
656
+ }
657
+ var HEADER_WIDTH = 30;
658
+ var HEADER_HEIGHT = 28;
659
+ function PoolNode({ data, selected }) {
660
+ const d = data;
661
+ const stroke = resolveStroke(selected, d.color?.stroke);
662
+ const sw = resolveStrokeWidth(selected);
663
+ const orientation = d.orientation ?? "horizontal";
664
+ const fill = d.color?.fill ?? "#f5f7ff";
665
+ const headerFill = d.color?.fill ?? "#edf0ff";
666
+ if (orientation === "vertical") {
667
+ return /* @__PURE__ */ jsxRuntime.jsxs(
668
+ "div",
669
+ {
670
+ style: {
671
+ width: "100%",
672
+ height: "100%",
673
+ display: "flex",
674
+ flexDirection: "column",
675
+ border: `${sw}px solid ${stroke}`,
676
+ borderRadius: 4,
677
+ boxSizing: "border-box",
678
+ background: fill,
679
+ overflow: "hidden",
680
+ fontFamily: BPMN_THEME.fontFamily
681
+ },
682
+ children: [
683
+ /* @__PURE__ */ jsxRuntime.jsx(
684
+ "div",
685
+ {
686
+ "aria-label": "pool-header",
687
+ style: {
688
+ height: HEADER_HEIGHT,
689
+ minHeight: HEADER_HEIGHT,
690
+ borderBottom: `${sw}px solid ${stroke}`,
691
+ display: "flex",
692
+ alignItems: "center",
693
+ justifyContent: "center",
694
+ background: headerFill,
695
+ padding: "0 8px"
696
+ },
697
+ children: /* @__PURE__ */ jsxRuntime.jsx(
698
+ "span",
699
+ {
700
+ style: {
701
+ fontSize: BPMN_THEME.fontSize,
702
+ fontWeight: 600,
703
+ color: BPMN_THEME.labelColor,
704
+ whiteSpace: "nowrap",
705
+ overflow: "hidden",
706
+ textOverflow: "ellipsis"
707
+ },
708
+ children: d.label
709
+ }
710
+ )
711
+ }
712
+ ),
713
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
714
+ ]
715
+ }
716
+ );
717
+ }
718
+ return /* @__PURE__ */ jsxRuntime.jsxs(
719
+ "div",
720
+ {
721
+ style: {
722
+ width: "100%",
723
+ height: "100%",
724
+ display: "flex",
725
+ border: `${sw}px solid ${stroke}`,
726
+ borderRadius: 4,
727
+ boxSizing: "border-box",
728
+ background: fill,
729
+ overflow: "hidden",
730
+ fontFamily: BPMN_THEME.fontFamily
731
+ },
732
+ children: [
733
+ /* @__PURE__ */ jsxRuntime.jsx(
734
+ "div",
735
+ {
736
+ "aria-label": "pool-header",
737
+ style: {
738
+ width: HEADER_WIDTH,
739
+ minWidth: HEADER_WIDTH,
740
+ borderRight: `${sw}px solid ${stroke}`,
741
+ display: "flex",
742
+ alignItems: "center",
743
+ justifyContent: "center",
744
+ background: headerFill
745
+ },
746
+ children: /* @__PURE__ */ jsxRuntime.jsx(
747
+ "span",
748
+ {
749
+ style: {
750
+ writingMode: "vertical-rl",
751
+ transform: "rotate(180deg)",
752
+ fontSize: BPMN_THEME.fontSize,
753
+ fontWeight: 600,
754
+ color: BPMN_THEME.labelColor,
755
+ whiteSpace: "nowrap",
756
+ overflow: "hidden",
757
+ textOverflow: "ellipsis",
758
+ maxHeight: "90%"
759
+ },
760
+ children: d.label
761
+ }
762
+ )
763
+ }
764
+ ),
765
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
766
+ ]
767
+ }
768
+ );
769
+ }
770
+ var HEADER_HEIGHT2 = 24;
771
+ var HEADER_WIDTH2 = 28;
772
+ function LaneNode({ data, selected }) {
773
+ const d = data;
774
+ const stroke = resolveStroke(selected, d.color?.stroke);
775
+ const sw = resolveStrokeWidth(selected);
776
+ const orientation = d.orientation ?? "horizontal";
777
+ const fill = d.color?.fill ?? "#fafbff";
778
+ const headerFill = d.color?.fill ?? "#f0f3ff";
779
+ if (orientation === "vertical") {
780
+ return /* @__PURE__ */ jsxRuntime.jsxs(
781
+ "div",
782
+ {
783
+ style: {
784
+ width: "100%",
785
+ height: "100%",
786
+ display: "flex",
787
+ border: `${sw}px solid ${stroke}`,
788
+ borderRadius: 2,
789
+ boxSizing: "border-box",
790
+ background: fill,
791
+ overflow: "hidden",
792
+ fontFamily: BPMN_THEME.fontFamily
793
+ },
794
+ children: [
795
+ /* @__PURE__ */ jsxRuntime.jsx(
796
+ "div",
797
+ {
798
+ "aria-label": "lane-header",
799
+ style: {
800
+ width: HEADER_WIDTH2,
801
+ minWidth: HEADER_WIDTH2,
802
+ borderRight: `1px solid ${stroke}`,
803
+ display: "flex",
804
+ alignItems: "center",
805
+ justifyContent: "center",
806
+ background: headerFill,
807
+ padding: "6px 0"
808
+ },
809
+ children: /* @__PURE__ */ jsxRuntime.jsx(
810
+ "span",
811
+ {
812
+ style: {
813
+ writingMode: "vertical-rl",
814
+ transform: "rotate(180deg)",
815
+ fontSize: BPMN_THEME.fontSize,
816
+ fontWeight: 500,
817
+ color: BPMN_THEME.labelColor,
818
+ whiteSpace: "nowrap",
819
+ overflow: "hidden",
820
+ textOverflow: "ellipsis",
821
+ maxHeight: "90%"
822
+ },
823
+ children: d.label
824
+ }
825
+ )
826
+ }
827
+ ),
828
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
829
+ ]
830
+ }
831
+ );
832
+ }
833
+ return /* @__PURE__ */ jsxRuntime.jsxs(
834
+ "div",
835
+ {
836
+ style: {
837
+ width: "100%",
838
+ height: "100%",
839
+ display: "flex",
840
+ flexDirection: "column",
841
+ border: `${sw}px solid ${stroke}`,
842
+ borderRadius: 2,
843
+ boxSizing: "border-box",
844
+ background: fill,
845
+ overflow: "hidden",
846
+ fontFamily: BPMN_THEME.fontFamily
847
+ },
848
+ children: [
849
+ /* @__PURE__ */ jsxRuntime.jsx(
850
+ "div",
851
+ {
852
+ "aria-label": "lane-header",
853
+ style: {
854
+ height: HEADER_HEIGHT2,
855
+ minHeight: HEADER_HEIGHT2,
856
+ borderBottom: `1px solid ${stroke}`,
857
+ display: "flex",
858
+ alignItems: "center",
859
+ paddingLeft: 8,
860
+ background: headerFill,
861
+ fontSize: BPMN_THEME.fontSize,
862
+ fontWeight: 500,
863
+ color: BPMN_THEME.labelColor
864
+ },
865
+ children: d.label
866
+ }
867
+ ),
868
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, position: "relative" } })
869
+ ]
870
+ }
871
+ );
872
+ }
873
+ var HANDLE_STYLE2 = { opacity: 0, width: 6, height: 6 };
874
+ function AnnotationNode({ data, selected }) {
875
+ const d = data;
876
+ const stroke = resolveStroke(selected, d.color?.stroke);
877
+ const sw = resolveStrokeWidth(selected);
878
+ const orientation = d.orientation ?? "vertical";
879
+ if (orientation === "horizontal") {
880
+ return /* @__PURE__ */ jsxRuntime.jsxs(
881
+ "div",
882
+ {
883
+ style: {
884
+ width: "100%",
885
+ height: "100%",
886
+ boxSizing: "border-box",
887
+ borderTop: `${sw + 1}px solid ${stroke}`,
888
+ borderLeft: `${sw}px solid ${stroke}`,
889
+ borderRight: `${sw}px solid ${stroke}`,
890
+ padding: "8px 6px",
891
+ background: "transparent",
892
+ fontFamily: BPMN_THEME.fontFamily,
893
+ fontSize: BPMN_THEME.fontSize,
894
+ color: BPMN_THEME.labelColor,
895
+ lineHeight: 1.4
896
+ },
897
+ children: [
898
+ d.label,
899
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Left, id: "target-left", style: HANDLE_STYLE2 }),
900
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Right, id: "target-right", style: HANDLE_STYLE2 }),
901
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "source", position: react.Position.Left, id: "source-left", style: HANDLE_STYLE2 }),
902
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "source", position: react.Position.Right, id: "source-right", style: HANDLE_STYLE2 })
903
+ ]
904
+ }
905
+ );
906
+ }
907
+ return /* @__PURE__ */ jsxRuntime.jsxs(
908
+ "div",
909
+ {
910
+ style: {
911
+ width: "100%",
912
+ height: "100%",
913
+ boxSizing: "border-box",
914
+ borderLeft: `${sw + 1}px solid ${stroke}`,
915
+ borderTop: `${sw}px solid ${stroke}`,
916
+ borderBottom: `${sw}px solid ${stroke}`,
917
+ padding: "4px 8px",
918
+ background: "transparent",
919
+ fontFamily: BPMN_THEME.fontFamily,
920
+ fontSize: BPMN_THEME.fontSize,
921
+ color: BPMN_THEME.labelColor,
922
+ lineHeight: 1.4
923
+ },
924
+ children: [
925
+ d.label,
926
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Top, id: "target-top", style: HANDLE_STYLE2 }),
927
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "target", position: react.Position.Bottom, id: "target-bottom", style: HANDLE_STYLE2 }),
928
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "source", position: react.Position.Top, id: "source-top", style: HANDLE_STYLE2 }),
929
+ /* @__PURE__ */ jsxRuntime.jsx(react.Handle, { type: "source", position: react.Position.Bottom, id: "source-bottom", style: HANDLE_STYLE2 })
930
+ ]
931
+ }
932
+ );
933
+ }
934
+ function GroupNode({ data, selected }) {
935
+ const d = data;
936
+ const stroke = resolveStroke(selected, d.color?.stroke);
937
+ const sw = resolveStrokeWidth(selected);
938
+ return /* @__PURE__ */ jsxRuntime.jsx(
939
+ "div",
940
+ {
941
+ style: {
942
+ width: "100%",
943
+ height: "100%",
944
+ border: `${sw}px dashed ${stroke}`,
945
+ borderRadius: 8,
946
+ boxSizing: "border-box",
947
+ background: "transparent",
948
+ padding: "4px 8px",
949
+ fontFamily: BPMN_THEME.fontFamily,
950
+ fontSize: BPMN_THEME.fontSize,
951
+ color: BPMN_THEME.labelColor,
952
+ fontStyle: "italic"
953
+ },
954
+ children: d.label
955
+ }
956
+ );
957
+ }
958
+ var W = 36;
959
+ var H2 = 50;
960
+ var FOLD = 10;
961
+ function DataObjectNode({ data, selected }) {
962
+ const d = data;
963
+ const stroke = resolveStroke(selected, d.color?.stroke);
964
+ const sw = resolveStrokeWidth(selected);
965
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
966
+ const path = [
967
+ `M 0 0`,
968
+ `L ${W - FOLD} 0`,
969
+ `L ${W} ${FOLD}`,
970
+ `L ${W} ${H2}`,
971
+ `L 0 ${H2}`,
972
+ `Z`
973
+ ].join(" ");
974
+ const foldPath2 = [
975
+ `M ${W - FOLD} 0`,
976
+ `L ${W - FOLD} ${FOLD}`,
977
+ `L ${W} ${FOLD}`
978
+ ].join(" ");
979
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W, height: H2, position: "relative" }, children: [
980
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: W, height: H2, style: { overflow: "visible", display: "block" }, children: [
981
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: path, fill, stroke, strokeWidth: sw }),
982
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath2, fill: "none", stroke, strokeWidth: sw })
983
+ ] }),
984
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
985
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
986
+ ] });
987
+ }
988
+ var DS_W = 50;
989
+ var DS_H = 50;
990
+ var RX = DS_W / 2;
991
+ var RY = 7;
992
+ function DataStoreNode({ data, selected }) {
993
+ const d = data;
994
+ const stroke = resolveStroke(selected, d.color?.stroke);
995
+ const sw = resolveStrokeWidth(selected);
996
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
997
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: DS_W, height: DS_H, position: "relative" }, children: [
998
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: DS_W, height: DS_H, style: { overflow: "visible", display: "block" }, children: [
999
+ /* @__PURE__ */ jsxRuntime.jsx(
1000
+ "path",
1001
+ {
1002
+ d: `M 0 ${RY} Q 0 0 ${RX} 0 Q ${DS_W} 0 ${DS_W} ${RY} L ${DS_W} ${DS_H - RY} Q ${DS_W} ${DS_H} ${RX} ${DS_H} Q 0 ${DS_H} 0 ${DS_H - RY} Z`,
1003
+ fill,
1004
+ stroke,
1005
+ strokeWidth: sw
1006
+ }
1007
+ ),
1008
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: RX, cy: RY, rx: RX, ry: RY, fill, stroke, strokeWidth: sw })
1009
+ ] }),
1010
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
1011
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
1012
+ ] });
1013
+ }
1014
+ var W2 = 36;
1015
+ var H3 = 50;
1016
+ var FOLD2 = 10;
1017
+ function documentPath() {
1018
+ return [
1019
+ `M 0 0`,
1020
+ `L ${W2 - FOLD2} 0`,
1021
+ `L ${W2} ${FOLD2}`,
1022
+ `L ${W2} ${H3}`,
1023
+ `L 0 ${H3}`,
1024
+ `Z`
1025
+ ].join(" ");
1026
+ }
1027
+ function foldPath() {
1028
+ return [`M ${W2 - FOLD2} 0`, `L ${W2 - FOLD2} ${FOLD2}`, `L ${W2} ${FOLD2}`].join(" ");
1029
+ }
1030
+ function collectionLines(stroke, sw) {
1031
+ const y = H3 - 8;
1032
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { stroke, strokeWidth: sw * 0.7, strokeLinecap: "round", children: [
1033
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: W2 * 0.25, y1: y, x2: W2 * 0.75, y2: y }),
1034
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: W2 * 0.25, y1: y + 3, x2: W2 * 0.75, y2: y + 3 }),
1035
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: W2 * 0.25, y1: y + 6, x2: W2 * 0.75, y2: y + 6 })
1036
+ ] });
1037
+ }
1038
+ function DataObjectReferenceNode({ data, selected }) {
1039
+ const d = data;
1040
+ const stroke = resolveStroke(selected, d.color?.stroke);
1041
+ const sw = resolveStrokeWidth(selected);
1042
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1043
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W2, height: H3, position: "relative" }, children: [
1044
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: W2, height: H3, style: { overflow: "visible", display: "block" }, children: [
1045
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: documentPath(), fill, stroke, strokeWidth: sw }),
1046
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath(), fill: "none", stroke, strokeWidth: sw }),
1047
+ d.isCollection && collectionLines(stroke, sw)
1048
+ ] }),
1049
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
1050
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
1051
+ ] });
1052
+ }
1053
+ function DataInputNode({ data, selected }) {
1054
+ const d = data;
1055
+ const stroke = resolveStroke(selected, d.color?.stroke);
1056
+ const sw = resolveStrokeWidth(selected);
1057
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1058
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W2, height: H3, position: "relative" }, children: [
1059
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: W2, height: H3, style: { overflow: "visible", display: "block" }, children: [
1060
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: documentPath(), fill, stroke, strokeWidth: sw }),
1061
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath(), fill: "none", stroke, strokeWidth: sw }),
1062
+ /* @__PURE__ */ jsxRuntime.jsx(
1063
+ "polygon",
1064
+ {
1065
+ points: `2,4 8,8 2,12`,
1066
+ fill: "none",
1067
+ stroke,
1068
+ strokeWidth: sw * 0.8
1069
+ }
1070
+ ),
1071
+ d.isCollection && collectionLines(stroke, sw)
1072
+ ] }),
1073
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "target" }),
1074
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
1075
+ ] });
1076
+ }
1077
+ function DataOutputNode({ data, selected }) {
1078
+ const d = data;
1079
+ const stroke = resolveStroke(selected, d.color?.stroke);
1080
+ const sw = resolveStrokeWidth(selected);
1081
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1082
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W2, height: H3, position: "relative" }, children: [
1083
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: W2, height: H3, style: { overflow: "visible", display: "block" }, children: [
1084
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: documentPath(), fill, stroke, strokeWidth: sw }),
1085
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: foldPath(), fill: "none", stroke, strokeWidth: sw }),
1086
+ /* @__PURE__ */ jsxRuntime.jsx(
1087
+ "polygon",
1088
+ {
1089
+ points: `2,4 8,8 2,12`,
1090
+ fill: stroke,
1091
+ stroke,
1092
+ strokeWidth: sw * 0.8
1093
+ }
1094
+ ),
1095
+ d.isCollection && collectionLines(stroke, sw)
1096
+ ] }),
1097
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "source" }),
1098
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
1099
+ ] });
1100
+ }
1101
+ var DS_W2 = 50;
1102
+ var DS_H2 = 50;
1103
+ var RX2 = DS_W2 / 2;
1104
+ var RY2 = 7;
1105
+ function DataStoreReferenceNode({ data, selected }) {
1106
+ const d = data;
1107
+ const stroke = resolveStroke(selected, d.color?.stroke);
1108
+ const sw = resolveStrokeWidth(selected);
1109
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1110
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: DS_W2, height: DS_H2, position: "relative" }, children: [
1111
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: DS_W2, height: DS_H2, style: { overflow: "visible", display: "block" }, children: [
1112
+ /* @__PURE__ */ jsxRuntime.jsx(
1113
+ "path",
1114
+ {
1115
+ d: `M 0 ${RY2} Q 0 0 ${RX2} 0 Q ${DS_W2} 0 ${DS_W2} ${RY2} L ${DS_W2} ${DS_H2 - RY2} Q ${DS_W2} ${DS_H2} ${RX2} ${DS_H2} Q 0 ${DS_H2} 0 ${DS_H2 - RY2} Z`,
1116
+ fill,
1117
+ stroke,
1118
+ strokeWidth: sw
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: RX2, cy: RY2, rx: RX2, ry: RY2, fill, stroke, strokeWidth: sw })
1122
+ ] }),
1123
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
1124
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { external: true, children: d.label })
1125
+ ] });
1126
+ }
1127
+ var W3 = 60;
1128
+ var H4 = 52;
1129
+ var INDENT = W3 / 4;
1130
+ function hexPoints() {
1131
+ return [
1132
+ `0,${H4 / 2}`,
1133
+ `${INDENT},0`,
1134
+ `${W3 - INDENT},0`,
1135
+ `${W3},${H4 / 2}`,
1136
+ `${W3 - INDENT},${H4}`,
1137
+ `${INDENT},${H4}`
1138
+ ].join(" ");
1139
+ }
1140
+ function HexShell({
1141
+ fill,
1142
+ stroke,
1143
+ sw,
1144
+ thick = false
1145
+ }) {
1146
+ return /* @__PURE__ */ jsxRuntime.jsx(
1147
+ "polygon",
1148
+ {
1149
+ points: hexPoints(),
1150
+ fill,
1151
+ stroke,
1152
+ strokeWidth: thick ? sw + 2 : sw
1153
+ }
1154
+ );
1155
+ }
1156
+ function ConversationNode({ data, selected }) {
1157
+ const d = data;
1158
+ const stroke = resolveStroke(selected, d.color?.stroke);
1159
+ const sw = resolveStrokeWidth(selected);
1160
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1161
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W3, height: H4, position: "relative" }, children: [
1162
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: W3, height: H4, style: { overflow: "visible", display: "block" }, children: /* @__PURE__ */ jsxRuntime.jsx(HexShell, { fill, stroke, sw }) }),
1163
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
1164
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { style: { textAlign: "center" }, children: d.label })
1165
+ ] });
1166
+ }
1167
+ function SubConversationNode({ data, selected }) {
1168
+ const d = data;
1169
+ const stroke = resolveStroke(selected, d.color?.stroke);
1170
+ const sw = resolveStrokeWidth(selected);
1171
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1172
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W3, height: H4, position: "relative" }, children: [
1173
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: W3, height: H4, style: { overflow: "visible", display: "block" }, children: [
1174
+ /* @__PURE__ */ jsxRuntime.jsx(HexShell, { fill, stroke, sw }),
1175
+ /* @__PURE__ */ jsxRuntime.jsx(
1176
+ "rect",
1177
+ {
1178
+ x: W3 / 2 - 7,
1179
+ y: H4 - 15,
1180
+ width: 14,
1181
+ height: 12,
1182
+ rx: 2,
1183
+ fill,
1184
+ stroke,
1185
+ strokeWidth: sw * 0.8
1186
+ }
1187
+ ),
1188
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: W3 / 2, y: H4 - 6, textAnchor: "middle", fontSize: 10, fill: stroke, fontFamily: BPMN_THEME.fontFamily, children: "+" })
1189
+ ] }),
1190
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
1191
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { style: { textAlign: "center" }, children: d.label })
1192
+ ] });
1193
+ }
1194
+ function CallConversationNode({ data, selected }) {
1195
+ const d = data;
1196
+ const stroke = resolveStroke(selected, d.color?.stroke);
1197
+ const sw = resolveStrokeWidth(selected);
1198
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1199
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: W3, height: H4, position: "relative" }, children: [
1200
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: W3, height: H4, style: { overflow: "visible", display: "block" }, children: [
1201
+ /* @__PURE__ */ jsxRuntime.jsx(HexShell, { fill, stroke, sw, thick: true }),
1202
+ /* @__PURE__ */ jsxRuntime.jsx(
1203
+ "rect",
1204
+ {
1205
+ x: W3 / 2 - 7,
1206
+ y: H4 - 15,
1207
+ width: 14,
1208
+ height: 12,
1209
+ rx: 2,
1210
+ fill,
1211
+ stroke,
1212
+ strokeWidth: sw * 0.8
1213
+ }
1214
+ ),
1215
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: W3 / 2, y: H4 - 6, textAnchor: "middle", fontSize: 10, fill: stroke, fontFamily: BPMN_THEME.fontFamily, children: "+" })
1216
+ ] }),
1217
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" }),
1218
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnLabel, { style: { textAlign: "center" }, children: d.label })
1219
+ ] });
1220
+ }
1221
+ var BAND_H = 20;
1222
+ var RADIUS = 6;
1223
+ function ChoreographyShell({ d, stroke, sw, thick = false, collapsed = false }) {
1224
+ const participants = d.participants ?? [
1225
+ { name: "Initiator", isInitiating: true },
1226
+ { name: "Responder", isInitiating: false }
1227
+ ];
1228
+ const fill = d.color?.fill ?? BPMN_THEME.fill;
1229
+ const respondFill = "#c8d8e8";
1230
+ const bw = thick ? sw + 2 : sw;
1231
+ const [topParticipant, ...rest] = participants;
1232
+ const bottomParticipants = rest;
1233
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1234
+ /* @__PURE__ */ jsxRuntime.jsx(
1235
+ "rect",
1236
+ {
1237
+ x: 0,
1238
+ y: 0,
1239
+ width: "100%",
1240
+ height: BAND_H,
1241
+ fill: topParticipant.isInitiating ? fill : respondFill,
1242
+ stroke,
1243
+ strokeWidth: bw,
1244
+ rx: RADIUS,
1245
+ ry: RADIUS
1246
+ }
1247
+ ),
1248
+ /* @__PURE__ */ jsxRuntime.jsx(
1249
+ "rect",
1250
+ {
1251
+ x: 0,
1252
+ y: BAND_H / 2,
1253
+ width: "100%",
1254
+ height: BAND_H / 2,
1255
+ fill: topParticipant.isInitiating ? fill : respondFill,
1256
+ stroke: "none"
1257
+ }
1258
+ ),
1259
+ /* @__PURE__ */ jsxRuntime.jsx(
1260
+ "rect",
1261
+ {
1262
+ x: 0,
1263
+ y: BAND_H,
1264
+ width: "100%",
1265
+ height: `calc(100% - ${BAND_H * (1 + bottomParticipants.length)}px)`,
1266
+ fill,
1267
+ stroke,
1268
+ strokeWidth: bw
1269
+ }
1270
+ ),
1271
+ bottomParticipants.map((p, i) => {
1272
+ const y = `calc(100% - ${BAND_H * (bottomParticipants.length - i)}px)`;
1273
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsx(
1274
+ "rect",
1275
+ {
1276
+ x: 0,
1277
+ y,
1278
+ width: "100%",
1279
+ height: BAND_H,
1280
+ fill: p.isInitiating ? fill : respondFill,
1281
+ stroke,
1282
+ strokeWidth: bw
1283
+ }
1284
+ ) }, i);
1285
+ }),
1286
+ /* @__PURE__ */ jsxRuntime.jsx(
1287
+ "rect",
1288
+ {
1289
+ x: bw / 2,
1290
+ y: bw / 2,
1291
+ width: `calc(100% - ${bw}px)`,
1292
+ height: `calc(100% - ${bw}px)`,
1293
+ fill: "none",
1294
+ stroke,
1295
+ strokeWidth: bw,
1296
+ rx: RADIUS,
1297
+ ry: RADIUS
1298
+ }
1299
+ ),
1300
+ /* @__PURE__ */ jsxRuntime.jsx(
1301
+ "foreignObject",
1302
+ {
1303
+ x: 4,
1304
+ y: BAND_H,
1305
+ width: "calc(100% - 8px)",
1306
+ height: `calc(100% - ${BAND_H * (1 + bottomParticipants.length)}px)`,
1307
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1308
+ "div",
1309
+ {
1310
+ style: {
1311
+ width: "100%",
1312
+ height: "100%",
1313
+ display: "flex",
1314
+ alignItems: "center",
1315
+ justifyContent: "center",
1316
+ fontSize: BPMN_THEME.fontSize,
1317
+ fontFamily: BPMN_THEME.fontFamily,
1318
+ color: stroke,
1319
+ textAlign: "center",
1320
+ padding: "2px 4px",
1321
+ boxSizing: "border-box",
1322
+ overflow: "hidden"
1323
+ },
1324
+ children: d.label ?? ""
1325
+ }
1326
+ )
1327
+ }
1328
+ ),
1329
+ /* @__PURE__ */ jsxRuntime.jsx(
1330
+ "text",
1331
+ {
1332
+ x: "50%",
1333
+ y: BAND_H * 0.65,
1334
+ textAnchor: "middle",
1335
+ fontSize: BPMN_THEME.fontSize - 1,
1336
+ fontFamily: BPMN_THEME.fontFamily,
1337
+ fill: stroke,
1338
+ clipPath: void 0,
1339
+ children: topParticipant.name
1340
+ }
1341
+ ),
1342
+ bottomParticipants.map((p, i) => /* @__PURE__ */ jsxRuntime.jsx(
1343
+ "text",
1344
+ {
1345
+ x: "50%",
1346
+ y: `calc(100% - ${BAND_H * (bottomParticipants.length - i) - BAND_H * 0.35}px)`,
1347
+ textAnchor: "middle",
1348
+ fontSize: BPMN_THEME.fontSize - 1,
1349
+ fontFamily: BPMN_THEME.fontFamily,
1350
+ fill: stroke,
1351
+ children: p.name
1352
+ },
1353
+ i
1354
+ )),
1355
+ collapsed && /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
1356
+ /* @__PURE__ */ jsxRuntime.jsx(
1357
+ "rect",
1358
+ {
1359
+ x: "50%",
1360
+ y: "calc(100% - 22px)",
1361
+ width: 14,
1362
+ height: 12,
1363
+ transform: "translate(-7, 0)",
1364
+ rx: 2,
1365
+ fill,
1366
+ stroke,
1367
+ strokeWidth: sw * 0.8
1368
+ }
1369
+ ),
1370
+ /* @__PURE__ */ jsxRuntime.jsx(
1371
+ "text",
1372
+ {
1373
+ x: "50%",
1374
+ y: "calc(100% - 13px)",
1375
+ textAnchor: "middle",
1376
+ fontSize: 10,
1377
+ fill: stroke,
1378
+ fontFamily: BPMN_THEME.fontFamily,
1379
+ children: "+"
1380
+ }
1381
+ )
1382
+ ] })
1383
+ ] });
1384
+ }
1385
+ function ChoreographyTaskNode({ data, selected }) {
1386
+ const d = data;
1387
+ const stroke = resolveStroke(selected, d.color?.stroke);
1388
+ const sw = resolveStrokeWidth(selected);
1389
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
1390
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "100%", height: "100%", style: { overflow: "visible", display: "block" }, children: /* @__PURE__ */ jsxRuntime.jsx(ChoreographyShell, { d, stroke, sw }) }),
1391
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" })
1392
+ ] });
1393
+ }
1394
+ function SubChoreographyNode({ data, selected }) {
1395
+ const d = data;
1396
+ const stroke = resolveStroke(selected, d.color?.stroke);
1397
+ const sw = resolveStrokeWidth(selected);
1398
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
1399
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "100%", height: "100%", style: { overflow: "visible", display: "block" }, children: /* @__PURE__ */ jsxRuntime.jsx(ChoreographyShell, { d, stroke, sw, collapsed: true }) }),
1400
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" })
1401
+ ] });
1402
+ }
1403
+ function CallChoreographyNode({ data, selected }) {
1404
+ const d = data;
1405
+ const stroke = resolveStroke(selected, d.color?.stroke);
1406
+ const sw = resolveStrokeWidth(selected);
1407
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
1408
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "100%", height: "100%", style: { overflow: "visible", display: "block" }, children: /* @__PURE__ */ jsxRuntime.jsx(ChoreographyShell, { d, stroke, sw, thick: true, collapsed: true }) }),
1409
+ /* @__PURE__ */ jsxRuntime.jsx(BpmnHandles, { variant: "all" })
1410
+ ] });
1411
+ }
1412
+
1413
+ // src/nodes/nodeTypes.ts
1414
+ var BPMN_NODE_TYPES = {
1415
+ // Events
1416
+ StartEvent: StartEventNode,
1417
+ EndEvent: EndEventNode,
1418
+ IntermediateCatchEvent: IntermediateCatchEventNode,
1419
+ IntermediateThrowEvent: IntermediateThrowEventNode,
1420
+ BoundaryEvent: BoundaryEventNode,
1421
+ // Tasks — differentiated by data.elementType
1422
+ Task: TaskNode,
1423
+ UserTask: TaskNode,
1424
+ ServiceTask: TaskNode,
1425
+ ScriptTask: TaskNode,
1426
+ ManualTask: TaskNode,
1427
+ BusinessRuleTask: TaskNode,
1428
+ ReceiveTask: TaskNode,
1429
+ SendTask: TaskNode,
1430
+ CallActivity: TaskNode,
1431
+ // Gateways — differentiated by data.elementType
1432
+ ExclusiveGateway: GatewayNode,
1433
+ InclusiveGateway: GatewayNode,
1434
+ ParallelGateway: GatewayNode,
1435
+ EventBasedGateway: GatewayNode,
1436
+ ComplexGateway: GatewayNode,
1437
+ // Containers
1438
+ SubProcess: SubProcessNode,
1439
+ Pool: PoolNode,
1440
+ Lane: LaneNode,
1441
+ // Artifacts
1442
+ Annotation: AnnotationNode,
1443
+ Group: GroupNode,
1444
+ // Data
1445
+ DataObject: DataObjectNode,
1446
+ DataObjectReference: DataObjectReferenceNode,
1447
+ DataInput: DataInputNode,
1448
+ DataOutput: DataOutputNode,
1449
+ DataStore: DataStoreNode,
1450
+ DataStoreReference: DataStoreReferenceNode,
1451
+ // Conversation (§12)
1452
+ Conversation: ConversationNode,
1453
+ SubConversation: SubConversationNode,
1454
+ CallConversation: CallConversationNode,
1455
+ // Choreography (§11)
1456
+ ChoreographyTask: ChoreographyTaskNode,
1457
+ SubChoreography: SubChoreographyNode,
1458
+ CallChoreography: CallChoreographyNode
1459
+ };
1460
+
1461
+ exports.AnnotationNode = AnnotationNode;
1462
+ exports.BPMN_NODE_TYPES = BPMN_NODE_TYPES;
1463
+ exports.BoundaryEventNode = BoundaryEventNode;
1464
+ exports.CallChoreographyNode = CallChoreographyNode;
1465
+ exports.CallConversationNode = CallConversationNode;
1466
+ exports.ChoreographyTaskNode = ChoreographyTaskNode;
1467
+ exports.ConversationNode = ConversationNode;
1468
+ exports.DataInputNode = DataInputNode;
1469
+ exports.DataObjectNode = DataObjectNode;
1470
+ exports.DataObjectReferenceNode = DataObjectReferenceNode;
1471
+ exports.DataOutputNode = DataOutputNode;
1472
+ exports.DataStoreNode = DataStoreNode;
1473
+ exports.DataStoreReferenceNode = DataStoreReferenceNode;
1474
+ exports.EndEventNode = EndEventNode;
1475
+ exports.GatewayNode = GatewayNode;
1476
+ exports.GroupNode = GroupNode;
1477
+ exports.IntermediateCatchEventNode = IntermediateCatchEventNode;
1478
+ exports.IntermediateThrowEventNode = IntermediateThrowEventNode;
1479
+ exports.LaneNode = LaneNode;
1480
+ exports.PoolNode = PoolNode;
1481
+ exports.StartEventNode = StartEventNode;
1482
+ exports.SubChoreographyNode = SubChoreographyNode;
1483
+ exports.SubConversationNode = SubConversationNode;
1484
+ exports.SubProcessNode = SubProcessNode;
1485
+ exports.TaskNode = TaskNode;
1486
+ //# sourceMappingURL=index.cjs.map
1487
+ //# sourceMappingURL=index.cjs.map