@g1cloud/bpmn-modeler-next 5.0.0-beta.60 → 5.0.0-beta.61

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.
@@ -414,7 +414,7 @@ class Qb {
414
414
  const b = !!v && !y(m), E = b ? r.filter((k) => k !== m && w(k) && !y(k)) : [], A = () => {
415
415
  let k = c.extensionElements;
416
416
  return k || (k = this.moddle.create("bpmn:ExtensionElements", { values: [] }), k.$parent = c, c.extensionElements = k, u.push(() => delete c.extensionElements)), k.get("values");
417
- }, N = (k, H) => {
417
+ }, I = (k, H) => {
418
418
  const F = A();
419
419
  let G = F.find((ee) => {
420
420
  var se;
@@ -433,15 +433,15 @@ class Qb {
433
433
  if (m === o && l) {
434
434
  if (f && !p.some((H) => H.body === f)) {
435
435
  const H = a && a !== o ? a : void 0;
436
- H && N(H, f);
436
+ H && I(H, f);
437
437
  }
438
438
  const k = Object.prototype.hasOwnProperty.call(l.target, l.key);
439
439
  l.target[l.key] = i, u.push(() => {
440
440
  k ? l.target[l.key] = f : delete l.target[l.key];
441
441
  });
442
442
  }
443
- N(m, i);
444
- } else (p.some((k) => Dn(k) === m) || !f && m !== d) && N(m, i);
443
+ I(m, i);
444
+ } else (p.some((k) => Dn(k) === m) || !f && m !== d) && I(m, i);
445
445
  if (!b) for (const k of Nr(c).filter((H) => H.locale === m)) P(k);
446
446
  for (const k of E) {
447
447
  const H = A(), F = this.moddle.create(wd, { locale: k, sourceLocale: m, previous: v });
@@ -1318,7 +1318,7 @@ function lw(e) {
1318
1318
  if (!this)
1319
1319
  return new lw(e);
1320
1320
  var t = e && e.proxy, n, i, o, r, a = MR, s, c, l, u, p = Hc, f = !1, d = !1, g = "", h = !1, m = !1, w = null, y = !1, v, b, E, A;
1321
- function N(F) {
1321
+ function I(F) {
1322
1322
  F instanceof Error || (F = zo(F)), w = F, a(F, p);
1323
1323
  }
1324
1324
  function P(F) {
@@ -1483,9 +1483,9 @@ function lw(e) {
1483
1483
  if (G)
1484
1484
  return F.substring(U);
1485
1485
  if (E.length)
1486
- return N("unexpected end of file");
1486
+ return I("unexpected end of file");
1487
1487
  if (!d)
1488
- return N("missing start tag");
1488
+ return I("missing start tag");
1489
1489
  U < F.length && F.substring(U).trim() && P(Hm);
1490
1490
  return;
1491
1491
  }
@@ -1499,7 +1499,7 @@ function lw(e) {
1499
1499
  if (de = F.charCodeAt(_e + 1), de === 33) {
1500
1500
  if (Q = F.charCodeAt(_e + 2), Q === 91 && F.substr(_e + 3, 6) === "CDATA[") {
1501
1501
  if (U = F.indexOf("]]>", _e), U === -1)
1502
- return G ? F.substring(_e) : N("unclosed cdata");
1502
+ return G ? F.substring(_e) : I("unclosed cdata");
1503
1503
  if (r && (r(F.substring(_e + 9, U), p), y))
1504
1504
  return;
1505
1505
  U += 3;
@@ -1507,7 +1507,7 @@ function lw(e) {
1507
1507
  }
1508
1508
  if (Q === 45 && F.charCodeAt(_e + 3) === 45) {
1509
1509
  if (U = F.indexOf("-->", _e), U === -1)
1510
- return G ? F.substring(_e) : N("unclosed comment");
1510
+ return G ? F.substring(_e) : I("unclosed comment");
1511
1511
  if (c && (c(F.substring(_e + 4, U), Tr, p), y))
1512
1512
  return;
1513
1513
  U += 3;
@@ -1516,7 +1516,7 @@ function lw(e) {
1516
1516
  }
1517
1517
  if (de === 63) {
1518
1518
  if (U = F.indexOf("?>", _e), U === -1)
1519
- return G ? F.substring(_e) : N("unclosed question");
1519
+ return G ? F.substring(_e) : I("unclosed question");
1520
1520
  if (l && (l(F.substring(_e, U + 2), p), y))
1521
1521
  return;
1522
1522
  U += 2;
@@ -1524,7 +1524,7 @@ function lw(e) {
1524
1524
  }
1525
1525
  for (le = _e + 1; ; le++) {
1526
1526
  if (Ee = F.charCodeAt(le), isNaN(Ee))
1527
- return G ? F.substring(_e) : (U = -1, N("unclosed tag"));
1527
+ return G ? F.substring(_e) : (U = -1, I("unclosed tag"));
1528
1528
  if (Ee === 34)
1529
1529
  Q = F.indexOf('"', le + 1), le = Q !== -1 ? Q : le;
1530
1530
  else if (Ee === 39)
@@ -1542,22 +1542,22 @@ function lw(e) {
1542
1542
  }
1543
1543
  if (pe = {}, de === 47) {
1544
1544
  if (fe = !1, ge = !0, !E.length)
1545
- return N("missing open tag");
1545
+ return I("missing open tag");
1546
1546
  if (le = $ = E.pop(), Q = _e + 2 + le.length, F.substring(_e + 2, Q) !== le)
1547
- return N("closing tag mismatch");
1547
+ return I("closing tag mismatch");
1548
1548
  for (; Q < U; Q++)
1549
1549
  if (de = F.charCodeAt(Q), !(de === 32 || de > 8 && de < 14))
1550
- return N("close tag");
1550
+ return I("close tag");
1551
1551
  } else {
1552
1552
  if (F.charCodeAt(U - 1) === 47 ? (le = $ = F.substring(_e + 1, U - 1), fe = !0, ge = !0) : (le = $ = F.substring(_e + 1, U), fe = !0, ge = !1), !(de > 96 && de < 123 || de > 64 && de < 91 || de === 95 || de === 58))
1553
- return N("illegal first char nodeName");
1553
+ return I("illegal first char nodeName");
1554
1554
  for (Q = 1, K = le.length; Q < K; Q++)
1555
1555
  if (de = le.charCodeAt(Q), !(de > 96 && de < 123 || de > 64 && de < 91 || de > 47 && de < 59 || de === 45 || de === 95 || de == 46)) {
1556
1556
  if (de === 32 || de < 14 && de > 8) {
1557
1557
  $ = le.substring(0, Q), pe = null;
1558
1558
  break;
1559
1559
  }
1560
- return N("invalid nodeName");
1560
+ return I("invalid nodeName");
1561
1561
  }
1562
1562
  ge || E.push($);
1563
1563
  }
@@ -1569,7 +1569,7 @@ function lw(e) {
1569
1569
  else {
1570
1570
  if (de = $.indexOf(":"), de !== -1) {
1571
1571
  if (Fe = b[$.substring(0, de)], !Fe)
1572
- return N("missing namespace on <" + C + ">");
1572
+ return I("missing namespace on <" + C + ">");
1573
1573
  $ = $.substr(de + 1);
1574
1574
  } else
1575
1575
  Fe = b.xmlns;
@@ -1819,14 +1819,14 @@ Pd.prototype.fromXML = function(e, t, n) {
1819
1819
  t instanceof qn ? (i = t, t = {}) : typeof t == "string" ? (i = this.handler(t), t = {}) : typeof i == "string" && (i = this.handler(i));
1820
1820
  var o = this.model, r = this.lax, a = new OR(Y({}, t, { rootHandler: i })), s = new lw({ proxy: !0 }), c = DR();
1821
1821
  i.context = a, c.push(i);
1822
- function l(E, A, N) {
1822
+ function l(E, A, I) {
1823
1823
  var P = A(), k = P.line, H = P.column, F = P.data;
1824
1824
  F.charAt(0) === "<" && F.indexOf(" ") !== -1 && (F = F.slice(0, F.indexOf(" ")) + ">");
1825
1825
  var G = "unparsable content " + (F ? F + " " : "") + `detected
1826
1826
  line: ` + k + `
1827
1827
  column: ` + H + `
1828
1828
  nested error: ` + E.message;
1829
- if (N)
1829
+ if (I)
1830
1830
  return a.addWarning({
1831
1831
  message: G,
1832
1832
  error: E
@@ -1837,8 +1837,8 @@ Pd.prototype.fromXML = function(e, t, n) {
1837
1837
  return l(E, A, !0);
1838
1838
  }
1839
1839
  function p() {
1840
- var E = a.elementsById, A = a.references, N, P;
1841
- for (N = 0; P = A[N]; N++) {
1840
+ var E = a.elementsById, A = a.references, I, P;
1841
+ for (I = 0; P = A[I]; I++) {
1842
1842
  var k = P.element, H = E[P.id], F = wo(k).propertiesByName[P.property];
1843
1843
  if (H || a.addWarning({
1844
1844
  message: "unresolved reference <" + P.id + ">",
@@ -1858,16 +1858,16 @@ Pd.prototype.fromXML = function(e, t, n) {
1858
1858
  var d = /^<\?xml /i, g = / encoding="([^"]+)"/i, h = /^utf-8$/i;
1859
1859
  function m(E) {
1860
1860
  if (d.test(E)) {
1861
- var A = g.exec(E), N = A && A[1];
1862
- !N || h.test(N) || a.addWarning({
1863
- message: "unsupported document encoding <" + N + ">, falling back to UTF-8"
1861
+ var A = g.exec(E), I = A && A[1];
1862
+ !I || h.test(I) || a.addWarning({
1863
+ message: "unsupported document encoding <" + I + ">, falling back to UTF-8"
1864
1864
  });
1865
1865
  }
1866
1866
  }
1867
1867
  function w(E, A) {
1868
- var N = c.peek();
1868
+ var I = c.peek();
1869
1869
  try {
1870
- c.push(N.handleNode(E));
1870
+ c.push(I.handleNode(E));
1871
1871
  } catch (P) {
1872
1872
  l(P, A, r) && c.push(new Cd());
1873
1873
  }
@@ -1875,8 +1875,8 @@ Pd.prototype.fromXML = function(e, t, n) {
1875
1875
  function y(E, A) {
1876
1876
  try {
1877
1877
  c.peek().handleText(E);
1878
- } catch (N) {
1879
- u(N, A);
1878
+ } catch (I) {
1879
+ u(I, A);
1880
1880
  }
1881
1881
  }
1882
1882
  function v(E, A) {
@@ -1884,10 +1884,10 @@ Pd.prototype.fromXML = function(e, t, n) {
1884
1884
  }
1885
1885
  var b = o.getPackages().reduce(function(E, A) {
1886
1886
  return E[A.uri] = A.prefix, E;
1887
- }, Object.entries(Of).reduce(function(E, [A, N]) {
1888
- return E[N] = A, E;
1887
+ }, Object.entries(Of).reduce(function(E, [A, I]) {
1888
+ return E[I] = A, E;
1889
1889
  }, o.config && o.config.nsMap || {}));
1890
- return s.ns(b).on("openTag", function(E, A, N, P) {
1890
+ return s.ns(b).on("openTag", function(E, A, I, P) {
1891
1891
  var k = E.attrs || {}, H = Object.keys(k).reduce(function(G, ee) {
1892
1892
  var se = A(k[ee]);
1893
1893
  return G[ee] = se, G;
@@ -1898,19 +1898,19 @@ Pd.prototype.fromXML = function(e, t, n) {
1898
1898
  ns: E.ns
1899
1899
  };
1900
1900
  w(F, P);
1901
- }).on("question", m).on("closeTag", f).on("cdata", y).on("text", function(E, A, N) {
1902
- v(A(E), N);
1901
+ }).on("question", m).on("closeTag", f).on("cdata", y).on("text", function(E, A, I) {
1902
+ v(A(E), I);
1903
1903
  }).on("error", l).on("warn", u), new Promise(function(E, A) {
1904
- var N;
1904
+ var I;
1905
1905
  try {
1906
1906
  s.parse(e), p();
1907
1907
  } catch (G) {
1908
- N = G;
1908
+ I = G;
1909
1909
  }
1910
1910
  var P = i.element;
1911
- !N && !P && (N = Qo("failed to parse document as <" + i.type.$descriptor.name + ">"));
1911
+ !I && !P && (I = Qo("failed to parse document as <" + i.type.$descriptor.name + ">"));
1912
1912
  var k = a.warnings, H = a.references, F = a.elementsById;
1913
- return N ? (N.warnings = k, A(N)) : E({
1913
+ return I ? (I.warnings = k, A(I)) : E({
1914
1914
  rootElement: P,
1915
1915
  elementsById: F,
1916
1916
  references: H,
@@ -6520,7 +6520,7 @@ function pt(e, t = {}) {
6520
6520
  if (!b) continue;
6521
6521
  const A = e.shapes.find((H) => H.id === b);
6522
6522
  if (!A || A.container) continue;
6523
- const N = Math.max(A.x - E.x, E.x - (A.x + A.width), 0), P = Math.max(A.y - E.y, E.y - (A.y + A.height), 0), k = Math.hypot(N, P);
6523
+ const I = Math.max(A.x - E.x, E.x - (A.x + A.width), 0), P = Math.max(A.y - E.y, E.y - (A.y + A.height), 0), k = Math.hypot(I, P);
6524
6524
  k > pM && n.push({ kind: "edge-endpoint-detached", edge: y.id, shape: b, distance: Math.round(k) });
6525
6525
  }
6526
6526
  }
@@ -6538,8 +6538,8 @@ function pt(e, t = {}) {
6538
6538
  );
6539
6539
  for (let y = 0; y < a.length; y++)
6540
6540
  for (let v = y + 1; v < a.length; v++) {
6541
- const b = a[y], E = a[v], A = Math.min(b.x + b.width, E.x + E.width) - Math.max(b.x, E.x), N = Math.min(b.y + b.height, E.y + E.height) - Math.max(b.y, E.y);
6542
- if (A <= zc || N <= zc) continue;
6541
+ const b = a[y], E = a[v], A = Math.min(b.x + b.width, E.x + E.width) - Math.max(b.x, E.x), I = Math.min(b.y + b.height, E.y + E.height) - Math.max(b.y, E.y);
6542
+ if (A <= zc || I <= zc) continue;
6543
6543
  const P = b.id < E.id ? [b.id, E.id] : [E.id, b.id], k = new Set(E.members);
6544
6544
  if (b.members.some((F) => k.has(F))) {
6545
6545
  const F = Ym(e, a, {
@@ -6571,13 +6571,13 @@ function pt(e, t = {}) {
6571
6571
  for (const y of a) {
6572
6572
  const v = new Set(c(y).map((k) => k.id)), b = new Set(y.members), E = new Set([...v].filter((k) => !b.has(k) && s.has(k)));
6573
6573
  if (!E.size) continue;
6574
- let A = !1, N = !1, P = !1;
6574
+ let A = !1, I = !1, P = !1;
6575
6575
  for (const k of e.edges) {
6576
6576
  if (k.type !== "bpmn:SequenceFlow" || !k.source || !k.target) continue;
6577
6577
  const H = E.has(k.source), F = E.has(k.target);
6578
- !H && F && !v.has(k.source) ? A = !0 : H && !F && !v.has(k.target) ? N = !0 : H && F && (P = !0);
6578
+ !H && F && !v.has(k.source) ? A = !0 : H && !F && !v.has(k.target) ? I = !0 : H && F && (P = !0);
6579
6579
  }
6580
- A && N && P && n.push({
6580
+ A && I && P && n.push({
6581
6581
  kind: "group-overlap-unreadable",
6582
6582
  reason: "throughpass",
6583
6583
  group: y.id,
@@ -6595,10 +6595,10 @@ function pt(e, t = {}) {
6595
6595
  bottom: Math.min(...E.map((k) => k.y + k.height))
6596
6596
  };
6597
6597
  if (A.right - A.x <= zc || A.bottom - A.y <= zc) continue;
6598
- const N = Ym(e, [], A);
6599
- if (!N.length) continue;
6598
+ const I = Ym(e, [], A);
6599
+ if (!I.length) continue;
6600
6600
  const P = E.map((k) => k.id).sort();
6601
- n.push({ kind: "group-stack-unreadable", groups: P, shapes: N });
6601
+ n.push({ kind: "group-stack-unreadable", groups: P, shapes: I });
6602
6602
  }
6603
6603
  for (const y of e.shapes.filter((v) => v.type === "bpmn:Group"))
6604
6604
  for (const v of e.shapes) {
@@ -6609,10 +6609,10 @@ function pt(e, t = {}) {
6609
6609
  ["left", y.x, "v", y.y, y.y + y.height],
6610
6610
  ["right", y.x + y.width, "v", y.y, y.y + y.height]
6611
6611
  ];
6612
- for (const [E, A, N, P, k] of b) {
6613
- const H = N === "h" ? v.x : v.y, F = N === "h" ? v.x + v.width : v.y + v.height;
6612
+ for (const [E, A, I, P, k] of b) {
6613
+ const H = I === "h" ? v.x : v.y, F = I === "h" ? v.x + v.width : v.y + v.height;
6614
6614
  if (!(H < k && P < F)) continue;
6615
- const G = N === "h" ? v.y : v.x, ee = N === "h" ? v.y + v.height : v.x + v.width;
6615
+ const G = I === "h" ? v.y : v.x, ee = I === "h" ? v.y + v.height : v.x + v.width;
6616
6616
  if (!(G < A && A < ee)) continue;
6617
6617
  const se = Math.min(A - G, ee - A);
6618
6618
  se < aM || n.push({ kind: "group-cuts-shape", group: y.id, shape: v.id, side: E, depth: se });
@@ -6628,15 +6628,15 @@ function pt(e, t = {}) {
6628
6628
  const b = xn(v);
6629
6629
  if (b.length)
6630
6630
  for (const E of u) {
6631
- const A = E.x + E.width, N = E.y + E.height, P = v.endpoints.some((H) => {
6631
+ const A = E.x + E.width, I = E.y + E.height, P = v.endpoints.some((H) => {
6632
6632
  const F = y.get(H);
6633
- return !!F && E.x < F.x && F.x < A && E.y < F.y && F.y < N;
6633
+ return !!F && E.x < F.x && F.x < A && E.y < F.y && F.y < I;
6634
6634
  });
6635
6635
  let k = null;
6636
6636
  for (const H of b) {
6637
- const [F, G, ee] = H.axis === "v" ? [E.y, N, [["left", E.x], ["right", A]]] : [E.x, A, [["top", E.y], ["bottom", N]]], se = Math.min(H.hi, G) - Math.max(H.lo, F);
6637
+ const [F, G, ee] = H.axis === "v" ? [E.y, I, [["left", E.x], ["right", A]]] : [E.x, A, [["top", E.y], ["bottom", I]]], se = Math.min(H.hi, G) - Math.max(H.lo, F);
6638
6638
  if (se < _w) continue;
6639
- const ie = H.axis === "v" ? E.x < H.at && H.at < A : E.y < H.at && H.at < N;
6639
+ const ie = H.axis === "v" ? E.x < H.at && H.at < A : E.y < H.at && H.at < I;
6640
6640
  if (!(ie && P))
6641
6641
  for (const [ve, fe] of ee) {
6642
6642
  const ge = Math.abs(H.at - fe);
@@ -6664,15 +6664,15 @@ function pt(e, t = {}) {
6664
6664
  ["left", y.x, v.x, E],
6665
6665
  ["right", y.x + y.width, v.x + v.width, E]
6666
6666
  ];
6667
- for (const [N, P, k, H] of A)
6668
- H && Math.abs(P - k) <= Gm && n.push({ kind: "group-on-container-boundary", group: y.id, container: v.id, side: N });
6667
+ for (const [I, P, k, H] of A)
6668
+ H && Math.abs(P - k) <= Gm && n.push({ kind: "group-on-container-boundary", group: y.id, container: v.id, side: I });
6669
6669
  }
6670
6670
  const f = e.shapes.filter((y) => y.type === "bpmn:Group");
6671
6671
  for (let y = 0; y < f.length; y++)
6672
6672
  for (let v = y + 1; v < f.length; v++) {
6673
- const b = f[y], E = f[v], A = b.x < E.x + E.width && E.x < b.x + b.width, N = b.y < E.y + E.height && E.y < b.y + b.height, P = [
6674
- ["x", b.x + b.width, E.x, N],
6675
- ["x", E.x + E.width, b.x, N],
6673
+ const b = f[y], E = f[v], A = b.x < E.x + E.width && E.x < b.x + b.width, I = b.y < E.y + E.height && E.y < b.y + b.height, P = [
6674
+ ["x", b.x + b.width, E.x, I],
6675
+ ["x", E.x + E.width, b.x, I],
6676
6676
  ["y", b.y + b.height, E.y, A],
6677
6677
  ["y", E.y + E.height, b.y, A]
6678
6678
  ];
@@ -6690,10 +6690,10 @@ function pt(e, t = {}) {
6690
6690
  for (let v = y + 1; v < e.edges.length; v++) {
6691
6691
  const b = e.edges[y], E = e.edges[v], A = ja(b, E);
6692
6692
  if (!A) continue;
6693
- const N = b.id < E.id ? [b.id, E.id] : [E.id, b.id];
6693
+ const I = b.id < E.id ? [b.id, E.id] : [E.id, b.id];
6694
6694
  n.push({
6695
6695
  kind: A.kind === "opposite" ? "edge-overlap-opposite" : A.kind === "mixed" ? "edge-overlap-mixed" : "edge-overlap-unrelated",
6696
- edges: N,
6696
+ edges: I,
6697
6697
  axis: A.axis,
6698
6698
  length: Math.round(A.length)
6699
6699
  });
@@ -6792,7 +6792,7 @@ function PM(e) {
6792
6792
  if (!w) continue;
6793
6793
  const y = typeof (m == null ? void 0 : m.$type) == "string" ? m.$type : "", v = Ft(h.bounds);
6794
6794
  if (v) {
6795
- const E = h.isExpanded === !1 && y !== "bpmn:Participant", A = Ft((l = Ft(h.label)) == null ? void 0 : l.bounds), N = {
6795
+ const E = h.isExpanded === !1 && y !== "bpmn:Participant", A = Ft((l = Ft(h.label)) == null ? void 0 : l.bounds), I = {
6796
6796
  id: w,
6797
6797
  type: y,
6798
6798
  x: Qt(v.x),
@@ -6805,7 +6805,7 @@ function PM(e) {
6805
6805
  ...A ? { label: { x: Qt(A.x), y: Qt(A.y), width: Qt(A.width), height: Qt(A.height) } } : {},
6806
6806
  ...y === "bpmn:Group" ? Pw(Aw(m)) : {}
6807
6807
  }, P = h.isHorizontal !== !1, k = typeof (m == null ? void 0 : m.name) == "string" ? m.name : "";
6808
- r.has(w) && P && k && (N.label = Sw(N, k)), t.push(N);
6808
+ r.has(w) && P && k && (I.label = Sw(I, k)), t.push(I);
6809
6809
  continue;
6810
6810
  }
6811
6811
  const b = h.waypoint;
@@ -6815,8 +6815,8 @@ function PM(e) {
6815
6815
  id: w,
6816
6816
  type: y,
6817
6817
  waypoints: b.map((A) => {
6818
- var N, P;
6819
- return { x: Qt((N = Ft(A)) == null ? void 0 : N.x), y: Qt((P = Ft(A)) == null ? void 0 : P.y) };
6818
+ var I, P;
6819
+ return { x: Qt((I = Ft(A)) == null ? void 0 : I.x), y: Qt((P = Ft(A)) == null ? void 0 : P.y) };
6820
6820
  }),
6821
6821
  endpoints: CM(m),
6822
6822
  ...MM(m),
@@ -7161,22 +7161,22 @@ function FM(e, t, n) {
7161
7161
  [u, l]
7162
7162
  ]) {
7163
7163
  if (n.has(p)) continue;
7164
- const d = s.edges.find((N) => N.id === p), g = s.edges.find((N) => N.id === f);
7164
+ const d = s.edges.find((I) => I.id === p), g = s.edges.find((I) => I.id === f);
7165
7165
  if (!d || !g) continue;
7166
7166
  const h = i.get(p);
7167
7167
  if (!h) continue;
7168
7168
  const m = Ql(h), w = $M(g), y = [...Nd(d, a) ?? []], v = Bd(d, [...a, ...w], m, r.edges);
7169
7169
  v && y.push(v);
7170
- for (let N = 0; N + 1 < d.waypoints.length; N++)
7170
+ for (let I = 0; I + 1 < d.waypoints.length; I++)
7171
7171
  for (const P of w)
7172
- for (const k of Lf(d.waypoints[N], d.waypoints[N + 1], P) ?? [])
7173
- y.push(If(d.waypoints, N, k));
7174
- const b = s.edges.filter((N) => N.id !== p), E = (N) => ({
7172
+ for (const k of Lf(d.waypoints[I], d.waypoints[I + 1], P) ?? [])
7173
+ y.push(If(d.waypoints, I, k));
7174
+ const b = s.edges.filter((I) => I.id !== p), E = (I) => ({
7175
7175
  ...s,
7176
- edges: s.edges.map((P) => P.id === p ? { ...P, waypoints: N } : P)
7177
- }), A = y.find((N) => {
7178
- const P = { ...d, waypoints: N };
7179
- return jp(P, g) || !Nf(N, m) || b.some((k) => k.id !== f && !jp(d, k) && jp(P, k)) ? !1 : pt(E(N)).every((k) => c.has(ft(k)));
7176
+ edges: s.edges.map((P) => P.id === p ? { ...P, waypoints: I } : P)
7177
+ }), A = y.find((I) => {
7178
+ const P = { ...d, waypoints: I };
7179
+ return jp(P, g) || !Nf(I, m) || b.some((k) => k.id !== f && !jp(d, k) && jp(P, k)) ? !1 : pt(E(I)).every((k) => c.has(ft(k)));
7180
7180
  });
7181
7181
  if (A) {
7182
7182
  o.updateWaypoints(h, A), s = E(A);
@@ -7238,14 +7238,14 @@ function WM(e, t, n) {
7238
7238
  if (!g || g.container) continue;
7239
7239
  const h = i.get(l), m = i.get(u);
7240
7240
  if (!h || !m) continue;
7241
- const w = (k) => n.has(k.id) ? [k.waypoints] : [k.waypoints, ...VM(k, g, a)], y = (k) => k.length - 2, v = w(p).flatMap((k) => w(f).map((H) => ({ pa: k, pb: H }))).filter(({ pa: k, pb: H }) => k !== p.waypoints || H !== f.waypoints).map((k) => ({ ...k, cost: ey(k.pa) + ey(k.pb) + HM * (y(k.pa) + y(k.pb)) })).sort((k, H) => k.cost - H.cost), b = Ql(h), E = Ql(m), A = to(c).length, N = new Set(er(c).map(([k, H]) => `${k}|${H}`)), P = v.find(({ pa: k, pb: H }) => {
7241
+ const w = (k) => n.has(k.id) ? [k.waypoints] : [k.waypoints, ...VM(k, g, a)], y = (k) => k.length - 2, v = w(p).flatMap((k) => w(f).map((H) => ({ pa: k, pb: H }))).filter(({ pa: k, pb: H }) => k !== p.waypoints || H !== f.waypoints).map((k) => ({ ...k, cost: ey(k.pa) + ey(k.pb) + HM * (y(k.pa) + y(k.pb)) })).sort((k, H) => k.cost - H.cost), b = Ql(h), E = Ql(m), A = to(c).length, I = new Set(er(c).map(([k, H]) => `${k}|${H}`)), P = v.find(({ pa: k, pb: H }) => {
7242
7242
  const F = { ...p, waypoints: k }, G = { ...f, waypoints: H };
7243
7243
  if (to({ edges: [F, G] }).length || ja(F, G) || !Nf(k, b) || !Nf(H, E)) return !1;
7244
7244
  const ee = {
7245
7245
  ...c,
7246
7246
  edges: c.edges.map((se) => se.id === l ? F : se.id === u ? G : se)
7247
7247
  };
7248
- return to(ee).length >= A || er(ee).some(([se, ie]) => !N.has(`${se}|${ie}`)) ? !1 : pt(ee).every((se) => s.has(ft(se)));
7248
+ return to(ee).length >= A || er(ee).some(([se, ie]) => !I.has(`${se}|${ie}`)) ? !1 : pt(ee).every((se) => s.has(ft(se)));
7249
7249
  });
7250
7250
  P && (P.pa !== p.waypoints && o.updateWaypoints(h, P.pa), P.pb !== f.waypoints && o.updateWaypoints(m, P.pb), c = {
7251
7251
  ...c,
@@ -7278,7 +7278,7 @@ function YM(e, t, n) {
7278
7278
  if (!d || d.type === "bpmn:Participant") continue;
7279
7279
  const g = d.x + d.width / 2;
7280
7280
  if (g >= f.x + 10 && g <= f.x + f.width - 10) continue;
7281
- const h = g > f.x + f.width, m = f.y > d.y, w = m ? d.y + d.height : d.y, y = m ? f.y : f.y + f.height, v = Math.round((w + y) / 2), b = (H) => f === u ? [...H].reverse() : H, E = (l.waypoints ?? []).map((H) => ({ x: H.x, y: H.y })), A = r(l.id), N = a(l.id, E) ?? /* @__PURE__ */ new Set(), P = h ? f.x + f.width : f.x, k = f.x + f.width / 2;
7281
+ const h = g > f.x + f.width, m = f.y > d.y, w = m ? d.y + d.height : d.y, y = m ? f.y : f.y + f.height, v = Math.round((w + y) / 2), b = (H) => f === u ? [...H].reverse() : H, E = (l.waypoints ?? []).map((H) => ({ x: H.x, y: H.y })), A = r(l.id), I = a(l.id, E) ?? /* @__PURE__ */ new Set(), P = h ? f.x + f.width : f.x, k = f.x + f.width / 2;
7282
7282
  for (let H = Math.min(UM, f.width / 4); h ? P - H > k : P + H < k; H += qM) {
7283
7283
  const F = Math.round(h ? P - H : P + H), G = b([
7284
7284
  { x: g, y: w },
@@ -7286,7 +7286,7 @@ function YM(e, t, n) {
7286
7286
  { x: F, y: v },
7287
7287
  { x: F, y }
7288
7288
  ]), ee = a(l.id, G);
7289
- if (!ee || [...ee].some((ie) => !N.has(ie))) continue;
7289
+ if (!ee || [...ee].some((ie) => !I.has(ie))) continue;
7290
7290
  o.updateWaypoints(l, G);
7291
7291
  const se = r(l.id);
7292
7292
  if (se.crossings <= A.crossings && se.shared <= A.shared && se.mine <= A.mine && [...se.keys].every((ie) => A.keys.has(ie)))
@@ -7314,9 +7314,9 @@ function XM(e, t) {
7314
7314
  if (!u.length) return null;
7315
7315
  const p = u[0], f = u[u.length - 1], d = (c.y + c.height + p.y) / 2, g = (f.y + f.height + l.y) / 2, h = s ? d : g, m = s ? g : d, w = e.waypoints[0], y = e.waypoints[e.waypoints.length - 1], v = Un(t), b = t.edges.filter((G) => G.id !== e.id), E = Pi(e, b), A = Ht(e, v).length;
7316
7316
  if (E === 0 && A === 0 || A === 0 && e.waypoints.length === 2) return null;
7317
- const N = Math.min(...u.map((G) => G.x)), P = Math.max(...u.map((G) => G.x + G.width)), k = (w.x + y.x) / 2, H = (G) => G.filter((ee, se) => se === 0 || !(Ye(ee.x, G[se - 1].x) && Ye(ee.y, G[se - 1].y)));
7317
+ const I = Math.min(...u.map((G) => G.x)), P = Math.max(...u.map((G) => G.x + G.width)), k = (w.x + y.x) / 2, H = (G) => G.filter((ee, se) => se === 0 || !(Ye(ee.x, G[se - 1].x) && Ye(ee.y, G[se - 1].y)));
7318
7318
  let F;
7319
- for (let G = N; G <= P; G += KM) {
7319
+ for (let G = I; G <= P; G += KM) {
7320
7320
  const ee = H([w, { x: w.x, y: h }, { x: G, y: h }, { x: G, y: m }, { x: y.x, y: m }, y]), se = { ...e, waypoints: ee };
7321
7321
  if (Ht(se, v).length > 0) continue;
7322
7322
  const ie = Pi(se, b), ve = Math.abs(G - k);
@@ -7337,7 +7337,7 @@ function JM(e, t, n) {
7337
7337
  const w = h.x - d.x, y = h.y - d.y;
7338
7338
  if (Ye(w, 0) && Ye(y, 0) || !Ye(m.x - g.x, w) || !Ye(m.y - g.y, y)) continue;
7339
7339
  const v = p.waypoints.map((A) => ({ x: A.x + w, y: A.y + y })), b = f.waypoints.map((A) => ({ x: A.x, y: A.y }));
7340
- b.length === v.length && b.every((A, N) => Ye(A.x, v[N].x) && Ye(A.y, v[N].y)) || b.length === 2 && (Ye(b[0].x, b[1].x) || Ye(b[0].y, b[1].y)) && Ht({ ...p, waypoints: b }, c).length === 0 || Ht({ ...p, waypoints: v }, c).length > 0 || o.updateWaypoints(f, v);
7340
+ b.length === v.length && b.every((A, I) => Ye(A.x, v[I].x) && Ye(A.y, v[I].y)) || b.length === 2 && (Ye(b[0].x, b[1].x) || Ye(b[0].y, b[1].y)) && Ht({ ...p, waypoints: b }, c).length === 0 || Ht({ ...p, waypoints: v }, c).length > 0 || o.updateWaypoints(f, v);
7341
7341
  }
7342
7342
  }
7343
7343
  function QM(e, t) {
@@ -7421,14 +7421,14 @@ function oA(e, t, n, i, o) {
7421
7421
  const fe = A[A.length - 1];
7422
7422
  fe && ie <= fe[1] ? fe[1] = Math.max(fe[1], ve) : A.push([ie, ve]);
7423
7423
  }
7424
- const N = [];
7424
+ const I = [];
7425
7425
  for (let ie = 1; ie < A.length; ie++)
7426
- A[ie][0] - A[ie - 1][1] >= tA && N.push(Math.round((A[ie - 1][1] + A[ie][0]) / 2));
7427
- A.length && N.push(A[0][0] - iy, A[A.length - 1][1] + iy);
7426
+ A[ie][0] - A[ie - 1][1] >= tA && I.push(Math.round((A[ie - 1][1] + A[ie][0]) / 2));
7427
+ A.length && I.push(A[0][0] - iy, A[A.length - 1][1] + iy);
7428
7428
  const P = (ie, ve) => ve < ie.y ? ie.y : ve > ie.y + ie.height ? ie.y + ie.height : void 0, k = new Set([a ? e.id : n == null ? void 0 : n.id, s ? t.id : i == null ? void 0 : i.id].filter((ie) => !!ie)), H = e.y + e.height / 2, F = t.y + t.height / 2, G = F > H ? 1 : -1, ee = (ie, ve, fe) => o.some(
7429
7429
  (ge) => !k.has(ge.id) && ge.x < ie && ie < ge.x + ge.width && ge.y < Math.max(ve, fe) - 1 && ge.y + ge.height > Math.min(ve, fe) + 1
7430
7430
  ), se = [];
7431
- for (const ie of N) {
7431
+ for (const ie of I) {
7432
7432
  const ve = P(e, ie), fe = P(t, ie);
7433
7433
  ve === void 0 || fe === void 0 || (ie - H) * G < 0 && ee(y, ve, ie) || (ie - F) * G > 0 && ee(w, fe, ie) || se.push({
7434
7434
  pts: [{ x: y, y: ve }, { x: y, y: ie }, { x: w, y: ie }, { x: w, y: fe }],
@@ -7452,11 +7452,11 @@ function rA(e, t, n) {
7452
7452
  }, l = (d, g) => d.length === g.length && d.every((h, m) => Ye(h.x, g[m].x) && Ye(h.y, g[m].y)), u = (d) => {
7453
7453
  const g = d.source, h = d.target;
7454
7454
  if (!g || !h) return "skip";
7455
- const m = We(i), w = new Map(m.shapes.map((U) => [U.id, U])), y = s(g), v = s(h), b = new Set([y, v].filter((U) => !!U)), E = m.shapes.filter((U) => U.type === "bpmn:Participant"), A = (d.waypoints ?? []).map((U) => ({ x: U.x, y: U.y })), N = Gp(A, b, E);
7456
- if (N < Hp) return "skip";
7455
+ const m = We(i), w = new Map(m.shapes.map((U) => [U.id, U])), y = s(g), v = s(h), b = new Set([y, v].filter((U) => !!U)), E = m.shapes.filter((U) => U.type === "bpmn:Participant"), A = (d.waypoints ?? []).map((U) => ({ x: U.x, y: U.y })), I = Gp(A, b, E);
7456
+ if (I < Hp) return "skip";
7457
7457
  if (t.has(d.id)) {
7458
7458
  const U = r.get(d.id);
7459
- if (U && l(U, A) || N - (U ? Gp(U, b, a) : 0) < Hp) return "skip";
7459
+ if (U && l(U, A) || I - (U ? Gp(U, b, a) : 0) < Hp) return "skip";
7460
7460
  }
7461
7461
  const P = w.get(g.id), k = w.get(h.id), H = m.edges.find((U) => U.id === d.id);
7462
7462
  if (!P || !k || !H) return "skip";
@@ -7610,32 +7610,32 @@ function uA(e, t) {
7610
7610
  if (e.type !== "bpmn:SequenceFlow") return null;
7611
7611
  const n = t.shapes.filter((A) => A.container), i = new Map(t.shapes.map((A) => [A.id, A])), o = Un(t), r = t.edges.filter((A) => A.id !== e.id), a = Ai(e, r), s = Pi(e, r), c = (A) => lA(A, t.shapes, e.endpoints) + (oy(A, n) ? 1 : 0), l = c(e.waypoints), u = (A) => {
7612
7612
  if (!A) return;
7613
- const N = A.x + A.width / 2, P = A.y + A.height / 2;
7614
- return n.find((k) => k.type === "bpmn:Lane" && N >= k.x && N <= k.x + k.width && P >= k.y && P <= k.y + k.height);
7613
+ const I = A.x + A.width / 2, P = A.y + A.height / 2;
7614
+ return n.find((k) => k.type === "bpmn:Lane" && I >= k.x && I <= k.x + k.width && P >= k.y && P <= k.y + k.height);
7615
7615
  }, p = u(i.get(e.endpoints[0] ?? "")), f = u(i.get(e.endpoints[1] ?? "")), d = !!p && !!f && p.id !== f.id, g = (A) => {
7616
7616
  if (!d || !f) return !1;
7617
- for (let N = 1; N < A.length - 2; N++) {
7618
- const P = A[N], k = A[N + 1];
7617
+ for (let I = 1; I < A.length - 2; I++) {
7618
+ const P = A[I], k = A[I + 1];
7619
7619
  if (Ye(P.y, k.y) && !Ye(P.x, k.x) && P.y > f.y && P.y < f.y + f.height) return !0;
7620
7620
  }
7621
7621
  return !1;
7622
7622
  }, h = g(e.waypoints), w = ((A) => {
7623
7623
  if (!A) return;
7624
- const N = A.x + A.width / 2, P = A.y + A.height / 2;
7625
- return n.filter((k) => k.type === "bpmn:Participant" && N >= k.x && N <= k.x + k.width && P >= k.y && P <= k.y + k.height).sort((k, H) => k.width * k.height - H.width * H.height)[0];
7624
+ const I = A.x + A.width / 2, P = A.y + A.height / 2;
7625
+ return n.filter((k) => k.type === "bpmn:Participant" && I >= k.x && I <= k.x + k.width && P >= k.y && P <= k.y + k.height).sort((k, H) => k.width * k.height - H.width * H.height)[0];
7626
7626
  })(i.get(e.endpoints[0] ?? "")), y = (A) => {
7627
7627
  if (!w) return 0;
7628
- let N = 0;
7628
+ let I = 0;
7629
7629
  for (let P = 1; P < A.length - 1; P++) {
7630
7630
  const k = A[P];
7631
- (k.x < w.x || k.x > w.x + w.width || k.y < w.y || k.y > w.y + w.height) && N++;
7631
+ (k.x < w.x || k.x > w.x + w.width || k.y < w.y || k.y > w.y + w.height) && I++;
7632
7632
  }
7633
- return N;
7633
+ return I;
7634
7634
  }, v = y(e.waypoints);
7635
7635
  if (!oy(e.waypoints, n) && !(d && !h) && v === 0) return null;
7636
- const b = (A) => A.reduce((N, P, k) => k ? N + Math.abs(P.x - A[k - 1].x) + Math.abs(P.y - A[k - 1].y) : 0, 0);
7636
+ const b = (A) => A.reduce((I, P, k) => k ? I + Math.abs(P.x - A[k - 1].x) + Math.abs(P.y - A[k - 1].y) : 0, 0);
7637
7637
  let E;
7638
- for (const { pts: A, cost: N } of Cu(e, i)) {
7638
+ for (const { pts: A, cost: I } of Cu(e, i)) {
7639
7639
  const P = { ...e, waypoints: A };
7640
7640
  if (Ht(P, o).length > 0) continue;
7641
7641
  const k = Ai(P, r);
@@ -7647,7 +7647,7 @@ function uA(e, t) {
7647
7647
  const G = c(A), ee = g(A);
7648
7648
  if (!F && !(ee && !h) && G >= l) continue;
7649
7649
  const ie = ee ? 0 : 1, ve = b(A);
7650
- (!E || H < E.out || H === E.out && (ie < E.lane || ie === E.lane && (k < E.opp || k === E.opp && (G < E.sc || G === E.sc && (N < E.cost || N === E.cost && ve < E.len))))) && (E = { pts: A, out: H, sc: G, lane: ie, opp: k, cost: N, len: ve });
7650
+ (!E || H < E.out || H === E.out && (ie < E.lane || ie === E.lane && (k < E.opp || k === E.opp && (G < E.sc || G === E.sc && (I < E.cost || I === E.cost && ve < E.len))))) && (E = { pts: A, out: H, sc: G, lane: ie, opp: k, cost: I, len: ve });
7651
7651
  }
7652
7652
  return (E == null ? void 0 : E.pts) ?? null;
7653
7653
  }
@@ -8035,12 +8035,12 @@ function PA(e, t, n = /* @__PURE__ */ new Set()) {
8035
8035
  const p = u.wps, f = i.get(l), d = f == null ? void 0 : f.label;
8036
8036
  if (!d || !(f != null && f.waypoints)) continue;
8037
8037
  const g = f.waypoints[0].x - p[0].x, h = f.waypoints[0].y - p[0].y;
8038
- if (!(f.waypoints.length === p.length && f.waypoints.every((N, P) => N.x - p[P].x === g && N.y - p[P].y === h))) {
8038
+ if (!(f.waypoints.length === p.length && f.waypoints.every((I, P) => I.x - p[P].x === g && I.y - p[P].y === h))) {
8039
8039
  if (((s = f.source) == null ? void 0 : s.id) === u.source && ((c = f.target) == null ? void 0 : c.id) === u.target) continue;
8040
- const N = r.edges.find((G) => G.id === l);
8041
- if (!(N != null && N.label) || !Zl(N.label, r).length && !n.has(l)) continue;
8042
- let P = { ...N.label, x: u.label.x, y: u.label.y };
8043
- if ((Zl(P, r).length || py(P, N.waypoints) > uy) && (P = null), !P && py(N.label, N.waypoints) > uy && (P = AA(N, r)), !P) continue;
8040
+ const I = r.edges.find((G) => G.id === l);
8041
+ if (!(I != null && I.label) || !Zl(I.label, r).length && !n.has(l)) continue;
8042
+ let P = { ...I.label, x: u.label.x, y: u.label.y };
8043
+ if ((Zl(P, r).length || py(P, I.waypoints) > uy) && (P = null), !P && py(I.label, I.waypoints) > uy && (P = AA(I, r)), !P) continue;
8044
8044
  const k = P;
8045
8045
  if (k.x === d.x && k.y === d.y) continue;
8046
8046
  const H = { ...r, edges: r.edges.map((G) => G.id === l ? { ...G, label: k } : G) }, F = pt(H);
@@ -8050,10 +8050,10 @@ function PA(e, t, n = /* @__PURE__ */ new Set()) {
8050
8050
  }
8051
8051
  const w = u.label.x + g - d.x, y = u.label.y + h - d.y;
8052
8052
  if (w === 0 && y === 0) continue;
8053
- const v = r.edges.find((N) => N.id === l);
8053
+ const v = r.edges.find((I) => I.id === l);
8054
8054
  if (!(v != null && v.label)) continue;
8055
- const b = { ...v.label, x: v.label.x + w, y: v.label.y + y }, E = { ...r, edges: r.edges.map((N) => N.id === l ? { ...N, label: b } : N) }, A = pt(E);
8056
- A.some((N) => !a.has(ft(N))) || (o.moveElements([d], { x: w, y }), r = E, a = new Set(A.map(ft)));
8055
+ const b = { ...v.label, x: v.label.x + w, y: v.label.y + y }, E = { ...r, edges: r.edges.map((I) => I.id === l ? { ...I, label: b } : I) }, A = pt(E);
8056
+ A.some((I) => !a.has(ft(I))) || (o.moveElements([d], { x: w, y }), r = E, a = new Set(A.map(ft)));
8057
8057
  }
8058
8058
  }
8059
8059
  function TA(e, t, n = /* @__PURE__ */ new Set()) {
@@ -8556,13 +8556,13 @@ function jA(e, t, n = {}) {
8556
8556
  break;
8557
8557
  }
8558
8558
  case "sequenceFlow.add": {
8559
- const { id: v, source: b, target: E, name: A, condition: N } = h.flow, P = u(m, b, "source", ["flowNode"]), k = u(m, E, "target", ["flowNode"]);
8560
- P && k && l(b) !== l(E) && o.push({ kind: "flow-cross-pool", opIndex: m, id: v }), A !== void 0 && N !== void 0 && o.push({ kind: "condition-name-conflict", opIndex: m, id: v });
8559
+ const { id: v, source: b, target: E, name: A, condition: I } = h.flow, P = u(m, b, "source", ["flowNode"]), k = u(m, E, "target", ["flowNode"]);
8560
+ P && k && l(b) !== l(E) && o.push({ kind: "flow-cross-pool", opIndex: m, id: v }), A !== void 0 && I !== void 0 && o.push({ kind: "condition-name-conflict", opIndex: m, id: v });
8561
8561
  break;
8562
8562
  }
8563
8563
  case "messageFlow.add": {
8564
- const { id: v, source: b, target: E } = h.flow, A = u(m, b, "source", ["flowNode", "participant"]), N = u(m, E, "target", ["flowNode", "participant"]);
8565
- if (A && N) {
8564
+ const { id: v, source: b, target: E } = h.flow, A = u(m, b, "source", ["flowNode", "participant"]), I = u(m, E, "target", ["flowNode", "participant"]);
8565
+ if (A && I) {
8566
8566
  const P = l(b), k = l(E);
8567
8567
  P !== void 0 && P === k && o.push({ kind: "message-flow-same-pool", opIndex: m, id: v });
8568
8568
  }
@@ -8589,14 +8589,14 @@ function jA(e, t, n = {}) {
8589
8589
  case "dataAssociation.add": {
8590
8590
  const { source: v, target: b } = h.association, E = u(m, v, "source"), A = u(m, b, "target");
8591
8591
  if (E && A) {
8592
- const N = /* @__PURE__ */ new Set([E, A]);
8593
- N.has("dataStore") && N.has("flowNode") || o.push({ kind: "data-association-ends", opIndex: m, source: v, target: b });
8592
+ const I = /* @__PURE__ */ new Set([E, A]);
8593
+ I.has("dataStore") && I.has("flowNode") || o.push({ kind: "data-association-ends", opIndex: m, source: v, target: b });
8594
8594
  }
8595
8595
  break;
8596
8596
  }
8597
8597
  case "association.add": {
8598
- const { id: v, source: b, target: E } = h.association, A = u(m, b, "source"), N = u(m, E, "target");
8599
- A && N && A !== "annotation" && N !== "annotation" && o.push({
8598
+ const { id: v, source: b, target: E } = h.association, A = u(m, b, "source"), I = u(m, E, "target");
8599
+ A && I && A !== "annotation" && I !== "annotation" && o.push({
8600
8600
  kind: "association-detached",
8601
8601
  opIndex: m,
8602
8602
  annotation: v ?? `${b}->${E}`
@@ -8639,8 +8639,8 @@ function jA(e, t, n = {}) {
8639
8639
  b.includes(P) || o.push({ kind: "lane-shrink-unsupported", opIndex: m, participant: h.id, lane: P });
8640
8640
  for (const P of b)
8641
8641
  t.categoryOf(P) !== void 0 && !v.includes(P) && o.push({ kind: "id-duplicate", opIndex: m, id: P });
8642
- const E = b.filter((P) => v.includes(P)), A = (P) => E.every((k, H) => k === P[H]), N = (((y = t.laneDeclarationOrderOf) == null ? void 0 : y.call(t, h.id)) ?? v).filter((P) => v.includes(P));
8643
- E.length === v.length && !A(v) && !A(N) && o.push({ kind: "lane-reorder-unsupported", opIndex: m, participant: h.id });
8642
+ const E = b.filter((P) => v.includes(P)), A = (P) => E.every((k, H) => k === P[H]), I = (((y = t.laneDeclarationOrderOf) == null ? void 0 : y.call(t, h.id)) ?? v).filter((P) => v.includes(P));
8643
+ E.length === v.length && !A(v) && !A(I) && o.push({ kind: "lane-reorder-unsupported", opIndex: m, participant: h.id });
8644
8644
  }
8645
8645
  break;
8646
8646
  }
@@ -8655,8 +8655,8 @@ function jA(e, t, n = {}) {
8655
8655
  case "sequenceFlow.update": {
8656
8656
  if (g(m, h.id, "sequenceFlow") === void 0) break;
8657
8657
  if (h.name !== void 0 && h.condition !== void 0 && o.push({ kind: "condition-name-conflict", opIndex: m, id: h.id }), h.source !== void 0 || h.target !== void 0) {
8658
- const v = h.source === void 0 || u(m, h.source, "source", ["flowNode"]) !== void 0, b = h.target === void 0 || u(m, h.target, "target", ["flowNode"]) !== void 0, E = t.endpointsOf(h.id), A = h.source ?? (E == null ? void 0 : E.source), N = h.target ?? (E == null ? void 0 : E.target);
8659
- v && b && A !== void 0 && N !== void 0 && (/* @__PURE__ */ new Set([l(A), l(N), l(h.id)])).size > 1 && o.push({ kind: "flow-cross-pool", opIndex: m, id: h.id });
8658
+ const v = h.source === void 0 || u(m, h.source, "source", ["flowNode"]) !== void 0, b = h.target === void 0 || u(m, h.target, "target", ["flowNode"]) !== void 0, E = t.endpointsOf(h.id), A = h.source ?? (E == null ? void 0 : E.source), I = h.target ?? (E == null ? void 0 : E.target);
8659
+ v && b && A !== void 0 && I !== void 0 && (/* @__PURE__ */ new Set([l(A), l(I), l(h.id)])).size > 1 && o.push({ kind: "flow-cross-pool", opIndex: m, id: h.id });
8660
8660
  }
8661
8661
  break;
8662
8662
  }
@@ -8825,8 +8825,8 @@ function nu(e, t, n, i, o) {
8825
8825
  }
8826
8826
  return ge;
8827
8827
  }
8828
- const N = o.from, P = s.x + Pn + r.width / 2, k = s.x + s.width - Pn - r.width / 2, H = s.y + Pn + r.height / 2, F = s.y + s.height - Pn - r.height / 2;
8829
- let G = { x: Math.min(k, Math.max(P, N.x)), y: Math.min(F, Math.max(H, N.y)) };
8828
+ const I = o.from, P = s.x + Pn + r.width / 2, k = s.x + s.width - Pn - r.width / 2, H = s.y + Pn + r.height / 2, F = s.y + s.height - Pn - r.height / 2;
8829
+ let G = { x: Math.min(k, Math.max(P, I.x)), y: Math.min(F, Math.max(H, I.y)) };
8830
8830
  if (b(G)) {
8831
8831
  const ee = (t.width + r.width) / 2 + Pn, ie = [
8832
8832
  { x: G.x + ee, y: G.y },
@@ -8881,12 +8881,12 @@ function qA(e, t) {
8881
8881
  (_) => !("waypoints" in _ && _.waypoints) && _.type !== "bpmn:Lane" && _.type !== "label" && typeof _.x == "number"
8882
8882
  ))
8883
8883
  h.set(x.id, { x: x.x, y: x.y });
8884
- const m = Bt(e, "participant.add"), w = Bt(e, "node.add"), y = Bt(e, "sequenceFlow.add"), v = Bt(e, "messageFlow.add"), b = Bt(e, "dataStore.add"), E = Bt(e, "dataAssociation.add"), A = Bt(e, "annotation.add"), N = Bt(e, "group.add"), P = new Map(w.map((x) => [x.node.id, x])), k = Iw(e, (x) => {
8884
+ const m = Bt(e, "participant.add"), w = Bt(e, "node.add"), y = Bt(e, "sequenceFlow.add"), v = Bt(e, "messageFlow.add"), b = Bt(e, "dataStore.add"), E = Bt(e, "dataAssociation.add"), A = Bt(e, "annotation.add"), I = Bt(e, "group.add"), P = new Map(w.map((x) => [x.node.id, x])), k = Iw(e, (x) => {
8885
8885
  var _, S;
8886
8886
  return (S = (_ = f(x)) == null ? void 0 : _.source) == null ? void 0 : S.id;
8887
8887
  }), H = new Set([...k.values()].map((x) => x.flow.id)), F = y.filter((x) => !H.has(x.flow.id)), G = new Set([...k.values()].map((x) => x.flow.target)), ee = (x) => Bt(e, "sequenceFlow.update").filter((_) => _.target === x).length + (G.has(x) ? 1 : 0), se = (x, _, S) => {
8888
8888
  var L;
8889
- const O = x.businessObject, I = (((L = O.extensionElements) == null ? void 0 : L.values) ?? []).filter((D) => D.$type !== _), T = S ? [...I, i.create(_, S)] : I;
8889
+ const O = x.businessObject, N = (((L = O.extensionElements) == null ? void 0 : L.values) ?? []).filter((D) => D.$type !== _), T = S ? [...N, i.create(_, S)] : N;
8890
8890
  if (!T.length) {
8891
8891
  O.extensionElements && n.updateProperties(x, { extensionElements: void 0 });
8892
8892
  return;
@@ -8923,20 +8923,20 @@ function qA(e, t) {
8923
8923
  }), fe.push({ pool: x.id, lanes: new Set(x.lanes.map((T) => T.id)) });
8924
8924
  continue;
8925
8925
  }
8926
- const O = new Set(S.map((T) => T.id)), I = x.lanes.reduce((T, B, L) => O.has(B.id) ? L : T, -1);
8926
+ const O = new Set(S.map((T) => T.id)), N = x.lanes.reduce((T, B, L) => O.has(B.id) ? L : T, -1);
8927
8927
  x.lanes.forEach((T, B) => {
8928
8928
  if (O.has(T.id)) {
8929
8929
  n.updateProperties(d(T.id), { name: T.name });
8930
8930
  return;
8931
8931
  }
8932
- const L = B === I + 1 && I >= 0, D = B === 0 ? n.addLane(ve(x.id)[0], "top") : L ? n.addLane(ve(x.id).at(-1), "bottom") : n.addLane(d(x.lanes[B - 1].id), "bottom");
8932
+ const L = B === N + 1 && N >= 0, D = B === 0 ? n.addLane(ve(x.id)[0], "top") : L ? n.addLane(ve(x.id).at(-1), "bottom") : n.addLane(d(x.lanes[B - 1].id), "bottom");
8933
8933
  n.updateProperties(D, { id: T.id, name: T.name });
8934
8934
  });
8935
8935
  }
8936
- const ge = 150, _e = 130, U = 80, le = 90, K = 180, Q = 30, de = 30, Ee = 10, Fe = 300, $ = 5, C = (x, _, S, O, I) => {
8936
+ const ge = 150, _e = 130, U = 80, le = 90, K = 180, Q = 30, de = 30, Ee = 10, Fe = 300, $ = 5, C = (x, _, S, O, N) => {
8937
8937
  const T = S - _.width / 2, B = O - _.height / 2;
8938
8938
  return (x.children ?? []).find(
8939
- (L) => !("waypoints" in L && L.waypoints) && L.type !== "bpmn:Lane" && L.type !== "label" && !(I != null && I.has(L.id)) && typeof L.x == "number" && T < L.x + L.width + de && T + _.width + de > L.x && B < L.y + L.height && B + _.height > L.y
8939
+ (L) => !("waypoints" in L && L.waypoints) && L.type !== "bpmn:Lane" && L.type !== "label" && !(N != null && N.has(L.id)) && typeof L.x == "number" && T < L.x + L.width + de && T + _.width + de > L.x && B < L.y + L.height && B + _.height > L.y
8940
8940
  );
8941
8941
  }, R = /* @__PURE__ */ new Set();
8942
8942
  for (const x of m) {
@@ -8952,15 +8952,15 @@ function qA(e, t) {
8952
8952
  const q = /* @__PURE__ */ new Map();
8953
8953
  for (const [x, _] of W) {
8954
8954
  if (!R.has(x)) continue;
8955
- const S = [..._].sort((T, B) => T - B), O = S.map((T, B) => B === 0 ? 0 : B % 2 === 1 ? Math.ceil(B / 2) : -(B / 2)), I = Math.min(...O);
8956
- q.set(x, new Map(S.map((T, B) => [T, O[B] - I])));
8955
+ const S = [..._].sort((T, B) => T - B), O = S.map((T, B) => B === 0 ? 0 : B % 2 === 1 ? Math.ceil(B / 2) : -(B / 2)), N = Math.min(...O);
8956
+ q.set(x, new Map(S.map((T, B) => [T, O[B] - N])));
8957
8957
  }
8958
8958
  {
8959
8959
  const x = /* @__PURE__ */ new Map();
8960
8960
  for (const _ of m) (_.participant.lanes ?? []).forEach((S, O) => x.set(S.id, O));
8961
8961
  for (const [_, S] of q) {
8962
8962
  if (!x.has(_) || S.size < 2) continue;
8963
- const O = x.get(_), I = S.get(0) ?? 0, T = /* @__PURE__ */ new Set();
8963
+ const O = x.get(_), N = S.get(0) ?? 0, T = /* @__PURE__ */ new Set();
8964
8964
  for (const ne of w) {
8965
8965
  if (ne.node.lane !== _ || (ne.band ?? 0) !== 0 || !ne.node.type.endsWith("Gateway")) continue;
8966
8966
  const ce = { in: /* @__PURE__ */ new Set(), out: /* @__PURE__ */ new Set(), cross: /* @__PURE__ */ new Set() };
@@ -8975,8 +8975,8 @@ function qA(e, t) {
8975
8975
  if (Z === void 0) continue;
8976
8976
  he = Z > O ? "down" : "up", te = !0;
8977
8977
  } else {
8978
- const Z = S.get(me.band ?? 0) ?? I;
8979
- he = Z > I ? "down" : Z < I ? "up" : void 0;
8978
+ const Z = S.get(me.band ?? 0) ?? N;
8979
+ he = Z > N ? "down" : Z < N ? "up" : void 0;
8980
8980
  }
8981
8981
  he && (ce[oe ? "out" : "in"].add(he), te && ce.cross.add(he));
8982
8982
  }
@@ -8984,7 +8984,7 @@ function qA(e, t) {
8984
8984
  }
8985
8985
  if (T.size !== 1) continue;
8986
8986
  const [B] = T, L = Math.max(...S.values()), D = B === "down" ? L : 0;
8987
- if (I === D) continue;
8987
+ if (N === D) continue;
8988
8988
  const z = [...S.entries()].filter(([ne]) => ne !== 0).sort((ne, ce) => ne[1] - ce[1]), j = [...Array(L + 1).keys()].filter((ne) => ne !== D), X = /* @__PURE__ */ new Map([[0, D]]);
8989
8989
  z.forEach(([ne], ce) => X.set(ne, j[ce])), q.set(_, X);
8990
8990
  }
@@ -9002,37 +9002,37 @@ function qA(e, t) {
9002
9002
  const x = /* @__PURE__ */ new Map();
9003
9003
  for (const O of F) x.set(O.flow.target, (x.get(O.flow.target) ?? 0) + 1);
9004
9004
  const _ = (O) => {
9005
- const I = [], T = /* @__PURE__ */ new Set([O]), B = [O];
9005
+ const N = [], T = /* @__PURE__ */ new Set([O]), B = [O];
9006
9006
  for (; B.length; ) {
9007
9007
  const L = B.shift();
9008
- I.push(L);
9008
+ N.push(L);
9009
9009
  for (const D of F)
9010
9010
  D.flow.source !== L || T.has(D.flow.target) || (x.get(D.flow.target) ?? 0) !== 1 || (T.add(D.flow.target), B.push(D.flow.target));
9011
9011
  }
9012
- return I;
9013
- }, S = (O, I) => {
9012
+ return N;
9013
+ }, S = (O, N) => {
9014
9014
  var T;
9015
- return ((T = q.get(O)) == null ? void 0 : T.get(I)) ?? I;
9015
+ return ((T = q.get(O)) == null ? void 0 : T.get(N)) ?? N;
9016
9016
  };
9017
9017
  for (const O of w) {
9018
9018
  if (!O.node.type.endsWith("Gateway")) continue;
9019
- const I = O.node.lane ?? `pool:${O.node.participant ?? ""}`, T = q.get(I);
9019
+ const N = O.node.lane ?? `pool:${O.node.participant ?? ""}`, T = q.get(N);
9020
9020
  if (!T || T.size < 2) continue;
9021
9021
  const B = at(O);
9022
- if (B === void 0 || S(I, B) !== S(I, 0)) continue;
9023
- const L = S(I, B), D = F.filter((ae) => ae.flow.source === O.node.id).map((ae) => P.get(ae.flow.target)).filter((ae) => !!ae && (ae.node.lane ?? `pool:${ae.node.participant ?? ""}`) === I), z = D.filter((ae) => {
9022
+ if (B === void 0 || S(N, B) !== S(N, 0)) continue;
9023
+ const L = S(N, B), D = F.filter((ae) => ae.flow.source === O.node.id).map((ae) => P.get(ae.flow.target)).filter((ae) => !!ae && (ae.node.lane ?? `pool:${ae.node.participant ?? ""}`) === N), z = D.filter((ae) => {
9024
9024
  const oe = at(ae);
9025
- return oe !== void 0 && S(I, oe) === L && (x.get(ae.node.id) ?? 0) === 1;
9025
+ return oe !== void 0 && S(N, oe) === L && (x.get(ae.node.id) ?? 0) === 1;
9026
9026
  }), j = D.some((ae) => {
9027
9027
  const oe = at(ae);
9028
- return oe !== void 0 && S(I, oe) > L;
9028
+ return oe !== void 0 && S(N, oe) > L;
9029
9029
  });
9030
9030
  if (z.length !== 1 || !j) continue;
9031
9031
  const X = new Set(D.flatMap((ae) => _(ae.node.id)));
9032
9032
  if (!F.some((ae) => ae.flow.target === O.node.id && X.has(ae.flow.source))) continue;
9033
9033
  const ce = /* @__PURE__ */ new Map();
9034
9034
  for (const [ae, oe] of T) ce.set(ae, oe + 1);
9035
- ce.set(-1, 0), q.set(I, ce);
9035
+ ce.set(-1, 0), q.set(N, ce);
9036
9036
  for (const ae of _(z[0].node.id)) P.has(ae) && (Qe.set(ae, -1), _t.add(ae));
9037
9037
  jt.add(O.node.id);
9038
9038
  }
@@ -9040,7 +9040,7 @@ function qA(e, t) {
9040
9040
  {
9041
9041
  const x = (j) => j.node.lane ?? `pool:${j.node.participant ?? ""}`, _ = (j) => at(j) ?? 0, S = new Map(
9042
9042
  m.map((j, X) => ({ id: j.participant.id, order: j.order ?? Number.POSITIVE_INFINITY, declared: X })).sort((j, X) => j.order !== X.order ? j.order - X.order : j.declared - X.declared).map((j, X) => [j.id, X])
9043
- ), O = (j) => j === void 0 ? void 0 : S.get(j) ?? -1, I = (j) => {
9043
+ ), O = (j) => j === void 0 ? void 0 : S.get(j) ?? -1, N = (j) => {
9044
9044
  var ce;
9045
9045
  const X = P.get(j);
9046
9046
  if (X) return X.node.participant;
@@ -9066,7 +9066,7 @@ function qA(e, t) {
9066
9066
  for (const ae of v) {
9067
9067
  const oe = X.has(ae.flow.source) ? ae.flow.target : X.has(ae.flow.target) ? ae.flow.source : void 0;
9068
9068
  if (oe === void 0) continue;
9069
- const me = O(I(oe));
9069
+ const me = O(N(oe));
9070
9070
  me === void 0 || me === ne || ce.add(me < ne ? "up" : "down");
9071
9071
  }
9072
9072
  return ce.size === 1 ? [...ce][0] : void 0;
@@ -9219,9 +9219,9 @@ function qA(e, t) {
9219
9219
  var S;
9220
9220
  return ((S = q.get(x)) == null ? void 0 : S.get(_)) ?? _;
9221
9221
  }, fn = (x, _, S, O) => {
9222
- const I = x ? f(x) : _ ? f(_) : void 0;
9223
- if (!I) return !1;
9224
- const T = x ? I.y + Math.min(I.height / 2, le) : I.y + U;
9222
+ const N = x ? f(x) : _ ? f(_) : void 0;
9223
+ if (!N) return !1;
9224
+ const T = x ? N.y + Math.min(N.height / 2, le) : N.y + U;
9225
9225
  return Math.abs(T + Nt(x ?? `pool:${_ ?? ""}`, S) * ge - O) <= ge / 2;
9226
9226
  }, Io = /* @__PURE__ */ new Map();
9227
9227
  for (const [x, _] of W) {
@@ -9229,41 +9229,41 @@ function qA(e, t) {
9229
9229
  for (const O of _) S = Math.max(S, Nt(x, O));
9230
9230
  Io.set(x, S);
9231
9231
  }
9232
- const Kn = (x) => K + ge * x, Xn = (x, _, S) => {
9233
- const O = p().children.filter(
9234
- (I) => !("waypoints" in I && I.waypoints) && I.type !== "label" && I.id !== _ && typeof I.y == "number" && I.y >= x
9232
+ const Kn = (x) => K + ge * x, Xn = (x, _, S, O) => {
9233
+ const N = p().children.filter(
9234
+ (T) => !("waypoints" in T && T.waypoints) && T.type !== "label" && T.id !== _ && !(O != null && O.has(T.id)) && typeof T.y == "number" && T.y >= x
9235
9235
  );
9236
- O.length && n.moveElements(O, { x: 0, y: S });
9236
+ N.length && n.moveElements(N, { x: 0, y: S });
9237
9237
  }, di = (x, _, S) => {
9238
9238
  const O = x.type === "bpmn:Participant" ? x : void 0;
9239
9239
  if (!O || O.children.some((L) => L.type === "bpmn:Lane")) return;
9240
- const I = S + _.height / 2 + Q - O.y;
9241
- if (O.height >= I) return;
9242
- const T = I - O.height, B = O.y + O.height;
9243
- n.resizeShape(O, { x: O.x, y: O.y, width: O.width, height: I }), Xn(B, O.id, T);
9240
+ const N = S + _.height / 2 + Q - O.y;
9241
+ if (O.height >= N) return;
9242
+ const T = N - O.height, B = O.y + O.height;
9243
+ n.resizeShape(O, { x: O.x, y: O.y, width: O.width, height: N }), Xn(B, O.id, T);
9244
9244
  }, on = (x, _) => {
9245
9245
  const S = _ - x.height;
9246
- if (S <= 0) return;
9247
- const O = g(x) ?? x, I = [], T = (D) => {
9248
- I.push(D);
9246
+ if (S <= 0) return /* @__PURE__ */ new Set();
9247
+ const O = g(x) ?? x, N = [], T = (D) => {
9248
+ N.push(D);
9249
9249
  for (const z of D.children ?? []) T(z);
9250
9250
  };
9251
9251
  T(O);
9252
- const B = x.y + x.height - 10, L = l.calculateAdjustments(I, "y", S, B);
9253
- l.makeSpace(L.movingShapes, L.resizingShapes, { x: 0, y: S }, "s", B);
9252
+ const B = x.y + x.height - 10, L = l.calculateAdjustments(N, "y", S, B);
9253
+ return l.makeSpace(L.movingShapes, L.resizingShapes, { x: 0, y: S }, "s", B), new Set(L.movingShapes.map((D) => D.id));
9254
9254
  }, go = (x, _, S) => {
9255
9255
  if (x) {
9256
9256
  const B = d(x), L = Kn(_);
9257
9257
  if (B.height >= L) return;
9258
- const D = L - B.height, z = g(B), j = z ? z.y + z.height : B.y + B.height;
9259
- on(B, L), Xn(j, z == null ? void 0 : z.id, D);
9258
+ const D = L - B.height, z = g(B), j = z ? z.y + z.height : B.y + B.height, X = on(B, L);
9259
+ Xn(j, z == null ? void 0 : z.id, D, X);
9260
9260
  return;
9261
9261
  }
9262
9262
  if (!S) return;
9263
9263
  const O = ge * (_ + 1);
9264
9264
  if (S.height >= O) return;
9265
- const I = O - S.height, T = S.y + S.height;
9266
- n.resizeShape(S, { x: S.x, y: S.y, width: S.width, height: O }), Xn(T, S.id, I);
9265
+ const N = O - S.height, T = S.y + S.height;
9266
+ n.resizeShape(S, { x: S.x, y: S.y, width: S.width, height: O }), Xn(T, S.id, N);
9267
9267
  }, ta = /* @__PURE__ */ new Map();
9268
9268
  for (const x of F) ta.set(x.flow.target, (ta.get(x.flow.target) ?? 0) + 1);
9269
9269
  const ei = (x) => (ta.get(x) ?? 0) <= 1, vt = new Set(
@@ -9274,10 +9274,10 @@ function qA(e, t) {
9274
9274
  if (!x) return;
9275
9275
  const S = f(x);
9276
9276
  if (!S || S.height >= Kn(_)) return;
9277
- const O = S.y + S.height - 10, I = g(S);
9278
- if (I)
9277
+ const O = S.y + S.height - 10, N = g(S);
9278
+ if (N)
9279
9279
  return new Set(
9280
- (I.children ?? []).filter((T) => T.type !== "bpmn:Lane" && typeof T.y == "number" && T.y > O).map((T) => T.id)
9280
+ (N.children ?? []).filter((T) => T.type !== "bpmn:Lane" && typeof T.y == "number" && T.y > O).map((T) => T.id)
9281
9281
  );
9282
9282
  }, Pc = (x, _, S) => {
9283
9283
  if (!x) return !0;
@@ -9287,7 +9287,7 @@ function qA(e, t) {
9287
9287
  for (const { pool: x, lanes: _ } of fe) {
9288
9288
  const S = f(x), O = ve(x);
9289
9289
  if (!S || O.length < 2) continue;
9290
- const I = Kn(0), T = U1, B = new Set(
9290
+ const N = Kn(0), T = U1, B = new Set(
9291
9291
  Bt(e, "node.update").filter((J) => J.lane !== void 0 && _.has(J.lane)).map((J) => J.id)
9292
9292
  ), L = S.children ?? [], D = L.filter(
9293
9293
  (J) => !("waypoints" in J && J.waypoints) && J.type !== "bpmn:Lane" && J.type !== "label" && typeof J.y == "number"
@@ -9317,7 +9317,7 @@ function qA(e, t) {
9317
9317
  Ne.push(Math.max(ce + T, ye));
9318
9318
  let ke;
9319
9319
  for (const qe of Ne) {
9320
- const Ce = !oe(te, qe) && qe - te < I ? D.filter((Ae) => Ae.y >= qe).length : 0, Me = Math.abs(qe - J), Se = ke ? Math.abs(ke.y - J) : 0;
9320
+ const Ce = !oe(te, qe) && qe - te < N ? D.filter((Ae) => Ae.y >= qe).length : 0, Me = Math.abs(qe - J), Se = ke ? Math.abs(ke.y - J) : 0;
9321
9321
  (!ke || Ce < ke.cost || Ce === ke.cost && (Me < Se || Me === Se && qe > ke.y)) && (ke = { y: qe, cost: Ce });
9322
9322
  }
9323
9323
  he.push(ke.y), te = ke.y;
@@ -9330,9 +9330,9 @@ function qA(e, t) {
9330
9330
  (J.y !== Ne || J.height !== ke) && n.resizeShape(J, { x: J.x, y: Ne, width: J.width, height: ke });
9331
9331
  });
9332
9332
  for (const J of O) {
9333
- if (J.height >= I || oe(J.y, J.y + J.height)) continue;
9334
- const ye = I - J.height, Ne = S.y + S.height;
9335
- on(J, I), Xn(Ne, S.id, ye);
9333
+ if (J.height >= N || oe(J.y, J.y + J.height)) continue;
9334
+ const ye = N - J.height, Ne = S.y + S.height, ke = on(J, N);
9335
+ Xn(Ne, S.id, ye, ke);
9336
9336
  }
9337
9337
  }
9338
9338
  const Tc = m.map((x, _) => ({ op: x, declared: _ }));
@@ -9347,13 +9347,13 @@ function qA(e, t) {
9347
9347
  (x) => x.type === "bpmn:Participant" && x.parent === p()
9348
9348
  ), Y1 = (() => {
9349
9349
  if (!Ep.length) return;
9350
- const x = Ep.filter((I) => !$w(I)), _ = x.length ? x : Ep, S = Math.min(..._.map((I) => I.x)), O = Math.max(..._.map((I) => I.x + I.width));
9350
+ const x = Ep.filter((N) => !$w(N)), _ = x.length ? x : Ep, S = Math.min(..._.map((N) => N.x)), O = Math.max(..._.map((N) => N.x + N.width));
9351
9351
  return O > S ? { x: S, width: O - S } : void 0;
9352
9352
  })();
9353
9353
  for (const { op: x } of Tc) {
9354
- const _ = x.participant, S = w.filter((oe) => oe.node.participant === _.id).length, O = ((dm = _.lanes) == null ? void 0 : dm.length) ?? 0, I = Math.max(1200, S * 160 + 300), T = (_.lanes ?? []).map((oe) => Kn(Io.get(oe.id) ?? 0)), B = T.reduce((oe, me) => oe + me, 0);
9354
+ const _ = x.participant, S = w.filter((oe) => oe.node.participant === _.id).length, O = ((dm = _.lanes) == null ? void 0 : dm.length) ?? 0, N = Math.max(1200, S * 160 + 300), T = (_.lanes ?? []).map((oe) => Kn(Io.get(oe.id) ?? 0)), B = T.reduce((oe, me) => oe + me, 0);
9355
9355
  O && B < 300 && (T[O - 1] += 300 - B);
9356
- const L = Math.max(300, ge * ((Io.get(`pool:${_.id}`) ?? 0) + 1)), D = _.blackBox || S + O === 0 ? 120 : O ? Math.max(300, B) : L, z = _.blackBox ? Y1 : void 0, j = (z == null ? void 0 : z.x) ?? 100, X = (z == null ? void 0 : z.width) ?? I, ne = o.createShape({
9356
+ const L = Math.max(300, ge * ((Io.get(`pool:${_.id}`) ?? 0) + 1)), D = _.blackBox || S + O === 0 ? 120 : O ? Math.max(300, B) : L, z = _.blackBox ? Y1 : void 0, j = (z == null ? void 0 : z.x) ?? 100, X = (z == null ? void 0 : z.width) ?? N, ne = o.createShape({
9357
9357
  type: "bpmn:Participant",
9358
9358
  businessObject: i.create("bpmn:Participant", {
9359
9359
  id: _.id,
@@ -9426,7 +9426,7 @@ function qA(e, t) {
9426
9426
  ], Rp = (x) => x.endsWith("Gateway");
9427
9427
  for (const x of X1) {
9428
9428
  const _ = ns.get(x), S = x ? d(x) : void 0, O = S ? S.x + 150 : 250;
9429
- let I = S ? S.y + 80 : 120;
9429
+ let N = S ? S.y + 80 : 120;
9430
9430
  const T = (Z, re, J) => {
9431
9431
  if (Z) {
9432
9432
  const ye = d(Z);
@@ -9509,7 +9509,7 @@ function qA(e, t) {
9509
9509
  Z.node.lane,
9510
9510
  J,
9511
9511
  Ce,
9512
- I,
9512
+ N,
9513
9513
  ce(Z.node.id),
9514
9514
  vt.has(Z.node.id) && Z.node.participant !== void 0 ? (Ae) => Me = Ae : void 0
9515
9515
  );
@@ -9517,7 +9517,7 @@ function qA(e, t) {
9517
9517
  const Ae = Z.node.lane ? d(Z.node.lane) : Ne;
9518
9518
  Et.set(Z.node.id, { container: Ae, relCy: Se.y - Ae.y, grow: Me });
9519
9519
  }
9520
- X.set(ye, Se.x + re.width + _e), !Z.node.lane && J === void 0 && (I += 160);
9520
+ X.set(ye, Se.x + re.width + _e), !Z.node.lane && J === void 0 && (N += 160);
9521
9521
  }
9522
9522
  const ae = /* @__PURE__ */ new Set(), oe = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map();
9523
9523
  if (x && R.has(`pool:${x}`)) {
@@ -9676,7 +9676,7 @@ function qA(e, t) {
9676
9676
  const re = Z[0];
9677
9677
  {
9678
9678
  const J = Sp(re.node, re.band), ye = L(re.node), Ne = Te(re);
9679
- n.createShape(J, D(ye, J, re.node.lane, Ne, O, I), ye), !re.node.lane && Ne === void 0 && (I += 160);
9679
+ n.createShape(J, D(ye, J, re.node.lane, Ne, O, N), ye), !re.node.lane && Ne === void 0 && (N += 160);
9680
9680
  }
9681
9681
  }
9682
9682
  }
@@ -9684,14 +9684,14 @@ function qA(e, t) {
9684
9684
  for (const [x, _] of k) {
9685
9685
  const S = f(x), O = f(_.flow.target);
9686
9686
  if (!(S != null && S.target) || !O) continue;
9687
- const I = S.label && { x: S.label.x, y: S.label.y, width: S.label.width, height: S.label.height };
9688
- Dg.set(x, { waypoints: S.waypoints.map((L) => ({ x: L.x, y: L.y })), label: I });
9687
+ const N = S.label && { x: S.label.x, y: S.label.y, width: S.label.width, height: S.label.height };
9688
+ Dg.set(x, { waypoints: S.waypoints.map((L) => ({ x: L.x, y: L.y })), label: N });
9689
9689
  const T = S.target, B = (L) => ({ x: L.x + L.width / 2, y: L.y + L.height / 2 });
9690
9690
  n.reconnect(S, O, T, [B(O), B(T)]), n.layoutConnection(S, { waypoints: [] });
9691
9691
  }
9692
9692
  const Lg = /* @__PURE__ */ new Set();
9693
9693
  {
9694
- const x = (T) => T.endsWith("Task") || T === "bpmn:CallActivity" || T === "bpmn:SubProcess", _ = (T) => x(T) || T === "bpmn:EndEvent" || T === "bpmn:IntermediateThrowEvent" || T === "bpmn:IntermediateCatchEvent", S = (T) => (T ?? []).filter((B) => B.type === "bpmn:SequenceFlow"), O = Bt(e, "sequenceFlow.update"), I = (T, B) => {
9694
+ const x = (T) => T.endsWith("Task") || T === "bpmn:CallActivity" || T === "bpmn:SubProcess", _ = (T) => x(T) || T === "bpmn:EndEvent" || T === "bpmn:IntermediateThrowEvent" || T === "bpmn:IntermediateCatchEvent", S = (T) => (T ?? []).filter((B) => B.type === "bpmn:SequenceFlow"), O = Bt(e, "sequenceFlow.update"), N = (T, B) => {
9695
9695
  if (!T) return;
9696
9696
  const L = B.x + B.width / 2, D = B.y + B.height / 2;
9697
9697
  let z;
@@ -9710,7 +9710,7 @@ function qA(e, t) {
9710
9710
  if (!B) continue;
9711
9711
  const L = T.source !== void 0 ? f(T.source) : B.source, D = T.target !== void 0 ? f(T.target) : B.target;
9712
9712
  if (!L || !D || L.id === D.id || P.has(L.id) || P.has(D.id) || !x(L.type) || !_(D.type) || L.parent !== D.parent || S(D.incoming).some((te) => te.id !== B.id) || S(D.outgoing).some((te) => te.id !== B.id) || O.some((te) => te !== T && (te.target === D.id || te.source === D.id)) || D.x >= L.x + L.width) continue;
9713
- const z = L.parent, j = g(L), X = L.x + L.width + _e, ne = L.y + L.height / 2, ce = D.y + D.height / 2, ae = I(j, L) === I(j, D), oe = /* @__PURE__ */ new Set([D.id]), me = [ae ? ne : ce, ce].find((te) => !C(z, D, X, te, oe));
9713
+ const z = L.parent, j = g(L), X = L.x + L.width + _e, ne = L.y + L.height / 2, ce = D.y + D.height / 2, ae = N(j, L) === N(j, D), oe = /* @__PURE__ */ new Set([D.id]), me = [ae ? ne : ce, ce].find((te) => !C(z, D, X, te, oe));
9714
9714
  if (me === void 0) continue;
9715
9715
  if (n.moveElements([D], { x: X - (D.x + D.width / 2), y: me - ce }), j) {
9716
9716
  const te = D.x + D.width + $f - (j.x + j.width);
@@ -9723,11 +9723,11 @@ function qA(e, t) {
9723
9723
  const No = 40, Z1 = 10, Oc = (x) => {
9724
9724
  const _ = (j) => j.kind === "label-over-line" || j.kind === "label-over-shape" || j.kind === "label-on-shared-segment" ? j.edge === x.id : j.kind === "annotation-over-label" || j.kind === "pool-name-over-label" ? j.label === x.id : !1, S = () => new Map(
9725
9725
  pt(We(r)).filter((j) => !_(j)).map((j) => [ft(j), j])
9726
- ), O = S(), I = (j) => [...j].filter(([X]) => !O.has(X)).map(([, X]) => X), T = (j) => I(j).length <= [...O.keys()].filter((X) => !j.has(X)).length, B = x.waypoints.map((j) => ({ x: j.x, y: j.y })), L = x.label, D = L && { x: L.x, y: L.y };
9726
+ ), O = S(), N = (j) => [...j].filter(([X]) => !O.has(X)).map(([, X]) => X), T = (j) => N(j).length <= [...O.keys()].filter((X) => !j.has(X)).length, B = x.waypoints.map((j) => ({ x: j.x, y: j.y })), L = x.label, D = L && { x: L.x, y: L.y };
9727
9727
  n.layoutConnection(x, { waypoints: [] });
9728
9728
  const z = S();
9729
9729
  if (!T(z)) {
9730
- if (I(z).every((j) => j.kind === "edge-crosses-shape" && j.edge === x.id)) {
9730
+ if (N(z).every((j) => j.kind === "edge-crosses-shape" && j.edge === x.id)) {
9731
9731
  const j = We(r), X = j.edges.find((oe) => oe.id === x.id), ne = Un(j), ce = X ? Ht(X, ne) : [], ae = X && ce.length && !ce.every((oe) => oe.type === "bpmn:TextAnnotation") ? Bd(X, ne, Ql(x), j.edges) : null;
9732
9732
  if (ae && (n.updateWaypoints(x, ae), T(S())))
9733
9733
  return;
@@ -9739,7 +9739,7 @@ function qA(e, t) {
9739
9739
  ...v.map((x) => x.flow.id),
9740
9740
  ...Bt(e, "sequenceFlow.update").map((x) => x.id),
9741
9741
  ...Bt(e, "messageFlow.update").map((x) => x.id)
9742
- ].filter((x) => !!x)), J1 = (x, _, S, O, I, T) => {
9742
+ ].filter((x) => !!x)), J1 = (x, _, S, O, N, T) => {
9743
9743
  const B = new Set(x.map((te) => te.id)), L = Math.min(...x.map((te) => te.x)) + _ - vi, D = Math.max(...x.map((te) => te.x + te.width)) + _ + Ig + vi, z = Math.min(...x.map((te) => te.y + Math.min(0, ...S))) - vi, j = Math.max(...x.map((te) => te.y + te.height + Math.max(0, ...S))) + vi, X = r.getAll().filter((te) => {
9744
9744
  if (te.type !== "bpmn:SequenceFlow" && te.type !== "bpmn:MessageFlow") return !1;
9745
9745
  const Z = te;
@@ -9779,19 +9779,19 @@ function qA(e, t) {
9779
9779
  const J = te.waypoints[re + 1];
9780
9780
  if (!J || Math.min(Z.y, J.y) > T || Math.max(Z.y, J.y) < T || Z.y === J.y) return !1;
9781
9781
  const ye = Z.x + (T - Z.y) * (J.x - Z.x) / (J.y - Z.y);
9782
- return ye > I && ye < oe;
9782
+ return ye > N && ye < oe;
9783
9783
  })
9784
9784
  ) ? 0 : ae;
9785
9785
  }, Bo = (x, _ = () => !0) => {
9786
9786
  const S = f(x);
9787
9787
  if (!S) return [];
9788
- const O = [S], I = /* @__PURE__ */ new Set([x]);
9788
+ const O = [S], N = /* @__PURE__ */ new Set([x]);
9789
9789
  for (let T = 0; T < O.length; T++) {
9790
9790
  const B = O[T].id;
9791
9791
  for (const L of F) {
9792
9792
  const D = L.flow.target;
9793
- if (L.flow.source !== B || I.has(D) || !P.has(D)) continue;
9794
- I.add(D);
9793
+ if (L.flow.source !== B || N.has(D) || !P.has(D)) continue;
9794
+ N.add(D);
9795
9795
  const z = f(D);
9796
9796
  z && _(z) && O.push(z);
9797
9797
  }
@@ -9800,13 +9800,13 @@ function qA(e, t) {
9800
9800
  }, Q1 = (x, _ = () => !0) => {
9801
9801
  const S = f(x);
9802
9802
  if (!S) return [];
9803
- const O = [S], I = /* @__PURE__ */ new Set([x]);
9803
+ const O = [S], N = /* @__PURE__ */ new Set([x]);
9804
9804
  for (let T = 0; T < O.length; T++) {
9805
9805
  const B = O[T].id;
9806
9806
  for (const L of F) {
9807
9807
  const D = L.flow.source;
9808
- if (L.flow.target !== B || I.has(D) || !P.has(D)) continue;
9809
- I.add(D);
9808
+ if (L.flow.target !== B || N.has(D) || !P.has(D)) continue;
9809
+ N.add(D);
9810
9810
  const z = f(D);
9811
9811
  z && _(z) && O.push(z);
9812
9812
  }
@@ -9822,7 +9822,7 @@ function qA(e, t) {
9822
9822
  )
9823
9823
  )) return null;
9824
9824
  }
9825
- const I = x.map((D) => D.pool.width), T = S ? r.filter((D) => Array.isArray(D.waypoints)).map((D) => ({
9825
+ const N = x.map((D) => D.pool.width), T = S ? r.filter((D) => Array.isArray(D.waypoints)).map((D) => ({
9826
9826
  c: D,
9827
9827
  wps: D.waypoints.map((z) => ({ x: z.x, y: z.y }))
9828
9828
  })) : [], B = r.filter((D) => D.type === "label").map((D) => ({
@@ -9843,7 +9843,7 @@ function qA(e, t) {
9843
9843
  x.flatMap((D) => D.subtree),
9844
9844
  { x: -_, y: 0 }
9845
9845
  ), x.forEach((D, z) => {
9846
- L[z] > 0 && na(D.pool, I[z]);
9846
+ L[z] > 0 && na(D.pool, N[z]);
9847
9847
  });
9848
9848
  for (const { c: D, wps: z } of T) {
9849
9849
  const j = D.waypoints ?? [];
@@ -9859,7 +9859,7 @@ function qA(e, t) {
9859
9859
  }
9860
9860
  };
9861
9861
  }, Mp = (x) => {
9862
- var I, T;
9862
+ var N, T;
9863
9863
  const _ = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
9864
9864
  for (const B of r.getAll()) {
9865
9865
  if (B.type !== "bpmn:Participant") continue;
@@ -9868,7 +9868,7 @@ function qA(e, t) {
9868
9868
  }
9869
9869
  for (const B of r.getAll()) {
9870
9870
  if (B.type !== "bpmn:MessageFlow") continue;
9871
- const L = B, D = (I = L.source) == null ? void 0 : I.id, z = (T = L.target) == null ? void 0 : T.id;
9871
+ const L = B, D = (N = L.source) == null ? void 0 : N.id, z = (T = L.target) == null ? void 0 : T.id;
9872
9872
  D && z && S.has(D) && S.get(D).push(z), D && z && S.has(z) && S.get(z).push(D);
9873
9873
  }
9874
9874
  const O = [];
@@ -9879,9 +9879,9 @@ function qA(e, t) {
9879
9879
  if (!x.length) return null;
9880
9880
  const S = new Set(x.map((j) => j.id)), O = r.getAll().filter(
9881
9881
  (j) => j.type === "bpmn:Participant" && !S.has(j.id)
9882
- ), I = Math.min(
9882
+ ), N = Math.min(
9883
9883
  ...O.filter((j) => (j.children ?? []).length > 0).map((j) => j.x)
9884
- ), T = new Set(x.filter((j) => Math.abs(j.x - I) <= 2).map((j) => j.id));
9884
+ ), T = new Set(x.filter((j) => Math.abs(j.x - N) <= 2).map((j) => j.id));
9885
9885
  if (x.some((j) => {
9886
9886
  const X = T.has(j.id) ? j.x : j.x + _, ne = T.has(j.id) ? j.width + _ : j.width;
9887
9887
  return O.some(
@@ -9908,34 +9908,34 @@ function qA(e, t) {
9908
9908
  }
9909
9909
  };
9910
9910
  }, Bg = (x, _, S) => {
9911
- const O = S.x + S.width / 2, I = _.y > S.y, T = I ? S.y + S.height : S.y, B = I ? _.y : _.y + _.height, L = x.source === _ ? [{ x: O, y: B }, { x: O, y: T }] : [{ x: O, y: T }, { x: O, y: B }], D = We(r), z = { ...D.edges.find((j) => j.id === x.id), waypoints: L };
9911
+ const O = S.x + S.width / 2, N = _.y > S.y, T = N ? S.y + S.height : S.y, B = N ? _.y : _.y + _.height, L = x.source === _ ? [{ x: O, y: B }, { x: O, y: T }] : [{ x: O, y: T }, { x: O, y: B }], D = We(r), z = { ...D.edges.find((j) => j.id === x.id), waypoints: L };
9912
9912
  return Ht(z, Un(D)).length ? !1 : (n.updateWaypoints(x, L), !0);
9913
9913
  }, eS = () => {
9914
9914
  const x = r.filter((B) => B.type === "bpmn:Participant"), _ = Math.min(...x.filter((B) => (B.children ?? []).length > 0).map((B) => B.x)), S = (B) => m.some((L) => L.participant.id === B.id), O = (B) => !!B && B.type === "bpmn:Participant" && !(B.children ?? []).length && Math.abs(B.x - _) <= 2 && // B-130 과 같은 판별자 — 폭이 아니라 좌변 관계
9915
- !S(B), I = (B) => !!B && B.type === "bpmn:Participant" && (B.children ?? []).length > 0 && !S(B), T = /* @__PURE__ */ new Set();
9915
+ !S(B), N = (B) => !!B && B.type === "bpmn:Participant" && (B.children ?? []).length > 0 && !S(B), T = /* @__PURE__ */ new Set();
9916
9916
  for (const B of r.getAll()) {
9917
9917
  if (B.type !== "bpmn:MessageFlow") continue;
9918
9918
  const L = B;
9919
9919
  if ((L.waypoints ?? []).length !== 2) continue;
9920
- const D = [L.source, L.target].find((X) => O(X) || I(X)), z = D === L.source ? L.target : L.source;
9920
+ const D = [L.source, L.target].find((X) => O(X) || N(X)), z = D === L.source ? L.target : L.source;
9921
9921
  if (!D || !z || z.type === "bpmn:Participant") continue;
9922
9922
  const j = z.x + z.width / 2;
9923
- I(D) && (j < D.x || j > D.x + D.width) || T.add(L.id);
9923
+ N(D) && (j < D.x || j > D.x + D.width) || T.add(L.id);
9924
9924
  }
9925
9925
  return T;
9926
9926
  }, tS = (x) => {
9927
9927
  var S;
9928
9928
  const _ = /* @__PURE__ */ new Map();
9929
9929
  for (const O of x) {
9930
- const I = r.get(O);
9931
- if (!I || (I.waypoints ?? []).length === 2) continue;
9932
- const T = ((S = I.source) == null ? void 0 : S.type) === "bpmn:Participant" ? I.source : I.target, B = T === I.source ? I.target : I.source;
9930
+ const N = r.get(O);
9931
+ if (!N || (N.waypoints ?? []).length === 2) continue;
9932
+ const T = ((S = N.source) == null ? void 0 : S.type) === "bpmn:Participant" ? N.source : N.target, B = T === N.source ? N.target : N.source;
9933
9933
  if (B.x + B.width / 2 <= T.x + T.width) continue;
9934
9934
  const L = _.get(T.id) ?? { pool: T, msgs: [] };
9935
- L.msgs.push({ conn: I, other: B }), _.set(T.id, L);
9935
+ L.msgs.push({ conn: N, other: B }), _.set(T.id, L);
9936
9936
  }
9937
- for (const { pool: O, msgs: I } of _.values()) {
9938
- const T = Math.max(...I.map(({ other: ae }) => ae.x + ae.width / 2)) + Wp;
9937
+ for (const { pool: O, msgs: N } of _.values()) {
9938
+ const T = Math.max(...N.map(({ other: ae }) => ae.x + ae.width / 2)) + Wp;
9939
9939
  if (r.getAll().some((ae) => {
9940
9940
  if (ae.type !== "bpmn:Participant" || ae.id === O.id) return !1;
9941
9941
  const oe = ae;
@@ -9946,7 +9946,7 @@ function qA(e, t) {
9946
9946
  return oe ? [{ label: oe, x: oe.x, y: oe.y }] : [];
9947
9947
  }), X = $o();
9948
9948
  na(O, T - O.x);
9949
- const ne = I.filter(({ conn: ae, other: oe }) => Bg(ae, O, oe)).length, ce = $o();
9949
+ const ne = N.filter(({ conn: ae, other: oe }) => Bg(ae, O, oe)).length, ce = $o();
9950
9950
  if (!(ne > 0 && ce.messages > X.messages && ce.lines >= X.lines)) {
9951
9951
  na(O, L.width);
9952
9952
  for (const { c: ae, wps: oe } of z) {
@@ -10001,8 +10001,8 @@ function qA(e, t) {
10001
10001
  const _ = (x.children ?? []).filter(bi);
10002
10002
  let S = 0;
10003
10003
  for (let O = 0; O < _.length; O++)
10004
- for (let I = O + 1; I < _.length; I++) {
10005
- const T = _[O], B = _[I];
10004
+ for (let N = O + 1; N < _.length; N++) {
10005
+ const T = _[O], B = _[N];
10006
10006
  T.x < B.x + B.width && T.x + T.width > B.x && T.y < B.y + B.height && T.y + T.height > B.y && S++;
10007
10007
  }
10008
10008
  return S;
@@ -10016,9 +10016,9 @@ function qA(e, t) {
10016
10016
  const _ = /* @__PURE__ */ new Map();
10017
10017
  for (const O of r.getAll()) {
10018
10018
  if (O.type !== "bpmn:MessageFlow") continue;
10019
- const I = O;
10020
- if (!I.waypoints || I.waypoints.length !== 2) continue;
10021
- const T = I.source, B = I.target;
10019
+ const N = O;
10020
+ if (!N.waypoints || N.waypoints.length !== 2) continue;
10021
+ const T = N.source, B = N.target;
10022
10022
  if (!T || !B) continue;
10023
10023
  const L = x.has(T.id);
10024
10024
  if (L === x.has(B.id)) continue;
@@ -10028,9 +10028,9 @@ function qA(e, t) {
10028
10028
  j ? D.x < j.minX && (j.minX = D.x) : _.set(z.id, { pool: z, minX: D.x });
10029
10029
  }
10030
10030
  const S = [];
10031
- for (const { pool: O, minX: I } of _.values()) {
10031
+ for (const { pool: O, minX: N } of _.values()) {
10032
10032
  const T = (O.children ?? []).filter(
10033
- (B) => bi(B) && !x.has(B.id) && B.x >= I
10033
+ (B) => bi(B) && !x.has(B.id) && B.x >= N
10034
10034
  );
10035
10035
  T.length && S.push({ subtree: T, pool: O });
10036
10036
  }
@@ -10038,16 +10038,16 @@ function qA(e, t) {
10038
10038
  }, iS = (x, _, S) => {
10039
10039
  const O = new Map(
10040
10040
  _.map((B) => [B.pool.id, { subtree: [...B.subtree], pool: B.pool }])
10041
- ), I = new Set(x);
10042
- for (const B of _) for (const L of B.subtree) I.add(L.id);
10041
+ ), N = new Set(x);
10042
+ for (const B of _) for (const L of B.subtree) N.add(L.id);
10043
10043
  let T = !1;
10044
10044
  for (; ; ) {
10045
10045
  let B = 0;
10046
- for (const L of zg(I)) {
10046
+ for (const L of zg(N)) {
10047
10047
  if (L.pool === S) continue;
10048
10048
  const D = O.get(L.pool.id);
10049
10049
  D ? D.subtree.push(...L.subtree) : O.set(L.pool.id, { subtree: [...L.subtree], pool: L.pool });
10050
- for (const z of L.subtree) I.add(z.id);
10050
+ for (const z of L.subtree) N.add(z.id);
10051
10051
  B += L.subtree.length;
10052
10052
  }
10053
10053
  if (!B) break;
@@ -10056,9 +10056,9 @@ function qA(e, t) {
10056
10056
  return T ? [...O.values()] : null;
10057
10057
  }, oS = (x, _) => {
10058
10058
  const S = /* @__PURE__ */ new Map();
10059
- for (const I of r.getAll()) {
10060
- if (I.type !== "bpmn:DataInputAssociation" && I.type !== "bpmn:DataOutputAssociation") continue;
10061
- const T = I, B = T.waypoints;
10059
+ for (const N of r.getAll()) {
10060
+ if (N.type !== "bpmn:DataInputAssociation" && N.type !== "bpmn:DataOutputAssociation") continue;
10061
+ const T = N, B = T.waypoints;
10062
10062
  if (!B || B.length < 2 || !B.every((ce) => Math.abs(ce.x - B[0].x) < 1)) continue;
10063
10063
  const L = T.source, D = T.target;
10064
10064
  if (!L || !D) continue;
@@ -10070,18 +10070,18 @@ function qA(e, t) {
10070
10070
  ne ? j.x < ne.minX && (ne.minX = j.x) : S.set(X.id, { pool: X, minX: j.x });
10071
10071
  }
10072
10072
  const O = [];
10073
- for (const { pool: I, minX: T } of S.values()) {
10074
- const B = (I.children ?? []).filter(
10073
+ for (const { pool: N, minX: T } of S.values()) {
10074
+ const B = (N.children ?? []).filter(
10075
10075
  (L) => bi(L) && !x.has(L.id) && L.x >= T
10076
10076
  );
10077
- B.length && O.push({ subtree: B, pool: I });
10077
+ B.length && O.push({ subtree: B, pool: N });
10078
10078
  }
10079
10079
  return O;
10080
10080
  }, Gg = (x) => {
10081
- const _ = We(r), S = _.shapes.filter((I) => x.has(I.id)), O = /* @__PURE__ */ new Set();
10082
- for (const I of _.edges)
10083
- if (!(I.type !== "bpmn:SequenceFlow" && I.type !== "bpmn:MessageFlow"))
10084
- for (const T of Ht(I, S)) O.add(`${I.id}|${T.id}`);
10081
+ const _ = We(r), S = _.shapes.filter((N) => x.has(N.id)), O = /* @__PURE__ */ new Set();
10082
+ for (const N of _.edges)
10083
+ if (!(N.type !== "bpmn:SequenceFlow" && N.type !== "bpmn:MessageFlow"))
10084
+ for (const T of Ht(N, S)) O.add(`${N.id}|${T.id}`);
10085
10085
  return O;
10086
10086
  }, Ap = /* @__PURE__ */ new Map(), rS = Bt(e, "sequenceFlow.update").flatMap(
10087
10087
  (x) => {
@@ -10096,16 +10096,16 @@ function qA(e, t) {
10096
10096
  if (!_) continue;
10097
10097
  const S = f(x.target), O = f(x.id);
10098
10098
  if (!S || !O) continue;
10099
- const I = x.source !== void 0 ? f(x.source) : O.source, T = O.target;
10100
- if (!I || !T || T.id === S.id) continue;
10101
- const B = Dg.get(O.id) ?? { waypoints: O.waypoints, label: O.label }, L = B.waypoints && B.waypoints.length >= 3 && Math.abs(B.waypoints[0].x - B.waypoints[1].x) < 1 && Math.abs(B.waypoints[0].y - B.waypoints[1].y) > 1 ? { x: B.waypoints[0].x, y: B.waypoints[0].y } : void 0, D = L ? B.waypoints[1].y : void 0, z = L && B.label ? { x: B.label.x, y: B.label.y } : void 0, j = z && B.label && Math.abs(z.y + B.label.height / 2 - D) <= ge / 5 && z.x + B.label.width > L.x ? z.x + B.label.width + 6 : void 0, X = (I.outgoing ?? []).filter(
10099
+ const N = x.source !== void 0 ? f(x.source) : O.source, T = O.target;
10100
+ if (!N || !T || T.id === S.id) continue;
10101
+ const B = Dg.get(O.id) ?? { waypoints: O.waypoints, label: O.label }, L = B.waypoints && B.waypoints.length >= 3 && Math.abs(B.waypoints[0].x - B.waypoints[1].x) < 1 && Math.abs(B.waypoints[0].y - B.waypoints[1].y) > 1 ? { x: B.waypoints[0].x, y: B.waypoints[0].y } : void 0, D = L ? B.waypoints[1].y : void 0, z = L && B.label ? { x: B.label.x, y: B.label.y } : void 0, j = z && B.label && Math.abs(z.y + B.label.height / 2 - D) <= ge / 5 && z.x + B.label.width > L.x ? z.x + B.label.width + 6 : void 0, X = (N.outgoing ?? []).filter(
10102
10102
  (Oe) => Oe.type === "bpmn:SequenceFlow" && Oe.id !== O.id && Oe.target && !is.has(Oe.id)
10103
10103
  ), ne = new Set(X.map((Oe) => Oe.target.id)), ce = (Oe) => {
10104
10104
  const St = { type: "bpmn:Task", x: Oe.x + 2, y: Oe.y + 2, width: Oe.width - 4, height: Oe.height - 4 };
10105
10105
  return X.find(
10106
10106
  (ht) => (ht.waypoints ?? []).some((Wt, $e) => !!ht.waypoints[$e + 1] && la(Wt, ht.waypoints[$e + 1], St) === 0)
10107
10107
  );
10108
- }, ae = Bo(x.target), oe = new Set(ae.map((Oe) => Oe.id)), me = Et.has(x.target) ? { autoResize: !1 } : void 0, he = Math.min(...ae.map((Oe) => Oe.x)), te = Math.max(...ae.map((Oe) => Oe.x + Oe.width)), Z = I.x + I.width, re = T.x + T.width <= I.x, J = (() => {
10108
+ }, ae = Bo(x.target), oe = new Set(ae.map((Oe) => Oe.id)), me = Et.has(x.target) ? { autoResize: !1 } : void 0, he = Math.min(...ae.map((Oe) => Oe.x)), te = Math.max(...ae.map((Oe) => Oe.x + Oe.width)), Z = N.x + N.width, re = T.x + T.width <= N.x, J = (() => {
10109
10109
  if (!re) return;
10110
10110
  const Oe = g(S), St = ((Oe == null ? void 0 : Oe.children) ?? []).filter(
10111
10111
  (He) => bi(He) && !oe.has(He.id) && He.type !== "bpmn:Group" && He.type !== "bpmn:Participant"
@@ -10123,10 +10123,10 @@ function qA(e, t) {
10123
10123
  if (la(Vn.waypoints[qi], Vn.waypoints[qi + 1], bt) < vi) return !1;
10124
10124
  return !0;
10125
10125
  });
10126
- }), Ue = I.x + I.width / 2, dt = I.y + I.height / 2, tt = B.waypoints ?? [], Ct = tt.length >= 2 && Math.abs(tt[0].y - tt[1].y) < 1 && tt[1].x < tt[0].x;
10126
+ }), Ue = N.x + N.width / 2, dt = N.y + N.height / 2, tt = B.waypoints ?? [], Ct = tt.length >= 2 && Math.abs(tt[0].y - tt[1].y) < 1 && tt[1].x < tt[0].x;
10127
10127
  return [
10128
10128
  ...D !== void 0 ? [{ cx: Ue, cy: D }] : [],
10129
- ...Ct ? [{ cx: I.x - No - S.width / 2, cy: tt[0].y }] : [],
10129
+ ...Ct ? [{ cx: N.x - No - S.width / 2, cy: tt[0].y }] : [],
10130
10130
  { cx: Ue, cy: dt + ge },
10131
10131
  { cx: Ue, cy: dt - ge }
10132
10132
  ].find((He) => $e(He.cx - (S.x + S.width / 2), He.cy - (S.y + S.height / 2)));
@@ -10135,7 +10135,7 @@ function qA(e, t) {
10135
10135
  if (L || re) return 0;
10136
10136
  const Oe = B.label, St = ((dt = O.businessObject) == null ? void 0 : dt.name) ?? "";
10137
10137
  if (!Oe || Oe.width == null || !St.trim()) return 0;
10138
- const ht = Z + No, Wt = I.y + I.height / 2 - S.height / 2;
10138
+ const ht = Z + No, Wt = N.y + N.height / 2 - S.height / 2;
10139
10139
  if (Math.min(Oe.y + Oe.height, Wt + S.height) - Math.max(Oe.y, Wt) < 3 || Oe.x + Oe.width - ht < 3) return 0;
10140
10140
  const Ue = Oe.x + Oe.width + Z1 - ht;
10141
10141
  return Ue <= S.width ? Ue : 0;
@@ -10144,15 +10144,15 @@ function qA(e, t) {
10144
10144
  const ke = S.y + S.height / 2, qe = J1(
10145
10145
  ae,
10146
10146
  Z + No + Ne - he,
10147
- [0, I.y + I.height / 2 - ke, T.y + T.height / 2 - ke],
10147
+ [0, N.y + N.height / 2 - ke, T.y + T.height / 2 - ke],
10148
10148
  ye,
10149
10149
  Z,
10150
- I.y + I.height / 2
10150
+ N.y + N.height / 2
10151
10151
  ), Ce = Z + No + Ne + qe, Me = (() => {
10152
10152
  if (j === void 0) return 0;
10153
- const Oe = Z + No, St = I.y + I.height / 2 - S.height / 2, ht = { x: Oe, y: St, width: te - he, height: S.height }, Wt = g(I);
10153
+ const Oe = Z + No, St = N.y + N.height / 2 - S.height / 2, ht = { x: Oe, y: St, width: te - he, height: S.height }, Wt = g(N);
10154
10154
  return ((Wt == null ? void 0 : Wt.children) ?? []).some(
10155
- (Ue) => bi(Ue) && !oe.has(Ue.id) && Ue.id !== I.id && Ue.id !== T.id && Ue.type !== "bpmn:Group" && Ue.type !== "bpmn:Participant" && Ue.x < ht.x + ht.width && Ue.x + Ue.width > ht.x && Ue.y < ht.y + ht.height && Ue.y + Ue.height > ht.y
10155
+ (Ue) => bi(Ue) && !oe.has(Ue.id) && Ue.id !== N.id && Ue.id !== T.id && Ue.type !== "bpmn:Group" && Ue.type !== "bpmn:Participant" && Ue.x < ht.x + ht.width && Ue.x + Ue.width > ht.x && Ue.y < ht.y + ht.height && Ue.y + Ue.height > ht.y
10156
10156
  ) || ce(ht) ? Math.max(0, j - Oe) : 0;
10157
10157
  })(), Se = J ? 0 : te - he + No * 2 + qe + Me + Ne - (re ? 0 : T.x - Z);
10158
10158
  let Ae = [];
@@ -10161,7 +10161,7 @@ function qA(e, t) {
10161
10161
  Ae = (() => {
10162
10162
  const tt = /* @__PURE__ */ new Set();
10163
10163
  for (const ze of St)
10164
- bi(ze) && !oe.has(ze.id) && ze.id !== I.id && ze.x >= ye && tt.add(ze.id);
10164
+ bi(ze) && !oe.has(ze.id) && ze.id !== N.id && ze.x >= ye && tt.add(ze.id);
10165
10165
  const Ct = [];
10166
10166
  for (const ze of St) {
10167
10167
  if (ze.type !== "bpmn:DataStoreReference" && ze.type !== "bpmn:DataObjectReference") continue;
@@ -10171,7 +10171,7 @@ function qA(e, t) {
10171
10171
  return Ct;
10172
10172
  })();
10173
10173
  const $e = St.filter(
10174
- (tt) => !("waypoints" in tt && tt.waypoints) && !ht(tt) && tt.type !== "label" && !oe.has(tt.id) && tt.id !== I.id && tt.x >= ye
10174
+ (tt) => !("waypoints" in tt && tt.waypoints) && !ht(tt) && tt.type !== "label" && !oe.has(tt.id) && tt.id !== N.id && tt.x >= ye
10175
10175
  ), Ue = $e.flatMap((tt) => tt.labels ?? []), dt = Oe ? [Oe, ...St.filter((tt) => ht(tt))] : [];
10176
10176
  if ($e.length) {
10177
10177
  const tt = new Set($e.map((it) => it.id)), Ct = zg(tt), ze = Ct.length ? iS(tt, Ct, Oe) : null, He = (it) => {
@@ -10247,12 +10247,12 @@ function qA(e, t) {
10247
10247
  if (!ue) return !0;
10248
10248
  const St = Oe.y + Oe.height / 2;
10249
10249
  return St >= ue.y && St <= ue.y + ue.height;
10250
- }, Pe = !Re(I) && Re(T), Be = (Oe) => Oe.y + Oe.height / 2, xt = () => {
10251
- const Oe = I.x + I.width, St = T.x, ht = Be(T) - S.height / 2, Wt = Be(T) + S.height / 2;
10250
+ }, Pe = !Re(N) && Re(T), Be = (Oe) => Oe.y + Oe.height / 2, xt = () => {
10251
+ const Oe = N.x + N.width, St = T.x, ht = Be(T) - S.height / 2, Wt = Be(T) + S.height / 2;
10252
10252
  return !r.getAll().some(
10253
- ($e) => bi($e) && $e.type !== "bpmn:Participant" && $e.type !== "bpmn:Group" && $e.type !== "bpmn:TextAnnotation" && $e.id !== I.id && $e.id !== T.id && $e.id !== S.id && $e.x < St && $e.x + $e.width > Oe && $e.y < Wt && $e.y + $e.height > ht
10253
+ ($e) => bi($e) && $e.type !== "bpmn:Participant" && $e.type !== "bpmn:Group" && $e.type !== "bpmn:TextAnnotation" && $e.id !== N.id && $e.id !== T.id && $e.id !== S.id && $e.x < St && $e.x + $e.width > Oe && $e.y < Wt && $e.y + $e.height > ht
10254
10254
  );
10255
- }, tn = !Pe && _.band !== void 0 && Re(T) && !fn(_.node.lane, _.node.participant, _.band, Be(I)) && fn(_.node.lane, _.node.participant, _.band, Be(T)) && T.x >= I.x + I.width && xt(), Gt = Pe || tn ? T : I, Vt = Gt.y + Gt.height / 2, Cn = Vt - (S.y + S.height / 2), dn = _.band !== void 0, Nc = dn ? [S] : ae, Np = (
10255
+ }, tn = !Pe && _.band !== void 0 && Re(T) && !fn(_.node.lane, _.node.participant, _.band, Be(N)) && fn(_.node.lane, _.node.participant, _.band, Be(T)) && T.x >= N.x + N.width && xt(), Gt = Pe || tn ? T : N, Vt = Gt.y + Gt.height / 2, Cn = Vt - (S.y + S.height / 2), dn = _.band !== void 0, Nc = dn ? [S] : ae, Np = (
10256
10256
  // ── B-89. 삽입도 같은 축이다 — band 가 **상류 행의 슬롯**을 가리키면 승계한다 ──
10257
10257
  // 🔁 「add/update 경로 갈림」의 동형이라 `freeSpot` 과 **같은 술어**를 쓴다(한쪽만 넓히면 구멍).
10258
10258
  (_.band === void 0 || fn(_.node.lane, _.node.participant, _.band, Vt)) && ei(x.target) && Nc.every(
@@ -10420,16 +10420,16 @@ function qA(e, t) {
10420
10420
  for (const [x, _] of Et) {
10421
10421
  const S = f(x);
10422
10422
  if (!S) continue;
10423
- const O = _.container, I = Math.abs(S.y + S.height / 2 - O.y - _.relCy) >= 0.5, T = S.label, B = Math.min(S.y, T && !T.hidden ? T.y : S.y), L = Math.max(S.y + S.height, T && !T.hidden ? T.y + T.height : 0);
10424
- if (I && B >= O.y && L <= O.y + O.height) continue;
10423
+ const O = _.container, N = Math.abs(S.y + S.height / 2 - O.y - _.relCy) >= 0.5, T = S.label, B = Math.min(S.y, T && !T.hidden ? T.y : S.y), L = Math.max(S.y + S.height, T && !T.hidden ? T.y + T.height : 0);
10424
+ if (N && B >= O.y && L <= O.y + O.height) continue;
10425
10425
  const D = S.y;
10426
10426
  _.grow(), S.y !== D && n.moveElements([S], { x: 0, y: D - S.y }, void 0, { autoResize: !1 });
10427
10427
  }
10428
10428
  const Vg = (x, _) => {
10429
- const S = _.target === x, O = d(_.source), I = d(_.target), T = S ? "bpmn:DataOutputAssociation" : "bpmn:DataInputAssociation";
10429
+ const S = _.target === x, O = d(_.source), N = d(_.target), T = S ? "bpmn:DataOutputAssociation" : "bpmn:DataInputAssociation";
10430
10430
  n.connect(
10431
10431
  O,
10432
- I,
10432
+ N,
10433
10433
  _.id ? { type: T, businessObject: i.create(T, { id: _.id }) } : { type: T }
10434
10434
  );
10435
10435
  }, Wg = (x) => {
@@ -10482,8 +10482,8 @@ function qA(e, t) {
10482
10482
  }
10483
10483
  }
10484
10484
  }
10485
- const I = Math.max(...O.map((T) => T.x + T.width / 2)) + Wp;
10486
- if (I > S.x + S.width && n.resizeShape(S, { x: S.x, y: S.y, width: I - S.x, height: S.height }), !!x)
10485
+ const N = Math.max(...O.map((T) => T.x + T.width / 2)) + Wp;
10486
+ if (N > S.x + S.width && n.resizeShape(S, { x: S.x, y: S.y, width: N - S.x, height: S.height }), !!x)
10487
10487
  for (const T of v) {
10488
10488
  const B = f(T.flow.id), L = T.flow.source === _.participant.id ? T.flow.target : T.flow.target === _.participant.id ? T.flow.source : void 0, D = L ? f(L) : void 0;
10489
10489
  if (!B || !D || D.type === "bpmn:Participant") continue;
@@ -10505,9 +10505,9 @@ function qA(e, t) {
10505
10505
  [...F.map((D) => D.flow.id), ...v.map((D) => D.flow.id)].filter(
10506
10506
  (D) => !!D
10507
10507
  )
10508
- ), O = r.filter((D) => !!D.waypoints), I = (D, z) => Math.abs(z.x - D.x) < 2 ? "L" : Math.abs(z.x - (D.x + D.width)) < 2 ? "R" : Math.abs(z.y - D.y) < 2 ? "T" : Math.abs(z.y - (D.y + D.height)) < 2 ? "B" : void 0, T = /* @__PURE__ */ new Map(), B = (D, z, j) => {
10508
+ ), O = r.filter((D) => !!D.waypoints), N = (D, z) => Math.abs(z.x - D.x) < 2 ? "L" : Math.abs(z.x - (D.x + D.width)) < 2 ? "R" : Math.abs(z.y - D.y) < 2 ? "T" : Math.abs(z.y - (D.y + D.height)) < 2 ? "B" : void 0, T = /* @__PURE__ */ new Map(), B = (D, z, j) => {
10509
10509
  if (!D || !z || typeof D.x != "number") return;
10510
- const X = I(D, z);
10510
+ const X = N(D, z);
10511
10511
  if (!X) return;
10512
10512
  let ne = T.get(D.id);
10513
10513
  ne || T.set(D.id, ne = /* @__PURE__ */ new Map()), ne.set(X, [...ne.get(X) ?? [], j]);
@@ -10563,8 +10563,8 @@ function qA(e, t) {
10563
10563
  return S ? Ht(S, Un(_)).length : 0;
10564
10564
  }, os = (x) => Fo(x) > 0, oa = (x) => We(r).edges.filter(
10565
10565
  (_) => _.type === "bpmn:MessageFlow" && _.id !== x && _.waypoints.length === 2
10566
- ).length, qg = (x, _, S) => ia([{ subtree: x, pool: _ }], S), Yg = (x, _) => _.bad > x.bad || _.crossings > x.crossings && _.straight <= x.straight && _.bad >= x.bad, ra = (x, _) => Yg(x, _) || _.straight < x.straight, jo = (x, _, S = () => !0, O = Yg, I = !1) => {
10567
- const T = Er(), B = ia(x, _, I);
10566
+ ).length, qg = (x, _, S) => ia([{ subtree: x, pool: _ }], S), Yg = (x, _) => _.bad > x.bad || _.crossings > x.crossings && _.straight <= x.straight && _.bad >= x.bad, ra = (x, _) => Yg(x, _) || _.straight < x.straight, jo = (x, _, S = () => !0, O = Yg, N = !1) => {
10567
+ const T = Er(), B = ia(x, _, N);
10568
10568
  if (!B) return !1;
10569
10569
  const L = Er();
10570
10570
  return O(T, L) || !S() ? (B(), !1) : !0;
@@ -10579,27 +10579,27 @@ function qA(e, t) {
10579
10579
  }
10580
10580
  const rs = [...aa.keys()], Tp = new Set(F.map((x) => x.flow.target)), Kg = (x) => Tc.findIndex(({ op: _ }) => _.participant.id === x);
10581
10581
  rs.sort((x, _) => {
10582
- var I, T;
10582
+ var N, T;
10583
10583
  const S = Tp.has(x) ? 1 : 0, O = Tp.has(_) ? 1 : 0;
10584
- return S !== O ? S - O : Kg((I = P.get(x)) == null ? void 0 : I.node.participant) - Kg((T = P.get(_)) == null ? void 0 : T.node.participant);
10584
+ return S !== O ? S - O : Kg((N = P.get(x)) == null ? void 0 : N.node.participant) - Kg((T = P.get(_)) == null ? void 0 : T.node.participant);
10585
10585
  });
10586
10586
  const Ho = (x) => x.x + x.width / 2, pS = (x) => {
10587
10587
  const _ = /* @__PURE__ */ new Map();
10588
- for (const I of r.getAll()) {
10589
- const T = I;
10588
+ for (const N of r.getAll()) {
10589
+ const T = N;
10590
10590
  if (!T.waypoints || !T.source || !T.target) continue;
10591
10591
  (_.get(T.source.id) ?? _.set(T.source.id, []).get(T.source.id)).push(T.target.id);
10592
10592
  }
10593
10593
  const S = /* @__PURE__ */ new Set([x]), O = [x];
10594
- for (let I = 0; I < O.length; I++)
10595
- for (const T of _.get(O[I]) ?? [])
10594
+ for (let N = 0; N < O.length; N++)
10595
+ for (const T of _.get(O[N]) ?? [])
10596
10596
  S.has(T) || (S.add(T), O.push(T));
10597
10597
  return S;
10598
10598
  }, fS = (x, _) => {
10599
10599
  const S = pS(_);
10600
10600
  let O;
10601
- for (const I of r.getAll()) {
10602
- const T = I;
10601
+ for (const N of r.getAll()) {
10602
+ const T = N;
10603
10603
  if (T.type !== "bpmn:MessageFlow" || !T.source || !T.target || T.target.id !== x || S.has(T.source.id)) continue;
10604
10604
  const B = T.source;
10605
10605
  if (typeof B.x != "number" || B.type === "bpmn:Participant") continue;
@@ -10624,7 +10624,7 @@ function qA(e, t) {
10624
10624
  }, hS = (x) => {
10625
10625
  const _ = dS(x);
10626
10626
  return _ !== void 0 && Math.abs(_) < Pp;
10627
- }, Dc = (x, _, S, O, I) => {
10627
+ }, Dc = (x, _, S, O, N) => {
10628
10628
  var T;
10629
10629
  for (let B = !0; B; ) {
10630
10630
  B = !1;
@@ -10633,31 +10633,31 @@ function qA(e, t) {
10633
10633
  const D = _.has(L.flow.source), z = _.has(L.flow.target);
10634
10634
  if (D === z || O(D ? L.flow.source : L.flow.target)) continue;
10635
10635
  const j = D ? L.flow.target : L.flow.source;
10636
- if (I(j) || !Sr(j)) continue;
10636
+ if (N(j) || !Sr(j)) continue;
10637
10637
  const X = f(L.flow.id);
10638
10638
  if (!(X != null && X.waypoints) || X.waypoints.length !== 2) continue;
10639
10639
  const ne = f(j), ce = (T = P.get(j)) == null ? void 0 : T.node.participant;
10640
10640
  if (!ne || !ce) continue;
10641
10641
  const ae = Bo(j, (oe) => oe.x >= ne.x).filter((oe) => !_.has(oe.id));
10642
- if (!(!ae.length || ae.some((oe) => I(oe.id)))) {
10642
+ if (!(!ae.length || ae.some((oe) => N(oe.id)))) {
10643
10643
  for (const oe of ae) _.add(oe.id);
10644
10644
  x.set(ce, [...x.get(ce) ?? [], ...ae]), B = !0;
10645
10645
  }
10646
10646
  }
10647
10647
  }
10648
10648
  return [...x].map(([B, L]) => ({ subtree: L, pool: d(B) }));
10649
- }, Zg = (x, _, S, O, I) => Dc(
10649
+ }, Zg = (x, _, S, O, N) => Dc(
10650
10650
  /* @__PURE__ */ new Map([[_, [...x]]]),
10651
10651
  new Set(x.map((T) => T.id)),
10652
10652
  O,
10653
10653
  (T) => T === S,
10654
- (T) => T === I
10654
+ (T) => T === N
10655
10655
  ), Op = (x) => {
10656
10656
  const _ = Xg(x);
10657
10657
  if (!_) return null;
10658
- const S = f(x), O = f(_.flow.source), I = kp(_, x);
10659
- if (!S || !O || I === void 0) return null;
10660
- const T = I - Ho(S);
10658
+ const S = f(x), O = f(_.flow.source), N = kp(_, x);
10659
+ if (!S || !O || N === void 0) return null;
10660
+ const T = N - Ho(S);
10661
10661
  if (T >= Pp) {
10662
10662
  const B = P.get(x).node.participant, L = Bo(x, (D) => D.x >= S.x);
10663
10663
  return { groups: Zg(L, B, x, _.flow.id, _.flow.source), dx: T };
@@ -10672,18 +10672,18 @@ function qA(e, t) {
10672
10672
  ).map((x) => x.id);
10673
10673
  for (let x = 0; x < 3; x++) {
10674
10674
  const _ = Er(), S = [];
10675
- for (const I of Jg()) {
10676
- const T = Op(I);
10675
+ for (const N of Jg()) {
10676
+ const T = Op(N);
10677
10677
  if (!T) continue;
10678
10678
  const B = ia(T.groups, T.dx);
10679
10679
  B && S.push(B);
10680
10680
  }
10681
10681
  if (!S.length) break;
10682
10682
  if (!ra(_, Er())) continue;
10683
- for (const I of S.reverse()) I();
10683
+ for (const N of S.reverse()) N();
10684
10684
  let O = !1;
10685
- for (const I of Jg()) {
10686
- const T = Op(I);
10685
+ for (const N of Jg()) {
10686
+ const T = Op(N);
10687
10687
  T && jo(T.groups, T.dx, () => !0, ra) && (O = !0);
10688
10688
  }
10689
10689
  if (!O) break;
@@ -10694,16 +10694,16 @@ function qA(e, t) {
10694
10694
  if (!_ || _.node.lane !== void 0) continue;
10695
10695
  const S = Te(_);
10696
10696
  if (S === void 0) continue;
10697
- const O = f(x), I = O ? g(O) : void 0;
10698
- if (!O || !I) continue;
10699
- const T = I.y + U + Nt(`pool:${_.node.participant ?? ""}`, S) * ge, B = T - (O.y + O.height / 2);
10700
- B !== 0 && !C(I, O, O.x + O.width / 2, T) && n.moveElements([O], { x: 0, y: B });
10697
+ const O = f(x), N = O ? g(O) : void 0;
10698
+ if (!O || !N) continue;
10699
+ const T = N.y + U + Nt(`pool:${_.node.participant ?? ""}`, S) * ge, B = T - (O.y + O.height / 2);
10700
+ B !== 0 && !C(N, O, O.x + O.width / 2, T) && n.moveElements([O], { x: 0, y: B });
10701
10701
  }
10702
10702
  const Lc = () => {
10703
10703
  const x = r.filter((O) => O.type === "bpmn:Participant"), _ = new Map(x.map((O) => [O.id, O]));
10704
10704
  let S = 0;
10705
- for (const { pools: [O, I] } of Tw(x)) {
10706
- const T = _.get(O), B = _.get(I);
10705
+ for (const { pools: [O, N] } of Tw(x)) {
10706
+ const T = _.get(O), B = _.get(N);
10707
10707
  S += (Math.min(T.x + T.width, B.x + B.width) - Math.max(T.x, B.x)) * (Math.min(T.y + T.height, B.y + B.height) - Math.max(T.y, B.y));
10708
10708
  }
10709
10709
  return S;
@@ -10714,10 +10714,10 @@ function qA(e, t) {
10714
10714
  if (Dp.has(S.flow.id) || !os(S.flow.id)) continue;
10715
10715
  const O = f(S.flow.target);
10716
10716
  if (!O) continue;
10717
- const I = d(P.get(S.flow.target).node.participant), T = Bo(S.flow.target, (j) => j.x >= O.x), B = O.width + _e, L = Fo(S.flow.id), D = oa(S.flow.id), z = Lc();
10717
+ const N = d(P.get(S.flow.target).node.participant), T = Bo(S.flow.target, (j) => j.x >= O.x), B = O.width + _e, L = Fo(S.flow.id), D = oa(S.flow.id), z = Lc();
10718
10718
  for (let j = 1; j <= Ug; j++) {
10719
10719
  const X = () => Fo(S.flow.id) >= L || Lc() > z ? !1 : oa(S.flow.id) >= D ? !0 : (Qg.add(S.flow.id), !1);
10720
- if (uS(T, I, B * j, X)) {
10720
+ if (uS(T, N, B * j, X)) {
10721
10721
  Dp.add(S.flow.id), _ = !0;
10722
10722
  break;
10723
10723
  }
@@ -10732,11 +10732,11 @@ function qA(e, t) {
10732
10732
  if (Dp.has(x.flow.id) || !Qg.has(x.flow.id) || !os(x.flow.id)) continue;
10733
10733
  const _ = f(x.flow.target);
10734
10734
  if (!_) continue;
10735
- const S = d(P.get(x.flow.target).node.participant), O = Bo(x.flow.target, (ne) => ne.x >= _.x), I = new Set(O.map((ne) => ne.id)), T = /* @__PURE__ */ new Map();
10735
+ const S = d(P.get(x.flow.target).node.participant), O = Bo(x.flow.target, (ne) => ne.x >= _.x), N = new Set(O.map((ne) => ne.id)), T = /* @__PURE__ */ new Map();
10736
10736
  for (const ne of r.filter((ce) => ce.type === "bpmn:MessageFlow")) {
10737
10737
  if (((ym = ne.waypoints) == null ? void 0 : ym.length) !== 2 || !ne.source || !ne.target) continue;
10738
- const ce = I.has(ne.source.id);
10739
- if (ce === I.has(ne.target.id)) continue;
10738
+ const ce = N.has(ne.source.id);
10739
+ if (ce === N.has(ne.target.id)) continue;
10740
10740
  const ae = ce ? ne.target : ne.source, oe = (vm = P.get(ae.id)) == null ? void 0 : vm.node.participant;
10741
10741
  !oe || T.has(ae.id) || T.set(ae.id, { subtree: [ae], pool: d(oe) });
10742
10742
  }
@@ -10752,16 +10752,16 @@ function qA(e, t) {
10752
10752
  if (!os(x.id)) continue;
10753
10753
  const _ = f(x.source), S = f(x.target);
10754
10754
  if (!_ || !S) continue;
10755
- let O, I, T;
10755
+ let O, N, T;
10756
10756
  if (x.preexisting) {
10757
10757
  const [L, D] = _.type === "bpmn:Participant" ? [S, _] : [_, S];
10758
10758
  if (O = Ho(L), O < D.x || O > D.x + D.width) continue;
10759
- [I, T] = L.y < D.y ? [L.y + L.height, D.y] : [D.y + D.height, L.y];
10759
+ [N, T] = L.y < D.y ? [L.y + L.height, D.y] : [D.y + D.height, L.y];
10760
10760
  } else {
10761
10761
  if (_.type === "bpmn:Participant" || S.type === "bpmn:Participant" || (O = _.x + _.width / 2, Math.abs(O - (S.x + S.width / 2)) > 15)) continue;
10762
- [I, T] = _.y < S.y ? [_.y + _.height, S.y] : [S.y + S.height, _.y];
10762
+ [N, T] = _.y < S.y ? [_.y + _.height, S.y] : [S.y + S.height, _.y];
10763
10763
  }
10764
- const B = [...P.values()].map((L) => f(L.node.id)).filter((L) => !!L && L.id !== _.id && L.id !== S.id).filter((L) => L.x <= O && O <= L.x + L.width && L.y + L.height > I && L.y < T).sort((L, D) => L.x - D.x);
10764
+ const B = [...P.values()].map((L) => f(L.node.id)).filter((L) => !!L && L.id !== _.id && L.id !== S.id).filter((L) => L.x <= O && O <= L.x + L.width && L.y + L.height > N && L.y < T).sort((L, D) => L.x - D.x);
10765
10765
  for (const L of B) {
10766
10766
  const D = (xm = P.get(L.id)) == null ? void 0 : xm.node.participant, z = D ? f(D) : void 0;
10767
10767
  if (!D || !z) continue;
@@ -10804,10 +10804,10 @@ function qA(e, t) {
10804
10804
  var _, S;
10805
10805
  return Fo(x) === 0 && ((S = (_ = f(x)) == null ? void 0 : _.waypoints) == null ? void 0 : S.length) === 2;
10806
10806
  }, mS = (x, _, S) => {
10807
- const O = new Set(x.flatMap((T) => T.subtree.map((B) => B.id))), I = [...Ic()].filter((T) => !S.has(T)).map((T) => T.split(">")[1]);
10808
- return [...new Set(I)].filter((T) => O.has(T) && T !== _.source && T !== _.target);
10809
- }, yS = (x, _, S, O, I) => {
10810
- const T = x.map((z) => ({ ...z, subtree: z.subtree.filter((j) => !I.includes(j.id)) })).filter((z) => z.subtree.length), B = new Set(T.flatMap((z) => z.subtree.map((j) => j.id))), L = () => I.every((z) => {
10807
+ const O = new Set(x.flatMap((T) => T.subtree.map((B) => B.id))), N = [...Ic()].filter((T) => !S.has(T)).map((T) => T.split(">")[1]);
10808
+ return [...new Set(N)].filter((T) => O.has(T) && T !== _.source && T !== _.target);
10809
+ }, yS = (x, _, S, O, N) => {
10810
+ const T = x.map((z) => ({ ...z, subtree: z.subtree.filter((j) => !N.includes(j.id)) })).filter((z) => z.subtree.length), B = new Set(T.flatMap((z) => z.subtree.map((j) => j.id))), L = () => N.every((z) => {
10811
10811
  const j = f(z);
10812
10812
  return !!j && F.filter((X) => X.flow.target === z && B.has(X.flow.source)).every((X) => {
10813
10813
  const ne = f(X.flow.source);
@@ -10822,8 +10822,8 @@ function qA(e, t) {
10822
10822
  if (((bm = _ == null ? void 0 : _.waypoints) == null ? void 0 : bm.length) !== 2) continue;
10823
10823
  const S = f(x.flow.source), O = f(x.flow.target);
10824
10824
  if (!S || !O || S.type === "bpmn:Participant" || O.type === "bpmn:Participant" || !Sr(x.flow.source) || !Sr(x.flow.target) || Math.abs(Ho(S) - Ho(O)) > cS) continue;
10825
- const I = Ho(S), T = _.waypoints.map((oe) => oe.y), [B, L] = [Math.min(...T), Math.max(...T)], D = Un(We(r)).filter(
10826
- (oe) => oe.id !== S.id && oe.id !== O.id && oe.x < I && I < oe.x + oe.width && B < oe.y + oe.height && oe.y < L
10825
+ const N = Ho(S), T = _.waypoints.map((oe) => oe.y), [B, L] = [Math.min(...T), Math.max(...T)], D = Un(We(r)).filter(
10826
+ (oe) => oe.id !== S.id && oe.id !== O.id && oe.x < N && N < oe.x + oe.width && B < oe.y + oe.height && oe.y < L
10827
10827
  );
10828
10828
  if (!D.length) continue;
10829
10829
  const z = (wm = P.get(x.flow.source)) == null ? void 0 : wm.node.participant, j = (_m = P.get(x.flow.target)) == null ? void 0 : _m.node.participant;
@@ -10844,7 +10844,7 @@ function qA(e, t) {
10844
10844
  () => !1
10845
10845
  ), ae = Math.max(...D.map((oe) => oe.x + oe.width));
10846
10846
  for (const oe of lS) {
10847
- const me = ae + oe - I;
10847
+ const me = ae + oe - N;
10848
10848
  if (me <= 0) continue;
10849
10849
  const he = Er().bad, te = Ic();
10850
10850
  let Z = [], re = !0;
@@ -10875,16 +10875,16 @@ function qA(e, t) {
10875
10875
  }
10876
10876
  }
10877
10877
  return D;
10878
- }, O = () => ({ ...Er(), grazes: S() }), I = [];
10878
+ }, O = () => ({ ...Er(), grazes: S() }), N = [];
10879
10879
  for (const T of P.keys()) {
10880
10880
  if (!Sr(T)) continue;
10881
10881
  const B = F.filter((z) => z.flow.target === T);
10882
10882
  if (B.length !== 1) continue;
10883
10883
  const L = f(B[0].flow.source), D = f(T);
10884
- !L || !D || !P.has(L.id) || Math.abs(x(L) - x(D)) > 1 || D.x - (L.x + L.width) <= _e + 1 || I.push({ id: T, pred: L, node: D });
10884
+ !L || !D || !P.has(L.id) || Math.abs(x(L) - x(D)) > 1 || D.x - (L.x + L.width) <= _e + 1 || N.push({ id: T, pred: L, node: D });
10885
10885
  }
10886
- I.sort((T, B) => T.node.x - B.node.x);
10887
- for (const { id: T } of I) {
10886
+ N.sort((T, B) => T.node.x - B.node.x);
10887
+ for (const { id: T } of N) {
10888
10888
  const B = P.get(T), L = f(T), D = f(F.find((Z) => Z.flow.target === T).flow.source);
10889
10889
  if (!L || !D) continue;
10890
10890
  const z = L.x - (D.x + D.width);
@@ -10917,18 +10917,18 @@ function qA(e, t) {
10917
10917
  (x) => x.type === "bpmn:DataStoreReference" && h.has(x.id)
10918
10918
  ), _S = (x, _) => {
10919
10919
  const S = x.x + x.width / 2, O = x.y + x.height / 2;
10920
- let I;
10920
+ let N;
10921
10921
  for (const T of wS) {
10922
10922
  if ((g(T) ?? p()) !== _ || T.y < x.y + x.height) continue;
10923
10923
  const B = Math.abs(T.x + T.width / 2 - S);
10924
10924
  B > xS || B < T.width || !bS(T).some(
10925
10925
  (D) => D.height === x.height && Math.abs(D.y + D.height / 2 - O) <= vS && T.y >= D.y + D.height
10926
- ) || (!I || B < I.dx || B === I.dx && T.id < I.id) && (I = { dx: B, id: T.id, cy: T.y + T.height / 2 });
10926
+ ) || (!N || B < N.dx || B === N.dx && T.id < N.id) && (N = { dx: B, id: T.id, cy: T.y + T.height / 2 });
10927
10927
  }
10928
- return I == null ? void 0 : I.cy;
10928
+ return N == null ? void 0 : N.cy;
10929
10929
  };
10930
10930
  for (const x of b) {
10931
- const _ = x.associations ?? [], S = _.map((T) => T.source === x.dataStore.id ? T.target : T.source).map(f).find(Boolean), O = S ? g(S) ?? p() : p(), I = S ? {
10931
+ const _ = x.associations ?? [], S = _.map((T) => T.source === x.dataStore.id ? T.target : T.source).map(f).find(Boolean), O = S ? g(S) ?? p() : p(), N = S ? {
10932
10932
  x: S.x + S.width / 2,
10933
10933
  y: _S(S, O) ?? S.y + S.height + 110
10934
10934
  } : { x: 200, y: ts + 60 };
@@ -10940,7 +10940,7 @@ function qA(e, t) {
10940
10940
  name: x.dataStore.name
10941
10941
  })
10942
10942
  },
10943
- I,
10943
+ N,
10944
10944
  O
10945
10945
  );
10946
10946
  for (const T of _) Vg(x.dataStore.id, T);
@@ -10965,17 +10965,17 @@ function qA(e, t) {
10965
10965
  Math.abs(x.x + x.width - ce) < z && (x.width = ce - z - x.x);
10966
10966
  }
10967
10967
  if (!S.length) return;
10968
- const O = Math.min(...S.map((D) => D.y)), I = Math.max(...S.map((D) => D.y + D.height)), T = O - x.y, B = x.y + x.height - I, L = om - Rr;
10968
+ const O = Math.min(...S.map((D) => D.y)), N = Math.max(...S.map((D) => D.y + D.height)), T = O - x.y, B = x.y + x.height - N, L = om - Rr;
10969
10969
  if (T > 0 != B > 0)
10970
10970
  if (T > 0 && T < L) {
10971
10971
  const D = T + Rr;
10972
10972
  x.y += D, x.height -= D;
10973
10973
  } else B > 0 && B < L && (x.height -= B + Rr);
10974
10974
  }, SS = (x, _) => {
10975
- const S = Rr, O = 30, I = r.filter(
10975
+ const S = Rr, O = 30, N = r.filter(
10976
10976
  (T) => T.type === "bpmn:Group" && T.id !== _
10977
10977
  );
10978
- for (const T of I) {
10978
+ for (const T of N) {
10979
10979
  const B = T.x, L = T.x + T.width, D = T.y, z = T.y + T.height, j = x.y < z && D < x.y + x.height, X = x.x < L && B < x.x + x.width;
10980
10980
  if (j) {
10981
10981
  if (Math.abs(x.x - L) < S) {
@@ -10999,11 +10999,11 @@ function qA(e, t) {
10999
10999
  }
11000
11000
  }
11001
11001
  }, Ip = (x, _) => {
11002
- const S = om, O = Math.min(...x.map((D) => D.x)) - S, I = Math.min(...x.map((D) => D.y)) - S, T = Math.max(...x.map((D) => D.x + D.width)) + S, B = Math.max(...x.map((D) => D.y + D.height)) + S, L = { x: O, y: I, width: T - O, height: B - I };
11002
+ const S = om, O = Math.min(...x.map((D) => D.x)) - S, N = Math.min(...x.map((D) => D.y)) - S, T = Math.max(...x.map((D) => D.x + D.width)) + S, B = Math.max(...x.map((D) => D.y + D.height)) + S, L = { x: O, y: N, width: T - O, height: B - N };
11003
11003
  return ES(L, x), SS(L, _), L;
11004
11004
  };
11005
- for (const x of N) {
11006
- const _ = (x.group.members ?? []).map(f).filter((I) => !!I);
11005
+ for (const x of I) {
11006
+ const _ = (x.group.members ?? []).map(f).filter((N) => !!N);
11007
11007
  let S;
11008
11008
  _.length ? S = Ip(_, x.group.id) : (S = { x: 300 + im * 350, y: 40, width: 300, height: 200 }, im++);
11009
11009
  const O = n.createShape(
@@ -11019,23 +11019,23 @@ function qA(e, t) {
11019
11019
  x.group.name && n.updateLabel(O, x.group.name), (Em = x.group.members) != null && Em.length && se(O, "bwl:Members", { refs: x.group.members.join(" ") });
11020
11020
  }
11021
11021
  {
11022
- const x = r.filter((I) => !!I.waypoints), _ = /* @__PURE__ */ new Map(), S = (I, T) => {
11023
- !I || !T || (_.has(I) || _.set(I, /* @__PURE__ */ new Set()), _.get(I).add(T));
11022
+ const x = r.filter((N) => !!N.waypoints), _ = /* @__PURE__ */ new Map(), S = (N, T) => {
11023
+ !N || !T || (_.has(N) || _.set(N, /* @__PURE__ */ new Set()), _.get(N).add(T));
11024
11024
  };
11025
- for (const I of x) {
11026
- const T = (Sm = I.source) == null ? void 0 : Sm.id, B = (Rm = I.target) == null ? void 0 : Rm.id;
11027
- S(T, B), ((Cm = I.type) != null && Cm.includes("DataOutputAssociation") || (Mm = I.type) != null && Mm.includes("DataInputAssociation") || I.type === "bpmn:Association") && S(B, T);
11025
+ for (const N of x) {
11026
+ const T = (Sm = N.source) == null ? void 0 : Sm.id, B = (Rm = N.target) == null ? void 0 : Rm.id;
11027
+ S(T, B), ((Cm = N.type) != null && Cm.includes("DataOutputAssociation") || (Mm = N.type) != null && Mm.includes("DataInputAssociation") || N.type === "bpmn:Association") && S(B, T);
11028
11028
  }
11029
- const O = r.filter((I) => I.type === "bpmn:Group");
11030
- for (const I of O) {
11031
- const B = (((Am = I.businessObject.extensionElements) == null ? void 0 : Am.values) ?? []).find((he) => he.$type === "bwl:Members"), L = ((B == null ? void 0 : B.refs) ?? "").split(" ").filter(Boolean);
11029
+ const O = r.filter((N) => N.type === "bpmn:Group");
11030
+ for (const N of O) {
11031
+ const B = (((Am = N.businessObject.extensionElements) == null ? void 0 : Am.values) ?? []).find((he) => he.$type === "bwl:Members"), L = ((B == null ? void 0 : B.refs) ?? "").split(" ").filter(Boolean);
11032
11032
  if (!L.length) continue;
11033
11033
  const D = new Set(L), z = [...L];
11034
11034
  for (; z.length; ) {
11035
11035
  const he = z.shift();
11036
11036
  for (const te of _.get(he) ?? []) D.has(te) || (D.add(te), z.push(te));
11037
11037
  }
11038
- const j = I.x, X = I.x + I.width, ne = I.y, ce = I.y + I.height, ae = (he) => F.filter((te) => te.flow.target === he).length, oe = (he) => {
11038
+ const j = N.x, X = N.x + N.width, ne = N.y, ce = N.y + N.height, ae = (he) => F.filter((te) => te.flow.target === he).length, oe = (he) => {
11039
11039
  var Z;
11040
11040
  const te = ((Z = f(he)) == null ? void 0 : Z.type) ?? "";
11041
11041
  if (te === "bpmn:StartEvent" && ae(he) === 0) return !1;
@@ -11106,25 +11106,25 @@ function qA(e, t) {
11106
11106
  }
11107
11107
  {
11108
11108
  const x = /* @__PURE__ */ new Set([
11109
- ...N.map((_) => _.group.id),
11109
+ ...I.map((_) => _.group.id),
11110
11110
  ...Bt(e, "group.update").map((_) => _.id)
11111
11111
  ]);
11112
11112
  for (const _ of r.filter((S) => S.type === "bpmn:Group")) {
11113
11113
  if (x.has(_.id)) continue;
11114
- const O = (((Tm = _.businessObject.extensionElements) == null ? void 0 : Tm.values) ?? []).find((L) => L.$type === "bwl:Members"), I = ((O == null ? void 0 : O.refs) ?? "").split(" ").filter(Boolean).map(f).filter((L) => !!L);
11115
- !I.length || !I.some((L) => {
11114
+ const O = (((Tm = _.businessObject.extensionElements) == null ? void 0 : Tm.values) ?? []).find((L) => L.$type === "bwl:Members"), N = ((O == null ? void 0 : O.refs) ?? "").split(" ").filter(Boolean).map(f).filter((L) => !!L);
11115
+ !N.length || !N.some((L) => {
11116
11116
  const D = h.get(L.id);
11117
11117
  return !D || D.x !== L.x || D.y !== L.y;
11118
- }) || !I.some((L) => L.x < _.x || L.y < _.y || L.x + L.width > _.x + _.width || L.y + L.height > _.y + _.height) || n.resizeShape(_, Ip(I, _.id));
11118
+ }) || !N.some((L) => L.x < _.x || L.y < _.y || L.x + L.width > _.x + _.width || L.y + L.height > _.y + _.height) || n.resizeShape(_, Ip(N, _.id));
11119
11119
  }
11120
11120
  }
11121
11121
  {
11122
- const _ = new Map(Fr(We(r)).map((L) => [L.owner, L.rect])), S = r.filter((L) => !!L.waypoints), O = /* @__PURE__ */ new Map(), I = (L, D) => {
11122
+ const _ = new Map(Fr(We(r)).map((L) => [L.owner, L.rect])), S = r.filter((L) => !!L.waypoints), O = /* @__PURE__ */ new Map(), N = (L, D) => {
11123
11123
  !L || !D || (O.has(L) || O.set(L, /* @__PURE__ */ new Set()), O.get(L).add(D));
11124
11124
  };
11125
11125
  for (const L of S) {
11126
11126
  const D = (km = L.source) == null ? void 0 : km.id, z = (Om = L.target) == null ? void 0 : Om.id;
11127
- I(D, z), ((Dm = L.type) != null && Dm.includes("DataOutputAssociation") || (Lm = L.type) != null && Lm.includes("DataInputAssociation") || L.type === "bpmn:Association") && I(z, D);
11127
+ N(D, z), ((Dm = L.type) != null && Dm.includes("DataOutputAssociation") || (Lm = L.type) != null && Lm.includes("DataInputAssociation") || L.type === "bpmn:Association") && N(z, D);
11128
11128
  }
11129
11129
  const T = (L) => F.filter((D) => D.flow.target === L).length, B = (L) => {
11130
11130
  var z;
@@ -11144,7 +11144,7 @@ function qA(e, t) {
11144
11144
  const z = (((Im = L.businessObject.extensionElements) == null ? void 0 : Im.values) ?? []).find((ue) => ue.$type === "bwl:Members"), j = ((z == null ? void 0 : z.refs) ?? "").split(" ").filter(Boolean);
11145
11145
  if (!j.length) continue;
11146
11146
  const X = j.map(f).filter((ue) => !!ue);
11147
- if (!X.length || !(N.some((ue) => ue.group.id === L.id) || Bt(e, "group.update").some((ue) => ue.id === L.id) || X.some((ue) => {
11147
+ if (!X.length || !(I.some((ue) => ue.group.id === L.id) || Bt(e, "group.update").some((ue) => ue.id === L.id) || X.some((ue) => {
11148
11148
  const Re = h.get(ue.id);
11149
11149
  return !Re || Re.x !== ue.x || Re.y !== ue.y;
11150
11150
  }))) continue;
@@ -11187,24 +11187,24 @@ function qA(e, t) {
11187
11187
  let as = 0;
11188
11188
  const am = 12, sm = 14, RS = 15, CS = 300, MS = (x) => {
11189
11189
  const _ = x.split(`
11190
- `), S = Math.max(..._.map((T) => $s(T, am))), O = Math.max(100, Math.min(CS, Math.ceil(S) + sm)), I = _.reduce((T, B) => T + Math.max(1, Math.ceil(($s(B, am) + sm) / O)), 0);
11191
- return { width: O, height: Math.max(30, I * RS + 10) };
11190
+ `), S = Math.max(..._.map((T) => $s(T, am))), O = Math.max(100, Math.min(CS, Math.ceil(S) + sm)), N = _.reduce((T, B) => T + Math.max(1, Math.ceil(($s(B, am) + sm) / O)), 0);
11191
+ return { width: O, height: Math.max(30, N * RS + 10) };
11192
11192
  };
11193
11193
  for (const x of A) {
11194
- const _ = x.association, S = ((Nm = x.placement) == null ? void 0 : Nm.anchor) ?? (_ ? _.source === x.annotation.id ? _.target : _.source : void 0), O = S ? f(S) : void 0, I = O ? rm(O) : void 0, T = MS(x.annotation.text ?? "");
11194
+ const _ = x.association, S = ((Nm = x.placement) == null ? void 0 : Nm.anchor) ?? (_ ? _.source === x.annotation.id ? _.target : _.source : void 0), O = S ? f(S) : void 0, N = O ? rm(O) : void 0, T = MS(x.annotation.text ?? "");
11195
11195
  let B;
11196
- if (I && x.placement) {
11196
+ if (N && x.placement) {
11197
11197
  const [j, X] = eu[x.placement.side], ne = x.placement.offset ?? 50;
11198
11198
  B = {
11199
- x: I.x + I.width / 2 + j * (I.width / 2 + T.width / 2 + ne),
11200
- y: I.y + I.height / 2 + X * (I.height / 2 + T.height / 2 + ne)
11199
+ x: N.x + N.width / 2 + j * (N.width / 2 + T.width / 2 + ne),
11200
+ y: N.y + N.height / 2 + X * (N.height / 2 + T.height / 2 + ne)
11201
11201
  };
11202
- } else I ? (B = {
11203
- x: I.x + I.width / 2 + 180 + as % 3 * 260,
11204
- y: I.y - 110 - as % 2 * 95
11202
+ } else N ? (B = {
11203
+ x: N.x + N.width / 2 + 180 + as % 3 * 260,
11204
+ y: N.y - 110 - as % 2 * 95
11205
11205
  }, as++) : (B = { x: 300 + as * 260, y: 60 }, as++);
11206
11206
  const L = O ? g(O) ?? p() : p(), D = L;
11207
- I && typeof D.x == "number" && typeof D.width == "number" && D.type === "bpmn:Participant" && (B = nu(r, I, T, D, x.placement ? { placement: x.placement } : { from: B }));
11207
+ N && typeof D.x == "number" && typeof D.width == "number" && D.type === "bpmn:Participant" && (B = nu(r, N, T, D, x.placement ? { placement: x.placement } : { from: B }));
11208
11208
  const z = n.createShape(
11209
11209
  {
11210
11210
  type: "bpmn:TextAnnotation",
@@ -11243,16 +11243,16 @@ function qA(e, t) {
11243
11243
  );
11244
11244
  }
11245
11245
  const AS = (x, _, S, O) => {
11246
- const I = x.parent;
11247
- if (!I) return O;
11246
+ const N = x.parent;
11247
+ if (!N) return O;
11248
11248
  const T = x.x + x.width / 2, B = /* @__PURE__ */ new Set([x.id]);
11249
- if (!C(I, x, T, O, B)) return O;
11249
+ if (!C(N, x, T, O, B)) return O;
11250
11250
  const L = _ ? _.y + Math.min(_.height / 2, le) : S ? S.y + U : void 0;
11251
11251
  if (L === void 0) return O;
11252
11252
  const D = Math.floor((O - L) / ge + 1e-6);
11253
11253
  for (let z = 1; z <= 3; z++) {
11254
11254
  const j = D + z, X = L + j * ge, ne = kg(_ == null ? void 0 : _.id, j);
11255
- if (!C(I, x, T, X, ne ? /* @__PURE__ */ new Set([...B, ...ne]) : B))
11255
+ if (!C(N, x, T, X, ne ? /* @__PURE__ */ new Set([...B, ...ne]) : B))
11256
11256
  return go(_ == null ? void 0 : _.id, j, S), X;
11257
11257
  }
11258
11258
  return O;
@@ -11260,7 +11260,7 @@ function qA(e, t) {
11260
11260
  for (const x of Bt(e, "node.update")) {
11261
11261
  let _ = d(x.id);
11262
11262
  if (x.type && qc(x.type) !== _.type) {
11263
- const S = _.x + _.width / 2, O = _.y + _.height / 2, I = cm();
11263
+ const S = _.x + _.width / 2, O = _.y + _.height / 2, N = cm();
11264
11264
  _ = c.replaceElement(
11265
11265
  _,
11266
11266
  {
@@ -11268,7 +11268,7 @@ function qA(e, t) {
11268
11268
  ...x.eventDefinition ? { eventDefinitionType: Cf[x.eventDefinition] } : {}
11269
11269
  }
11270
11270
  );
11271
- const T = cm(), B = [...I].filter((z) => z !== x.id && !T.has(z));
11271
+ const T = cm(), B = [...N].filter((z) => z !== x.id && !T.has(z));
11272
11272
  if (B.length)
11273
11273
  throw new Nw({
11274
11274
  kind: "type-change-drops-elements",
@@ -11285,13 +11285,13 @@ function qA(e, t) {
11285
11285
  }
11286
11286
  if (x.name !== void 0 && n.updateProperties(_, { name: x.name ?? void 0 }), x.lane || x.band !== void 0) {
11287
11287
  x.band !== void 0 && n.updateProperties(_, { "bwl:band": x.band });
11288
- const S = _.y + _.height / 2, O = g(_), I = x.lane ? d(x.lane) : ((O == null ? void 0 : O.children) ?? []).find(
11288
+ const S = _.y + _.height / 2, O = g(_), N = x.lane ? d(x.lane) : ((O == null ? void 0 : O.children) ?? []).find(
11289
11289
  (B) => B.type === "bpmn:Lane" && S >= B.y && S <= B.y + B.height
11290
11290
  );
11291
- x.band !== void 0 && go(I == null ? void 0 : I.id, x.band, O);
11292
- const T = I ? I.y + (x.band === void 0 ? I.height / 2 : Math.min(I.height / 2, le) + Nt(I.id, x.band) * ge) : x.band !== void 0 && O ? O.y + U + Nt(`pool:${O.id}`, x.band) * ge : void 0;
11291
+ x.band !== void 0 && go(N == null ? void 0 : N.id, x.band, O);
11292
+ const T = N ? N.y + (x.band === void 0 ? N.height / 2 : Math.min(N.height / 2, le) + Nt(N.id, x.band) * ge) : x.band !== void 0 && O ? O.y + U + Nt(`pool:${O.id}`, x.band) * ge : void 0;
11293
11293
  if (T !== void 0) {
11294
- const B = AS(_, I, O, T), L = B === T ? T - S : B - (_.y + _.height / 2);
11294
+ const B = AS(_, N, O, T), L = B === T ? T - S : B - (_.y + _.height / 2);
11295
11295
  L !== 0 && n.moveElements([_], { x: 0, y: L });
11296
11296
  }
11297
11297
  }
@@ -11299,11 +11299,11 @@ function qA(e, t) {
11299
11299
  for (const x of Bt(e, "sequenceFlow.update")) {
11300
11300
  const _ = d(x.id), S = k.get(x.id);
11301
11301
  if (S) {
11302
- const O = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 }), I = d(S.flow.source), T = d(S.flow.target), B = n.connect(I, T, { type: "bpmn:SequenceFlow", businessObject: kc(S.flow) }), L = Ap.get(x.id), D = T.y + T.height / 2;
11303
- L && T.x > L.exit.x && Math.abs(D - L.exit.y) > 1 ? n.updateWaypoints(B, [L.exit, { x: L.exit.x, y: D }, { x: T.x, y: D }]) : (n.reconnect(B, I, T, [O(I), O(T)]), Math.abs(D - (I.y + I.height / 2)) > 1 && Oc(B));
11302
+ const O = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 }), N = d(S.flow.source), T = d(S.flow.target), B = n.connect(N, T, { type: "bpmn:SequenceFlow", businessObject: kc(S.flow) }), L = Ap.get(x.id), D = T.y + T.height / 2;
11303
+ L && T.x > L.exit.x && Math.abs(D - L.exit.y) > 1 ? n.updateWaypoints(B, [L.exit, { x: L.exit.x, y: D }, { x: T.x, y: D }]) : (n.reconnect(B, N, T, [O(N), O(T)]), Math.abs(D - (N.y + N.height / 2)) > 1 && Oc(B));
11304
11304
  } else if ((x.source !== void 0 || x.target !== void 0) && !Lg.has(x.id)) {
11305
- const O = _, I = x.source !== void 0 ? d(x.source) : O.source, T = x.target !== void 0 ? d(x.target) : O.target, B = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 });
11306
- n.reconnect(O, I, T, [B(I), B(T)]);
11305
+ const O = _, N = x.source !== void 0 ? d(x.source) : O.source, T = x.target !== void 0 ? d(x.target) : O.target, B = (z) => ({ x: z.x + z.width / 2, y: z.y + z.height / 2 });
11306
+ n.reconnect(O, N, T, [B(N), B(T)]);
11307
11307
  const L = Ap.get(O.id), D = T.y + T.height / 2;
11308
11308
  if (L && T.x > L.exit.x && Math.abs(D - L.exit.y) > 1) {
11309
11309
  n.updateWaypoints(O, [L.exit, { x: L.exit.x, y: D }, { x: T.x, y: D }]);
@@ -11312,7 +11312,7 @@ function qA(e, t) {
11312
11312
  const X = Math.abs(L.label.y + z.height / 2 - L.channelY) <= ge / 5 && L.label.x + z.width > L.exit.x, ne = L.exit.x + 6, ce = T.x - 6 - z.width, ae = X ? ce >= ne ? { x: Math.max(ne, Math.min(L.label.x, ce)), y: L.label.y + (D - L.channelY) } : void 0 : L.label;
11313
11313
  ae && (ae.x !== z.x || ae.y !== z.y) && n.moveElements([z], { x: ae.x - z.x, y: ae.y - z.y });
11314
11314
  }
11315
- } else Math.abs(D - (I.y + I.height / 2)) > 1 && Oc(O);
11315
+ } else Math.abs(D - (N.y + N.height / 2)) > 1 && Oc(O);
11316
11316
  }
11317
11317
  x.name !== void 0 && n.updateProperties(_, { name: x.name ?? void 0 }), x.condition !== void 0 && n.updateProperties(_, { name: ((Bm = x.condition) == null ? void 0 : Bm.label) ?? void 0 });
11318
11318
  }
@@ -11325,10 +11325,10 @@ function qA(e, t) {
11325
11325
  if (x.text !== void 0 && n.updateProperties(_, { text: x.text }), x.placement === null)
11326
11326
  se(_, "bwl:Placement", null);
11327
11327
  else if (x.placement) {
11328
- const S = d(x.placement.anchor), O = rm(S), I = g(S) ?? p(), T = typeof I.x == "number" && typeof I.width == "number" && I.type === "bpmn:Participant", [B, L] = eu[x.placement.side], D = x.placement.offset ?? 50, z = {
11328
+ const S = d(x.placement.anchor), O = rm(S), N = g(S) ?? p(), T = typeof N.x == "number" && typeof N.width == "number" && N.type === "bpmn:Participant", [B, L] = eu[x.placement.side], D = x.placement.offset ?? 50, z = {
11329
11329
  x: O.x + O.width / 2 + B * (O.width / 2 + _.width / 2 + D),
11330
11330
  y: O.y + O.height / 2 + L * (O.height / 2 + _.height / 2 + D)
11331
- }, j = T ? nu(r, O, { width: _.width, height: _.height }, I, { placement: x.placement, selfId: x.id }) : z;
11331
+ }, j = T ? nu(r, O, { width: _.width, height: _.height }, N, { placement: x.placement, selfId: x.id }) : z;
11332
11332
  n.moveElements([_], { x: j.x - (_.x + _.width / 2), y: j.y - (_.y + _.height / 2) }), se(_, "bwl:Placement", ie(x.placement));
11333
11333
  }
11334
11334
  }
@@ -11404,18 +11404,18 @@ function KA(e, t, n) {
11404
11404
  (ve) => ve.type === "bpmn:Association"
11405
11405
  ), v = (w != null && w.anchor ? i.get(w.anchor) : void 0) ?? (y ? ((p = y.source) == null ? void 0 : p.id) === f ? y.target : y.source : void 0);
11406
11406
  if (!v) continue;
11407
- const b = v.waypoints, E = b != null && b.length ? { x: b[Math.floor((b.length - 1) / 2)].x, y: b[Math.floor((b.length - 1) / 2)].y, width: 0, height: 0 } : { x: v.x, y: v.y, width: v.width, height: v.height }, A = { width: d.width, height: d.height }, N = { x: d.x + d.width / 2, y: d.y + d.height / 2 }, P = w == null ? void 0 : w.side, k = Lw(i, E, h), H = [];
11408
- if (P && P in eu && H.push(nu(i, E, A, h, { placement: { side: P, offset: (w == null ? void 0 : w.offset) ?? null }, selfId: f })), k && !tu(N, A, k))
11407
+ const b = v.waypoints, E = b != null && b.length ? { x: b[Math.floor((b.length - 1) / 2)].x, y: b[Math.floor((b.length - 1) / 2)].y, width: 0, height: 0 } : { x: v.x, y: v.y, width: v.width, height: v.height }, A = { width: d.width, height: d.height }, I = { x: d.x + d.width / 2, y: d.y + d.height / 2 }, P = w == null ? void 0 : w.side, k = Lw(i, E, h), H = [];
11408
+ if (P && P in eu && H.push(nu(i, E, A, h, { placement: { side: P, offset: (w == null ? void 0 : w.offset) ?? null }, selfId: f })), k && !tu(I, A, k))
11409
11409
  for (const ve of WA)
11410
11410
  H.push(nu(i, E, A, h, { placement: { side: ve, offset: null }, selfId: f }));
11411
11411
  for (const [ve, fe] of [[-1, 0], [1, 0], [0, -1], [0, 1]])
11412
11412
  for (let ge = 1; ge <= VA; ge++)
11413
- H.push({ x: N.x + ve * gy * ge, y: N.y + fe * gy * ge });
11413
+ H.push({ x: I.x + ve * gy * ge, y: I.y + fe * gy * ge });
11414
11414
  const F = { ...s, edges: s.edges.filter((ve) => ve.id !== (y == null ? void 0 : y.id)) }, G = r(F), ee = G.filter((ve) => Up(ve).includes(f)).length;
11415
11415
  if (!ee) continue;
11416
11416
  let se, ie = !1;
11417
11417
  for (const ve of H) {
11418
- const fe = ve.x - N.x, ge = ve.y - N.y;
11418
+ const fe = ve.x - I.x, ge = ve.y - I.y;
11419
11419
  if (!fe && !ge || ve.x - A.width / 2 < h.x || ve.x + A.width / 2 > h.x + h.width || ve.y - A.height / 2 < h.y || ve.y + A.height / 2 > h.y + h.height || k && !tu(ve, A, k)) continue;
11420
11420
  const _e = {
11421
11421
  ...F,
@@ -11428,7 +11428,7 @@ function KA(e, t, n) {
11428
11428
  break;
11429
11429
  }
11430
11430
  }
11431
- se && o.moveElements([d], { x: se.x - N.x, y: se.y - N.y });
11431
+ se && o.moveElements([d], { x: se.x - I.x, y: se.y - I.y });
11432
11432
  }
11433
11433
  }
11434
11434
  const XA = 60;
@@ -11447,21 +11447,21 @@ function ZA(e, t, n) {
11447
11447
  if (!s.get(w)) return [w];
11448
11448
  const v = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set([w]);
11449
11449
  for (let A = 0; A < 4; A++) {
11450
- let N = !1;
11450
+ let I = !1;
11451
11451
  for (const P of n.shapes)
11452
11452
  P.type !== "bpmn:Group" || v.has(P.id) || [...b].some((k) => {
11453
11453
  const H = s.get(k);
11454
11454
  return H && c(P, H);
11455
- }) && (v.add(P.id), N = !0);
11455
+ }) && (v.add(P.id), I = !0);
11456
11456
  for (const P of n.shapes)
11457
11457
  P.type !== "bpmn:Participant" || b.has(P.id) || [...v].some((k) => {
11458
11458
  const H = s.get(k);
11459
11459
  return H && c(H, P);
11460
- }) && (b.add(P.id), N = !0);
11461
- if (!N) break;
11460
+ }) && (b.add(P.id), I = !0);
11461
+ if (!I) break;
11462
11462
  }
11463
- const E = n.shapes.filter((A) => !A.parent && !b.has(A.id) && !v.has(A.id) && A.type !== "bpmn:Group" && A.type !== "bpmn:Participant").filter((A) => [...v].some((N) => {
11464
- const P = s.get(N);
11463
+ const E = n.shapes.filter((A) => !A.parent && !b.has(A.id) && !v.has(A.id) && A.type !== "bpmn:Group" && A.type !== "bpmn:Participant").filter((A) => [...v].some((I) => {
11464
+ const P = s.get(I);
11465
11465
  return P && c(P, A);
11466
11466
  })).map((A) => A.id);
11467
11467
  return [...b, ...v, ...E];
@@ -11489,8 +11489,8 @@ function ZA(e, t, n) {
11489
11489
  const A = E.movers.map((k) => i.get(k)).filter((k) => !!k && typeof k.x == "number");
11490
11490
  if (!A.length) break;
11491
11491
  o.moveElements(A, { x: E.dx, y: 0 }), d.push({ els: A, dx: E.dx });
11492
- const N = r(We(i)), P = a(N).length;
11493
- P < p && N.length <= f && (P < h || P === h && N.length < m || g === 0) && (g = d.length, h = P, m = N.length);
11492
+ const I = r(We(i)), P = a(I).length;
11493
+ P < p && I.length <= f && (P < h || P === h && I.length < m || g === 0) && (g = d.length, h = P, m = I.length);
11494
11494
  }
11495
11495
  for (const { els: w, dx: y } of d.slice(g).reverse()) o.moveElements(w, { x: -y, y: 0 });
11496
11496
  }
@@ -11618,8 +11618,8 @@ function nP(e, t, n, i) {
11618
11618
  if (!(!m || Math.abs(m.x - h.x) >= 0.5 || Math.abs(m.y - h.y) >= 0.5 || Math.abs(m.width - h.width) >= 0.5 || Math.abs(m.height - h.height) >= 0.5)) continue;
11619
11619
  const y = h.members.map((Fe) => o.get(Fe)).filter((Fe) => !!Fe && typeof Fe.x == "number");
11620
11620
  if (!y.length) continue;
11621
- const v = Math.min(...y.map((Fe) => Fe.x)), b = Math.min(...y.map((Fe) => Fe.y)), E = Math.max(...y.map((Fe) => Fe.x + Fe.width)), A = Math.max(...y.map((Fe) => Fe.y + Fe.height)), N = h.x, P = h.y, k = h.x + h.width, H = h.y + h.height;
11622
- let F = N, G = P, ee = k, se = H;
11621
+ const v = Math.min(...y.map((Fe) => Fe.x)), b = Math.min(...y.map((Fe) => Fe.y)), E = Math.max(...y.map((Fe) => Fe.x + Fe.width)), A = Math.max(...y.map((Fe) => Fe.y + Fe.height)), I = h.x, P = h.y, k = h.x + h.width, H = h.y + h.height;
11622
+ let F = I, G = P, ee = k, se = H;
11623
11623
  for (const Fe of g) {
11624
11624
  const $ = s.edges.find((R) => R.id === Fe.edge);
11625
11625
  if (!$) continue;
@@ -11627,14 +11627,14 @@ function nP(e, t, n, i) {
11627
11627
  const W = s.shapes.find((Te) => Te.id === R);
11628
11628
  if (!W || W.container) return !1;
11629
11629
  const q = W.x + W.width / 2, pe = W.y + W.height / 2;
11630
- return N < q && q < k && P < pe && pe < H;
11630
+ return I < q && q < k && P < pe && pe < H;
11631
11631
  });
11632
11632
  for (const R of xn($)) {
11633
- const W = R.axis === "v" ? [P, H] : [N, k];
11634
- Math.min(R.hi, W[1]) - Math.max(R.lo, W[0]) < _w || (R.axis === "v" ? N < R.at && R.at < k : P < R.at && R.at < H) && C || (R.axis === "v" ? (Math.abs(R.at - N) <= Cs && (F = Math.max(F, R.at + Yc)), Math.abs(R.at - k) <= Cs && (ee = Math.min(ee, R.at - Yc))) : (Math.abs(R.at - P) <= Cs && (G = Math.max(G, R.at + Yc)), Math.abs(R.at - H) <= Cs && (se = Math.min(se, R.at - Yc))));
11633
+ const W = R.axis === "v" ? [P, H] : [I, k];
11634
+ Math.min(R.hi, W[1]) - Math.max(R.lo, W[0]) < _w || (R.axis === "v" ? I < R.at && R.at < k : P < R.at && R.at < H) && C || (R.axis === "v" ? (Math.abs(R.at - I) <= Cs && (F = Math.max(F, R.at + Yc)), Math.abs(R.at - k) <= Cs && (ee = Math.min(ee, R.at - Yc))) : (Math.abs(R.at - P) <= Cs && (G = Math.max(G, R.at + Yc)), Math.abs(R.at - H) <= Cs && (se = Math.min(se, R.at - Yc))));
11635
11635
  }
11636
11636
  }
11637
- if (F > v - Kc && (F = N), G > b - Kc && (G = P), ee < E + Kc && (ee = k), se < A + Kc && (se = H), F === N && G === P && ee === k && se === H) continue;
11637
+ if (F > v - Kc && (F = I), G > b - Kc && (G = P), ee < E + Kc && (ee = k), se < A + Kc && (se = H), F === I && G === P && ee === k && se === H) continue;
11638
11638
  const ie = o.get(d), ve = { x: ie.x, y: ie.y, width: ie.width, height: ie.height }, fe = We(o), ge = new Set(pt(fe).map(ft)), _e = a(fe);
11639
11639
  r.resizeShape(ie, { x: F, y: G, width: ee - F, height: se - G });
11640
11640
  let U = We(o), le = pt(U).filter((Fe) => !ge.has(ft(Fe)));
@@ -11704,7 +11704,7 @@ function oP(e, t, n = {}) {
11704
11704
  const ge = (_e = r.elementRegistry.get(fe.id)) == null ? void 0 : _e.waypoints;
11705
11705
  return ge ? !(ge.length === fe.waypoints.length && fe.waypoints.every((U, le) => Math.round(U.x) === Math.round(ge[le].x) && Math.round(U.y) === Math.round(ge[le].y))) : !1;
11706
11706
  }).map((fe) => fe.id)
11707
- ), y = (fe, ge) => new Set([...fe].filter((_e) => !ge.has(_e))), v = new Set(p.shapes.map((fe) => fe.id)), b = er(p), E = b.length, A = new Set(b.map(([fe, ge]) => `${fe}|${ge}`)), N = to(p), P = new Set(N.map(([fe, ge]) => `${fe}|${ge}`)), k = /* @__PURE__ */ new Map();
11707
+ ), y = (fe, ge) => new Set([...fe].filter((_e) => !ge.has(_e))), v = new Set(p.shapes.map((fe) => fe.id)), b = er(p), E = b.length, A = new Set(b.map(([fe, ge]) => `${fe}|${ge}`)), I = to(p), P = new Set(I.map(([fe, ge]) => `${fe}|${ge}`)), k = /* @__PURE__ */ new Map();
11708
11708
  for (const fe of r.elementRegistry.filter(
11709
11709
  (ge) => "waypoints" in ge && !!ge.waypoints
11710
11710
  ))
@@ -11759,7 +11759,7 @@ function oP(e, t, n = {}) {
11759
11759
  crossPoolMessages: ee.crossPoolMessages
11760
11760
  },
11761
11761
  sharedEndpointCrossings: {
11762
- before: N.length,
11762
+ before: I.length,
11763
11763
  after: se.length,
11764
11764
  pairs: se
11765
11765
  }
@@ -11794,7 +11794,7 @@ function sP(e, t = {}) {
11794
11794
  n.filter((U) => U.$type === "bpmn:Process").map((U) => [U.id, U])
11795
11795
  ), r = [], a = [], s = [], c = [], l = [], u = [], p = { poolOrders: {}, bands: {}, placements: {}, afterColumns: {} }, f = [], d = [], g = [], h = [], m = [], w = [], y = [], v = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), A = (U) => {
11796
11796
  U && b.add(U);
11797
- }, N = (U) => {
11797
+ }, I = (U) => {
11798
11798
  b.add(U), E.add(U);
11799
11799
  }, P = (U) => {
11800
11800
  const le = yy(U, "bwl:Placement");
@@ -11811,7 +11811,7 @@ function sP(e, t = {}) {
11811
11811
  for (const K of U)
11812
11812
  switch (A(K.id), K.$type) {
11813
11813
  case "bpmn:TextAnnotation":
11814
- N(K.id), v.set(K.id, K), c.push({ id: K.id, text: typeof K.text == "string" ? K.text : "" }), P(K);
11814
+ I(K.id), v.set(K.id, K), c.push({ id: K.id, text: typeof K.text == "string" ? K.text : "" }), P(K);
11815
11815
  break;
11816
11816
  case "bpmn:Association":
11817
11817
  g.push({
@@ -11822,7 +11822,7 @@ function sP(e, t = {}) {
11822
11822
  });
11823
11823
  break;
11824
11824
  case "bpmn:Group": {
11825
- N(K.id), v.set(K.id, K);
11825
+ I(K.id), v.set(K.id, K);
11826
11826
  const Q = (le = K.categoryValueRef) == null ? void 0 : le.value;
11827
11827
  l.push({ id: K.id, ...typeof Q == "string" && Q ? { name: Q } : {} }), k(K);
11828
11828
  break;
@@ -11855,7 +11855,7 @@ function sP(e, t = {}) {
11855
11855
  continue;
11856
11856
  }
11857
11857
  if (Ee.$type === "bpmn:DataStoreReference") {
11858
- N(Ee.id), s.push({ id: Ee.id, ...Ee.name ? { name: Ee.name } : {} });
11858
+ I(Ee.id), s.push({ id: Ee.id, ...Ee.name ? { name: Ee.name } : {} });
11859
11859
  continue;
11860
11860
  }
11861
11861
  const Fe = rP(Ee.$type), $ = Fe === "intermediateCatchEvent" ? Wb((Ee.eventDefinitions ?? []).map((q) => q.$type)) : void 0;
@@ -11863,7 +11863,7 @@ function sP(e, t = {}) {
11863
11863
  u.push({ id: Ee.id, type: Ee.$type, reason: "type-outside-mvp" });
11864
11864
  continue;
11865
11865
  }
11866
- N(Ee.id);
11866
+ I(Ee.id);
11867
11867
  const C = Fe === "boundaryEvent" ? Hi(Ee.attachedToRef) : void 0;
11868
11868
  a.push({
11869
11869
  id: Ee.id,
@@ -11899,11 +11899,11 @@ function sP(e, t = {}) {
11899
11899
  if (i) {
11900
11900
  const U = /* @__PURE__ */ new Set();
11901
11901
  for (const le of i.participants ?? []) {
11902
- N(le.id), v.set(le.id, le);
11902
+ I(le.id), v.set(le.id, le);
11903
11903
  const K = Hi(le.processRef);
11904
11904
  K && U.add(K);
11905
11905
  const Q = K ? o.get(K) : void 0, de = ((Q == null ? void 0 : Q.laneSets) ?? []).flatMap((C) => C.lanes ?? []), Ee = de.map((C) => ({ id: C.id, ...C.name ? { name: C.name } : {} }));
11906
- for (const C of Ee) N(C.id);
11906
+ for (const C of Ee) I(C.id);
11907
11907
  const Fe = !Q || (Q.flowElements ?? []).length === 0 && de.length === 0 && (Q.artifacts ?? []).length === 0;
11908
11908
  r.push({
11909
11909
  id: le.id,
@@ -13108,7 +13108,7 @@ function Zw(e, t) {
13108
13108
  v = Tl(v.slice());
13109
13109
  else
13110
13110
  throw s(`Cannot invoke "${v}". Expected a function!`);
13111
- const A = (v.$inject || aT(v)).map((N) => Jp(b, N) ? b[N] : c(N));
13111
+ const A = (v.$inject || aT(v)).map((I) => Jp(b, I) ? b[I] : c(I));
13112
13112
  return {
13113
13113
  fn: v,
13114
13114
  dependencies: A
@@ -13124,19 +13124,19 @@ function Zw(e, t) {
13124
13124
  function p(v, b, E) {
13125
13125
  const {
13126
13126
  fn: A,
13127
- dependencies: N
13127
+ dependencies: I
13128
13128
  } = l(v, E);
13129
- return A.apply(b, N);
13129
+ return A.apply(b, I);
13130
13130
  }
13131
13131
  function f(v) {
13132
13132
  return Tl((b) => v.get(b));
13133
13133
  }
13134
13134
  function d(v, b) {
13135
13135
  if (b && b.length) {
13136
- const E = /* @__PURE__ */ Object.create(null), A = /* @__PURE__ */ Object.create(null), N = [], P = [], k = [];
13136
+ const E = /* @__PURE__ */ Object.create(null), A = /* @__PURE__ */ Object.create(null), I = [], P = [], k = [];
13137
13137
  let H, F, G, ee;
13138
13138
  for (let se in o)
13139
- H = o[se], b.indexOf(se) !== -1 && (H[2] === "private" ? (F = N.indexOf(H[3]), F === -1 ? (G = H[3].createChild([], b), ee = f(G), N.push(H[3]), P.push(G), k.push(ee), E[se] = [ee, se, "private", G]) : E[se] = [k[F], se, "private", P[F]]) : E[se] = [H[2], H[1]], A[se] = !0), (H[2] === "factory" || H[2] === "type") && H[1].$scope && b.forEach((ie) => {
13139
+ H = o[se], b.indexOf(se) !== -1 && (H[2] === "private" ? (F = I.indexOf(H[3]), F === -1 ? (G = H[3].createChild([], b), ee = f(G), I.push(H[3]), P.push(G), k.push(ee), E[se] = [ee, se, "private", G]) : E[se] = [k[F], se, "private", P[F]]) : E[se] = [H[2], H[1]], A[se] = !0), (H[2] === "factory" || H[2] === "type") && H[1].$scope && b.forEach((ie) => {
13140
13140
  H[1].$scope.indexOf(ie) !== -1 && (E[se] = [H[2], H[1]], A[ie] = !0);
13141
13141
  });
13142
13142
  b.forEach((se) => {
@@ -13164,7 +13164,7 @@ function Zw(e, t) {
13164
13164
  function m(v) {
13165
13165
  const b = v.__exports__;
13166
13166
  if (b) {
13167
- const E = v.__modules__, A = Object.keys(v).reduce((F, G) => (G !== "__exports__" && G !== "__modules__" && G !== "__init__" && G !== "__depends__" && (F[G] = v[G]), F), /* @__PURE__ */ Object.create(null)), N = (E || []).concat(A), P = d(N), k = Tl(function(F) {
13167
+ const E = v.__modules__, A = Object.keys(v).reduce((F, G) => (G !== "__exports__" && G !== "__modules__" && G !== "__init__" && G !== "__depends__" && (F[G] = v[G]), F), /* @__PURE__ */ Object.create(null)), I = (E || []).concat(A), P = d(I), k = Tl(function(F) {
13168
13168
  return P.get(F);
13169
13169
  });
13170
13170
  b.forEach(function(F) {
@@ -13188,8 +13188,8 @@ function Zw(e, t) {
13188
13188
  o[E] = A;
13189
13189
  return;
13190
13190
  }
13191
- const N = A[0], P = A[1];
13192
- o[E] = [g[N], sT(N, P), N];
13191
+ const I = A[0], P = A[1];
13192
+ o[E] = [g[I], sT(I, P), I];
13193
13193
  }), h(v, a);
13194
13194
  }
13195
13195
  function w(v, b) {
@@ -13623,11 +13623,11 @@ function TT(e, t, n) {
13623
13623
  h = Ly(...t, d / c), u[d] = { x: h.x, y: h.y, t: d / c };
13624
13624
  for (d = 0; d < s; d++)
13625
13625
  for (g = 0; g < c; g++) {
13626
- var m = l[d], w = l[d + 1], y = u[g], v = u[g + 1], b = Xo(w.x - m.x) < 0.01 ? "y" : "x", E = Xo(v.x - y.x) < 0.01 ? "y" : "x", A = PT(m.x, m.y, w.x, w.y, y.x, y.y, v.x, v.y), N;
13626
+ var m = l[d], w = l[d + 1], y = u[g], v = u[g + 1], b = Xo(w.x - m.x) < 0.01 ? "y" : "x", E = Xo(v.x - y.x) < 0.01 ? "y" : "x", A = PT(m.x, m.y, w.x, w.y, y.x, y.y, v.x, v.y), I;
13627
13627
  if (A) {
13628
- if (N = A.x.toFixed(9) + "#" + A.y.toFixed(9), p[N])
13628
+ if (I = A.x.toFixed(9) + "#" + A.y.toFixed(9), p[I])
13629
13629
  continue;
13630
- p[N] = !0;
13630
+ p[I] = !0;
13631
13631
  var P = m.t + Xo((A[b] - m[b]) / (w[b] - m[b])) * (w.t - m.t), k = y.t + Xo((A[E] - y[E]) / (v[E] - y[E])) * (v.t - y.t);
13632
13632
  P >= 0 && P <= 1 && k >= 0 && k <= 1 && f.push({
13633
13633
  x: A.x,
@@ -13742,21 +13742,21 @@ function t_(e, t, n, i, o, r, a, s, c, l) {
13742
13742
  return { x: W, y: q };
13743
13743
  });
13744
13744
  if (l)
13745
- N = l[0], P = l[1], E = l[2], A = l[3];
13745
+ I = l[0], P = l[1], E = l[2], A = l[3];
13746
13746
  else {
13747
13747
  d = g(e, t, -p), e = d.x, t = d.y, d = g(s, c, -p), s = d.x, c = d.y;
13748
13748
  var h = (e - s) / 2, m = (t - c) / 2, w = h * h / (n * n) + m * m / (i * i);
13749
13749
  w > 1 && (w = rn.sqrt(w), n = w * n, i = w * i);
13750
- var y = n * n, v = i * i, b = (r == a ? -1 : 1) * rn.sqrt(Xo((y * v - y * m * m - v * h * h) / (y * m * m + v * h * h))), E = b * n * m / i + (e + s) / 2, A = b * -i * h / n + (t + c) / 2, N = rn.asin(((t - A) / i).toFixed(9)), P = rn.asin(((c - A) / i).toFixed(9));
13751
- N = e < E ? Go - N : N, P = s < E ? Go - P : P, N < 0 && (N = Go * 2 + N), P < 0 && (P = Go * 2 + P), a && N > P && (N = N - Go * 2), !a && P > N && (P = P - Go * 2);
13750
+ var y = n * n, v = i * i, b = (r == a ? -1 : 1) * rn.sqrt(Xo((y * v - y * m * m - v * h * h) / (y * m * m + v * h * h))), E = b * n * m / i + (e + s) / 2, A = b * -i * h / n + (t + c) / 2, I = rn.asin(((t - A) / i).toFixed(9)), P = rn.asin(((c - A) / i).toFixed(9));
13751
+ I = e < E ? Go - I : I, P = s < E ? Go - P : P, I < 0 && (I = Go * 2 + I), P < 0 && (P = Go * 2 + P), a && I > P && (I = I - Go * 2), !a && P > I && (P = P - Go * 2);
13752
13752
  }
13753
- var k = P - N;
13753
+ var k = P - I;
13754
13754
  if (Xo(k) > u) {
13755
13755
  var H = P, F = s, G = c;
13756
- P = N + u * (a && P > N ? 1 : -1), s = E + n * rn.cos(P), c = A + i * rn.sin(P), f = t_(s, c, n, i, o, 0, a, F, G, [P, H, E, A]);
13756
+ P = I + u * (a && P > I ? 1 : -1), s = E + n * rn.cos(P), c = A + i * rn.sin(P), f = t_(s, c, n, i, o, 0, a, F, G, [P, H, E, A]);
13757
13757
  }
13758
- k = P - N;
13759
- var ee = rn.cos(N), se = rn.sin(N), ie = rn.cos(P), ve = rn.sin(P), fe = rn.tan(k / 4), ge = 4 / 3 * n * fe, _e = 4 / 3 * i * fe, U = [e, t], le = [e + ge * se, t - _e * ee], K = [s + ge * ve, c - _e * ie], Q = [s, c];
13758
+ k = P - I;
13759
+ var ee = rn.cos(I), se = rn.sin(I), ie = rn.cos(P), ve = rn.sin(P), fe = rn.tan(k / 4), ge = 4 / 3 * n * fe, _e = 4 / 3 * i * fe, U = [e, t], le = [e + ge * se, t - _e * ee], K = [s + ge * ve, c - _e * ie], Q = [s, c];
13760
13760
  if (le[0] = 2 * U[0] - le[0], le[1] = 2 * U[1] - le[1], l)
13761
13761
  return [le, K, Q].concat(f);
13762
13762
  f = [le, K, Q].concat(f).join().split(",");
@@ -14947,14 +14947,14 @@ function a2(e) {
14947
14947
  function A(K, Q) {
14948
14948
  l(K, Q);
14949
14949
  }
14950
- function N(K, Q) {
14950
+ function I(K, Q) {
14951
14951
  l(K, Q);
14952
14952
  }
14953
14953
  function P(K, Q) {
14954
14954
  V(K, function(de) {
14955
14955
  Zn(de, "bpmn:Association") ? n.push(function() {
14956
- N(de, Q);
14957
- }) : N(de, Q);
14956
+ I(de, Q);
14957
+ }) : I(de, Q);
14958
14958
  });
14959
14959
  }
14960
14960
  function k(K, Q) {
@@ -15779,7 +15779,7 @@ function Kr(e, t, n, i, o, r, a) {
15779
15779
  function A($) {
15780
15780
  return Fe[$];
15781
15781
  }
15782
- function N($) {
15782
+ function I($) {
15783
15783
  return function(C, R, W) {
15784
15784
  return A($)(C, R, W);
15785
15785
  };
@@ -16466,7 +16466,7 @@ function Kr(e, t, n, i, o, r, a) {
16466
16466
  "stroke"
16467
16467
  ]), _e($, C, R);
16468
16468
  },
16469
- "bpmn:DataObjectReference": N("bpmn:DataObject"),
16469
+ "bpmn:DataObjectReference": I("bpmn:DataObject"),
16470
16470
  "bpmn:DataOutput": function($, C, R = {}) {
16471
16471
  R = gt(R, [
16472
16472
  "fill",
@@ -16645,8 +16645,8 @@ function Kr(e, t, n, i, o, r, a) {
16645
16645
  strokeWidth: 1.5
16646
16646
  }), W && k(C, $, R), q;
16647
16647
  },
16648
- "bpmn:IntermediateCatchEvent": N("bpmn:IntermediateEvent"),
16649
- "bpmn:IntermediateThrowEvent": N("bpmn:IntermediateEvent"),
16648
+ "bpmn:IntermediateCatchEvent": I("bpmn:IntermediateEvent"),
16649
+ "bpmn:IntermediateThrowEvent": I("bpmn:IntermediateEvent"),
16650
16650
  "bpmn:Lane": function($, C, R = {}) {
16651
16651
  return R = gt(R, [
16652
16652
  "fill",
@@ -21177,7 +21177,7 @@ function E0(e, t, n) {
21177
21177
  throw new Error("invalid hit type <" + k + ">");
21178
21178
  return De(P, H), P;
21179
21179
  }
21180
- function N(P, k) {
21180
+ function I(P, k) {
21181
21181
  et(P, k);
21182
21182
  }
21183
21183
  this.removeHits = function(P) {
@@ -21191,14 +21191,14 @@ function E0(e, t, n) {
21191
21191
  }));
21192
21192
  }, this.createWaypointsHit = function(P, k) {
21193
21193
  var H = tc(k);
21194
- return A(H, "stroke"), N(P, H), H;
21194
+ return A(H, "stroke"), I(P, H), H;
21195
21195
  }, this.createBoxHit = function(P, k, H) {
21196
21196
  H = Y({
21197
21197
  x: 0,
21198
21198
  y: 0
21199
21199
  }, H);
21200
21200
  var F = je("rect");
21201
- return A(F, k), De(F, H), N(P, F), F;
21201
+ return A(F, k), De(F, H), I(P, F), F;
21202
21202
  }, this.updateDefaultHit = function(P, k) {
21203
21203
  var H = Rt(".djs-hit", k);
21204
21204
  if (H)
@@ -21423,7 +21423,7 @@ function P0(e, t, n, i) {
21423
21423
  b.length && n.select(b);
21424
21424
  }
21425
21425
  function l(v, b) {
21426
- var E = r.payload, A = r.displacement, N = r.globalStart, P = Hr(v), k = Gi(P, N), H = r.localStart, F = a(P), G = Gi(F, H);
21426
+ var E = r.payload, A = r.displacement, I = r.globalStart, P = Hr(v), k = Gi(P, I), H = r.localStart, F = a(P), G = Gi(F, H);
21427
21427
  if (!r.active && (b || HD(k) > r.threshold)) {
21428
21428
  if (Y(E, {
21429
21429
  x: va(H.x + A.x),
@@ -21479,10 +21479,10 @@ function P0(e, t, n, i) {
21479
21479
  }
21480
21480
  function y(v, b, E, A) {
21481
21481
  r && m(!1), typeof b == "string" && (A = E, E = b, b = null), A = Y({}, o, A || {});
21482
- var N = A.data || {}, P, k, H, F, G;
21482
+ var I = A.data || {}, P, k, H, F, G;
21483
21483
  if (A.trapClick ? F = f : F = u, v ? (P = Va(v) || v, k = Hr(v), tf(v), P.type === "dragstart" && Or(P)) : (P = null, k = { x: 0, y: 0 }), H = a(k), b || (b = H), G = jD(P), r = Y({
21484
21484
  prefix: E,
21485
- data: N,
21485
+ data: I,
21486
21486
  payload: {},
21487
21487
  globalStart: k,
21488
21488
  displacement: Gi(b, H),
@@ -22673,10 +22673,10 @@ function mL(e, t, n, i, o) {
22673
22673
  return !kt(G) && !ot(G) && !u.has(G) && !p.has(G);
22674
22674
  }), w = st(g, function(G) {
22675
22675
  return !kt(G) && !ot(G) && u.has(G);
22676
- }), y, v, b, E = [], A = [], N, P, k, H;
22676
+ }), y, v, b, E = [], A = [], I, P, k, H;
22677
22677
  m.length && (v = Gv(Ve(ln(m))), y = i - h[qo[n]] + v[qo[n]], n === "n" ? s.bottom = l = Ke(l) ? Math.min(l, y) : y : n === "w" ? s.right = l = Ke(l) ? Math.min(l, y) : y : n === "s" ? s.top = c = Ke(c) ? Math.max(c, y) : y : n === "e" && (s.left = c = Ke(c) ? Math.max(c, y) : y)), w.length && (b = Gv(Ve(ln(w))), y = i - b[qo[ll[n]]] + h[qo[ll[n]]], n === "n" ? s.bottom = l = Ke(l) ? Math.min(l, y) : y : n === "w" ? s.right = l = Ke(l) ? Math.min(l, y) : y : n === "s" ? s.top = c = Ke(c) ? Math.max(c, y) : y : n === "e" && (s.left = c = Ke(c) ? Math.max(c, y) : y)), d && d.length && (d.forEach(function(G) {
22678
22678
  u.has(G) ? E.push(G) : A.push(G);
22679
- }), E.length && (N = Ve(ln(E.map(Xe))), P = h[qo[ll[n]]] - (N[qo[ll[n]]] - i)), A.length && (k = Ve(ln(A.map(Xe))), H = k[qo[n]] - (h[qo[n]] - i)), n === "n" ? (y = Math.min(P || 1 / 0, H || 1 / 0), s.bottom = l = Ke(l) ? Math.min(l, y) : y) : n === "w" ? (y = Math.min(P || 1 / 0, H || 1 / 0), s.right = l = Ke(l) ? Math.min(l, y) : y) : n === "s" ? (y = Math.max(P || -1 / 0, H || -1 / 0), s.top = c = Ke(c) ? Math.max(c, y) : y) : n === "e" && (y = Math.max(P || -1 / 0, H || -1 / 0), s.left = c = Ke(c) ? Math.max(c, y) : y));
22679
+ }), E.length && (I = Ve(ln(E.map(Xe))), P = h[qo[ll[n]]] - (I[qo[ll[n]]] - i)), A.length && (k = Ve(ln(A.map(Xe))), H = k[qo[n]] - (h[qo[n]] - i)), n === "n" ? (y = Math.min(P || 1 / 0, H || 1 / 0), s.bottom = l = Ke(l) ? Math.min(l, y) : y) : n === "w" ? (y = Math.min(P || 1 / 0, H || 1 / 0), s.right = l = Ke(l) ? Math.min(l, y) : y) : n === "s" ? (y = Math.max(P || -1 / 0, H || -1 / 0), s.top = c = Ke(c) ? Math.max(c, y) : y) : n === "e" && (y = Math.max(P || -1 / 0, H || -1 / 0), s.left = c = Ke(c) ? Math.max(c, y) : y));
22680
22680
  var F = o && o[f.id];
22681
22681
  F && (n === "n" ? (y = i + f[yo[t]] - F[yo[t]], s.bottom = l = Ke(l) ? Math.min(l, y) : y) : n === "w" ? (y = i + f[yo[t]] - F[yo[t]], s.right = l = Ke(l) ? Math.min(l, y) : y) : n === "s" ? (y = i - f[yo[t]] + F[yo[t]], s.top = c = Ke(c) ? Math.max(c, y) : y) : n === "e" && (y = i - f[yo[t]] + F[yo[t]], s.left = c = Ke(c) ? Math.max(c, y) : y));
22682
22682
  }), s;
@@ -22722,8 +22722,8 @@ function $0(e, t, n, i, o) {
22722
22722
  });
22723
22723
  var h = /* @__PURE__ */ new Set(), m = s.movingConnections = [];
22724
22724
  g.forEach(function(A) {
22725
- V(A.outgoing, function(N) {
22726
- h.has(N) || !kt(N) || !g.has(N.target) || (h.add(N), m.push(N));
22725
+ V(A.outgoing, function(I) {
22726
+ h.has(I) || !kt(I) || !g.has(I.target) || (h.add(I), m.push(I));
22727
22727
  });
22728
22728
  }), r(m, d), s.dragGroup = d;
22729
22729
  }
@@ -22732,9 +22732,9 @@ function $0(e, t, n, i, o) {
22732
22732
  De(w, i.cls("djs-frame-group", ["no-events"])), et(n.getActiveLayer(), w);
22733
22733
  var y = [];
22734
22734
  V(p, function(A) {
22735
- var N = o.addFrame(A, w), P = N.getBBox();
22735
+ var I = o.addFrame(A, w), P = I.getBBox();
22736
22736
  y.push({
22737
- element: N,
22737
+ element: I,
22738
22738
  initialBounds: P
22739
22739
  }), n.addMarker(A, Wv);
22740
22740
  }), s.frameGroup = w, s.frames = y;
@@ -22746,15 +22746,15 @@ function $0(e, t, n, i, o) {
22746
22746
  De(c, { d: v[l] });
22747
22747
  var b = { x: "y", y: "x" }, E = { x: a.dx, y: a.dy };
22748
22748
  E[b[s.axis]] = 0, Ln(s.dragGroup, E.x, E.y), V(s.frames, function(A) {
22749
- var N = A.element, P = A.initialBounds, k, H;
22750
- s.direction === "e" ? De(N, {
22749
+ var I = A.element, P = A.initialBounds, k, H;
22750
+ s.direction === "e" ? De(I, {
22751
22751
  width: pl(P.width + E.x, 5)
22752
- }) : (k = pl(P.width - E.x, 5), De(N, {
22752
+ }) : (k = pl(P.width - E.x, 5), De(I, {
22753
22753
  width: k,
22754
22754
  x: P.x + P.width - k
22755
- })), s.direction === "s" ? De(N, {
22755
+ })), s.direction === "s" ? De(I, {
22756
22756
  height: pl(P.height + E.y, 5)
22757
- }) : (H = pl(P.height - E.y, 5), De(N, {
22757
+ }) : (H = pl(P.height - E.y, 5), De(I, {
22758
22758
  height: H,
22759
22759
  y: P.y + P.height - H
22760
22760
  }));
@@ -24832,8 +24832,8 @@ bc.prototype._computeUpdates = function(e, t) {
24832
24832
  var b = cf(y), E = f.get(b) || [], A = Pa(
24833
24833
  E,
24834
24834
  y
24835
- ), N = Object.keys(A).length > 0;
24836
- N && (v = u(y));
24835
+ ), I = Object.keys(A).length > 0;
24836
+ I && (v = u(y));
24837
24837
  }
24838
24838
  s(y, v, !0);
24839
24839
  }), t.forEach(function(y) {
@@ -24846,19 +24846,19 @@ bc.prototype._computeUpdates = function(e, t) {
24846
24846
  var b = y.present;
24847
24847
  if (b) {
24848
24848
  var E = m.get(b.root) || [], A = Pa(E, v);
24849
- E.forEach(function(N) {
24850
- if (A[N.id]) {
24851
- var P = h.get(N);
24852
- P || (P = /* @__PURE__ */ new Set(), h.set(N, P)), P.add(b.categoryValue);
24849
+ E.forEach(function(I) {
24850
+ if (A[I.id]) {
24851
+ var P = h.get(I);
24852
+ P || (P = /* @__PURE__ */ new Set(), h.set(I, P)), P.add(b.categoryValue);
24853
24853
  }
24854
24854
  });
24855
24855
  }
24856
24856
  });
24857
24857
  var w = d.reduce(function(y, v) {
24858
- var b = o.get(v), E = b.get(ig), A = new Set(E), N = h.get(v) || /* @__PURE__ */ new Set(), P = Array.from(N).filter(function(H) {
24858
+ var b = o.get(v), E = b.get(ig), A = new Set(E), I = h.get(v) || /* @__PURE__ */ new Set(), P = Array.from(I).filter(function(H) {
24859
24859
  return !A.has(H);
24860
24860
  }), k = E.filter(function(H) {
24861
- return g.has(H) && !N.has(H);
24861
+ return g.has(H) && !I.has(H);
24862
24862
  });
24863
24863
  return (P.length || k.length) && y.push({
24864
24864
  businessObject: b,
@@ -27803,7 +27803,7 @@ function Rx(e) {
27803
27803
  };
27804
27804
  }
27805
27805
  function mg(e, t, n, i, o, r, a, s, c, l) {
27806
- var u, p, f, d, g, h, m, w, y, v, b, E, A, N, P, k, H = t.type;
27806
+ var u, p, f, d, g, h, m, w, y, v, b, E, A, I, P, k, H = t.type;
27807
27807
  if (t.constructor !== void 0) return null;
27808
27808
  128 & n.__u && (c = !!(32 & n.__u), r = [s = t.__e = n.__e]), (u = Yt.__b) && u(t);
27809
27809
  e: if (typeof H == "function") {
@@ -27821,10 +27821,10 @@ function mg(e, t, n, i, o, r, a, s, c, l) {
27821
27821
  f.componentDidUpdate(g, h, m);
27822
27822
  });
27823
27823
  }
27824
- if (f.context = E, f.props = y, f.__P = e, f.__e = !1, A = Yt.__r, N = 0, v) f.state = f.__s, f.__d = !1, A && A(t), u = f.render(f.props, f.state, f.context), hu.push.apply(f.__h, f._sb), f._sb = [];
27824
+ if (f.context = E, f.props = y, f.__P = e, f.__e = !1, A = Yt.__r, I = 0, v) f.state = f.__s, f.__d = !1, A && A(t), u = f.render(f.props, f.state, f.context), hu.push.apply(f.__h, f._sb), f._sb = [];
27825
27825
  else do
27826
27826
  f.__d = !1, A && A(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;
27827
- while (f.__d && ++N < 25);
27827
+ while (f.__d && ++I < 25);
27828
27828
  f.state = f.__s, f.getChildContext != null && (i = bo(bo({}, i), f.getChildContext())), v && !d && f.getSnapshotBeforeUpdate != null && (m = f.getSnapshotBeforeUpdate(g, h)), P = u != null && u.type === dp && u.key == null ? HE(u.props.children) : u, s = BE(e, fp(P) ? P : [P], t, n, i, o, r, a, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && a.push(f), w && (f.__E = f.__ = null);
27829
27829
  } catch (F) {
27830
27830
  if (a.length = p, t.__v = null, c || r != null) {
@@ -28381,16 +28381,16 @@ function mB(e) {
28381
28381
  w,
28382
28382
  { keys: ["label", "search", "description"] }
28383
28383
  ).map(({ item: Q }) => Q) : K.filter(({ rank: Q = 0 }) => Q >= 0) : K;
28384
- }, [E, v, b, w, p, h, f]), N = vo(() => v ? A.length ? [{ id: "default", entries: A }] : [] : bB(A), [A, v]), [P, k] = hf(A[0]), H = mu(null), F = mu(!1), G = vo(() => gB.next(), []), ee = `${G}-results`, se = P && YE(G, P);
28384
+ }, [E, v, b, w, p, h, f]), I = vo(() => v ? A.length ? [{ id: "default", entries: A }] : [] : bB(A), [A, v]), [P, k] = hf(A[0]), H = mu(null), F = mu(!1), G = vo(() => gB.next(), []), ee = `${G}-results`, se = P && YE(G, P);
28385
28385
  Gl(() => {
28386
28386
  const K = H.current;
28387
28387
  K && A.includes(K) ? k(K) : k(A[0]), H.current = null;
28388
28388
  }, [A]);
28389
28389
  const ie = xs((K) => {
28390
- const Q = vB(N);
28390
+ const Q = vB(I);
28391
28391
  let Ee = Q.indexOf(P) + K;
28392
28392
  Ee < 0 && (Ee = Q.length - 1), Ee >= Q.length && (Ee = 0), F.current = !0, k(Q[Ee]);
28393
- }, [N, P]), ve = xs((K) => {
28393
+ }, [I, P]), ve = xs((K) => {
28394
28394
  K > 0 && P && P.entries && (F.current = !0, m((Q) => [...Q, P])), K < 0 && h.length > 0 && (F.current = !0, H.current = h[h.length + K], m((Q) => Q.slice(0, K)));
28395
28395
  }, [P, h]), fe = xs((K, Q, de) => {
28396
28396
  if (!(!Q || Q.disabled))
@@ -28474,7 +28474,7 @@ function mB(e) {
28474
28474
  `}
28475
28475
 
28476
28476
  <${dB}
28477
- groupedEntries=${N}
28477
+ groupedEntries=${I}
28478
28478
  selectedEntry=${P}
28479
28479
  setSelectedEntry=${k}
28480
28480
  keyboardSelection=${F}
@@ -29288,22 +29288,22 @@ function $B(e, t) {
29288
29288
  }
29289
29289
  function i1(e, t, n, i, o) {
29290
29290
  function r(v, b, E) {
29291
- var A = v.index, N = v.point, P, k, H, F, G, ee;
29292
- return A <= 0 || v.bendpoint ? !1 : (P = b[A - 1], k = b[A], H = Vf(P, k), F = xo(P, k), G = Math.abs(N.x - H.x), ee = Math.abs(N.y - H.y), F && G <= E && ee <= E);
29291
+ var A = v.index, I = v.point, P, k, H, F, G, ee;
29292
+ return A <= 0 || v.bendpoint ? !1 : (P = b[A - 1], k = b[A], H = Vf(P, k), F = xo(P, k), G = Math.abs(I.x - H.x), ee = Math.abs(I.y - H.y), F && G <= E && ee <= E);
29293
29293
  }
29294
29294
  function a(v, b) {
29295
- var E = v.waypoints, A, N, P, k;
29295
+ var E = v.waypoints, A, I, P, k;
29296
29296
  return b.index <= 0 || b.bendpoint || (A = {
29297
29297
  start: E[b.index - 1],
29298
29298
  end: E[b.index]
29299
- }, N = xo(A.start, A.end), !N) ? null : (N === "h" ? P = A.end.x - A.start.x : P = A.end.y - A.start.y, k = dd(P) / 2, k);
29299
+ }, I = xo(A.start, A.end), !I) ? null : (I === "h" ? P = A.end.x - A.start.x : P = A.end.y - A.start.y, k = dd(P) / 2, k);
29300
29300
  }
29301
29301
  function s(v, b) {
29302
- var E = b.waypoints, A = pd(t, E, v), N;
29302
+ var E = b.waypoints, A = pd(t, E, v), I;
29303
29303
  if (A) {
29304
- N = a(b, A);
29304
+ I = a(b, A);
29305
29305
  var P;
29306
- if (r(A, E, N) ? P = o.start(v, b, A.index) : P = i.start(v, b, A.index, !A.bendpoint), P !== !1)
29306
+ if (r(A, E, I) ? P = o.start(v, b, A.index) : P = i.start(v, b, A.index, !A.bendpoint), P !== !1)
29307
29307
  return !0;
29308
29308
  }
29309
29309
  }
@@ -29324,13 +29324,13 @@ function i1(e, t, n, i, o) {
29324
29324
  }
29325
29325
  function p(v, b) {
29326
29326
  b.waypoints.forEach(function(E, A) {
29327
- var N = fd(v);
29328
- et(v, N), Ln(N, E.x, E.y);
29327
+ var I = fd(v);
29328
+ et(v, I), Ln(I, E.x, E.y);
29329
29329
  }), fd(v, "floating");
29330
29330
  }
29331
29331
  function f(v, b) {
29332
- for (var E = b.waypoints, A, N, P, k = 1; k < E.length; k++)
29333
- A = E[k - 1], N = E[k], xo(A, N) && (P = n1(v, A, N), De(P, { "data-segment-idx": k }), c(P, "mousemove", b));
29332
+ for (var E = b.waypoints, A, I, P, k = 1; k < E.length; k++)
29333
+ A = E[k - 1], I = E[k], xo(A, I) && (P = n1(v, A, I), De(P, { "data-segment-idx": k }), c(P, "mousemove", b));
29334
29334
  }
29335
29335
  function d(v) {
29336
29336
  V(Fs("." + e1, v), function(b) {
@@ -29355,7 +29355,7 @@ function i1(e, t, n, i, o) {
29355
29355
  E && (Ln(E, A.x, A.y), ut(E).add("positioned"));
29356
29356
  }
29357
29357
  function y(v, b, E) {
29358
- var A = u(b.index, v), N = E[b.index - 1], P = E[b.index], k = b.point, H = Vf(N, P), F = xo(N, P), G, ee;
29358
+ var A = u(b.index, v), I = E[b.index - 1], P = E[b.index], k = b.point, H = Vf(I, P), F = xo(I, P), G, ee;
29359
29359
  A && (G = FB(A), ee = {
29360
29360
  x: k.x - H.x,
29361
29361
  y: k.y - H.y
@@ -29373,11 +29373,11 @@ function i1(e, t, n, i, o) {
29373
29373
  var b = v.element, E;
29374
29374
  b.waypoints && (E = h(b), v.add ? ut(E).add(v.marker) : ut(E).remove(v.marker));
29375
29375
  }), e.on("element.mousemove", function(v) {
29376
- var b = v.element, E = b.waypoints, A, N;
29376
+ var b = v.element, E = b.waypoints, A, I;
29377
29377
  if (E) {
29378
- if (A = l(b, !0), N = pd(t, E, v.originalEvent), !N)
29378
+ if (A = l(b, !0), I = pd(t, E, v.originalEvent), !I)
29379
29379
  return;
29380
- w(A, N), N.bendpoint || y(A, N, E);
29380
+ w(A, I), I.bendpoint || y(A, I, E);
29381
29381
  }
29382
29382
  }), e.on("element.mousedown", function(v) {
29383
29383
  if (ur(v)) {
@@ -29569,9 +29569,9 @@ function Zx(e, t, n) {
29569
29569
  function a1(e, t, n, i, o, r) {
29570
29570
  var a = e.get("connectionDocking", !1);
29571
29571
  this.start = function(p, f, d) {
29572
- var g, h = n.getGraphics(f), m = d - 1, w = d, y = f.waypoints, v = y[m], b = y[w], E = pd(n, y, p), A, N, P;
29572
+ var g, h = n.getGraphics(f), m = d - 1, w = d, y = f.waypoints, v = y[m], b = y[w], E = pd(n, y, p), A, I, P;
29573
29573
  if (A = xo(v, b), !!A)
29574
- return N = A === "v" ? "x" : "y", m === 0 && (v = Zx(v, f.source, N)), w === y.length - 1 && (b = Zx(b, f.target, N)), E ? P = E.point : P = {
29574
+ return I = A === "v" ? "x" : "y", m === 0 && (v = Zx(v, f.source, I)), w === y.length - 1 && (b = Zx(b, f.target, I)), E ? P = E.point : P = {
29575
29575
  x: (v.x + b.x) / 2,
29576
29576
  y: (v.y + b.y) / 2
29577
29577
  }, g = {
@@ -29580,10 +29580,10 @@ function a1(e, t, n, i, o, r) {
29580
29580
  segmentEndIndex: w,
29581
29581
  segmentStart: v,
29582
29582
  segmentEnd: b,
29583
- axis: N,
29583
+ axis: I,
29584
29584
  dragPosition: P
29585
29585
  }, i.init(p, P, "connectionSegment.move", {
29586
- cursor: N === "x" ? "resize-ew" : "resize-ns",
29586
+ cursor: I === "x" ? "resize-ew" : "resize-ns",
29587
29587
  data: {
29588
29588
  connection: f,
29589
29589
  connectionGfx: h,
@@ -29617,10 +29617,10 @@ function a1(e, t, n, i, o, r) {
29617
29617
  var f = p.context, d = p.connection, g = n.getLayer("overlays");
29618
29618
  f.originalWaypoints = d.waypoints.slice(), f.draggerGfx = n1(g, f.segmentStart, f.segmentEnd), ut(f.draggerGfx).add("djs-dragging"), n.addMarker(d, Kx);
29619
29619
  }), t.on("connectionSegment.move.move", function(p) {
29620
- var f = p.context, d = f.connection, g = f.segmentStartIndex, h = f.segmentEndIndex, m = f.segmentStart, w = f.segmentEnd, y = f.axis, v = f.originalWaypoints.slice(), b = Xx(m, y, p["d" + y]), E = Xx(w, y, p["d" + y]), A = v.length, N = 0;
29620
+ var f = p.context, d = f.connection, g = f.segmentStartIndex, h = f.segmentEndIndex, m = f.segmentStart, w = f.segmentEnd, y = f.axis, v = f.originalWaypoints.slice(), b = Xx(m, y, p["d" + y]), E = Xx(w, y, p["d" + y]), A = v.length, I = 0;
29621
29621
  v[g] = b, v[h] = E;
29622
29622
  var P, k;
29623
- g < 2 && (P = In(d.source, b), g === 1 ? P === "intersect" && (v.shift(), v[0] = b, N--) : P !== "intersect" && (v.unshift(m), N++)), h > A - 3 && (k = In(d.target, E), h === A - 2 ? k === "intersect" && (v.pop(), v[v.length - 1] = E) : k !== "intersect" && v.push(w)), f.newWaypoints = d.waypoints = s(d, v), l(f, N, p), f.newSegmentStartIndex = g + N, c(p);
29623
+ g < 2 && (P = In(d.source, b), g === 1 ? P === "intersect" && (v.shift(), v[0] = b, I--) : P !== "intersect" && (v.unshift(m), I++)), h > A - 3 && (k = In(d.target, E), h === A - 2 ? k === "intersect" && (v.pop(), v[v.length - 1] = E) : k !== "intersect" && v.push(w)), f.newWaypoints = d.waypoints = s(d, v), l(f, I, p), f.newSegmentStartIndex = g + I, c(p);
29624
29624
  }), t.on("connectionSegment.move.hover", function(p) {
29625
29625
  p.context.hover = p.hover, n.addMarker(p.hover, Yx);
29626
29626
  }), t.on([
@@ -31463,14 +31463,14 @@ Ec.prototype.getContextPadEntries = function(e) {
31463
31463
  };
31464
31464
  }
31465
31465
  function h(v) {
31466
- var b = 5, E = t.getPad(v).html, A = E.getBoundingClientRect(), N = {
31466
+ var b = 5, E = t.getPad(v).html, A = E.getBoundingClientRect(), I = {
31467
31467
  x: A.left,
31468
31468
  y: A.bottom + b
31469
31469
  };
31470
- return N;
31470
+ return I;
31471
31471
  }
31472
31472
  function m(v, b, E, A) {
31473
- function N(H, F) {
31473
+ function I(H, F) {
31474
31474
  var G = i.createShape(Y({ type: v }, A));
31475
31475
  r.start(H, G, {
31476
31476
  source: F
@@ -31479,7 +31479,7 @@ Ec.prototype.getContextPadEntries = function(e) {
31479
31479
  var P = s ? function(H, F) {
31480
31480
  var G = i.createShape(Y({ type: v }, A));
31481
31481
  s.append(F, G);
31482
- } : N, k = s ? function(H, F) {
31482
+ } : I, k = s ? function(H, F) {
31483
31483
  return l.create(F, v, A), () => {
31484
31484
  l.cleanUp();
31485
31485
  };
@@ -31489,7 +31489,7 @@ Ec.prototype.getContextPadEntries = function(e) {
31489
31489
  className: b,
31490
31490
  title: E,
31491
31491
  action: {
31492
- dragstart: N,
31492
+ dragstart: I,
31493
31493
  click: P,
31494
31494
  hover: k
31495
31495
  }
@@ -32798,11 +32798,11 @@ Mc.prototype.getEditingBBox = function(e) {
32798
32798
  y: b.y,
32799
32799
  width: 0,
32800
32800
  height: 0
32801
- }), A = l, N = jr.width * a + 2 * y;
32801
+ }), A = l, I = jr.width * a + 2 * y;
32802
32802
  Y(r, {
32803
- width: N,
32803
+ width: I,
32804
32804
  height: A + 2 * y,
32805
- x: E.x - N / 2,
32805
+ x: E.x - I / 2,
32806
32806
  y: E.y - A / 2 - y
32807
32807
  }), Y(d, {
32808
32808
  fontSize: l + "px",