@metadev/daga-react 4.2.3 → 4.2.4

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.
package/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as k, jsxs as V, Fragment as Di } from "react/jsx-runtime";
1
+ import { jsx as k, jsxs as V, Fragment as Hi } from "react/jsx-runtime";
2
2
  import * as N from "d3";
3
- import { debounceTime as Hi, Subject as Xt, merge as Gi, map as Bi } from "rxjs";
4
- import { createContext as fi, useState as U, useContext as Yt, useRef as ct, useEffect as Et, useMemo as Fi } from "react";
5
- var b = /* @__PURE__ */ ((i) => (i.Bottom = "bottom", i.Left = "left", i.Right = "right", i.Top = "top", i))(b || {}), Wt = /* @__PURE__ */ ((i) => (i.BottomLeft = "bottom-left", i.BottomRight = "bottom-right", i.TopLeft = "top-left", i.TopRight = "top-right", i))(Wt || {}), Pt = /* @__PURE__ */ ((i) => (i.Left = "left", i.Center = "center", i.Right = "right", i))(Pt || {}), Kt = /* @__PURE__ */ ((i) => (i.Top = "top", i.Center = "center", i.Bottom = "bottom", i))(Kt || {});
6
- const Mt = (i) => [Math.round(i[0]), Math.round(i[1])], bt = (i, t, e) => t < e ? t <= i && i <= e : e <= i && i <= t, ii = (i, t, e) => (i - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], qt = (i, t, e, o, a, l, s) => {
3
+ import { debounceTime as Gi, Subject as Zt, merge as Bi, map as Ui } from "rxjs";
4
+ import { createContext as yi, useState as U, useContext as Wt, useRef as dt, useEffect as Tt, useMemo as Yi } from "react";
5
+ var b = /* @__PURE__ */ ((i) => (i.Bottom = "bottom", i.Left = "left", i.Right = "right", i.Top = "top", i))(b || {}), qt = /* @__PURE__ */ ((i) => (i.BottomLeft = "bottom-left", i.BottomRight = "bottom-right", i.TopLeft = "top-left", i.TopRight = "top-right", i))(qt || {}), zt = /* @__PURE__ */ ((i) => (i.Left = "left", i.Center = "center", i.Right = "right", i))(zt || {}), Qt = /* @__PURE__ */ ((i) => (i.Top = "top", i.Center = "center", i.Bottom = "bottom", i))(Qt || {});
6
+ const Nt = (i) => [Math.round(i[0]), Math.round(i[1])], kt = (i, t, e) => t < e ? t <= i && i <= e : e <= i && i <= t, ri = (i, t, e) => (i - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], te = (i, t, e, o, a, l, s) => {
7
7
  const n = (() => {
8
8
  switch (l) {
9
9
  case "start":
@@ -16,7 +16,7 @@ const Mt = (i) => [Math.round(i[0]), Math.round(i[1])], bt = (i, t, e) => t < e
16
16
  }
17
17
  case "floating":
18
18
  default:
19
- return ii(i[0], t, o);
19
+ return ri(i[0], t, o);
20
20
  }
21
21
  })(), r = (() => {
22
22
  switch (s) {
@@ -30,47 +30,47 @@ const Mt = (i) => [Math.round(i[0]), Math.round(i[1])], bt = (i, t, e) => t < e
30
30
  }
31
31
  case "floating":
32
32
  default:
33
- return ii(i[1], e, a);
33
+ return ri(i[1], e, a);
34
34
  }
35
35
  })();
36
36
  return [n, r];
37
- }, pi = (i, t) => ((i[0] - t[0]) ** 2 + (i[1] - t[1]) ** 2) ** 0.5, Ui = (i, t) => (bt(
37
+ }, bi = (i, t) => ((i[0] - t[0]) ** 2 + (i[1] - t[1]) ** 2) ** 0.5, Xi = (i, t) => (kt(
38
38
  i[0][0],
39
39
  t[0][0],
40
40
  t[1][0]
41
- ) || bt(
41
+ ) || kt(
42
42
  i[1][0],
43
43
  t[1][0],
44
44
  t[0][0]
45
- ) || bt(
45
+ ) || kt(
46
46
  t[0][0],
47
47
  i[0][0],
48
48
  i[1][0]
49
- ) || bt(
49
+ ) || kt(
50
50
  t[1][0],
51
51
  i[1][0],
52
52
  i[0][0]
53
- )) && (bt(
53
+ )) && (kt(
54
54
  i[0][1],
55
55
  t[0][1],
56
56
  t[1][1]
57
- ) || bt(
57
+ ) || kt(
58
58
  i[1][1],
59
59
  t[1][1],
60
60
  t[0][1]
61
- ) || bt(
61
+ ) || kt(
62
62
  t[0][1],
63
63
  i[0][1],
64
64
  i[1][1]
65
- ) || bt(
65
+ ) || kt(
66
66
  t[1][1],
67
67
  i[1][1],
68
68
  i[0][1]
69
69
  ));
70
- var L = /* @__PURE__ */ ((i) => (i.Blur = "blur", i.Change = "change", i.Click = "click", i.ContextMenu = "contextmenu", i.DoubleClick = "dblclick", i.Focus = "focus", i.FocusIn = "focusin", i.FocusOut = "focusout", i.Input = "input", i.KeyDown = "keydown", i.KeyUp = "keyup", i.MouseDown = "mousedown", i.MouseEnter = "mouseenter", i.MouseLeave = "mouseleave", i.MouseMove = "mousemove", i.MouseOut = "mouseout", i.MouseOver = "mouseover", i.MouseUp = "mouseup", i.TouchStart = "touchstart", i.TouchEnd = "touchend", i.Wheel = "wheel", i))(L || {}), it = /* @__PURE__ */ ((i) => (i.Alt = "Alt", i.AltGraph = "AltGraph", i.ArrowDown = "ArrowDown", i.ArrowLeft = "ArrowLeft", i.ArrowRight = "ArrowRight", i.ArrowUp = "ArrowUp", i.Backspace = "Backspace", i.Control = "Control", i.Delete = "Delete", i.End = "End", i.Enter = "Enter", i.Escape = "Escape", i.Home = "Home", i.OS = "OS", i.PageDown = "PageDown", i.PageUp = "PageUp", i.Shift = "Shift", i.Tab = "Tab", i))(it || {}), M = /* @__PURE__ */ ((i) => (i.Drag = "drag", i.Start = "start", i.End = "end", i))(M || {}), fe = /* @__PURE__ */ ((i) => (i.Zoom = "zoom", i.Start = "start", i.End = "end", i))(fe || {});
71
- const pe = (i) => i.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
72
- var vi = /* @__PURE__ */ ((i) => (i.Straight = "straight", i.Bezier = "bezier", i.Square = "square", i))(vi || {}), yi = /* @__PURE__ */ ((i) => (i.Solid = "solid", i.Dashed = "dashed", i.GappedDashes = "gapped-dashes", i.Dotted = "dotted", i))(yi || {});
73
- const Yi = 20, Xi = (i, t, e, o, a) => {
70
+ var L = /* @__PURE__ */ ((i) => (i.Blur = "blur", i.Change = "change", i.Click = "click", i.ContextMenu = "contextmenu", i.DoubleClick = "dblclick", i.Focus = "focus", i.FocusIn = "focusin", i.FocusOut = "focusout", i.Input = "input", i.KeyDown = "keydown", i.KeyUp = "keyup", i.MouseDown = "mousedown", i.MouseEnter = "mouseenter", i.MouseLeave = "mouseleave", i.MouseMove = "mousemove", i.MouseOut = "mouseout", i.MouseOver = "mouseover", i.MouseUp = "mouseup", i.TouchStart = "touchstart", i.TouchEnd = "touchend", i.Wheel = "wheel", i))(L || {}), it = /* @__PURE__ */ ((i) => (i.Alt = "Alt", i.AltGraph = "AltGraph", i.ArrowDown = "ArrowDown", i.ArrowLeft = "ArrowLeft", i.ArrowRight = "ArrowRight", i.ArrowUp = "ArrowUp", i.Backspace = "Backspace", i.Control = "Control", i.Delete = "Delete", i.End = "End", i.Enter = "Enter", i.Escape = "Escape", i.Home = "Home", i.OS = "OS", i.PageDown = "PageDown", i.PageUp = "PageUp", i.Shift = "Shift", i.Tab = "Tab", i))(it || {}), M = /* @__PURE__ */ ((i) => (i.Drag = "drag", i.Start = "start", i.End = "end", i))(M || {}), ve = /* @__PURE__ */ ((i) => (i.Zoom = "zoom", i.Start = "start", i.End = "end", i))(ve || {});
71
+ const ye = (i) => i.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
72
+ var ki = /* @__PURE__ */ ((i) => (i.Straight = "straight", i.Bezier = "bezier", i.Square = "square", i))(ki || {}), Se = /* @__PURE__ */ ((i) => (i.Solid = "solid", i.Dashed = "dashed", i.GappedDashes = "gapped-dashes", i.Dotted = "dotted", i))(Se || {});
73
+ const ji = 20, Wi = (i, t, e, o, a) => {
74
74
  if (typeof i == "function")
75
75
  return i(
76
76
  t,
@@ -83,7 +83,7 @@ const Yi = 20, Xi = (i, t, e, o, a) => {
83
83
  if (t.length === 1)
84
84
  return `M ${t[0][0]} ${t[0][1]}`;
85
85
  {
86
- a = a || Yi;
86
+ a = a || ji;
87
87
  let l = "", s, n;
88
88
  switch (i) {
89
89
  case "straight":
@@ -229,7 +229,7 @@ const Yi = 20, Xi = (i, t, e, o, a) => {
229
229
  }
230
230
  return l;
231
231
  }
232
- }, oi = (i, t) => {
232
+ }, be = (i, t) => {
233
233
  switch (i) {
234
234
  case "dotted":
235
235
  return `${t}`;
@@ -245,68 +245,68 @@ const Yi = 20, Xi = (i, t, e, o, a) => {
245
245
  const e = i.indexOf(t);
246
246
  return e >= 0 && i.splice(e, 1), i;
247
247
  };
248
- var Qt = /* @__PURE__ */ ((i) => (i.Ellipse = "ellipse", i.Empty = "empty", i.Folder = "folder", i.Hexagon = "hexagon", i.Octagon = "octagon", i.Pill = "pill", i.Rectangle = "rectangle", i.Rhombus = "rhombus", i.RoundedRectangle = "rounded-rectangle", i.StickyNote = "sticky-note", i))(Qt || {});
249
- const ve = (i, t, e, o, a) => {
248
+ var _t = /* @__PURE__ */ ((i) => (i.Ellipse = "ellipse", i.Empty = "empty", i.Folder = "folder", i.Hexagon = "hexagon", i.Octagon = "octagon", i.Pill = "pill", i.Rectangle = "rectangle", i.Rhombus = "rhombus", i.RoundedRectangle = "rounded-rectangle", i.StickyNote = "sticky-note", i))(_t || {});
249
+ const ke = (i, t, e, o, a) => {
250
250
  if (typeof i == "function")
251
251
  return i(t, e, o, a);
252
252
  switch (i) {
253
253
  case "ellipse":
254
- return bi(t, e, o, a);
254
+ return wi(t, e, o, a);
255
255
  case "empty":
256
- return ji();
256
+ return Zi();
257
257
  case "folder":
258
- return Wi(t, e, o, a);
258
+ return Ki(t, e, o, a);
259
259
  case "hexagon":
260
- return Zi(t, e, o, a);
260
+ return qi(t, e, o, a);
261
261
  case "octagon":
262
- return Ki(t, e, o, a);
262
+ return Ji(t, e, o, a);
263
263
  case "pill":
264
- return Zt(t, e, o, a);
264
+ return Jt(t, e, o, a);
265
265
  case "rectangle":
266
- return si(t, e, o, a);
266
+ return ai(t, e, o, a);
267
267
  case "rhombus":
268
- return qi(t, e, o, a);
268
+ return Qi(t, e, o, a);
269
269
  case "rounded-rectangle":
270
- return Ji(t, e, o, a);
270
+ return to(t, e, o, a);
271
271
  case "sticky-note":
272
- return Qi(t, e, o, a);
272
+ return eo(t, e, o, a);
273
273
  default:
274
- return si(t, e, o, a);
274
+ return ai(t, e, o, a);
275
275
  }
276
- }, bi = (i, t, e, o) => `M ${i + e / 2} ${t} A ${e / 2} ${o / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${o / 2} 0 1 0 ${i + e / 2} ${t} Z`, ji = () => "Z", Wi = (i, t, e, o) => `M ${i} ${t} L ${i + e / 3} ${t} L ${i + e / 2} ${t + o / 6} L ${i + e} ${t + o / 6} L ${i + e} ${t + o} L ${i} ${t + o} Z`, Zi = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 2} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + o / 2} Z`, Ki = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} L ${i + e / 4} ${t} Z`, Zt = (i, t, e, o) => o < e ? `M ${i + o / 2} ${t} L ${i + e - o / 2} ${t} A ${o / 2} ${o / 2} 0 0 1 ${i + e} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + e - o / 2} ${t + o} L ${i + o / 2} ${t + o} A ${o / 2} ${o / 2} 0 0 1 ${i} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + o / 2} ${t} Z` : o > e ? `M ${i} ${t + e / 2} L ${i} ${t + o - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${e / 2} 0 0 0 ${i + e} ${t + o - e / 2} L ${i + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${i} ${t + e / 2} Z` : bi(i, t, e, o), si = (i, t, e, o) => `M ${i} ${t} L ${i + e} ${t} L ${i + e} ${t + o} L ${i} ${t + o} Z`, qi = (i, t, e, o) => `M ${i + e / 2} ${t} L ${i + e} ${t + o / 2} L ${i + e / 2} ${t + o} L ${i} ${t + o / 2} Z`, Ji = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} A ${e / 4} ${o / 4} 0 0 1 ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} A ${e / 4} ${o / 4} 0 0 1 ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + e / 4} ${t} Z`, Qi = (i, t, e, o) => `M ${i} ${t} L ${i + 3 * e / 4} ${t} L ${i + 3 * e / 4} ${t + o / 4} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + 3 * e / 4} ${t + o / 4} L ${i + e} ${t + o / 4} L ${i + e} ${t + o} L ${i} ${t + o} Z`;
276
+ }, wi = (i, t, e, o) => `M ${i + e / 2} ${t} A ${e / 2} ${o / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${o / 2} 0 1 0 ${i + e / 2} ${t} Z`, Zi = () => "Z", Ki = (i, t, e, o) => `M ${i} ${t} L ${i + e / 3} ${t} L ${i + e / 2} ${t + o / 6} L ${i + e} ${t + o / 6} L ${i + e} ${t + o} L ${i} ${t + o} Z`, qi = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 2} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + o / 2} Z`, Ji = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} L ${i + e / 4} ${t} Z`, Jt = (i, t, e, o) => o < e ? `M ${i + o / 2} ${t} L ${i + e - o / 2} ${t} A ${o / 2} ${o / 2} 0 0 1 ${i + e} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + e - o / 2} ${t + o} L ${i + o / 2} ${t + o} A ${o / 2} ${o / 2} 0 0 1 ${i} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + o / 2} ${t} Z` : o > e ? `M ${i} ${t + e / 2} L ${i} ${t + o - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${e / 2} 0 0 0 ${i + e} ${t + o - e / 2} L ${i + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${i} ${t + e / 2} Z` : wi(i, t, e, o), ai = (i, t, e, o) => `M ${i} ${t} L ${i + e} ${t} L ${i + e} ${t + o} L ${i} ${t + o} Z`, Qi = (i, t, e, o) => `M ${i + e / 2} ${t} L ${i + e} ${t + o / 2} L ${i + e / 2} ${t + o} L ${i} ${t + o / 2} Z`, to = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} A ${e / 4} ${o / 4} 0 0 1 ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} A ${e / 4} ${o / 4} 0 0 1 ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + e / 4} ${t} Z`, eo = (i, t, e, o) => `M ${i} ${t} L ${i + 3 * e / 4} ${t} L ${i + 3 * e / 4} ${t + o / 4} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + 3 * e / 4} ${t + o / 4} L ${i + e} ${t + o / 4} L ${i + e} ${t + o} L ${i} ${t + o} Z`;
277
277
  var P = /* @__PURE__ */ ((i) => (i.AllScroll = "all-scroll", i.Auto = "auto", i.Crosshair = "crosshair", i.EWResize = "ew-resize", i.Grab = "grab", i.Grabbing = "grabbing", i.Move = "move", i.NoDrop = "no-drop", i.NSResize = "ns-resize", i.NotAllowed = "not-allowed", i.ZoomIn = "zoom-in", i.ZoomOut = "zoom-out", i))(P || {});
278
- const to = (i) => Math.max(...i.split(`
279
- `).map((t) => t.length)), eo = (i) => {
278
+ const io = (i) => Math.max(...i.split(`
279
+ `).map((t) => t.length)), oo = (i) => {
280
280
  var t;
281
281
  return ((t = i.match(/\n/g)) == null ? void 0 : t.length) || 0;
282
282
  }, et = [];
283
283
  for (let i = 0; i < 256; ++i)
284
284
  et.push((i + 256).toString(16).slice(1));
285
- function io(i, t = 0) {
285
+ function so(i, t = 0) {
286
286
  return (et[i[t + 0]] + et[i[t + 1]] + et[i[t + 2]] + et[i[t + 3]] + "-" + et[i[t + 4]] + et[i[t + 5]] + "-" + et[i[t + 6]] + et[i[t + 7]] + "-" + et[i[t + 8]] + et[i[t + 9]] + "-" + et[i[t + 10]] + et[i[t + 11]] + et[i[t + 12]] + et[i[t + 13]] + et[i[t + 14]] + et[i[t + 15]]).toLowerCase();
287
287
  }
288
- let le;
289
- const oo = new Uint8Array(16);
290
- function so() {
291
- if (!le) {
288
+ let de;
289
+ const no = new Uint8Array(16);
290
+ function ro() {
291
+ if (!de) {
292
292
  if (typeof crypto > "u" || !crypto.getRandomValues)
293
293
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
294
- le = crypto.getRandomValues.bind(crypto);
294
+ de = crypto.getRandomValues.bind(crypto);
295
295
  }
296
- return le(oo);
296
+ return de(no);
297
297
  }
298
- const no = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ni = { randomUUID: no };
299
- function ri(i, t, e) {
298
+ const ao = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), li = { randomUUID: ao };
299
+ function ci(i, t, e) {
300
300
  var a;
301
- if (ni.randomUUID && !i)
302
- return ni.randomUUID();
301
+ if (li.randomUUID && !i)
302
+ return li.randomUUID();
303
303
  i = i || {};
304
- const o = i.random ?? ((a = i.rng) == null ? void 0 : a.call(i)) ?? so();
304
+ const o = i.random ?? ((a = i.rng) == null ? void 0 : a.call(i)) ?? ro();
305
305
  if (o.length < 16)
306
306
  throw new Error("Random bytes length must be >= 16");
307
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, io(o);
307
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, so(o);
308
308
  }
309
- const rt = (i) => {
309
+ const at = (i) => {
310
310
  const { selected: t, highlighted: e, ...o } = i, a = o, l = {
311
311
  ...a,
312
312
  ...t
@@ -325,7 +325,7 @@ const rt = (i) => {
325
325
  selectedAndHighlightedLook: n
326
326
  };
327
327
  };
328
- class te {
328
+ class ie {
329
329
  constructor() {
330
330
  this.entities = [], this.entityMap = {};
331
331
  }
@@ -436,8 +436,8 @@ class te {
436
436
  yield t;
437
437
  }
438
438
  }
439
- const Vt = 0;
440
- class $t {
439
+ const Ot = 0;
440
+ class Mt {
441
441
  constructor(t, e) {
442
442
  this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
443
443
  }
@@ -469,10 +469,10 @@ class $t {
469
469
  */
470
470
  select() {
471
471
  var t, e;
472
- return (e = (t = this.model.canvas) == null ? void 0 : t.selectCanvasView()) == null ? void 0 : e.select(`[id='${pe(this.id)}']`);
472
+ return (e = (t = this.model.canvas) == null ? void 0 : t.selectCanvasView()) == null ? void 0 : e.select(`[id='${ye(this.id)}']`);
473
473
  }
474
474
  }
475
- class yt extends te {
475
+ class bt extends ie {
476
476
  all(t = !1) {
477
477
  return t ? super.all() : super.filter((e) => !e.removed);
478
478
  }
@@ -510,13 +510,13 @@ class yt extends te {
510
510
  yield e;
511
511
  }
512
512
  }
513
- class ro {
514
- constructor(t, e, o, a, l, s) {
515
- this.name = t, this.type = e, this.defaultValue = o, this.basic = a, this.editable = l, this.rootAttribute = s, this.options = void 0, this.properties = void 0;
513
+ class lo {
514
+ constructor(t, e, o, a, l, s, n) {
515
+ this.name = t, this.label = e, this.type = o, this.defaultValue = a, this.basic = l, this.editable = s, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
516
516
  }
517
517
  }
518
518
  var _ = /* @__PURE__ */ ((i) => (i.Boolean = "boolean", i.Color = "color", i.Date = "date", i.Datetime = "datetime", i.Number = "number", i.Object = "object", i.Option = "option", i.OptionList = "option-list", i.OptionSet = "option-set", i.Text = "text", i.TextArea = "text-area", i.TextList = "text-list", i.TextSet = "text-set", i.TextMap = "text-map", i.Time = "time", i.Url = "url", i))(_ || {});
519
- class ee {
519
+ class oe {
520
520
  constructor(t = []) {
521
521
  this.propertyList = t, this.propertyMap = {};
522
522
  for (const e of this.propertyList)
@@ -532,24 +532,24 @@ class ee {
532
532
  return this.propertyList.length > 0;
533
533
  }
534
534
  }
535
- function At(i, t) {
535
+ function xt(i, t) {
536
536
  return !t || i[0] > t[0] ? !0 : i[0] === t[0] ? i[1] >= t[1] : !1;
537
537
  }
538
- const ai = (i) => i == null || i === "" || i instanceof Array && i.length === 0 || i instanceof Object && Object.keys(i).length === 0, Lt = (i, t) => i === t || JSON.stringify(i) === JSON.stringify(t), ki = (i, t, e) => {
538
+ const di = (i) => i == null || i === "" || i instanceof Array && i.length === 0 || i instanceof Object && Object.keys(i).length === 0, Et = (i, t) => i === t || JSON.stringify(i) === JSON.stringify(t), Ci = (i, t, e) => {
539
539
  const o = {}, a = {};
540
540
  for (const l in e.propertySet.propertyMap)
541
541
  if (e.propertySet.propertyMap[l].type === _.Object) {
542
- const s = ki(
542
+ const s = Ci(
543
543
  i[l],
544
544
  t[l],
545
545
  e.getSubValueSet(l)
546
546
  );
547
547
  Object.keys(s[0]).length > 0 && Object.keys(s[1]).length > 0 && (o[l] = s[0], a[l] = s[1]);
548
548
  } else
549
- Lt(i[l], t[l]) || (o[l] = i[l], a[l] = t[l]);
549
+ Et(i[l], t[l]) || (o[l] = i[l], a[l] = t[l]);
550
550
  return [o, a];
551
- }, ao = (i) => i != null && i.constructor === Object;
552
- class St {
551
+ }, co = (i) => i != null && i.constructor === Object;
552
+ class It {
553
553
  constructor(t, e) {
554
554
  this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
555
555
  }
@@ -657,7 +657,7 @@ class St {
657
657
  */
658
658
  hasValue(t) {
659
659
  const e = this.getValue(t);
660
- return !ai(e);
660
+ return !di(e);
661
661
  }
662
662
  /**
663
663
  * Checks if the value under the key is not empty or the default value.
@@ -667,7 +667,7 @@ class St {
667
667
  */
668
668
  hasSetValue(t) {
669
669
  const e = this.getValue(t), o = this.propertySet.getProperty(t);
670
- return o && o.type === _.Object ? this.getSubValueSet(t).hasAnySetValue() : !ai(e) && !Lt(e, o == null ? void 0 : o.defaultValue);
670
+ return o && o.type === _.Object ? this.getSubValueSet(t).hasAnySetValue() : !di(e) && !Et(e, o == null ? void 0 : o.defaultValue);
671
671
  }
672
672
  /**
673
673
  * Checks if any of the values in the set are not empty or the default value.
@@ -689,7 +689,7 @@ class St {
689
689
  setValue(t, e) {
690
690
  const o = this.propertySet.getProperty(t);
691
691
  if (o) {
692
- o.type === _.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, Lt(e, o.defaultValue) || this.displayProperty(o));
692
+ o.type === _.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, Et(e, o.defaultValue) || this.displayProperty(o));
693
693
  const a = o.rootAttribute;
694
694
  a != null && this.setRootElementValue(a, e);
695
695
  }
@@ -739,7 +739,7 @@ class St {
739
739
  this.propertySet.getProperty(o).type === _.Object ? this.valueSets[o].overwriteValuesLww(
740
740
  t[o],
741
741
  e
742
- ) : At(e, this.ownTimestamps[o]) && (this.setValue(o, t[o]), this.ownTimestamps[o] = e);
742
+ ) : xt(e, this.ownTimestamps[o]) && (this.setValue(o, t[o]), this.ownTimestamps[o] = e);
743
743
  }
744
744
  /**
745
745
  * Sets all the values of this set to the defaults.
@@ -750,10 +750,10 @@ class St {
750
750
  this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
751
751
  for (const t in this.propertySet.propertyMap) {
752
752
  const e = this.propertySet.getProperty(t), o = e.rootAttribute;
753
- e.type === _.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = structuredClone(e.defaultValue), o != null && e.defaultValue !== void 0 && !Lt(
753
+ e.type === _.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = structuredClone(e.defaultValue), o != null && e.defaultValue !== void 0 && !Et(
754
754
  this.getRootElementValue(o),
755
755
  e.defaultValue
756
- ) && this.setRootElementValue(o, this.values[t]), e.basic ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
756
+ ) && this.setRootElementValue(o, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
757
757
  }
758
758
  }
759
759
  /**
@@ -763,7 +763,7 @@ class St {
763
763
  * @returns The constructed ValueSet.
764
764
  */
765
765
  constructSubValueSet(t) {
766
- const e = this.propertySet.getProperty(t), o = new ee(e.properties), a = new St(o, this.rootElement);
766
+ const e = this.propertySet.getProperty(t), o = new oe(e.properties), a = new It(o, this.rootElement);
767
767
  return a.overwriteValues(
768
768
  structuredClone(e.defaultValue)
769
769
  ), a;
@@ -794,15 +794,15 @@ class St {
794
794
  this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), K(this.displayedProperties, t));
795
795
  }
796
796
  }
797
- const lo = {
797
+ const st = {
798
798
  name: "",
799
799
  label: null,
800
800
  look: {
801
801
  lookType: "connection-look",
802
802
  color: "#000000",
803
803
  thickness: 1,
804
- shape: vi.Straight,
805
- style: yi.Solid,
804
+ shape: ki.Straight,
805
+ style: Se.Solid,
806
806
  selected: {
807
807
  color: "#AA00AA"
808
808
  },
@@ -816,29 +816,29 @@ const lo = {
816
816
  endTypes: [],
817
817
  properties: []
818
818
  };
819
- class wi {
819
+ class Si {
820
820
  constructor(t) {
821
821
  const e = {
822
- ...lo,
822
+ ...st,
823
823
  ...t
824
824
  };
825
825
  this.id = e.id, this.name = e.name, this.label = e.label;
826
- const o = rt(e.look);
826
+ const o = at(e.look);
827
827
  if (this.defaultLook = o.defaultLook, this.selectedLook = o.selectedLook, this.highlightedLook = o.highlightedLook, this.selectedAndHighlightedLook = o.selectedAndHighlightedLook, e.startMarkerLook !== void 0) {
828
- const a = rt(
828
+ const a = at(
829
829
  e.startMarkerLook
830
830
  );
831
831
  this.defaultStartMarkerLook = a.defaultLook, this.selectedStartMarkerLook = a.selectedLook, this.highlightedStartMarkerLook = a.highlightedLook, this.selectedAndHighlightedStartMarkerLook = a.selectedAndHighlightedLook;
832
832
  } else
833
833
  this.defaultStartMarkerLook = null, this.selectedStartMarkerLook = null, this.highlightedStartMarkerLook = null, this.selectedAndHighlightedStartMarkerLook = null;
834
834
  if (e.endMarkerLook !== void 0) {
835
- const a = rt(
835
+ const a = at(
836
836
  e.endMarkerLook
837
837
  );
838
838
  this.defaultEndMarkerLook = a.defaultLook, this.selectedEndMarkerLook = a.selectedLook, this.highlightedEndMarkerLook = a.highlightedLook, this.selectedAndHighlightedEndMarkerLook = a.selectedAndHighlightedLook;
839
839
  } else
840
840
  this.defaultEndMarkerLook = null, this.selectedEndMarkerLook = null, this.highlightedEndMarkerLook = null, this.selectedAndHighlightedEndMarkerLook = null;
841
- this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new ee(e.properties);
841
+ this.startTypes = e.startTypes, this.endTypes = e.endTypes, this.propertySet = new oe(e.properties);
842
842
  }
843
843
  canStartFromType(t) {
844
844
  return this.startTypes.indexOf(t) >= 0;
@@ -847,20 +847,20 @@ class wi {
847
847
  return this.endTypes.indexOf(t) >= 0;
848
848
  }
849
849
  }
850
- class gt extends $t {
850
+ class ut extends Mt {
851
851
  constructor(t, e, o, a, l) {
852
852
  if (t.connections.get(l) !== void 0)
853
853
  throw new Error(`DiagramConnection with id "${l}" already exists`);
854
854
  if (!l)
855
855
  throw new Error("DiagramConnection cannot have an empty or null id");
856
- super(t, l), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = e, this.valueSet = new St(e.propertySet, this), this.originalData = {}, this.setStart(o), this.setEnd(a);
856
+ super(t, l), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = e, this.valueSet = new It(e.propertySet, this), this.originalData = {}, this.setStart(o), this.setEnd(a);
857
857
  }
858
858
  get type() {
859
859
  return this._type;
860
860
  }
861
861
  set type(t) {
862
862
  var e, o;
863
- t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new St(t.propertySet, this)), (o = (e = this.model.canvas) == null ? void 0 : e.userSelection) == null || o.openInPropertyEditor(this, !1), this.updateInView());
863
+ t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new It(t.propertySet, this)), (o = (e = this.model.canvas) == null ? void 0 : e.userSelection) == null || o.openInPropertyEditor(this, !1), this.updateInView());
864
864
  }
865
865
  get typeString() {
866
866
  return this.type.id;
@@ -895,7 +895,7 @@ class gt extends $t {
895
895
  */
896
896
  set look(t) {
897
897
  if (t) {
898
- const e = rt(t);
898
+ const e = at(t);
899
899
  this._defaultLook = {
900
900
  ...this._defaultLook,
901
901
  ...e.defaultLook
@@ -926,7 +926,7 @@ class gt extends $t {
926
926
  */
927
927
  set startMarkerLook(t) {
928
928
  if (t) {
929
- const e = rt(t);
929
+ const e = at(t);
930
930
  this._defaultStartMarkerLook = {
931
931
  ...this._defaultStartMarkerLook,
932
932
  ...e.defaultLook
@@ -957,7 +957,7 @@ class gt extends $t {
957
957
  */
958
958
  set endMarkerLook(t) {
959
959
  if (t) {
960
- const e = rt(t);
960
+ const e = at(t);
961
961
  this._defaultEndMarkerLook = {
962
962
  ...this._defaultEndMarkerLook,
963
963
  ...e.defaultLook
@@ -1057,16 +1057,16 @@ class gt extends $t {
1057
1057
  }
1058
1058
  }
1059
1059
  getPriority() {
1060
- return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Vt;
1060
+ return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Ot;
1061
1061
  }
1062
1062
  }
1063
- class co extends yt {
1063
+ class ho extends bt {
1064
1064
  /**
1065
1065
  * Instance a set of connections for the given model. This method is used internally.
1066
1066
  * @private
1067
1067
  */
1068
1068
  constructor(t) {
1069
- super(), this.types = new te(), this.model = t;
1069
+ super(), this.types = new ie(), this.model = t;
1070
1070
  }
1071
1071
  /**
1072
1072
  * Instance a new connection and add it to this set.
@@ -1079,7 +1079,7 @@ class co extends yt {
1079
1079
  */
1080
1080
  new(t, e, o, a) {
1081
1081
  let l;
1082
- if (t instanceof wi)
1082
+ if (t instanceof Si)
1083
1083
  l = t;
1084
1084
  else {
1085
1085
  const n = this.types.get(t);
@@ -1089,7 +1089,7 @@ class co extends yt {
1089
1089
  );
1090
1090
  l = n;
1091
1091
  }
1092
- const s = new gt(
1092
+ const s = new ut(
1093
1093
  this.model,
1094
1094
  l,
1095
1095
  e,
@@ -1104,7 +1104,7 @@ class co extends yt {
1104
1104
  e && (K(((o = e.start) == null ? void 0 : o.outgoingConnections) || [], e), K(((a = e.end) == null ? void 0 : a.incomingConnections) || [], e), super.remove(t), e.updateInView());
1105
1105
  }
1106
1106
  }
1107
- const H = {
1107
+ const F = {
1108
1108
  editable: !0,
1109
1109
  fontSize: 0,
1110
1110
  margin: 0,
@@ -1113,13 +1113,13 @@ const H = {
1113
1113
  color: "#000000",
1114
1114
  selectedColor: "#000000",
1115
1115
  backgroundColor: "#00000000",
1116
- horizontalAlign: Pt.Center,
1117
- verticalAlign: Kt.Center,
1116
+ horizontalAlign: zt.Center,
1117
+ verticalAlign: Qt.Center,
1118
1118
  orientation: b.Top,
1119
1119
  fit: !1,
1120
1120
  shrink: !0
1121
1121
  };
1122
- class pt extends $t {
1122
+ class vt extends Mt {
1123
1123
  constructor(t, e, o, a, l, s, n, r, c, d, h, u, p, f, m, g) {
1124
1124
  const v = `${e == null ? void 0 : e.id}_field`;
1125
1125
  if (t.fields.get(v) !== void 0)
@@ -1177,10 +1177,10 @@ class pt extends $t {
1177
1177
  }
1178
1178
  getPriority() {
1179
1179
  var t;
1180
- return ((t = this.rootElement) == null ? void 0 : t.getPriority()) || Vt;
1180
+ return ((t = this.rootElement) == null ? void 0 : t.getPriority()) || Ot;
1181
1181
  }
1182
1182
  }
1183
- class ho extends yt {
1183
+ class go extends bt {
1184
1184
  /**
1185
1185
  * Instance a set of fields for the given model. This method is used internally.
1186
1186
  * @private
@@ -1193,7 +1193,7 @@ class ho extends yt {
1193
1193
  * @private
1194
1194
  */
1195
1195
  new(t, e, o, a, l, s, n, r, c, d, h, u, p, f, m) {
1196
- const g = new pt(
1196
+ const g = new vt(
1197
1197
  this.model,
1198
1198
  t,
1199
1199
  e,
@@ -1219,26 +1219,26 @@ class ho extends yt {
1219
1219
  e && (((o = e.rootElement) == null ? void 0 : o.label) !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1220
1220
  }
1221
1221
  }
1222
- const st = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? H.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? H.margin : i.margin.length === 1 || i.margin.length === 2 ? i.margin[0] : (i.margin.length === 3, i.margin[2]), tt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? H.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? H.margin : i.margin.length === 1 ? i.margin[0] : i.margin.length === 2 || i.margin.length === 3 ? i.margin[1] : i.margin[3], lt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? H.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? H.margin : i.margin.length === 1 ? i.margin[0] : (i.margin.length === 2 || i.margin.length === 3, i.margin[1]), Z = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? H.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? H.margin : (i.margin.length === 1 || i.margin.length === 2 || i.margin.length === 3, i.margin[0]), Dt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? H.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? H.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), Ht = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? H.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? H.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], Gt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? H.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? H.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), Bt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? H.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? H.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), li = 1, ci = 1, go = 1, uo = 1;
1223
- class mo {
1222
+ const nt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 || i.margin.length === 2 ? i.margin[0] : (i.margin.length === 3, i.margin[2]), tt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 ? i.margin[0] : i.margin.length === 2 || i.margin.length === 3 ? i.margin[1] : i.margin[3], ct = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 ? i.margin[0] : (i.margin.length === 2 || i.margin.length === 3, i.margin[1]), Z = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : (i.margin.length === 1 || i.margin.length === 2 || i.margin.length === 3, i.margin[0]), Gt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), Bt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], Ut = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), Yt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), hi = 1, gi = 1, uo = 1, mo = 1;
1223
+ class fo {
1224
1224
  constructor(t) {
1225
1225
  this.margin = t.margin || 0, this.defaultWidths = t.defaultWidths || null, this.defaultHeights = t.defaultHeights || null, this.minWidths = t.minWidths || null, this.minHeights = t.minHeights || null, this.sections = [];
1226
1226
  for (const e of t.sections) {
1227
1227
  const o = [];
1228
1228
  this.sections.push(o);
1229
1229
  for (const a of e)
1230
- o.push(new fo(a));
1230
+ o.push(new po(a));
1231
1231
  }
1232
1232
  }
1233
1233
  }
1234
- class fo {
1234
+ class po {
1235
1235
  constructor(t) {
1236
- this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Vt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1237
- const e = rt(t.look || Ci);
1236
+ this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Ot, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1237
+ const e = at(t.look || Ii);
1238
1238
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1239
1239
  }
1240
1240
  }
1241
- class X extends $t {
1241
+ class X extends Mt {
1242
1242
  constructor(t, e, o, a, l, s, n, r) {
1243
1243
  if (t.sections.get(r) !== void 0)
1244
1244
  throw new Error(`DiagramSection with id "${r}" already exists`);
@@ -1272,7 +1272,7 @@ class X extends $t {
1272
1272
  */
1273
1273
  set look(t) {
1274
1274
  if (t) {
1275
- const e = rt(t);
1275
+ const e = at(t);
1276
1276
  this._defaultLook = {
1277
1277
  ...this._defaultLook,
1278
1278
  ...e.defaultLook
@@ -1310,15 +1310,15 @@ class X extends $t {
1310
1310
  }
1311
1311
  getMinWidth() {
1312
1312
  var t, e, o, a;
1313
- return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minWidths) == null ? void 0 : a[this.indexXInNode]) || go;
1313
+ return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minWidths) == null ? void 0 : a[this.indexXInNode]) || uo;
1314
1314
  }
1315
1315
  getMinHeight() {
1316
1316
  var t, e, o, a;
1317
- return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minHeights) == null ? void 0 : a[this.indexYInNode]) || uo;
1317
+ return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minHeights) == null ? void 0 : a[this.indexYInNode]) || mo;
1318
1318
  }
1319
1319
  getPriority() {
1320
1320
  var t, e, o, a, l, s;
1321
- return ((s = (l = (a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.sections) == null ? void 0 : a[this.indexYInNode]) == null ? void 0 : l[this.indexXInNode]) == null ? void 0 : s.priority) || Vt;
1321
+ return ((s = (l = (a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.sections) == null ? void 0 : a[this.indexYInNode]) == null ? void 0 : l[this.indexXInNode]) == null ? void 0 : s.priority) || Ot;
1322
1322
  }
1323
1323
  /**
1324
1324
  * Returns whether this section can be resized horizontally.
@@ -1461,7 +1461,7 @@ class X extends $t {
1461
1461
  const a = [this.coords[0], this.coords[0] + this.width], l = [this.coords[1], this.coords[1] + this.height];
1462
1462
  for (const r of this.ports)
1463
1463
  r.move(
1464
- qt(
1464
+ te(
1465
1465
  r.coords,
1466
1466
  e,
1467
1467
  o,
@@ -1475,10 +1475,10 @@ class X extends $t {
1475
1475
  this.label && (this.label.coords = [
1476
1476
  this.coords[0] + tt(s == null ? void 0 : s.label),
1477
1477
  this.coords[1] + Z(s == null ? void 0 : s.label)
1478
- ], this.label.width = this.width - tt(s == null ? void 0 : s.label) - lt(s == null ? void 0 : s.label), this.label.height = this.height - Z(s == null ? void 0 : s.label) - st(s == null ? void 0 : s.label), this.label.updateInView());
1478
+ ], this.label.width = this.width - tt(s == null ? void 0 : s.label) - ct(s == null ? void 0 : s.label), this.label.height = this.height - Z(s == null ? void 0 : s.label) - nt(s == null ? void 0 : s.label), this.label.updateInView());
1479
1479
  for (const r of this.decorators)
1480
1480
  r.move(
1481
- qt(
1481
+ te(
1482
1482
  r.coords,
1483
1483
  e,
1484
1484
  o,
@@ -1491,7 +1491,7 @@ class X extends $t {
1491
1491
  ((n = this.model.canvas) == null ? void 0 : n.autoTightenConnections) !== !1 && this.getConnections().forEach((r) => r.tighten()), this.updateInView();
1492
1492
  }
1493
1493
  }
1494
- class po extends yt {
1494
+ class vo extends bt {
1495
1495
  /**
1496
1496
  * Instance a set of sections for the given model. This method is used internally.
1497
1497
  * @private
@@ -1537,9 +1537,9 @@ class po extends yt {
1537
1537
  );
1538
1538
  if ((m = $.type) != null && m.label) {
1539
1539
  const C = {
1540
- ...H,
1540
+ ...F,
1541
1541
  ...(g = $.type) == null ? void 0 : g.label
1542
- }, R = 6 * C.fontSize + Ht(C) + Gt(C), T = C.fontSize + Bt(C) + Dt(C);
1542
+ }, R = 6 * C.fontSize + Bt(C) + Ut(C), T = C.fontSize + Yt(C) + Gt(C);
1543
1543
  let z;
1544
1544
  switch ($.direction) {
1545
1545
  case b.Bottom:
@@ -1547,7 +1547,7 @@ class po extends yt {
1547
1547
  case b.Right:
1548
1548
  z = [
1549
1549
  $.coords[0] - R / 2,
1550
- $.coords[1] - T - st(C)
1550
+ $.coords[1] - T - nt(C)
1551
1551
  ];
1552
1552
  break;
1553
1553
  case b.Top:
@@ -1581,7 +1581,7 @@ class po extends yt {
1581
1581
  const d = (A = (y = (w = (v = t.type.sectionGrid) == null ? void 0 : v.sections) == null ? void 0 : w[o]) == null ? void 0 : y[e]) == null ? void 0 : A.label;
1582
1582
  if (d) {
1583
1583
  const I = {
1584
- ...H,
1584
+ ...F,
1585
1585
  ...d
1586
1586
  };
1587
1587
  this.model.fields.new(
@@ -1594,8 +1594,8 @@ class po extends yt {
1594
1594
  I.fontFamily,
1595
1595
  I.color,
1596
1596
  I.selectedColor,
1597
- r.width - tt(I) - lt(I),
1598
- r.height - Z(I) - st(I),
1597
+ r.width - tt(I) - ct(I),
1598
+ r.height - Z(I) - nt(I),
1599
1599
  I.horizontalAlign,
1600
1600
  I.verticalAlign,
1601
1601
  I.orientation,
@@ -1616,9 +1616,9 @@ class po extends yt {
1616
1616
  }
1617
1617
  }
1618
1618
  }
1619
- const Ci = {
1619
+ const Ii = {
1620
1620
  lookType: "shaped-look",
1621
- shape: Qt.Rectangle,
1621
+ shape: _t.Rectangle,
1622
1622
  fillColor: "#FFFFFF",
1623
1623
  borderColor: "#000000",
1624
1624
  borderThickness: 1,
@@ -1629,7 +1629,7 @@ const Ci = {
1629
1629
  highlighted: {
1630
1630
  borderThickness: 3
1631
1631
  }
1632
- }, vt = {
1632
+ }, yt = {
1633
1633
  name: "",
1634
1634
  defaultWidth: 1,
1635
1635
  defaultHeight: 1,
@@ -1642,38 +1642,38 @@ const Ci = {
1642
1642
  ports: [],
1643
1643
  decorators: [],
1644
1644
  sectionGrid: null,
1645
- look: Ci,
1645
+ look: Ii,
1646
1646
  isUnique: !1,
1647
1647
  canBeParentless: !0,
1648
1648
  childrenTypes: [],
1649
- priority: Vt,
1649
+ priority: Ot,
1650
1650
  properties: []
1651
1651
  };
1652
- class Si {
1652
+ class Ai {
1653
1653
  constructor(t) {
1654
1654
  const e = {
1655
- ...vt,
1655
+ ...yt,
1656
1656
  ...t
1657
1657
  };
1658
- this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.bottomPadding = yo(e), this.leftPadding = bo(e), this.rightPadding = ko(e), this.topPadding = wo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new mo(e.sectionGrid) : null;
1659
- const o = rt(e.look);
1660
- this.defaultLook = o.defaultLook, this.selectedLook = o.selectedLook, this.highlightedLook = o.highlightedLook, this.selectedAndHighlightedLook = o.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new ee((t == null ? void 0 : t.properties) || []);
1658
+ this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.bottomPadding = bo(e), this.leftPadding = ko(e), this.rightPadding = wo(e), this.topPadding = Co(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new fo(e.sectionGrid) : null;
1659
+ const o = at(e.look);
1660
+ this.defaultLook = o.defaultLook, this.selectedLook = o.selectedLook, this.highlightedLook = o.highlightedLook, this.selectedAndHighlightedLook = o.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new oe((t == null ? void 0 : t.properties) || []);
1661
1661
  }
1662
1662
  }
1663
- class O extends $t {
1663
+ class O extends Mt {
1664
1664
  constructor(t, e, o = [0, 0], a) {
1665
1665
  if (t.nodes.get(a) !== void 0)
1666
1666
  throw new Error(`DiagramNode with id "${a}" already exists`);
1667
1667
  if (!a)
1668
1668
  throw new Error("DiagramNode cannot have an empty or null id");
1669
- super(t, a), this.children = [], this.sections = [], this.ports = [], this.decorators = [], this.geometryTimestamp = null, this._type = e, this.valueSet = new St(e.propertySet, this), this.originalData = {}, this.coords = o, this.width = e.defaultWidth, this.height = e.defaultHeight;
1669
+ super(t, a), this.children = [], this.sections = [], this.ports = [], this.decorators = [], this.geometryTimestamp = null, this._type = e, this.valueSet = new It(e.propertySet, this), this.originalData = {}, this.coords = o, this.width = e.defaultWidth, this.height = e.defaultHeight;
1670
1670
  }
1671
1671
  get type() {
1672
1672
  return this._type;
1673
1673
  }
1674
1674
  set type(t) {
1675
1675
  var e, o;
1676
- t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new St(t.propertySet, this)), (o = (e = this.model.canvas) == null ? void 0 : e.userSelection) == null || o.openInPropertyEditor(this, !1), this.updateInView());
1676
+ t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new It(t.propertySet, this)), (o = (e = this.model.canvas) == null ? void 0 : e.userSelection) == null || o.openInPropertyEditor(this, !1), this.updateInView());
1677
1677
  }
1678
1678
  get typeString() {
1679
1679
  return this.type.id;
@@ -1709,7 +1709,7 @@ class O extends $t {
1709
1709
  */
1710
1710
  set look(t) {
1711
1711
  if (t) {
1712
- const e = rt(t);
1712
+ const e = at(t);
1713
1713
  this._defaultLook = {
1714
1714
  ...this._defaultLook,
1715
1715
  ...e.defaultLook
@@ -2075,7 +2075,7 @@ class O extends $t {
2075
2075
  }
2076
2076
  for (const n of this.ports)
2077
2077
  n.move(
2078
- qt(
2078
+ te(
2079
2079
  n.coords,
2080
2080
  e,
2081
2081
  o,
@@ -2088,10 +2088,10 @@ class O extends $t {
2088
2088
  this.label && (this.label.coords = [
2089
2089
  this.coords[0] + tt(this.type.label),
2090
2090
  this.coords[1] + Z(this.type.label)
2091
- ], this.label.width = this.width - tt(this.type.label) - lt(this.type.label), this.label.height = this.height - Z(this.type.label) - st(this.type.label), this.label.updateInView());
2091
+ ], this.label.width = this.width - tt(this.type.label) - ct(this.type.label), this.label.height = this.height - Z(this.type.label) - nt(this.type.label), this.label.updateInView());
2092
2092
  for (const n of this.decorators)
2093
2093
  n.move(
2094
- qt(
2094
+ te(
2095
2095
  n.coords,
2096
2096
  e,
2097
2097
  o,
@@ -2210,13 +2210,13 @@ class O extends $t {
2210
2210
  this.stretch(b.Bottom, e + o);
2211
2211
  }
2212
2212
  }
2213
- class vo extends yt {
2213
+ class yo extends bt {
2214
2214
  /**
2215
2215
  * Instance a set of nodes for the given model. This method is used internally.
2216
2216
  * @private
2217
2217
  */
2218
2218
  constructor(t) {
2219
- super(), this.types = new te(), this.model = t;
2219
+ super(), this.types = new ie(), this.model = t;
2220
2220
  }
2221
2221
  /**
2222
2222
  * Instance a new node and add it to this set.
@@ -2229,7 +2229,7 @@ class vo extends yt {
2229
2229
  new(t, e, o) {
2230
2230
  var s, n, r, c, d, h, u;
2231
2231
  let a;
2232
- if (t instanceof Si)
2232
+ if (t instanceof Ai)
2233
2233
  a = t;
2234
2234
  else {
2235
2235
  const p = this.types.get(t);
@@ -2248,11 +2248,11 @@ class vo extends yt {
2248
2248
  g,
2249
2249
  f,
2250
2250
  [m, p],
2251
- ((s = a.sectionGrid.defaultWidths) == null ? void 0 : s[g]) || li,
2252
- ((n = a.sectionGrid.defaultHeights) == null ? void 0 : n[f]) || ci,
2251
+ ((s = a.sectionGrid.defaultWidths) == null ? void 0 : s[g]) || hi,
2252
+ ((n = a.sectionGrid.defaultHeights) == null ? void 0 : n[f]) || gi,
2253
2253
  `${l.id}_${f}_${g}`
2254
- ), m += (((r = a.sectionGrid.defaultWidths) == null ? void 0 : r[g]) || li) + (a.sectionGrid.margin || 0);
2255
- p += (((c = a.sectionGrid.defaultHeights) == null ? void 0 : c[f]) || ci) + (a.sectionGrid.margin || 0);
2254
+ ), m += (((r = a.sectionGrid.defaultWidths) == null ? void 0 : r[g]) || hi) + (a.sectionGrid.margin || 0);
2255
+ p += (((c = a.sectionGrid.defaultHeights) == null ? void 0 : c[f]) || gi) + (a.sectionGrid.margin || 0);
2256
2256
  }
2257
2257
  }
2258
2258
  if (a.ports.length > 0)
@@ -2275,9 +2275,9 @@ class vo extends yt {
2275
2275
  );
2276
2276
  if ((d = g.type) != null && d.label) {
2277
2277
  const v = {
2278
- ...H,
2278
+ ...F,
2279
2279
  ...(h = g.type) == null ? void 0 : h.label
2280
- }, w = 6 * v.fontSize + Ht(v) + Gt(v), y = v.fontSize + Bt(v) + Dt(v);
2280
+ }, w = 6 * v.fontSize + Bt(v) + Ut(v), y = v.fontSize + Yt(v) + Gt(v);
2281
2281
  let A;
2282
2282
  switch (g.direction) {
2283
2283
  case b.Bottom:
@@ -2285,7 +2285,7 @@ class vo extends yt {
2285
2285
  case b.Right:
2286
2286
  A = [
2287
2287
  g.coords[0] - w / 2,
2288
- g.coords[1] - y - st(v)
2288
+ g.coords[1] - y - nt(v)
2289
2289
  ];
2290
2290
  break;
2291
2291
  case b.Top:
@@ -2318,7 +2318,7 @@ class vo extends yt {
2318
2318
  }
2319
2319
  if (a.label) {
2320
2320
  const p = {
2321
- ...H,
2321
+ ...F,
2322
2322
  ...a.label
2323
2323
  };
2324
2324
  this.model.fields.new(
@@ -2331,8 +2331,8 @@ class vo extends yt {
2331
2331
  p.fontFamily,
2332
2332
  p.color,
2333
2333
  p.selectedColor,
2334
- l.width - tt(p) - lt(p),
2335
- l.height - Z(p) - st(p),
2334
+ l.width - tt(p) - ct(p),
2335
+ l.height - Z(p) - nt(p),
2336
2336
  p.horizontalAlign,
2337
2337
  p.verticalAlign,
2338
2338
  p.orientation,
@@ -2390,14 +2390,14 @@ class vo extends yt {
2390
2390
  return o;
2391
2391
  }
2392
2392
  }
2393
- const Ii = (i) => {
2393
+ const xi = (i) => {
2394
2394
  for (let t = 0; t < i.length; ++t)
2395
2395
  for (let e = 0; e < i.length; ++e)
2396
2396
  e !== t && i[e].isAncestorOf(i[t]) && (i.splice(e, 1), --e, t > e && --t);
2397
2397
  return i;
2398
- }, yo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? vt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? vt.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), bo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? vt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? vt.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], ko = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? vt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? vt.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), wo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? vt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? vt.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), Ai = {
2398
+ }, bo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), ko = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], wo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), Co = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), Li = {
2399
2399
  lookType: "shaped-look",
2400
- shape: Qt.Ellipse,
2400
+ shape: _t.Ellipse,
2401
2401
  fillColor: "transparent",
2402
2402
  borderColor: "transparent",
2403
2403
  borderThickness: 0,
@@ -2407,26 +2407,26 @@ const Ii = (i) => {
2407
2407
  highlighted: {
2408
2408
  fillColor: "rgba(0, 255, 255, 0.5)"
2409
2409
  }
2410
- }, jt = rt(Ai), xi = {
2410
+ }, Kt = at(Li), Ei = {
2411
2411
  name: "",
2412
2412
  label: null,
2413
2413
  allowsOutgoing: !0,
2414
2414
  allowsIncoming: !0,
2415
2415
  width: 24,
2416
- look: Ai
2416
+ look: Li
2417
2417
  };
2418
- class Co {
2418
+ class So {
2419
2419
  constructor(t) {
2420
2420
  const e = {
2421
- ...xi,
2421
+ ...Ei,
2422
2422
  ...t
2423
2423
  };
2424
2424
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
2425
- const o = rt(e.look);
2425
+ const o = at(e.look);
2426
2426
  this.defaultLook = o.defaultLook, this.selectedLook = o.selectedLook, this.highlightedLook = o.highlightedLook, this.selectedAndHighlightedLook = o.selectedAndHighlightedLook;
2427
2427
  }
2428
2428
  }
2429
- class It extends $t {
2429
+ class At extends Mt {
2430
2430
  constructor(t, e, o, a, l, s, n, r = "floating", c = "floating") {
2431
2431
  if (t.ports.get(n) !== void 0)
2432
2432
  throw new Error(`DiagramPort with id "${n}" already exists`);
@@ -2485,7 +2485,7 @@ class It extends $t {
2485
2485
  */
2486
2486
  get look() {
2487
2487
  var t, e, o, a;
2488
- return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (t = this.type || jt) == null ? void 0 : t.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (e = this.type || jt) == null ? void 0 : e.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (o = this.type || jt) == null ? void 0 : o.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (a = this.type || jt) == null ? void 0 : a.defaultLook;
2488
+ return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (t = this.type || Kt) == null ? void 0 : t.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (e = this.type || Kt) == null ? void 0 : e.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (o = this.type || Kt) == null ? void 0 : o.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (a = this.type || Kt) == null ? void 0 : a.defaultLook;
2489
2489
  }
2490
2490
  /**
2491
2491
  * Sets the look configuration of the look to override the one determined by the type.
@@ -2494,7 +2494,7 @@ class It extends $t {
2494
2494
  */
2495
2495
  set look(t) {
2496
2496
  if (t) {
2497
- const e = rt(
2497
+ const e = at(
2498
2498
  t
2499
2499
  );
2500
2500
  this._defaultLook = {
@@ -2519,7 +2519,7 @@ class It extends $t {
2519
2519
  */
2520
2520
  get width() {
2521
2521
  var t;
2522
- return ((t = this.type) == null ? void 0 : t.width) || xi.width;
2522
+ return ((t = this.type) == null ? void 0 : t.width) || Ei.width;
2523
2523
  }
2524
2524
  /**
2525
2525
  * Current height of this port. Same as the width.
@@ -2572,7 +2572,7 @@ class It extends $t {
2572
2572
  }
2573
2573
  getPriority() {
2574
2574
  var t;
2575
- return ((t = this.rootElement) == null ? void 0 : t.getPriority()) || Vt;
2575
+ return ((t = this.rootElement) == null ? void 0 : t.getPriority()) || Ot;
2576
2576
  }
2577
2577
  /**
2578
2578
  * Change the coordinates of this port to the given coordinates and move its labels correspondingly.
@@ -2595,23 +2595,23 @@ class It extends $t {
2595
2595
  ]), this.updateInView();
2596
2596
  }
2597
2597
  distanceTo(t) {
2598
- return pi(this.coords, t);
2598
+ return bi(this.coords, t);
2599
2599
  }
2600
2600
  }
2601
- class So extends yt {
2601
+ class Io extends bt {
2602
2602
  /**
2603
2603
  * Instance a set of ports for the given model. This method is used internally.
2604
2604
  * @private
2605
2605
  */
2606
2606
  constructor(t) {
2607
- super(), this.types = new te(), this.model = t;
2607
+ super(), this.types = new ie(), this.model = t;
2608
2608
  }
2609
2609
  /**
2610
2610
  * Instance a new port and add it to this set. This method is normally called when instancing an element with a port and it is rarely called by itself.
2611
2611
  * @private
2612
2612
  */
2613
2613
  new(t, e, o, a, l, s, n = "floating", r = "floating") {
2614
- const c = new It(
2614
+ const c = new At(
2615
2615
  this.model,
2616
2616
  t,
2617
2617
  e,
@@ -2635,7 +2635,7 @@ class So extends yt {
2635
2635
  }
2636
2636
  }
2637
2637
  }
2638
- class Li {
2638
+ class Ti {
2639
2639
  import(t, e) {
2640
2640
  t.clear(), e.id && (t.id = e.id), t.name = e.name, t.description = e.description, t.type = e.type, t.createdAt = new Date(e.createdAt), t.updatedAt = new Date(e.updatedAt);
2641
2641
  for (const o of e.nodes || [])
@@ -2668,17 +2668,17 @@ class Li {
2668
2668
  }
2669
2669
  if (o.label) {
2670
2670
  const g = {
2671
- ...H,
2671
+ ...F,
2672
2672
  ...o.label
2673
- }, v = new pt(
2673
+ }, v = new vt(
2674
2674
  t,
2675
2675
  f,
2676
2676
  [
2677
2677
  f.coords[0] + tt(g),
2678
2678
  f.coords[1] + Z(g)
2679
2679
  ],
2680
- f.width - tt(g) - lt(g),
2681
- f.height - Z(g) - st(g),
2680
+ f.width - tt(g) - ct(g),
2681
+ f.height - Z(g) - nt(g),
2682
2682
  g.fontSize,
2683
2683
  g.fontFamily,
2684
2684
  g.color,
@@ -2711,17 +2711,17 @@ class Li {
2711
2711
  );
2712
2712
  if ((l = f.sections) == null || l.push(v), t.sections.add(v), g.label && (c = (r = (n = (s = o.sectionGrid) == null ? void 0 : s.sections) == null ? void 0 : n[g.indexYInNode]) == null ? void 0 : r[g.indexXInNode]) != null && c.label) {
2713
2713
  const y = {
2714
- ...H,
2714
+ ...F,
2715
2715
  ...(p = (u = (h = (d = o.sectionGrid) == null ? void 0 : d.sections) == null ? void 0 : h[g.indexYInNode]) == null ? void 0 : u[g.indexXInNode]) == null ? void 0 : p.label
2716
- }, A = new pt(
2716
+ }, A = new vt(
2717
2717
  t,
2718
2718
  v,
2719
2719
  [
2720
2720
  v.coords[0] + tt(y),
2721
2721
  v.coords[1] + Z(y)
2722
2722
  ],
2723
- v.width - tt(y) - lt(y),
2724
- v.height - Z(y) - st(y),
2723
+ v.width - tt(y) - ct(y),
2724
+ v.height - Z(y) - nt(y),
2725
2725
  y.fontSize,
2726
2726
  y.fontFamily,
2727
2727
  y.color,
@@ -2738,7 +2738,7 @@ class Li {
2738
2738
  }
2739
2739
  let w = 0;
2740
2740
  for (const y of g.ports || []) {
2741
- const A = y.type !== void 0 ? t.ports.types.get(y.type) : void 0, I = new It(
2741
+ const A = y.type !== void 0 ? t.ports.types.get(y.type) : void 0, I = new At(
2742
2742
  t,
2743
2743
  A,
2744
2744
  v,
@@ -2750,7 +2750,7 @@ class Li {
2750
2750
  if (v.ports.push(I), t.ports.add(I), y.label) {
2751
2751
  if (o.ports.length > w && (A != null && A.label)) {
2752
2752
  const E = {
2753
- ...H,
2753
+ ...F,
2754
2754
  ...A == null ? void 0 : A.label
2755
2755
  };
2756
2756
  let $;
@@ -2777,7 +2777,7 @@ class Li {
2777
2777
  default:
2778
2778
  $ = I.coords;
2779
2779
  }
2780
- const C = new pt(
2780
+ const C = new vt(
2781
2781
  t,
2782
2782
  I,
2783
2783
  $,
@@ -2808,7 +2808,7 @@ class Li {
2808
2808
  }
2809
2809
  let m = 0;
2810
2810
  for (const g of e.ports || []) {
2811
- const v = g.type !== void 0 ? t.ports.types.get(g.type) : void 0, w = new It(
2811
+ const v = g.type !== void 0 ? t.ports.types.get(g.type) : void 0, w = new At(
2812
2812
  t,
2813
2813
  v,
2814
2814
  f,
@@ -2820,7 +2820,7 @@ class Li {
2820
2820
  if (f.ports.push(w), t.ports.add(w), g.label) {
2821
2821
  if (o.ports.length > m && (v != null && v.label)) {
2822
2822
  const y = {
2823
- ...H,
2823
+ ...F,
2824
2824
  ...v == null ? void 0 : v.label
2825
2825
  };
2826
2826
  let A;
@@ -2847,7 +2847,7 @@ class Li {
2847
2847
  default:
2848
2848
  A = w.coords;
2849
2849
  }
2850
- const I = new pt(
2850
+ const I = new vt(
2851
2851
  t,
2852
2852
  w,
2853
2853
  A,
@@ -2877,7 +2877,7 @@ class Li {
2877
2877
  importConnection(t, e) {
2878
2878
  const o = t.connections.types.get(e.type);
2879
2879
  if (o) {
2880
- const a = new gt(
2880
+ const a = new ut(
2881
2881
  t,
2882
2882
  o,
2883
2883
  e.start ? t.ports.get(e.start) : void 0,
@@ -2893,7 +2893,7 @@ class Li {
2893
2893
  t && e && (t.selfRemoved = e.selfRemoved, t.selfRemovedTimestamp = e.selfRemovedTimestamp, t.textTimestamp = e.textTimestamp);
2894
2894
  }
2895
2895
  }
2896
- class ie {
2896
+ class se {
2897
2897
  constructor(t, e, o, a, l, s, n) {
2898
2898
  this.canvas = t, this.id = e, this.typeId = o, this.coords = a, this.parentId = l, this.label = s, this.values = n;
2899
2899
  }
@@ -2919,7 +2919,7 @@ class ie {
2919
2919
  };
2920
2920
  }
2921
2921
  static deserialize(t, e) {
2922
- return new ie(
2922
+ return new se(
2923
2923
  t,
2924
2924
  e.id,
2925
2925
  e.typeId,
@@ -2930,13 +2930,13 @@ class ie {
2930
2930
  );
2931
2931
  }
2932
2932
  }
2933
- class ke {
2933
+ class Ie {
2934
2934
  constructor(t, e, o, a, l, s, n) {
2935
2935
  this.canvas = t, this.nodeId = e, this.copyColumnIndex = o, this.copyRowIndex = a, this.removeColumnIndex = l, this.removeRowIndex = s, this.timestamp = n;
2936
2936
  }
2937
2937
  do() {
2938
2938
  const t = this.canvas.model.nodes.get(this.nodeId);
2939
- t && At(this.timestamp, t.geometryTimestamp) && (this.copyColumnIndex !== void 0 && t.copySectionColumn(this.copyColumnIndex), this.copyRowIndex !== void 0 && t.copySectionRow(this.copyRowIndex), this.removeColumnIndex !== void 0 && t.removeSectionColumn(this.removeColumnIndex), this.removeRowIndex !== void 0 && t.removeSectionRow(this.removeRowIndex), t.geometryTimestamp = this.timestamp);
2939
+ t && xt(this.timestamp, t.geometryTimestamp) && (this.copyColumnIndex !== void 0 && t.copySectionColumn(this.copyColumnIndex), this.copyRowIndex !== void 0 && t.copySectionRow(this.copyRowIndex), this.removeColumnIndex !== void 0 && t.removeSectionColumn(this.removeColumnIndex), this.removeRowIndex !== void 0 && t.removeSectionRow(this.removeRowIndex), t.geometryTimestamp = this.timestamp);
2940
2940
  }
2941
2941
  serialize() {
2942
2942
  return {
@@ -2950,7 +2950,7 @@ class ke {
2950
2950
  };
2951
2951
  }
2952
2952
  static deserialize(t, e) {
2953
- return new ke(
2953
+ return new Ie(
2954
2954
  t,
2955
2955
  e.nodeId,
2956
2956
  e.copyColumnIndex,
@@ -2961,14 +2961,14 @@ class ke {
2961
2961
  );
2962
2962
  }
2963
2963
  }
2964
- class we {
2964
+ class Ae {
2965
2965
  constructor(t, e, o) {
2966
2966
  this.canvas = t, this.to = e, this.timestamp = o;
2967
2967
  }
2968
2968
  do() {
2969
2969
  for (const t in this.to) {
2970
2970
  const e = this.canvas.model.nodes.get(t, !0);
2971
- if (e && At(this.timestamp, e.geometryTimestamp)) {
2971
+ if (e && xt(this.timestamp, e.geometryTimestamp)) {
2972
2972
  const o = this.to[t];
2973
2973
  e.move([o[0], o[1]]), e.geometryTimestamp = this.timestamp;
2974
2974
  }
@@ -2982,14 +2982,14 @@ class we {
2982
2982
  };
2983
2983
  }
2984
2984
  static deserialize(t, e) {
2985
- return new we(
2985
+ return new Ae(
2986
2986
  t,
2987
2987
  e.to,
2988
2988
  e.timestamp
2989
2989
  );
2990
2990
  }
2991
2991
  }
2992
- class Ft {
2992
+ class Xt {
2993
2993
  constructor(t, e, o, a) {
2994
2994
  this.canvas = t, this.nodeIds = e, this.delta = o, this.timestamp = a;
2995
2995
  }
@@ -2997,7 +2997,7 @@ class Ft {
2997
2997
  var t;
2998
2998
  for (const e of this.nodeIds) {
2999
2999
  const o = this.canvas.model.nodes.get(e, !0);
3000
- o && At(this.timestamp, o.geometryTimestamp) && (o.move([
3000
+ o && xt(this.timestamp, o.geometryTimestamp) && (o.move([
3001
3001
  o.coords[0] + this.delta[0],
3002
3002
  o.coords[1] + this.delta[1]
3003
3003
  ]), (t = o.parent) == null || t.fitToChild(o), o.geometryTimestamp = this.timestamp);
@@ -3012,7 +3012,7 @@ class Ft {
3012
3012
  };
3013
3013
  }
3014
3014
  static deserialize(t, e) {
3015
- return new Ft(
3015
+ return new Xt(
3016
3016
  t,
3017
3017
  e.nodeIds,
3018
3018
  e.delta,
@@ -3020,14 +3020,14 @@ class Ft {
3020
3020
  );
3021
3021
  }
3022
3022
  }
3023
- class nt {
3023
+ class rt {
3024
3024
  constructor(t, e, o, a) {
3025
3025
  this.canvas = t, this.nodeId = e, this.to = o, this.timestamp = a;
3026
3026
  }
3027
3027
  do() {
3028
3028
  var e, o, a;
3029
3029
  const t = this.canvas.model.nodes.get(this.nodeId, !0);
3030
- if (t && At(this.timestamp, t.geometryTimestamp)) {
3030
+ if (t && xt(this.timestamp, t.geometryTimestamp)) {
3031
3031
  t.setGeometry(this.to), (e = t.label) != null && e.fit && this.canvas.fitFieldRootInView(t.label.id, t.label.shrink);
3032
3032
  for (const l of t.sections)
3033
3033
  (o = l.label) != null && o.fit && this.canvas.fitFieldRootInView(
@@ -3046,7 +3046,7 @@ class nt {
3046
3046
  };
3047
3047
  }
3048
3048
  static deserialize(t, e) {
3049
- return new nt(
3049
+ return new rt(
3050
3050
  t,
3051
3051
  e.nodeId,
3052
3052
  e.to,
@@ -3054,14 +3054,14 @@ class nt {
3054
3054
  );
3055
3055
  }
3056
3056
  }
3057
- class Ut {
3057
+ class jt {
3058
3058
  constructor(t, e, o, a, l) {
3059
3059
  this.canvas = t, this.childId = e, this.parentId = o, this.childGeometry = a, this.timestamp = l;
3060
3060
  }
3061
3061
  do() {
3062
3062
  var o;
3063
3063
  const t = this.canvas.model.nodes.get(this.childId, !0), e = this.parentId !== void 0 ? this.canvas.model.nodes.get(this.parentId, !0) : void 0;
3064
- t && (this.parentId === void 0 || e) && At(this.timestamp, t.geometryTimestamp) && ((o = t.parent) == null || o.removeChild(t), t.setGeometry(this.childGeometry), e == null || e.addChild(t));
3064
+ t && (this.parentId === void 0 || e) && xt(this.timestamp, t.geometryTimestamp) && ((o = t.parent) == null || o.removeChild(t), t.setGeometry(this.childGeometry), e == null || e.addChild(t));
3065
3065
  }
3066
3066
  serialize() {
3067
3067
  return {
@@ -3073,7 +3073,7 @@ class Ut {
3073
3073
  };
3074
3074
  }
3075
3075
  static deserialize(t, e) {
3076
- return new Ut(
3076
+ return new jt(
3077
3077
  t,
3078
3078
  e.childId,
3079
3079
  e.parentId,
@@ -3082,7 +3082,7 @@ class Ut {
3082
3082
  );
3083
3083
  }
3084
3084
  }
3085
- class oe {
3085
+ class ne {
3086
3086
  constructor(t, e, o, a, l) {
3087
3087
  this.canvas = t, this.id = e, this.typeId = o, this.startId = a, this.endId = l;
3088
3088
  }
@@ -3100,7 +3100,7 @@ class oe {
3100
3100
  };
3101
3101
  }
3102
3102
  static deserialize(t, e) {
3103
- return new oe(
3103
+ return new ne(
3104
3104
  t,
3105
3105
  e.id,
3106
3106
  e.typeId,
@@ -3109,13 +3109,13 @@ class oe {
3109
3109
  );
3110
3110
  }
3111
3111
  }
3112
- class zt {
3112
+ class Rt {
3113
3113
  constructor(t, e, o, a) {
3114
3114
  this.canvas = t, this.fieldId = e, this.to = o, this.timestamp = a;
3115
3115
  }
3116
3116
  do() {
3117
3117
  const t = this.canvas.model.fields.get(this.fieldId, !0);
3118
- t && At(this.timestamp, t.textTimestamp) && (t.text = this.to, t.textTimestamp = this.timestamp);
3118
+ t && xt(this.timestamp, t.textTimestamp) && (t.text = this.to, t.textTimestamp = this.timestamp);
3119
3119
  }
3120
3120
  serialize() {
3121
3121
  return {
@@ -3126,7 +3126,7 @@ class zt {
3126
3126
  };
3127
3127
  }
3128
3128
  static deserialize(t, e) {
3129
- return new zt(
3129
+ return new Rt(
3130
3130
  t,
3131
3131
  e.fieldId,
3132
3132
  e.to,
@@ -3134,7 +3134,7 @@ class zt {
3134
3134
  );
3135
3135
  }
3136
3136
  }
3137
- class Rt {
3137
+ class Vt {
3138
3138
  constructor(t, e, o, a) {
3139
3139
  this.canvas = t, this.id = e, this.to = o, this.timestamp = a;
3140
3140
  }
@@ -3155,7 +3155,7 @@ class Rt {
3155
3155
  };
3156
3156
  }
3157
3157
  static deserialize(t, e) {
3158
- return new Rt(
3158
+ return new Vt(
3159
3159
  t,
3160
3160
  e.id,
3161
3161
  e.to,
@@ -3163,12 +3163,12 @@ class Rt {
3163
3163
  );
3164
3164
  }
3165
3165
  }
3166
- class dt {
3166
+ class ht {
3167
3167
  constructor(t, e, o, a, l, s, n, r) {
3168
3168
  this.canvas = t, this.nodeIds = e, this.sectionIds = o, this.portIds = a, this.connectionIds = l, this.fieldIds = s, this.selfRemoved = n, this.timestamp = r;
3169
3169
  }
3170
3170
  doOne(t) {
3171
- t && At(this.timestamp, t.selfRemovedTimestamp) && (t.selfRemoved = this.selfRemoved, t.selfRemovedTimestamp = this.timestamp);
3171
+ t && xt(this.timestamp, t.selfRemovedTimestamp) && (t.selfRemoved = this.selfRemoved, t.selfRemovedTimestamp = this.timestamp);
3172
3172
  }
3173
3173
  do() {
3174
3174
  for (const t of this.nodeIds)
@@ -3196,7 +3196,7 @@ class dt {
3196
3196
  };
3197
3197
  }
3198
3198
  static deserialize(t, e) {
3199
- return new dt(
3199
+ return new ht(
3200
3200
  t,
3201
3201
  e.nodeIds,
3202
3202
  e.sectionIds,
@@ -3208,12 +3208,12 @@ class dt {
3208
3208
  );
3209
3209
  }
3210
3210
  }
3211
- class se {
3211
+ class re {
3212
3212
  constructor(t, e, o) {
3213
3213
  this.canvas = t, this.nodes = e, this.connections = o;
3214
3214
  }
3215
3215
  do() {
3216
- const t = new Li();
3216
+ const t = new Ti();
3217
3217
  this.canvas.userSelection.clear();
3218
3218
  for (const e of this.nodes) {
3219
3219
  const o = t.importNode(this.canvas.model, e);
@@ -3235,16 +3235,16 @@ class se {
3235
3235
  };
3236
3236
  }
3237
3237
  static deserialize(t, e) {
3238
- return new se(
3238
+ return new re(
3239
3239
  t,
3240
3240
  e.nodes,
3241
3241
  e.connections
3242
3242
  );
3243
3243
  }
3244
3244
  }
3245
- class Io {
3245
+ class Ao {
3246
3246
  constructor(t) {
3247
- this.isInRoom = !1, this.canvas = t, this.replicaId = ri();
3247
+ this.isInRoom = !1, this.canvas = t, this.replicaId = ci();
3248
3248
  }
3249
3249
  /**
3250
3250
  * Returns a fresh timestamp, suitable for use by new CollabActions.
@@ -3256,7 +3256,7 @@ class Io {
3256
3256
  * Returns a fresh unique ID, suitable for use by new CollabActions.
3257
3257
  */
3258
3258
  freshId() {
3259
- return "id" + ri();
3259
+ return "id" + ci();
3260
3260
  }
3261
3261
  /**
3262
3262
  * Performs the action - immediately locally, and eventually for remote collaborators.
@@ -3279,62 +3279,62 @@ class Io {
3279
3279
  t.timestamp[0]
3280
3280
  )), t.type) {
3281
3281
  case "addNode": {
3282
- ie.deserialize(this.canvas, t).do();
3282
+ se.deserialize(this.canvas, t).do();
3283
3283
  break;
3284
3284
  }
3285
3285
  case "addSection": {
3286
- ke.deserialize(this.canvas, t).do();
3286
+ Ie.deserialize(this.canvas, t).do();
3287
3287
  break;
3288
3288
  }
3289
3289
  case "applyLayout": {
3290
- we.deserialize(
3290
+ Ae.deserialize(
3291
3291
  this.canvas,
3292
3292
  t
3293
3293
  ).do();
3294
3294
  break;
3295
3295
  }
3296
3296
  case "move": {
3297
- Ft.deserialize(this.canvas, t).do();
3297
+ Xt.deserialize(this.canvas, t).do();
3298
3298
  break;
3299
3299
  }
3300
3300
  case "setGeometry": {
3301
- nt.deserialize(
3301
+ rt.deserialize(
3302
3302
  this.canvas,
3303
3303
  t
3304
3304
  ).do();
3305
3305
  break;
3306
3306
  }
3307
3307
  case "setParent": {
3308
- Ut.deserialize(this.canvas, t).do();
3308
+ jt.deserialize(this.canvas, t).do();
3309
3309
  break;
3310
3310
  }
3311
3311
  case "addConnection": {
3312
- oe.deserialize(
3312
+ ne.deserialize(
3313
3313
  this.canvas,
3314
3314
  t
3315
3315
  ).do();
3316
3316
  break;
3317
3317
  }
3318
3318
  case "editField": {
3319
- zt.deserialize(this.canvas, t).do();
3319
+ Rt.deserialize(this.canvas, t).do();
3320
3320
  break;
3321
3321
  }
3322
3322
  case "updateValues": {
3323
- Rt.deserialize(
3323
+ Vt.deserialize(
3324
3324
  this.canvas,
3325
3325
  t
3326
3326
  ).do();
3327
3327
  break;
3328
3328
  }
3329
3329
  case "setSelfRemoved": {
3330
- dt.deserialize(
3330
+ ht.deserialize(
3331
3331
  this.canvas,
3332
3332
  t
3333
3333
  ).do();
3334
3334
  break;
3335
3335
  }
3336
3336
  case "paste": {
3337
- se.deserialize(this.canvas, t).do();
3337
+ re.deserialize(this.canvas, t).do();
3338
3338
  break;
3339
3339
  }
3340
3340
  default:
@@ -3345,7 +3345,7 @@ class Io {
3345
3345
  }
3346
3346
  }
3347
3347
  }
3348
- class Ao {
3348
+ class xo {
3349
3349
  constructor(t, e) {
3350
3350
  this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
3351
3351
  }
@@ -3398,12 +3398,12 @@ class Ao {
3398
3398
  }
3399
3399
  }
3400
3400
  var S = /* @__PURE__ */ ((i) => (i.AddConnection = "add-connection", i.AddNode = "add-node", i.AddSectionAction = "add-section", i.ApplyLayout = "apply-layout", i.Clipboard = "clipboard", i.ContextMenu = "context-menu", i.EditField = "edit-field", i.MoveNode = "move-node", i.Paste = "paste", i.Remove = "remove", i.StretchNode = "stretch-node", i.StretchSection = "stretch-section", i.UpdateValues = "update-values", i.Zoom = "zoom", i))(S || {});
3401
- class xo {
3401
+ class Lo {
3402
3402
  constructor(t, e, o, a, l, s, n, r, c) {
3403
3403
  this.canvas = t, this.type = e, this.coords = o, this.parentId = a, this.ancestorId = l, this.fromAncestorGeometry = s, this.toAncestorGeometry = n, this.label = r, this.values = c, this.id = this.canvas.collabEngine.freshId();
3404
3404
  }
3405
3405
  do() {
3406
- const t = new ie(
3406
+ const t = new se(
3407
3407
  this.canvas,
3408
3408
  this.id,
3409
3409
  this.type.id,
@@ -3413,7 +3413,7 @@ class xo {
3413
3413
  this.values
3414
3414
  );
3415
3415
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3416
- const e = new nt(
3416
+ const e = new rt(
3417
3417
  this.canvas,
3418
3418
  this.ancestorId,
3419
3419
  this.toAncestorGeometry,
@@ -3424,7 +3424,7 @@ class xo {
3424
3424
  return !0;
3425
3425
  }
3426
3426
  undo() {
3427
- const t = this.canvas.model.nodes.get(this.id), e = new dt(
3427
+ const t = this.canvas.model.nodes.get(this.id), e = new ht(
3428
3428
  this.canvas,
3429
3429
  [this.id],
3430
3430
  [],
@@ -3435,7 +3435,7 @@ class xo {
3435
3435
  this.canvas.collabEngine.freshTimestamp()
3436
3436
  );
3437
3437
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3438
- const o = new nt(
3438
+ const o = new rt(
3439
3439
  this.canvas,
3440
3440
  this.ancestorId,
3441
3441
  this.fromAncestorGeometry,
@@ -3446,7 +3446,7 @@ class xo {
3446
3446
  return t !== void 0;
3447
3447
  }
3448
3448
  redo() {
3449
- const t = this.canvas.model.nodes.get(this.id), e = new dt(
3449
+ const t = this.canvas.model.nodes.get(this.id), e = new ht(
3450
3450
  this.canvas,
3451
3451
  [this.id],
3452
3452
  [],
@@ -3457,7 +3457,7 @@ class xo {
3457
3457
  this.canvas.collabEngine.freshTimestamp()
3458
3458
  );
3459
3459
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3460
- const o = new nt(
3460
+ const o = new rt(
3461
3461
  this.canvas,
3462
3462
  this.ancestorId,
3463
3463
  this.toAncestorGeometry,
@@ -3468,12 +3468,12 @@ class xo {
3468
3468
  return t === void 0;
3469
3469
  }
3470
3470
  }
3471
- class ce {
3471
+ class he {
3472
3472
  constructor(t, e, o) {
3473
3473
  this.canvas = t, this.nodeIds = e, this.delta = o;
3474
3474
  }
3475
3475
  do() {
3476
- const t = new Ft(
3476
+ const t = new Xt(
3477
3477
  this.canvas,
3478
3478
  this.nodeIds,
3479
3479
  this.delta,
@@ -3482,7 +3482,7 @@ class ce {
3482
3482
  return this.canvas.collabEngine.doCollaboratively(t), this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) && (this.delta[0] !== 0 || this.delta[1] !== 0);
3483
3483
  }
3484
3484
  undo() {
3485
- const t = new Ft(
3485
+ const t = new Xt(
3486
3486
  this.canvas,
3487
3487
  this.nodeIds,
3488
3488
  [-this.delta[0], -this.delta[1]],
@@ -3501,14 +3501,14 @@ class J {
3501
3501
  do() {
3502
3502
  const t = this.canvas.model.nodes.get(this.nodeId);
3503
3503
  if (t) {
3504
- const e = new nt(
3504
+ const e = new rt(
3505
3505
  this.canvas,
3506
3506
  this.nodeId,
3507
3507
  this.to,
3508
3508
  this.canvas.collabEngine.freshTimestamp()
3509
3509
  );
3510
3510
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3511
- const o = new nt(
3511
+ const o = new rt(
3512
3512
  this.canvas,
3513
3513
  this.ancestorId,
3514
3514
  this.toAncestorGeometry,
@@ -3523,14 +3523,14 @@ class J {
3523
3523
  const t = this.canvas.model.nodes.get(this.nodeId);
3524
3524
  if (t) {
3525
3525
  this.to = t.getGeometry();
3526
- const e = new nt(
3526
+ const e = new rt(
3527
3527
  this.canvas,
3528
3528
  this.nodeId,
3529
3529
  this.from,
3530
3530
  this.canvas.collabEngine.freshTimestamp()
3531
3531
  );
3532
3532
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3533
- const o = new nt(
3533
+ const o = new rt(
3534
3534
  this.canvas,
3535
3535
  this.ancestorId,
3536
3536
  this.fromAncestorGeometry,
@@ -3545,7 +3545,7 @@ class J {
3545
3545
  const t = this.canvas.model.nodes.get(this.nodeId);
3546
3546
  if (t) {
3547
3547
  this.from = t.getGeometry();
3548
- const e = new nt(
3548
+ const e = new rt(
3549
3549
  this.canvas,
3550
3550
  this.nodeId,
3551
3551
  this.to,
@@ -3556,12 +3556,12 @@ class J {
3556
3556
  return t !== void 0;
3557
3557
  }
3558
3558
  }
3559
- class Lo {
3559
+ class Eo {
3560
3560
  constructor(t, e, o, a, l, s, n, r, c) {
3561
3561
  this.canvas = t, this.childId = e, this.fromParentId = o, this.toParentId = a, this.fromChildGeometry = l, this.toChildGeometry = s, this.ancestorId = n, this.fromAncestorGeometry = r, this.toAncestorGeometry = c;
3562
3562
  }
3563
3563
  do() {
3564
- const t = this.canvas.model.nodes.get(this.childId), e = new Ut(
3564
+ const t = this.canvas.model.nodes.get(this.childId), e = new jt(
3565
3565
  this.canvas,
3566
3566
  this.childId,
3567
3567
  this.toParentId,
@@ -3569,7 +3569,7 @@ class Lo {
3569
3569
  this.canvas.collabEngine.freshTimestamp()
3570
3570
  );
3571
3571
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3572
- const o = new nt(
3572
+ const o = new rt(
3573
3573
  this.canvas,
3574
3574
  this.ancestorId,
3575
3575
  this.toAncestorGeometry,
@@ -3580,7 +3580,7 @@ class Lo {
3580
3580
  return t !== void 0;
3581
3581
  }
3582
3582
  undo() {
3583
- const t = this.canvas.model.nodes.get(this.childId), e = new Ut(
3583
+ const t = this.canvas.model.nodes.get(this.childId), e = new jt(
3584
3584
  this.canvas,
3585
3585
  this.childId,
3586
3586
  this.fromParentId,
@@ -3588,7 +3588,7 @@ class Lo {
3588
3588
  this.canvas.collabEngine.freshTimestamp()
3589
3589
  );
3590
3590
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3591
- const o = new nt(
3591
+ const o = new rt(
3592
3592
  this.canvas,
3593
3593
  this.ancestorId,
3594
3594
  this.fromAncestorGeometry,
@@ -3602,12 +3602,12 @@ class Lo {
3602
3602
  return this.do();
3603
3603
  }
3604
3604
  }
3605
- class de {
3605
+ class ge {
3606
3606
  constructor(t, e, o, a) {
3607
3607
  this.canvas = t, this.type = e, this.startId = o, this.endId = a, this.id = this.canvas.collabEngine.freshId();
3608
3608
  }
3609
3609
  do() {
3610
- const t = new oe(
3610
+ const t = new ne(
3611
3611
  this.canvas,
3612
3612
  this.id,
3613
3613
  this.type.id,
@@ -3617,7 +3617,7 @@ class de {
3617
3617
  return this.canvas.collabEngine.doCollaboratively(t), !0;
3618
3618
  }
3619
3619
  undo() {
3620
- const t = this.canvas.model.connections.get(this.id), e = new dt(
3620
+ const t = this.canvas.model.connections.get(this.id), e = new ht(
3621
3621
  this.canvas,
3622
3622
  [],
3623
3623
  [],
@@ -3630,7 +3630,7 @@ class de {
3630
3630
  return this.canvas.collabEngine.doCollaboratively(e), t !== void 0;
3631
3631
  }
3632
3632
  redo() {
3633
- const t = this.canvas.model.connections.get(this.id), e = new dt(
3633
+ const t = this.canvas.model.connections.get(this.id), e = new ht(
3634
3634
  this.canvas,
3635
3635
  [],
3636
3636
  [],
@@ -3643,12 +3643,12 @@ class de {
3643
3643
  return this.canvas.collabEngine.doCollaboratively(e), t === void 0;
3644
3644
  }
3645
3645
  }
3646
- class di {
3646
+ class ui {
3647
3647
  constructor(t, e, o, a) {
3648
3648
  this.canvas = t, this.fieldId = e, this.from = o, this.to = a;
3649
3649
  }
3650
3650
  do() {
3651
- const t = this.canvas.model.fields.get(this.fieldId), e = new zt(
3651
+ const t = this.canvas.model.fields.get(this.fieldId), e = new Rt(
3652
3652
  this.canvas,
3653
3653
  this.fieldId,
3654
3654
  this.to,
@@ -3660,7 +3660,7 @@ class di {
3660
3660
  const t = this.canvas.model.fields.get(this.fieldId);
3661
3661
  if (t) {
3662
3662
  this.to = t.text;
3663
- const e = new zt(
3663
+ const e = new Rt(
3664
3664
  this.canvas,
3665
3665
  this.fieldId,
3666
3666
  this.from,
@@ -3674,7 +3674,7 @@ class di {
3674
3674
  const t = this.canvas.model.fields.get(this.fieldId);
3675
3675
  if (t) {
3676
3676
  this.from = t.text;
3677
- const e = new zt(
3677
+ const e = new Rt(
3678
3678
  this.canvas,
3679
3679
  this.fieldId,
3680
3680
  this.to,
@@ -3685,12 +3685,12 @@ class di {
3685
3685
  return t !== void 0;
3686
3686
  }
3687
3687
  }
3688
- class Eo {
3688
+ class To {
3689
3689
  constructor(t, e, o, a) {
3690
3690
  this.canvas = t, this.id = e, this.from = o, this.to = a;
3691
3691
  }
3692
3692
  do() {
3693
- const t = new Rt(
3693
+ const t = new Vt(
3694
3694
  this.canvas,
3695
3695
  this.id,
3696
3696
  this.to,
@@ -3699,7 +3699,7 @@ class Eo {
3699
3699
  return this.canvas.collabEngine.doCollaboratively(t), !0;
3700
3700
  }
3701
3701
  undo() {
3702
- const t = new Rt(
3702
+ const t = new Vt(
3703
3703
  this.canvas,
3704
3704
  this.id,
3705
3705
  this.from,
@@ -3712,7 +3712,7 @@ class Eo {
3712
3712
  return !e.rootElement.removed;
3713
3713
  }
3714
3714
  redo() {
3715
- const t = new Rt(
3715
+ const t = new Vt(
3716
3716
  this.canvas,
3717
3717
  this.id,
3718
3718
  this.to,
@@ -3725,7 +3725,7 @@ class Eo {
3725
3725
  return !e.rootElement.removed;
3726
3726
  }
3727
3727
  }
3728
- class To {
3728
+ class $o {
3729
3729
  constructor(t, e, o, a, l, s) {
3730
3730
  this.canvas = t, this.nodeIds = e, this.sectionIds = o, this.portIds = a, this.connectionIds = l, this.fieldIds = s;
3731
3731
  }
@@ -3734,7 +3734,7 @@ class To {
3734
3734
  (o) => this.canvas.model.sections.get(o) !== void 0
3735
3735
  ).includes(!0) || this.portIds.map((o) => this.canvas.model.ports.get(o) !== void 0).includes(!0) || this.connectionIds.map(
3736
3736
  (o) => this.canvas.model.connections.get(o) !== void 0
3737
- ).includes(!0) || this.fieldIds.map((o) => this.canvas.model.fields.get(o) !== void 0).includes(!0), e = new dt(
3737
+ ).includes(!0) || this.fieldIds.map((o) => this.canvas.model.fields.get(o) !== void 0).includes(!0), e = new ht(
3738
3738
  this.canvas,
3739
3739
  this.nodeIds,
3740
3740
  this.sectionIds,
@@ -3751,7 +3751,7 @@ class To {
3751
3751
  (o) => this.canvas.model.sections.get(o) === void 0
3752
3752
  ).includes(!0) || this.portIds.map((o) => this.canvas.model.ports.get(o) === void 0).includes(!0) || this.connectionIds.map(
3753
3753
  (o) => this.canvas.model.connections.get(o) === void 0
3754
- ).includes(!0) || this.fieldIds.map((o) => this.canvas.model.fields.get(o) === void 0).includes(!0), e = new dt(
3754
+ ).includes(!0) || this.fieldIds.map((o) => this.canvas.model.fields.get(o) === void 0).includes(!0), e = new ht(
3755
3755
  this.canvas,
3756
3756
  this.nodeIds,
3757
3757
  this.sectionIds,
@@ -3767,7 +3767,7 @@ class To {
3767
3767
  return this.do();
3768
3768
  }
3769
3769
  }
3770
- class $o {
3770
+ class Mo {
3771
3771
  constructor(t, e, o, a) {
3772
3772
  this.canvas = t, this.nodes = e, this.connections = o, this.coords = a;
3773
3773
  }
@@ -3814,7 +3814,7 @@ class $o {
3814
3814
  l.points[n][1] + e[1]
3815
3815
  ];
3816
3816
  }
3817
- const a = new se(
3817
+ const a = new re(
3818
3818
  this.canvas,
3819
3819
  this.nodes,
3820
3820
  this.connections
@@ -3824,7 +3824,7 @@ class $o {
3824
3824
  undo() {
3825
3825
  const t = this.nodes.map((o) => this.canvas.model.nodes.get(o.id) !== void 0).includes(!0) || this.connections.map(
3826
3826
  (o) => this.canvas.model.connections.get(o.id) !== void 0
3827
- ).includes(!0), e = new dt(
3827
+ ).includes(!0), e = new ht(
3828
3828
  this.canvas,
3829
3829
  this.nodes.map((o) => o.id),
3830
3830
  [],
@@ -3839,7 +3839,7 @@ class $o {
3839
3839
  redo() {
3840
3840
  const t = this.nodes.map((o) => this.canvas.model.nodes.get(o.id) === void 0).includes(!0) || this.connections.map(
3841
3841
  (o) => this.canvas.model.connections.get(o.id) === void 0
3842
- ).includes(!0), e = new dt(
3842
+ ).includes(!0), e = new ht(
3843
3843
  this.canvas,
3844
3844
  this.nodes.map((o) => o.id),
3845
3845
  [],
@@ -3852,7 +3852,7 @@ class $o {
3852
3852
  return this.canvas.collabEngine.doCollaboratively(e), t;
3853
3853
  }
3854
3854
  }
3855
- class ne {
3855
+ class ae {
3856
3856
  constructor(t) {
3857
3857
  this.type = t, this.defaultPrevented = !1;
3858
3858
  }
@@ -3860,8 +3860,8 @@ class ne {
3860
3860
  this.defaultPrevented = !0;
3861
3861
  }
3862
3862
  }
3863
- var Ei = /* @__PURE__ */ ((i) => (i[i.DoubleClick = 0] = "DoubleClick", i[i.SecondaryClick = 1] = "SecondaryClick", i[i.Selection = 2] = "Selection", i[i.Highlight = 3] = "Highlight", i))(Ei || {});
3864
- class kt extends ne {
3863
+ var $i = /* @__PURE__ */ ((i) => (i[i.DoubleClick = 0] = "DoubleClick", i[i.SecondaryClick = 1] = "SecondaryClick", i[i.Selection = 2] = "Selection", i[i.Highlight = 3] = "Highlight", i))($i || {});
3864
+ class wt extends ae {
3865
3865
  /**
3866
3866
  * Create a diagram double click event.
3867
3867
  *
@@ -3876,7 +3876,7 @@ class kt extends ne {
3876
3876
  ), this.cause = t, this.target = e, this.coords = o;
3877
3877
  }
3878
3878
  }
3879
- class wt extends ne {
3879
+ class Ct extends ae {
3880
3880
  /**
3881
3881
  * Create a diagram secondary click event.
3882
3882
  *
@@ -3891,7 +3891,7 @@ class wt extends ne {
3891
3891
  ), this.cause = t, this.target = e, this.coords = o;
3892
3892
  }
3893
3893
  }
3894
- class F extends ne {
3894
+ class B extends ae {
3895
3895
  /**
3896
3896
  * Create a diagram selection event.
3897
3897
  *
@@ -3905,7 +3905,7 @@ class F extends ne {
3905
3905
  ), this.targets = t, this.selected = e;
3906
3906
  }
3907
3907
  }
3908
- class ot extends ne {
3908
+ class ot extends ae {
3909
3909
  /**
3910
3910
  * Create a diagram highlight event.
3911
3911
  *
@@ -3918,7 +3918,7 @@ class ot extends ne {
3918
3918
  ), this.target = t;
3919
3919
  }
3920
3920
  }
3921
- class Ti extends $t {
3921
+ class Mi extends Mt {
3922
3922
  constructor(t, e, o, a, l, s, n, r, c = "floating", d = "floating") {
3923
3923
  if (t.objects.get(r) !== void 0)
3924
3924
  throw new Error(`DiagramDecorator with id "${r}" already exists`);
@@ -3949,7 +3949,7 @@ class Ti extends $t {
3949
3949
  return this.priority;
3950
3950
  }
3951
3951
  }
3952
- class Mo extends yt {
3952
+ class No extends bt {
3953
3953
  /**
3954
3954
  * Instance a set of decorators for the given model. This method is used internally.
3955
3955
  * @private
@@ -3969,7 +3969,7 @@ class Mo extends yt {
3969
3969
  * @returns The instanced decorator.
3970
3970
  */
3971
3971
  new(t, e, o, a, l, s, n, r = "floating", c = "floating") {
3972
- const d = new Ti(
3972
+ const d = new Mi(
3973
3973
  this.model,
3974
3974
  t,
3975
3975
  e,
@@ -3988,7 +3988,7 @@ class Mo extends yt {
3988
3988
  e && ((e.rootElement instanceof O || e.rootElement instanceof X) && K(e.rootElement.decorators, e), super.remove(t), e.updateInView());
3989
3989
  }
3990
3990
  }
3991
- class No extends $t {
3991
+ class Po extends Mt {
3992
3992
  constructor(t, e, o, a, l, s, n) {
3993
3993
  if (t.objects.get(n) !== void 0)
3994
3994
  throw new Error(`DiagramObject with id "${n}" already exists`);
@@ -4019,7 +4019,7 @@ class No extends $t {
4019
4019
  return this.priority;
4020
4020
  }
4021
4021
  }
4022
- class Po extends yt {
4022
+ class zo extends bt {
4023
4023
  /**
4024
4024
  * Instance a set of objects for the given model. This method is used internally.
4025
4025
  * @private
@@ -4039,7 +4039,7 @@ class Po extends yt {
4039
4039
  * @returns The instanced object.
4040
4040
  */
4041
4041
  new(t, e, o, a, l, s) {
4042
- const n = new No(
4042
+ const n = new Po(
4043
4043
  this.model,
4044
4044
  t,
4045
4045
  e,
@@ -4055,9 +4055,9 @@ class Po extends yt {
4055
4055
  e && (super.remove(t), e.updateInView());
4056
4056
  }
4057
4057
  }
4058
- class $i {
4058
+ class Ni {
4059
4059
  constructor(t, e, o, a, l, s = []) {
4060
- this.nodes = new vo(this), this.sections = new po(this), this.ports = new So(this), this.connections = new co(this), this.fields = new ho(this), this.objects = new Po(this), this.decorators = new Mo(this), this.canvas = t, this.id = e, this.name = o, this.description = a, this.type = l, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new St(new ee(s), this);
4060
+ this.nodes = new yo(this), this.sections = new vo(this), this.ports = new Io(this), this.connections = new ho(this), this.fields = new go(this), this.objects = new zo(this), this.decorators = new No(this), this.canvas = t, this.id = e, this.name = o, this.description = a, this.type = l, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new It(new oe(s), this);
4061
4061
  }
4062
4062
  /**
4063
4063
  * Deletes everything in this diagram.
@@ -4068,7 +4068,7 @@ class $i {
4068
4068
  (t = this.canvas) == null || t.cancelAllUserActions(), this.id = void 0, this.name = "", this.description = void 0, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.nodes.clear(), this.sections.clear(), this.ports.clear(), this.connections.clear(), this.fields.clear(), this.objects.clear(), this.decorators.clear(), this.valueSet.resetValues(), (e = this.canvas) == null || e.updateModelInView();
4069
4069
  }
4070
4070
  }
4071
- const Ct = (i) => !!i.button, he = (i, t, e, o, a, l, s, n) => Xi(
4071
+ const St = (i) => !!i.button, ue = (i, t, e, o, a, l, s, n) => Wi(
4072
4072
  i,
4073
4073
  [t, e],
4074
4074
  o,
@@ -4081,13 +4081,39 @@ const Ct = (i) => !!i.button, he = (i, t, e, o, a, l, s, n) => Xi(
4081
4081
  ) * l
4082
4082
  ), x = (i) => {
4083
4083
  i ? N.select("body").style("cursor", i) : N.select("body").style("cursor", P.Auto);
4084
- }, ft = (i) => i instanceof O ? i : i instanceof X ? i.node || i : i.rootElement instanceof O || i.rootElement instanceof X || i.rootElement instanceof It ? ft(i.rootElement) : i, ge = (i) => {
4084
+ }, pt = (i) => i instanceof O ? i : i instanceof X ? i.node || i : i.rootElement instanceof O || i.rootElement instanceof X || i.rootElement instanceof At ? pt(i.rootElement) : i, me = (i) => {
4085
4085
  i.filter(".shaped-look").append("path"), i.filter(".image-look").append("image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "top-left-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "top-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "top-right-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "left-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "center-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "right-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "bottom-left-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "bottom-image").attr("preserveAspectRatio", "none"), i.filter(".stretchable-image-look").append("image").attr("class", "bottom-right-image").attr("preserveAspectRatio", "none");
4086
- }, ue = (i) => {
4086
+ }, Ft = {
4087
+ fillColor: "#FFFFFF",
4088
+ borderColor: "#000000",
4089
+ borderThickness: 1,
4090
+ borderStyle: Se.Solid
4091
+ }, fe = (i) => {
4087
4092
  i.filter(".shaped-look").select("path").attr(
4088
4093
  "d",
4089
- (t) => ve(t.look.shape, 0, 0, t.width, t.height)
4090
- ).attr("fill", (t) => t.look.fillColor).attr("stroke", (t) => t.look.borderColor).attr("stroke-width", (t) => `${t.look.borderThickness}px`), i.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("href", (t) => t.look.backgroundImage), i.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (t) => t.look.leftMargin).attr("height", (t) => t.look.topMargin).attr(
4094
+ (t) => ke(
4095
+ t.look.shape || _t.Rectangle,
4096
+ 0,
4097
+ 0,
4098
+ t.width,
4099
+ t.height
4100
+ )
4101
+ ).attr(
4102
+ "fill",
4103
+ (t) => t.look.fillColor || Ft.fillColor
4104
+ ).attr(
4105
+ "stroke",
4106
+ (t) => t.look.borderColor || Ft.borderColor
4107
+ ).attr(
4108
+ "stroke-width",
4109
+ (t) => `${t.look.borderThickness || Ft.borderThickness}px`
4110
+ ).attr(
4111
+ "stroke-dasharray",
4112
+ (t) => be(
4113
+ t.look.borderStyle || Ft.borderStyle,
4114
+ t.look.borderThickness || Ft.borderThickness
4115
+ )
4116
+ ), i.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("href", (t) => t.look.backgroundImage), i.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (t) => t.look.leftMargin).attr("height", (t) => t.look.topMargin).attr(
4091
4117
  "href",
4092
4118
  (t) => t.look.backgroundImageTopLeft
4093
4119
  ), i.filter(".stretchable-image-look").select("image.top-image").attr("x", (t) => t.look.leftMargin).attr("y", 0).attr(
@@ -4124,13 +4150,13 @@ const Ct = (i) => !!i.button, he = (i, t, e, o, a, l, s, n) => Xi(
4124
4150
  "href",
4125
4151
  (t) => t.look.backgroundImageBottomRight
4126
4152
  );
4127
- }, Ot = {
4153
+ }, Ht = {
4128
4154
  style: "dots",
4129
4155
  color: "rgba(0, 0, 0, 0.1)",
4130
4156
  snap: !1,
4131
4157
  spacing: 10,
4132
4158
  thickness: 0.05
4133
- }, zo = (i, t, e) => {
4159
+ }, Ro = (i, t, e) => {
4134
4160
  const o = t.append("defs");
4135
4161
  if (i.gridSize > 0 && isFinite(i.gridSize)) {
4136
4162
  const a = o.append("pattern").attr("id", e).attr("x", -i.gridSize / 2).attr("y", -i.gridSize / 2).attr("width", i.gridSize).attr("height", i.gridSize).attr("patternUnits", "userSpaceOnUse");
@@ -4150,17 +4176,17 @@ const Ct = (i) => !!i.button, he = (i, t, e, o, a, l, s, n) => Xi(
4150
4176
  }
4151
4177
  t.select("rect").attr("fill", `url(#${e})`);
4152
4178
  }
4153
- }, ye = 96, Q = 32, Nt = ye + Q, Ro = Math.PI / 4, Vo = 100, hi = {
4179
+ }, we = 96, Q = 32, Pt = we + Q, Vo = Math.PI / 4, _o = 100, mi = {
4154
4180
  customButtons: []
4155
4181
  };
4156
- class _o {
4182
+ class Oo {
4157
4183
  /**
4158
4184
  * Constructs a context menu object.
4159
4185
  * @public
4160
4186
  * @param canvas A canvas.
4161
4187
  */
4162
4188
  constructor(t, e) {
4163
- this.canvas = t, this.config = e || hi;
4189
+ this.canvas = t, this.config = e || mi;
4164
4190
  }
4165
4191
  /**
4166
4192
  * Opens the context menu at the location determined by the given mouse event.
@@ -4169,7 +4195,7 @@ class _o {
4169
4195
  */
4170
4196
  open(t) {
4171
4197
  this.close();
4172
- const e = this.canvas.getPointerLocationRelativeToRoot(t), o = this.canvas.getPointerLocationRelativeToCanvas(t), a = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - Nt}px`).attr("y", `${e[1] - Nt}px`).attr("width", `${2 * Nt}px`).attr("height", `${2 * Nt}px`).style("pointer-events", "none").on(L.ContextMenu, (s) => {
4198
+ const e = this.canvas.getPointerLocationRelativeToRoot(t), o = this.canvas.getPointerLocationRelativeToCanvas(t), a = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - Pt}px`).attr("y", `${e[1] - Pt}px`).attr("width", `${2 * Pt}px`).attr("height", `${2 * Pt}px`).style("pointer-events", "none").on(L.ContextMenu, (s) => {
4173
4199
  this.canvas.canUserPerformAction(S.ContextMenu) && (t.preventDefault(), this.open(s));
4174
4200
  }).on(L.Click, (s) => {
4175
4201
  s.preventDefault(), this.close();
@@ -4203,7 +4229,7 @@ class _o {
4203
4229
  s.userSelection.removeFromModel(), s.cancelAllUserActions();
4204
4230
  }
4205
4231
  });
4206
- for (const s of this.config.customButtons || hi.customButtons)
4232
+ for (const s of this.config.customButtons || mi.customButtons)
4207
4233
  (s.condition === void 0 || s.condition(this.canvas)) && l.push(s);
4208
4234
  l.length === 0 && l.push({
4209
4235
  name: "NONE",
@@ -4211,7 +4237,7 @@ class _o {
4211
4237
  onPress: void 0
4212
4238
  });
4213
4239
  for (let s = 0; s < l.length; ++s) {
4214
- const n = l[s], r = n.onPress, c = (s + 0.5 - l.length / 2) * Ro, d = a.append("xhtml:div").attr(
4240
+ const n = l[s], r = n.onPress, c = (s + 0.5 - l.length / 2) * Vo, d = a.append("xhtml:div").attr(
4215
4241
  "class",
4216
4242
  `daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
4217
4243
  ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * Q}px`).style("height", `${2 * Q}px`).style("border-radius", `${Q}px`).style("pointer-events", "auto").on(L.Click, (h) => {
@@ -4219,14 +4245,14 @@ class _o {
4219
4245
  }).on(L.KeyDown, (h) => {
4220
4246
  r && h.key === it.Enter && (h.preventDefault(), r(this.canvas));
4221
4247
  });
4222
- n.imageClass !== void 0 ? d.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && d.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).attr("src", n.image), d.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Q}px`).style("top", `${1.1 * Q}px`).style("text-align", "center").style("width", `${1.6 * Q}px`).style("height", `${0.35 * Q}px`).style("margin", "0").style("font-size", `${0.35 * Q}px`).style("font-weight", "700").style("user-select", "none").text(n.name), d.transition().ease(N.easeLinear).duration(Vo).tween("progress", () => (h) => {
4248
+ n.imageClass !== void 0 ? d.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && d.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).attr("src", n.image), d.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Q}px`).style("top", `${1.1 * Q}px`).style("text-align", "center").style("width", `${1.6 * Q}px`).style("height", `${0.35 * Q}px`).style("margin", "0").style("font-size", `${0.35 * Q}px`).style("font-weight", "700").style("user-select", "none").text(n.name), d.transition().ease(N.easeLinear).duration(_o).tween("progress", () => (h) => {
4223
4249
  const u = c * h;
4224
4250
  return d.style(
4225
4251
  "left",
4226
- `${Math.sin(u) * ye - Q + Nt}px`
4252
+ `${Math.sin(u) * we - Q + Pt}px`
4227
4253
  ).style(
4228
4254
  "top",
4229
- `${-Math.cos(u) * ye - Q + Nt}px`
4255
+ `${-Math.cos(u) * we - Q + Pt}px`
4230
4256
  );
4231
4257
  });
4232
4258
  }
@@ -4240,7 +4266,7 @@ class _o {
4240
4266
  (t = this.contextMenuContainer) == null || t.remove(), this.contextMenuContainer = void 0;
4241
4267
  }
4242
4268
  }
4243
- class Oo extends yt {
4269
+ class Do extends bt {
4244
4270
  /**
4245
4271
  * Constructs a user highlight object.
4246
4272
  * @public
@@ -4262,7 +4288,7 @@ class Oo extends yt {
4262
4288
  * @param element
4263
4289
  */
4264
4290
  focusOn(t) {
4265
- this.clear(), this.focus = t, (t instanceof pt || t instanceof Ti) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4291
+ this.clear(), this.focus = t, (t instanceof vt || t instanceof Mi) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4266
4292
  }
4267
4293
  add(t) {
4268
4294
  if (super.add(t), t instanceof O) {
@@ -4284,7 +4310,7 @@ class Oo extends yt {
4284
4310
  super.add(e), this.canvas.updatePortsInView(e.id);
4285
4311
  t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updateSectionsInView(t.id);
4286
4312
  }
4287
- else t instanceof It ? (t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updatePortsInView(t.id)) : t instanceof gt && this.canvas.updateConnectionsInView(t.id);
4313
+ else t instanceof At ? (t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updatePortsInView(t.id)) : t instanceof ut && this.canvas.updateConnectionsInView(t.id);
4288
4314
  }
4289
4315
  clear() {
4290
4316
  for (; this.entities.length > 0; ) {
@@ -4294,13 +4320,13 @@ class Oo extends yt {
4294
4320
  this.focus = void 0;
4295
4321
  }
4296
4322
  }
4297
- const Do = 1;
4298
- class Mi {
4323
+ const Fo = 1;
4324
+ class Pi {
4299
4325
  export(t, e = !1) {
4300
4326
  const o = {
4301
4327
  name: t.name,
4302
4328
  type: t.type,
4303
- typeVersion: Do,
4329
+ typeVersion: Fo,
4304
4330
  createdAt: t.createdAt,
4305
4331
  updatedAt: t.updatedAt,
4306
4332
  nodes: [],
@@ -4334,8 +4360,8 @@ class Mi {
4334
4360
  p.push({
4335
4361
  id: f.id,
4336
4362
  type: (s = f.type) == null ? void 0 : s.id,
4337
- coords: Mt(f.coords),
4338
- connectionPoint: Mt(f.connectionPoint),
4363
+ coords: Nt(f.coords),
4364
+ connectionPoint: Nt(f.connectionPoint),
4339
4365
  direction: f.direction,
4340
4366
  label: ((n = f.label) == null ? void 0 : n.text) || "",
4341
4367
  ...e ? {
@@ -4353,7 +4379,7 @@ class Mi {
4353
4379
  label: ((r = u.label) == null ? void 0 : r.text) || "",
4354
4380
  indexXInNode: u.indexXInNode,
4355
4381
  indexYInNode: u.indexYInNode,
4356
- coords: Mt(u.coords),
4382
+ coords: Nt(u.coords),
4357
4383
  width: u.width,
4358
4384
  height: u.height,
4359
4385
  ...e ? {
@@ -4371,8 +4397,8 @@ class Mi {
4371
4397
  l.push({
4372
4398
  id: u.id,
4373
4399
  type: (c = u.type) == null ? void 0 : c.id,
4374
- coords: Mt(u.coords),
4375
- connectionPoint: Mt(u.connectionPoint),
4400
+ coords: Nt(u.coords),
4401
+ connectionPoint: Nt(u.connectionPoint),
4376
4402
  direction: u.direction,
4377
4403
  label: ((d = u.label) == null ? void 0 : d.text) || "",
4378
4404
  ...e ? {
@@ -4391,7 +4417,7 @@ class Mi {
4391
4417
  sections: a,
4392
4418
  ports: l,
4393
4419
  label: ((h = t.label) == null ? void 0 : h.text) || "",
4394
- coords: Mt(t.coords),
4420
+ coords: Nt(t.coords),
4395
4421
  width: t.width,
4396
4422
  height: t.height,
4397
4423
  data: t.valueSet.getValues(),
@@ -4441,19 +4467,19 @@ class Mi {
4441
4467
  }
4442
4468
  }
4443
4469
  const Ho = "Diagram properties";
4444
- class Go extends yt {
4470
+ class Go extends bt {
4445
4471
  /**
4446
4472
  * Constructs a user selection object.
4447
4473
  * @public
4448
4474
  * @param canvas A canvas.
4449
4475
  */
4450
4476
  constructor(t) {
4451
- super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(Hi(2e3)).subscribe(() => {
4477
+ super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(Gi(2e3)).subscribe(() => {
4452
4478
  this.makeUpdateValuesAction();
4453
4479
  });
4454
4480
  }
4455
4481
  add(t) {
4456
- if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof O || t instanceof gt) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof X ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof O && t.sections))
4482
+ if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof O || t instanceof ut) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof X ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof O && t.sections))
4457
4483
  for (const e of t.sections)
4458
4484
  super.add(e), e.updateInView();
4459
4485
  }
@@ -4498,8 +4524,8 @@ class Go extends yt {
4498
4524
  if (this.length > 0) {
4499
4525
  const t = [], e = [], o = [], a = [], l = [];
4500
4526
  for (const n of this.all())
4501
- n instanceof O ? t.push(n.id) : n instanceof X ? e.push(n.id) : n instanceof It ? o.push(n.id) : n instanceof gt ? a.push(n.id) : n instanceof pt && l.push(n.id);
4502
- const s = new To(
4527
+ n instanceof O ? t.push(n.id) : n instanceof X ? e.push(n.id) : n instanceof At ? o.push(n.id) : n instanceof ut ? a.push(n.id) : n instanceof vt && l.push(n.id);
4528
+ const s = new $o(
4503
4529
  this.canvas,
4504
4530
  t,
4505
4531
  e,
@@ -4515,9 +4541,9 @@ class Go extends yt {
4515
4541
  * @public
4516
4542
  */
4517
4543
  copyToClipboard() {
4518
- const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new Mi();
4544
+ const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new Pi();
4519
4545
  for (const o of this.all())
4520
- o instanceof O && t.nodes.push(e.exportNode(o, !1)), o instanceof gt && t.connections.push(
4546
+ o instanceof O && t.nodes.push(e.exportNode(o, !1)), o instanceof ut && t.connections.push(
4521
4547
  e.exportConnection(o, !1)
4522
4548
  );
4523
4549
  navigator.clipboard.writeText(JSON.stringify(t));
@@ -4539,7 +4565,7 @@ class Go extends yt {
4539
4565
  const o = JSON.parse(e);
4540
4566
  if (o.type !== "daga-user-selection")
4541
4567
  return;
4542
- const a = new $o(
4568
+ const a = new Mo(
4543
4569
  this.canvas,
4544
4570
  o.nodes,
4545
4571
  o.connections,
@@ -4568,25 +4594,25 @@ class Go extends yt {
4568
4594
  const a = t == null ? void 0 : t.valueSet;
4569
4595
  a ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = structuredClone(
4570
4596
  a.getValues()
4571
- )), o && (t instanceof O || t instanceof gt ? (t instanceof O ? t.name ? o.title = `${t.type.name}: ${t.name}` : o.title = t.type.name : t instanceof gt && (o.title = t.type.name), o.valueSet = void 0, o.valueSet = a) : (o.title = Ho, o.valueSet = void 0, o.valueSet = a))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, o && (o.title = "", o.valueSet = void 0));
4597
+ )), o && (t instanceof O || t instanceof ut ? (t instanceof O ? t.name ? o.title = `${t.type.name}: ${t.name}` : o.title = t.type.name : t instanceof ut && (o.title = t.type.name), o.valueSet = void 0, o.valueSet = a) : (o.title = Ho, o.valueSet = void 0, o.valueSet = a))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, o && (o.title = "", o.valueSet = void 0));
4572
4598
  }
4573
4599
  makeUpdateValuesAction() {
4574
4600
  var n, r, c;
4575
4601
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
4576
4602
  return;
4577
- const t = this.propertyEditorSelection instanceof $i ? void 0 : this.propertyEditorSelection.id;
4578
- if (Lt(
4603
+ const t = this.propertyEditorSelection instanceof Ni ? void 0 : this.propertyEditorSelection.id;
4604
+ if (Et(
4579
4605
  this.propertyEditorValues,
4580
4606
  (n = this.propertyEditorSelection) == null ? void 0 : n.valueSet.getValues()
4581
4607
  ))
4582
4608
  return;
4583
4609
  const e = this.propertyEditorValues, o = structuredClone(
4584
4610
  (r = this.propertyEditorSelection) == null ? void 0 : r.valueSet.getValues()
4585
- ), [a, l] = ki(
4611
+ ), [a, l] = Ci(
4586
4612
  e,
4587
4613
  o,
4588
4614
  (c = this.propertyEditorSelection) == null ? void 0 : c.valueSet
4589
- ), s = new Eo(
4615
+ ), s = new To(
4590
4616
  this.canvas,
4591
4617
  t,
4592
4618
  a,
@@ -4595,10 +4621,10 @@ class Go extends yt {
4595
4621
  s.do(), this.canvas.actionStack.add(s), this.propertyEditorValues = o;
4596
4622
  }
4597
4623
  }
4598
- const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4624
+ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4599
4625
  const o = Bo(e), a = Math.sin(o), l = Math.cos(o), s = (Math.abs(i * l) - Math.abs(t * a)) / (l * l - a * a), n = (Math.abs(i * a) - Math.abs(t * l)) / (a * a - l * l);
4600
4626
  return [s, n];
4601
- }, Fo = 12, B = 6, Uo = 25, me = "diagram-connection-unfinished", Jt = class Jt {
4627
+ }, Uo = 12, G = 6, Yo = 25, pe = "diagram-connection-unfinished", ee = class ee {
4602
4628
  /**
4603
4629
  * Constructs a canvas object.
4604
4630
  * @public
@@ -4606,22 +4632,22 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4606
4632
  * @param config The configuration object used to set the parameters of this canvas.
4607
4633
  */
4608
4634
  constructor(t, e) {
4609
- var o, a, l, s, n, r, c, d, h, u, p, f, m, g, v, w, y, A, I, E, $, C, R, T, z, j, D, q, G;
4610
- if (this.backgroundPatternId = `daga-background-pattern-id-${Jt.canvasCount++}`, this.zoomTransform = N.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Xt(), this.diagramChange$ = new Xt(), this.diagramEvent$ = new Xt(), this.propertyEditorChanges$ = new Xt(), this.parentComponent = t, this.model = new $i(
4635
+ var o, a, l, s, n, r, c, d, h, u, p, f, m, g, v, w, y, A, I, E, $, C, R, T, z, j, D, q, H;
4636
+ if (this.backgroundPatternId = `daga-background-pattern-id-${ee.canvasCount++}`, this.zoomTransform = N.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Zt(), this.diagramChange$ = new Zt(), this.diagramEvent$ = new Zt(), this.propertyEditorChanges$ = new Zt(), this.parentComponent = t, this.model = new Ni(
4611
4637
  this,
4612
4638
  void 0,
4613
4639
  e.name || "unnamed",
4614
4640
  "",
4615
4641
  e.type || "",
4616
4642
  e.properties || []
4617
- ), this.userSelection = new Go(this), this.userHighlight = new Oo(
4643
+ ), this.userSelection = new Go(this), this.userHighlight = new Do(
4618
4644
  this,
4619
4645
  ((o = e.canvas) == null ? void 0 : o.highlightSections) !== !1
4620
- ), this.contextMenu = new _o(this, (a = e.canvas) == null ? void 0 : a.contextMenu), this.backgroundColor = ((l = e.canvas) == null ? void 0 : l.backgroundColor) || "#FFFFFF", this.gridStyle = ((n = (s = e.canvas) == null ? void 0 : s.grid) == null ? void 0 : n.style) ?? Ot.style, this.gridSize = ((c = (r = e.canvas) == null ? void 0 : r.grid) == null ? void 0 : c.enabled) === !1 || ((d = e.canvas) == null ? void 0 : d.grid) === void 0 ? 0 : Math.abs(((u = (h = e.canvas) == null ? void 0 : h.grid) == null ? void 0 : u.spacing) || Ot.spacing), this.gridThickness = Math.abs(
4621
- ((f = (p = e.canvas) == null ? void 0 : p.grid) == null ? void 0 : f.thickness) || Ot.thickness
4622
- ), this.gridColor = ((g = (m = e.canvas) == null ? void 0 : m.grid) == null ? void 0 : g.color) || Ot.color, this.snapToGrid = ((w = (v = e.canvas) == null ? void 0 : v.grid) == null ? void 0 : w.enabled) === !1 || ((y = e.canvas) == null ? void 0 : y.grid) === void 0 ? !1 : ((I = (A = e.canvas) == null ? void 0 : A.grid) == null ? void 0 : I.snap) || Ot.snap, this.zoomFactor = ((E = e.canvas) == null ? void 0 : E.zoomFactor) || 2, this.panRate = (($ = e.canvas) == null ? void 0 : $.panRate) || 100, this.inferConnectionType = ((C = e.connectionSettings) == null ? void 0 : C.inferConnectionType) || !1, this.autoTightenConnections = ((R = e.connectionSettings) == null ? void 0 : R.autoTighten) !== !1, this.allowConnectionLoops = ((T = e.connectionSettings) == null ? void 0 : T.allowLoops) || !1, this.allowSharingPorts = ((z = e.connectionSettings) == null ? void 0 : z.sharePorts) !== !1, this.allowSharingBothPorts = ((j = e.connectionSettings) == null ? void 0 : j.shareBothPorts) || !1, this.portHighlightRadius = ((D = e.connectionSettings) == null ? void 0 : D.portHighlightRadius) || 100, this.multipleSelectionOn = !1, this.priorityThresholds = ((q = e.canvas) == null ? void 0 : q.priorityThresholds) || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ao(this, Uo), this.collabEngine = new Io(this), e.nodeTypes)
4646
+ ), this.contextMenu = new Oo(this, (a = e.canvas) == null ? void 0 : a.contextMenu), this.backgroundColor = ((l = e.canvas) == null ? void 0 : l.backgroundColor) || "#FFFFFF", this.gridStyle = ((n = (s = e.canvas) == null ? void 0 : s.grid) == null ? void 0 : n.style) ?? Ht.style, this.gridSize = ((c = (r = e.canvas) == null ? void 0 : r.grid) == null ? void 0 : c.enabled) === !1 || ((d = e.canvas) == null ? void 0 : d.grid) === void 0 ? 0 : Math.abs(((u = (h = e.canvas) == null ? void 0 : h.grid) == null ? void 0 : u.spacing) || Ht.spacing), this.gridThickness = Math.abs(
4647
+ ((f = (p = e.canvas) == null ? void 0 : p.grid) == null ? void 0 : f.thickness) || Ht.thickness
4648
+ ), this.gridColor = ((g = (m = e.canvas) == null ? void 0 : m.grid) == null ? void 0 : g.color) || Ht.color, this.snapToGrid = ((w = (v = e.canvas) == null ? void 0 : v.grid) == null ? void 0 : w.enabled) === !1 || ((y = e.canvas) == null ? void 0 : y.grid) === void 0 ? !1 : ((I = (A = e.canvas) == null ? void 0 : A.grid) == null ? void 0 : I.snap) || Ht.snap, this.zoomFactor = ((E = e.canvas) == null ? void 0 : E.zoomFactor) || 2, this.panRate = (($ = e.canvas) == null ? void 0 : $.panRate) || 100, this.inferConnectionType = ((C = e.connectionSettings) == null ? void 0 : C.inferConnectionType) || !1, this.autoTightenConnections = ((R = e.connectionSettings) == null ? void 0 : R.autoTighten) !== !1, this.allowConnectionLoops = ((T = e.connectionSettings) == null ? void 0 : T.allowLoops) || !1, this.allowSharingPorts = ((z = e.connectionSettings) == null ? void 0 : z.sharePorts) !== !1, this.allowSharingBothPorts = ((j = e.connectionSettings) == null ? void 0 : j.shareBothPorts) || !1, this.portHighlightRadius = ((D = e.connectionSettings) == null ? void 0 : D.portHighlightRadius) || 100, this.multipleSelectionOn = !1, this.priorityThresholds = ((q = e.canvas) == null ? void 0 : q.priorityThresholds) || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new xo(this, Yo), this.collabEngine = new Ao(this), e.nodeTypes)
4623
4649
  for (const Y of e.nodeTypes) {
4624
- const W = new Si({
4650
+ const W = new Ai({
4625
4651
  ...e.nodeTypeDefaults,
4626
4652
  ...Y
4627
4653
  });
@@ -4629,7 +4655,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4629
4655
  }
4630
4656
  if (e.portTypes)
4631
4657
  for (const Y of e.portTypes) {
4632
- const W = new Co({
4658
+ const W = new So({
4633
4659
  ...e.portTypeDefaults,
4634
4660
  ...Y
4635
4661
  });
@@ -4637,13 +4663,13 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4637
4663
  }
4638
4664
  if (e.connectionTypes) {
4639
4665
  for (const Y of e.connectionTypes) {
4640
- const W = new wi({
4666
+ const W = new Si({
4641
4667
  ...e.connectionTypeDefaults,
4642
4668
  ...Y
4643
4669
  });
4644
4670
  this.model.connections.types.add(W);
4645
4671
  }
4646
- this._connectionType = ((G = e == null ? void 0 : e.connectionSettings) == null ? void 0 : G.defaultConnection) !== void 0 ? this.model.connections.types.get(
4672
+ this._connectionType = ((H = e == null ? void 0 : e.connectionSettings) == null ? void 0 : H.defaultConnection) !== void 0 ? this.model.connections.types.get(
4647
4673
  e.connectionSettings.defaultConnection
4648
4674
  ) : void 0;
4649
4675
  }
@@ -4685,10 +4711,10 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4685
4711
  a.preventDefault(), a.stopPropagation(), this.dragging = !1;
4686
4712
  return;
4687
4713
  }
4688
- const l = new wt(a, null);
4714
+ const l = new Ct(a, null);
4689
4715
  this.diagramEvent$.next(l), !l.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (a.preventDefault(), this.contextMenu.open(a));
4690
4716
  }).on(L.DoubleClick, (a) => {
4691
- const l = new kt(a, null);
4717
+ const l = new wt(a, null);
4692
4718
  this.diagramEvent$.next(l);
4693
4719
  }).on(L.KeyDown, (a) => {
4694
4720
  if (!a.ctrlKey && (a.key === it.Delete || a.key === it.Backspace) && this.canUserPerformAction(S.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), a.ctrlKey && a.key === "a") {
@@ -4698,7 +4724,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4698
4724
  for (const l of this.model.connections)
4699
4725
  this.userSelection.add(l);
4700
4726
  this.diagramEvent$.next(
4701
- new F(this.userSelection.all(), !0)
4727
+ new B(this.userSelection.all(), !0)
4702
4728
  );
4703
4729
  }
4704
4730
  if (a.ctrlKey && a.key === "i") {
@@ -4709,9 +4735,9 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4709
4735
  for (const n of this.model.connections)
4710
4736
  this.userSelection.toggle(n), n.selected ? l.push(n) : s.push(n);
4711
4737
  l.length > 0 && this.diagramEvent$.next(
4712
- new F(l, !0)
4738
+ new B(l, !0)
4713
4739
  ), s.length > 0 && this.diagramEvent$.next(
4714
- new F(s, !1)
4740
+ new B(s, !1)
4715
4741
  );
4716
4742
  }
4717
4743
  if (a.ctrlKey && a.key === "c" && this.canUserPerformAction(S.Clipboard) && (a.preventDefault(), this.userSelection.copyToClipboard(), this.cancelAllUserActions()), a.ctrlKey && a.key === "x" && this.canUserPerformAction(S.Clipboard) && this.canUserPerformAction(S.Remove) && (a.preventDefault(), this.userSelection.cutToClipboard(), this.cancelAllUserActions()), a.ctrlKey && a.key === "v" && this.canUserPerformAction(S.Paste)) {
@@ -4728,7 +4754,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4728
4754
  });
4729
4755
  const o = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
4730
4756
  o.call(
4731
- this.zoomBehavior = N.zoom().filter((a) => a.type !== L.DoubleClick).on(fe.Zoom, (a) => {
4757
+ this.zoomBehavior = N.zoom().filter((a) => a.type !== L.DoubleClick).on(ve.Zoom, (a) => {
4732
4758
  if (a.sourceEvent) {
4733
4759
  if (!this.canUserPerformAction(S.Zoom)) {
4734
4760
  x(P.NotAllowed);
@@ -4742,7 +4768,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4742
4768
  "patternTransform",
4743
4769
  l
4744
4770
  ), this.contextMenu.close();
4745
- }).on(fe.End, () => {
4771
+ }).on(ve.End, () => {
4746
4772
  x();
4747
4773
  })
4748
4774
  ), o.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", this.backgroundColor).attr("stroke-width", "0").on(L.MouseMove, (a) => {
@@ -4756,18 +4782,18 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4756
4782
  if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new ot(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4757
4783
  const a = this.userSelection.all();
4758
4784
  this.userSelection.clear(), this.diagramEvent$.next(
4759
- new F(a, !1)
4785
+ new B(a, !1)
4760
4786
  ), this.userSelection.openInPropertyEditor(this.model);
4761
4787
  }
4762
4788
  }).call(
4763
- N.drag().filter((a) => this.multipleSelectionOn || Ct(a)).on(M.Start, (a) => {
4789
+ N.drag().filter((a) => this.multipleSelectionOn || St(a)).on(M.Start, (a) => {
4764
4790
  this.startMultipleSelection(a);
4765
4791
  }).on(M.Drag, (a) => {
4766
4792
  this.continueMultipleSelection(a);
4767
4793
  }).on(M.End, (a) => {
4768
4794
  this.finishMultipleSelection(a);
4769
4795
  })
4770
- ), zo(this, o, this.backgroundPatternId), o.append("g").attr("class", "daga-canvas-elements");
4796
+ ), Ro(this, o, this.backgroundPatternId), o.append("g").attr("class", "daga-canvas-elements");
4771
4797
  }
4772
4798
  zoomBy(t) {
4773
4799
  isNaN(t) || this.zoomBehavior.scaleBy(this.selectCanvasView(), t);
@@ -4875,31 +4901,31 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4875
4901
  if (!s.ctrlKey && !s.shiftKey) {
4876
4902
  const r = this.userSelection.all();
4877
4903
  this.userSelection.clear(), this.diagramEvent$.next(
4878
- new F(r, !1)
4904
+ new B(r, !1)
4879
4905
  );
4880
4906
  }
4881
- this.userSelection.toggle(n), this.diagramEvent$.next(new F([n], n.selected));
4907
+ this.userSelection.toggle(n), this.diagramEvent$.next(new B([n], n.selected));
4882
4908
  }).on(L.ContextMenu, (s, n) => {
4883
4909
  if (this.dragging) {
4884
4910
  s.preventDefault(), s.stopPropagation(), this.dragging = !1;
4885
4911
  return;
4886
4912
  }
4887
- const r = new wt(s, n);
4888
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (s.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)), this.userSelection.add(n), this.diagramEvent$.next(new F([n], !0)), this.contextMenu.open(s));
4913
+ const r = new Ct(s, n);
4914
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (s.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)), this.userSelection.add(n), this.diagramEvent$.next(new B([n], !0)), this.contextMenu.open(s));
4889
4915
  }).on(L.DoubleClick, (s, n) => {
4890
- const r = new kt(s, n);
4916
+ const r = new wt(s, n);
4891
4917
  this.diagramEvent$.next(r);
4892
4918
  }).call(
4893
- N.drag().filter((s) => (this.secondaryButton = Ct(s), !0)).on(M.Start, (s, n) => {
4919
+ N.drag().filter((s) => (this.secondaryButton = St(s), !0)).on(M.Start, (s, n) => {
4894
4920
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(s) : this.startMovingNode(s, n);
4895
4921
  }).on(M.Drag, (s, n) => {
4896
4922
  this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(s) : this.continueMovingNode(s, n);
4897
4923
  }).on(M.End, (s, n) => {
4898
4924
  this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(s) : this.finishMovingNode(s, n), this.secondaryButton = !1;
4899
4925
  })
4900
- ), ge(
4926
+ ), me(
4901
4927
  a
4902
- ), a.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
4928
+ ), a.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
4903
4929
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && x(P.EWResize);
4904
4930
  }).on(L.MouseOut, (s, n) => {
4905
4931
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && x();
@@ -4924,7 +4950,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4924
4950
  }
4925
4951
  x();
4926
4952
  })
4927
- ), a.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
4953
+ ), a.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
4928
4954
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && x(P.NSResize);
4929
4955
  }).on(L.MouseOut, (s, n) => {
4930
4956
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && x();
@@ -4949,7 +4975,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4949
4975
  }
4950
4976
  x();
4951
4977
  })
4952
- ), a.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
4978
+ ), a.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
4953
4979
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && x(P.EWResize);
4954
4980
  }).on(L.MouseOut, (s, n) => {
4955
4981
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && x();
@@ -4974,7 +5000,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4974
5000
  }
4975
5001
  x();
4976
5002
  })
4977
- ), a.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
5003
+ ), a.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
4978
5004
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && x(P.NSResize);
4979
5005
  }).on(L.MouseOut, (s, n) => {
4980
5006
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && x();
@@ -5005,9 +5031,9 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5005
5031
  }
5006
5032
  x();
5007
5033
  })
5008
- ), l.attr("transform", (s) => `translate(${s.coords[0]},${s.coords[1]})`).attr("opacity", (s) => s.removed ? 0.5 : 1), ue(
5034
+ ), l.attr("transform", (s) => `translate(${s.coords[0]},${s.coords[1]})`).attr("opacity", (s) => s.removed ? 0.5 : 1), fe(
5009
5035
  l
5010
- ), l.filter(".resizable-x").select("line.left-resizer").attr("x1", B / 2).attr("x2", B / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", B / 2).attr("y2", B / 2), l.filter(".resizable-x").select("line.right-resizer").attr("x1", (s) => s.width - B / 2).attr("x2", (s) => s.width - B / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.bottom-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", (s) => s.height - B / 2).attr("y2", (s) => s.height - B / 2);
5036
+ ), l.filter(".resizable-x").select("line.left-resizer").attr("x1", G / 2).attr("x2", G / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", G / 2).attr("y2", G / 2), l.filter(".resizable-x").select("line.right-resizer").attr("x1", (s) => s.width - G / 2).attr("x2", (s) => s.width - G / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.bottom-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", (s) => s.height - G / 2).attr("y2", (s) => s.height - G / 2);
5011
5037
  }
5012
5038
  updateSectionsInView(...t) {
5013
5039
  let e = this.selectCanvasElements().selectAll("g.diagram-section").data(
@@ -5031,12 +5057,12 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5031
5057
  if (!s.ctrlKey && !s.shiftKey) {
5032
5058
  const c = this.userSelection.all();
5033
5059
  this.userSelection.clear(), this.diagramEvent$.next(
5034
- new F(c, !1)
5060
+ new B(c, !1)
5035
5061
  );
5036
5062
  }
5037
- const r = ft(n);
5063
+ const r = pt(n);
5038
5064
  this.userSelection.toggle(r), this.diagramEvent$.next(
5039
- new F(
5065
+ new B(
5040
5066
  [r],
5041
5067
  r.selected
5042
5068
  )
@@ -5046,19 +5072,19 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5046
5072
  s.preventDefault(), s.stopPropagation(), this.dragging = !1;
5047
5073
  return;
5048
5074
  }
5049
- const r = new wt(s, n);
5075
+ const r = new Ct(s, n);
5050
5076
  if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu)) {
5051
5077
  s.preventDefault();
5052
- const c = ft(n);
5078
+ const c = pt(n);
5053
5079
  this.userHighlight.focusOn(c), this.diagramEvent$.next(new ot(c)), this.userSelection.add(c), this.diagramEvent$.next(
5054
- new F([c], !0)
5080
+ new B([c], !0)
5055
5081
  ), this.contextMenu.open(s);
5056
5082
  }
5057
5083
  }).on(L.DoubleClick, (s, n) => {
5058
- const r = new kt(s, n);
5084
+ const r = new wt(s, n);
5059
5085
  this.diagramEvent$.next(r);
5060
5086
  }).call(
5061
- N.drag().filter((s) => (this.secondaryButton = Ct(s), !0)).on(M.Start, (s, n) => {
5087
+ N.drag().filter((s) => (this.secondaryButton = St(s), !0)).on(M.Start, (s, n) => {
5062
5088
  if (this.multipleSelectionOn || this.secondaryButton)
5063
5089
  this.startMultipleSelection(s);
5064
5090
  else {
@@ -5081,9 +5107,9 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5081
5107
  }
5082
5108
  this.secondaryButton = !1;
5083
5109
  })
5084
- ), ge(
5110
+ ), me(
5085
5111
  a
5086
- ), a.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
5112
+ ), a.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
5087
5113
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && x(P.EWResize);
5088
5114
  }).on(L.MouseOut, (s, n) => {
5089
5115
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && x();
@@ -5118,7 +5144,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5118
5144
  }
5119
5145
  x();
5120
5146
  })
5121
- ), a.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
5147
+ ), a.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
5122
5148
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && x(P.NSResize);
5123
5149
  }).on(L.MouseOut, (s, n) => {
5124
5150
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && x();
@@ -5153,7 +5179,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5153
5179
  }
5154
5180
  x();
5155
5181
  })
5156
- ), a.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
5182
+ ), a.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
5157
5183
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && x(P.EWResize);
5158
5184
  }).on(L.MouseOut, (s, n) => {
5159
5185
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && x();
@@ -5188,7 +5214,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5188
5214
  }
5189
5215
  x();
5190
5216
  })
5191
- ), a.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${B}px`).on(L.MouseOver, (s, n) => {
5217
+ ), a.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(L.MouseOver, (s, n) => {
5192
5218
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && x(P.NSResize);
5193
5219
  }).on(L.MouseOut, (s, n) => {
5194
5220
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && x();
@@ -5223,9 +5249,9 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5223
5249
  }
5224
5250
  x();
5225
5251
  })
5226
- ), l.attr("transform", (s) => `translate(${s.coords[0]},${s.coords[1]})`).attr("opacity", (s) => s.removed ? 0.5 : 1), ue(
5252
+ ), l.attr("transform", (s) => `translate(${s.coords[0]},${s.coords[1]})`).attr("opacity", (s) => s.removed ? 0.5 : 1), fe(
5227
5253
  l
5228
- ), l.filter(".resizable-x").select("line.left-resizer").attr("x1", B / 2).attr("x2", B / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", B / 2).attr("y2", B / 2), l.filter(".resizable-x").select("line.right-resizer").attr("x1", (s) => s.width - B / 2).attr("x2", (s) => s.width - B / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.bottom-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", (s) => s.height - B / 2).attr("y2", (s) => s.height - B / 2);
5254
+ ), l.filter(".resizable-x").select("line.left-resizer").attr("x1", G / 2).attr("x2", G / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.top-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", G / 2).attr("y2", G / 2), l.filter(".resizable-x").select("line.right-resizer").attr("x1", (s) => s.width - G / 2).attr("x2", (s) => s.width - G / 2).attr("y1", 0).attr("y2", (s) => s.height), l.filter(".resizable-y").select("line.bottom-resizer").attr("x1", 0).attr("x2", (s) => s.width).attr("y1", (s) => s.height - G / 2).attr("y2", (s) => s.height - G / 2);
5229
5255
  }
5230
5256
  updatePortsInView(...t) {
5231
5257
  let e = this.selectCanvasElements().selectAll("g.diagram-port").data(
@@ -5258,12 +5284,12 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5258
5284
  if (!s.ctrlKey && !s.shiftKey) {
5259
5285
  const c = this.userSelection.all();
5260
5286
  this.userSelection.clear(), this.diagramEvent$.next(
5261
- new F(c, !1)
5287
+ new B(c, !1)
5262
5288
  );
5263
5289
  }
5264
- const r = ft(n);
5290
+ const r = pt(n);
5265
5291
  this.userSelection.toggle(r), this.diagramEvent$.next(
5266
- new F(
5292
+ new B(
5267
5293
  [r],
5268
5294
  r.selected
5269
5295
  )
@@ -5273,19 +5299,19 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5273
5299
  s.preventDefault(), s.stopPropagation(), this.dragging = !1;
5274
5300
  return;
5275
5301
  }
5276
- const r = new wt(s, n);
5302
+ const r = new Ct(s, n);
5277
5303
  if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu)) {
5278
5304
  s.preventDefault();
5279
- const c = ft(n);
5305
+ const c = pt(n);
5280
5306
  this.userHighlight.focusOn(c), this.diagramEvent$.next(new ot(c)), this.userSelection.add(c), this.diagramEvent$.next(
5281
- new F([c], !0)
5307
+ new B([c], !0)
5282
5308
  ), this.contextMenu.open(s);
5283
5309
  }
5284
5310
  }).on(L.DoubleClick, (s, n) => {
5285
- const r = new kt(s, n);
5311
+ const r = new wt(s, n);
5286
5312
  this.diagramEvent$.next(r);
5287
5313
  }).call(
5288
- N.drag().filter((s) => (this.secondaryButton = Ct(s), !0)).on(M.Start, (s, n) => {
5314
+ N.drag().filter((s) => (this.secondaryButton = St(s), !0)).on(M.Start, (s, n) => {
5289
5315
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(s) : this.canUserPerformAction(S.AddConnection) && (this.allowSharingPorts || n.incomingConnections.length === 0 && n.outgoingConnections.length === 0) && !n.removed ? (x(P.Grabbing), this.startConnection(n), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : x(P.NotAllowed);
5290
5316
  }).on(M.Drag, (s, n) => {
5291
5317
  var r, c, d, h;
@@ -5295,13 +5321,13 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5295
5321
  const u = [s.x, s.y];
5296
5322
  (d = this.unfinishedConnectionTracer) == null || d.attr(
5297
5323
  "d",
5298
- he(
5299
- this.unfinishedConnection.look.shape,
5324
+ ue(
5325
+ this.unfinishedConnection.look.shape || st.look.shape,
5300
5326
  this.unfinishedConnection.startCoords,
5301
5327
  u,
5302
5328
  this.unfinishedConnection.startDirection,
5303
5329
  this.unfinishedConnection.endDirection,
5304
- this.unfinishedConnection.look.thickness,
5330
+ this.unfinishedConnection.look.thickness || st.look.thickness,
5305
5331
  (r = this.unfinishedConnection.startMarkerLook) == null ? void 0 : r.width,
5306
5332
  (c = this.unfinishedConnection.endMarkerLook) == null ? void 0 : c.width
5307
5333
  )
@@ -5320,7 +5346,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5320
5346
  ];
5321
5347
  } else
5322
5348
  this.unfinishedConnection.endCoords = u;
5323
- if (this.updateConnectionsInView(me), this.model.ports.length > 0) {
5349
+ if (this.updateConnectionsInView(pe), this.model.ports.length > 0) {
5324
5350
  const f = this.getPointerLocationRelativeToCanvas(s);
5325
5351
  let m = Number.POSITIVE_INFINITY, g;
5326
5352
  for (const v of this.model.ports) {
@@ -5338,11 +5364,11 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5338
5364
  if (this.canUserPerformAction(S.AddConnection) && !n.removed) {
5339
5365
  (r = this.unfinishedConnectionTracer) == null || r.remove();
5340
5366
  const c = this.userHighlight.getFocus();
5341
- if (c instanceof It)
5367
+ if (c instanceof At)
5342
5368
  this.finishConnection(c);
5343
- else if (c instanceof pt && c.rootElement instanceof It)
5369
+ else if (c instanceof vt && c.rootElement instanceof At)
5344
5370
  this.finishConnection(c.rootElement);
5345
- else if (c instanceof O || c instanceof X || c instanceof pt) {
5371
+ else if (c instanceof O || c instanceof X || c instanceof vt) {
5346
5372
  let d;
5347
5373
  if (c instanceof O || c instanceof X)
5348
5374
  d = c;
@@ -5364,12 +5390,12 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5364
5390
  }
5365
5391
  this.secondaryButton = !1;
5366
5392
  })
5367
- ), a.filter(".image-look").append("image"), ge(
5393
+ ), a.filter(".image-look").append("image"), me(
5368
5394
  a
5369
5395
  ), l.attr(
5370
5396
  "transform",
5371
5397
  (s) => `translate(${s.coords[0] - s.width / 2},${s.coords[1] - s.width / 2})`
5372
- ).attr("opacity", (s) => s.removed ? 0.5 : 1), ue(
5398
+ ).attr("opacity", (s) => s.removed ? 0.5 : 1), fe(
5373
5399
  l
5374
5400
  );
5375
5401
  }
@@ -5388,22 +5414,22 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5388
5414
  if (!n.ctrlKey && !n.shiftKey) {
5389
5415
  const c = this.userSelection.all();
5390
5416
  this.userSelection.clear(), this.diagramEvent$.next(
5391
- new F(c, !1)
5417
+ new B(c, !1)
5392
5418
  );
5393
5419
  }
5394
- this.userSelection.toggle(r), this.diagramEvent$.next(new F([r], r.selected));
5420
+ this.userSelection.toggle(r), this.diagramEvent$.next(new B([r], r.selected));
5395
5421
  }).on(L.ContextMenu, (n, r) => {
5396
5422
  if (this.dragging) {
5397
5423
  n.preventDefault(), n.stopPropagation(), this.dragging = !1;
5398
5424
  return;
5399
5425
  }
5400
- const c = new wt(n, r);
5401
- this.diagramEvent$.next(c), !c.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(r), this.diagramEvent$.next(new ot(r)), this.userSelection.add(r), this.diagramEvent$.next(new F([r], !0)), this.contextMenu.open(n));
5426
+ const c = new Ct(n, r);
5427
+ this.diagramEvent$.next(c), !c.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(r), this.diagramEvent$.next(new ot(r)), this.userSelection.add(r), this.diagramEvent$.next(new B([r], !0)), this.contextMenu.open(n));
5402
5428
  }).on(L.DoubleClick, (n, r) => {
5403
- const c = new kt(n, r);
5429
+ const c = new wt(n, r);
5404
5430
  this.diagramEvent$.next(c);
5405
5431
  }).call(
5406
- N.drag().filter((n) => (this.secondaryButton = Ct(n), !0)).on(M.Start, (n) => {
5432
+ N.drag().filter((n) => (this.secondaryButton = St(n), !0)).on(M.Start, (n) => {
5407
5433
  this.startMultipleSelection(n);
5408
5434
  }).on(M.Drag, (n) => {
5409
5435
  this.continueMultipleSelection(n);
@@ -5414,41 +5440,50 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5414
5440
  "d",
5415
5441
  (n) => {
5416
5442
  var r, c;
5417
- return he(
5418
- n.look.shape,
5443
+ return ue(
5444
+ n.look.shape || st.look.shape,
5419
5445
  n.startCoords,
5420
5446
  n.endCoords,
5421
5447
  n.startDirection,
5422
5448
  n.endDirection,
5423
- n.look.thickness,
5449
+ n.look.thickness || st.look.thickness,
5424
5450
  (r = n.startMarkerLook) == null ? void 0 : r.width,
5425
5451
  (c = n.endMarkerLook) == null ? void 0 : c.width
5426
5452
  );
5427
5453
  }
5428
- ).attr("marker-start", (n) => `url(#${n.id}-start-marker)`).attr("marker-end", (n) => `url(#${n.id}-end-marker)`).attr("stroke", (n) => n.look.color).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
5454
+ ).attr("marker-start", (n) => `url(#${n.id}-start-marker)`).attr("marker-end", (n) => `url(#${n.id}-end-marker)`).attr(
5455
+ "stroke",
5456
+ (n) => n.look.color || st.look.color
5457
+ ).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
5429
5458
  "stroke-dasharray",
5430
- (n) => oi(n.look.style, n.look.thickness)
5459
+ (n) => be(
5460
+ n.look.style || st.look.style,
5461
+ n.look.thickness || st.look.thickness
5462
+ )
5431
5463
  ).attr("fill", "none"), s.select("path.diagram-connection-path-box").attr(
5432
5464
  "d",
5433
5465
  (n) => {
5434
5466
  var r, c;
5435
- return he(
5436
- n.look.shape,
5467
+ return ue(
5468
+ n.look.shape || st.look.shape,
5437
5469
  n.startCoords,
5438
5470
  n.endCoords,
5439
5471
  n.startDirection,
5440
5472
  n.endDirection,
5441
- n.look.thickness,
5473
+ n.look.thickness || st.look.thickness,
5442
5474
  (r = n.startMarkerLook) == null ? void 0 : r.width,
5443
5475
  (c = n.endMarkerLook) == null ? void 0 : c.width
5444
5476
  );
5445
5477
  }
5446
5478
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5447
5479
  "stroke-width",
5448
- (n) => `${n.look.thickness + Fo}px`
5480
+ (n) => `${(n.look.thickness || st.look.thickness) + Uo}px`
5449
5481
  ).attr(
5450
5482
  "stroke-dasharray",
5451
- (n) => oi(n.look.style, n.look.thickness)
5483
+ (n) => be(
5484
+ n.look.style || st.look.style,
5485
+ n.look.thickness || st.look.thickness
5486
+ )
5452
5487
  ).attr("fill", "none"), s.data().forEach((n) => {
5453
5488
  this.updateConnectionLabelsInView(n), this.updateConnectionMarkersInView(n);
5454
5489
  });
@@ -5471,12 +5506,12 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5471
5506
  if (!s.ctrlKey && !s.shiftKey) {
5472
5507
  const c = this.userSelection.all();
5473
5508
  this.userSelection.clear(), this.diagramEvent$.next(
5474
- new F(c, !1)
5509
+ new B(c, !1)
5475
5510
  );
5476
5511
  }
5477
- const r = ft(n);
5512
+ const r = pt(n);
5478
5513
  this.userSelection.toggle(r), this.diagramEvent$.next(
5479
- new F(
5514
+ new B(
5480
5515
  [r],
5481
5516
  r.selected
5482
5517
  )
@@ -5486,32 +5521,32 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5486
5521
  s.preventDefault(), s.stopPropagation(), this.dragging = !1;
5487
5522
  return;
5488
5523
  }
5489
- const r = new wt(s, n);
5524
+ const r = new Ct(s, n);
5490
5525
  if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu)) {
5491
5526
  s.preventDefault();
5492
- const c = ft(n);
5527
+ const c = pt(n);
5493
5528
  this.userHighlight.focusOn(c), this.diagramEvent$.next(new ot(c)), this.userSelection.add(c), this.diagramEvent$.next(
5494
- new F([c], !0)
5529
+ new B([c], !0)
5495
5530
  ), this.contextMenu.open(s);
5496
5531
  }
5497
5532
  }).on(L.DoubleClick, (s, n) => {
5498
- const r = new kt(s, n);
5499
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.EditField) && n.editable && !n.removed && (this.currentAction = new di(this, n.id, n.text, ""), this.createInputField(
5533
+ const r = new wt(s, n);
5534
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.EditField) && n.editable && !n.removed && (this.currentAction = new ui(this, n.id, n.text, ""), this.createInputField(
5500
5535
  n.text,
5501
5536
  n.coords,
5502
5537
  n.width,
5503
5538
  n.height,
5504
5539
  n.fontSize,
5505
- n.fontFamily || H.fontFamily,
5540
+ n.fontFamily || F.fontFamily,
5506
5541
  n.orientation,
5507
5542
  (c) => {
5508
5543
  },
5509
5544
  (c) => {
5510
- n.text = c, this.currentAction instanceof di && (this.currentAction.to = c, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
5545
+ n.text = c, this.currentAction instanceof ui && (this.currentAction.to = c, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
5511
5546
  }
5512
5547
  ));
5513
5548
  }).call(
5514
- N.drag().filter((s) => (this.secondaryButton = Ct(s), !0)).on(M.Start, (s, n) => {
5549
+ N.drag().filter((s) => (this.secondaryButton = St(s), !0)).on(M.Start, (s, n) => {
5515
5550
  if (this.multipleSelectionOn || this.secondaryButton)
5516
5551
  this.startMultipleSelection(s);
5517
5552
  else {
@@ -5536,19 +5571,19 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5536
5571
  })
5537
5572
  ).append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").append("xhtml:p").style("box-sizing", "border-box").style("outline", 0).style("margin", 0).style("border", 0).style("padding", 0).style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"), l.attr("x", 0).attr("y", 0).attr("width", (s) => `${s.width}px`).attr("height", (s) => `${s.height}px`).attr("transform", (s) => `translate(${s.coords[0]},${s.coords[1]})`).attr("opacity", (s) => s.removed ? 0.5 : 1).select("div").style(
5538
5573
  "justify-content",
5539
- (s) => s.horizontalAlign === Pt.Center ? "center" : s.horizontalAlign === Pt.Right ? "flex-end" : "flex-start"
5574
+ (s) => s.horizontalAlign === zt.Center ? "center" : s.horizontalAlign === zt.Right ? "flex-end" : "flex-start"
5540
5575
  ).style(
5541
5576
  "align-items",
5542
- (s) => s.verticalAlign === Kt.Center ? "center" : s.verticalAlign === Kt.Bottom ? "end" : "start"
5577
+ (s) => s.verticalAlign === Qt.Center ? "center" : s.verticalAlign === Qt.Bottom ? "end" : "start"
5543
5578
  ).select("p").style(
5544
5579
  "max-width",
5545
- (s) => s.fit ? "default" : `${gi(s.width, s.height, s.orientation)[0]}px`
5580
+ (s) => s.fit ? "default" : `${fi(s.width, s.height, s.orientation)[0]}px`
5546
5581
  ).style(
5547
5582
  "max-height",
5548
- (s) => s.fit ? "default" : `${gi(s.width, s.height, s.orientation)[1]}px`
5583
+ (s) => s.fit ? "default" : `${fi(s.width, s.height, s.orientation)[1]}px`
5549
5584
  ).style("overflow", (s) => s.fit ? "default" : "clip").style("text-overflow", (s) => s.fit ? "default" : "ellipsis").style(
5550
5585
  "text-align",
5551
- (s) => s.horizontalAlign === Pt.Center ? "center" : s.horizontalAlign === Pt.Right ? "end" : "start"
5586
+ (s) => s.horizontalAlign === zt.Center ? "center" : s.horizontalAlign === zt.Right ? "end" : "start"
5552
5587
  ).style("transform", (s) => `rotate(${s.orientation}deg)`).style("font-size", (s) => `${s.fontSize}px`).style(
5553
5588
  "font-family",
5554
5589
  (s) => s.fontFamily || "'Wonder Unit Sans', sans-serif"
@@ -5574,13 +5609,13 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5574
5609
  s.preventDefault(), s.stopPropagation(), this.dragging = !1;
5575
5610
  return;
5576
5611
  }
5577
- const r = new wt(s, n);
5612
+ const r = new Ct(s, n);
5578
5613
  this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (s.preventDefault(), this.contextMenu.open(s));
5579
5614
  }).on(L.DoubleClick, (s, n) => {
5580
- const r = new kt(s, n);
5615
+ const r = new wt(s, n);
5581
5616
  this.diagramEvent$.next(r);
5582
5617
  }).call(
5583
- N.drag().filter((s) => (this.secondaryButton = Ct(s), !0)).on(M.Start, (s) => {
5618
+ N.drag().filter((s) => (this.secondaryButton = St(s), !0)).on(M.Start, (s) => {
5584
5619
  (this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(s);
5585
5620
  }).on(M.Drag, (s) => {
5586
5621
  (this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(s);
@@ -5605,13 +5640,13 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5605
5640
  if (!s.ctrlKey && !s.shiftKey) {
5606
5641
  const r = this.userSelection.all();
5607
5642
  this.userSelection.clear(), this.diagramEvent$.next(
5608
- new F(r, !1)
5643
+ new B(r, !1)
5609
5644
  );
5610
5645
  }
5611
5646
  if (n.rootElement) {
5612
- const r = ft(n.rootElement);
5647
+ const r = pt(n.rootElement);
5613
5648
  this.userSelection.toggle(r), this.diagramEvent$.next(
5614
- new F(
5649
+ new B(
5615
5650
  [r],
5616
5651
  r.selected
5617
5652
  )
@@ -5622,21 +5657,21 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5622
5657
  s.preventDefault(), s.stopPropagation(), this.dragging = !1;
5623
5658
  return;
5624
5659
  }
5625
- const r = new wt(s, n);
5660
+ const r = new Ct(s, n);
5626
5661
  if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && n.rootElement) {
5627
5662
  s.preventDefault();
5628
- const c = ft(n.rootElement);
5663
+ const c = pt(n.rootElement);
5629
5664
  this.userHighlight.focusOn(c), this.diagramEvent$.next(
5630
5665
  new ot(c)
5631
5666
  ), this.userSelection.add(c), this.diagramEvent$.next(
5632
- new F([c], !0)
5667
+ new B([c], !0)
5633
5668
  ), this.contextMenu.open(s);
5634
5669
  }
5635
5670
  }).on(L.DoubleClick, (s, n) => {
5636
- const r = new kt(s, n);
5671
+ const r = new wt(s, n);
5637
5672
  this.diagramEvent$.next(r);
5638
5673
  }).call(
5639
- N.drag().filter((s) => (this.secondaryButton = Ct(s), !0)).on(M.Start, (s, n) => {
5674
+ N.drag().filter((s) => (this.secondaryButton = St(s), !0)).on(M.Start, (s, n) => {
5640
5675
  if (this.multipleSelectionOn || this.secondaryButton)
5641
5676
  this.startMultipleSelection(s);
5642
5677
  else {
@@ -5664,9 +5699,9 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5664
5699
  updateConnectionLabelsInView(t) {
5665
5700
  var s, n, r;
5666
5701
  const e = this.selectCanvasView().select(
5667
- `[id='${pe(t.id)}']`
5702
+ `[id='${ye(t.id)}']`
5668
5703
  ), a = e.select("path").node(), l = {
5669
- ...H,
5704
+ ...F,
5670
5705
  ...t.type.label
5671
5706
  };
5672
5707
  if (a) {
@@ -5713,17 +5748,17 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5713
5748
  ).style("font-kerning", "none").text(t.startLabel);
5714
5749
  const g = (s = e.select("g.diagram-connection-start-label text").node()) == null ? void 0 : s.getBoundingClientRect();
5715
5750
  if (g) {
5716
- const y = t.startLabel ? g.width / this.zoomTransform.k + Ht(l) + Gt(l) : 0, A = t.startLabel ? g.height / this.zoomTransform.k + Bt(l) + Dt(l) : 0, I = a.getPointAtLength(
5751
+ const y = t.startLabel ? g.width / this.zoomTransform.k + Bt(l) + Ut(l) : 0, A = t.startLabel ? g.height / this.zoomTransform.k + Yt(l) + Gt(l) : 0, I = a.getPointAtLength(
5717
5752
  Math.max(
5718
5753
  tt(l) + y / 2,
5719
- lt(l) + y / 2,
5754
+ ct(l) + y / 2,
5720
5755
  Z(l) + A / 2,
5721
- st(l) + A / 2
5756
+ nt(l) + A / 2
5722
5757
  )
5723
5758
  );
5724
5759
  e.select("g.diagram-connection-start-label path").attr(
5725
5760
  "d",
5726
- Zt(
5761
+ Jt(
5727
5762
  -y / 2,
5728
5763
  -A / 2,
5729
5764
  y,
@@ -5740,10 +5775,10 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5740
5775
  ).style("font-kerning", "none").text(t.middleLabel);
5741
5776
  const v = (n = e.select("g.diagram-connection-middle-label text").node()) == null ? void 0 : n.getBoundingClientRect();
5742
5777
  if (v) {
5743
- const y = t.middleLabel ? v.width / this.zoomTransform.k + Ht(l) + Gt(l) : 0, A = t.middleLabel ? v.height / this.zoomTransform.k + Bt(l) + Dt(l) : 0, I = a.getPointAtLength(c / 2);
5778
+ const y = t.middleLabel ? v.width / this.zoomTransform.k + Bt(l) + Ut(l) : 0, A = t.middleLabel ? v.height / this.zoomTransform.k + Yt(l) + Gt(l) : 0, I = a.getPointAtLength(c / 2);
5744
5779
  e.select("g.diagram-connection-middle-label path").attr(
5745
5780
  "d",
5746
- Zt(
5781
+ Jt(
5747
5782
  -y / 2,
5748
5783
  -A / 2,
5749
5784
  y,
@@ -5760,17 +5795,17 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5760
5795
  ).style("font-kerning", "none").text(t.endLabel);
5761
5796
  const w = (r = e.select("g.diagram-connection-end-label text").node()) == null ? void 0 : r.getBoundingClientRect();
5762
5797
  if (w) {
5763
- const y = t.endLabel ? w.width / this.zoomTransform.k + Ht(l) + Gt(l) : 0, A = t.endLabel ? w.height / this.zoomTransform.k + Bt(l) + Dt(l) : 0, I = a.getPointAtLength(
5798
+ const y = t.endLabel ? w.width / this.zoomTransform.k + Bt(l) + Ut(l) : 0, A = t.endLabel ? w.height / this.zoomTransform.k + Yt(l) + Gt(l) : 0, I = a.getPointAtLength(
5764
5799
  c - Math.max(
5765
5800
  tt(l) + y / 2,
5766
- lt(l) + y / 2,
5801
+ ct(l) + y / 2,
5767
5802
  Z(l) + A / 2,
5768
- st(l) + A / 2
5803
+ nt(l) + A / 2
5769
5804
  )
5770
5805
  );
5771
5806
  e.select("g.diagram-connection-end-label path").attr(
5772
5807
  "d",
5773
- Zt(
5808
+ Jt(
5774
5809
  -y / 2,
5775
5810
  -A / 2,
5776
5811
  y,
@@ -5785,7 +5820,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5785
5820
  }
5786
5821
  updateConnectionMarkersInView(t) {
5787
5822
  const e = this.selectCanvasView().select(
5788
- `[id='${pe(t.id)}']`
5823
+ `[id='${ye(t.id)}']`
5789
5824
  ), o = e.select("marker.diagram-connection-start-marker"), a = e.select("marker.diagram-connection-end-marker");
5790
5825
  t.startMarkerLook !== null ? o.attr("orient", "auto-start-reverse").attr("markerWidth", t.startMarkerLook.width).attr("markerHeight", t.startMarkerLook.height).attr("refX", t.startMarkerLook.refX).attr("refY", t.startMarkerLook.refY).select("image").attr("href", t.startMarkerLook.image).attr("width", t.startMarkerLook.width).attr("height", t.startMarkerLook.height) : o.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0), t.endMarkerLook !== null ? a.attr("orient", "auto-start-reverse").attr("markerWidth", t.endMarkerLook.width).attr("markerHeight", t.endMarkerLook.height).attr("refX", t.endMarkerLook.refX).attr("refY", t.endMarkerLook.refY).select("image").attr("href", t.endMarkerLook.image).attr("width", t.endMarkerLook.width).attr("height", t.endMarkerLook.height) : a.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0);
5791
5826
  }
@@ -5795,7 +5830,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5795
5830
  if (!e)
5796
5831
  return !1;
5797
5832
  if (e.rootElement instanceof O || e.rootElement instanceof X) {
5798
- const n = this.minimumSizeOfField(e), r = n[0] + tt((o = e.rootElement.type) == null ? void 0 : o.label) + lt((a = e.rootElement.type) == null ? void 0 : a.label) - e.rootElement.width, c = n[1] + Z((l = e.rootElement.type) == null ? void 0 : l.label) + st((s = e.rootElement.type) == null ? void 0 : s.label) - e.rootElement.height;
5833
+ const n = this.minimumSizeOfField(e), r = n[0] + tt((o = e.rootElement.type) == null ? void 0 : o.label) + ct((a = e.rootElement.type) == null ? void 0 : a.label) - e.rootElement.width, c = n[1] + Z((l = e.rootElement.type) == null ? void 0 : l.label) + nt((s = e.rootElement.type) == null ? void 0 : s.label) - e.rootElement.height;
5799
5834
  return r <= 0 && c <= 0;
5800
5835
  }
5801
5836
  return !0;
@@ -5806,7 +5841,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5806
5841
  if (o) {
5807
5842
  if (o.rootElement instanceof O) {
5808
5843
  const n = this.minimumSizeOfField(o);
5809
- let r = n[0] + tt(o.rootElement.type.label) + lt(o.rootElement.type.label) - o.rootElement.width, c = n[1] + Z(o.rootElement.type.label) + st(o.rootElement.type.label) - o.rootElement.height;
5844
+ let r = n[0] + tt(o.rootElement.type.label) + ct(o.rootElement.type.label) - o.rootElement.width, c = n[1] + Z(o.rootElement.type.label) + nt(o.rootElement.type.label) - o.rootElement.height;
5810
5845
  this.snapToGrid && (r = Math.ceil(r / this.gridSize) * this.gridSize, c = Math.ceil(c / this.gridSize) * this.gridSize), o.rootElement.width + r < o.rootElement.type.minWidth && (r = o.rootElement.type.minWidth - o.rootElement.width), o.rootElement.height + c < o.rootElement.type.minHeight && (c = o.rootElement.type.minHeight - o.rootElement.height), (e !== !1 || r > 0) && o.rootElement.stretch(b.Right, r), (e !== !1 || c > 0) && o.rootElement.stretch(b.Bottom, c);
5811
5846
  }
5812
5847
  if (o.rootElement instanceof X) {
@@ -5822,7 +5857,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5822
5857
  )));
5823
5858
  n[0] < r && (n[0] = r), n[1] < c && (n[1] = c);
5824
5859
  const d = o.rootElement.type;
5825
- let h = n[0] + tt(d == null ? void 0 : d.label) + lt(d == null ? void 0 : d.label) - o.rootElement.width, u = n[1] + Z(d == null ? void 0 : d.label) + st(d == null ? void 0 : d.label) - o.rootElement.height;
5860
+ let h = n[0] + tt(d == null ? void 0 : d.label) + ct(d == null ? void 0 : d.label) - o.rootElement.width, u = n[1] + Z(d == null ? void 0 : d.label) + nt(d == null ? void 0 : d.label) - o.rootElement.height;
5826
5861
  this.snapToGrid && (h = Math.ceil(h / this.gridSize) * this.gridSize, u = Math.ceil(u / this.gridSize) * this.gridSize), o.rootElement.width + h < (o.rootElement.getMinWidth() || 0) && (h = (o.rootElement.getMinWidth() || 0) - o.rootElement.width), o.rootElement.height + u < (o.rootElement.getMinHeight() || 0) && (u = (o.rootElement.getMinHeight() || 0) - o.rootElement.height), (e || h > 0) && ((l = o.rootElement.node) == null || l.stretchSections(
5827
5862
  b.Right,
5828
5863
  h,
@@ -5877,12 +5912,12 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5877
5912
  ) && t.allowsOutgoing || this.connectionType.canFinishOnType(
5878
5913
  ((l = (a = t.getNode()) == null ? void 0 : a.type) == null ? void 0 : l.id) || ""
5879
5914
  ) && t.allowsIncoming))
5880
- this.unfinishedConnection = new gt(
5915
+ this.unfinishedConnection = new ut(
5881
5916
  this.model,
5882
5917
  this.connectionType,
5883
5918
  t,
5884
5919
  void 0,
5885
- me
5920
+ pe
5886
5921
  );
5887
5922
  else if (this.inferConnectionType) {
5888
5923
  let s = this.model.connections.types.all().find(
@@ -5896,12 +5931,12 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5896
5931
  var r, c;
5897
5932
  return t.allowsIncoming && n.canFinishOnType(((c = (r = t.getNode()) == null ? void 0 : r.type) == null ? void 0 : c.id) || "");
5898
5933
  }
5899
- )), s !== void 0 && (this.unfinishedConnection = new gt(
5934
+ )), s !== void 0 && (this.unfinishedConnection = new ut(
5900
5935
  this.model,
5901
5936
  s,
5902
5937
  t,
5903
5938
  void 0,
5904
- me
5939
+ pe
5905
5940
  ));
5906
5941
  }
5907
5942
  }
@@ -5931,7 +5966,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5931
5966
  ) && ((n = (s = this.unfinishedConnection) == null ? void 0 : s.start) != null && n.allowsOutgoing) && this.unfinishedConnection.type.canFinishOnType(
5932
5967
  ((c = (r = t.getNode()) == null ? void 0 : r.type) == null ? void 0 : c.id) || ""
5933
5968
  ) && t.allowsIncoming) {
5934
- const E = new de(
5969
+ const E = new ge(
5935
5970
  this,
5936
5971
  this.unfinishedConnection.type,
5937
5972
  (d = this.unfinishedConnection.start) == null ? void 0 : d.id,
@@ -5943,7 +5978,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5943
5978
  ) && ((g = (m = this.unfinishedConnection) == null ? void 0 : m.start) != null && g.allowsIncoming) && this.unfinishedConnection.type.canStartFromType(
5944
5979
  ((w = (v = t.getNode()) == null ? void 0 : v.type) == null ? void 0 : w.id) || ""
5945
5980
  ) && t.allowsOutgoing) {
5946
- const E = new de(
5981
+ const E = new ge(
5947
5982
  this,
5948
5983
  this.unfinishedConnection.type,
5949
5984
  t.id,
@@ -5953,21 +5988,21 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5953
5988
  } else if (this.inferConnectionType) {
5954
5989
  let E = this.model.connections.types.all().find(
5955
5990
  (C) => {
5956
- var R, T, z, j, D, q, G, Y;
5991
+ var R, T, z, j, D, q, H, Y;
5957
5992
  return C.canStartFromType(
5958
5993
  ((j = (z = (T = (R = this.unfinishedConnection) == null ? void 0 : R.start) == null ? void 0 : T.getNode()) == null ? void 0 : z.type) == null ? void 0 : j.id) || ""
5959
- ) && ((q = (D = this.unfinishedConnection) == null ? void 0 : D.start) == null ? void 0 : q.allowsOutgoing) && C.canFinishOnType(((Y = (G = t.getNode()) == null ? void 0 : G.type) == null ? void 0 : Y.id) || "") && t.allowsIncoming;
5994
+ ) && ((q = (D = this.unfinishedConnection) == null ? void 0 : D.start) == null ? void 0 : q.allowsOutgoing) && C.canFinishOnType(((Y = (H = t.getNode()) == null ? void 0 : H.type) == null ? void 0 : Y.id) || "") && t.allowsIncoming;
5960
5995
  }
5961
5996
  ), $ = !1;
5962
5997
  if (E === void 0 && (E = this.model.connections.types.all().find(
5963
5998
  (C) => {
5964
- var R, T, z, j, D, q, G, Y;
5999
+ var R, T, z, j, D, q, H, Y;
5965
6000
  return C.canFinishOnType(
5966
6001
  ((j = (z = (T = (R = this.unfinishedConnection) == null ? void 0 : R.start) == null ? void 0 : T.getNode()) == null ? void 0 : z.type) == null ? void 0 : j.id) || ""
5967
- ) && ((q = (D = this.unfinishedConnection) == null ? void 0 : D.start) == null ? void 0 : q.allowsIncoming) && C.canStartFromType(((Y = (G = t.getNode()) == null ? void 0 : G.type) == null ? void 0 : Y.id) || "") && t.allowsOutgoing;
6002
+ ) && ((q = (D = this.unfinishedConnection) == null ? void 0 : D.start) == null ? void 0 : q.allowsIncoming) && C.canStartFromType(((Y = (H = t.getNode()) == null ? void 0 : H.type) == null ? void 0 : Y.id) || "") && t.allowsOutgoing;
5968
6003
  }
5969
6004
  ), $ = !0), E !== void 0) {
5970
- const C = new de(
6005
+ const C = new ge(
5971
6006
  this,
5972
6007
  E,
5973
6008
  $ ? t.id : (A = this.unfinishedConnection.start) == null ? void 0 : A.id,
@@ -6005,7 +6040,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6005
6040
  }
6006
6041
  }).on(L.Input, () => {
6007
6042
  const m = h.property("value");
6008
- h.attr("cols", to(m) + 1), h.attr("rows", eo(m) + 1), h.style("width", ""), h.style("height", ""), u = h.property("scrollWidth") + 1, p = h.property("scrollHeight") + 1;
6043
+ h.attr("cols", io(m) + 1), h.attr("rows", oo(m) + 1), h.style("width", ""), h.style("height", ""), u = h.property("scrollWidth") + 1, p = h.property("scrollHeight") + 1;
6009
6044
  const g = Math.max(u, o), v = Math.max(p, a);
6010
6045
  d == null || d.attr("width", `${g}px`), h.style("width", `${g}px`), d == null || d.attr("height", `${v}px`), h.style("height", `${v}px`), r && r(m);
6011
6046
  }).on(L.Click, (m) => {
@@ -6038,7 +6073,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6038
6073
  startMovingNode(t, e) {
6039
6074
  if (this.canUserPerformAction(S.MoveNode) && !e.removed)
6040
6075
  if (x(P.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((o) => o instanceof O) > 1)
6041
- this.currentAction = new ce(
6076
+ this.currentAction = new he(
6042
6077
  this,
6043
6078
  this.userSelection.filter((o) => o instanceof O).map((o) => o.id),
6044
6079
  e.coords
@@ -6063,7 +6098,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6063
6098
  * Method to call to continue the moving of a node triggered by a user drag event.
6064
6099
  */
6065
6100
  continueMovingNode(t, e) {
6066
- if (this.canUserPerformAction(S.MoveNode) && (this.currentAction instanceof ce || this.currentAction instanceof J) && !e.removed) {
6101
+ if (this.canUserPerformAction(S.MoveNode) && (this.currentAction instanceof he || this.currentAction instanceof J) && !e.removed) {
6067
6102
  const o = [
6068
6103
  t.x - e.width / 2,
6069
6104
  t.y - e.height / 2
@@ -6084,7 +6119,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6084
6119
  t.x - e.width / 2,
6085
6120
  t.y - e.height / 2
6086
6121
  ];
6087
- if (this.snapToGrid && (s = this.getClosestGridPoint(s)), this.currentAction instanceof ce) {
6122
+ if (this.snapToGrid && (s = this.getClosestGridPoint(s)), this.currentAction instanceof he) {
6088
6123
  const n = this.currentAction.delta;
6089
6124
  this.currentAction.delta = [
6090
6125
  s[0] - n[0],
@@ -6097,11 +6132,11 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6097
6132
  e.move(s);
6098
6133
  const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((h) => h.id !== e.id && !h.isDescendantOf(e)).filter(
6099
6134
  (h) => h.type.childrenTypes.includes(e.type.id)
6100
- ), c = Ii(
6135
+ ), c = xi(
6101
6136
  r
6102
6137
  ), d = c[c.length - 1];
6103
6138
  if (d !== e.parent && (e.type.canBeParentless || d !== void 0)) {
6104
- const h = d == null ? void 0 : d.getLastAncestor(), u = this.currentAction.from, p = new Lo(
6139
+ const h = d == null ? void 0 : d.getLastAncestor(), u = this.currentAction.from, p = new Eo(
6105
6140
  this,
6106
6141
  e.id,
6107
6142
  (o = e.parent) == null ? void 0 : o.id,
@@ -6149,7 +6184,7 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6149
6184
  const e = this.getPointerLocationRelativeToCanvas(t);
6150
6185
  (o = this.multipleSelectionContainer) == null || o.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
6151
6186
  for (const a of this.model.nodes)
6152
- Ui(
6187
+ Xi(
6153
6188
  [
6154
6189
  a.coords,
6155
6190
  [a.coords[0] + a.width, a.coords[1] + a.height]
@@ -6157,13 +6192,13 @@ const Bo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
6157
6192
  [this.draggingFrom, e]
6158
6193
  ) && this.userSelection.add(a);
6159
6194
  this.multipleSelectionOn = !1, this.diagramEvent$.next(
6160
- new F(this.userSelection.all(), !0)
6195
+ new B(this.userSelection.all(), !0)
6161
6196
  ), x();
6162
6197
  }
6163
6198
  };
6164
- Jt.canvasCount = 0;
6165
- let be = Jt;
6166
- class Ni {
6199
+ ee.canvasCount = 0;
6200
+ let Ce = ee;
6201
+ class zi {
6167
6202
  constructor() {
6168
6203
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
6169
6204
  }
@@ -6275,7 +6310,7 @@ class Ni {
6275
6310
  }
6276
6311
  }
6277
6312
  }
6278
- class Yo {
6313
+ class Xo {
6279
6314
  constructor(t) {
6280
6315
  this.gapSize = t;
6281
6316
  }
@@ -6283,9 +6318,9 @@ class Yo {
6283
6318
  var n;
6284
6319
  if (t.nodes.length === 0)
6285
6320
  return t;
6286
- const e = new Ni(), o = t.nodes.filter((r) => !r.parent);
6321
+ const e = new zi(), o = t.nodes.filter((r) => !r.parent);
6287
6322
  for (; o.length > 0; )
6288
- Pi(
6323
+ Ri(
6289
6324
  o[0],
6290
6325
  e,
6291
6326
  [0, 0],
@@ -6303,18 +6338,18 @@ class Yo {
6303
6338
  return t;
6304
6339
  }
6305
6340
  }
6306
- const Pi = (i, t, e, o) => {
6341
+ const Ri = (i, t, e, o) => {
6307
6342
  const a = t.getClosestEmptyCoordinate(e);
6308
6343
  t.set(a, i), K(o, i);
6309
6344
  for (const l of i.getAdjacentNodes())
6310
- o.includes(l) && Pi(
6345
+ o.includes(l) && Ri(
6311
6346
  l,
6312
6347
  t,
6313
6348
  a,
6314
6349
  o
6315
6350
  );
6316
6351
  };
6317
- class Xo {
6352
+ class jo {
6318
6353
  constructor(t) {
6319
6354
  this.gapSize = t;
6320
6355
  }
@@ -6322,7 +6357,7 @@ class Xo {
6322
6357
  var d;
6323
6358
  if (t.nodes.length === 0)
6324
6359
  return t;
6325
- const e = new Ni(), o = t.nodes.filter((h) => !h.parent), a = {}, l = o[0];
6360
+ const e = new zi(), o = t.nodes.filter((h) => !h.parent), a = {}, l = o[0];
6326
6361
  let s = [l];
6327
6362
  for (a[l.id] = [0, 0]; o.length > 0; ) {
6328
6363
  const h = [];
@@ -6356,7 +6391,7 @@ class Xo {
6356
6391
  return t;
6357
6392
  }
6358
6393
  }
6359
- class re {
6394
+ class le {
6360
6395
  constructor(t) {
6361
6396
  this.gapSize = t;
6362
6397
  }
@@ -6391,7 +6426,7 @@ class re {
6391
6426
  return t;
6392
6427
  }
6393
6428
  }
6394
- class jo {
6429
+ class Wo {
6395
6430
  constructor(t) {
6396
6431
  this.gapSize = t;
6397
6432
  }
@@ -6399,7 +6434,7 @@ class jo {
6399
6434
  var h;
6400
6435
  if (t.nodes.length === 0)
6401
6436
  return t;
6402
- new re(this.gapSize).apply(t);
6437
+ new le(this.gapSize).apply(t);
6403
6438
  const e = this.gapSize !== void 0 ? this.gapSize : (((h = t.canvas) == null ? void 0 : h.gridSize) || 0) * 2, o = 0.99, a = 1, l = 0.1, s = 2e5, n = 0.5, r = 1, c = 2e-3;
6404
6439
  let d = 100;
6405
6440
  for (; d > a; ) {
@@ -6419,7 +6454,7 @@ class jo {
6419
6454
  ], v = [
6420
6455
  m.coords[0] + m.width / 2,
6421
6456
  m.coords[1] + m.height / 2
6422
- ], w = pi(
6457
+ ], w = bi(
6423
6458
  p.coords,
6424
6459
  m.coords
6425
6460
  ), y = [m.coords[0], m.coords[1]];
@@ -6442,7 +6477,7 @@ class jo {
6442
6477
  return t;
6443
6478
  }
6444
6479
  }
6445
- class Wo {
6480
+ class Zo {
6446
6481
  constructor(t) {
6447
6482
  this.gapSize = t;
6448
6483
  }
@@ -6458,7 +6493,7 @@ class Wo {
6458
6493
  return t;
6459
6494
  }
6460
6495
  }
6461
- class Zo {
6496
+ class Ko {
6462
6497
  constructor(t) {
6463
6498
  this.gapSize = t;
6464
6499
  }
@@ -6472,7 +6507,7 @@ class Zo {
6472
6507
  ...t.nodes.map((h) => h.getPriority())
6473
6508
  );
6474
6509
  if (e === o)
6475
- return new re(this.gapSize).apply(t), t;
6510
+ return new le(this.gapSize).apply(t), t;
6476
6511
  const a = this.gapSize !== void 0 ? this.gapSize : (((d = t.canvas) == null ? void 0 : d.gridSize) || 0) * 2, l = t.nodes.filter((h) => !h.parent), s = [], n = t.nodes.filter((h) => !h.parent).filter((h) => h.getPriority() >= e), r = [];
6477
6512
  if (n.length > 1) {
6478
6513
  const h = n[0];
@@ -6526,7 +6561,7 @@ class Zo {
6526
6561
  return t;
6527
6562
  }
6528
6563
  }
6529
- class Ko {
6564
+ class qo {
6530
6565
  constructor(t) {
6531
6566
  this.gapSize = t;
6532
6567
  }
@@ -6540,17 +6575,17 @@ class Ko {
6540
6575
  ...t.nodes.map((h) => h.getPriority())
6541
6576
  );
6542
6577
  if (e === o)
6543
- return new re(this.gapSize).apply(t), t;
6578
+ return new le(this.gapSize).apply(t), t;
6544
6579
  const a = this.gapSize !== void 0 ? this.gapSize : (((d = t.canvas) == null ? void 0 : d.gridSize) || 0) * 2, l = t.nodes.filter((h) => !h.parent).sort((h, u) => u.getPriority() - h.getPriority()), s = [];
6545
6580
  for (; l.length > 0; ) {
6546
6581
  const h = l[0];
6547
6582
  l.splice(0, 1);
6548
- const u = new Ce(void 0, h);
6549
- zi(u, l), s.push(u);
6583
+ const u = new xe(void 0, h);
6584
+ Vi(u, l), s.push(u);
6550
6585
  }
6551
6586
  const n = [];
6552
6587
  for (const h of s)
6553
- n.push([h]), Ri(h, n, n.length);
6588
+ n.push([h]), _i(h, n, n.length);
6554
6589
  const r = Math.max(...t.nodes.map((h) => h.height));
6555
6590
  let c = 0;
6556
6591
  for (let h = 0; h < n.length; ++h) {
@@ -6569,29 +6604,29 @@ class Ko {
6569
6604
  return t;
6570
6605
  }
6571
6606
  }
6572
- const zi = (i, t) => {
6607
+ const Vi = (i, t) => {
6573
6608
  for (const e of i.node.getAdjacentNodes().sort((o, a) => a.getPriority() - o.getPriority())) {
6574
6609
  const o = t.indexOf(e);
6575
6610
  if (o >= 0) {
6576
6611
  t.splice(o, 1);
6577
6612
  const a = i.addBranch(e);
6578
- zi(a, t);
6613
+ Vi(a, t);
6579
6614
  }
6580
6615
  }
6581
- }, Ri = (i, t, e) => {
6616
+ }, _i = (i, t, e) => {
6582
6617
  if (i.branches.length > 0) {
6583
6618
  for (; e >= t.length; )
6584
6619
  t.push([]);
6585
6620
  for (const o of i.branches)
6586
- t[e].push(o), Ri(o, t, e + 1);
6621
+ t[e].push(o), _i(o, t, e + 1);
6587
6622
  }
6588
6623
  };
6589
- class Ce {
6624
+ class xe {
6590
6625
  constructor(t, e) {
6591
6626
  this.parent = t, this.branches = [], this.depth = 0, this.node = e;
6592
6627
  }
6593
6628
  addBranch(t) {
6594
- const e = new Ce(this, t);
6629
+ const e = new xe(this, t);
6595
6630
  return e.depth = this.depth + 1, this.branches.push(e), e;
6596
6631
  }
6597
6632
  countBranchHeight() {
@@ -6605,7 +6640,7 @@ class Ce {
6605
6640
  }
6606
6641
  }
6607
6642
  }
6608
- class qo {
6643
+ class Jo {
6609
6644
  constructor(t) {
6610
6645
  this.gapSize = t;
6611
6646
  }
@@ -6621,17 +6656,17 @@ class qo {
6621
6656
  return t;
6622
6657
  }
6623
6658
  }
6624
- const ui = {
6625
- adjacency: new Yo(),
6626
- breadth: new re(),
6627
- "breadth-adjacency": new Xo(),
6628
- force: new jo(),
6629
- horizontal: new Wo(),
6630
- priority: new Zo(),
6631
- tree: new Ko(),
6632
- vertical: new qo()
6633
- }, Jo = fi({}), Tt = fi({});
6634
- class Qo {
6659
+ const pi = {
6660
+ adjacency: new Xo(),
6661
+ breadth: new le(),
6662
+ "breadth-adjacency": new jo(),
6663
+ force: new Wo(),
6664
+ horizontal: new Zo(),
6665
+ priority: new Ko(),
6666
+ tree: new qo(),
6667
+ vertical: new Jo()
6668
+ }, Qo = yi({}), $t = yi({});
6669
+ class ts {
6635
6670
  constructor(t, e) {
6636
6671
  this.onTitleChange = t, this.onValueSetChange = e;
6637
6672
  }
@@ -6650,7 +6685,7 @@ class Qo {
6650
6685
  highlightProperty(...t) {
6651
6686
  }
6652
6687
  }
6653
- const Se = ({
6688
+ const Le = ({
6654
6689
  direction: i,
6655
6690
  collapsableSelector: t,
6656
6691
  collapsableAdditionalSelector: e,
@@ -6695,10 +6730,10 @@ const Se = ({
6695
6730
  children: /* @__PURE__ */ k("div", { className: u() })
6696
6731
  }
6697
6732
  ) });
6698
- }, ts = () => {
6699
- const i = Yt(Tt), t = ct(null), [e, o] = U([]);
6700
- Gi(i.validatorChange$, i.diagramChange$).pipe(
6701
- Bi(() => a())
6733
+ }, es = () => {
6734
+ const i = Wt($t), t = dt(null), [e, o] = U([]);
6735
+ Bi(i.validatorChange$, i.diagramChange$).pipe(
6736
+ Ui(() => a())
6702
6737
  ).subscribe();
6703
6738
  const a = () => {
6704
6739
  o([]);
@@ -6731,7 +6766,7 @@ const Se = ({
6731
6766
  " errors found"
6732
6767
  ] }),
6733
6768
  /* @__PURE__ */ k("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ k(
6734
- Se,
6769
+ Le,
6735
6770
  {
6736
6771
  collapsableSelector: t,
6737
6772
  collapsableAdditionalSelector: ".daga-error-panel",
@@ -6753,18 +6788,18 @@ const Se = ({
6753
6788
  n
6754
6789
  )) }) })
6755
6790
  ] }) });
6756
- }, es = 200, mi = (i) => (i || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Vi = ({
6791
+ }, is = 200, vi = (i) => (i || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Oi = ({
6757
6792
  disabled: i,
6758
6793
  options: t,
6759
6794
  value: e,
6760
6795
  onChange: o
6761
6796
  }) => {
6762
- const a = ct(null), [l, s] = U("");
6797
+ const a = dt(null), [l, s] = U("");
6763
6798
  let n;
6764
6799
  const [r, c] = U([]), [d, h] = U([]), [u, p] = U([]), [f, m] = U([]), [g, v] = U(!1);
6765
- Et(() => {
6800
+ Tt(() => {
6766
6801
  var T;
6767
- s(((T = t.find((z) => Lt(z.key, e))) == null ? void 0 : T.label) || "");
6802
+ s(((T = t.find((z) => Et(z.key, e))) == null ? void 0 : T.label) || "");
6768
6803
  }, [e, t]);
6769
6804
  const w = (T) => {
6770
6805
  if (!i)
@@ -6792,12 +6827,12 @@ const Se = ({
6792
6827
  }
6793
6828
  }, y = () => {
6794
6829
  if (!i) {
6795
- const T = mi(l.trim());
6830
+ const T = vi(l.trim());
6796
6831
  c([]), h([]), p([]), m([]);
6797
6832
  for (const z of t) {
6798
- const D = mi(z.label).indexOf(T);
6833
+ const D = vi(z.label).indexOf(T);
6799
6834
  if (D >= 0) {
6800
- const q = z.label.substring(0, D), G = z.label.substring(
6835
+ const q = z.label.substring(0, D), H = z.label.substring(
6801
6836
  D,
6802
6837
  D + T.length
6803
6838
  ), Y = z.label.substring(
@@ -6808,7 +6843,7 @@ const Se = ({
6808
6843
  q
6809
6844
  ]), p((W) => [
6810
6845
  ...W,
6811
- G
6846
+ H
6812
6847
  ]), m((W) => [
6813
6848
  ...W,
6814
6849
  Y
@@ -6828,7 +6863,7 @@ const Se = ({
6828
6863
  }, E = () => {
6829
6864
  setTimeout(() => {
6830
6865
  A();
6831
- }, es);
6866
+ }, is);
6832
6867
  }, $ = (T) => {
6833
6868
  var j;
6834
6869
  const z = (j = a.current) == null ? void 0 : j.querySelectorAll("li")[T];
@@ -6878,10 +6913,10 @@ const Se = ({
6878
6913
  ]
6879
6914
  }
6880
6915
  );
6881
- }, is = (i, t) => {
6916
+ }, os = (i, t) => {
6882
6917
  var e;
6883
6918
  return ((e = i.find((o) => o.key === t)) == null ? void 0 : e.label) || `${t}`;
6884
- }, os = ({
6919
+ }, ss = ({
6885
6920
  disabled: i,
6886
6921
  allowRepeats: t,
6887
6922
  options: e,
@@ -6889,8 +6924,8 @@ const Se = ({
6889
6924
  onChange: a
6890
6925
  }) => {
6891
6926
  const [l, s] = U(), [n, r] = U([]), [c, d] = U([]);
6892
- Et(() => {
6893
- const g = o.length === 0, v = o.map((w) => is(e, w));
6927
+ Tt(() => {
6928
+ const g = o.length === 0, v = o.map((w) => os(e, w));
6894
6929
  r(v), g && a(o), m();
6895
6930
  }, [o, e]);
6896
6931
  const h = (g) => {
@@ -6926,7 +6961,7 @@ const Se = ({
6926
6961
  ] }, v)),
6927
6962
  !i && /* @__PURE__ */ V("div", { className: "daga-value-item-input", children: [
6928
6963
  /* @__PURE__ */ k("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ k(
6929
- Vi,
6964
+ Oi,
6930
6965
  {
6931
6966
  disabled: i,
6932
6967
  options: t ? e || [] : c || [],
@@ -6937,7 +6972,7 @@ const Se = ({
6937
6972
  /* @__PURE__ */ k("button", { className: "daga-property-button", onClick: p, children: /* @__PURE__ */ k("div", { className: "daga-icon daga-add-icon" }) })
6938
6973
  ] })
6939
6974
  ] });
6940
- }, ss = ({
6975
+ }, ns = ({
6941
6976
  disabled: i,
6942
6977
  allowRepeats: t,
6943
6978
  value: e,
@@ -6963,7 +6998,7 @@ const Se = ({
6963
6998
  }, h = (u) => {
6964
6999
  u.key === "Enter" && c();
6965
7000
  };
6966
- return /* @__PURE__ */ V(Di, { children: [
7001
+ return /* @__PURE__ */ V(Hi, { children: [
6967
7002
  e.map((u, p) => /* @__PURE__ */ V("div", { className: "daga-value-item-element", children: [
6968
7003
  /* @__PURE__ */ k(
6969
7004
  "input",
@@ -7000,7 +7035,7 @@ const Se = ({
7000
7035
  /* @__PURE__ */ k("button", { className: "daga-property-button", onClick: c, children: /* @__PURE__ */ k("div", { className: "daga-icon daga-add-icon" }) })
7001
7036
  ] })
7002
7037
  ] });
7003
- }, ns = ({
7038
+ }, rs = ({
7004
7039
  disabled: i,
7005
7040
  value: t,
7006
7041
  onChange: e
@@ -7115,13 +7150,13 @@ const Se = ({
7115
7150
  /* @__PURE__ */ k("button", { className: "daga-property-button", onClick: u, children: /* @__PURE__ */ k("div", { className: "daga-icon daga-add-icon" }) })
7116
7151
  ] })
7117
7152
  ] });
7118
- }, _i = ({
7153
+ }, Di = ({
7119
7154
  valueSet: i,
7120
7155
  onValueChange: t,
7121
7156
  depth: e
7122
7157
  }) => {
7123
7158
  var r;
7124
- const a = Yt(Tt).canUserPerformAction(S.UpdateValues) && ((r = i == null ? void 0 : i.rootElement) == null ? void 0 : r.removed) !== !0, l = (c) => "daga-property-name-" + c.replace(/\s/g, ""), s = (c) => {
7159
+ const a = Wt($t).canUserPerformAction(S.UpdateValues) && ((r = i == null ? void 0 : i.rootElement) == null ? void 0 : r.removed) !== !0, l = (c) => "daga-property-name-" + c.replace(/\s/g, ""), s = (c) => {
7125
7160
  if (typeof c == "string")
7126
7161
  return c;
7127
7162
  if (c == null || isNaN(c.valueOf()))
@@ -7134,12 +7169,12 @@ const Se = ({
7134
7169
  {
7135
7170
  className: `daga-property ${l(c.name)}`,
7136
7171
  children: [
7137
- /* @__PURE__ */ k("p", { className: "daga-property-name", children: c.name }),
7172
+ /* @__PURE__ */ k("p", { className: "daga-property-name", children: c.label || c.name }),
7138
7173
  c.type === _.Text && /* @__PURE__ */ k(
7139
7174
  "input",
7140
7175
  {
7141
7176
  type: "daga-text",
7142
- disabled: !c.editable || !a,
7177
+ disabled: c.editable === !1 || !a,
7143
7178
  value: i == null ? void 0 : i.getValue(c.name),
7144
7179
  onChange: (d) => t(i, c, d.target.value)
7145
7180
  }
@@ -7147,7 +7182,7 @@ const Se = ({
7147
7182
  c.type === _.TextArea && /* @__PURE__ */ k(
7148
7183
  "textarea",
7149
7184
  {
7150
- disabled: !c.editable || !a,
7185
+ disabled: c.editable === !1 || !a,
7151
7186
  value: i == null ? void 0 : i.getValue(c.name),
7152
7187
  onChange: (d) => t(i, c, d.target.value)
7153
7188
  }
@@ -7156,7 +7191,7 @@ const Se = ({
7156
7191
  "input",
7157
7192
  {
7158
7193
  type: "number",
7159
- disabled: !c.editable || !a,
7194
+ disabled: c.editable === !1 || !a,
7160
7195
  value: i == null ? void 0 : i.getValue(c.name),
7161
7196
  onChange: (d) => t(i, c, d.target.value)
7162
7197
  }
@@ -7166,7 +7201,7 @@ const Se = ({
7166
7201
  {
7167
7202
  type: "text",
7168
7203
  pattern: "#[0-9a-fA-F]{6}",
7169
- disabled: !c.editable || !a,
7204
+ disabled: c.editable === !1 || !a,
7170
7205
  value: i == null ? void 0 : i.getValue(c.name),
7171
7206
  onChange: (d) => t(i, c, d.target.value)
7172
7207
  }
@@ -7175,16 +7210,22 @@ const Se = ({
7175
7210
  "input",
7176
7211
  {
7177
7212
  type: "datetime-local",
7178
- disabled: !c.editable || !a,
7179
- value: s(i == null ? void 0 : i.getValue(c.name)),
7180
- onChange: (d) => t(i, c, n(d.target.value))
7213
+ disabled: c.editable === !1 || !a,
7214
+ value: s(
7215
+ i == null ? void 0 : i.getValue(c.name)
7216
+ ),
7217
+ onChange: (d) => t(
7218
+ i,
7219
+ c,
7220
+ n(d.target.value)
7221
+ )
7181
7222
  }
7182
7223
  ),
7183
7224
  c.type === _.Date && /* @__PURE__ */ k(
7184
7225
  "input",
7185
7226
  {
7186
7227
  type: "date",
7187
- disabled: !c.editable || !a,
7228
+ disabled: c.editable === !1 || !a,
7188
7229
  value: i == null ? void 0 : i.getValue(c.name),
7189
7230
  onChange: (d) => t(i, c, d.target.value)
7190
7231
  }
@@ -7193,7 +7234,7 @@ const Se = ({
7193
7234
  "input",
7194
7235
  {
7195
7236
  type: "time",
7196
- disabled: !c.editable || !a,
7237
+ disabled: c.editable === !1 || !a,
7197
7238
  value: i == null ? void 0 : i.getValue(c.name),
7198
7239
  onChange: (d) => t(i, c, d.target.value)
7199
7240
  }
@@ -7202,54 +7243,66 @@ const Se = ({
7202
7243
  "input",
7203
7244
  {
7204
7245
  type: "url",
7205
- disabled: !c.editable || !a,
7246
+ disabled: c.editable === !1 || !a,
7206
7247
  value: i == null ? void 0 : i.getValue(c.name),
7207
7248
  onChange: (d) => t(i, c, d.target.value)
7208
7249
  }
7209
7250
  ),
7210
7251
  c.type === _.Boolean && /* @__PURE__ */ V("div", { className: "daga-radio", children: [
7211
- /* @__PURE__ */ V("label", { className: "daga-radio-item daga-radio-start" + ((i == null ? void 0 : i.getValue(c.name)) === !1 ? " daga-checked" : ""), children: [
7212
- /* @__PURE__ */ k(
7213
- "input",
7214
- {
7215
- type: "radio",
7216
- disabled: !c.editable || !a,
7217
- name: c.name,
7218
- value: "false",
7219
- checked: (i == null ? void 0 : i.getValue(c.name)) === !1,
7220
- onChange: () => t(i, c, !1)
7221
- }
7222
- ),
7223
- "No"
7224
- ] }),
7225
- /* @__PURE__ */ V("label", { className: "daga-radio-item daga-radio-end" + ((i == null ? void 0 : i.getValue(c.name)) === !0 ? " daga-checked" : ""), children: [
7226
- /* @__PURE__ */ k(
7227
- "input",
7228
- {
7229
- type: "radio",
7230
- disabled: !c.editable || !a,
7231
- name: c.name,
7232
- value: "true",
7233
- checked: (i == null ? void 0 : i.getValue(c.name)) === !0,
7234
- onChange: () => t(i, c, !0)
7235
- }
7236
- ),
7237
- "Yes"
7238
- ] })
7252
+ /* @__PURE__ */ V(
7253
+ "label",
7254
+ {
7255
+ className: "daga-radio-item daga-radio-start" + ((i == null ? void 0 : i.getValue(c.name)) === !1 ? " daga-checked" : ""),
7256
+ children: [
7257
+ /* @__PURE__ */ k(
7258
+ "input",
7259
+ {
7260
+ type: "radio",
7261
+ disabled: c.editable === !1 || !a,
7262
+ name: c.name,
7263
+ value: "false",
7264
+ checked: (i == null ? void 0 : i.getValue(c.name)) === !1,
7265
+ onChange: () => t(i, c, !1)
7266
+ }
7267
+ ),
7268
+ "No"
7269
+ ]
7270
+ }
7271
+ ),
7272
+ /* @__PURE__ */ V(
7273
+ "label",
7274
+ {
7275
+ className: "daga-radio-item daga-radio-end" + ((i == null ? void 0 : i.getValue(c.name)) === !0 ? " daga-checked" : ""),
7276
+ children: [
7277
+ /* @__PURE__ */ k(
7278
+ "input",
7279
+ {
7280
+ type: "radio",
7281
+ disabled: c.editable === !1 || !a,
7282
+ name: c.name,
7283
+ value: "true",
7284
+ checked: (i == null ? void 0 : i.getValue(c.name)) === !0,
7285
+ onChange: () => t(i, c, !0)
7286
+ }
7287
+ ),
7288
+ "Yes"
7289
+ ]
7290
+ }
7291
+ )
7239
7292
  ] }),
7240
7293
  c.type === _.Option && /* @__PURE__ */ k("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ k(
7241
- Vi,
7294
+ Oi,
7242
7295
  {
7243
- disabled: !c.editable || !a,
7296
+ disabled: c.editable === !1 || !a,
7244
7297
  options: c.options || [],
7245
7298
  value: i == null ? void 0 : i.getValue(c.name),
7246
7299
  onChange: (d) => t(i, c, d)
7247
7300
  }
7248
7301
  ) }),
7249
7302
  (c.type === _.OptionList || c.type === _.OptionSet) && /* @__PURE__ */ k(
7250
- os,
7303
+ ss,
7251
7304
  {
7252
- disabled: !c.editable || !a,
7305
+ disabled: c.editable === !1 || !a,
7253
7306
  allowRepeats: c.type === _.OptionList,
7254
7307
  options: c.options || [],
7255
7308
  value: i == null ? void 0 : i.getValue(c.name),
@@ -7257,24 +7310,24 @@ const Se = ({
7257
7310
  }
7258
7311
  ),
7259
7312
  (c.type === _.TextList || c.type === _.TextSet) && /* @__PURE__ */ k(
7260
- ss,
7313
+ ns,
7261
7314
  {
7262
- disabled: !c.editable || !a,
7315
+ disabled: c.editable === !1 || !a,
7263
7316
  allowRepeats: c.type === _.TextList,
7264
7317
  value: i == null ? void 0 : i.getValue(c.name),
7265
7318
  onChange: (d) => t(i, c, d)
7266
7319
  }
7267
7320
  ),
7268
7321
  c.type === _.TextMap && /* @__PURE__ */ k(
7269
- ns,
7322
+ rs,
7270
7323
  {
7271
- disabled: !c.editable || !a,
7324
+ disabled: c.editable === !1 || !a,
7272
7325
  value: i == null ? void 0 : i.getValue(c.name),
7273
7326
  onChange: (d) => t(i, c, d)
7274
7327
  }
7275
7328
  ),
7276
7329
  c.type === _.Object && /* @__PURE__ */ k("div", { className: "daga-left-bar", children: /* @__PURE__ */ k(
7277
- _i,
7330
+ Di,
7278
7331
  {
7279
7332
  valueSet: i.getSubValueSet(c.name),
7280
7333
  onValueChange: t,
@@ -7285,8 +7338,8 @@ const Se = ({
7285
7338
  },
7286
7339
  c.name
7287
7340
  )) });
7288
- }, Oi = ({ valueSet: i, depth: t }) => {
7289
- const e = Yt(Tt), o = ct(null), a = (r) => "daga-property-name-" + r.replace(/\s/g, ""), l = () => {
7341
+ }, Fi = ({ valueSet: i, depth: t }) => {
7342
+ const e = Wt($t), o = dt(null), a = (r) => "daga-property-name-" + r.replace(/\s/g, ""), l = () => {
7290
7343
  for (const r of (i == null ? void 0 : i.displayedProperties) || []) {
7291
7344
  let c = 0, d = 0, h = 0;
7292
7345
  const u = N.select(o.current).select(
@@ -7352,7 +7405,7 @@ const Se = ({
7352
7405
  if (i === void 0)
7353
7406
  return;
7354
7407
  let c;
7355
- r instanceof ro ? c = r : r instanceof Event ? c = i == null ? void 0 : i.propertySet.getProperty(
7408
+ r instanceof lo ? c = r : r instanceof Event ? c = i == null ? void 0 : i.propertySet.getProperty(
7356
7409
  ((d = r.target) == null ? void 0 : d.value) || ""
7357
7410
  ) : c = i == null ? void 0 : i.propertySet.getProperty(r || ""), c && (i == null || i.hideProperty(c)), l();
7358
7411
  };
@@ -7369,7 +7422,7 @@ const Se = ({
7369
7422
  className: `daga-property ${a(r.name)} daga-depth-${t}`,
7370
7423
  children: [
7371
7424
  /* @__PURE__ */ V("div", { className: "daga-property-name", children: [
7372
- /* @__PURE__ */ k("span", { children: r.name }),
7425
+ /* @__PURE__ */ k("span", { children: r.label || r.name }),
7373
7426
  /* @__PURE__ */ V("div", { className: "daga-buttons", children: [
7374
7427
  /* @__PURE__ */ k("button", { className: "daga-property-button daga-move-button", children: /* @__PURE__ */ k("div", { className: "daga-icon daga-move-icon" }) }),
7375
7428
  /* @__PURE__ */ k(
@@ -7382,9 +7435,9 @@ const Se = ({
7382
7435
  )
7383
7436
  ] })
7384
7437
  ] }),
7385
- r.type !== _.Object && /* @__PURE__ */ k("div", { className: "daga-property-value", children: rs(i == null ? void 0 : i.getValue(r.name)) }),
7438
+ r.type !== _.Object && /* @__PURE__ */ k("div", { className: "daga-property-value", children: as(i == null ? void 0 : i.getValue(r.name)) }),
7386
7439
  r.type === _.Object && /* @__PURE__ */ k(
7387
- Oi,
7440
+ Fi,
7388
7441
  {
7389
7442
  valueSet: i == null ? void 0 : i.getSubValueSet(r.name),
7390
7443
  depth: t + 1
@@ -7404,9 +7457,9 @@ const Se = ({
7404
7457
  r.name
7405
7458
  ))
7406
7459
  ] });
7407
- }, rs = (i) => Array.isArray(i) ? i.join(", ") : ao(i) ? Object.entries(i).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : i instanceof Date ? i.toLocaleString() : i == null ? "" : "" + i, as = ({ location: i, direction: t, width: e, title: o, valueSet: a, onValueChange: l }) => {
7408
- const s = ct(null), [n, r] = U(!1), [c, d] = U(!1), h = () => N.select(s.current);
7409
- return Et(() => {
7460
+ }, as = (i) => Array.isArray(i) ? i.join(", ") : co(i) ? Object.entries(i).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : i instanceof Date ? i.toLocaleString() : i == null ? "" : "" + i, ls = ({ location: i, direction: t, width: e, title: o, valueSet: a, onValueChange: l }) => {
7461
+ const s = dt(null), [n, r] = U(!1), [c, d] = U(!1), h = () => N.select(s.current);
7462
+ return Tt(() => {
7410
7463
  if (s.current)
7411
7464
  switch (t) {
7412
7465
  case b.Bottom:
@@ -7425,7 +7478,7 @@ const Se = ({
7425
7478
  className: `daga-panel daga-bottom daga-${i} daga-${t}`,
7426
7479
  children: [
7427
7480
  /* @__PURE__ */ k(
7428
- Se,
7481
+ Le,
7429
7482
  {
7430
7483
  disabled: !a || !a.propertySet || !a.propertySet.hasProperties(),
7431
7484
  collapsed: n,
@@ -7456,24 +7509,24 @@ const Se = ({
7456
7509
  )
7457
7510
  ] }),
7458
7511
  !c && /* @__PURE__ */ k(
7459
- _i,
7512
+ Di,
7460
7513
  {
7461
7514
  valueSet: a,
7462
7515
  onValueChange: l,
7463
7516
  depth: 0
7464
7517
  }
7465
7518
  ),
7466
- c && /* @__PURE__ */ k(Oi, { valueSet: a, depth: 0 })
7519
+ c && /* @__PURE__ */ k(Fi, { valueSet: a, depth: 0 })
7467
7520
  ] })
7468
7521
  ]
7469
7522
  }
7470
7523
  ) });
7471
- }, ls = 6, cs = (i) => {
7472
- const t = Yt(Tt), [e, o] = U(
7524
+ }, cs = 6, ds = (i) => {
7525
+ const t = Wt($t), [e, o] = U(
7473
7526
  i.currentPalette || i.palettes[0]
7474
7527
  ), [a, l] = U(0), [s, n] = U(
7475
7528
  void 0
7476
- ), r = ct(null), c = (m) => {
7529
+ ), r = dt(null), c = (m) => {
7477
7530
  if (o(m), d().selectAll("*").remove(), l(t.getPriorityThreshold() || 0), m.categories && h(m.categories), m.templates)
7478
7531
  for (const g of m.templates)
7479
7532
  u(g);
@@ -7503,7 +7556,7 @@ const Se = ({
7503
7556
  }, p = (m, g, v) => {
7504
7557
  if (a !== void 0 && m.priority < a)
7505
7558
  return;
7506
- const w = m.defaultLook.lookType === "shaped-look" ? m.defaultLook.borderThickness : 0, y = m.defaultHeight + w, A = m.defaultWidth + w, I = g.height || y, E = g.width || A, $ = d().append("div").attr(
7559
+ const w = m.defaultLook.lookType === "shaped-look" ? m.defaultLook.borderThickness || 1 : 0, y = m.defaultHeight + w, A = m.defaultWidth + w, I = g.height || y, E = g.width || A, $ = d().append("div").attr(
7507
7560
  "class",
7508
7561
  `daga-template-container ${v !== void 0 ? v : ""}`
7509
7562
  ).style("width", `${E}px`).style("height", `${I}px`).call(
@@ -7528,7 +7581,7 @@ const Se = ({
7528
7581
  var T;
7529
7582
  if (t.canUserPerformAction(S.AddNode)) {
7530
7583
  if (x(P.Auto), $.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), m.isUnique && t.model.nodes.find(
7531
- (xt) => !xt.removed && xt.type.id === m.id
7584
+ (Lt) => !Lt.removed && Lt.type.id === m.id
7532
7585
  ) !== void 0)
7533
7586
  return;
7534
7587
  const z = t.getPointerLocationRelativeToScreen(R);
@@ -7552,24 +7605,24 @@ const Se = ({
7552
7605
  D[0],
7553
7606
  D[1]
7554
7607
  ).filter(
7555
- (xt) => xt.type.childrenTypes.includes(m.id)
7556
- ), W = Ii(
7608
+ (Lt) => Lt.type.childrenTypes.includes(m.id)
7609
+ ), W = xi(
7557
7610
  Y
7558
- ), at = W[W.length - 1];
7559
- if (!m.canBeParentless && at === void 0)
7611
+ ), lt = W[W.length - 1];
7612
+ if (!m.canBeParentless && lt === void 0)
7560
7613
  return;
7561
- const ut = at == null ? void 0 : at.getLastAncestor(), _t = new xo(
7614
+ const mt = lt == null ? void 0 : lt.getLastAncestor(), Dt = new Lo(
7562
7615
  t,
7563
7616
  m,
7564
7617
  q,
7565
- at == null ? void 0 : at.id,
7566
- ut == null ? void 0 : ut.id,
7567
- ut == null ? void 0 : ut.getGeometry(),
7618
+ lt == null ? void 0 : lt.id,
7619
+ mt == null ? void 0 : mt.id,
7620
+ mt == null ? void 0 : mt.getGeometry(),
7568
7621
  void 0,
7569
7622
  g.label,
7570
7623
  g.values
7571
7624
  );
7572
- _t.do(), t == null || t.actionStack.add(_t), x();
7625
+ Dt.do(), t == null || t.actionStack.add(Dt), x();
7573
7626
  }
7574
7627
  })
7575
7628
  ).append("svg").attr("class", `palette-node ${m.id}`).attr("viewBox", `0 0 ${A} ${y}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${E}px`).style("height", `${I}px`), C = g.look || m.defaultLook;
@@ -7577,14 +7630,14 @@ const Se = ({
7577
7630
  case "shaped-look":
7578
7631
  $.append("path").attr(
7579
7632
  "d",
7580
- ve(
7581
- C.shape,
7582
- C.borderThickness / 2,
7583
- C.borderThickness / 2,
7633
+ ke(
7634
+ C.shape || _t.Rectangle,
7635
+ (C.borderThickness || 1) / 2,
7636
+ (C.borderThickness || 1) / 2,
7584
7637
  m.defaultWidth,
7585
7638
  m.defaultHeight
7586
7639
  )
7587
- ).attr("fill", C.fillColor).attr("stroke", C.borderColor).attr("stroke-width", `${C.borderThickness}px`);
7640
+ ).attr("fill", C.fillColor || "#FFFFFF").attr("stroke", C.borderColor || "#000000").attr("stroke-width", `${C.borderThickness}px`);
7588
7641
  break;
7589
7642
  case "image-look":
7590
7643
  $.append("image").attr("x", 0).attr("y", 0).attr("width", m.defaultWidth).attr("height", m.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
@@ -7619,7 +7672,7 @@ const Se = ({
7619
7672
  ).html(R.html);
7620
7673
  if (g.label) {
7621
7674
  const R = {
7622
- ...H,
7675
+ ...F,
7623
7676
  ...m.label,
7624
7677
  ...g.labelLook
7625
7678
  };
@@ -7638,8 +7691,8 @@ const Se = ({
7638
7691
  });
7639
7692
  w.append("path").attr(
7640
7693
  "d",
7641
- ve(
7642
- Qt.Rectangle,
7694
+ ke(
7695
+ _t.Rectangle,
7643
7696
  0,
7644
7697
  0,
7645
7698
  g.width,
@@ -7647,10 +7700,10 @@ const Se = ({
7647
7700
  )
7648
7701
  ).attr("fill", g.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), g.icon !== "" && w.append("image").attr("x", 0).attr("y", 0).attr("width", g.width).attr("height", g.height).attr("href", g.icon), g.label !== "" && w.append("text").attr(
7649
7702
  "transform",
7650
- `translate(${g.width / 2},${g.height / 2 + ls})`
7703
+ `translate(${g.width / 2},${g.height / 2 + cs})`
7651
7704
  ).attr("x", 0).attr("y", 0).attr("font-size", "20px").attr("text-anchor", "middle").attr("font-family", "'Wonder Unit Sans', sans-serif").attr("font-weight", 400).attr("fill", "#000000").attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(g.label);
7652
7705
  };
7653
- return Et(() => {
7706
+ return Tt(() => {
7654
7707
  if (c(i.palettes[0]), r.current)
7655
7708
  switch (i.direction) {
7656
7709
  case b.Bottom:
@@ -7669,7 +7722,7 @@ const Se = ({
7669
7722
  className: `daga-panel daga-${i.location} daga-${i.direction}`,
7670
7723
  children: [
7671
7724
  /* @__PURE__ */ k(
7672
- Se,
7725
+ Le,
7673
7726
  {
7674
7727
  direction: i.direction,
7675
7728
  collapsableSelector: r,
@@ -7695,7 +7748,7 @@ const Se = ({
7695
7748
  ]
7696
7749
  }
7697
7750
  ) });
7698
- }, ds = ({
7751
+ }, hs = ({
7699
7752
  location: i,
7700
7753
  direction: t,
7701
7754
  enableAction: e,
@@ -7719,42 +7772,42 @@ const Se = ({
7719
7772
  d = "width", h = "scaleX", u = "left", p = "right";
7720
7773
  break;
7721
7774
  }
7722
- const f = ct(null), m = ct(null), g = ct(null);
7723
- Et(() => {
7775
+ const f = dt(null), m = dt(null), g = dt(null);
7776
+ Tt(() => {
7724
7777
  N.select(
7725
7778
  f.current
7726
7779
  ).style(`margin-${p}`, "-1rem").style(d, "0rem").style("transform", `${h}(0)`).style("transform-origin", u);
7727
7780
  });
7728
7781
  const v = async () => {
7729
- const G = N.select(
7782
+ const H = N.select(
7730
7783
  f.current
7731
7784
  );
7732
7785
  if (!c)
7733
7786
  if (r) {
7734
7787
  r = !1;
7735
- const at = `${4 * G.selectChildren().size()}rem`;
7736
- G.transition().duration(500).ease(N.easeLinear).style(d, at).style("transform", `${h}(1)`), setTimeout(() => {
7788
+ const lt = `${4 * H.selectChildren().size()}rem`;
7789
+ H.transition().duration(500).ease(N.easeLinear).style(d, lt).style("transform", `${h}(1)`), setTimeout(() => {
7737
7790
  c = !1;
7738
7791
  }, 500);
7739
7792
  } else
7740
- r = !0, G.transition().duration(500).ease(N.easeLinear).style(d, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
7793
+ r = !0, H.transition().duration(500).ease(N.easeLinear).style(d, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
7741
7794
  c = !1;
7742
7795
  }, 500);
7743
- }, w = Yt(Tt), y = () => {
7796
+ }, w = Wt($t), y = () => {
7744
7797
  w.zoomBy(w.zoomFactor);
7745
7798
  }, A = () => {
7746
7799
  w.zoomBy(1 / w.zoomFactor);
7747
7800
  }, I = () => {
7748
7801
  w.center();
7749
7802
  }, E = () => {
7750
- w.layoutFormat && w.layoutFormat in ui && ui[w.layoutFormat].apply(w.model);
7803
+ w.layoutFormat && w.layoutFormat in pi && pi[w.layoutFormat].apply(w.model);
7751
7804
  }, $ = () => {
7752
7805
  n = !n, N.select(
7753
7806
  g.current
7754
7807
  ).classed("daga-on", n).classed("daga-off", !n);
7755
- const G = w.getPriorityThresholdOptions();
7756
- G && G.length >= 2 && w.setPriorityThreshold(
7757
- G[n ? 1 : 0]
7808
+ const H = w.getPriorityThresholdOptions();
7809
+ H && H.length >= 2 && w.setPriorityThreshold(
7810
+ H[n ? 1 : 0]
7758
7811
  );
7759
7812
  }, C = () => {
7760
7813
  w.actionStack.undo();
@@ -7772,10 +7825,10 @@ const Se = ({
7772
7825
  w.multipleSelectionOn = !0, N.select(
7773
7826
  m.current
7774
7827
  ).classed("daga-on", !0).classed("daga-off", !1);
7775
- const G = w.diagramEvent$.subscribe((Y) => {
7776
- Y.type === Ei.Selection && (N.select(
7828
+ const H = w.diagramEvent$.subscribe((Y) => {
7829
+ Y.type === $i.Selection && (N.select(
7777
7830
  m.current
7778
- ).classed("daga-on", !1).classed("daga-off", !0), G.unsubscribe());
7831
+ ).classed("daga-on", !1).classed("daga-off", !0), H.unsubscribe());
7779
7832
  });
7780
7833
  };
7781
7834
  return /* @__PURE__ */ k("daga-diagram-buttons", { children: /* @__PURE__ */ V(
@@ -7801,15 +7854,15 @@ const Se = ({
7801
7854
  ]
7802
7855
  }
7803
7856
  ) });
7804
- }, ms = ({
7857
+ }, fs = ({
7805
7858
  config: i,
7806
7859
  model: t,
7807
7860
  onCanvasCreated: e,
7808
7861
  onDiagramEvent: o,
7809
7862
  onModelChange: a
7810
7863
  }) => {
7811
- var $, C, R, T, z, j, D, q, G, Y, W, at, ut, _t, xt, Ie, Ae, xe, Le, Ee, Te, $e, Me, Ne, Pe, ze, Re, Ve, _e, Oe, De, He, Ge, Be, Fe, Ue, Ye, Xe, je, We, Ze, Ke, qe, Je, Qe;
7812
- const l = new Li(), s = new Mi(), n = ct(null), r = ct(void 0), c = ct(!1), d = [], [h, u] = U(void 0), [p, f] = U(void 0), m = {
7864
+ var $, C, R, T, z, j, D, q, H, Y, W, lt, mt, Dt, Lt, Ee, Te, $e, Me, Ne, Pe, ze, Re, Ve, _e, Oe, De, Fe, He, Ge, Be, Ue, Ye, Xe, je, We, Ze, Ke, qe, Je, Qe, ti, ei, ii, oi;
7865
+ const l = new Ti(), s = new Pi(), n = dt(null), r = dt(void 0), c = dt(!1), d = [], [h, u] = U(void 0), [p, f] = U(void 0), m = {
7813
7866
  zoomIn: () => {
7814
7867
  },
7815
7868
  zoomOut: () => {
@@ -7827,82 +7880,82 @@ const Se = ({
7827
7880
  }, g = {
7828
7881
  refreshPalette: () => {
7829
7882
  }
7830
- }, v = new Qo(
7831
- (ht) => u(ht),
7832
- (ht) => f(ht)
7883
+ }, v = new ts(
7884
+ (gt) => u(gt),
7885
+ (gt) => f(gt)
7833
7886
  ), w = {
7834
7887
  diagramButtons: m,
7835
7888
  palette: g,
7836
7889
  propertyEditor: v
7837
- }, y = (ht = !1) => ((!r.current || ht) && (d.forEach((mt) => mt.unsubscribe()), r.current = new be(w, i)), r.current), A = y(), I = (ht) => {
7838
- A.initView(ht), d.push(
7839
- A.diagramEvent$.subscribe((mt) => {
7840
- o == null || o(mt);
7890
+ }, y = (gt = !1) => ((!r.current || gt) && (d.forEach((ft) => ft.unsubscribe()), r.current = new Ce(w, i)), r.current), A = y(), I = (gt) => {
7891
+ A.initView(gt), d.push(
7892
+ A.diagramEvent$.subscribe((ft) => {
7893
+ o == null || o(ft);
7841
7894
  })
7842
7895
  ), d.push(
7843
7896
  A.diagramChange$.subscribe(() => {
7844
- const mt = s.export(A.model);
7845
- a == null || a(mt);
7897
+ const ft = s.export(A.model);
7898
+ a == null || a(ft);
7846
7899
  })
7847
7900
  );
7848
7901
  };
7849
- Et(() => {
7902
+ Tt(() => {
7850
7903
  n.current && (c.current || (I(n.current), c.current = !0, e == null || e(A)));
7851
- }, [n.current]), Fi(() => {
7904
+ }, [n.current]), Yi(() => {
7852
7905
  n.current && (y(!0), I(n.current), e == null || e(A));
7853
- }, [i]), Et(() => {
7906
+ }, [i]), Tt(() => {
7854
7907
  t && l.import(A.model, t);
7855
7908
  }, [t]);
7856
- const E = (ht, mt, ti) => {
7857
- var ei;
7858
- if (p !== void 0 && mt.editable && !Lt(ht.getValue(mt.name), ti)) {
7859
- ht.setValue(mt.name, ti);
7860
- const ae = new St(
7909
+ const E = (gt, ft, si) => {
7910
+ var ni;
7911
+ if (p !== void 0 && ft.editable !== !1 && !Et(gt.getValue(ft.name), si)) {
7912
+ gt.setValue(ft.name, si);
7913
+ const ce = new It(
7861
7914
  p.propertySet,
7862
7915
  p.rootElement
7863
7916
  );
7864
- ae.setValues(p.getValues()), v.valueSet = ae, p.rootElement.valueSet = ae, (ei = A.propertyEditorChanges$) == null || ei.next();
7917
+ ce.setValues(p.getValues()), v.valueSet = ce, p.rootElement.valueSet = ce, (ni = A.propertyEditorChanges$) == null || ni.next();
7865
7918
  }
7866
7919
  };
7867
- return /* @__PURE__ */ k("daga-diagram", { children: /* @__PURE__ */ k(Jo.Provider, { value: i, children: /* @__PURE__ */ k(Tt.Provider, { value: A, children: /* @__PURE__ */ V("daga-diagram-editor", { children: [
7920
+ return /* @__PURE__ */ k("daga-diagram", { children: /* @__PURE__ */ k(Qo.Provider, { value: i, children: /* @__PURE__ */ k($t.Provider, { value: A, children: /* @__PURE__ */ V("daga-diagram-editor", { children: [
7868
7921
  /* @__PURE__ */ k("div", { className: "daga-append-to", ref: n }),
7869
- /* @__PURE__ */ V(Tt.Provider, { value: A, children: [
7922
+ /* @__PURE__ */ V($t.Provider, { value: A, children: [
7870
7923
  (($ = i.components) == null ? void 0 : $.buttons) !== void 0 && ((R = (C = i.components) == null ? void 0 : C.buttons) == null ? void 0 : R.enabled) !== !1 && /* @__PURE__ */ k(
7871
- ds,
7924
+ hs,
7872
7925
  {
7873
- location: ((z = (T = i.components) == null ? void 0 : T.buttons) == null ? void 0 : z.location) || Wt.BottomRight,
7926
+ location: ((z = (T = i.components) == null ? void 0 : T.buttons) == null ? void 0 : z.location) || qt.BottomRight,
7874
7927
  direction: ((D = (j = i.components) == null ? void 0 : j.buttons) == null ? void 0 : D.direction) || b.Top,
7875
- enableAction: ((G = (q = i.components) == null ? void 0 : q.buttons) == null ? void 0 : G.enableAction) !== !1,
7928
+ enableAction: ((H = (q = i.components) == null ? void 0 : q.buttons) == null ? void 0 : H.enableAction) !== !1,
7876
7929
  enableFilter: ((W = (Y = i.components) == null ? void 0 : Y.buttons) == null ? void 0 : W.enableFilter) === !0,
7877
- enableLayout: ((ut = (at = i.components) == null ? void 0 : at.buttons) == null ? void 0 : ut.enableLayout) === !0,
7878
- enableSelection: ((xt = (_t = i.components) == null ? void 0 : _t.buttons) == null ? void 0 : xt.enableSelection) !== !1,
7879
- enableZoom: ((Ae = (Ie = i.components) == null ? void 0 : Ie.buttons) == null ? void 0 : Ae.enableZoom) !== !1
7930
+ enableLayout: ((mt = (lt = i.components) == null ? void 0 : lt.buttons) == null ? void 0 : mt.enableLayout) === !0,
7931
+ enableSelection: ((Lt = (Dt = i.components) == null ? void 0 : Dt.buttons) == null ? void 0 : Lt.enableSelection) !== !1,
7932
+ enableZoom: ((Te = (Ee = i.components) == null ? void 0 : Ee.buttons) == null ? void 0 : Te.enableZoom) !== !1
7880
7933
  }
7881
7934
  ),
7882
- ((xe = i.components) == null ? void 0 : xe.palette) !== void 0 && ((Ee = (Le = i.components) == null ? void 0 : Le.palette) == null ? void 0 : Ee.enabled) !== !1 && (($e = (Te = i.components) == null ? void 0 : Te.palette) == null ? void 0 : $e.sections) && (((Pe = (Ne = (Me = i.components) == null ? void 0 : Me.palette) == null ? void 0 : Ne.sections) == null ? void 0 : Pe.length) || 0) > 0 && /* @__PURE__ */ k(
7883
- cs,
7935
+ (($e = i.components) == null ? void 0 : $e.palette) !== void 0 && ((Ne = (Me = i.components) == null ? void 0 : Me.palette) == null ? void 0 : Ne.enabled) !== !1 && ((ze = (Pe = i.components) == null ? void 0 : Pe.palette) == null ? void 0 : ze.sections) && (((_e = (Ve = (Re = i.components) == null ? void 0 : Re.palette) == null ? void 0 : Ve.sections) == null ? void 0 : _e.length) || 0) > 0 && /* @__PURE__ */ k(
7936
+ ds,
7884
7937
  {
7885
- location: ((Re = (ze = i.components) == null ? void 0 : ze.palette) == null ? void 0 : Re.location) || Wt.TopLeft,
7886
- direction: ((_e = (Ve = i.components) == null ? void 0 : Ve.palette) == null ? void 0 : _e.direction) || b.Bottom,
7887
- width: ((De = (Oe = i.components) == null ? void 0 : Oe.palette) == null ? void 0 : De.width) || "12rem",
7888
- palettes: ((Ge = (He = i.components) == null ? void 0 : He.palette) == null ? void 0 : Ge.sections) || []
7938
+ location: ((De = (Oe = i.components) == null ? void 0 : Oe.palette) == null ? void 0 : De.location) || qt.TopLeft,
7939
+ direction: ((He = (Fe = i.components) == null ? void 0 : Fe.palette) == null ? void 0 : He.direction) || b.Bottom,
7940
+ width: ((Be = (Ge = i.components) == null ? void 0 : Ge.palette) == null ? void 0 : Be.width) || "12rem",
7941
+ palettes: ((Ye = (Ue = i.components) == null ? void 0 : Ue.palette) == null ? void 0 : Ye.sections) || []
7889
7942
  }
7890
7943
  ),
7891
- ((Be = i.components) == null ? void 0 : Be.propertyEditor) !== void 0 && ((Ue = (Fe = i.components) == null ? void 0 : Fe.propertyEditor) == null ? void 0 : Ue.enabled) !== !1 && /* @__PURE__ */ k(
7892
- as,
7944
+ ((Xe = i.components) == null ? void 0 : Xe.propertyEditor) !== void 0 && ((We = (je = i.components) == null ? void 0 : je.propertyEditor) == null ? void 0 : We.enabled) !== !1 && /* @__PURE__ */ k(
7945
+ ls,
7893
7946
  {
7894
- location: ((Xe = (Ye = i.components) == null ? void 0 : Ye.propertyEditor) == null ? void 0 : Xe.location) || Wt.TopRight,
7895
- direction: ((We = (je = i.components) == null ? void 0 : je.propertyEditor) == null ? void 0 : We.direction) || b.Bottom,
7896
- width: ((Ke = (Ze = i.components) == null ? void 0 : Ze.propertyEditor) == null ? void 0 : Ke.width) || "24rem",
7947
+ location: ((Ke = (Ze = i.components) == null ? void 0 : Ze.propertyEditor) == null ? void 0 : Ke.location) || qt.TopRight,
7948
+ direction: ((Je = (qe = i.components) == null ? void 0 : qe.propertyEditor) == null ? void 0 : Je.direction) || b.Bottom,
7949
+ width: ((ti = (Qe = i.components) == null ? void 0 : Qe.propertyEditor) == null ? void 0 : ti.width) || "24rem",
7897
7950
  title: h,
7898
7951
  valueSet: p,
7899
7952
  onValueChange: E
7900
7953
  }
7901
7954
  ),
7902
- ((qe = i.components) == null ? void 0 : qe.errors) !== void 0 && ((Qe = (Je = i.components) == null ? void 0 : Je.errors) == null ? void 0 : Qe.enabled) !== !1 && /* @__PURE__ */ k(ts, {})
7955
+ ((ei = i.components) == null ? void 0 : ei.errors) !== void 0 && ((oi = (ii = i.components) == null ? void 0 : ii.errors) == null ? void 0 : oi.enabled) !== !1 && /* @__PURE__ */ k(es, {})
7903
7956
  ] })
7904
7957
  ] }) }) }) });
7905
7958
  };
7906
7959
  export {
7907
- ms as DagaDiagram
7960
+ fs as DagaDiagram
7908
7961
  };