@focus.matters/diagrams 0.2.20 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INTEGRATION.md +40 -0
- package/LIFECYCLE.md +117 -0
- package/dist/diagrams.css +1 -1
- package/dist/index.es.js +934 -873
- package/dist/index.umd.js +6 -6
- package/dist/src/Diagrams/components/objects/useEdgeLabelMeasurement.d.ts +4 -0
- package/dist/src/Diagrams/custom/agent/edges/AgentEdge.d.ts +6 -6
- package/dist/src/Diagrams/custom/agent/nodes/AgentNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmn/edges/BPMNEdge.d.ts +6 -6
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNModelerExtension.d.ts +2 -2
- package/dist/src/Diagrams/custom/bpmn/nodes/DocumentNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmn/nodes/EventNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmn/nodes/GateNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmn/nodes/Lanes/index.d.ts +8 -8
- package/dist/src/Diagrams/custom/bpmn/nodes/TaskNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmn/nodes/TextAnnotationNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmn/nodes/UnknownBPMNNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNExecutionEdge.d.ts +6 -6
- package/dist/src/Diagrams/custom/bpmnExecution/BPMNExecutionExtension.d.ts +1 -1
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionBlackBoxPoolNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDataStoreNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDocumentAnnotationNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionDocumentNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionEventNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionGateNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionTaskNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionTextAnnotationNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/bpmnExecution/nodes/BPMNExecutionUnknownNode.d.ts +7 -7
- package/dist/src/Diagrams/custom/communication/CommunicationDiagram.d.ts +2 -2
- package/dist/src/Diagrams/custom/editable/EditableNode.d.ts +2 -2
- package/dist/src/Diagrams/custom/mr/edges/MRForeignKeyEdge.d.ts +6 -6
- package/dist/src/Diagrams/custom/mr/extensions/MRModelerExtension.d.ts +1 -1
- package/dist/src/Diagrams/custom/mr/nodes/MRTableNode.d.ts +7 -7
- package/dist/src/Diagrams/store/Diagram.d.ts +1 -1
- package/dist/src/index.d.ts +34 -0
- package/package.json +52 -50
- package/dist/DirectedPoint-DNhrnCXr.js.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ var Ec = (i, t, e) => t in i ? so(i, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var o = (i, t) => so(i, "name", { value: t, configurable: !0 });
|
|
4
4
|
var Nt = (i, t, e) => Ec(i, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
import { makeAutoObservable as ne, toJS as Ds, makeObservable as z, action as _, observable as E, runInAction as I, computed as F, intercept as kc } from "mobx";
|
|
6
|
-
import ce, { createContext as Sc, useContext as Mc, useRef as q, createElement as Qn, useState as
|
|
6
|
+
import ce, { createContext as Sc, useContext as Mc, useRef as q, createElement as Qn, useState as vt, useLayoutEffect as Si, useEffect as qt, isValidElement as Cc, cloneElement as Ac, useId as Ic, useMemo as jc, forwardRef as Ml, Children as Pc, useCallback as Cl } from "react";
|
|
7
7
|
import { observer as M } from "mobx-react-lite";
|
|
8
8
|
import "svg-path-bbox";
|
|
9
9
|
const ii = class ii {
|
|
@@ -44,7 +44,7 @@ function Tc() {
|
|
|
44
44
|
}
|
|
45
45
|
o(Tc, "requireJsxRuntime");
|
|
46
46
|
var d = Tc();
|
|
47
|
-
const
|
|
47
|
+
const xt = class xt {
|
|
48
48
|
_data = [];
|
|
49
49
|
constructor(t, e = !0) {
|
|
50
50
|
if (t || (t = [0, 0, 0, 0]), Array.isArray(t)) {
|
|
@@ -133,7 +133,7 @@ const ft = class ft {
|
|
|
133
133
|
return Ds([...this._data]);
|
|
134
134
|
}
|
|
135
135
|
get round() {
|
|
136
|
-
return new
|
|
136
|
+
return new xt([
|
|
137
137
|
Math.round(this.x),
|
|
138
138
|
Math.round(this.y),
|
|
139
139
|
Math.round(this.width),
|
|
@@ -151,7 +151,7 @@ const ft = class ft {
|
|
|
151
151
|
assign(t) {
|
|
152
152
|
if (t.length !== 4)
|
|
153
153
|
throw new Error("Invalid number of Dimensions");
|
|
154
|
-
const e = t instanceof
|
|
154
|
+
const e = t instanceof xt ? t : new xt(t);
|
|
155
155
|
return this.set(0, e.get(0)), this.set(1, e.get(1)), this.set(2, e.get(2)), this.set(3, e.get(3)), this;
|
|
156
156
|
}
|
|
157
157
|
assignCoordinates(t) {
|
|
@@ -176,7 +176,7 @@ const ft = class ft {
|
|
|
176
176
|
);
|
|
177
177
|
}
|
|
178
178
|
collides(t, e = !1) {
|
|
179
|
-
if (t instanceof
|
|
179
|
+
if (t instanceof xt) {
|
|
180
180
|
const n = this.x - (e ? 1 : 0), s = this.x + this.width + (e ? 1 : 0), r = this.y - (e ? 1 : 0), a = this.y + this.height + (e ? 1 : 0), l = t.x, c = t.x + t.width, h = t.y, u = t.y + t.height;
|
|
181
181
|
return !(s <= l || c <= n || a <= h || u <= r);
|
|
182
182
|
} else {
|
|
@@ -185,7 +185,7 @@ const ft = class ft {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
copy() {
|
|
188
|
-
return new
|
|
188
|
+
return new xt([this.x, this.y, this.width, this.height]);
|
|
189
189
|
}
|
|
190
190
|
divide(t) {
|
|
191
191
|
return this.set(0, this.get(0) / t), this.set(1, this.get(1) / t), this.set(2, this.get(2) / t), this.set(3, this.get(3) / t), this;
|
|
@@ -214,7 +214,7 @@ const ft = class ft {
|
|
|
214
214
|
substract(t) {
|
|
215
215
|
if (t.length !== 4)
|
|
216
216
|
throw new Error("Invalid number of Dimensions");
|
|
217
|
-
const e = t instanceof
|
|
217
|
+
const e = t instanceof xt ? t : new xt(t);
|
|
218
218
|
return this.set(0, this.get(0) - e.get(0)), this.set(1, this.get(1) - e.get(1)), this.set(2, this.get(2) - e.get(2)), this.set(3, this.get(3) - e.get(3)), this;
|
|
219
219
|
}
|
|
220
220
|
sum(t) {
|
|
@@ -223,7 +223,7 @@ const ft = class ft {
|
|
|
223
223
|
else {
|
|
224
224
|
if (t.length !== 4)
|
|
225
225
|
throw new Error("Invalid number of Dimensions");
|
|
226
|
-
const e = t instanceof
|
|
226
|
+
const e = t instanceof xt ? t : new xt(t);
|
|
227
227
|
this.set(0, this.get(0) + e.get(0)), this.set(1, this.get(1) + e.get(1)), this.set(2, this.get(2) + e.get(2)), this.set(3, this.get(3) + e.get(3));
|
|
228
228
|
}
|
|
229
229
|
return this;
|
|
@@ -235,8 +235,8 @@ const ft = class ft {
|
|
|
235
235
|
return this.set(0, this.get(0) + t.get(0)), this.set(1, this.get(1) + t.get(1)), this;
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
|
-
o(
|
|
239
|
-
let S =
|
|
238
|
+
o(xt, "Dimensions");
|
|
239
|
+
let S = xt;
|
|
240
240
|
const Ws = class Ws {
|
|
241
241
|
constructor(t) {
|
|
242
242
|
this.originalEvent = t;
|
|
@@ -360,7 +360,7 @@ let Zt = qs;
|
|
|
360
360
|
const Js = class Js extends Yt {
|
|
361
361
|
};
|
|
362
362
|
o(Js, "DMouseUpEvent");
|
|
363
|
-
let
|
|
363
|
+
let dt = Js;
|
|
364
364
|
const Qs = class Qs extends Yt {
|
|
365
365
|
};
|
|
366
366
|
o(Qs, "DMouseMoveEvent");
|
|
@@ -914,10 +914,10 @@ const Mr = class Mr extends me {
|
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
916
|
o(Mr, "DiagramExtension");
|
|
917
|
-
let
|
|
917
|
+
let H = Mr;
|
|
918
918
|
const zn = /* @__PURE__ */ new WeakMap();
|
|
919
919
|
let Oc = 0;
|
|
920
|
-
const
|
|
920
|
+
const bt = {
|
|
921
921
|
mark(i, t) {
|
|
922
922
|
const e = zn.get(i) ?? {};
|
|
923
923
|
e[t] === void 0 && (e[t] = Oc++, zn.set(i, e));
|
|
@@ -930,7 +930,7 @@ function lo(i, t) {
|
|
|
930
930
|
return !i || t.score < i.score ? t : i;
|
|
931
931
|
}
|
|
932
932
|
o(lo, "nearest");
|
|
933
|
-
const Cr = class Cr extends
|
|
933
|
+
const Cr = class Cr extends H {
|
|
934
934
|
gridSize = 25;
|
|
935
935
|
proposals = [];
|
|
936
936
|
/** Removes every transient equal-distance guide when the current drag finishes. */
|
|
@@ -942,7 +942,7 @@ const Cr = class Cr extends G {
|
|
|
942
942
|
z(this, {
|
|
943
943
|
clear: _,
|
|
944
944
|
proposals: E
|
|
945
|
-
}), this.diagram.onEvent(
|
|
945
|
+
}), this.diagram.onEvent(dt, () => this.clear()), this.diagram.onEvent(
|
|
946
946
|
jt,
|
|
947
947
|
(t) => this.balance(t),
|
|
948
948
|
this.diagram.priorities.Drag_Node_Distances_Balancer
|
|
@@ -956,10 +956,10 @@ const Cr = class Cr extends G {
|
|
|
956
956
|
if (l.cancelled) continue;
|
|
957
957
|
const c = l.get(), h = this.findNeighbors(c, e, n);
|
|
958
958
|
if (h.top && h.bottom) {
|
|
959
|
-
const u = -c.edgeDistanceY(h.top.box),
|
|
960
|
-
|
|
959
|
+
const u = -c.edgeDistanceY(h.top.box), g = c.edgeDistanceY(h.bottom.box), p = Math.abs(u - g);
|
|
960
|
+
p < this.gridSize && (r = lo(r, {
|
|
961
961
|
proposal: l,
|
|
962
|
-
score:
|
|
962
|
+
score: p,
|
|
963
963
|
target: (h.top.box.bottomMiddle.y + h.bottom.box.topMiddle.y) / 2 - c.height / 2,
|
|
964
964
|
guides: [
|
|
965
965
|
{
|
|
@@ -980,10 +980,10 @@ const Cr = class Cr extends G {
|
|
|
980
980
|
}));
|
|
981
981
|
}
|
|
982
982
|
if (h.left && h.right) {
|
|
983
|
-
const u = -c.edgeDistanceX(h.left.box),
|
|
984
|
-
|
|
983
|
+
const u = -c.edgeDistanceX(h.left.box), g = c.edgeDistanceX(h.right.box), p = Math.abs(g - u);
|
|
984
|
+
p < this.gridSize && (s = lo(s, {
|
|
985
985
|
proposal: l,
|
|
986
|
-
score:
|
|
986
|
+
score: p,
|
|
987
987
|
target: (h.right.box.leftMiddle.x + h.left.box.rightMiddle.x) / 2 - c.width / 2,
|
|
988
988
|
guides: [
|
|
989
989
|
{
|
|
@@ -1010,32 +1010,32 @@ const Cr = class Cr extends G {
|
|
|
1010
1010
|
}), this.applyCandidate(s, "x"), this.applyCandidate(r, "y");
|
|
1011
1011
|
}
|
|
1012
1012
|
findNeighbors(t, e, n) {
|
|
1013
|
-
let s = null, r = null, a = null, l = null, c = 1 / 0, h = 1 / 0, u = 1 / 0,
|
|
1014
|
-
for (const
|
|
1015
|
-
if (e.has(
|
|
1016
|
-
const m = t.edgeDistanceX(
|
|
1017
|
-
b === 0 && m < 0 && -m < u && (u = -m, a =
|
|
1013
|
+
let s = null, r = null, a = null, l = null, c = 1 / 0, h = 1 / 0, u = 1 / 0, g = 1 / 0;
|
|
1014
|
+
for (const p of this.diagram.nodes) {
|
|
1015
|
+
if (e.has(p.id)) continue;
|
|
1016
|
+
const m = t.edgeDistanceX(p.box), b = t.edgeDistanceY(p.box);
|
|
1017
|
+
b === 0 && m < 0 && -m < u && (u = -m, a = p), b === 0 && m > 0 && m < g && (g = m, l = p), m === 0 && b < 0 && -b < c && (c = -b, s = p), m === 0 && b > 0 && b < h && (h = b, r = p);
|
|
1018
1018
|
}
|
|
1019
1019
|
return {
|
|
1020
1020
|
top: c < n ? s : null,
|
|
1021
1021
|
bottom: h < n ? r : null,
|
|
1022
1022
|
left: u < n ? a : null,
|
|
1023
|
-
right:
|
|
1023
|
+
right: g < n ? l : null
|
|
1024
1024
|
};
|
|
1025
1025
|
}
|
|
1026
1026
|
applyCandidate(t, e) {
|
|
1027
1027
|
if (t) {
|
|
1028
1028
|
if (e === "x") {
|
|
1029
|
-
t.proposal.updateX(t.target),
|
|
1029
|
+
t.proposal.updateX(t.target), bt.mark(t.proposal, "x"), t.proposal.lockX();
|
|
1030
1030
|
return;
|
|
1031
1031
|
}
|
|
1032
|
-
t.proposal.updateY(t.target),
|
|
1032
|
+
t.proposal.updateY(t.target), bt.mark(t.proposal, "y"), t.proposal.lockY();
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
};
|
|
1036
1036
|
o(Cr, "DistancesBalancer");
|
|
1037
1037
|
let mi = Cr;
|
|
1038
|
-
const Ar = class Ar extends
|
|
1038
|
+
const Ar = class Ar extends H {
|
|
1039
1039
|
gridSize = 50;
|
|
1040
1040
|
init() {
|
|
1041
1041
|
z(this, {
|
|
@@ -1070,7 +1070,7 @@ const Ar = class Ar extends G {
|
|
|
1070
1070
|
};
|
|
1071
1071
|
o(Ar, "GridSnap");
|
|
1072
1072
|
let Y = Ar;
|
|
1073
|
-
const Ir = class Ir extends
|
|
1073
|
+
const Ir = class Ir extends H {
|
|
1074
1074
|
windowTime = 20;
|
|
1075
1075
|
maxSize = 50;
|
|
1076
1076
|
index = -1;
|
|
@@ -1153,14 +1153,14 @@ const Ir = class Ir extends G {
|
|
|
1153
1153
|
t.cancelled || this.window();
|
|
1154
1154
|
},
|
|
1155
1155
|
this.diagram.priorities.Change_History
|
|
1156
|
-
), this.diagram.onEvent(
|
|
1156
|
+
), this.diagram.onEvent(dt, () => {
|
|
1157
1157
|
this.draggingNodes && (this.draggingNodes = !1, this.window());
|
|
1158
1158
|
}), this.window();
|
|
1159
1159
|
}
|
|
1160
1160
|
};
|
|
1161
1161
|
o(Ir, "History");
|
|
1162
1162
|
let fi = Ir;
|
|
1163
|
-
const jr = class jr extends
|
|
1163
|
+
const jr = class jr extends H {
|
|
1164
1164
|
init() {
|
|
1165
1165
|
z(this, {
|
|
1166
1166
|
_enabled: E,
|
|
@@ -1219,7 +1219,7 @@ function Ut(i, t) {
|
|
|
1219
1219
|
return Number.isFinite(t.distance) && (!i || t.distance < i.distance) ? t : i;
|
|
1220
1220
|
}
|
|
1221
1221
|
o(Ut, "closer$1");
|
|
1222
|
-
const Pr = class Pr extends
|
|
1222
|
+
const Pr = class Pr extends H {
|
|
1223
1223
|
gridSize = 50;
|
|
1224
1224
|
horizontalSuggestionProviders = [];
|
|
1225
1225
|
verticalSuggestionProviders = [];
|
|
@@ -1247,7 +1247,7 @@ const Pr = class Pr extends G {
|
|
|
1247
1247
|
proposals: E
|
|
1248
1248
|
}), U(this, "keydown", (t) => {
|
|
1249
1249
|
t.ctrlKey && this.clear();
|
|
1250
|
-
}), this.diagram.onEvent(
|
|
1250
|
+
}), this.diagram.onEvent(dt, () => this.clear()), this.diagram.onEvent(
|
|
1251
1251
|
jt,
|
|
1252
1252
|
(t) => this.align(t),
|
|
1253
1253
|
this.diagram.priorities.Drag_Node_Aligner
|
|
@@ -1255,89 +1255,89 @@ const Pr = class Pr extends G {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
align(t) {
|
|
1257
1257
|
if (this.clear(), !this.enabled || t.proposals.length === 0) return;
|
|
1258
|
-
const e = this.diagram.canvas.frameDimensions.norm / 2, n = this.gridSize / 5 * 2, s = this.gridSize / 3, r = new Set(t.proposals.map(({ node:
|
|
1259
|
-
(
|
|
1258
|
+
const e = this.diagram.canvas.frameDimensions.norm / 2, n = this.gridSize / 5 * 2, s = this.gridSize / 3, r = new Set(t.proposals.map(({ node: g }) => g.id)), a = t.proposals.some(
|
|
1259
|
+
(g) => bt.get(g, "x") !== void 0
|
|
1260
1260
|
), l = t.proposals.some(
|
|
1261
|
-
(
|
|
1261
|
+
(g) => bt.get(g, "y") !== void 0
|
|
1262
1262
|
);
|
|
1263
1263
|
let c = null, h = null;
|
|
1264
|
-
for (const
|
|
1265
|
-
if (
|
|
1266
|
-
const
|
|
1264
|
+
for (const g of t.proposals) {
|
|
1265
|
+
if (g.cancelled) continue;
|
|
1266
|
+
const p = g.get();
|
|
1267
1267
|
for (const m of this.diagram.nodes) {
|
|
1268
1268
|
if (r.has(m.id)) continue;
|
|
1269
|
-
const b = Math.abs(
|
|
1269
|
+
const b = Math.abs(p.edgeDistanceX(m.box)), x = Math.abs(p.edgeDistanceY(m.box));
|
|
1270
1270
|
!l && b < e && (h = Ut(
|
|
1271
1271
|
h,
|
|
1272
1272
|
this.verticalCandidate(
|
|
1273
|
-
|
|
1274
|
-
Math.abs(m.box.middle.y -
|
|
1275
|
-
m.box.middle.y -
|
|
1273
|
+
g,
|
|
1274
|
+
Math.abs(m.box.middle.y - p.middle.y),
|
|
1275
|
+
m.box.middle.y - p.height / 2,
|
|
1276
1276
|
m.box.middle.y,
|
|
1277
|
-
be(m.box.rightMiddle.x,
|
|
1277
|
+
be(m.box.rightMiddle.x, p.x),
|
|
1278
1278
|
n
|
|
1279
1279
|
)
|
|
1280
1280
|
), h = Ut(
|
|
1281
1281
|
h,
|
|
1282
1282
|
this.verticalCandidate(
|
|
1283
|
-
|
|
1284
|
-
Math.abs(m.box.y -
|
|
1283
|
+
g,
|
|
1284
|
+
Math.abs(m.box.y - p.y),
|
|
1285
1285
|
m.box.y,
|
|
1286
1286
|
m.box.y,
|
|
1287
|
-
be(m.box.rightMiddle.x,
|
|
1287
|
+
be(m.box.rightMiddle.x, p.x),
|
|
1288
1288
|
n
|
|
1289
1289
|
)
|
|
1290
1290
|
), h = Ut(
|
|
1291
1291
|
h,
|
|
1292
1292
|
this.verticalCandidate(
|
|
1293
|
-
|
|
1294
|
-
Math.abs(m.box.bottomMiddle.y -
|
|
1295
|
-
m.box.bottomMiddle.y -
|
|
1293
|
+
g,
|
|
1294
|
+
Math.abs(m.box.bottomMiddle.y - p.bottomMiddle.y),
|
|
1295
|
+
m.box.bottomMiddle.y - p.height,
|
|
1296
1296
|
m.box.bottomMiddle.y,
|
|
1297
|
-
be(m.box.rightMiddle.x,
|
|
1297
|
+
be(m.box.rightMiddle.x, p.x),
|
|
1298
1298
|
n
|
|
1299
1299
|
)
|
|
1300
1300
|
)), !a && x < e && (c = Ut(
|
|
1301
1301
|
c,
|
|
1302
1302
|
this.horizontalCandidate(
|
|
1303
|
-
|
|
1304
|
-
Math.abs(m.box.x -
|
|
1303
|
+
g,
|
|
1304
|
+
Math.abs(m.box.x - p.x),
|
|
1305
1305
|
m.box.x,
|
|
1306
1306
|
m.box.x,
|
|
1307
|
-
be(m.box.bottomMiddle.y,
|
|
1307
|
+
be(m.box.bottomMiddle.y, p.y),
|
|
1308
1308
|
n
|
|
1309
1309
|
)
|
|
1310
1310
|
), c = Ut(
|
|
1311
1311
|
c,
|
|
1312
1312
|
this.horizontalCandidate(
|
|
1313
|
-
|
|
1314
|
-
Math.abs(m.box.middle.x -
|
|
1315
|
-
m.box.middle.x -
|
|
1313
|
+
g,
|
|
1314
|
+
Math.abs(m.box.middle.x - p.middle.x),
|
|
1315
|
+
m.box.middle.x - p.width / 2,
|
|
1316
1316
|
m.box.middle.x,
|
|
1317
|
-
be(m.box.bottomMiddle.y,
|
|
1317
|
+
be(m.box.bottomMiddle.y, p.y),
|
|
1318
1318
|
n
|
|
1319
1319
|
)
|
|
1320
1320
|
), c = Ut(
|
|
1321
1321
|
c,
|
|
1322
1322
|
this.horizontalCandidate(
|
|
1323
|
-
|
|
1324
|
-
Math.abs(m.box.rightMiddle.x -
|
|
1325
|
-
m.box.rightMiddle.x -
|
|
1323
|
+
g,
|
|
1324
|
+
Math.abs(m.box.rightMiddle.x - p.rightMiddle.x),
|
|
1325
|
+
m.box.rightMiddle.x - p.width,
|
|
1326
1326
|
m.box.rightMiddle.x,
|
|
1327
|
-
be(m.box.bottomMiddle.y,
|
|
1327
|
+
be(m.box.bottomMiddle.y, p.y),
|
|
1328
1328
|
n
|
|
1329
1329
|
)
|
|
1330
1330
|
));
|
|
1331
1331
|
}
|
|
1332
1332
|
if (!l)
|
|
1333
1333
|
for (const m of this.verticalSuggestionProviders.flatMap(
|
|
1334
|
-
(b) => b(
|
|
1334
|
+
(b) => b(g.node, p)
|
|
1335
1335
|
))
|
|
1336
1336
|
h = Ut(
|
|
1337
1337
|
h,
|
|
1338
1338
|
this.verticalCandidate(
|
|
1339
|
-
|
|
1340
|
-
Math.abs(m.nodeY -
|
|
1339
|
+
g,
|
|
1340
|
+
Math.abs(m.nodeY - p.y),
|
|
1341
1341
|
m.nodeY,
|
|
1342
1342
|
m.guideY,
|
|
1343
1343
|
m.range,
|
|
@@ -1346,13 +1346,13 @@ const Pr = class Pr extends G {
|
|
|
1346
1346
|
);
|
|
1347
1347
|
if (!a)
|
|
1348
1348
|
for (const m of this.horizontalSuggestionProviders.flatMap(
|
|
1349
|
-
(b) => b(
|
|
1349
|
+
(b) => b(g.node, p)
|
|
1350
1350
|
))
|
|
1351
1351
|
c = Ut(
|
|
1352
1352
|
c,
|
|
1353
1353
|
this.horizontalCandidate(
|
|
1354
|
-
|
|
1355
|
-
Math.abs(m.nodeX -
|
|
1354
|
+
g,
|
|
1355
|
+
Math.abs(m.nodeX - p.x),
|
|
1356
1356
|
m.nodeX,
|
|
1357
1357
|
m.guideX,
|
|
1358
1358
|
m.range,
|
|
@@ -1361,7 +1361,7 @@ const Pr = class Pr extends G {
|
|
|
1361
1361
|
);
|
|
1362
1362
|
}
|
|
1363
1363
|
const u = [c?.guide, h?.guide].filter(
|
|
1364
|
-
(
|
|
1364
|
+
(g) => !!g
|
|
1365
1365
|
);
|
|
1366
1366
|
I(() => {
|
|
1367
1367
|
this.proposals = u;
|
|
@@ -1397,10 +1397,10 @@ const Pr = class Pr extends G {
|
|
|
1397
1397
|
if (!(!t || t.distance >= n)) {
|
|
1398
1398
|
if (e === "x") {
|
|
1399
1399
|
if (t.proposal.updateX(t.target), Math.abs(t.proposal.get().x - t.target) > 1e-3) return;
|
|
1400
|
-
|
|
1400
|
+
bt.mark(t.proposal, "x"), t.proposal.lockX();
|
|
1401
1401
|
return;
|
|
1402
1402
|
}
|
|
1403
|
-
t.proposal.updateY(t.target), !(Math.abs(t.proposal.get().y - t.target) > 1e-3) && (
|
|
1403
|
+
t.proposal.updateY(t.target), !(Math.abs(t.proposal.get().y - t.target) > 1e-3) && (bt.mark(t.proposal, "y"), t.proposal.lockY());
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
1406
|
};
|
|
@@ -1805,7 +1805,7 @@ const Lr = class Lr extends me {
|
|
|
1805
1805
|
strokeWidth: h,
|
|
1806
1806
|
to: {
|
|
1807
1807
|
id: u,
|
|
1808
|
-
parent: { id:
|
|
1808
|
+
parent: { id: g }
|
|
1809
1809
|
}
|
|
1810
1810
|
} = this;
|
|
1811
1811
|
return {
|
|
@@ -1814,7 +1814,7 @@ const Lr = class Lr extends me {
|
|
|
1814
1814
|
displacementEnd: this.state.displacementEnd?.raw,
|
|
1815
1815
|
displacementStart: this.state.displacementStart?.raw,
|
|
1816
1816
|
lineStyle: n,
|
|
1817
|
-
labels: this.state.labels.map((
|
|
1817
|
+
labels: this.state.labels.map((p) => p.serialize()),
|
|
1818
1818
|
pathType: s,
|
|
1819
1819
|
startAnchor: {
|
|
1820
1820
|
mode: r.mode,
|
|
@@ -1825,12 +1825,12 @@ const Lr = class Lr extends me {
|
|
|
1825
1825
|
position: a.position?.raw
|
|
1826
1826
|
},
|
|
1827
1827
|
steps: l.map(
|
|
1828
|
-
(
|
|
1828
|
+
(p) => [...p.raw, p.mode, p.manualAxes]
|
|
1829
1829
|
),
|
|
1830
1830
|
stroke: c,
|
|
1831
1831
|
strokeWidth: h,
|
|
1832
1832
|
to: u,
|
|
1833
|
-
toParentId:
|
|
1833
|
+
toParentId: g,
|
|
1834
1834
|
class: this.constructor.name
|
|
1835
1835
|
};
|
|
1836
1836
|
}
|
|
@@ -1904,10 +1904,10 @@ function ue(i, t) {
|
|
|
1904
1904
|
return Q(i.x, t.x) && Q(i.y, t.y);
|
|
1905
1905
|
}
|
|
1906
1906
|
o(ue, "samePoint");
|
|
1907
|
-
function
|
|
1907
|
+
function mt(i, t) {
|
|
1908
1908
|
return Q(i.x, t.x) || Q(i.y, t.y);
|
|
1909
1909
|
}
|
|
1910
|
-
o(
|
|
1910
|
+
o(mt, "axisAligned");
|
|
1911
1911
|
function Gc(i, t) {
|
|
1912
1912
|
return Ki(i.x, t.x) && Ki(i.y, t.y);
|
|
1913
1913
|
}
|
|
@@ -1917,7 +1917,7 @@ function zs(i, t) {
|
|
|
1917
1917
|
}
|
|
1918
1918
|
o(zs, "strictlyAxisAligned");
|
|
1919
1919
|
function Tt(i, t) {
|
|
1920
|
-
return ue(i, t) || !
|
|
1920
|
+
return ue(i, t) || !mt(i, t) ? null : Q(i.y, t.y) ? "horizontal" : "vertical";
|
|
1921
1921
|
}
|
|
1922
1922
|
o(Tt, "segmentDirection");
|
|
1923
1923
|
function Os(i, t, e) {
|
|
@@ -1973,7 +1973,7 @@ function Je(i, t) {
|
|
|
1973
1973
|
);
|
|
1974
1974
|
}
|
|
1975
1975
|
o(Je, "endpointPoint");
|
|
1976
|
-
function
|
|
1976
|
+
function yt(i, t) {
|
|
1977
1977
|
const e = i.parent.state.box;
|
|
1978
1978
|
return new S(
|
|
1979
1979
|
[
|
|
@@ -1985,7 +1985,7 @@ function bt(i, t) {
|
|
|
1985
1985
|
!1
|
|
1986
1986
|
);
|
|
1987
1987
|
}
|
|
1988
|
-
o(
|
|
1988
|
+
o(yt, "routingBox");
|
|
1989
1989
|
function ho(i, t, e) {
|
|
1990
1990
|
return i >= t - B && i <= e + B;
|
|
1991
1991
|
}
|
|
@@ -2074,22 +2074,22 @@ function Kc(i) {
|
|
|
2074
2074
|
}
|
|
2075
2075
|
o(Kc, "compactRawPoints");
|
|
2076
2076
|
function jl(i, t, e) {
|
|
2077
|
-
if (!
|
|
2077
|
+
if (!mt(i, t))
|
|
2078
2078
|
return 1;
|
|
2079
2079
|
if (Q(i.x, t.x)) {
|
|
2080
|
-
const c = i.x, h = Math.min(i.y, t.y), u = Math.max(i.y, t.y),
|
|
2081
|
-
return
|
|
2080
|
+
const c = i.x, h = Math.min(i.y, t.y), u = Math.max(i.y, t.y), g = c > e.x + B && c < e.x + e.width - B, p = u > e.y + B && h < e.y + e.height - B;
|
|
2081
|
+
return g && p ? 1 : 0;
|
|
2082
2082
|
}
|
|
2083
2083
|
const n = i.y, s = Math.min(i.x, t.x), r = Math.max(i.x, t.x), a = n > e.y + B && n < e.y + e.height - B, l = r > e.x + B && s < e.x + e.width - B;
|
|
2084
2084
|
return a && l ? 1 : 0;
|
|
2085
2085
|
}
|
|
2086
2086
|
o(jl, "segmentCollisionPenalty");
|
|
2087
2087
|
function Uc(i, t, e) {
|
|
2088
|
-
if (!
|
|
2088
|
+
if (!mt(i, t))
|
|
2089
2089
|
return 1;
|
|
2090
2090
|
if (Q(i.x, t.x)) {
|
|
2091
|
-
const c = i.x, h = Math.min(i.y, t.y), u = Math.max(i.y, t.y),
|
|
2092
|
-
return
|
|
2091
|
+
const c = i.x, h = Math.min(i.y, t.y), u = Math.max(i.y, t.y), g = Q(c, e.x) || Q(c, e.x + e.width), p = Math.min(u, e.y + e.height) - Math.max(h, e.y);
|
|
2092
|
+
return g && p > B ? 1 : 0;
|
|
2093
2093
|
}
|
|
2094
2094
|
const n = i.y, s = Math.min(i.x, t.x), r = Math.max(i.x, t.x), a = Q(n, e.y) || Q(n, e.y + e.height), l = Math.min(r, e.x + e.width) - Math.max(s, e.x);
|
|
2095
2095
|
return a && l > B ? 1 : 0;
|
|
@@ -2098,23 +2098,23 @@ o(Uc, "segmentBorderOverlapPenalty");
|
|
|
2098
2098
|
function Xc(i, t, e = {}) {
|
|
2099
2099
|
let n = 0, s = 0, r = 0, a = 0, l = 0, c = e.incomingDirection ?? null;
|
|
2100
2100
|
for (let h = 0; h < i.length - 1; h++) {
|
|
2101
|
-
const u = i[h],
|
|
2102
|
-
if (!
|
|
2101
|
+
const u = i[h], g = i[h + 1];
|
|
2102
|
+
if (!mt(u, g))
|
|
2103
2103
|
return null;
|
|
2104
|
-
const
|
|
2105
|
-
if (h === 0 && e.avoidFirstDirection &&
|
|
2106
|
-
const m = { x:
|
|
2104
|
+
const p = Tt(u, g);
|
|
2105
|
+
if (h === 0 && e.avoidFirstDirection && p === e.avoidFirstDirection && (r += 1), h === 0 && e.avoidFirstBacktrack) {
|
|
2106
|
+
const m = { x: g.x - u.x, y: g.y - u.y };
|
|
2107
2107
|
if (ze(m, e.avoidFirstBacktrack) < -B)
|
|
2108
2108
|
return null;
|
|
2109
2109
|
}
|
|
2110
|
-
if (h === i.length - 2 && e.avoidLastDirection &&
|
|
2111
|
-
const m = { x: u.x -
|
|
2110
|
+
if (h === i.length - 2 && e.avoidLastDirection && p === e.avoidLastDirection && (r += 1), h === i.length - 2 && e.avoidLastBacktrack) {
|
|
2111
|
+
const m = { x: u.x - g.x, y: u.y - g.y };
|
|
2112
2112
|
if (ze(m, e.avoidLastBacktrack) < -B)
|
|
2113
2113
|
return null;
|
|
2114
2114
|
}
|
|
2115
|
-
l += Math.abs(u.x -
|
|
2115
|
+
l += Math.abs(u.x - g.x) + Math.abs(u.y - g.y), c && p && c !== p && (a += 1), c = p;
|
|
2116
2116
|
for (const m of t.obstacleBoxes)
|
|
2117
|
-
n += jl(u,
|
|
2117
|
+
n += jl(u, g, m), s += Uc(u, g, m);
|
|
2118
2118
|
}
|
|
2119
2119
|
return c && e.outgoingDirection && c !== e.outgoingDirection && (a += 1), [
|
|
2120
2120
|
n,
|
|
@@ -2149,10 +2149,10 @@ function Oi(i, t, e, n = {}) {
|
|
|
2149
2149
|
return [i];
|
|
2150
2150
|
let s = null, r = null;
|
|
2151
2151
|
const a = /* @__PURE__ */ o((h) => {
|
|
2152
|
-
const u = Kc(h),
|
|
2153
|
-
|
|
2152
|
+
const u = Kc(h), g = Xc(u, e, n);
|
|
2153
|
+
g && qc(g, r) && (s = u, r = g);
|
|
2154
2154
|
}, "push");
|
|
2155
|
-
|
|
2155
|
+
mt(i, t) && a([i, t]), a([i, rt(t.x, i.y), t]), a([i, rt(i.x, t.y), t]);
|
|
2156
2156
|
const l = uo([
|
|
2157
2157
|
i.x,
|
|
2158
2158
|
t.x,
|
|
@@ -2237,11 +2237,11 @@ function ji(i, t, e, n, s, r) {
|
|
|
2237
2237
|
let a = e;
|
|
2238
2238
|
const l = i === "x" ? "y" : "x", c = r.gridSize / 2;
|
|
2239
2239
|
for (const h of r.obstacleBoxes) {
|
|
2240
|
-
const u = l === "x" ? h.x : h.y,
|
|
2241
|
-
if (!po(t, u,
|
|
2240
|
+
const u = l === "x" ? h.x : h.y, g = l === "x" ? h.x + h.width : h.y + h.height, p = i === "x" ? h.x : h.y, m = i === "x" ? h.x + h.width : h.y + h.height;
|
|
2241
|
+
if (!po(t, u, g) || !po(a, p, m))
|
|
2242
2242
|
continue;
|
|
2243
|
-
const b = s !== void 0 ? s - a : 0, x = n - a, y = (
|
|
2244
|
-
a = (Math.abs(b) > B ? Math.sign(b) : Math.abs(x) > B ? Math.sign(x) : a < y ? -1 : 1) < 0 ?
|
|
2243
|
+
const b = s !== void 0 ? s - a : 0, x = n - a, y = (p + m) / 2;
|
|
2244
|
+
a = (Math.abs(b) > B ? Math.sign(b) : Math.abs(x) > B ? Math.sign(x) : a < y ? -1 : 1) < 0 ? p - c : m + c;
|
|
2245
2245
|
}
|
|
2246
2246
|
return a;
|
|
2247
2247
|
}
|
|
@@ -2365,7 +2365,7 @@ function ds(i, t, e) {
|
|
|
2365
2365
|
const n = [...i];
|
|
2366
2366
|
for (let s = 0; s < n.length - 3; ) {
|
|
2367
2367
|
const r = n[s], a = n[s + 1], l = n[s + 2], c = n[s + 3];
|
|
2368
|
-
if (!(
|
|
2368
|
+
if (!(mt(r, a) && mt(a, l) && mt(l, c)) || !Pl(r, c, t)) {
|
|
2369
2369
|
s += 1;
|
|
2370
2370
|
continue;
|
|
2371
2371
|
}
|
|
@@ -2384,7 +2384,7 @@ function Nl(i, t, e) {
|
|
|
2384
2384
|
s = !1;
|
|
2385
2385
|
for (let r = 0; r < n.length - 3; r++) {
|
|
2386
2386
|
const a = n[r], l = n[r + 1], c = n[r + 2], h = n[r + 3];
|
|
2387
|
-
if (l.mode === "auto" && c.mode === "auto" && !e.has(l) && !e.has(c) &&
|
|
2387
|
+
if (l.mode === "auto" && c.mode === "auto" && !e.has(l) && !e.has(c) && mt(a, l) && mt(l, c) && mt(c, h) && Pl(a, h, t)) {
|
|
2388
2388
|
n.splice(r + 1, 2), s = !0;
|
|
2389
2389
|
break;
|
|
2390
2390
|
}
|
|
@@ -2396,7 +2396,7 @@ o(Nl, "collapseAnyAutoRectangles");
|
|
|
2396
2396
|
function sd(i, t, e, n) {
|
|
2397
2397
|
const s = new W(null, [t.x, i.y, "auto"]), r = new W(null, [i.x, t.y, "auto"]), a = /* @__PURE__ */ o((l) => {
|
|
2398
2398
|
let c = 0;
|
|
2399
|
-
return e &&
|
|
2399
|
+
return e && mt(e, l) && (c += 1), n && mt(l, n) && (c += 1), i.mode === "manual" && e && Tt(e, i) === Tt(i, l) && (c -= 2), t.mode === "manual" && n && Tt(l, t) === Tt(t, n) && (c -= 2), c;
|
|
2400
2400
|
}, "score");
|
|
2401
2401
|
return a(s) >= a(r) ? s : r;
|
|
2402
2402
|
}
|
|
@@ -2503,18 +2503,18 @@ function us(i, t, e, n, s) {
|
|
|
2503
2503
|
r,
|
|
2504
2504
|
i.orientation,
|
|
2505
2505
|
s.gridSize,
|
|
2506
|
-
[
|
|
2506
|
+
[yt(t, 0)]
|
|
2507
2507
|
), u = c?.[1] ?? Ui(s.parent, l, t.orientation, s.gridSize, [
|
|
2508
|
-
|
|
2509
|
-
]),
|
|
2508
|
+
yt(i, 0)
|
|
2509
|
+
]), g = /* @__PURE__ */ new Set([h, u]), p = Oi(h, u, s, {
|
|
2510
2510
|
avoidFirstBacktrack: i.orientation,
|
|
2511
2511
|
avoidLastBacktrack: t.orientation,
|
|
2512
2512
|
incomingDirection: Tt(r, h) ?? void 0,
|
|
2513
2513
|
outgoingDirection: Tt(u, l) ?? void 0
|
|
2514
2514
|
}), m = Tl(
|
|
2515
|
-
[r, ...
|
|
2515
|
+
[r, ...p, l],
|
|
2516
2516
|
s,
|
|
2517
|
-
|
|
2517
|
+
g
|
|
2518
2518
|
);
|
|
2519
2519
|
return Dl(
|
|
2520
2520
|
Ll(m, s, h, u),
|
|
@@ -2527,8 +2527,8 @@ o(us, "routeAuto");
|
|
|
2527
2527
|
function od(i, t, e, n, s, r = null) {
|
|
2528
2528
|
const a = Il(i), l = {
|
|
2529
2529
|
gridSize: a,
|
|
2530
|
-
obstacleBoxes: [
|
|
2531
|
-
laneBoxes: [
|
|
2530
|
+
obstacleBoxes: [yt(t, 0), yt(e, 0)],
|
|
2531
|
+
laneBoxes: [yt(t, a / 2), yt(e, a / 2)],
|
|
2532
2532
|
parent: r
|
|
2533
2533
|
};
|
|
2534
2534
|
return us(t, e, n, s, l);
|
|
@@ -2537,13 +2537,13 @@ o(od, "routeOrthogonalBetweenGateways");
|
|
|
2537
2537
|
function ld(i, t, e = [], n) {
|
|
2538
2538
|
const s = Il(i), r = {
|
|
2539
2539
|
gridSize: s,
|
|
2540
|
-
obstacleBoxes: [
|
|
2540
|
+
obstacleBoxes: [yt(t.from, 0), yt(t.to, 0)],
|
|
2541
2541
|
laneBoxes: [
|
|
2542
|
-
|
|
2543
|
-
|
|
2542
|
+
yt(t.from, s / 2),
|
|
2543
|
+
yt(t.to, s / 2)
|
|
2544
2544
|
],
|
|
2545
2545
|
parent: t
|
|
2546
|
-
}, a = t.steps.filter((T,
|
|
2546
|
+
}, a = t.steps.filter((T, G) => G > 0 && G < t.steps.length - 1 && T.mode === "manual");
|
|
2547
2547
|
if (a.length === 0)
|
|
2548
2548
|
return us(
|
|
2549
2549
|
t.from,
|
|
@@ -2565,63 +2565,63 @@ function ld(i, t, e = [], n) {
|
|
|
2565
2565
|
c.x,
|
|
2566
2566
|
c.y,
|
|
2567
2567
|
"static"
|
|
2568
|
-
),
|
|
2568
|
+
), g = Ui(
|
|
2569
2569
|
r.parent,
|
|
2570
2570
|
h,
|
|
2571
2571
|
t.from.orientation,
|
|
2572
2572
|
s,
|
|
2573
|
-
[
|
|
2574
|
-
),
|
|
2573
|
+
[yt(t.to, 0)]
|
|
2574
|
+
), p = Ui(
|
|
2575
2575
|
r.parent,
|
|
2576
2576
|
u,
|
|
2577
2577
|
t.to.orientation,
|
|
2578
2578
|
s,
|
|
2579
|
-
[
|
|
2579
|
+
[yt(t.from, 0)]
|
|
2580
2580
|
), { copies: m, copiesByOriginal: b } = ed(
|
|
2581
2581
|
a,
|
|
2582
2582
|
r.parent
|
|
2583
2583
|
), x = e.map(
|
|
2584
2584
|
(T) => id(T, b, r.parent)
|
|
2585
2585
|
), y = /* @__PURE__ */ new Set([
|
|
2586
|
-
p,
|
|
2587
2586
|
g,
|
|
2587
|
+
p,
|
|
2588
2588
|
...x
|
|
2589
|
-
]), w = Jc(m), v = [h,
|
|
2590
|
-
let k =
|
|
2589
|
+
]), w = Jc(m), v = [h, g];
|
|
2590
|
+
let k = g;
|
|
2591
2591
|
for (let T = 0; T < w.length; T++) {
|
|
2592
|
-
const
|
|
2593
|
-
if (
|
|
2594
|
-
const Tn = Oi(k,
|
|
2592
|
+
const G = w[T], J = k instanceof W && k.mode === "manual" ? Tt(v.at(-2), k) ?? void 0 : void 0;
|
|
2593
|
+
if (G.type === "point") {
|
|
2594
|
+
const Tn = Oi(k, G.point, r, {
|
|
2595
2595
|
avoidFirstDirection: J,
|
|
2596
2596
|
avoidFirstBacktrack: T === 0 ? t.from.orientation : void 0
|
|
2597
2597
|
});
|
|
2598
|
-
v.push(...Tn.slice(1)), k =
|
|
2598
|
+
v.push(...Tn.slice(1)), k = G.point;
|
|
2599
2599
|
continue;
|
|
2600
2600
|
}
|
|
2601
|
-
const X = Qc(w[T + 1],
|
|
2602
|
-
let [
|
|
2603
|
-
|
|
2601
|
+
const X = Qc(w[T + 1], p);
|
|
2602
|
+
let [ot, $t] = td(
|
|
2603
|
+
G,
|
|
2604
2604
|
k,
|
|
2605
2605
|
X,
|
|
2606
2606
|
r.parent,
|
|
2607
2607
|
r
|
|
2608
2608
|
);
|
|
2609
|
-
if (Cn(
|
|
2609
|
+
if (Cn(ot, $t, r))
|
|
2610
2610
|
continue;
|
|
2611
|
-
const Ci = Oi(k,
|
|
2611
|
+
const Ci = Oi(k, ot, r, {
|
|
2612
2612
|
avoidFirstDirection: J,
|
|
2613
2613
|
avoidFirstBacktrack: T === 0 ? t.from.orientation : void 0
|
|
2614
2614
|
});
|
|
2615
2615
|
v.push(...Ci.slice(1), $t), k = $t;
|
|
2616
2616
|
}
|
|
2617
|
-
const C = k instanceof W && k.mode === "manual" ? Tt(v.at(-2), k) ?? void 0 : void 0, P = Oi(k,
|
|
2617
|
+
const C = k instanceof W && k.mode === "manual" ? Tt(v.at(-2), k) ?? void 0 : void 0, P = Oi(k, p, r, {
|
|
2618
2618
|
avoidFirstDirection: C,
|
|
2619
|
-
avoidLastDirection: Tt(
|
|
2619
|
+
avoidLastDirection: Tt(p, u) ?? void 0,
|
|
2620
2620
|
avoidLastBacktrack: t.to.orientation
|
|
2621
2621
|
});
|
|
2622
2622
|
v.push(...P.slice(1), u);
|
|
2623
2623
|
const L = Tl(v, r, y), N = Dl(
|
|
2624
|
-
Ll(L, r,
|
|
2624
|
+
Ll(L, r, g, p),
|
|
2625
2625
|
t.from.orientation,
|
|
2626
2626
|
t.to.orientation,
|
|
2627
2627
|
r
|
|
@@ -2992,7 +2992,7 @@ let Mi = (Se = class extends me {
|
|
|
2992
2992
|
];
|
|
2993
2993
|
return new f(
|
|
2994
2994
|
h.reduce(
|
|
2995
|
-
(u,
|
|
2995
|
+
(u, g) => g.value < u.value ? g : u
|
|
2996
2996
|
).point
|
|
2997
2997
|
);
|
|
2998
2998
|
}
|
|
@@ -3021,8 +3021,8 @@ let Mi = (Se = class extends me {
|
|
|
3021
3021
|
if (Math.abs(c) > 1) return null;
|
|
3022
3022
|
let h = l ? r : a;
|
|
3023
3023
|
this.edgeGatewayShape === "ellipse" ? h *= Math.sqrt(Math.max(0, 1 - c ** 2)) : this.edgeGatewayShape === "diamond" && (h *= 1 - Math.abs(c));
|
|
3024
|
-
const u = l ? t.x <= s.x ? -1 : 1 : t.y <= s.y ? -1 : 1,
|
|
3025
|
-
return this.anchorForBoundaryPoint(
|
|
3024
|
+
const u = l ? t.x <= s.x ? -1 : 1 : t.y <= s.y ? -1 : 1, g = l ? new f([s.x + u * h, t.y]) : new f([t.x, s.y + u * h]);
|
|
3025
|
+
return this.anchorForBoundaryPoint(g);
|
|
3026
3026
|
}
|
|
3027
3027
|
/** Resolves the exact shape-boundary intersection facing a supplied route hint. */
|
|
3028
3028
|
findAutomaticConnectionAnchor(t) {
|
|
@@ -3117,8 +3117,8 @@ let Mi = (Se = class extends me {
|
|
|
3117
3117
|
labelOffset: c,
|
|
3118
3118
|
selected: h,
|
|
3119
3119
|
stroke: u,
|
|
3120
|
-
strokewWidth:
|
|
3121
|
-
} = this.state,
|
|
3120
|
+
strokewWidth: g
|
|
3121
|
+
} = this.state, p = this.gateways.map((m) => m.serialize());
|
|
3122
3122
|
return {
|
|
3123
3123
|
box: t,
|
|
3124
3124
|
id: e,
|
|
@@ -3126,12 +3126,12 @@ let Mi = (Se = class extends me {
|
|
|
3126
3126
|
movable: s,
|
|
3127
3127
|
selectable: r,
|
|
3128
3128
|
selected: h,
|
|
3129
|
-
gateways:
|
|
3129
|
+
gateways: p,
|
|
3130
3130
|
fill: a,
|
|
3131
3131
|
labelFontSize: l,
|
|
3132
3132
|
labelOffset: c ? [...c] : void 0,
|
|
3133
3133
|
stroke: u,
|
|
3134
|
-
strokewWidth:
|
|
3134
|
+
strokewWidth: g,
|
|
3135
3135
|
class: this.constructor.name
|
|
3136
3136
|
};
|
|
3137
3137
|
}
|
|
@@ -3142,7 +3142,7 @@ let Mi = (Se = class extends me {
|
|
|
3142
3142
|
RenderOverlay = null;
|
|
3143
3143
|
RenderScreen = null;
|
|
3144
3144
|
}, o(Se, "Node"), Se);
|
|
3145
|
-
const Hr = class Hr extends
|
|
3145
|
+
const Hr = class Hr extends H {
|
|
3146
3146
|
selectionMode = "element";
|
|
3147
3147
|
_selection = /* @__PURE__ */ new Set();
|
|
3148
3148
|
_edgesSelection = /* @__PURE__ */ new Set();
|
|
@@ -3249,7 +3249,7 @@ const Hr = class Hr extends G {
|
|
|
3249
3249
|
I(() => {
|
|
3250
3250
|
this.startPoint = this.diagram.canvas.inverseFit(e);
|
|
3251
3251
|
}), t.cancel(), this.unbind = Pt(
|
|
3252
|
-
Bt(this,
|
|
3252
|
+
Bt(this, dt, this.handleMouseUp),
|
|
3253
3253
|
Bt(this, Kt, this.handleMouseMove),
|
|
3254
3254
|
An(this.handleSelectionInterval.bind(this), 30)
|
|
3255
3255
|
);
|
|
@@ -3270,7 +3270,7 @@ const Hr = class Hr extends G {
|
|
|
3270
3270
|
}, "handleUp");
|
|
3271
3271
|
this.unbind = Pt(
|
|
3272
3272
|
Bt(this, Kt, s),
|
|
3273
|
-
Bt(this,
|
|
3273
|
+
Bt(this, dt, r)
|
|
3274
3274
|
);
|
|
3275
3275
|
}
|
|
3276
3276
|
handleMouseMove = /* @__PURE__ */ o((t) => {
|
|
@@ -3305,7 +3305,7 @@ const Hr = class Hr extends G {
|
|
|
3305
3305
|
};
|
|
3306
3306
|
o(Hr, "Selector");
|
|
3307
3307
|
let V = Hr;
|
|
3308
|
-
const Gr = class Gr extends
|
|
3308
|
+
const Gr = class Gr extends H {
|
|
3309
3309
|
hotkeys = [];
|
|
3310
3310
|
isEditableTarget(t) {
|
|
3311
3311
|
return t instanceof HTMLElement ? t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement || t instanceof HTMLButtonElement || t.isContentEditable : !1;
|
|
@@ -3488,7 +3488,8 @@ let hd = (Me = class extends me {
|
|
|
3488
3488
|
constructor(t) {
|
|
3489
3489
|
super(t), z(this, {
|
|
3490
3490
|
_scale: E,
|
|
3491
|
-
setScale: _
|
|
3491
|
+
setScale: _,
|
|
3492
|
+
setGridSize: _
|
|
3492
3493
|
}), this.unbindDocumentEvents.push(
|
|
3493
3494
|
U(this, "click", this.handleClick),
|
|
3494
3495
|
U(this, "dblclick", this.handleDoubleClick),
|
|
@@ -3555,14 +3556,14 @@ let hd = (Me = class extends me {
|
|
|
3555
3556
|
t.x,
|
|
3556
3557
|
t.width,
|
|
3557
3558
|
e
|
|
3558
|
-
),
|
|
3559
|
+
), g = this.visibleOriginForInterval(
|
|
3559
3560
|
h,
|
|
3560
3561
|
a,
|
|
3561
3562
|
t.y,
|
|
3562
3563
|
t.height,
|
|
3563
3564
|
e
|
|
3564
|
-
),
|
|
3565
|
-
return
|
|
3565
|
+
), p = new f([-u, -g]);
|
|
3566
|
+
return p.copy(!1).substract(l).norm < 1e-3 ? !1 : (n && typeof requestAnimationFrame < "u" ? this.animateDisplacement(p) : this.setDisplacement(p), !0);
|
|
3566
3567
|
}
|
|
3567
3568
|
visibleOriginForInterval(t, e, n, s, r) {
|
|
3568
3569
|
const a = Math.max(0, r);
|
|
@@ -3732,7 +3733,7 @@ let hd = (Me = class extends me {
|
|
|
3732
3733
|
this.isInsideFrameEvent(t) && this.emit(new Ri(this, t));
|
|
3733
3734
|
}
|
|
3734
3735
|
handleMouseUp(t) {
|
|
3735
|
-
!this.isInsideFrameEvent(t) && !this.eventStart && !this.mouseSessionStartedInFrame || (this.emit(new
|
|
3736
|
+
!this.isInsideFrameEvent(t) && !this.eventStart && !this.mouseSessionStartedInFrame || (this.emit(new dt(this, t)), this._dragging = !1, this.eventStart = null, this.mouseSessionStartedInFrame = !1);
|
|
3736
3737
|
}
|
|
3737
3738
|
handleMouseDown(t) {
|
|
3738
3739
|
const e = this.isInsideFrameEvent(t);
|
|
@@ -3796,7 +3797,7 @@ const Br = class Br extends Mi {
|
|
|
3796
3797
|
};
|
|
3797
3798
|
o(Br, "TextNode");
|
|
3798
3799
|
let qi = Br;
|
|
3799
|
-
const Vr = class Vr extends
|
|
3800
|
+
const Vr = class Vr extends H {
|
|
3800
3801
|
creationMode = "none";
|
|
3801
3802
|
init() {
|
|
3802
3803
|
this.diagram.onEvent(Ri, (t) => {
|
|
@@ -3833,7 +3834,7 @@ const Vr = class Vr extends G {
|
|
|
3833
3834
|
};
|
|
3834
3835
|
o(Vr, "Creator");
|
|
3835
3836
|
let ms = Vr;
|
|
3836
|
-
const Wr = class Wr extends
|
|
3837
|
+
const Wr = class Wr extends H {
|
|
3837
3838
|
dragThreshold = 10;
|
|
3838
3839
|
autopan = new At(this.diagram);
|
|
3839
3840
|
autopanReady = !0;
|
|
@@ -3851,7 +3852,7 @@ const Wr = class Wr extends G {
|
|
|
3851
3852
|
this.handleMouseDown.bind(this),
|
|
3852
3853
|
this.diagram.priorities.Mouse_Down_Dragger
|
|
3853
3854
|
), this.diagram.onEvent(
|
|
3854
|
-
|
|
3855
|
+
dt,
|
|
3855
3856
|
this.handleMouseUp.bind(this),
|
|
3856
3857
|
this.diagram.priorities.Mouse_Up_Dragger
|
|
3857
3858
|
), this.diagram.onEvent(
|
|
@@ -3906,8 +3907,8 @@ const Wr = class Wr extends G {
|
|
|
3906
3907
|
[1, 0],
|
|
3907
3908
|
[0, 1]
|
|
3908
3909
|
].map(
|
|
3909
|
-
([
|
|
3910
|
-
), h = l.copy().sum(t), u = c.map((
|
|
3910
|
+
([g, p]) => s.copy().sum([g * r, p * a])
|
|
3911
|
+
), h = l.copy().sum(t), u = c.map((g) => ({ anchor: g, distance: g.distance(h) })).sort((g, p) => g.distance - p.distance)[0];
|
|
3911
3912
|
return u ? u.anchor.copy().substract(l) : t;
|
|
3912
3913
|
}
|
|
3913
3914
|
handleMouseDown(t) {
|
|
@@ -3972,26 +3973,26 @@ const Wr = class Wr extends G {
|
|
|
3972
3973
|
const s = n.find(
|
|
3973
3974
|
(y) => y.node.id === this.primaryNodeId
|
|
3974
3975
|
) ?? n[0], r = [...n].sort(
|
|
3975
|
-
(y, w) => (
|
|
3976
|
+
(y, w) => (bt.get(y, "x") ?? 1 / 0) - (bt.get(w, "x") ?? 1 / 0)
|
|
3976
3977
|
)[0], a = [...n].sort(
|
|
3977
|
-
(y, w) => (
|
|
3978
|
-
)[0], l =
|
|
3978
|
+
(y, w) => (bt.get(y, "y") ?? 1 / 0) - (bt.get(w, "y") ?? 1 / 0)
|
|
3979
|
+
)[0], l = bt.get(r, "x") === void 0 ? s : r, c = bt.get(a, "y") === void 0 ? s : a, h = this.draggingNodes.get(l.node.id)?.startPoint, u = this.draggingNodes.get(c.node.id)?.startPoint;
|
|
3979
3980
|
if (!h || !u) return null;
|
|
3980
|
-
const
|
|
3981
|
+
const g = new f([
|
|
3981
3982
|
l.get().x - h.x,
|
|
3982
3983
|
c.get().y - u.y
|
|
3983
3984
|
]);
|
|
3984
|
-
let
|
|
3985
|
+
let p = Number.NEGATIVE_INFINITY, m = Number.POSITIVE_INFINITY, b = Number.NEGATIVE_INFINITY, x = Number.POSITIVE_INFINITY;
|
|
3985
3986
|
return n.forEach((y) => {
|
|
3986
3987
|
const w = this.draggingNodes.get(y.node.id)?.startPoint;
|
|
3987
|
-
w && (
|
|
3988
|
+
w && (p = Math.max(p, -w.x), m = Math.min(
|
|
3988
3989
|
m,
|
|
3989
3990
|
this.diagram.canvas.size.x - w.x - y.node.box.width
|
|
3990
3991
|
), b = Math.max(b, -w.y), x = Math.min(
|
|
3991
3992
|
x,
|
|
3992
3993
|
this.diagram.canvas.size.y - w.y - y.node.box.height
|
|
3993
3994
|
));
|
|
3994
|
-
}),
|
|
3995
|
+
}), g.x = Math.min(m, Math.max(p, g.x)), g.y = Math.min(x, Math.max(b, g.y)), g;
|
|
3995
3996
|
}
|
|
3996
3997
|
applyNodePositionProposals(t) {
|
|
3997
3998
|
const e = new Map(
|
|
@@ -4014,11 +4015,11 @@ const Wr = class Wr extends G {
|
|
|
4014
4015
|
});
|
|
4015
4016
|
}
|
|
4016
4017
|
}), this.groupedChildren.size && this.groupedChildren.forEach((c, h) => {
|
|
4017
|
-
const u = e.get(c),
|
|
4018
|
-
if (!
|
|
4018
|
+
const u = e.get(c), g = this.draggingNodes.get(h), p = this.draggingNodes.get(c);
|
|
4019
|
+
if (!g || !p)
|
|
4019
4020
|
return;
|
|
4020
|
-
const b = (u?.cancelled ?
|
|
4021
|
-
|
|
4021
|
+
const b = (u?.cancelled ? p.startPoint : u?.node.coordinates ?? p.startPoint).copy().substract(p.startPoint), x = g.startPoint.copy().sum(b);
|
|
4022
|
+
g.node.setPosition(x, {
|
|
4022
4023
|
updateConnectedEdges: !1
|
|
4023
4024
|
});
|
|
4024
4025
|
}), this.updateEdgesAfterBatchMove(l, a);
|
|
@@ -4122,13 +4123,13 @@ function Ol(i, t, e) {
|
|
|
4122
4123
|
(u) => u.box.translate(new f([-Ni, -Ni])).sum([0, 0, Ni * 2, Ni * 2]).collides(t)
|
|
4123
4124
|
);
|
|
4124
4125
|
if (e.axisConstraint) {
|
|
4125
|
-
const u = n.filter((
|
|
4126
|
-
anchor:
|
|
4126
|
+
const u = n.filter((p) => p.edgesAsGateways && p.box.collides(t)).sort((p, m) => p.box.middle.distance(t) - m.box.middle.distance(t)).map((p) => ({
|
|
4127
|
+
anchor: p.findAxisAlignedConnectionAnchor(
|
|
4127
4128
|
e.axisConstraint.origin,
|
|
4128
4129
|
e.axisConstraint.axis
|
|
4129
4130
|
),
|
|
4130
|
-
node:
|
|
4131
|
-
})).find((
|
|
4131
|
+
node: p
|
|
4132
|
+
})).find((p) => p.anchor);
|
|
4132
4133
|
if (u?.anchor)
|
|
4133
4134
|
return {
|
|
4134
4135
|
anchor: u.anchor,
|
|
@@ -4139,23 +4140,23 @@ function Ol(i, t, e) {
|
|
|
4139
4140
|
node: u.node,
|
|
4140
4141
|
snappedToGateway: !1
|
|
4141
4142
|
};
|
|
4142
|
-
const
|
|
4143
|
-
distance:
|
|
4144
|
-
gateway:
|
|
4143
|
+
const g = n.flatMap((p) => p.gateways).map((p) => ({
|
|
4144
|
+
distance: p.coordinates.distance(t),
|
|
4145
|
+
gateway: p
|
|
4145
4146
|
})).filter(
|
|
4146
|
-
({ gateway:
|
|
4147
|
-
).filter((
|
|
4148
|
-
if (
|
|
4149
|
-
const
|
|
4150
|
-
gateway:
|
|
4151
|
-
point:
|
|
4152
|
-
relativePosition:
|
|
4147
|
+
({ gateway: p }) => e.axisConstraint.axis === "horizontal" ? Math.abs(p.coordinates.y - e.axisConstraint.origin.y) < 1e-3 : Math.abs(p.coordinates.x - e.axisConstraint.origin.x) < 1e-3
|
|
4148
|
+
).filter((p) => p.distance <= xo).sort((p, m) => p.distance - m.distance)[0]?.gateway;
|
|
4149
|
+
if (g) {
|
|
4150
|
+
const p = {
|
|
4151
|
+
gateway: g,
|
|
4152
|
+
point: g.coordinates.copy(),
|
|
4153
|
+
relativePosition: g.relativePosition,
|
|
4153
4154
|
displacement: new f()
|
|
4154
4155
|
};
|
|
4155
4156
|
return {
|
|
4156
|
-
anchor:
|
|
4157
|
-
anchorState: { mode: "fixed", position:
|
|
4158
|
-
node:
|
|
4157
|
+
anchor: p,
|
|
4158
|
+
anchorState: { mode: "fixed", position: p.relativePosition },
|
|
4159
|
+
node: g.parent,
|
|
4159
4160
|
snappedToGateway: !0
|
|
4160
4161
|
};
|
|
4161
4162
|
}
|
|
@@ -4164,7 +4165,7 @@ function Ol(i, t, e) {
|
|
|
4164
4165
|
const s = n.flatMap((u) => u.gateways).map((u) => ({
|
|
4165
4166
|
gateway: u,
|
|
4166
4167
|
distance: u.coordinates.distance(t)
|
|
4167
|
-
})).filter((u) => u.distance <= xo).sort((u,
|
|
4168
|
+
})).filter((u) => u.distance <= xo).sort((u, g) => u.distance - g.distance)[0]?.gateway;
|
|
4168
4169
|
if (s) {
|
|
4169
4170
|
const u = {
|
|
4170
4171
|
gateway: s,
|
|
@@ -4198,12 +4199,12 @@ function Ol(i, t, e) {
|
|
|
4198
4199
|
node: r.parent,
|
|
4199
4200
|
snappedToGateway: !0
|
|
4200
4201
|
};
|
|
4201
|
-
const a = n.filter((u) => u.edgesAsGateways).sort((u,
|
|
4202
|
+
const a = n.filter((u) => u.edgesAsGateways).sort((u, g) => u.box.middle.distance(t) - g.box.middle.distance(t))[0];
|
|
4202
4203
|
if (a) {
|
|
4203
|
-
const u = a.usesAutomaticConnectionPoint(t),
|
|
4204
|
+
const u = a.usesAutomaticConnectionPoint(t), g = u ? a.findAutomaticGatewayAnchor(e.oppositePoint) : a.findFixedConnectionAnchor(t);
|
|
4204
4205
|
return {
|
|
4205
|
-
anchor:
|
|
4206
|
-
anchorState: u ? { mode: "automatic" } : { mode: "fixed", position:
|
|
4206
|
+
anchor: g,
|
|
4207
|
+
anchorState: u ? { mode: "automatic" } : { mode: "fixed", position: g.relativePosition },
|
|
4207
4208
|
node: a,
|
|
4208
4209
|
snappedToGateway: !1
|
|
4209
4210
|
};
|
|
@@ -4211,7 +4212,7 @@ function Ol(i, t, e) {
|
|
|
4211
4212
|
const l = n.flatMap((u) => u.gateways).map((u) => ({
|
|
4212
4213
|
gateway: u,
|
|
4213
4214
|
distance: u.connectionDistance(t)
|
|
4214
|
-
})).filter((u) => Number.isFinite(u.distance)).sort((u,
|
|
4215
|
+
})).filter((u) => Number.isFinite(u.distance)).sort((u, g) => u.distance - g.distance)[0]?.gateway;
|
|
4215
4216
|
if (!l) return null;
|
|
4216
4217
|
const c = l.connectionDisplacement(t);
|
|
4217
4218
|
return {
|
|
@@ -4227,7 +4228,7 @@ function Ol(i, t, e) {
|
|
|
4227
4228
|
};
|
|
4228
4229
|
}
|
|
4229
4230
|
o(Ol, "resolveConnectionCandidate");
|
|
4230
|
-
const Ve = 1e-3, Rt = 3, Yr = class Yr extends
|
|
4231
|
+
const Ve = 1e-3, Rt = 3, Yr = class Yr extends H {
|
|
4231
4232
|
autopan = new At(this.diagram);
|
|
4232
4233
|
drag = null;
|
|
4233
4234
|
endpointDrag = null;
|
|
@@ -4392,20 +4393,20 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4392
4393
|
const r = e.state.steps, a = r.findIndex((N) => N === this.drag.pointA), l = r.findIndex((N) => N === this.drag.pointB);
|
|
4393
4394
|
if (a < 0 || l < 0)
|
|
4394
4395
|
return !1;
|
|
4395
|
-
const c = t === "from" ? a <= l ? "pointA" : "pointB" : a >= l ? "pointA" : "pointB", h = c === "pointA" ? "pointB" : "pointA", u = this.drag[c],
|
|
4396
|
+
const c = t === "from" ? a <= l ? "pointA" : "pointB" : a >= l ? "pointA" : "pointB", h = c === "pointA" ? "pointB" : "pointA", u = this.drag[c], g = this.drag[h], p = r.findIndex((N) => N === u), m = this.endpointLeadPoint(e, t), b = t === "from" ? 1 : r.length - 2, x = r[b], y = !!(x && this.pointMatches(x, m)), w = t === "from" ? p === 1 : p === r.length - 2, v = t === "from" ? p === 2 && y : p === r.length - 3 && y, k = this.crossesStaticBoundary(
|
|
4396
4397
|
s,
|
|
4397
4398
|
n,
|
|
4398
4399
|
u,
|
|
4399
4400
|
m,
|
|
4400
4401
|
Rt
|
|
4401
4402
|
);
|
|
4402
|
-
if (
|
|
4403
|
+
if (p < 0 || !w && !v || !k)
|
|
4403
4404
|
return !1;
|
|
4404
4405
|
const C = this.perpendicularAxis(n), P = this.guardCoordinate(
|
|
4405
4406
|
e,
|
|
4406
4407
|
t,
|
|
4407
4408
|
m,
|
|
4408
|
-
|
|
4409
|
+
g,
|
|
4409
4410
|
C
|
|
4410
4411
|
);
|
|
4411
4412
|
this.setPointAxis(u, C, P), this.markManual(u, n), this.rebaseDraggedEndpointFixedAxis(c, u);
|
|
@@ -4423,9 +4424,9 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4423
4424
|
m.y,
|
|
4424
4425
|
"auto"
|
|
4425
4426
|
);
|
|
4426
|
-
r.splice(
|
|
4427
|
+
r.splice(p, 0, N, L);
|
|
4427
4428
|
} else
|
|
4428
|
-
r.splice(
|
|
4429
|
+
r.splice(p, 0, L);
|
|
4429
4430
|
return this.drag.sourceLeadAdjacent = !1, this.drag.staticBoundaryGuarded = !0, !0;
|
|
4430
4431
|
}
|
|
4431
4432
|
if (w) {
|
|
@@ -4435,9 +4436,9 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4435
4436
|
m.y,
|
|
4436
4437
|
"auto"
|
|
4437
4438
|
);
|
|
4438
|
-
r.splice(
|
|
4439
|
+
r.splice(p + 1, 0, L, N);
|
|
4439
4440
|
} else
|
|
4440
|
-
r.splice(
|
|
4441
|
+
r.splice(p + 1, 0, L);
|
|
4441
4442
|
return this.drag.targetLeadAdjacent = !1, this.drag.staticBoundaryGuarded = !0, !0;
|
|
4442
4443
|
}
|
|
4443
4444
|
insertStaticBoundaryGuards() {
|
|
@@ -4565,8 +4566,8 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4565
4566
|
chooseOrthogonalCorner(t, e, n, s) {
|
|
4566
4567
|
const r = new W(this.drag?.edge ?? null, [e.x, t.y, "auto"]), a = new W(this.drag?.edge ?? null, [t.x, e.y, "auto"]), l = /* @__PURE__ */ o((c) => {
|
|
4567
4568
|
let h = 0;
|
|
4568
|
-
const u = n ? this.segmentDirection(n, t) : null,
|
|
4569
|
-
return u &&
|
|
4569
|
+
const u = n ? this.segmentDirection(n, t) : null, g = this.segmentDirection(t, c), p = s ? this.segmentDirection(e, s) : null, m = this.segmentDirection(c, e);
|
|
4570
|
+
return u && g !== u && (h += 2), p && m !== p && (h += 2), this.axisAligned(n ?? t, c) && (h += 1), this.axisAligned(c, s ?? e) && (h += 1), h;
|
|
4570
4571
|
}, "score");
|
|
4571
4572
|
return l(r) >= l(a) ? r : a;
|
|
4572
4573
|
}
|
|
@@ -4687,11 +4688,11 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4687
4688
|
});
|
|
4688
4689
|
if (!u)
|
|
4689
4690
|
return;
|
|
4690
|
-
const
|
|
4691
|
+
const g = e.steps.findIndex(
|
|
4691
4692
|
(x) => x === u.pointA
|
|
4692
|
-
),
|
|
4693
|
+
), p = e.steps.findIndex(
|
|
4693
4694
|
(x) => x === u.pointB
|
|
4694
|
-
), m =
|
|
4695
|
+
), m = g === 2 || p === 2, b = g === e.steps.length - 3 || p === e.steps.length - 3;
|
|
4695
4696
|
this.drag = {
|
|
4696
4697
|
edge: e,
|
|
4697
4698
|
midpoint: t.midPoint,
|
|
@@ -4769,8 +4770,8 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4769
4770
|
this.endpointDrag.candidate = null, this.endpointCandidatePoint = null, this.restoreEndpointDrag();
|
|
4770
4771
|
return;
|
|
4771
4772
|
}
|
|
4772
|
-
const u = n === "from" ? h.anchor.gateway : e.from,
|
|
4773
|
-
if (!u.canStartConnection(
|
|
4773
|
+
const u = n === "from" ? h.anchor.gateway : e.from, g = n === "to" ? h.anchor.gateway : e.to;
|
|
4774
|
+
if (!u.canStartConnection(g, e) || !g.canConnect(u, e)) {
|
|
4774
4775
|
this.endpointDrag.candidate = null, this.endpointCandidatePoint = null, this.restoreEndpointDrag();
|
|
4775
4776
|
return;
|
|
4776
4777
|
}
|
|
@@ -4832,7 +4833,7 @@ const Ve = 1e-3, Rt = 3, Yr = class Yr extends G {
|
|
|
4832
4833
|
};
|
|
4833
4834
|
o(Yr, "EdgesDragger");
|
|
4834
4835
|
let Oe = Yr;
|
|
4835
|
-
const Zr = class Zr extends
|
|
4836
|
+
const Zr = class Zr extends H {
|
|
4836
4837
|
proposals = [];
|
|
4837
4838
|
snapDistance = 10;
|
|
4838
4839
|
/** Clears transient label-specific visual guides after a drag session is completed. */
|
|
@@ -4854,30 +4855,30 @@ const Zr = class Zr extends G {
|
|
|
4854
4855
|
distance: Number.POSITIVE_INFINITY,
|
|
4855
4856
|
guide: h,
|
|
4856
4857
|
target: n.x
|
|
4857
|
-
},
|
|
4858
|
+
}, g = {
|
|
4858
4859
|
distance: Number.POSITIVE_INFINITY,
|
|
4859
4860
|
guide: h,
|
|
4860
4861
|
target: n.y
|
|
4861
4862
|
};
|
|
4862
|
-
const
|
|
4863
|
+
const p = /* @__PURE__ */ o((x, y) => {
|
|
4863
4864
|
const w = Math.abs(n.x - x);
|
|
4864
4865
|
w <= a && w < u.distance && (u = { distance: w, guide: y, target: x });
|
|
4865
4866
|
}, "chooseX"), m = /* @__PURE__ */ o((x, y) => {
|
|
4866
4867
|
const w = Math.abs(n.y - x);
|
|
4867
|
-
w <= a && w <
|
|
4868
|
+
w <= a && w < g.distance && (g = { distance: w, guide: y, target: x });
|
|
4868
4869
|
}, "chooseY");
|
|
4869
4870
|
for (const x of this.diagram.edges.flatMap((y) => y.labels)) {
|
|
4870
4871
|
if (x === e) continue;
|
|
4871
4872
|
const y = x.position.x + x.size.width / 2, w = x.position.y + x.size.height / 2, v = x.position.y + x.size.height, k = x.position.x + x.size.width, C = Math.min(n.y, x.position.y), P = Math.max(n.y + s.height, v), L = Math.min(n.x, x.position.x), N = Math.max(n.x + s.width, k);
|
|
4872
|
-
|
|
4873
|
+
p(x.position.x, {
|
|
4873
4874
|
from: new f([x.position.x, C]),
|
|
4874
4875
|
id: `label-left-${x.id}`,
|
|
4875
4876
|
to: new f([x.position.x, P])
|
|
4876
|
-
}),
|
|
4877
|
+
}), p(k - s.width, {
|
|
4877
4878
|
from: new f([k, C]),
|
|
4878
4879
|
id: `label-right-${x.id}`,
|
|
4879
4880
|
to: new f([k, P])
|
|
4880
|
-
}),
|
|
4881
|
+
}), p(y - s.width / 2, {
|
|
4881
4882
|
from: new f([y, C]),
|
|
4882
4883
|
id: `label-center-x-${x.id}`,
|
|
4883
4884
|
to: new f([y, P])
|
|
@@ -4895,16 +4896,16 @@ const Zr = class Zr extends G {
|
|
|
4895
4896
|
to: new f([N, w])
|
|
4896
4897
|
});
|
|
4897
4898
|
}
|
|
4898
|
-
Number.isFinite(u.distance) && (l = u.target), Number.isFinite(
|
|
4899
|
+
Number.isFinite(u.distance) && (l = u.target), Number.isFinite(g.distance) && (c = g.target);
|
|
4899
4900
|
for (let x = 0; x < t.steps.length - 1; x += 1) {
|
|
4900
4901
|
const y = t.steps[x], w = t.steps[x + 1], v = Math.abs(y.x - w.x) < 1e-3, k = Math.abs(y.y - w.y) < 1e-3;
|
|
4901
4902
|
if (v && c + s.height >= Math.min(y.y, w.y) - a && c <= Math.max(y.y, w.y) + a) {
|
|
4902
4903
|
const C = Math.min(y.y, w.y), P = Math.max(y.y, w.y);
|
|
4903
|
-
|
|
4904
|
+
p(y.x + r, {
|
|
4904
4905
|
from: new f([y.x + r, C]),
|
|
4905
4906
|
id: `edge-left-${x}`,
|
|
4906
4907
|
to: new f([y.x + r, P])
|
|
4907
|
-
}),
|
|
4908
|
+
}), p(y.x - r - s.width, {
|
|
4908
4909
|
from: new f([y.x - r, C]),
|
|
4909
4910
|
id: `edge-right-${x}`,
|
|
4910
4911
|
to: new f([y.x - r, P])
|
|
@@ -4923,8 +4924,8 @@ const Zr = class Zr extends G {
|
|
|
4923
4924
|
});
|
|
4924
4925
|
}
|
|
4925
4926
|
}
|
|
4926
|
-
Number.isFinite(u.distance) && (l = u.target), Number.isFinite(
|
|
4927
|
-
const b = [u,
|
|
4927
|
+
Number.isFinite(u.distance) && (l = u.target), Number.isFinite(g.distance) && (c = g.target);
|
|
4928
|
+
const b = [u, g].filter((x) => Number.isFinite(x.distance)).map((x) => x.guide);
|
|
4928
4929
|
return I(() => {
|
|
4929
4930
|
this.proposals = b;
|
|
4930
4931
|
}), new f([l, c]);
|
|
@@ -4945,7 +4946,7 @@ function ud(i, t, e) {
|
|
|
4945
4946
|
}
|
|
4946
4947
|
}
|
|
4947
4948
|
o(ud, "stepFromGateway");
|
|
4948
|
-
const pd = 5, Kr = class Kr extends
|
|
4949
|
+
const pd = 5, Kr = class Kr extends H {
|
|
4949
4950
|
hasRoutedPreview = !1;
|
|
4950
4951
|
previewRequestVersion = 0;
|
|
4951
4952
|
previewRafId = null;
|
|
@@ -5012,20 +5013,20 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5012
5013
|
try {
|
|
5013
5014
|
const a = this.diagram.canvas.inverseFit(s), l = this.axisConstrained && this.startAnchor ? Ke(this.startAnchor.point, a).point : a, c = this.snap.gridSize / 2, h = l.copy().divide(c).round.multiply(c);
|
|
5014
5015
|
if (this.axisConstrained && this.startAnchor) {
|
|
5015
|
-
const
|
|
5016
|
+
const p = Ke(
|
|
5016
5017
|
this.startAnchor.point,
|
|
5017
5018
|
l
|
|
5018
5019
|
);
|
|
5019
|
-
|
|
5020
|
+
p.axis === "horizontal" ? h.y = p.point.y : h.x = p.point.x;
|
|
5020
5021
|
}
|
|
5021
5022
|
const u = this.resolveStartAnchor(
|
|
5022
5023
|
e?.parent.box.middle ?? l,
|
|
5023
5024
|
this.axisConstrained
|
|
5024
5025
|
);
|
|
5025
5026
|
if (!u) return;
|
|
5026
|
-
let
|
|
5027
|
+
let g = [];
|
|
5027
5028
|
if (e)
|
|
5028
|
-
|
|
5029
|
+
g = this.previewRouter.findRouteBetween(
|
|
5029
5030
|
this.diagram,
|
|
5030
5031
|
u.gateway,
|
|
5031
5032
|
n.gateway,
|
|
@@ -5033,24 +5034,24 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5033
5034
|
n.displacement
|
|
5034
5035
|
);
|
|
5035
5036
|
else {
|
|
5036
|
-
const
|
|
5037
|
+
const p = new Mi(null, {
|
|
5037
5038
|
id: "fake",
|
|
5038
5039
|
label: "",
|
|
5039
5040
|
box: new S([...h.raw, 0, 0])
|
|
5040
5041
|
}), m = u.gateway.coordinates.substract(
|
|
5041
|
-
|
|
5042
|
+
p.getGateway("down").coordinates
|
|
5042
5043
|
).x, b = u.gateway.coordinates.substract(
|
|
5043
|
-
|
|
5044
|
+
p.getGateway("down").coordinates
|
|
5044
5045
|
).y, x = Math.abs(m) > Math.abs(b) ? m >= 0 ? "right" : "left" : b >= 0 ? "down" : "up";
|
|
5045
|
-
|
|
5046
|
+
g = this.previewRouter.findRouteBetween(
|
|
5046
5047
|
this.diagram,
|
|
5047
5048
|
u.gateway,
|
|
5048
|
-
|
|
5049
|
+
p.getGateway(x),
|
|
5049
5050
|
u.displacement
|
|
5050
5051
|
);
|
|
5051
5052
|
}
|
|
5052
5053
|
I(() => {
|
|
5053
|
-
this.startGateway === t && r === this.previewRequestVersion && (this._arrowSteps =
|
|
5054
|
+
this.startGateway === t && r === this.previewRequestVersion && (this._arrowSteps = g.map((p) => new f([p.x, p.y])), this.hasRoutedPreview = this._arrowSteps.length > 1);
|
|
5054
5055
|
});
|
|
5055
5056
|
} catch {
|
|
5056
5057
|
}
|
|
@@ -5058,11 +5059,11 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5058
5059
|
orthogonalMousePreview(t, e) {
|
|
5059
5060
|
const n = this.snap.gridSize / 2, s = e.copy().divide(n).round.multiply(n);
|
|
5060
5061
|
if (this.axisConstrained && this.startAnchor) {
|
|
5061
|
-
const
|
|
5062
|
+
const p = Ke(
|
|
5062
5063
|
this.startAnchor.point,
|
|
5063
5064
|
e
|
|
5064
5065
|
);
|
|
5065
|
-
|
|
5066
|
+
p.axis === "horizontal" ? s.y = p.point.y : s.x = p.point.x;
|
|
5066
5067
|
}
|
|
5067
5068
|
const r = t.point.copy(), a = ud(
|
|
5068
5069
|
this.snap.gridSize,
|
|
@@ -5071,8 +5072,8 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5071
5072
|
), l = [r, a];
|
|
5072
5073
|
if (Math.abs(a.x - s.x) < 1e-3 || Math.abs(a.y - s.y) < 1e-3)
|
|
5073
5074
|
return l.push(s), this.compactPreviewPoints(l);
|
|
5074
|
-
const c = new f([a.x, s.y]), h = new f([s.x, a.y]), u = Math.abs(s.x - a.x),
|
|
5075
|
-
return l.push(u >=
|
|
5075
|
+
const c = new f([a.x, s.y]), h = new f([s.x, a.y]), u = Math.abs(s.x - a.x), g = Math.abs(s.y - a.y);
|
|
5076
|
+
return l.push(u >= g ? h : c, s), this.compactPreviewPoints(l);
|
|
5076
5077
|
}
|
|
5077
5078
|
compactPreviewPoints(t) {
|
|
5078
5079
|
const e = [];
|
|
@@ -5129,7 +5130,7 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5129
5130
|
pointer: new f(t)
|
|
5130
5131
|
}, t.cancel(), this.unbindPendingConnection = Pt(
|
|
5131
5132
|
Bt(this, Kt, this.handlePendingMouseMove),
|
|
5132
|
-
Bt(this,
|
|
5133
|
+
Bt(this, dt, this.cancelPendingConnection)
|
|
5133
5134
|
));
|
|
5134
5135
|
}
|
|
5135
5136
|
handlePendingMouseMove(t) {
|
|
@@ -5170,7 +5171,7 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5170
5171
|
t.point.copy()
|
|
5171
5172
|
], this.u(), this.u = Pt(
|
|
5172
5173
|
Bt(this, Kt, this.handleMouseMove),
|
|
5173
|
-
Bt(this,
|
|
5174
|
+
Bt(this, dt, this.handleMouseUp)
|
|
5174
5175
|
), !0;
|
|
5175
5176
|
}
|
|
5176
5177
|
handleMouseMove(t) {
|
|
@@ -5235,7 +5236,7 @@ const pd = 5, Kr = class Kr extends G {
|
|
|
5235
5236
|
};
|
|
5236
5237
|
o(Kr, "NodesConnector");
|
|
5237
5238
|
let Fe = Kr;
|
|
5238
|
-
const Ur = class Ur extends
|
|
5239
|
+
const Ur = class Ur extends H {
|
|
5239
5240
|
init() {
|
|
5240
5241
|
this.diagram.onEvent(
|
|
5241
5242
|
pi,
|
|
@@ -5248,7 +5249,7 @@ const Ur = class Ur extends G {
|
|
|
5248
5249
|
o(Ur, "NodesResizer");
|
|
5249
5250
|
let xs = Ur;
|
|
5250
5251
|
var Ce;
|
|
5251
|
-
let Fl = (Ce = class extends
|
|
5252
|
+
let Fl = (Ce = class extends H {
|
|
5252
5253
|
grid = null;
|
|
5253
5254
|
points = null;
|
|
5254
5255
|
highlighted = /* @__PURE__ */ new Set();
|
|
@@ -5334,7 +5335,7 @@ const bo = "diagram-grid-visible", qr = class qr {
|
|
|
5334
5335
|
};
|
|
5335
5336
|
o(qr, "Rules");
|
|
5336
5337
|
let ys = qr;
|
|
5337
|
-
const Jr = class Jr extends
|
|
5338
|
+
const Jr = class Jr extends H {
|
|
5338
5339
|
straight = "none";
|
|
5339
5340
|
startCoordinates = null;
|
|
5340
5341
|
startProposals = [];
|
|
@@ -5359,7 +5360,7 @@ const Jr = class Jr extends G {
|
|
|
5359
5360
|
},
|
|
5360
5361
|
this.diagram.priorities.Mouse_Move_Straight_Drag
|
|
5361
5362
|
), this.diagram.onEvent(
|
|
5362
|
-
|
|
5363
|
+
dt,
|
|
5363
5364
|
() => {
|
|
5364
5365
|
this.reset();
|
|
5365
5366
|
},
|
|
@@ -5392,7 +5393,7 @@ const Jr = class Jr extends G {
|
|
|
5392
5393
|
};
|
|
5393
5394
|
o(Jr, "StraightDrag");
|
|
5394
5395
|
let ws = Jr;
|
|
5395
|
-
const Qr = class Qr extends
|
|
5396
|
+
const Qr = class Qr extends H {
|
|
5396
5397
|
shiftHeld = !1;
|
|
5397
5398
|
/** Tracks the Shift modifier globally so pointer-driven label timers share its current state. */
|
|
5398
5399
|
init() {
|
|
@@ -5639,9 +5640,9 @@ const yo = Sc(null), gd = /* @__PURE__ */ o(() => ({
|
|
|
5639
5640
|
id: l,
|
|
5640
5641
|
gateways: a.gateways.map((u) => ({
|
|
5641
5642
|
...u,
|
|
5642
|
-
outEdges: u.outEdges.map((
|
|
5643
|
-
...
|
|
5644
|
-
toParentId: r.get(
|
|
5643
|
+
outEdges: u.outEdges.map((g) => ({
|
|
5644
|
+
...g,
|
|
5645
|
+
toParentId: r.get(g.toParentId) || g.toParentId
|
|
5645
5646
|
}))
|
|
5646
5647
|
}))
|
|
5647
5648
|
}, r);
|
|
@@ -5683,12 +5684,12 @@ const yo = Sc(null), gd = /* @__PURE__ */ o(() => ({
|
|
|
5683
5684
|
});
|
|
5684
5685
|
this.add(u);
|
|
5685
5686
|
}), e.nodes.forEach((c) => {
|
|
5686
|
-
const h = n.get(c.id), u = this.getNodeById(h),
|
|
5687
|
+
const h = n.get(c.id), u = this.getNodeById(h), g = u.remapSerializedReferences({
|
|
5687
5688
|
...c,
|
|
5688
5689
|
id: h,
|
|
5689
|
-
gateways: c.gateways.map((
|
|
5690
|
-
...
|
|
5691
|
-
outEdges:
|
|
5690
|
+
gateways: c.gateways.map((p) => ({
|
|
5691
|
+
...p,
|
|
5692
|
+
outEdges: p.outEdges.map((m) => ({
|
|
5692
5693
|
...m,
|
|
5693
5694
|
toParentId: n.get(m.toParentId) || m.toParentId
|
|
5694
5695
|
}))
|
|
@@ -5700,7 +5701,7 @@ const yo = Sc(null), gd = /* @__PURE__ */ o(() => ({
|
|
|
5700
5701
|
c.box[3]
|
|
5701
5702
|
]
|
|
5702
5703
|
}, n);
|
|
5703
|
-
u.deserialize(
|
|
5704
|
+
u.deserialize(g);
|
|
5704
5705
|
});
|
|
5705
5706
|
}
|
|
5706
5707
|
});
|
|
@@ -5714,8 +5715,8 @@ const yo = Sc(null), gd = /* @__PURE__ */ o(() => ({
|
|
|
5714
5715
|
return !1;
|
|
5715
5716
|
let n = 1 / 0, s = 1 / 0, r = -1 / 0, a = -1 / 0;
|
|
5716
5717
|
for (const u of this.nodes) {
|
|
5717
|
-
const
|
|
5718
|
-
n = Math.min(n,
|
|
5718
|
+
const g = u.box;
|
|
5719
|
+
n = Math.min(n, g.x), s = Math.min(s, g.y), r = Math.max(r, g.x + g.width), a = Math.max(a, g.y + g.height);
|
|
5719
5720
|
}
|
|
5720
5721
|
if (!Number.isFinite(n) || !Number.isFinite(s) || !Number.isFinite(r) || !Number.isFinite(a))
|
|
5721
5722
|
return !1;
|
|
@@ -5757,7 +5758,7 @@ function In(i) {
|
|
|
5757
5758
|
return ["Enter", "Escape"].includes(i.code);
|
|
5758
5759
|
}
|
|
5759
5760
|
o(In, "allowEventInEdition");
|
|
5760
|
-
const ta = class ta extends
|
|
5761
|
+
const ta = class ta extends H {
|
|
5761
5762
|
inEdition = /* @__PURE__ */ new Set();
|
|
5762
5763
|
cancel() {
|
|
5763
5764
|
this.inEdition.forEach((t) => t.cancel()), this.inEdition.clear();
|
|
@@ -5811,8 +5812,8 @@ const $l = M(
|
|
|
5811
5812
|
i.classList.string
|
|
5812
5813
|
) ? " bpmn__node-label" : "";
|
|
5813
5814
|
n.style["--screen-label-font-size"] = `${i.state.labelFontSize ?? 14}px`;
|
|
5814
|
-
const
|
|
5815
|
-
return i.editionMode &&
|
|
5815
|
+
const g = i.diagram?.rules.allowEdition !== !1;
|
|
5816
|
+
return i.editionMode && g ? /* @__PURE__ */ d.jsx(
|
|
5816
5817
|
"textarea",
|
|
5817
5818
|
{
|
|
5818
5819
|
...n,
|
|
@@ -5820,16 +5821,16 @@ const $l = M(
|
|
|
5820
5821
|
className: `node__screenLabel node__screenHitArea editable__label${c}${h}${u}${i.selected ? " selected" : ""}`,
|
|
5821
5822
|
autoFocus: !0,
|
|
5822
5823
|
value: i.state.label,
|
|
5823
|
-
onChange: /* @__PURE__ */ o((
|
|
5824
|
+
onChange: /* @__PURE__ */ o((p) => {
|
|
5824
5825
|
I(() => {
|
|
5825
|
-
i.state.label =
|
|
5826
|
+
i.state.label = p.target.value;
|
|
5826
5827
|
});
|
|
5827
5828
|
}, "onChange"),
|
|
5828
|
-
onKeyDownCapture: /* @__PURE__ */ o((
|
|
5829
|
-
i.editionMode && !In(
|
|
5829
|
+
onKeyDownCapture: /* @__PURE__ */ o((p) => {
|
|
5830
|
+
i.editionMode && !In(p.nativeEvent) && p.nativeEvent.stopImmediatePropagation();
|
|
5830
5831
|
}, "onKeyDownCapture"),
|
|
5831
|
-
ref: /* @__PURE__ */ o((
|
|
5832
|
-
|
|
5832
|
+
ref: /* @__PURE__ */ o((p) => {
|
|
5833
|
+
p instanceof HTMLTextAreaElement && !e.current && (e.current = !0, p.select());
|
|
5833
5834
|
}, "ref")
|
|
5834
5835
|
}
|
|
5835
5836
|
) : (e.current = !1, i.state.label ? /* @__PURE__ */ d.jsx(
|
|
@@ -6142,7 +6143,7 @@ const ha = class ha extends Ot {
|
|
|
6142
6143
|
}
|
|
6143
6144
|
};
|
|
6144
6145
|
o(ha, "BPMNode");
|
|
6145
|
-
let
|
|
6146
|
+
let ht = ha;
|
|
6146
6147
|
var Rl = {
|
|
6147
6148
|
color: void 0,
|
|
6148
6149
|
size: void 0,
|
|
@@ -6677,7 +6678,7 @@ function uh(i, t) {
|
|
|
6677
6678
|
return i.stage === t.stage && i.kind === t.kind && i.direction === t.direction;
|
|
6678
6679
|
}
|
|
6679
6680
|
o(uh, "sameDefinition");
|
|
6680
|
-
const ua = class ua extends
|
|
6681
|
+
const ua = class ua extends ht {
|
|
6681
6682
|
definition;
|
|
6682
6683
|
attachedToTaskId;
|
|
6683
6684
|
attachmentOffset;
|
|
@@ -6850,13 +6851,13 @@ function ye(i, t) {
|
|
|
6850
6851
|
return `bpmn__event__${i[t]}`;
|
|
6851
6852
|
}
|
|
6852
6853
|
o(ye, "getEnumStr");
|
|
6853
|
-
var
|
|
6854
|
+
var R = /* @__PURE__ */ ((i) => (i[i.inclusive = 0] = "inclusive", i[i.exclusive = 1] = "exclusive", i[i.parallel = 2] = "parallel", i[i.eventBased = 3] = "eventBased", i[i.complex = 4] = "complex", i))(R || {});
|
|
6854
6855
|
const ph = 5, gh = 2, mh = 1.18;
|
|
6855
6856
|
function fh(i) {
|
|
6856
6857
|
return typeof i?.setDefault == "function";
|
|
6857
6858
|
}
|
|
6858
6859
|
o(fh, "canSetDefaultFlow");
|
|
6859
|
-
const pa = class pa extends
|
|
6860
|
+
const pa = class pa extends ht {
|
|
6860
6861
|
type = -1;
|
|
6861
6862
|
edgesAsGateways = !0;
|
|
6862
6863
|
occupiesGridSquare = !0;
|
|
@@ -6877,40 +6878,40 @@ const pa = class pa extends dt {
|
|
|
6877
6878
|
fh(n) && n.setDefault(!1);
|
|
6878
6879
|
})
|
|
6879
6880
|
);
|
|
6880
|
-
for (const e of Object.values(
|
|
6881
|
-
this.classList.delete(ye(
|
|
6881
|
+
for (const e of Object.values(R))
|
|
6882
|
+
this.classList.delete(ye(R, e));
|
|
6882
6883
|
switch (t) {
|
|
6883
6884
|
case 1:
|
|
6884
6885
|
this.classList.add(ye(
|
|
6885
|
-
|
|
6886
|
+
R,
|
|
6886
6887
|
1
|
|
6887
6888
|
/* exclusive */
|
|
6888
6889
|
));
|
|
6889
6890
|
break;
|
|
6890
6891
|
case 0:
|
|
6891
6892
|
this.classList.add(ye(
|
|
6892
|
-
|
|
6893
|
+
R,
|
|
6893
6894
|
0
|
|
6894
6895
|
/* inclusive */
|
|
6895
6896
|
));
|
|
6896
6897
|
break;
|
|
6897
6898
|
case 2:
|
|
6898
6899
|
this.classList.add(ye(
|
|
6899
|
-
|
|
6900
|
+
R,
|
|
6900
6901
|
2
|
|
6901
6902
|
/* parallel */
|
|
6902
6903
|
));
|
|
6903
6904
|
break;
|
|
6904
6905
|
case 3:
|
|
6905
6906
|
this.classList.add(ye(
|
|
6906
|
-
|
|
6907
|
+
R,
|
|
6907
6908
|
3
|
|
6908
6909
|
/* eventBased */
|
|
6909
6910
|
));
|
|
6910
6911
|
break;
|
|
6911
6912
|
case 4:
|
|
6912
6913
|
this.classList.add(ye(
|
|
6913
|
-
|
|
6914
|
+
R,
|
|
6914
6915
|
4
|
|
6915
6916
|
/* complex */
|
|
6916
6917
|
));
|
|
@@ -7131,7 +7132,7 @@ function Fn(i, t) {
|
|
|
7131
7132
|
return Number.isFinite(t.distance) && (!i || t.distance < i.distance) ? t : i;
|
|
7132
7133
|
}
|
|
7133
7134
|
o(Fn, "closer");
|
|
7134
|
-
const ma = class ma extends
|
|
7135
|
+
const ma = class ma extends H {
|
|
7135
7136
|
alignmentProposals = [];
|
|
7136
7137
|
/** Initializes the observable guide collection used by the diagram overlay. */
|
|
7137
7138
|
init() {
|
|
@@ -7152,18 +7153,18 @@ const ma = class ma extends G {
|
|
|
7152
7153
|
return s;
|
|
7153
7154
|
const l = r ?? t.minimumResizeSize;
|
|
7154
7155
|
if (!l) return s;
|
|
7155
|
-
const c = Io / 5 * 2, h = Io / 3, u = this.diagram.canvas.frameDimensions.norm,
|
|
7156
|
+
const c = Io / 5 * 2, h = Io / 3, u = this.diagram.canvas.frameDimensions.norm, g = u > 0 ? u / 2 : 1 / 0, p = n.includes("w"), m = n.includes("e"), b = n.includes("n"), x = n.includes("s");
|
|
7156
7157
|
let y = null, w = null;
|
|
7157
7158
|
for (const k of this.diagram.nodes) {
|
|
7158
|
-
if (k === t || !(k instanceof
|
|
7159
|
+
if (k === t || !(k instanceof ht)) continue;
|
|
7159
7160
|
const C = k.box;
|
|
7160
|
-
(
|
|
7161
|
+
(p || m) && Math.abs(e.edgeDistanceY(C)) < g && (y = Fn(
|
|
7161
7162
|
y,
|
|
7162
7163
|
this.sideCandidate(
|
|
7163
7164
|
l,
|
|
7164
7165
|
e,
|
|
7165
7166
|
C,
|
|
7166
|
-
|
|
7167
|
+
p ? "w" : "e",
|
|
7167
7168
|
c
|
|
7168
7169
|
)
|
|
7169
7170
|
), y = Fn(
|
|
@@ -7172,10 +7173,10 @@ const ma = class ma extends G {
|
|
|
7172
7173
|
l,
|
|
7173
7174
|
e,
|
|
7174
7175
|
C,
|
|
7175
|
-
|
|
7176
|
+
p,
|
|
7176
7177
|
c
|
|
7177
7178
|
)
|
|
7178
|
-
)), (b || x) && Math.abs(e.edgeDistanceX(C)) <
|
|
7179
|
+
)), (b || x) && Math.abs(e.edgeDistanceX(C)) < g && (w = Fn(
|
|
7179
7180
|
w,
|
|
7180
7181
|
this.sideCandidate(
|
|
7181
7182
|
l,
|
|
@@ -7272,7 +7273,7 @@ const ma = class ma extends G {
|
|
|
7272
7273
|
};
|
|
7273
7274
|
o(ma, "BPMNResizeSuggester");
|
|
7274
7275
|
let ie = ma;
|
|
7275
|
-
const fa = class fa extends
|
|
7276
|
+
const fa = class fa extends H {
|
|
7276
7277
|
autopan = new At(this.diagram);
|
|
7277
7278
|
session = null;
|
|
7278
7279
|
unbindSession = /* @__PURE__ */ o(() => {
|
|
@@ -7321,15 +7322,15 @@ const fa = class fa extends G {
|
|
|
7321
7322
|
/** Resizes from one handle while keeping the opposite sides anchored in place. */
|
|
7322
7323
|
resizeNodeFromDirection(t, e, n, s) {
|
|
7323
7324
|
if (t.diagram !== this.diagram) return !1;
|
|
7324
|
-
const r = this.diagram.getExtension(Y), a = r?.enabled === !0 ? r.gridSize : null, l = n.includes("w"), c = n.includes("e"), h = n.includes("n"), u = n.includes("s"),
|
|
7325
|
+
const r = this.diagram.getExtension(Y), a = r?.enabled === !0 ? r.gridSize : null, l = n.includes("w"), c = n.includes("e"), h = n.includes("n"), u = n.includes("s"), g = l ? e.x + e.width : this.diagram.canvas.size.x - e.x, p = h ? e.y + e.height : this.diagram.canvas.size.y - e.y, m = e.width + (c ? s.x : l ? -s.x : 0), b = e.height + (u ? s.y : h ? -s.y : 0), x = l || c ? this.constrain(
|
|
7325
7326
|
m,
|
|
7326
7327
|
t.minimumResizeSize.x,
|
|
7327
|
-
|
|
7328
|
+
g,
|
|
7328
7329
|
null
|
|
7329
7330
|
) : e.width, y = h || u ? this.constrain(
|
|
7330
7331
|
b,
|
|
7331
7332
|
t.minimumResizeSize.y,
|
|
7332
|
-
|
|
7333
|
+
p,
|
|
7333
7334
|
null
|
|
7334
7335
|
) : e.height, w = l ? e.x + e.width - x : e.x, v = h ? e.y + e.height - y : e.y, k = new S(
|
|
7335
7336
|
[w, v, x, y],
|
|
@@ -7547,7 +7548,7 @@ function vh(i) {
|
|
|
7547
7548
|
return Ht(i) ? new S([0, 0, 400, 250]) : new S([0, 0, 150, 100]);
|
|
7548
7549
|
}
|
|
7549
7550
|
o(vh, "defaultTaskBox");
|
|
7550
|
-
const xa = class xa extends
|
|
7551
|
+
const xa = class xa extends ht {
|
|
7551
7552
|
type = -1;
|
|
7552
7553
|
minimumResizeSize = new f([300, 200], !1);
|
|
7553
7554
|
multiInstance;
|
|
@@ -7739,7 +7740,7 @@ const xa = class xa extends dt {
|
|
|
7739
7740
|
};
|
|
7740
7741
|
o(xa, "TaskNode");
|
|
7741
7742
|
let D = xa;
|
|
7742
|
-
const ba = class ba extends
|
|
7743
|
+
const ba = class ba extends ht {
|
|
7743
7744
|
sourceType = "unknown";
|
|
7744
7745
|
constructor(t, e) {
|
|
7745
7746
|
super(t, {
|
|
@@ -7778,7 +7779,7 @@ function Lo(i, t) {
|
|
|
7778
7779
|
{ distance: Math.abs(e.y - r), x: e.x, y: r },
|
|
7779
7780
|
{ distance: Math.abs(a - e.y), x: e.x, y: a }
|
|
7780
7781
|
].reduce(
|
|
7781
|
-
(
|
|
7782
|
+
(g, p) => p.distance < g.distance ? p : g
|
|
7782
7783
|
);
|
|
7783
7784
|
l.assign([u.x, u.y]);
|
|
7784
7785
|
} else l.x > n && l.x < s ? l.y = e.y < r ? r : a : l.y > r && l.y < a && (l.x = e.x < n ? n : s);
|
|
@@ -7795,7 +7796,7 @@ function kh(i, t) {
|
|
|
7795
7796
|
return new S([s, r, i.width, i.height]);
|
|
7796
7797
|
}
|
|
7797
7798
|
o(kh, "clampInsideContainer");
|
|
7798
|
-
const ya = class ya extends
|
|
7799
|
+
const ya = class ya extends H {
|
|
7799
7800
|
draggedEventIds = /* @__PURE__ */ new Set();
|
|
7800
7801
|
/** Registers attachment projection after generic alignment and grid constraints. */
|
|
7801
7802
|
init() {
|
|
@@ -7804,7 +7805,7 @@ const ya = class ya extends G {
|
|
|
7804
7805
|
(t) => this.handleDrag(t),
|
|
7805
7806
|
this.diagram.priorities.Drag_Node_Snap_To_Grid - 1
|
|
7806
7807
|
), this.diagram.onEvent(
|
|
7807
|
-
|
|
7808
|
+
dt,
|
|
7808
7809
|
() => {
|
|
7809
7810
|
this.finishEventDrags(), this.clearDropPresentations();
|
|
7810
7811
|
},
|
|
@@ -7944,7 +7945,7 @@ function Bl(i) {
|
|
|
7944
7945
|
return i.children.length ? i.children.reduce((t, e) => t + Bl(e), 0) : 1;
|
|
7945
7946
|
}
|
|
7946
7947
|
o(Bl, "leafCount$1");
|
|
7947
|
-
const wa = class wa extends
|
|
7948
|
+
const wa = class wa extends H {
|
|
7948
7949
|
/** Initializes the extension, whose resize constraints are invoked by BPMN tools. */
|
|
7949
7950
|
init() {
|
|
7950
7951
|
this.diagram.onEvent(
|
|
@@ -7996,22 +7997,22 @@ const wa = class wa extends G {
|
|
|
7996
7997
|
({ lane: b }) => b.name === e.laneId
|
|
7997
7998
|
);
|
|
7998
7999
|
if (!a) return !1;
|
|
7999
|
-
const l = Bl(a.lane) * r.minimumLaneHeight, c = t.box, h = c.y + a.y, u = Math.max(l, e.height),
|
|
8000
|
+
const l = Bl(a.lane) * r.minimumLaneHeight, c = t.box, h = c.y + a.y, u = Math.max(l, e.height), g = new S(
|
|
8000
8001
|
[c.x, h, c.width, u],
|
|
8001
8002
|
!1
|
|
8002
|
-
),
|
|
8003
|
-
n?.enabled === !0 && (
|
|
8004
|
-
|
|
8003
|
+
), p = g.copy();
|
|
8004
|
+
n?.enabled === !0 && (p.height = this.snapGrowingEdge(
|
|
8005
|
+
g.bottomMiddle.y,
|
|
8005
8006
|
h + l,
|
|
8006
8007
|
s
|
|
8007
8008
|
) - h);
|
|
8008
8009
|
const m = this.diagram.getExtension(ie)?.suggest(
|
|
8009
8010
|
t,
|
|
8010
|
-
p,
|
|
8011
|
-
"s",
|
|
8012
8011
|
g,
|
|
8012
|
+
"s",
|
|
8013
|
+
p,
|
|
8013
8014
|
new f([c.width, l], !1)
|
|
8014
|
-
).height ??
|
|
8015
|
+
).height ?? p.height;
|
|
8015
8016
|
return t.resizeLane(e.laneId, m);
|
|
8016
8017
|
}
|
|
8017
8018
|
snapGrowingEdge(t, e, n) {
|
|
@@ -8025,18 +8026,18 @@ const wa = class wa extends G {
|
|
|
8025
8026
|
getLaneSuggestions(t, e) {
|
|
8026
8027
|
const n = this.diagram.getClass("Lanes");
|
|
8027
8028
|
if (!n || t instanceof n) return [];
|
|
8028
|
-
const s = this.diagram.nodes.filter((
|
|
8029
|
-
const m =
|
|
8030
|
-
return
|
|
8031
|
-
}).filter(({ laneBox:
|
|
8032
|
-
const b =
|
|
8033
|
-
return e.middle.x >= b && e.middle.x <=
|
|
8034
|
-
}).sort((
|
|
8029
|
+
const s = this.diagram.nodes.filter((p) => p instanceof n).flatMap((p) => {
|
|
8030
|
+
const m = p.box;
|
|
8031
|
+
return p.laneLayouts.filter(({ lane: b }) => b.children.length === 0).map((b) => ({ lanes: p, laneBox: m, layout: b }));
|
|
8032
|
+
}).filter(({ laneBox: p, layout: m }) => {
|
|
8033
|
+
const b = p.x + (m.depth + 1) * n.laneHeaderWidth, x = p.y + m.y;
|
|
8034
|
+
return e.middle.x >= b && e.middle.x <= p.x + p.width && e.middle.y >= x && e.middle.y <= x + m.height;
|
|
8035
|
+
}).sort((p, m) => m.layout.depth - p.layout.depth)[0];
|
|
8035
8036
|
if (!s) return [];
|
|
8036
8037
|
const r = this.diagram.getExtension(Y)?.gridSize ?? 50, { laneBox: a, layout: l } = s, c = a.y + l.y, u = [
|
|
8037
8038
|
a.x + (l.depth + 1) * n.laneHeaderWidth,
|
|
8038
8039
|
a.x + a.width
|
|
8039
|
-
],
|
|
8040
|
+
], g = [
|
|
8040
8041
|
{
|
|
8041
8042
|
nodeY: c + (l.height - e.height) / 2,
|
|
8042
8043
|
guideY: c + l.height / 2,
|
|
@@ -8044,21 +8045,21 @@ const wa = class wa extends G {
|
|
|
8044
8045
|
}
|
|
8045
8046
|
];
|
|
8046
8047
|
if (l.height > r * 3) {
|
|
8047
|
-
const
|
|
8048
|
-
|
|
8048
|
+
const p = r / 2;
|
|
8049
|
+
g.push(
|
|
8049
8050
|
{
|
|
8050
|
-
nodeY: c +
|
|
8051
|
-
guideY: c +
|
|
8051
|
+
nodeY: c + p,
|
|
8052
|
+
guideY: c + p,
|
|
8052
8053
|
range: u
|
|
8053
8054
|
},
|
|
8054
8055
|
{
|
|
8055
|
-
nodeY: c + l.height -
|
|
8056
|
-
guideY: c + l.height -
|
|
8056
|
+
nodeY: c + l.height - p - e.height,
|
|
8057
|
+
guideY: c + l.height - p,
|
|
8057
8058
|
range: u
|
|
8058
8059
|
}
|
|
8059
8060
|
);
|
|
8060
8061
|
}
|
|
8061
|
-
return
|
|
8062
|
+
return g;
|
|
8062
8063
|
}
|
|
8063
8064
|
getHorizontalLaneSuggestions(t, e) {
|
|
8064
8065
|
const n = this.diagram.getClass("Lanes");
|
|
@@ -8071,17 +8072,17 @@ const wa = class wa extends G {
|
|
|
8071
8072
|
return e.middle.x >= x && e.middle.x <= m.x + m.width && e.middle.y >= y && e.middle.y <= y + b.height;
|
|
8072
8073
|
}).sort((m, b) => b.layout.depth - m.layout.depth)[0];
|
|
8073
8074
|
if (!s) return [];
|
|
8074
|
-
const a = (this.diagram.getExtension(Y)?.gridSize ?? 50) / 2, { laneBox: l, layout: c } = s, h = l.y + c.y, u = l.x + (c.depth + 1) * n.laneHeaderWidth,
|
|
8075
|
+
const a = (this.diagram.getExtension(Y)?.gridSize ?? 50) / 2, { laneBox: l, layout: c } = s, h = l.y + c.y, u = l.x + (c.depth + 1) * n.laneHeaderWidth, g = l.x + l.width, p = [h, h + c.height];
|
|
8075
8076
|
return [
|
|
8076
8077
|
{
|
|
8077
8078
|
nodeX: u + a,
|
|
8078
8079
|
guideX: u + a,
|
|
8079
|
-
range:
|
|
8080
|
+
range: p
|
|
8080
8081
|
},
|
|
8081
8082
|
{
|
|
8082
|
-
nodeX:
|
|
8083
|
-
guideX:
|
|
8084
|
-
range:
|
|
8083
|
+
nodeX: g - a - e.width,
|
|
8084
|
+
guideX: g - a,
|
|
8085
|
+
range: p
|
|
8085
8086
|
}
|
|
8086
8087
|
];
|
|
8087
8088
|
}
|
|
@@ -8092,7 +8093,7 @@ const va = class va extends st {
|
|
|
8092
8093
|
};
|
|
8093
8094
|
o(va, "BPMNLaneChangeEvent");
|
|
8094
8095
|
let Xt = va;
|
|
8095
|
-
const _a = class _a extends
|
|
8096
|
+
const _a = class _a extends H {
|
|
8096
8097
|
autopan = new At(this.diagram);
|
|
8097
8098
|
session = null;
|
|
8098
8099
|
unbindSession = /* @__PURE__ */ o(() => {
|
|
@@ -8156,7 +8157,7 @@ const _a = class _a extends G {
|
|
|
8156
8157
|
};
|
|
8157
8158
|
o(_a, "BPMNLaneResizer");
|
|
8158
8159
|
let ve = _a;
|
|
8159
|
-
const Ea = class Ea extends
|
|
8160
|
+
const Ea = class Ea extends ht {
|
|
8160
8161
|
minimumResizeSize = new f([300, 100], !1);
|
|
8161
8162
|
edgesAsGateways = !0;
|
|
8162
8163
|
constructor(t, e) {
|
|
@@ -8210,7 +8211,7 @@ const Ea = class Ea extends dt {
|
|
|
8210
8211
|
});
|
|
8211
8212
|
};
|
|
8212
8213
|
o(Ea, "BlackBoxPoolNode");
|
|
8213
|
-
let
|
|
8214
|
+
let ft = Ea;
|
|
8214
8215
|
const Sh = M(
|
|
8215
8216
|
({ node: i }) => {
|
|
8216
8217
|
const t = i.diagram?.bpmnLabels ?? Ft, e = q(!1), n = i.box, s = Math.min(20, n.width / 4, n.height / 4), r = i.state.labelFontSize ?? 16, a = Math.min(
|
|
@@ -8243,27 +8244,27 @@ const Sh = M(
|
|
|
8243
8244
|
pointerEvents: "all",
|
|
8244
8245
|
textAlign: "center",
|
|
8245
8246
|
whiteSpace: "pre"
|
|
8246
|
-
},
|
|
8247
|
-
return (!i.editionMode || !
|
|
8248
|
-
(!i.editionMode || !
|
|
8249
|
-
i.editionMode &&
|
|
8247
|
+
}, g = i.diagram?.rules.allowEdition !== !1;
|
|
8248
|
+
return (!i.editionMode || !g) && (e.current = !1), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
8249
|
+
(!i.editionMode || !g) && i.state.label && /* @__PURE__ */ d.jsx("pre", { ...c, className: h, style: u, children: i.state.label }),
|
|
8250
|
+
i.editionMode && g && /* @__PURE__ */ d.jsx(
|
|
8250
8251
|
"textarea",
|
|
8251
8252
|
{
|
|
8252
8253
|
...c,
|
|
8253
8254
|
"aria-label": t.inputs.blackBoxPoolName,
|
|
8254
8255
|
autoFocus: !0,
|
|
8255
8256
|
className: h,
|
|
8256
|
-
onChange: /* @__PURE__ */ o((
|
|
8257
|
+
onChange: /* @__PURE__ */ o((p) => {
|
|
8257
8258
|
I(() => {
|
|
8258
|
-
i.state.label =
|
|
8259
|
+
i.state.label = p.target.value;
|
|
8259
8260
|
});
|
|
8260
8261
|
}, "onChange"),
|
|
8261
|
-
onKeyDownCapture: /* @__PURE__ */ o((
|
|
8262
|
-
In(
|
|
8262
|
+
onKeyDownCapture: /* @__PURE__ */ o((p) => {
|
|
8263
|
+
In(p.nativeEvent) || p.nativeEvent.stopImmediatePropagation();
|
|
8263
8264
|
}, "onKeyDownCapture"),
|
|
8264
|
-
onMouseDown: /* @__PURE__ */ o((
|
|
8265
|
-
ref: /* @__PURE__ */ o((
|
|
8266
|
-
|
|
8265
|
+
onMouseDown: /* @__PURE__ */ o((p) => p.nativeEvent.stopImmediatePropagation(), "onMouseDown"),
|
|
8266
|
+
ref: /* @__PURE__ */ o((p) => {
|
|
8267
|
+
p && !e.current && (e.current = !0, p.select());
|
|
8267
8268
|
}, "ref"),
|
|
8268
8269
|
rows: 1,
|
|
8269
8270
|
style: {
|
|
@@ -8278,7 +8279,7 @@ const Sh = M(
|
|
|
8278
8279
|
/* @__PURE__ */ d.jsx(sn, { node: i })
|
|
8279
8280
|
] });
|
|
8280
8281
|
}
|
|
8281
|
-
), ka = class ka extends
|
|
8282
|
+
), ka = class ka extends ht {
|
|
8282
8283
|
requiredEdgePathType = "straight";
|
|
8283
8284
|
occupiesGridSquare = !0;
|
|
8284
8285
|
constructor(t, e) {
|
|
@@ -8305,8 +8306,8 @@ const Sh = M(
|
|
|
8305
8306
|
] }) }));
|
|
8306
8307
|
};
|
|
8307
8308
|
o(ka, "DataStoreNode");
|
|
8308
|
-
let
|
|
8309
|
-
const Sa = class Sa extends
|
|
8309
|
+
let _t = ka;
|
|
8310
|
+
const Sa = class Sa extends ht {
|
|
8310
8311
|
minimumResizeSize = new f([0, 0], !1);
|
|
8311
8312
|
edgesAsGateways = !0;
|
|
8312
8313
|
constructor(t, e) {
|
|
@@ -8374,7 +8375,7 @@ const Sa = class Sa extends dt {
|
|
|
8374
8375
|
});
|
|
8375
8376
|
};
|
|
8376
8377
|
o(Sa, "DocumentAnnotationNode");
|
|
8377
|
-
let
|
|
8378
|
+
let ut = Sa;
|
|
8378
8379
|
const Mh = M(
|
|
8379
8380
|
({ node: i }) => {
|
|
8380
8381
|
const t = i.diagram?.bpmnLabels ?? Ft, e = q(!1), n = i.box, s = Math.min(8, n.width / 6, n.height / 6), r = new S([
|
|
@@ -8451,7 +8452,7 @@ const Do = new Set(
|
|
|
8451
8452
|
Object.values(kt).filter(
|
|
8452
8453
|
(i) => typeof i == "number"
|
|
8453
8454
|
)
|
|
8454
|
-
), Ma = class Ma extends
|
|
8455
|
+
), Ma = class Ma extends ht {
|
|
8455
8456
|
type = -1;
|
|
8456
8457
|
requiredEdgePathType = "straight";
|
|
8457
8458
|
occupiesGridSquare = !0;
|
|
@@ -8508,16 +8509,16 @@ const Ah = M(
|
|
|
8508
8509
|
const t = i.diagram?.bpmnLabels ?? Ft, e = i.box, n = i.diagram?.rules.allowEdition !== !1, s = q(null), r = i.laneLayouts;
|
|
8509
8510
|
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
8510
8511
|
r.map(({ lane: a, depth: l, y: c, height: h, siblingCount: u }) => {
|
|
8511
|
-
const
|
|
8512
|
-
e.x + l *
|
|
8512
|
+
const g = new S([
|
|
8513
|
+
e.x + l * ct.laneHeaderWidth,
|
|
8513
8514
|
e.y + c,
|
|
8514
|
-
|
|
8515
|
+
ct.laneHeaderWidth,
|
|
8515
8516
|
h
|
|
8516
|
-
]),
|
|
8517
|
+
]), p = Dt(i, g), m = n && i.editingLaneId === a.name, b = l === 0 ? u > 1 : u > 2;
|
|
8517
8518
|
return /* @__PURE__ */ Qn(
|
|
8518
8519
|
"div",
|
|
8519
8520
|
{
|
|
8520
|
-
...
|
|
8521
|
+
...p,
|
|
8521
8522
|
key: a.name,
|
|
8522
8523
|
className: `node__screenHitArea lane__screenHeader${m ? " lane__screenHeader--editing" : ""}${i.selected ? " selected" : ""}`,
|
|
8523
8524
|
onDoubleClick: n ? () => i.renameLane(a.name) : void 0
|
|
@@ -8527,7 +8528,7 @@ const Ah = M(
|
|
|
8527
8528
|
{
|
|
8528
8529
|
className: "lane__screenLabel",
|
|
8529
8530
|
style: {
|
|
8530
|
-
fontSize: `calc(${
|
|
8531
|
+
fontSize: `calc(${ct.laneHeaderFontSize}px * var(--diagram-canvas-scale, 1))`
|
|
8531
8532
|
},
|
|
8532
8533
|
children: a.label
|
|
8533
8534
|
}
|
|
@@ -8709,12 +8710,12 @@ function Ih(i) {
|
|
|
8709
8710
|
o(Ih, "normalizeLanes");
|
|
8710
8711
|
function Yl(i, t) {
|
|
8711
8712
|
if (!i.children.length) {
|
|
8712
|
-
const s = Math.max(
|
|
8713
|
+
const s = Math.max(ct.minimumLaneHeight, t);
|
|
8713
8714
|
return i.height === s ? !1 : (i.height = s, !0);
|
|
8714
8715
|
}
|
|
8715
8716
|
let e = !1, n = t - ge(i);
|
|
8716
8717
|
for (let s = i.children.length - 1; s >= 0; s--) {
|
|
8717
|
-
const r = i.children[s], a = ge(r), l = Fs(r) *
|
|
8718
|
+
const r = i.children[s], a = ge(r), l = Fs(r) * ct.minimumLaneHeight, c = Math.max(
|
|
8718
8719
|
l - a,
|
|
8719
8720
|
n
|
|
8720
8721
|
);
|
|
@@ -8723,7 +8724,7 @@ function Yl(i, t) {
|
|
|
8723
8724
|
return e;
|
|
8724
8725
|
}
|
|
8725
8726
|
o(Yl, "resizeLaneLeaves");
|
|
8726
|
-
const it = class it extends
|
|
8727
|
+
const it = class it extends ht {
|
|
8727
8728
|
edgesAsGateways = !1;
|
|
8728
8729
|
pools;
|
|
8729
8730
|
constructor(t, e) {
|
|
@@ -8927,8 +8928,8 @@ const it = class it extends dt {
|
|
|
8927
8928
|
});
|
|
8928
8929
|
};
|
|
8929
8930
|
o(it, "Lanes"), Nt(it, "laneHeaderWidth", 50), Nt(it, "laneHeight", 250), Nt(it, "laneHeaderFontSize", 16), Nt(it, "minimumLaneHeight", 150), Nt(it, "minimumWidthInGrids", 10);
|
|
8930
|
-
let
|
|
8931
|
-
const Ca = class Ca extends
|
|
8931
|
+
let ct = it;
|
|
8932
|
+
const Ca = class Ca extends ht {
|
|
8932
8933
|
edgesAsGateways = !0;
|
|
8933
8934
|
requiredEdgePathType = "straight";
|
|
8934
8935
|
constructor(t, e) {
|
|
@@ -8953,17 +8954,17 @@ const Ca = class Ca extends dt {
|
|
|
8953
8954
|
/** Computes text-driven annotation bounds capped at six configured grid units. */
|
|
8954
8955
|
get box() {
|
|
8955
8956
|
const t = this.state.box, n = (this.diagram?.getExtension(Y)?.gridSize ?? 50) * 6, s = Math.max(this.state.labelFontSize ?? 14, 12), r = s * 0.58, a = (this.state.label || " ").split(`
|
|
8956
|
-
`), l = Math.max(...a.map((
|
|
8957
|
+
`), l = Math.max(...a.map((p) => p.length), 1), c = Math.min(
|
|
8957
8958
|
n,
|
|
8958
8959
|
Math.max(t.width, l * r + 28)
|
|
8959
8960
|
), h = Math.max(1, Math.floor((c - 28) / r)), u = a.reduce(
|
|
8960
|
-
(
|
|
8961
|
+
(p, m) => p + Math.max(1, Math.ceil(m.length / h)),
|
|
8961
8962
|
0
|
|
8962
|
-
),
|
|
8963
|
+
), g = Math.min(
|
|
8963
8964
|
n,
|
|
8964
8965
|
Math.max(t.height, u * s * 1.35 + 24)
|
|
8965
8966
|
);
|
|
8966
|
-
return new S([t.x, t.y, c,
|
|
8967
|
+
return new S([t.x, t.y, c, g]);
|
|
8967
8968
|
}
|
|
8968
8969
|
/** Persists the computed annotation size rather than its original minimum box. */
|
|
8969
8970
|
serialize() {
|
|
@@ -8976,7 +8977,7 @@ const Ca = class Ca extends dt {
|
|
|
8976
8977
|
RenderOverlay = M(() => /* @__PURE__ */ d.jsx("div", { ...et(this), children: /* @__PURE__ */ d.jsx("span", { className: "bpmn__annotation_bracket" }) }));
|
|
8977
8978
|
};
|
|
8978
8979
|
o(Ca, "TextAnnotationNode");
|
|
8979
|
-
let
|
|
8980
|
+
let pt = Ca;
|
|
8980
8981
|
const _e = [
|
|
8981
8982
|
{ id: "task", family: "task", section: "activities", priority: 1, enabled: !0, connectable: !0 },
|
|
8982
8983
|
{ id: "serviceTask", family: "task", section: "activities", priority: 1, enabled: !0, connectable: !0 },
|
|
@@ -9087,14 +9088,14 @@ const Aa = class Aa {
|
|
|
9087
9088
|
if (t instanceof A)
|
|
9088
9089
|
return t.kind === "none" ? t.stage : t.kind === "message" ? t.isCatching ? "messageCatch" : "messageThrow" : t.kind;
|
|
9089
9090
|
if (t instanceof Z)
|
|
9090
|
-
return t.type ===
|
|
9091
|
-
if (t instanceof
|
|
9092
|
-
if (t instanceof
|
|
9093
|
-
if (t instanceof
|
|
9091
|
+
return t.type === R.inclusive ? "inclusive" : t.type === R.parallel ? "parallel" : t.type === R.eventBased ? "eventBased" : t.type === R.complex ? "complex" : "exclusive";
|
|
9092
|
+
if (t instanceof ct) return "lanes";
|
|
9093
|
+
if (t instanceof ft) return "blackBoxPool";
|
|
9094
|
+
if (t instanceof _t) return "dataStore";
|
|
9094
9095
|
if (t instanceof at)
|
|
9095
9096
|
return t.type === kt.input ? "dataInput" : t.type === kt.output ? "dataOutput" : "document";
|
|
9096
|
-
if (t instanceof
|
|
9097
|
-
if (t instanceof
|
|
9097
|
+
if (t instanceof ut) return "documentAnnotation";
|
|
9098
|
+
if (t instanceof pt) return "textAnnotation";
|
|
9098
9099
|
}
|
|
9099
9100
|
/** Creates an unmounted node for the requested catalog element identifier. */
|
|
9100
9101
|
static create(t, e, n) {
|
|
@@ -9153,19 +9154,19 @@ const Aa = class Aa {
|
|
|
9153
9154
|
case "terminate":
|
|
9154
9155
|
return new A(null, { ...s, type: j.terminate });
|
|
9155
9156
|
case "inclusive":
|
|
9156
|
-
return new Z(null, { ...s, type:
|
|
9157
|
+
return new Z(null, { ...s, type: R.inclusive });
|
|
9157
9158
|
case "parallel":
|
|
9158
|
-
return new Z(null, { ...s, type:
|
|
9159
|
+
return new Z(null, { ...s, type: R.parallel });
|
|
9159
9160
|
case "eventBased":
|
|
9160
|
-
return new Z(null, { ...s, type:
|
|
9161
|
+
return new Z(null, { ...s, type: R.eventBased });
|
|
9161
9162
|
case "complex":
|
|
9162
|
-
return new Z(null, { ...s, type:
|
|
9163
|
+
return new Z(null, { ...s, type: R.complex });
|
|
9163
9164
|
case "lanes":
|
|
9164
|
-
return new
|
|
9165
|
+
return new ct(null, { id: e });
|
|
9165
9166
|
case "blackBoxPool":
|
|
9166
|
-
return new
|
|
9167
|
+
return new ft(null, s);
|
|
9167
9168
|
case "dataStore":
|
|
9168
|
-
return new
|
|
9169
|
+
return new _t(null, s);
|
|
9169
9170
|
case "document":
|
|
9170
9171
|
return new at(null, s);
|
|
9171
9172
|
case "dataInput":
|
|
@@ -9173,11 +9174,11 @@ const Aa = class Aa {
|
|
|
9173
9174
|
case "dataOutput":
|
|
9174
9175
|
return new at(null, { ...s, type: kt.output });
|
|
9175
9176
|
case "documentAnnotation":
|
|
9176
|
-
return new ht(null, s);
|
|
9177
|
-
case "textAnnotation":
|
|
9178
9177
|
return new ut(null, s);
|
|
9178
|
+
case "textAnnotation":
|
|
9179
|
+
return new pt(null, s);
|
|
9179
9180
|
default:
|
|
9180
|
-
return new Z(null, { ...s, type:
|
|
9181
|
+
return new Z(null, { ...s, type: R.exclusive });
|
|
9181
9182
|
}
|
|
9182
9183
|
}
|
|
9183
9184
|
/** Mutates a node to another enabled variant in the same semantic family. */
|
|
@@ -9201,7 +9202,7 @@ const Aa = class Aa {
|
|
|
9201
9202
|
}
|
|
9202
9203
|
if (t instanceof Z)
|
|
9203
9204
|
return t.setType(
|
|
9204
|
-
e === "inclusive" ?
|
|
9205
|
+
e === "inclusive" ? R.inclusive : e === "parallel" ? R.parallel : e === "eventBased" ? R.eventBased : e === "complex" ? R.complex : R.exclusive
|
|
9205
9206
|
), !0;
|
|
9206
9207
|
if (t instanceof at) {
|
|
9207
9208
|
const r = e === "dataInput" ? kt.input : e === "dataOutput" ? kt.output : e === "document" ? kt.normal : null;
|
|
@@ -9211,7 +9212,7 @@ const Aa = class Aa {
|
|
|
9211
9212
|
}
|
|
9212
9213
|
};
|
|
9213
9214
|
o(Aa, "BPMNElementCatalog");
|
|
9214
|
-
let
|
|
9215
|
+
let lt = Aa;
|
|
9215
9216
|
function Th(i) {
|
|
9216
9217
|
return i instanceof A && i.attachedToTaskId !== null && i.kind === "compensation";
|
|
9217
9218
|
}
|
|
@@ -9233,7 +9234,7 @@ const ri = class ri extends ee {
|
|
|
9233
9234
|
}
|
|
9234
9235
|
get supportsDefaultFlow() {
|
|
9235
9236
|
const t = this.state.from?.parent;
|
|
9236
|
-
return this.kind === "sequenceFlow" && !!this.state.to && t instanceof Z && (t.type ===
|
|
9237
|
+
return this.kind === "sequenceFlow" && !!this.state.to && t instanceof Z && (t.type === R.exclusive || t.type === R.inclusive);
|
|
9237
9238
|
}
|
|
9238
9239
|
constructor(t, e) {
|
|
9239
9240
|
super(t, e), this.kind = e.kind ?? (e.to ? ri.inferKind(e.from.parent, e.to.parent) : null) ?? "sequenceFlow", this.condition = e.condition ?? "", this.defaultFlow = !1, this.directedFlow = e.isDirected ?? this.supportsDirection, z(this, {
|
|
@@ -9253,7 +9254,7 @@ const ri = class ri extends ee {
|
|
|
9253
9254
|
}
|
|
9254
9255
|
/** Infers the legal BPMN connection type for two concrete endpoint nodes. */
|
|
9255
9256
|
static inferKind(t, e) {
|
|
9256
|
-
return t instanceof
|
|
9257
|
+
return t instanceof pt || e instanceof pt || t instanceof ut || e instanceof ut ? "association" : Th(t) ? e instanceof D && e.compensation ? "association" : null : (t instanceof _t || t instanceof at) && e instanceof D ? "inputDataAssociation" : t instanceof D && (e instanceof _t || e instanceof at) ? "outputDataAssociation" : t instanceof ft && (e instanceof ft || e instanceof D || e instanceof A || e instanceof Z) || e instanceof ft && (t instanceof D || t instanceof A || t instanceof Z) || t instanceof A && t.kind === "message" && !t.isCatching && (e instanceof A || e instanceof Z) ? "messageFlow" : (t instanceof D || t instanceof A || t instanceof Z) && (e instanceof D || e instanceof A || e instanceof Z) ? t instanceof A && t.isEnd || e instanceof A && (e.isStart || e.attachedToTaskId) || t instanceof Z && t.type === R.eventBased && !(e instanceof A && e.isCatching && ["message", "timer", "signal", "conditional"].includes(e.kind) || e instanceof D && e.type === O.receive) ? null : "sequenceFlow" : null;
|
|
9257
9258
|
}
|
|
9258
9259
|
/** Updates connection semantics and reapplies the standard BPMN edge styling. */
|
|
9259
9260
|
setKind(t) {
|
|
@@ -9314,7 +9315,7 @@ const ri = class ri extends ee {
|
|
|
9314
9315
|
}
|
|
9315
9316
|
};
|
|
9316
9317
|
o(ri, "BPMNEdge");
|
|
9317
|
-
let
|
|
9318
|
+
let wt = ri;
|
|
9318
9319
|
function zo(i) {
|
|
9319
9320
|
return i.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase();
|
|
9320
9321
|
}
|
|
@@ -9326,7 +9327,7 @@ function Oo({
|
|
|
9326
9327
|
onSelect: n,
|
|
9327
9328
|
selectedId: s
|
|
9328
9329
|
}) {
|
|
9329
|
-
const [r, a] =
|
|
9330
|
+
const [r, a] = vt(""), l = q(null), c = zo(r.trim()), h = c ? t.filter(
|
|
9330
9331
|
(u) => zo(e.elements[u.id]).includes(c)
|
|
9331
9332
|
) : t;
|
|
9332
9333
|
return Si(() => {
|
|
@@ -9433,22 +9434,22 @@ function Rn({
|
|
|
9433
9434
|
label: n,
|
|
9434
9435
|
onDragStart: s
|
|
9435
9436
|
}) {
|
|
9436
|
-
const [r, a] =
|
|
9437
|
+
const [r, a] = vt(!1), [l, c] = vt(!1), [h, u] = vt({ left: !1, top: -4 }), g = q(null), p = q(null), m = q(() => {
|
|
9437
9438
|
}), b = q(!1), x = q(null);
|
|
9438
9439
|
qt(
|
|
9439
9440
|
() => () => {
|
|
9440
|
-
|
|
9441
|
+
g.current !== null && window.clearTimeout(g.current), p.current !== null && window.clearTimeout(p.current), m.current();
|
|
9441
9442
|
},
|
|
9442
9443
|
[]
|
|
9443
9444
|
), Si(() => {
|
|
9444
9445
|
if (!r || !x.current) return;
|
|
9445
9446
|
const N = x.current.querySelector(".bpmn__element_menu");
|
|
9446
9447
|
if (!N) return;
|
|
9447
|
-
const T = x.current.getBoundingClientRect(),
|
|
9448
|
+
const T = x.current.getBoundingClientRect(), G = N.getBoundingClientRect(), J = document.querySelector(".toolbar")?.getBoundingClientRect();
|
|
9448
9449
|
u(
|
|
9449
9450
|
Lh(
|
|
9450
9451
|
T,
|
|
9451
|
-
|
|
9452
|
+
G,
|
|
9452
9453
|
{ width: window.innerWidth, height: window.innerHeight },
|
|
9453
9454
|
J
|
|
9454
9455
|
)
|
|
@@ -9457,29 +9458,29 @@ function Rn({
|
|
|
9457
9458
|
r && l && c(!1);
|
|
9458
9459
|
}, [l, r]);
|
|
9459
9460
|
const y = /* @__PURE__ */ o(() => {
|
|
9460
|
-
|
|
9461
|
+
g.current !== null && window.clearTimeout(g.current), p.current !== null && window.clearTimeout(p.current), g.current = null, p.current = null;
|
|
9461
9462
|
}, "clearTimers"), w = /* @__PURE__ */ o(() => {
|
|
9462
9463
|
y(), a(!0);
|
|
9463
9464
|
}, "show"), v = /* @__PURE__ */ o(() => {
|
|
9464
|
-
r ||
|
|
9465
|
-
|
|
9465
|
+
r || g.current !== null || (p.current !== null && window.clearTimeout(p.current), p.current = null, g.current = window.setTimeout(() => {
|
|
9466
|
+
g.current = null, a(!0);
|
|
9466
9467
|
}, 250));
|
|
9467
9468
|
}, "showAfterDelay"), k = /* @__PURE__ */ o(() => {
|
|
9468
|
-
y(),
|
|
9469
|
+
y(), p.current = window.setTimeout(() => a(!1), 180);
|
|
9469
9470
|
}, "hideSoon"), C = /* @__PURE__ */ o((N) => {
|
|
9470
9471
|
if (!s || N.button !== 0) return;
|
|
9471
9472
|
m.current();
|
|
9472
|
-
const T = N.clientX,
|
|
9473
|
-
document.removeEventListener("mousemove",
|
|
9473
|
+
const T = N.clientX, G = N.clientY, J = N, X = /* @__PURE__ */ o(() => {
|
|
9474
|
+
document.removeEventListener("mousemove", ot), document.removeEventListener("mouseup", X), m.current = () => {
|
|
9474
9475
|
};
|
|
9475
|
-
}, "cleanup"),
|
|
9476
|
+
}, "cleanup"), ot = /* @__PURE__ */ o(($t) => {
|
|
9476
9477
|
if (($t.buttons & 1) === 0) {
|
|
9477
9478
|
X();
|
|
9478
9479
|
return;
|
|
9479
9480
|
}
|
|
9480
|
-
Math.hypot($t.clientX - T, $t.clientY -
|
|
9481
|
+
Math.hypot($t.clientX - T, $t.clientY - G) < 5 || (X(), b.current = !0, s(J));
|
|
9481
9482
|
}, "handleMouseMove");
|
|
9482
|
-
m.current = X, document.addEventListener("mousemove",
|
|
9483
|
+
m.current = X, document.addEventListener("mousemove", ot), document.addEventListener("mouseup", X);
|
|
9483
9484
|
}, "prepareDrag"), P = /* @__PURE__ */ o(() => {
|
|
9484
9485
|
if (b.current) {
|
|
9485
9486
|
b.current = !1;
|
|
@@ -9532,21 +9533,21 @@ const $o = M(({ extension: i }) => {
|
|
|
9532
9533
|
) });
|
|
9533
9534
|
}), Fh = M(
|
|
9534
9535
|
({ diagram: i, extension: t }) => {
|
|
9535
|
-
const e = t.labels, n = i.getExtension(V), s = n.selectedNodes, r = n.selectedEdges, a = i.rules?.allowEdition !== !1, [l, c] =
|
|
9536
|
+
const e = t.labels, n = i.getExtension(V), s = n.selectedNodes, r = n.selectedEdges, a = i.rules?.allowEdition !== !1, [l, c] = vt({
|
|
9536
9537
|
edgeId: "",
|
|
9537
9538
|
x: 0,
|
|
9538
9539
|
y: 0
|
|
9539
|
-
}), h = q(null), u = /* @__PURE__ */ o((
|
|
9540
|
-
if (
|
|
9541
|
-
|
|
9542
|
-
const m = l.edgeId ===
|
|
9540
|
+
}), h = q(null), u = /* @__PURE__ */ o((g, p) => {
|
|
9541
|
+
if (g.button !== 0) return;
|
|
9542
|
+
g.preventDefault(), g.stopPropagation(), g.nativeEvent.stopImmediatePropagation();
|
|
9543
|
+
const m = l.edgeId === p ? l : { x: 0, y: 0 };
|
|
9543
9544
|
h.current = {
|
|
9544
|
-
edgeId:
|
|
9545
|
+
edgeId: p,
|
|
9545
9546
|
offsetX: m.x,
|
|
9546
9547
|
offsetY: m.y,
|
|
9547
|
-
pointerId:
|
|
9548
|
-
startX:
|
|
9549
|
-
startY:
|
|
9548
|
+
pointerId: g.pointerId,
|
|
9549
|
+
startX: g.clientX,
|
|
9550
|
+
startY: g.clientY
|
|
9550
9551
|
};
|
|
9551
9552
|
const b = /* @__PURE__ */ o((w) => {
|
|
9552
9553
|
const v = h.current;
|
|
@@ -9558,34 +9559,34 @@ const $o = M(({ extension: i }) => {
|
|
|
9558
9559
|
}, "move"), x = /* @__PURE__ */ o(() => {
|
|
9559
9560
|
document.removeEventListener("pointermove", b), document.removeEventListener("pointerup", y), document.removeEventListener("pointercancel", y), h.current = null;
|
|
9560
9561
|
}, "cleanup"), y = /* @__PURE__ */ o((w) => {
|
|
9561
|
-
w.pointerId ===
|
|
9562
|
+
w.pointerId === g.pointerId && x();
|
|
9562
9563
|
}, "finish");
|
|
9563
9564
|
document.addEventListener("pointermove", b, { passive: !1 }), document.addEventListener("pointerup", y, { once: !0 }), document.addEventListener("pointercancel", y, { once: !0 });
|
|
9564
9565
|
}, "startEdgeToolbarDrag");
|
|
9565
9566
|
return t.dragging || t.connecting || s.length + r.length !== 1 ? null : /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
9566
|
-
s.map((
|
|
9567
|
-
if (
|
|
9568
|
-
const
|
|
9567
|
+
s.map((g) => {
|
|
9568
|
+
if (g instanceof ct) return null;
|
|
9569
|
+
const p = a ? t.transformTargets(g) : [], m = lt.forNode(g), b = a ? t.shapeOptions(g) : [], x = a ? t.connectionTargets(g) : [], y = g instanceof Ot && Oh(g), w = y ? g.labelScreenBox : null, v = w ? new S([
|
|
9569
9570
|
w.x + w.width / 2,
|
|
9570
9571
|
w.y + w.height + 8,
|
|
9571
9572
|
1,
|
|
9572
9573
|
1
|
|
9573
9574
|
]) : new S([
|
|
9574
|
-
|
|
9575
|
-
|
|
9575
|
+
g.box.x + g.box.width + 10,
|
|
9576
|
+
g.box.y + g.box.height / 2,
|
|
9576
9577
|
1,
|
|
9577
9578
|
1
|
|
9578
9579
|
]);
|
|
9579
9580
|
return /* @__PURE__ */ Qn(
|
|
9580
9581
|
"div",
|
|
9581
9582
|
{
|
|
9582
|
-
...Dt(
|
|
9583
|
+
...Dt(g, v),
|
|
9583
9584
|
className: `bpmn__selection_toolbar${y ? " bpmn__selection_toolbar--below-external-label" : ""}`,
|
|
9584
9585
|
"data-diagram-interactive-ui": "true",
|
|
9585
|
-
key:
|
|
9586
|
+
key: g.id,
|
|
9586
9587
|
onMouseDown: Fo
|
|
9587
9588
|
},
|
|
9588
|
-
|
|
9589
|
+
p.length > 0 && /* @__PURE__ */ d.jsx(
|
|
9589
9590
|
Rn,
|
|
9590
9591
|
{
|
|
9591
9592
|
icon: /* @__PURE__ */ d.jsx(Vt, { id: "transform" }),
|
|
@@ -9595,7 +9596,7 @@ const $o = M(({ extension: i }) => {
|
|
|
9595
9596
|
{
|
|
9596
9597
|
items: b,
|
|
9597
9598
|
labels: e,
|
|
9598
|
-
onSelect: /* @__PURE__ */ o((k) => t.transform(
|
|
9599
|
+
onSelect: /* @__PURE__ */ o((k) => t.transform(g, k.id), "onSelect"),
|
|
9599
9600
|
selectedId: m?.id
|
|
9600
9601
|
}
|
|
9601
9602
|
)
|
|
@@ -9607,13 +9608,13 @@ const $o = M(({ extension: i }) => {
|
|
|
9607
9608
|
focusSearchOnClick: !0,
|
|
9608
9609
|
icon: /* @__PURE__ */ d.jsx(Vt, { id: "connect" }),
|
|
9609
9610
|
label: e.actions.connect,
|
|
9610
|
-
onDragStart: /* @__PURE__ */ o((k) => t.startToolbarConnection(
|
|
9611
|
+
onDragStart: /* @__PURE__ */ o((k) => t.startToolbarConnection(g, k), "onDragStart"),
|
|
9611
9612
|
children: /* @__PURE__ */ d.jsx(
|
|
9612
9613
|
Oo,
|
|
9613
9614
|
{
|
|
9614
9615
|
items: x,
|
|
9615
9616
|
labels: e,
|
|
9616
|
-
onSelect: /* @__PURE__ */ o((k) => t.appendConnected(
|
|
9617
|
+
onSelect: /* @__PURE__ */ o((k) => t.appendConnected(g, k.id), "onSelect")
|
|
9617
9618
|
}
|
|
9618
9619
|
)
|
|
9619
9620
|
}
|
|
@@ -9621,17 +9622,17 @@ const $o = M(({ extension: i }) => {
|
|
|
9621
9622
|
/* @__PURE__ */ d.jsx($o, { extension: t })
|
|
9622
9623
|
);
|
|
9623
9624
|
}),
|
|
9624
|
-
r.map((
|
|
9625
|
-
if (!(
|
|
9626
|
-
const
|
|
9625
|
+
r.map((g) => {
|
|
9626
|
+
if (!(g instanceof wt) || g.steps.length === 0) return null;
|
|
9627
|
+
const p = i.canvas.inverseFit(
|
|
9627
9628
|
i.canvas.frameDimensions
|
|
9628
9629
|
), m = zh(
|
|
9629
|
-
|
|
9630
|
-
|
|
9630
|
+
g.steps,
|
|
9631
|
+
p,
|
|
9631
9632
|
48 / Math.max(i.canvas.scale, 1e-3)
|
|
9632
9633
|
), b = {
|
|
9633
|
-
"--bpmn-edge-toolbar-offset-x": `${l.edgeId ===
|
|
9634
|
-
"--bpmn-edge-toolbar-offset-y": `${l.edgeId ===
|
|
9634
|
+
"--bpmn-edge-toolbar-offset-x": `${l.edgeId === g.id ? l.x : 0}px`,
|
|
9635
|
+
"--bpmn-edge-toolbar-offset-y": `${l.edgeId === g.id ? l.y : 0}px`,
|
|
9635
9636
|
"--screen-renderer-x": `${m.x}px`,
|
|
9636
9637
|
"--screen-renderer-y": `${m.y}px`,
|
|
9637
9638
|
"--screen-renderer-width": "1px",
|
|
@@ -9651,7 +9652,7 @@ const $o = M(({ extension: i }) => {
|
|
|
9651
9652
|
{
|
|
9652
9653
|
"aria-label": "Move edge toolbar",
|
|
9653
9654
|
className: "bpmn__selection_toolbar_drag_handle",
|
|
9654
|
-
onPointerDown: /* @__PURE__ */ o((x) => u(x,
|
|
9655
|
+
onPointerDown: /* @__PURE__ */ o((x) => u(x, g.id), "onPointerDown"),
|
|
9655
9656
|
title: "Move toolbar",
|
|
9656
9657
|
type: "button",
|
|
9657
9658
|
children: /* @__PURE__ */ d.jsx("span", { "aria-hidden": "true", children: "•••" })
|
|
@@ -9663,11 +9664,11 @@ const $o = M(({ extension: i }) => {
|
|
|
9663
9664
|
{
|
|
9664
9665
|
icon: /* @__PURE__ */ d.jsx(Vt, { id: "transform" }),
|
|
9665
9666
|
label: e.actions.transform,
|
|
9666
|
-
children: /* @__PURE__ */ d.jsx("div", { className: "bpmn__element_menu", role: "menu", children: t.edgeKindOptions(
|
|
9667
|
+
children: /* @__PURE__ */ d.jsx("div", { className: "bpmn__element_menu", role: "menu", children: t.edgeKindOptions(g).filter((x) => x !== g.kind).map((x) => /* @__PURE__ */ d.jsxs(
|
|
9667
9668
|
"button",
|
|
9668
9669
|
{
|
|
9669
9670
|
className: "bpmn__element_menu_item",
|
|
9670
|
-
onClick: /* @__PURE__ */ o(() => t.changeEdgeKind(
|
|
9671
|
+
onClick: /* @__PURE__ */ o(() => t.changeEdgeKind(g, x), "onClick"),
|
|
9671
9672
|
role: "menuitem",
|
|
9672
9673
|
type: "button",
|
|
9673
9674
|
children: [
|
|
@@ -9683,7 +9684,7 @@ const $o = M(({ extension: i }) => {
|
|
|
9683
9684
|
"button",
|
|
9684
9685
|
{
|
|
9685
9686
|
"aria-label": e.actions.reverseDirection,
|
|
9686
|
-
onClick: /* @__PURE__ */ o(() => t.reverseEdge(
|
|
9687
|
+
onClick: /* @__PURE__ */ o(() => t.reverseEdge(g), "onClick"),
|
|
9687
9688
|
title: e.actions.reverseDirection,
|
|
9688
9689
|
type: "button",
|
|
9689
9690
|
children: /* @__PURE__ */ d.jsx(Gd, { "aria-hidden": "true" })
|
|
@@ -9693,7 +9694,7 @@ const $o = M(({ extension: i }) => {
|
|
|
9693
9694
|
/* @__PURE__ */ d.jsx($o, { extension: t })
|
|
9694
9695
|
]
|
|
9695
9696
|
},
|
|
9696
|
-
|
|
9697
|
+
g.id
|
|
9697
9698
|
);
|
|
9698
9699
|
})
|
|
9699
9700
|
] });
|
|
@@ -9716,7 +9717,7 @@ function Ro({
|
|
|
9716
9717
|
children: i,
|
|
9717
9718
|
title: t
|
|
9718
9719
|
}) {
|
|
9719
|
-
const [e, n] =
|
|
9720
|
+
const [e, n] = vt(!0), s = Ic();
|
|
9720
9721
|
return /* @__PURE__ */ d.jsxs("section", { className: "bpmn__properties_section", children: [
|
|
9721
9722
|
/* @__PURE__ */ d.jsxs(
|
|
9722
9723
|
"button",
|
|
@@ -9763,18 +9764,18 @@ function Hh({
|
|
|
9763
9764
|
o(Hh, "PropertiesSections");
|
|
9764
9765
|
const Kl = M(
|
|
9765
9766
|
({ diagram: i, extension: t, sections: e }) => {
|
|
9766
|
-
const n = i.getExtension(V), s = n.selectedNodes.length === 1 ? n.selectedNodes[0] : null, r = n.selectedEdges.length === 1 ? n.selectedEdges[0] : null, a = t.propertiesPanelOpen && !!(s || r) && !t.dragging, l = s ?
|
|
9767
|
+
const n = i.getExtension(V), s = n.selectedNodes.length === 1 ? n.selectedNodes[0] : null, r = n.selectedEdges.length === 1 ? n.selectedEdges[0] : null, a = t.propertiesPanelOpen && !!(s || r) && !t.dragging, l = s ? lt.forNode(s) : void 0, c = s ? t.shapeOptions(s) : [], h = t.labels, u = i.rules?.allowEdition !== !1, g = u || e?.additionalEditable === !0;
|
|
9767
9768
|
return /* @__PURE__ */ d.jsxs(
|
|
9768
9769
|
"aside",
|
|
9769
9770
|
{
|
|
9770
9771
|
"aria-hidden": !a,
|
|
9771
|
-
"aria-readonly": !
|
|
9772
|
-
className: `bpmn__properties_panel${a ? " bpmn__properties_panel--open" : ""}${
|
|
9772
|
+
"aria-readonly": !g,
|
|
9773
|
+
className: `bpmn__properties_panel${a ? " bpmn__properties_panel--open" : ""}${g ? "" : " bpmn__properties_panel--readonly"}`,
|
|
9773
9774
|
children: [
|
|
9774
9775
|
/* @__PURE__ */ d.jsxs("header", { children: [
|
|
9775
9776
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
|
9776
9777
|
/* @__PURE__ */ d.jsx("span", { children: h.properties.title }),
|
|
9777
|
-
/* @__PURE__ */ d.jsx("strong", { children: l ? h.elements[l.id] : r instanceof
|
|
9778
|
+
/* @__PURE__ */ d.jsx("strong", { children: l ? h.elements[l.id] : r instanceof wt ? h.edges[r.kind] : "" })
|
|
9778
9779
|
] }),
|
|
9779
9780
|
/* @__PURE__ */ d.jsx(
|
|
9780
9781
|
"button",
|
|
@@ -9794,7 +9795,7 @@ const Kl = M(
|
|
|
9794
9795
|
/* @__PURE__ */ d.jsx(
|
|
9795
9796
|
"textarea",
|
|
9796
9797
|
{
|
|
9797
|
-
onChange: /* @__PURE__ */ o((
|
|
9798
|
+
onChange: /* @__PURE__ */ o((p) => t.renameNode(s, p.target.value), "onChange"),
|
|
9798
9799
|
value: s.state.label
|
|
9799
9800
|
}
|
|
9800
9801
|
)
|
|
@@ -9804,9 +9805,9 @@ const Kl = M(
|
|
|
9804
9805
|
/* @__PURE__ */ d.jsx(
|
|
9805
9806
|
"select",
|
|
9806
9807
|
{
|
|
9807
|
-
onChange: /* @__PURE__ */ o((
|
|
9808
|
+
onChange: /* @__PURE__ */ o((p) => t.transform(s, p.target.value), "onChange"),
|
|
9808
9809
|
value: l.id,
|
|
9809
|
-
children: c.map((
|
|
9810
|
+
children: c.map((p) => p && /* @__PURE__ */ d.jsx("option", { value: p.id, children: h.elements[p.id] }, p.id))
|
|
9810
9811
|
}
|
|
9811
9812
|
)
|
|
9812
9813
|
] }),
|
|
@@ -9816,12 +9817,12 @@ const Kl = M(
|
|
|
9816
9817
|
/* @__PURE__ */ d.jsx(
|
|
9817
9818
|
"select",
|
|
9818
9819
|
{
|
|
9819
|
-
onChange: /* @__PURE__ */ o((
|
|
9820
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEventKind(
|
|
9820
9821
|
s,
|
|
9821
|
-
|
|
9822
|
+
p.target.value
|
|
9822
9823
|
), "onChange"),
|
|
9823
9824
|
value: s.kind,
|
|
9824
|
-
children: t.eventKindOptions(s).map((
|
|
9825
|
+
children: t.eventKindOptions(s).map((p) => /* @__PURE__ */ d.jsx("option", { value: p, children: h.elements[p === "none" ? "event" : p] }, p))
|
|
9825
9826
|
}
|
|
9826
9827
|
)
|
|
9827
9828
|
] }),
|
|
@@ -9830,12 +9831,12 @@ const Kl = M(
|
|
|
9830
9831
|
/* @__PURE__ */ d.jsx(
|
|
9831
9832
|
"select",
|
|
9832
9833
|
{
|
|
9833
|
-
onChange: /* @__PURE__ */ o((
|
|
9834
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEventStage(
|
|
9834
9835
|
s,
|
|
9835
|
-
|
|
9836
|
+
p.target.value
|
|
9836
9837
|
), "onChange"),
|
|
9837
9838
|
value: s.stage,
|
|
9838
|
-
children: t.eventStageOptions(s).map((
|
|
9839
|
+
children: t.eventStageOptions(s).map((p) => /* @__PURE__ */ d.jsx("option", { value: p, children: h.eventOptions[p] }, p))
|
|
9839
9840
|
}
|
|
9840
9841
|
)
|
|
9841
9842
|
] }),
|
|
@@ -9844,12 +9845,12 @@ const Kl = M(
|
|
|
9844
9845
|
/* @__PURE__ */ d.jsx(
|
|
9845
9846
|
"select",
|
|
9846
9847
|
{
|
|
9847
|
-
onChange: /* @__PURE__ */ o((
|
|
9848
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEventDirection(
|
|
9848
9849
|
s,
|
|
9849
|
-
|
|
9850
|
+
p.target.value
|
|
9850
9851
|
), "onChange"),
|
|
9851
9852
|
value: s.direction,
|
|
9852
|
-
children: t.eventDirectionOptions(s).map((
|
|
9853
|
+
children: t.eventDirectionOptions(s).map((p) => /* @__PURE__ */ d.jsx("option", { value: p, children: h.eventOptions[p] }, p))
|
|
9853
9854
|
}
|
|
9854
9855
|
)
|
|
9855
9856
|
] }),
|
|
@@ -9858,9 +9859,9 @@ const Kl = M(
|
|
|
9858
9859
|
"input",
|
|
9859
9860
|
{
|
|
9860
9861
|
checked: s.interrupting,
|
|
9861
|
-
onChange: /* @__PURE__ */ o((
|
|
9862
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEventInterrupting(
|
|
9862
9863
|
s,
|
|
9863
|
-
|
|
9864
|
+
p.target.checked
|
|
9864
9865
|
), "onChange"),
|
|
9865
9866
|
type: "checkbox"
|
|
9866
9867
|
}
|
|
@@ -9874,14 +9875,14 @@ const Kl = M(
|
|
|
9874
9875
|
/* @__PURE__ */ d.jsxs(
|
|
9875
9876
|
"select",
|
|
9876
9877
|
{
|
|
9877
|
-
onChange: /* @__PURE__ */ o((
|
|
9878
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEventSubprocessStartKind(
|
|
9878
9879
|
s,
|
|
9879
|
-
|
|
9880
|
+
p.target.value
|
|
9880
9881
|
), "onChange"),
|
|
9881
9882
|
value: t.eventSubprocessStartKind(s),
|
|
9882
9883
|
children: [
|
|
9883
9884
|
/* @__PURE__ */ d.jsx("option", { disabled: !0, value: "", children: h.eventOptions.none }),
|
|
9884
|
-
Rh.map((
|
|
9885
|
+
Rh.map((p) => /* @__PURE__ */ d.jsx("option", { value: p, children: h.elements[p] }, p))
|
|
9885
9886
|
]
|
|
9886
9887
|
}
|
|
9887
9888
|
)
|
|
@@ -9891,7 +9892,7 @@ const Kl = M(
|
|
|
9891
9892
|
"input",
|
|
9892
9893
|
{
|
|
9893
9894
|
checked: s.loop,
|
|
9894
|
-
onChange: /* @__PURE__ */ o((
|
|
9895
|
+
onChange: /* @__PURE__ */ o((p) => t.changeTaskLoop(s, p.target.checked), "onChange"),
|
|
9895
9896
|
type: "checkbox"
|
|
9896
9897
|
}
|
|
9897
9898
|
),
|
|
@@ -9902,9 +9903,9 @@ const Kl = M(
|
|
|
9902
9903
|
"input",
|
|
9903
9904
|
{
|
|
9904
9905
|
checked: s.multiInstance === "parallel",
|
|
9905
|
-
onChange: /* @__PURE__ */ o((
|
|
9906
|
+
onChange: /* @__PURE__ */ o((p) => t.changeTaskMultiInstance(
|
|
9906
9907
|
s,
|
|
9907
|
-
|
|
9908
|
+
p.target.checked ? "parallel" : "none"
|
|
9908
9909
|
), "onChange"),
|
|
9909
9910
|
type: "checkbox"
|
|
9910
9911
|
}
|
|
@@ -9916,9 +9917,9 @@ const Kl = M(
|
|
|
9916
9917
|
"input",
|
|
9917
9918
|
{
|
|
9918
9919
|
checked: s.compensation,
|
|
9919
|
-
onChange: /* @__PURE__ */ o((
|
|
9920
|
+
onChange: /* @__PURE__ */ o((p) => t.changeTaskCompensation(
|
|
9920
9921
|
s,
|
|
9921
|
-
|
|
9922
|
+
p.target.checked
|
|
9922
9923
|
), "onChange"),
|
|
9923
9924
|
type: "checkbox"
|
|
9924
9925
|
}
|
|
@@ -9930,7 +9931,7 @@ const Kl = M(
|
|
|
9930
9931
|
"input",
|
|
9931
9932
|
{
|
|
9932
9933
|
checked: s.adHoc,
|
|
9933
|
-
onChange: /* @__PURE__ */ o((
|
|
9934
|
+
onChange: /* @__PURE__ */ o((p) => t.changeTaskAdHoc(s, p.target.checked), "onChange"),
|
|
9934
9935
|
type: "checkbox"
|
|
9935
9936
|
}
|
|
9936
9937
|
),
|
|
@@ -9941,7 +9942,7 @@ const Kl = M(
|
|
|
9941
9942
|
"input",
|
|
9942
9943
|
{
|
|
9943
9944
|
checked: s.transaction,
|
|
9944
|
-
onChange: /* @__PURE__ */ o((
|
|
9945
|
+
onChange: /* @__PURE__ */ o((p) => t.changeTaskTransaction(s, p.target.checked), "onChange"),
|
|
9945
9946
|
type: "checkbox"
|
|
9946
9947
|
}
|
|
9947
9948
|
),
|
|
@@ -9949,13 +9950,13 @@ const Kl = M(
|
|
|
9949
9950
|
] })
|
|
9950
9951
|
] })
|
|
9951
9952
|
] }),
|
|
9952
|
-
r instanceof
|
|
9953
|
+
r instanceof wt && /* @__PURE__ */ d.jsxs("fieldset", { className: "bpmn__properties_fields", disabled: !u, children: [
|
|
9953
9954
|
/* @__PURE__ */ d.jsxs("label", { children: [
|
|
9954
9955
|
/* @__PURE__ */ d.jsx("span", { children: h.properties.name }),
|
|
9955
9956
|
/* @__PURE__ */ d.jsx(
|
|
9956
9957
|
"input",
|
|
9957
9958
|
{
|
|
9958
|
-
onChange: /* @__PURE__ */ o((
|
|
9959
|
+
onChange: /* @__PURE__ */ o((p) => t.renameEdge(r, p.target.value), "onChange"),
|
|
9959
9960
|
type: "text",
|
|
9960
9961
|
value: r.labels[0]?.text ?? ""
|
|
9961
9962
|
}
|
|
@@ -9966,9 +9967,9 @@ const Kl = M(
|
|
|
9966
9967
|
/* @__PURE__ */ d.jsx(
|
|
9967
9968
|
"select",
|
|
9968
9969
|
{
|
|
9969
|
-
onChange: /* @__PURE__ */ o((
|
|
9970
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEdgeKind(r, p.target.value), "onChange"),
|
|
9970
9971
|
value: r.kind,
|
|
9971
|
-
children: t.edgeKindOptions(r).map((
|
|
9972
|
+
children: t.edgeKindOptions(r).map((p) => /* @__PURE__ */ d.jsx("option", { value: p, children: h.edges[p] }, p))
|
|
9972
9973
|
}
|
|
9973
9974
|
)
|
|
9974
9975
|
] }),
|
|
@@ -9977,12 +9978,12 @@ const Kl = M(
|
|
|
9977
9978
|
/* @__PURE__ */ d.jsx(
|
|
9978
9979
|
"select",
|
|
9979
9980
|
{
|
|
9980
|
-
onChange: /* @__PURE__ */ o((
|
|
9981
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEdgePathType(
|
|
9981
9982
|
r,
|
|
9982
|
-
|
|
9983
|
+
p.target.value
|
|
9983
9984
|
), "onChange"),
|
|
9984
9985
|
value: r.pathType,
|
|
9985
|
-
children: $h.map((
|
|
9986
|
+
children: $h.map((p) => /* @__PURE__ */ d.jsx("option", { value: p, children: h.routing[p] }, p))
|
|
9986
9987
|
}
|
|
9987
9988
|
)
|
|
9988
9989
|
] }),
|
|
@@ -9991,7 +9992,7 @@ const Kl = M(
|
|
|
9991
9992
|
/* @__PURE__ */ d.jsx(
|
|
9992
9993
|
"textarea",
|
|
9993
9994
|
{
|
|
9994
|
-
onChange: /* @__PURE__ */ o((
|
|
9995
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEdgeCondition(r, p.target.value), "onChange"),
|
|
9995
9996
|
rows: 4,
|
|
9996
9997
|
value: r.condition
|
|
9997
9998
|
}
|
|
@@ -10002,7 +10003,7 @@ const Kl = M(
|
|
|
10002
10003
|
"input",
|
|
10003
10004
|
{
|
|
10004
10005
|
checked: r.isDefault,
|
|
10005
|
-
onChange: /* @__PURE__ */ o((
|
|
10006
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEdgeDefault(r, p.target.checked), "onChange"),
|
|
10006
10007
|
type: "checkbox"
|
|
10007
10008
|
}
|
|
10008
10009
|
),
|
|
@@ -10013,7 +10014,7 @@ const Kl = M(
|
|
|
10013
10014
|
"input",
|
|
10014
10015
|
{
|
|
10015
10016
|
checked: r.isDirected,
|
|
10016
|
-
onChange: /* @__PURE__ */ o((
|
|
10017
|
+
onChange: /* @__PURE__ */ o((p) => t.changeEdgeDirected(r, p.target.checked), "onChange"),
|
|
10017
10018
|
type: "checkbox"
|
|
10018
10019
|
}
|
|
10019
10020
|
),
|
|
@@ -10027,11 +10028,11 @@ const Kl = M(
|
|
|
10027
10028
|
}
|
|
10028
10029
|
);
|
|
10029
10030
|
function Gh(i, t, e) {
|
|
10030
|
-
if (!(t instanceof
|
|
10031
|
+
if (!(t instanceof pt || t instanceof ut) || !(t instanceof pt && e === "documentAnnotation" || t instanceof ut && e === "textAnnotation")) return null;
|
|
10031
10032
|
const n = new Set(t.gateways.flatMap((r) => [
|
|
10032
10033
|
...r.incomingEdges,
|
|
10033
10034
|
...r.outgoingEdges
|
|
10034
|
-
])), s =
|
|
10035
|
+
])), s = lt.create(e, t.id, t.state.label);
|
|
10035
10036
|
return I(() => {
|
|
10036
10037
|
s.state = { ...t.state, box: t.box, selected: !1 }, i.delete(t), i.add(s), n.forEach((r) => {
|
|
10037
10038
|
const a = r.from.parent === t ? s.findAutomaticGatewayAnchor(r.to.parent === t ? s.box.middle : r.to.parent.box.middle) : r.resolveEndpointAnchor("from"), l = r.to.parent === t ? s.findAutomaticGatewayAnchor(r.from.parent === t ? s.box.middle : r.from.parent.box.middle) : r.resolveEndpointAnchor("to");
|
|
@@ -10080,7 +10081,7 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10080
10081
|
"compensation",
|
|
10081
10082
|
"signal",
|
|
10082
10083
|
"multiple"
|
|
10083
|
-
]), Gn = "bpmn-properties-panel-open", Wh = 24, Ia = class Ia extends
|
|
10084
|
+
]), Gn = "bpmn-properties-panel-open", Wh = 24, Ia = class Ia extends H {
|
|
10084
10085
|
dragging = !1;
|
|
10085
10086
|
propertiesPanelOpen = !1;
|
|
10086
10087
|
RenderDiagram = Fh;
|
|
@@ -10105,15 +10106,15 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10105
10106
|
propertiesPanelOpen: E,
|
|
10106
10107
|
appendConnected: _,
|
|
10107
10108
|
configureLabels: _
|
|
10108
|
-
}), typeof window < "u" && (this.propertiesPanelOpen = window.localStorage.getItem(Gn) === "true"), this.diagram.registerClass(
|
|
10109
|
-
(!
|
|
10109
|
+
}), typeof window < "u" && (this.propertiesPanelOpen = window.localStorage.getItem(Gn) === "true"), this.diagram.registerClass(wt), this.diagram.setDefaultEdge(wt), this.diagram.onEvent(hi, (t) => {
|
|
10110
|
+
(!wt.inferKind(t.origin, t.target) || t.origin instanceof A && t.origin.attachedToTaskId && t.origin.kind === "compensation" && t.origin.gateways.some(
|
|
10110
10111
|
(e) => e.outgoingEdges.some((n) => n !== t.edge)
|
|
10111
10112
|
)) && t.cancel();
|
|
10112
10113
|
}), this.diagram.onEvent(jt, () => {
|
|
10113
10114
|
I(() => {
|
|
10114
10115
|
this.dragging = !0;
|
|
10115
10116
|
});
|
|
10116
|
-
}), this.diagram.onEvent(
|
|
10117
|
+
}), this.diagram.onEvent(dt, () => {
|
|
10117
10118
|
I(() => {
|
|
10118
10119
|
this.dragging = !1;
|
|
10119
10120
|
});
|
|
@@ -10121,10 +10122,10 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10121
10122
|
}
|
|
10122
10123
|
/** Returns legal enabled transformations that preserve current connections. */
|
|
10123
10124
|
transformTargets(t) {
|
|
10124
|
-
const e =
|
|
10125
|
+
const e = lt.forNode(t);
|
|
10125
10126
|
if (!e) return [];
|
|
10126
10127
|
const n = t.gateways.some((r) => r.incomingEdges.length), s = t.gateways.some((r) => r.outgoingEdges.length);
|
|
10127
|
-
return
|
|
10128
|
+
return lt.enabled().filter((r) => !(r.family !== e.family || r.id === e.id || r.id === "start" && n || (r.id === "end" || r.id === "terminate") && s || t instanceof A && t.attachedToTaskId && ![
|
|
10128
10129
|
"timer",
|
|
10129
10130
|
"messageCatch",
|
|
10130
10131
|
"signal",
|
|
@@ -10135,13 +10136,13 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10135
10136
|
}
|
|
10136
10137
|
/** Returns transform choices in stable catalog order including the current type. */
|
|
10137
10138
|
shapeOptions(t) {
|
|
10138
|
-
const e =
|
|
10139
|
+
const e = lt.forNode(t);
|
|
10139
10140
|
if (!e) return [];
|
|
10140
10141
|
const n = /* @__PURE__ */ new Set([
|
|
10141
10142
|
e.id,
|
|
10142
10143
|
...this.transformTargets(t).map((s) => s.id)
|
|
10143
10144
|
]);
|
|
10144
|
-
return
|
|
10145
|
+
return lt.enabled().filter((s) => n.has(s.id));
|
|
10145
10146
|
}
|
|
10146
10147
|
/** Changes a node variant through the shared catalog and emits history state. */
|
|
10147
10148
|
transform(t, e) {
|
|
@@ -10150,19 +10151,19 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10150
10151
|
const n = Gh(this.diagram, t, e);
|
|
10151
10152
|
if (n)
|
|
10152
10153
|
return t.selected && this.diagram.getExtension(V).selectNode(n), !0;
|
|
10153
|
-
const s =
|
|
10154
|
+
const s = lt.transform(t, e);
|
|
10154
10155
|
return s && t instanceof Z && t.gateways.forEach(
|
|
10155
10156
|
(r) => r.outgoingEdges.forEach((a) => {
|
|
10156
|
-
a instanceof
|
|
10157
|
+
a instanceof wt && !a.supportsDefaultFlow && a.setDefault(!1);
|
|
10157
10158
|
})
|
|
10158
10159
|
), s;
|
|
10159
10160
|
}
|
|
10160
10161
|
/** Returns enabled target elements that form a legal outgoing BPMN connection. */
|
|
10161
10162
|
connectionTargets(t) {
|
|
10162
10163
|
if (t instanceof A && t.attachedToTaskId && t.kind === "compensation")
|
|
10163
|
-
return t.gateways.some((n) => n.outgoingEdges.length) ? [] :
|
|
10164
|
-
const e =
|
|
10165
|
-
return e ?
|
|
10164
|
+
return t.gateways.some((n) => n.outgoingEdges.length) ? [] : lt.enabled().filter(({ id: n }) => n === "task");
|
|
10165
|
+
const e = lt.idForNode(t);
|
|
10166
|
+
return e ? lt.enabled().filter((n) => {
|
|
10166
10167
|
const s = n.connectable && this.inferDefinitionKind(e, n.id);
|
|
10167
10168
|
return !!s && !(t instanceof A && t.isEnd && s === "sequenceFlow");
|
|
10168
10169
|
}) : [];
|
|
@@ -10175,8 +10176,8 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10175
10176
|
}
|
|
10176
10177
|
/** Creates and connects a catalog node at the nearest collision-free position. */
|
|
10177
10178
|
appendConnected(t, e) {
|
|
10178
|
-
if (!this.connectionTargets(t).some((
|
|
10179
|
-
const n = De(this.diagram, e), r = t instanceof A && t.attachedToTaskId && t.kind === "compensation" ? new D(null, { id: n, label: this.labels.elements.task, movable: !0, type: O.task, compensation: !0 }) :
|
|
10179
|
+
if (!this.connectionTargets(t).some((p) => p.id === e)) return null;
|
|
10180
|
+
const n = De(this.diagram, e), r = t instanceof A && t.attachedToTaskId && t.kind === "compensation" ? new D(null, { id: n, label: this.labels.elements.task, movable: !0, type: O.task, compensation: !0 }) : lt.create(e, n, ["event", "gateway"].includes(_e.find((p) => p.id === e)?.family ?? "") ? "" : this.labels.elements[e]);
|
|
10180
10181
|
this.diagram.add(r);
|
|
10181
10182
|
const a = this.diagram.getExtension(Y).gridSize, l = new f([
|
|
10182
10183
|
t.box.x + t.box.width + a,
|
|
@@ -10198,8 +10199,8 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10198
10199
|
},
|
|
10199
10200
|
endAnchor: { mode: "automatic" }
|
|
10200
10201
|
});
|
|
10201
|
-
const
|
|
10202
|
-
return
|
|
10202
|
+
const g = this.diagram.getExtension(V);
|
|
10203
|
+
return g.clearSelection(), g.selectNode(r), this.diagram.canvas.ensureVisible(r.box, a * 3, !0), r;
|
|
10203
10204
|
}
|
|
10204
10205
|
nearestAvailablePosition(t, e) {
|
|
10205
10206
|
const n = this.diagram.getExtension(Y).gridSize, s = this.diagram.nodes.filter(
|
|
@@ -10209,17 +10210,17 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10209
10210
|
for (let l = 0; l <= Wh; l += 1) {
|
|
10210
10211
|
const c = [];
|
|
10211
10212
|
for (let u = -l; u <= l; u += 1)
|
|
10212
|
-
for (let
|
|
10213
|
-
Math.max(Math.abs(u), Math.abs(
|
|
10214
|
-
c.sort((u,
|
|
10215
|
-
const
|
|
10216
|
-
return
|
|
10217
|
-
}), c.forEach(([u,
|
|
10218
|
-
const
|
|
10213
|
+
for (let g = -l; g <= l; g += 1)
|
|
10214
|
+
Math.max(Math.abs(u), Math.abs(g)) === l && c.push([u, g]);
|
|
10215
|
+
c.sort((u, g) => {
|
|
10216
|
+
const p = u[0] ** 2 + u[1] ** 2, m = g[0] ** 2 + g[1] ** 2;
|
|
10217
|
+
return p !== m ? p - m : this.placementDirectionRank(u) - this.placementDirectionRank(g);
|
|
10218
|
+
}), c.forEach(([u, g]) => {
|
|
10219
|
+
const p = e.copy(!1).sum([u * n, g * n]), m = p.toDimensions(t.box.size);
|
|
10219
10220
|
if (!(m.x >= 0 && m.y >= 0 && m.x + m.width <= this.diagram.canvas.size.x && m.y + m.height <= this.diagram.canvas.size.y) || s.some((y) => y.collides(m)))
|
|
10220
10221
|
return;
|
|
10221
|
-
const x = (u * n) ** 2 + (
|
|
10222
|
-
x < a && (r =
|
|
10222
|
+
const x = (u * n) ** 2 + (g * n) ** 2;
|
|
10223
|
+
x < a && (r = p, a = x);
|
|
10223
10224
|
});
|
|
10224
10225
|
const h = (l + 1) * n;
|
|
10225
10226
|
if (r && h ** 2 > a)
|
|
@@ -10356,7 +10357,7 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10356
10357
|
/** Returns only edge kinds that preserve all endpoint-specific BPMN constraints. */
|
|
10357
10358
|
edgeKindOptions(t) {
|
|
10358
10359
|
const e = t.from.parent, n = t.to.parent;
|
|
10359
|
-
return e instanceof
|
|
10360
|
+
return e instanceof pt || n instanceof pt || e instanceof ut || n instanceof ut ? ["association"] : e instanceof ft || n instanceof ft ? ["messageFlow"] : e instanceof _t || e instanceof at ? ["inputDataAssociation"] : n instanceof _t || n instanceof at ? ["outputDataAssociation"] : Bh;
|
|
10360
10361
|
}
|
|
10361
10362
|
/** Updates a BPMN edge kind and refreshes its visual connection convention. */
|
|
10362
10363
|
changeEdgeKind(t, e) {
|
|
@@ -10392,7 +10393,7 @@ const Ye = /* @__PURE__ */ new Set(["task", "event", "gateway"]), Bh = [
|
|
|
10392
10393
|
supportsCondition(t) {
|
|
10393
10394
|
if (t.kind !== "sequenceFlow") return !1;
|
|
10394
10395
|
const e = t.from.parent;
|
|
10395
|
-
return !(e instanceof Z && (e.type ===
|
|
10396
|
+
return !(e instanceof Z && (e.type === R.parallel || e.type === R.eventBased));
|
|
10396
10397
|
}
|
|
10397
10398
|
/** Toggles the properties inspector and persists its current preference locally. */
|
|
10398
10399
|
togglePropertiesPanel() {
|
|
@@ -10416,7 +10417,7 @@ const ja = class ja extends $e {
|
|
|
10416
10417
|
constructor(t) {
|
|
10417
10418
|
super(t), this.registerExtension(vi), this.registerExtension(ve), this.registerExtension(ie), this.registerExtension(nn), this.registerExtension(le), this.getExtension(le).configureLabels(
|
|
10418
10419
|
t?.labels ?? {}
|
|
10419
|
-
), this.registerExtension(Ms), this.registerClass(
|
|
10420
|
+
), this.registerExtension(Ms), this.registerClass(ht), this.registerClass(D), this.registerClass(A), this.registerClass(Z), this.registerClass(ct), this.registerClass(Re), this.registerClass(ft), this.registerClass(_t), this.registerClass(at), this.registerClass(ut), this.registerClass(pt);
|
|
10420
10421
|
}
|
|
10421
10422
|
/** Exposes the isolated complete labels currently used by this BPMN diagram. */
|
|
10422
10423
|
get bpmnLabels() {
|
|
@@ -10429,7 +10430,7 @@ const ja = class ja extends $e {
|
|
|
10429
10430
|
};
|
|
10430
10431
|
o(ja, "BPMDiagram");
|
|
10431
10432
|
let Cs = ja;
|
|
10432
|
-
const Pa = class Pa extends
|
|
10433
|
+
const Pa = class Pa extends wt {
|
|
10433
10434
|
executionId;
|
|
10434
10435
|
visited = !1;
|
|
10435
10436
|
visitCount = 0;
|
|
@@ -10586,9 +10587,9 @@ const Ta = class Ta {
|
|
|
10586
10587
|
}
|
|
10587
10588
|
};
|
|
10588
10589
|
o(Ta, "BPMNNodeExecutionState");
|
|
10589
|
-
let
|
|
10590
|
+
let gt = Ta;
|
|
10590
10591
|
function an(i) {
|
|
10591
|
-
return "execution" in i && i.execution instanceof
|
|
10592
|
+
return "execution" in i && i.execution instanceof gt;
|
|
10592
10593
|
}
|
|
10593
10594
|
o(an, "isBPMNExecutionNode");
|
|
10594
10595
|
const Zh = M(
|
|
@@ -10606,14 +10607,14 @@ const Zh = M(
|
|
|
10606
10607
|
"data-execution-node-id": e.id,
|
|
10607
10608
|
style: n.style,
|
|
10608
10609
|
children: e.execution.markers.map((s) => {
|
|
10609
|
-
const r = s.kind === "error", a = s.kind === "waiting", l = s.kind === "completed", c = `execution-marker-${e.id}-${s.id}`, h = r ? s.message || "Execution failed" : s.message, u = !!h,
|
|
10610
|
+
const r = s.kind === "error", a = s.kind === "waiting", l = s.kind === "completed", c = `execution-marker-${e.id}-${s.id}`, h = r ? s.message || "Execution failed" : s.message, u = !!h, g = r ? t.executionSettings.errorColor : a ? "#d97706" : l ? "#16a34a" : t.executionSettings.tokenColor;
|
|
10610
10611
|
return /* @__PURE__ */ d.jsxs(
|
|
10611
10612
|
"span",
|
|
10612
10613
|
{
|
|
10613
10614
|
"aria-describedby": u ? c : void 0,
|
|
10614
10615
|
"aria-label": s.kind === "token" ? `${s.value ?? 0} active tokens` : r ? "Execution error" : a ? "Waiting" : l ? "Completed" : s.message || s.kind,
|
|
10615
10616
|
className: `bpmn-execution__marker bpmn-execution__marker--${s.kind}${u ? " bpmn-execution__marker--has-tooltip" : ""}`,
|
|
10616
|
-
style: { "--execution-marker-color": s.color ??
|
|
10617
|
+
style: { "--execution-marker-color": s.color ?? g },
|
|
10617
10618
|
tabIndex: u ? 0 : void 0,
|
|
10618
10619
|
title: u ? void 0 : s.kind,
|
|
10619
10620
|
children: [
|
|
@@ -10637,7 +10638,7 @@ const Zh = M(
|
|
|
10637
10638
|
);
|
|
10638
10639
|
}) });
|
|
10639
10640
|
}
|
|
10640
|
-
), La = class La extends
|
|
10641
|
+
), La = class La extends H {
|
|
10641
10642
|
RenderDiagram = Zh;
|
|
10642
10643
|
/** Initializes the visual execution layer without changing BPMN modeler behavior. */
|
|
10643
10644
|
init() {
|
|
@@ -10645,10 +10646,10 @@ const Zh = M(
|
|
|
10645
10646
|
};
|
|
10646
10647
|
o(La, "BPMNExecutionExtension");
|
|
10647
10648
|
let As = La;
|
|
10648
|
-
const Da = class Da extends
|
|
10649
|
+
const Da = class Da extends ft {
|
|
10649
10650
|
execution;
|
|
10650
10651
|
constructor(t, e) {
|
|
10651
|
-
super(t, e), this.execution = new
|
|
10652
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10652
10653
|
}
|
|
10653
10654
|
/** Serializes execution metadata together with the hidden-participant model. */
|
|
10654
10655
|
serialize() {
|
|
@@ -10661,10 +10662,10 @@ const Da = class Da extends mt {
|
|
|
10661
10662
|
};
|
|
10662
10663
|
o(Da, "BPMNExecutionBlackBoxPoolNode");
|
|
10663
10664
|
let on = Da;
|
|
10664
|
-
const za = class za extends
|
|
10665
|
+
const za = class za extends _t {
|
|
10665
10666
|
execution;
|
|
10666
10667
|
constructor(t, e) {
|
|
10667
|
-
super(t, e), this.execution = new
|
|
10668
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10668
10669
|
}
|
|
10669
10670
|
/** Serializes optional execution metadata beside normal data-store semantics. */
|
|
10670
10671
|
serialize() {
|
|
@@ -10677,10 +10678,10 @@ const za = class za extends vt {
|
|
|
10677
10678
|
};
|
|
10678
10679
|
o(za, "BPMNExecutionDataStoreNode");
|
|
10679
10680
|
let ln = za;
|
|
10680
|
-
const Oa = class Oa extends
|
|
10681
|
+
const Oa = class Oa extends ut {
|
|
10681
10682
|
execution;
|
|
10682
10683
|
constructor(t, e) {
|
|
10683
|
-
super(t, e), this.execution = new
|
|
10684
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10684
10685
|
}
|
|
10685
10686
|
/** Serializes optional execution metadata beside document-annotation state. */
|
|
10686
10687
|
serialize() {
|
|
@@ -10696,7 +10697,7 @@ let cn = Oa;
|
|
|
10696
10697
|
const Fa = class Fa extends at {
|
|
10697
10698
|
execution;
|
|
10698
10699
|
constructor(t, e) {
|
|
10699
|
-
super(t, e), this.execution = new
|
|
10700
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10700
10701
|
}
|
|
10701
10702
|
/** Serializes optional execution metadata beside normal data-object semantics. */
|
|
10702
10703
|
serialize() {
|
|
@@ -10712,7 +10713,7 @@ let dn = Fa;
|
|
|
10712
10713
|
const $a = class $a extends A {
|
|
10713
10714
|
execution;
|
|
10714
10715
|
constructor(t, e) {
|
|
10715
|
-
super(t, e), this.execution = new
|
|
10716
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10716
10717
|
}
|
|
10717
10718
|
/** Serializes execution data alongside every property owned by the BPMN event. */
|
|
10718
10719
|
serialize() {
|
|
@@ -10728,7 +10729,7 @@ let hn = $a;
|
|
|
10728
10729
|
const Ra = class Ra extends Z {
|
|
10729
10730
|
execution;
|
|
10730
10731
|
constructor(t, e) {
|
|
10731
|
-
super(t, e), this.execution = new
|
|
10732
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10732
10733
|
}
|
|
10733
10734
|
/** Serializes execution data alongside every property owned by the BPMN gateway. */
|
|
10734
10735
|
serialize() {
|
|
@@ -10741,10 +10742,10 @@ const Ra = class Ra extends Z {
|
|
|
10741
10742
|
};
|
|
10742
10743
|
o(Ra, "BPMNExecutionGateNode");
|
|
10743
10744
|
let un = Ra;
|
|
10744
|
-
const Ha = class Ha extends
|
|
10745
|
+
const Ha = class Ha extends ct {
|
|
10745
10746
|
execution;
|
|
10746
10747
|
constructor(t, e) {
|
|
10747
|
-
super(t, e), this.execution = new
|
|
10748
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10748
10749
|
}
|
|
10749
10750
|
/** Serializes execution metadata together with the complete lane and pool model. */
|
|
10750
10751
|
serialize() {
|
|
@@ -10760,7 +10761,7 @@ let pn = Ha;
|
|
|
10760
10761
|
const Ga = class Ga extends D {
|
|
10761
10762
|
execution;
|
|
10762
10763
|
constructor(t, e) {
|
|
10763
|
-
super(t, e), this.execution = new
|
|
10764
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10764
10765
|
}
|
|
10765
10766
|
/** Serializes execution data alongside every property owned by the BPMN task. */
|
|
10766
10767
|
serialize() {
|
|
@@ -10773,10 +10774,10 @@ const Ga = class Ga extends D {
|
|
|
10773
10774
|
};
|
|
10774
10775
|
o(Ga, "BPMNExecutionTaskNode");
|
|
10775
10776
|
let gn = Ga;
|
|
10776
|
-
const Ba = class Ba extends
|
|
10777
|
+
const Ba = class Ba extends pt {
|
|
10777
10778
|
execution;
|
|
10778
10779
|
constructor(t, e) {
|
|
10779
|
-
super(t, e), this.execution = new
|
|
10780
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10780
10781
|
}
|
|
10781
10782
|
/** Serializes optional execution metadata beside normal text annotation state. */
|
|
10782
10783
|
serialize() {
|
|
@@ -10792,7 +10793,7 @@ let mn = Ba;
|
|
|
10792
10793
|
const Va = class Va extends Re {
|
|
10793
10794
|
execution;
|
|
10794
10795
|
constructor(t, e) {
|
|
10795
|
-
super(t, e), this.execution = new
|
|
10796
|
+
super(t, e), this.execution = new gt(e.execution);
|
|
10796
10797
|
}
|
|
10797
10798
|
/** Serializes execution metadata while preserving the unsupported source type. */
|
|
10798
10799
|
serialize() {
|
|
@@ -10807,7 +10808,7 @@ o(Va, "BPMNExecutionUnknownNode");
|
|
|
10807
10808
|
let fn = Va;
|
|
10808
10809
|
function Kh(i) {
|
|
10809
10810
|
const t = i.id;
|
|
10810
|
-
if (i instanceof Wt || i.constructor !==
|
|
10811
|
+
if (i instanceof Wt || i.constructor !== wt)
|
|
10811
10812
|
return i;
|
|
10812
10813
|
Object.setPrototypeOf(i, Wt.prototype);
|
|
10813
10814
|
const e = i;
|
|
@@ -10818,18 +10819,18 @@ const Uh = /* @__PURE__ */ new Map([
|
|
|
10818
10819
|
[D, gn.prototype],
|
|
10819
10820
|
[A, hn.prototype],
|
|
10820
10821
|
[Z, un.prototype],
|
|
10821
|
-
[
|
|
10822
|
-
[
|
|
10823
|
-
[
|
|
10822
|
+
[ct, pn.prototype],
|
|
10823
|
+
[ft, on.prototype],
|
|
10824
|
+
[_t, ln.prototype],
|
|
10824
10825
|
[at, dn.prototype],
|
|
10825
|
-
[
|
|
10826
|
-
[
|
|
10826
|
+
[ut, cn.prototype],
|
|
10827
|
+
[pt, mn.prototype],
|
|
10827
10828
|
[Re, fn.prototype]
|
|
10828
10829
|
]);
|
|
10829
10830
|
function Xh(i) {
|
|
10830
10831
|
if ("execution" in i) return i;
|
|
10831
10832
|
const t = Uh.get(i.constructor);
|
|
10832
|
-
return t && (Object.setPrototypeOf(i, t), i.execution = new
|
|
10833
|
+
return t && (Object.setPrototypeOf(i, t), i.execution = new gt()), i;
|
|
10833
10834
|
}
|
|
10834
10835
|
o(Xh, "promoteBPMNExecutionNode");
|
|
10835
10836
|
const qh = [
|
|
@@ -11088,19 +11089,19 @@ const Qh = M(
|
|
|
11088
11089
|
let l = 0, c = 0;
|
|
11089
11090
|
return I(() => {
|
|
11090
11091
|
s && this.clearExecution(), Object.entries(e).forEach(([h, u]) => {
|
|
11091
|
-
const
|
|
11092
|
-
if (!
|
|
11092
|
+
const g = this.getNodeById(h);
|
|
11093
|
+
if (!g || !an(g)) {
|
|
11093
11094
|
r.push(h);
|
|
11094
11095
|
return;
|
|
11095
11096
|
}
|
|
11096
|
-
|
|
11097
|
+
g.execution.apply(u), l += 1;
|
|
11097
11098
|
}), Object.entries(n).forEach(([h, u]) => {
|
|
11098
|
-
const
|
|
11099
|
-
if (!
|
|
11099
|
+
const g = this.resolveExecutionEdge(h);
|
|
11100
|
+
if (!g) {
|
|
11100
11101
|
a.push(h);
|
|
11101
11102
|
return;
|
|
11102
11103
|
}
|
|
11103
|
-
|
|
11104
|
+
g.applyExecution(u), c += 1;
|
|
11104
11105
|
});
|
|
11105
11106
|
}), {
|
|
11106
11107
|
appliedNodes: l,
|
|
@@ -11127,14 +11128,14 @@ const Qh = M(
|
|
|
11127
11128
|
[D, gn],
|
|
11128
11129
|
[A, hn],
|
|
11129
11130
|
[Z, un],
|
|
11130
|
-
[
|
|
11131
|
+
[ct, pn],
|
|
11131
11132
|
[Re, fn],
|
|
11132
|
-
[
|
|
11133
|
-
[
|
|
11133
|
+
[ft, on],
|
|
11134
|
+
[_t, ln],
|
|
11134
11135
|
[at, dn],
|
|
11135
|
-
[
|
|
11136
|
-
[
|
|
11137
|
-
[
|
|
11136
|
+
[ut, cn],
|
|
11137
|
+
[pt, mn],
|
|
11138
|
+
[wt, Wt]
|
|
11138
11139
|
].forEach(([e, n]) => {
|
|
11139
11140
|
this.registerClass(n), this.registerClass(n, e.name);
|
|
11140
11141
|
});
|
|
@@ -11633,16 +11634,16 @@ function ou() {
|
|
|
11633
11634
|
}
|
|
11634
11635
|
o(ou, "initialPanelWidth");
|
|
11635
11636
|
function lu() {
|
|
11636
|
-
const [i, t] =
|
|
11637
|
+
const [i, t] = vt(ou);
|
|
11637
11638
|
return { panelWidth: i, startResize: /* @__PURE__ */ o((n) => {
|
|
11638
11639
|
n.preventDefault(), n.stopPropagation();
|
|
11639
11640
|
const s = n.clientX, r = i;
|
|
11640
11641
|
let a = i;
|
|
11641
11642
|
const l = /* @__PURE__ */ o((h) => {
|
|
11642
|
-
const u = Math.min(Xl, window.innerWidth - 28),
|
|
11643
|
+
const u = Math.min(Xl, window.innerWidth - 28), g = Math.max(u, window.innerWidth - 56);
|
|
11643
11644
|
a = Math.max(
|
|
11644
11645
|
u,
|
|
11645
|
-
Math.min(
|
|
11646
|
+
Math.min(g, r + s - h.clientX)
|
|
11646
11647
|
), t(a);
|
|
11647
11648
|
}, "move"), c = /* @__PURE__ */ o(() => {
|
|
11648
11649
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", c), window.localStorage.setItem(Ul, String(a));
|
|
@@ -11674,14 +11675,14 @@ const cu = M(/* @__PURE__ */ o(function({
|
|
|
11674
11675
|
extension: e,
|
|
11675
11676
|
node: n
|
|
11676
11677
|
}) {
|
|
11677
|
-
const [s, r] =
|
|
11678
|
+
const [s, r] = vt(
|
|
11678
11679
|
null
|
|
11679
11680
|
), a = /* @__PURE__ */ o((l, c) => {
|
|
11680
11681
|
if (l.preventDefault(), !s) return;
|
|
11681
|
-
const h = l.currentTarget, u = l.clientY > h.getBoundingClientRect().top + h.clientHeight / 2,
|
|
11682
|
+
const h = l.currentTarget, u = l.clientY > h.getBoundingClientRect().top + h.clientHeight / 2, g = n.model.attributes.findIndex(
|
|
11682
11683
|
(m) => m.id === c
|
|
11683
|
-
),
|
|
11684
|
-
e.moveAttribute(n, s,
|
|
11684
|
+
), p = u ? n.model.attributes[g + 1]?.id ?? null : c;
|
|
11685
|
+
e.moveAttribute(n, s, p), r(null);
|
|
11685
11686
|
}, "dropAttribute");
|
|
11686
11687
|
return /* @__PURE__ */ d.jsxs("div", { className: "mr__attribute_table_scroller", children: [
|
|
11687
11688
|
/* @__PURE__ */ d.jsxs("table", { className: "mr__attribute_table", children: [
|
|
@@ -12168,7 +12169,7 @@ const cu = M(/* @__PURE__ */ o(function({
|
|
|
12168
12169
|
}
|
|
12169
12170
|
)
|
|
12170
12171
|
] }),
|
|
12171
|
-
/* @__PURE__ */ d.jsx("datalist", { id: "mr-data-types", children: su.map((
|
|
12172
|
+
/* @__PURE__ */ d.jsx("datalist", { id: "mr-data-types", children: su.map((g) => /* @__PURE__ */ d.jsx("option", { value: g }, g)) })
|
|
12172
12173
|
]
|
|
12173
12174
|
}
|
|
12174
12175
|
);
|
|
@@ -12187,7 +12188,7 @@ function Di(i, t = 0) {
|
|
|
12187
12188
|
);
|
|
12188
12189
|
}
|
|
12189
12190
|
o(Di, "tablePosition");
|
|
12190
|
-
const eo = class eo extends
|
|
12191
|
+
const eo = class eo extends H {
|
|
12191
12192
|
RenderUI = pu;
|
|
12192
12193
|
/** Initializes this stateless modeler extension for fixed inspector rendering. */
|
|
12193
12194
|
init() {
|
|
@@ -12317,7 +12318,7 @@ const eo = class eo extends G {
|
|
|
12317
12318
|
a.length
|
|
12318
12319
|
), c = n.box.middle.x <= s.box.middle.x ? "right" : "left", h = c === "right" ? "left" : "right", u = this.diagram.edges.filter(
|
|
12319
12320
|
(m) => m instanceof It && m.constraintId === t.constraintId
|
|
12320
|
-
).sort((m, b) => m.mappingIndex - b.mappingIndex),
|
|
12321
|
+
).sort((m, b) => m.mappingIndex - b.mappingIndex), g = {
|
|
12321
12322
|
constraintId: t.constraintId,
|
|
12322
12323
|
mappingIndex: 0,
|
|
12323
12324
|
name: e.name ?? t.name,
|
|
@@ -12336,11 +12337,11 @@ const eo = class eo extends G {
|
|
|
12336
12337
|
const b = r[Math.min(m, r.length - 1)], x = a[Math.min(m, a.length - 1)], y = n.gatewayForAttribute(b, c), w = s.gatewayForAttribute(x, h);
|
|
12337
12338
|
if (!y || !w) continue;
|
|
12338
12339
|
const v = u[m] ?? this.diagram.connect(y, w);
|
|
12339
|
-
this.rewireForeignKey(v, y, w), v.updateModel({ ...
|
|
12340
|
+
this.rewireForeignKey(v, y, w), v.updateModel({ ...g, mappingIndex: m }), u[m] = v;
|
|
12340
12341
|
}
|
|
12341
12342
|
u.slice(l).forEach((m) => this.diagram.disconnect(m));
|
|
12342
|
-
const
|
|
12343
|
-
|
|
12343
|
+
const p = this.diagram.getExtension(V);
|
|
12344
|
+
p.selectedEdges.includes(t) && u[0] && (p.clearSelection(), p.selectEdge(u[0]));
|
|
12344
12345
|
}
|
|
12345
12346
|
/** Changes the routing family used to draw one relational foreign-key connection. */
|
|
12346
12347
|
updateForeignKeyPath(t, e) {
|
|
@@ -12401,10 +12402,10 @@ let ei = eo;
|
|
|
12401
12402
|
var ql = Object.defineProperty, gu = /* @__PURE__ */ o((i, t, e) => t in i ? ql(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, "hn"), mu = /* @__PURE__ */ o((i, t) => {
|
|
12402
12403
|
for (var e in t) ql(i, e, { get: t[e], enumerable: !0 });
|
|
12403
12404
|
}, "fn"), fu = /* @__PURE__ */ o((i, t, e) => gu(i, t + "", e), "pe"), xu = {};
|
|
12404
|
-
mu(xu, { Graph: /* @__PURE__ */ o(() =>
|
|
12405
|
+
mu(xu, { Graph: /* @__PURE__ */ o(() => Et, "Graph"), alg: /* @__PURE__ */ o(() => Rs, "alg"), json: /* @__PURE__ */ o(() => Ql, "json"), version: /* @__PURE__ */ o(() => wu, "version") });
|
|
12405
12406
|
var bu = Object.defineProperty, Jl = /* @__PURE__ */ o((i, t) => {
|
|
12406
12407
|
for (var e in t) bu(i, e, { get: t[e], enumerable: !0 });
|
|
12407
|
-
}, "Le"), Ae,
|
|
12408
|
+
}, "Le"), Ae, Et = (Ae = class {
|
|
12408
12409
|
constructor(t) {
|
|
12409
12410
|
this._isDirected = !0, this._isMultigraph = !1, this._isCompound = !1, this._nodes = {}, this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}, this._nodeCount = 0, this._edgeCount = 0, this._defaultNodeLabelFn = () => {
|
|
12410
12411
|
}, this._defaultEdgeLabelFn = () => {
|
|
@@ -12541,8 +12542,8 @@ var bu = Object.defineProperty, Jl = /* @__PURE__ */ o((i, t) => {
|
|
|
12541
12542
|
if (u in this._edgeLabels) return h && (this._edgeLabels[u] = c), this;
|
|
12542
12543
|
if (l !== void 0 && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false");
|
|
12543
12544
|
this.setNode(r), this.setNode(a), this._edgeLabels[u] = h ? c : this._defaultEdgeLabelFn(r, a, l);
|
|
12544
|
-
let
|
|
12545
|
-
return r =
|
|
12545
|
+
let g = yu(this._isDirected, r, a, l);
|
|
12546
|
+
return r = g.v, a = g.w, Object.freeze(g), this._edgeObjs[u] = g, nl(this._preds[a], r), nl(this._sucs[r], a), this._in[a][u] = g, this._out[r][u] = g, this._edgeCount++, this;
|
|
12546
12547
|
}
|
|
12547
12548
|
edge(t, e, n) {
|
|
12548
12549
|
let s = arguments.length === 1 ? Wn(this._isDirected, t) : Ue(this._isDirected, t, e, n);
|
|
@@ -12634,7 +12635,7 @@ function Eu(i) {
|
|
|
12634
12635
|
}
|
|
12635
12636
|
o(Eu, "Ln");
|
|
12636
12637
|
function ku(i) {
|
|
12637
|
-
let t = new
|
|
12638
|
+
let t = new Et(i.options);
|
|
12638
12639
|
return i.value !== void 0 && t.setGraph(i.value), i.nodes.forEach((e) => {
|
|
12639
12640
|
t.setNode(e.v, e.value), e.parent && t.setParent(e.v, e.parent);
|
|
12640
12641
|
}), i.edges.forEach((e) => {
|
|
@@ -12652,23 +12653,23 @@ function tc(i, t, e, n) {
|
|
|
12652
12653
|
}
|
|
12653
12654
|
o(tc, "we");
|
|
12654
12655
|
function Mu(i, t, e, n) {
|
|
12655
|
-
let s = {}, r, a = 0, l = i.nodes(), c = /* @__PURE__ */ o(function(
|
|
12656
|
-
let
|
|
12657
|
-
s[
|
|
12656
|
+
let s = {}, r, a = 0, l = i.nodes(), c = /* @__PURE__ */ o(function(g) {
|
|
12657
|
+
let p = e(g);
|
|
12658
|
+
s[g.v].distance + p < s[g.w].distance && (s[g.w] = { distance: s[g.v].distance + p, predecessor: g.v }, r = !0);
|
|
12658
12659
|
}, "d"), h = /* @__PURE__ */ o(function() {
|
|
12659
|
-
l.forEach(function(
|
|
12660
|
-
n(
|
|
12661
|
-
let m =
|
|
12660
|
+
l.forEach(function(g) {
|
|
12661
|
+
n(g).forEach(function(p) {
|
|
12662
|
+
let m = p.v === g ? p.v : p.w, b = m === p.v ? p.w : p.v;
|
|
12662
12663
|
c({ v: m, w: b });
|
|
12663
12664
|
});
|
|
12664
12665
|
});
|
|
12665
12666
|
}, "l");
|
|
12666
|
-
l.forEach(function(
|
|
12667
|
-
let
|
|
12668
|
-
s[
|
|
12667
|
+
l.forEach(function(g) {
|
|
12668
|
+
let p = g === t ? 0 : Number.POSITIVE_INFINITY;
|
|
12669
|
+
s[g] = { distance: p, predecessor: "" };
|
|
12669
12670
|
});
|
|
12670
12671
|
let u = l.length;
|
|
12671
|
-
for (let
|
|
12672
|
+
for (let g = 1; g < u && (r = !1, a++, h(), !!r); g++) ;
|
|
12672
12673
|
if (a === u - 1 && (r = !1, h(), r)) throw new Error("The graph contains a negative weight cycle");
|
|
12673
12674
|
return s;
|
|
12674
12675
|
}
|
|
@@ -12746,9 +12747,9 @@ function _n(i, t, e, n) {
|
|
|
12746
12747
|
o(_n, "F");
|
|
12747
12748
|
function Iu(i, t, e, n) {
|
|
12748
12749
|
let s = {}, r = new ec(), a, l, c = /* @__PURE__ */ o(function(h) {
|
|
12749
|
-
let u = h.v !== a ? h.v : h.w,
|
|
12750
|
-
if (
|
|
12751
|
-
m <
|
|
12750
|
+
let u = h.v !== a ? h.v : h.w, g = s[u], p = e(h), m = l.distance + p;
|
|
12751
|
+
if (p < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + h + " Weight: " + p);
|
|
12752
|
+
m < g.distance && (g.distance = m, g.predecessor = a, r.decrease(u, m));
|
|
12752
12753
|
}, "d");
|
|
12753
12754
|
for (i.nodes().forEach(function(h) {
|
|
12754
12755
|
let u = h === t ? 0 : Number.POSITIVE_INFINITY;
|
|
@@ -12809,8 +12810,8 @@ function Lu(i, t, e) {
|
|
|
12809
12810
|
s.forEach(function(l) {
|
|
12810
12811
|
let c = n[l];
|
|
12811
12812
|
s.forEach(function(h) {
|
|
12812
|
-
let u = c[r],
|
|
12813
|
-
m <
|
|
12813
|
+
let u = c[r], g = a[h], p = c[h], m = u.distance + g.distance;
|
|
12814
|
+
m < p.distance && (p.distance = m, p.predecessor = g.predecessor);
|
|
12814
12815
|
});
|
|
12815
12816
|
});
|
|
12816
12817
|
}), n;
|
|
@@ -12874,12 +12875,12 @@ function Fu(i, t) {
|
|
|
12874
12875
|
}
|
|
12875
12876
|
o(Fu, "Mn");
|
|
12876
12877
|
function $u(i, t) {
|
|
12877
|
-
let e = new
|
|
12878
|
+
let e = new Et(), n = {}, s = new ec(), r;
|
|
12878
12879
|
function a(c) {
|
|
12879
12880
|
let h = c.v === r ? c.w : c.v, u = s.priority(h);
|
|
12880
12881
|
if (u !== void 0) {
|
|
12881
|
-
let
|
|
12882
|
-
|
|
12882
|
+
let g = t(c);
|
|
12883
|
+
g < u && (n[h] = r, s.decrease(h, g));
|
|
12883
12884
|
}
|
|
12884
12885
|
}
|
|
12885
12886
|
if (o(a, "s"), i.nodeCount() === 0) return e;
|
|
@@ -12911,8 +12912,8 @@ function Hu(i, t, e, n) {
|
|
|
12911
12912
|
for (let a = 0; a < r.length; a++) {
|
|
12912
12913
|
let l = n(r[a]);
|
|
12913
12914
|
for (let c = 0; c < l.length; c++) {
|
|
12914
|
-
let h = l[c], u = h.v === r[a] ? h.v : h.w,
|
|
12915
|
-
e({ v: u, w:
|
|
12915
|
+
let h = l[c], u = h.v === r[a] ? h.v : h.w, g = u === h.v ? h.w : h.v;
|
|
12916
|
+
e({ v: u, w: g }) < 0 && (s = !0);
|
|
12916
12917
|
}
|
|
12917
12918
|
if (s) return tc(i, t, e, n);
|
|
12918
12919
|
}
|
|
@@ -12926,7 +12927,7 @@ function Ge(i, t, e, n) {
|
|
|
12926
12927
|
}
|
|
12927
12928
|
o(Ge, "w");
|
|
12928
12929
|
function Gu(i) {
|
|
12929
|
-
let t = new
|
|
12930
|
+
let t = new Et().setGraph(i.graph());
|
|
12930
12931
|
return i.nodes().forEach((e) => t.setNode(e, i.node(e))), i.edges().forEach((e) => {
|
|
12931
12932
|
let n = t.edge(e.v, e.w) || { weight: 0, minlen: 1 }, s = i.edge(e);
|
|
12932
12933
|
t.setEdge(e.v, e.w, { weight: n.weight + s.weight, minlen: Math.max(n.minlen, s.minlen) });
|
|
@@ -12934,7 +12935,7 @@ function Gu(i) {
|
|
|
12934
12935
|
}
|
|
12935
12936
|
o(Gu, "xe");
|
|
12936
12937
|
function ac(i) {
|
|
12937
|
-
let t = new
|
|
12938
|
+
let t = new Et({ multigraph: i.isMultigraph() }).setGraph(i.graph());
|
|
12938
12939
|
return i.nodes().forEach((e) => {
|
|
12939
12940
|
i.children(e).length || t.setNode(e, i.node(e));
|
|
12940
12941
|
}), i.edges().forEach((e) => {
|
|
@@ -13123,14 +13124,14 @@ function Yn(i, t, e, n, s) {
|
|
|
13123
13124
|
}
|
|
13124
13125
|
o(Yn, "$");
|
|
13125
13126
|
function np(i, t) {
|
|
13126
|
-
let e = new
|
|
13127
|
+
let e = new Et(), n = 0, s = 0;
|
|
13127
13128
|
i.nodes().forEach((l) => {
|
|
13128
13129
|
e.setNode(l, { v: l, in: 0, out: 0 });
|
|
13129
13130
|
}), i.edges().forEach((l) => {
|
|
13130
13131
|
let c = e.edge(l.v, l.w) || 0, h = t(l), u = c + h;
|
|
13131
13132
|
e.setEdge(l.v, l.w, u);
|
|
13132
|
-
let
|
|
13133
|
-
s = Math.max(s,
|
|
13133
|
+
let g = e.node(l.v), p = e.node(l.w);
|
|
13134
|
+
s = Math.max(s, g.out += h), n = Math.max(n, p.in += h);
|
|
13134
13135
|
});
|
|
13135
13136
|
let r = sp(s + n + 3).map(() => new Qu()), a = n + 1;
|
|
13136
13137
|
return e.nodes().forEach((l) => {
|
|
@@ -13189,8 +13190,8 @@ function cp(i, t) {
|
|
|
13189
13190
|
let e = t.v, n = i.node(e).rank, s = t.w, r = i.node(s).rank, a = t.name, l = i.edge(t), c = l.labelRank;
|
|
13190
13191
|
if (r === n + 1) return;
|
|
13191
13192
|
i.removeEdge(t);
|
|
13192
|
-
let h, u,
|
|
13193
|
-
for (
|
|
13193
|
+
let h, u, g;
|
|
13194
|
+
for (g = 0, ++n; n < r; ++g, ++n) l.points = [], u = { width: 0, height: 0, edgeLabel: l, edgeObj: t, rank: n }, h = Ge(i, "edge", u, "_d"), n === c && (u.width = l.width, u.height = l.height, u.dummy = "edge-label", u.labelpos = l.labelpos), i.setEdge(e, h, { weight: l.weight }, a), g === 0 && i.graph().dummyChains.push(h), e = h;
|
|
13194
13195
|
i.setEdge(e, s, { weight: l.weight }, a);
|
|
13195
13196
|
}
|
|
13196
13197
|
o(cp, "Xn");
|
|
@@ -13219,7 +13220,7 @@ function He(i, t) {
|
|
|
13219
13220
|
o(He, "v");
|
|
13220
13221
|
var cc = hp;
|
|
13221
13222
|
function hp(i) {
|
|
13222
|
-
let t = new
|
|
13223
|
+
let t = new Et({ directed: !1 }), e = i.nodes();
|
|
13223
13224
|
if (e.length === 0) throw new Error("Graph must have at least one node");
|
|
13224
13225
|
let n = e[0], s = i.nodeCount();
|
|
13225
13226
|
t.setNode(n, {});
|
|
@@ -13282,10 +13283,10 @@ function dc(i, t, e) {
|
|
|
13282
13283
|
return l && l.forEach((c) => {
|
|
13283
13284
|
let h = c.v === e, u = h ? c.w : c.v;
|
|
13284
13285
|
if (u !== n) {
|
|
13285
|
-
let
|
|
13286
|
-
if (a +=
|
|
13286
|
+
let g = h === s, p = t.edge(c).weight;
|
|
13287
|
+
if (a += g ? p : -p, wp(i, e, u)) {
|
|
13287
13288
|
let m = i.edge(e, u).cutvalue;
|
|
13288
|
-
a +=
|
|
13289
|
+
a += g ? -m : m;
|
|
13289
13290
|
}
|
|
13290
13291
|
}
|
|
13291
13292
|
}), a;
|
|
@@ -13421,11 +13422,11 @@ function mc(i, t, e, n, s, r, a) {
|
|
|
13421
13422
|
a !== t && i.setEdge(t, a, { weight: 0, minlen: e });
|
|
13422
13423
|
return;
|
|
13423
13424
|
}
|
|
13424
|
-
let h = al(i, "_bt"), u = al(i, "_bb"),
|
|
13425
|
-
i.setParent(h, a),
|
|
13425
|
+
let h = al(i, "_bt"), u = al(i, "_bb"), g = i.node(a);
|
|
13426
|
+
i.setParent(h, a), g.borderTop = h, i.setParent(u, a), g.borderBottom = u, c.forEach((p) => {
|
|
13426
13427
|
var m;
|
|
13427
|
-
mc(i, t, e, n, s, r,
|
|
13428
|
-
let b = i.node(
|
|
13428
|
+
mc(i, t, e, n, s, r, p);
|
|
13429
|
+
let b = i.node(p), x = b.borderTop ? b.borderTop : p, y = b.borderBottom ? b.borderBottom : p, w = b.borderTop ? n : 2 * n, v = x !== y ? 1 : s - ((m = r[a]) != null ? m : 0) + 1;
|
|
13429
13430
|
i.setEdge(h, x, { weight: w, minlen: v, nestingEdge: !0 }), i.setEdge(y, u, { weight: w, minlen: v, nestingEdge: !0 });
|
|
13430
13431
|
}), i.parent(a) || i.setEdge(t, h, { weight: 0, minlen: s + ((l = r[a]) != null ? l : 0) });
|
|
13431
13432
|
}
|
|
@@ -13535,7 +13536,7 @@ o(Rp, "oe");
|
|
|
13535
13536
|
function Hp(i, t, e) {
|
|
13536
13537
|
let n = Xu(e, e.map((h, u) => u)), s = t.flatMap((h) => {
|
|
13537
13538
|
let u = i.outEdges(h);
|
|
13538
|
-
return u ? u.map((
|
|
13539
|
+
return u ? u.map((g) => ({ pos: n[g.w], weight: i.edge(g).weight })).sort((g, p) => g.pos - p.pos) : [];
|
|
13539
13540
|
}), r = 1;
|
|
13540
13541
|
for (; r < e.length; ) r <<= 1;
|
|
13541
13542
|
let a = 2 * r - 1;
|
|
@@ -13544,9 +13545,9 @@ function Hp(i, t, e) {
|
|
|
13544
13545
|
return s.forEach((h) => {
|
|
13545
13546
|
let u = h.pos + r;
|
|
13546
13547
|
l[u] += h.weight;
|
|
13547
|
-
let
|
|
13548
|
-
for (; u > 0; ) u % 2 && (
|
|
13549
|
-
c += h.weight *
|
|
13548
|
+
let g = 0;
|
|
13549
|
+
for (; u > 0; ) u % 2 && (g += l[u + 1]), u = u - 1 >> 1, l[u] += h.weight;
|
|
13550
|
+
c += h.weight * g;
|
|
13550
13551
|
}), c;
|
|
13551
13552
|
}
|
|
13552
13553
|
o(Hp, "mt");
|
|
@@ -13603,7 +13604,7 @@ function Wp(i, t) {
|
|
|
13603
13604
|
}
|
|
13604
13605
|
o(Wp, "Lt");
|
|
13605
13606
|
function Yp(i, t) {
|
|
13606
|
-
let e = Yu(i, (u) => Object.hasOwn(u, "barycenter")), n = e.lhs, s = e.rhs.sort((u,
|
|
13607
|
+
let e = Yu(i, (u) => Object.hasOwn(u, "barycenter")), n = e.lhs, s = e.rhs.sort((u, g) => g.i - u.i), r = [], a = 0, l = 0, c = 0;
|
|
13607
13608
|
n.sort(Zp(!!t)), c = ul(r, s, c), n.forEach((u) => {
|
|
13608
13609
|
c += u.vs.length, r.push(u.vs), a += u.barycenter * u.weight, l += u.weight, c = ul(r, s, c);
|
|
13609
13610
|
});
|
|
@@ -13623,26 +13624,26 @@ function Zp(i) {
|
|
|
13623
13624
|
o(Zp, "yt");
|
|
13624
13625
|
function xc(i, t, e, n) {
|
|
13625
13626
|
let s = i.children(t), r = i.node(t), a = r ? r.borderLeft : void 0, l = r ? r.borderRight : void 0, c = {};
|
|
13626
|
-
a && (s = s.filter((
|
|
13627
|
+
a && (s = s.filter((p) => p !== a && p !== l));
|
|
13627
13628
|
let h = Gp(i, s);
|
|
13628
|
-
h.forEach((
|
|
13629
|
-
if (i.children(
|
|
13630
|
-
let m = xc(i,
|
|
13631
|
-
c[
|
|
13629
|
+
h.forEach((p) => {
|
|
13630
|
+
if (i.children(p.v).length) {
|
|
13631
|
+
let m = xc(i, p.v, e, n);
|
|
13632
|
+
c[p.v] = m, Object.hasOwn(m, "barycenter") && Up(p, m);
|
|
13632
13633
|
}
|
|
13633
13634
|
});
|
|
13634
13635
|
let u = Bp(h, e);
|
|
13635
13636
|
Kp(u, c);
|
|
13636
|
-
let
|
|
13637
|
+
let g = Yp(u, n);
|
|
13637
13638
|
if (a && l) {
|
|
13638
|
-
|
|
13639
|
-
let
|
|
13640
|
-
if (
|
|
13641
|
-
let m = i.node(
|
|
13642
|
-
Object.hasOwn(
|
|
13639
|
+
g.vs = [a, g.vs, l].flat(1);
|
|
13640
|
+
let p = i.predecessors(a);
|
|
13641
|
+
if (p && p.length) {
|
|
13642
|
+
let m = i.node(p[0]), b = i.predecessors(l), x = i.node(b[0]);
|
|
13643
|
+
Object.hasOwn(g, "barycenter") || (g.barycenter = 0, g.weight = 0), g.barycenter = (g.barycenter * g.weight + m.order + x.order) / (g.weight + 2), g.weight += 2;
|
|
13643
13644
|
}
|
|
13644
13645
|
}
|
|
13645
|
-
return
|
|
13646
|
+
return g;
|
|
13646
13647
|
}
|
|
13647
13648
|
o(xc, "W");
|
|
13648
13649
|
function Kp(i, t) {
|
|
@@ -13657,15 +13658,15 @@ function Up(i, t) {
|
|
|
13657
13658
|
o(Up, "Nt");
|
|
13658
13659
|
function Xp(i, t, e, n) {
|
|
13659
13660
|
n || (n = i.nodes());
|
|
13660
|
-
let s = qp(i), r = new
|
|
13661
|
+
let s = qp(i), r = new Et({ compound: !0 }).setGraph({ root: s }).setDefaultNodeLabel((a) => i.node(a));
|
|
13661
13662
|
return n.forEach((a) => {
|
|
13662
13663
|
let l = i.node(a), c = i.parent(a);
|
|
13663
13664
|
if (l.rank === t || l.minRank <= t && t <= l.maxRank) {
|
|
13664
13665
|
r.setNode(a), r.setParent(a, c || s);
|
|
13665
13666
|
let h = i[e](a);
|
|
13666
13667
|
h && h.forEach((u) => {
|
|
13667
|
-
let
|
|
13668
|
-
r.setEdge(
|
|
13668
|
+
let g = u.v === a ? u.w : u.v, p = r.edge(g, a), m = p !== void 0 ? p.weight : 0;
|
|
13669
|
+
r.setEdge(g, a, { weight: i.edge(u).weight + m });
|
|
13669
13670
|
}), Object.hasOwn(l, "minRank") && r.setNode(a, { borderLeft: l.borderLeft[t], borderRight: l.borderRight[t] });
|
|
13670
13671
|
}
|
|
13671
13672
|
}), r;
|
|
@@ -13701,8 +13702,8 @@ function bc(i, t = {}) {
|
|
|
13701
13702
|
let a = Number.POSITIVE_INFINITY, l, c = t.constraints || [];
|
|
13702
13703
|
for (let h = 0, u = 0; u < 4; ++h, ++u) {
|
|
13703
13704
|
Qp(h % 2 ? n : s, h % 4 >= 2, c), r = jn(i);
|
|
13704
|
-
let
|
|
13705
|
-
|
|
13705
|
+
let g = Rp(i, r);
|
|
13706
|
+
g < a ? (u = 0, l = Object.assign({}, r), a = g) : g === a && (l = structuredClone(r));
|
|
13706
13707
|
}
|
|
13707
13708
|
gl(i, l);
|
|
13708
13709
|
}
|
|
@@ -13721,7 +13722,7 @@ function pl(i, t, e) {
|
|
|
13721
13722
|
}
|
|
13722
13723
|
o(pl, "sn");
|
|
13723
13724
|
function Qp(i, t, e) {
|
|
13724
|
-
let n = new
|
|
13725
|
+
let n = new Et();
|
|
13725
13726
|
i.forEach(function(s) {
|
|
13726
13727
|
e.forEach((l) => n.setEdge(l.left, l.right));
|
|
13727
13728
|
let r = s.graph().root, a = xc(s, r, n, t);
|
|
@@ -13737,15 +13738,15 @@ function tg(i, t) {
|
|
|
13737
13738
|
let e = {};
|
|
13738
13739
|
function n(s, r) {
|
|
13739
13740
|
let a = 0, l = 0, c = s.length, h = r[r.length - 1];
|
|
13740
|
-
return r.forEach((u,
|
|
13741
|
-
let
|
|
13742
|
-
(
|
|
13741
|
+
return r.forEach((u, g) => {
|
|
13742
|
+
let p = ig(i, u), m = p ? i.node(p).order : c;
|
|
13743
|
+
(p || u === h) && (r.slice(l, g + 1).forEach((b) => {
|
|
13743
13744
|
let x = i.predecessors(b);
|
|
13744
13745
|
x && x.forEach((y) => {
|
|
13745
13746
|
let w = i.node(y), v = w.order;
|
|
13746
13747
|
(v < a || m < v) && !(w.dummy && i.node(b).dummy) && yc(e, y, b);
|
|
13747
13748
|
});
|
|
13748
|
-
}), l =
|
|
13749
|
+
}), l = g + 1, a = m);
|
|
13749
13750
|
}), r;
|
|
13750
13751
|
}
|
|
13751
13752
|
return o(n, "r"), t.length && t.reduce(n), e;
|
|
@@ -13755,13 +13756,13 @@ function eg(i, t) {
|
|
|
13755
13756
|
let e = {};
|
|
13756
13757
|
function n(r, a, l, c, h) {
|
|
13757
13758
|
Ei(a, l).forEach((u) => {
|
|
13758
|
-
let
|
|
13759
|
-
if (
|
|
13760
|
-
let
|
|
13761
|
-
|
|
13759
|
+
let g = r[u];
|
|
13760
|
+
if (g !== void 0 && i.node(g).dummy) {
|
|
13761
|
+
let p = i.predecessors(g);
|
|
13762
|
+
p && p.forEach((m) => {
|
|
13762
13763
|
if (m === void 0) return;
|
|
13763
13764
|
let b = i.node(m);
|
|
13764
|
-
b.dummy && (b.order < c || b.order > h) && yc(e, m,
|
|
13765
|
+
b.dummy && (b.order < c || b.order > h) && yc(e, m, g);
|
|
13765
13766
|
});
|
|
13766
13767
|
}
|
|
13767
13768
|
});
|
|
@@ -13769,13 +13770,13 @@ function eg(i, t) {
|
|
|
13769
13770
|
o(n, "r");
|
|
13770
13771
|
function s(r, a) {
|
|
13771
13772
|
let l = -1, c = -1, h = 0;
|
|
13772
|
-
return a.forEach((u,
|
|
13773
|
+
return a.forEach((u, g) => {
|
|
13773
13774
|
if (i.node(u).dummy === "border") {
|
|
13774
|
-
let
|
|
13775
|
-
if (
|
|
13776
|
-
let m =
|
|
13775
|
+
let p = i.predecessors(u);
|
|
13776
|
+
if (p && p.length) {
|
|
13777
|
+
let m = p[0];
|
|
13777
13778
|
if (m === void 0) return;
|
|
13778
|
-
c = i.node(m).order, n(a, h,
|
|
13779
|
+
c = i.node(m).order, n(a, h, g, l, c), h = g, l = c;
|
|
13779
13780
|
}
|
|
13780
13781
|
}
|
|
13781
13782
|
n(a, h, a.length, c, r.length);
|
|
@@ -13820,12 +13821,12 @@ function sg(i, t, e, n) {
|
|
|
13820
13821
|
l.forEach((h) => {
|
|
13821
13822
|
let u = n(h);
|
|
13822
13823
|
if (u && u.length) {
|
|
13823
|
-
let
|
|
13824
|
+
let g = u.sort((m, b) => {
|
|
13824
13825
|
let x = a[m], y = a[b];
|
|
13825
13826
|
return (x !== void 0 ? x : 0) - (y !== void 0 ? y : 0);
|
|
13826
|
-
}),
|
|
13827
|
-
for (let m = Math.floor(
|
|
13828
|
-
let x =
|
|
13827
|
+
}), p = (g.length - 1) / 2;
|
|
13828
|
+
for (let m = Math.floor(p), b = Math.ceil(p); m <= b; ++m) {
|
|
13829
|
+
let x = g[m];
|
|
13829
13830
|
if (x === void 0) continue;
|
|
13830
13831
|
let y = a[x];
|
|
13831
13832
|
if (y !== void 0 && r[h] === h && c < y && !ng(e, h, x)) {
|
|
@@ -13871,14 +13872,14 @@ function rg(i, t, e, n, s = !1) {
|
|
|
13871
13872
|
x !== Number.POSITIVE_INFINITY && y.borderType !== l && (r[m] = Math.max(r[m] !== void 0 ? r[m] : 0, x));
|
|
13872
13873
|
}
|
|
13873
13874
|
o(u, "u");
|
|
13874
|
-
function
|
|
13875
|
+
function g(m) {
|
|
13875
13876
|
return a.predecessors(m) || [];
|
|
13876
13877
|
}
|
|
13877
|
-
o(
|
|
13878
|
-
function
|
|
13878
|
+
o(g, "c");
|
|
13879
|
+
function p(m) {
|
|
13879
13880
|
return a.successors(m) || [];
|
|
13880
13881
|
}
|
|
13881
|
-
return o(
|
|
13882
|
+
return o(p, "h"), c(h, g), c(u, p), Object.keys(n).forEach((m) => {
|
|
13882
13883
|
var b;
|
|
13883
13884
|
let x = e[m];
|
|
13884
13885
|
x !== void 0 && (r[m] = (b = r[x]) != null ? b : 0);
|
|
@@ -13886,17 +13887,17 @@ function rg(i, t, e, n, s = !1) {
|
|
|
13886
13887
|
}
|
|
13887
13888
|
o(rg, "It");
|
|
13888
13889
|
function ag(i, t, e, n) {
|
|
13889
|
-
let s = new
|
|
13890
|
+
let s = new Et(), r = i.graph(), a = hg(r.nodesep, r.edgesep, n);
|
|
13890
13891
|
return t.forEach((l) => {
|
|
13891
13892
|
let c;
|
|
13892
13893
|
l.forEach((h) => {
|
|
13893
13894
|
let u = e[h];
|
|
13894
13895
|
if (u !== void 0) {
|
|
13895
13896
|
if (s.setNode(u), c !== void 0) {
|
|
13896
|
-
let
|
|
13897
|
-
if (
|
|
13898
|
-
let
|
|
13899
|
-
s.setEdge(
|
|
13897
|
+
let g = e[c];
|
|
13898
|
+
if (g !== void 0) {
|
|
13899
|
+
let p = s.edge(g, u);
|
|
13900
|
+
s.setEdge(g, u, Math.max(a(i, h, c), p || 0));
|
|
13900
13901
|
}
|
|
13901
13902
|
}
|
|
13902
13903
|
c = h;
|
|
@@ -13924,7 +13925,7 @@ function lg(i, t) {
|
|
|
13924
13925
|
let l = r + a, c = i[l];
|
|
13925
13926
|
if (!c || c === t) return;
|
|
13926
13927
|
let h = Object.values(c), u = n - zt(Math.min, h);
|
|
13927
|
-
a !== "l" && (u = s - zt(Math.max, h)), u && (i[l] = Pn(c, (
|
|
13928
|
+
a !== "l" && (u = s - zt(Math.max, h)), u && (i[l] = Pn(c, (g) => g + u));
|
|
13928
13929
|
});
|
|
13929
13930
|
});
|
|
13930
13931
|
}
|
|
@@ -13994,8 +13995,8 @@ function gg(i) {
|
|
|
13994
13995
|
t.forEach((a) => {
|
|
13995
13996
|
let l = a.reduce((c, h) => {
|
|
13996
13997
|
var u;
|
|
13997
|
-
let
|
|
13998
|
-
return c >
|
|
13998
|
+
let g = (u = i.node(h).height) != null ? u : 0;
|
|
13999
|
+
return c > g ? c : g;
|
|
13999
14000
|
}, 0);
|
|
14000
14001
|
a.forEach((c) => {
|
|
14001
14002
|
let h = i.node(c);
|
|
@@ -14028,7 +14029,7 @@ function xg(i, t) {
|
|
|
14028
14029
|
o(xg, "At");
|
|
14029
14030
|
var bg = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], yg = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "TB", rankalign: "center" }, wg = ["acyclicer", "ranker", "rankdir", "align", "rankalign"], vg = ["width", "height", "rank"], ml = { width: 0, height: 0 }, _g = ["minlen", "weight", "width", "height", "labeloffset"], Eg = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, kg = ["labelpos"];
|
|
14030
14031
|
function Sg(i) {
|
|
14031
|
-
let t = new
|
|
14032
|
+
let t = new Et({ multigraph: !0, compound: !0 }), e = Xn(i.graph());
|
|
14032
14033
|
return t.setGraph(Object.assign({}, yg, Un(e, bg), kn(e, wg))), i.nodes().forEach((n) => {
|
|
14033
14034
|
let s = Xn(i.node(n)), r = Un(s, vg);
|
|
14034
14035
|
Object.keys(ml).forEach((l) => {
|
|
@@ -14081,8 +14082,8 @@ o(Ig, "Jt");
|
|
|
14081
14082
|
function jg(i) {
|
|
14082
14083
|
let t = Number.POSITIVE_INFINITY, e = 0, n = Number.POSITIVE_INFINITY, s = 0, r = i.graph(), a = r.marginx || 0, l = r.marginy || 0;
|
|
14083
14084
|
function c(h) {
|
|
14084
|
-
let u = h.x,
|
|
14085
|
-
t = Math.min(t, u -
|
|
14085
|
+
let u = h.x, g = h.y, p = h.width, m = h.height;
|
|
14086
|
+
t = Math.min(t, u - p / 2), e = Math.max(e, u + p / 2), n = Math.min(n, g - m / 2), s = Math.max(s, g + m / 2);
|
|
14086
14087
|
}
|
|
14087
14088
|
o(c, "d"), i.nodes().forEach((h) => c(i.node(h))), i.edges().forEach((h) => {
|
|
14088
14089
|
let u = i.edge(h);
|
|
@@ -14092,8 +14093,8 @@ function jg(i) {
|
|
|
14092
14093
|
u.x -= t, u.y -= n;
|
|
14093
14094
|
}), i.edges().forEach((h) => {
|
|
14094
14095
|
let u = i.edge(h);
|
|
14095
|
-
u.points.forEach((
|
|
14096
|
-
|
|
14096
|
+
u.points.forEach((g) => {
|
|
14097
|
+
g.x -= t, g.y -= n;
|
|
14097
14098
|
}), Object.hasOwn(u, "x") && (u.x -= t), Object.hasOwn(u, "y") && (u.y -= n);
|
|
14098
14099
|
}), r.width = e - t + a, r.height = s - n + l;
|
|
14099
14100
|
}
|
|
@@ -14226,7 +14227,7 @@ o(Gg, "reroute");
|
|
|
14226
14227
|
function Bg(i) {
|
|
14227
14228
|
const t = Fg(i);
|
|
14228
14229
|
if (t.length === 0) return !1;
|
|
14229
|
-
const e = $g(i), n = i.getExtension(Y)?.gridSize ?? 50, s = new
|
|
14230
|
+
const e = $g(i), n = i.getExtension(Y)?.gridSize ?? 50, s = new Et({ multigraph: !0 }).setGraph({
|
|
14230
14231
|
rankdir: "LR",
|
|
14231
14232
|
ranker: "network-simplex",
|
|
14232
14233
|
rankalign: "center",
|
|
@@ -14248,16 +14249,16 @@ function Bg(i) {
|
|
|
14248
14249
|
r.add(c.constraintId);
|
|
14249
14250
|
const h = c.from.parent, u = c.to.parent;
|
|
14250
14251
|
if (h === u) return;
|
|
14251
|
-
const
|
|
14252
|
+
const g = c.labels[0];
|
|
14252
14253
|
s.setEdge(
|
|
14253
14254
|
u.id,
|
|
14254
14255
|
h.id,
|
|
14255
14256
|
{
|
|
14256
|
-
height:
|
|
14257
|
+
height: g?.size.height ?? 0,
|
|
14257
14258
|
labelpos: "c",
|
|
14258
14259
|
minlen: 1,
|
|
14259
14260
|
weight: 2,
|
|
14260
|
-
width:
|
|
14261
|
+
width: g?.size.width ?? 0
|
|
14261
14262
|
},
|
|
14262
14263
|
c.constraintId
|
|
14263
14264
|
);
|
|
@@ -14267,12 +14268,12 @@ function Bg(i) {
|
|
|
14267
14268
|
if (c.mappingIndex !== 0 || !c.labels[0]) return;
|
|
14268
14269
|
const h = c.from.parent, u = c.to.parent;
|
|
14269
14270
|
if (h === u) return;
|
|
14270
|
-
const
|
|
14271
|
+
const g = s.edge(
|
|
14271
14272
|
u.id,
|
|
14272
14273
|
h.id,
|
|
14273
14274
|
c.constraintId
|
|
14274
14275
|
);
|
|
14275
|
-
|
|
14276
|
+
g?.x !== void 0 && g.y !== void 0 && g.width !== void 0 && g.height !== void 0 && a.set(c.constraintId, g);
|
|
14276
14277
|
});
|
|
14277
14278
|
let l = !1;
|
|
14278
14279
|
return t.forEach((c) => {
|
|
@@ -14321,7 +14322,7 @@ const io = class io extends $e {
|
|
|
14321
14322
|
/** Connects a dependent table to a referenced table with foreign-key metadata. */
|
|
14322
14323
|
connectForeignKey(t, e, n = {}) {
|
|
14323
14324
|
const s = n.sourceAttributeIds?.length ? [...n.sourceAttributeIds] : [
|
|
14324
|
-
t.model.attributes.find((
|
|
14325
|
+
t.model.attributes.find((g) => !g.primaryKey)?.id ?? t.model.attributes[0]?.id
|
|
14325
14326
|
].filter(Boolean), r = n.targetAttributeIds?.length ? [...n.targetAttributeIds] : Vg(e);
|
|
14326
14327
|
if (!s.length || !r.length)
|
|
14327
14328
|
throw new Error("Foreign keys require source and referenced attributes.");
|
|
@@ -14330,15 +14331,15 @@ const io = class io extends $e {
|
|
|
14330
14331
|
r.length
|
|
14331
14332
|
), h = [];
|
|
14332
14333
|
let u = n.constraintId;
|
|
14333
|
-
for (let
|
|
14334
|
-
const
|
|
14334
|
+
for (let g = 0; g < c; g += 1) {
|
|
14335
|
+
const p = fl(s, g), m = fl(r, g), b = t.gatewayForAttribute(p, a), x = e.gatewayForAttribute(m, l);
|
|
14335
14336
|
if (!b || !x)
|
|
14336
14337
|
throw new Error("Unable to resolve a foreign-key attribute gateway.");
|
|
14337
14338
|
const y = this.connect(b, x);
|
|
14338
14339
|
u ??= y.constraintId, y.updateModel({
|
|
14339
14340
|
...n,
|
|
14340
14341
|
constraintId: u,
|
|
14341
|
-
mappingIndex:
|
|
14342
|
+
mappingIndex: g,
|
|
14342
14343
|
sourceAttributeIds: s,
|
|
14343
14344
|
targetAttributeIds: r
|
|
14344
14345
|
}), h.push(y);
|
|
@@ -14439,12 +14440,12 @@ function Ug(i) {
|
|
|
14439
14440
|
);
|
|
14440
14441
|
return Array.from(
|
|
14441
14442
|
{ length: bl + 1 },
|
|
14442
|
-
(u,
|
|
14443
|
+
(u, g) => Kg(
|
|
14443
14444
|
e,
|
|
14444
14445
|
c,
|
|
14445
14446
|
h,
|
|
14446
14447
|
n,
|
|
14447
|
-
|
|
14448
|
+
g / bl
|
|
14448
14449
|
)
|
|
14449
14450
|
);
|
|
14450
14451
|
}
|
|
@@ -14494,8 +14495,8 @@ function tm(i, t, e = Zg, n = Yg) {
|
|
|
14494
14495
|
1,
|
|
14495
14496
|
((t.x - k.x) * P + (t.y - k.y) * L) / N
|
|
14496
14497
|
)
|
|
14497
|
-
),
|
|
14498
|
-
X >= r || (r = X, a = [
|
|
14498
|
+
), G = k.x + P * T, J = k.y + L * T, X = (t.x - G) ** 2 + (t.y - J) ** 2;
|
|
14499
|
+
X >= r || (r = X, a = [G, J], l = [P, L]);
|
|
14499
14500
|
}
|
|
14500
14501
|
const c = Math.max(i.diagram?.canvas.scale ?? 1, 1e-3), h = n / c;
|
|
14501
14502
|
if (!a || !l)
|
|
@@ -14504,9 +14505,9 @@ function tm(i, t, e = Zg, n = Yg) {
|
|
|
14504
14505
|
-h - e.height
|
|
14505
14506
|
]);
|
|
14506
14507
|
const u = Math.hypot(l[0], l[1]);
|
|
14507
|
-
let
|
|
14508
|
-
(
|
|
14509
|
-
const m = new f(a), b = [
|
|
14508
|
+
let g = -l[1] / u, p = l[0] / u;
|
|
14509
|
+
(p > 1e-6 || Math.abs(p) <= 1e-6 && g < 0) && (g *= -1, p *= -1);
|
|
14510
|
+
const m = new f(a), b = [g, p], x = [-g, -p], y = [b, x].map((v) => ({
|
|
14510
14511
|
normal: v,
|
|
14511
14512
|
position: Xg(m, v, e, h)
|
|
14512
14513
|
})), w = qg(i);
|
|
@@ -14554,8 +14555,8 @@ function em(i, t, e) {
|
|
|
14554
14555
|
return "M " + i.map((b) => `${b.x} ${b.y}`).join(" L ");
|
|
14555
14556
|
if (r === "straight")
|
|
14556
14557
|
return `M ${n.x} ${n.y} L ${s.x} ${s.y}`;
|
|
14557
|
-
const a = n.distance(s), l = Math.max(40, Math.min(160, a / 2)), c = vl(t?.from.orientation), h = vl(t?.to.orientation), u = n.x + c[0] * l,
|
|
14558
|
-
return `M ${n.x} ${n.y} C ${u} ${
|
|
14558
|
+
const a = n.distance(s), l = Math.max(40, Math.min(160, a / 2)), c = vl(t?.from.orientation), h = vl(t?.to.orientation), u = n.x + c[0] * l, g = n.y + c[1] * l, p = s.x + h[0] * l, m = s.y + h[1] * l;
|
|
14559
|
+
return `M ${n.x} ${n.y} C ${u} ${g}, ${p} ${m}, ${s.x} ${s.y}`;
|
|
14559
14560
|
}
|
|
14560
14561
|
o(em, "buildEdgePath");
|
|
14561
14562
|
const im = {};
|
|
@@ -14937,8 +14938,8 @@ const ki = M(
|
|
|
14937
14938
|
pathType: c,
|
|
14938
14939
|
endStroke: h = e,
|
|
14939
14940
|
startStroke: u = e,
|
|
14940
|
-
onMidpointMouseDown:
|
|
14941
|
-
onEndpointMouseDown:
|
|
14941
|
+
onMidpointMouseDown: g,
|
|
14942
|
+
onEndpointMouseDown: p,
|
|
14942
14943
|
className: m,
|
|
14943
14944
|
draggable: b,
|
|
14944
14945
|
selected: x
|
|
@@ -14975,11 +14976,11 @@ const ki = M(
|
|
|
14975
14976
|
onDoubleClick: /* @__PURE__ */ o((T) => {
|
|
14976
14977
|
if (!i?.diagram || !i.diagram.rules.allowEdition) return;
|
|
14977
14978
|
T.stopPropagation();
|
|
14978
|
-
const
|
|
14979
|
+
const G = i.diagram.canvas.inverseFit(
|
|
14979
14980
|
new f(T.nativeEvent)
|
|
14980
|
-
), J = i.createLabel(
|
|
14981
|
+
), J = i.createLabel(G);
|
|
14981
14982
|
J.setPosition(
|
|
14982
|
-
tm(i,
|
|
14983
|
+
tm(i, G, J.size)
|
|
14983
14984
|
);
|
|
14984
14985
|
}, "onDoubleClick"),
|
|
14985
14986
|
children: [
|
|
@@ -15039,14 +15040,14 @@ const ki = M(
|
|
|
15039
15040
|
}, "onClickCapture")
|
|
15040
15041
|
}
|
|
15041
15042
|
),
|
|
15042
|
-
ts.instance.showDragHints && t.map((T,
|
|
15043
|
+
ts.instance.showDragHints && t.map((T, G) => /* @__PURE__ */ d.jsx(Ns, { coordinates: T, size: 15, stroke: hm(T) }, G)),
|
|
15043
15044
|
L && /* @__PURE__ */ d.jsx(
|
|
15044
15045
|
dm,
|
|
15045
15046
|
{
|
|
15046
15047
|
edge: i,
|
|
15047
15048
|
points: t,
|
|
15048
|
-
onMouseDown: /* @__PURE__ */ o((T,
|
|
15049
|
-
|
|
15049
|
+
onMouseDown: /* @__PURE__ */ o((T, G) => {
|
|
15050
|
+
g?.(T, G);
|
|
15050
15051
|
}, "onMouseDown")
|
|
15051
15052
|
}
|
|
15052
15053
|
),
|
|
@@ -15061,7 +15062,7 @@ const ki = M(
|
|
|
15061
15062
|
T.button === 0 && (Xe(i, {
|
|
15062
15063
|
type: "endpoint",
|
|
15063
15064
|
endpoint: "from"
|
|
15064
|
-
}),
|
|
15065
|
+
}), p?.("from", T));
|
|
15065
15066
|
}, "onMouseDownCapture"),
|
|
15066
15067
|
children: [
|
|
15067
15068
|
/* @__PURE__ */ d.jsx(
|
|
@@ -15095,7 +15096,7 @@ const ki = M(
|
|
|
15095
15096
|
T.button === 0 && (Xe(i, {
|
|
15096
15097
|
type: "endpoint",
|
|
15097
15098
|
endpoint: "to"
|
|
15098
|
-
}),
|
|
15099
|
+
}), p?.("to", T));
|
|
15099
15100
|
}, "onMouseDownCapture"),
|
|
15100
15101
|
children: [
|
|
15101
15102
|
/* @__PURE__ */ d.jsx(
|
|
@@ -15184,8 +15185,8 @@ const ki = M(
|
|
|
15184
15185
|
labelColor: c,
|
|
15185
15186
|
labelFontSize: h,
|
|
15186
15187
|
labelFontFamily: u = "sans-serif",
|
|
15187
|
-
labelOffset:
|
|
15188
|
-
"data-id":
|
|
15188
|
+
labelOffset: g,
|
|
15189
|
+
"data-id": p,
|
|
15189
15190
|
...m
|
|
15190
15191
|
}, b) => {
|
|
15191
15192
|
const x = nt.use();
|
|
@@ -15193,7 +15194,7 @@ const ki = M(
|
|
|
15193
15194
|
"g",
|
|
15194
15195
|
{
|
|
15195
15196
|
...m,
|
|
15196
|
-
"data-id":
|
|
15197
|
+
"data-id": p,
|
|
15197
15198
|
className: `${r || ""} ${n ? "selected" : ""} base_shape`,
|
|
15198
15199
|
transform: e,
|
|
15199
15200
|
onClick: s,
|
|
@@ -15237,17 +15238,17 @@ const ki = M(
|
|
|
15237
15238
|
strokeStyle: L = "solid",
|
|
15238
15239
|
animated: N = !1,
|
|
15239
15240
|
animationDuration: T = 1,
|
|
15240
|
-
nonScalingStroke:
|
|
15241
|
+
nonScalingStroke: G = !0,
|
|
15241
15242
|
roundedBorders: J = a,
|
|
15242
15243
|
arrow: X
|
|
15243
15244
|
} = y;
|
|
15244
|
-
let
|
|
15245
|
+
let ot;
|
|
15245
15246
|
switch (L) {
|
|
15246
15247
|
case "dashed":
|
|
15247
|
-
|
|
15248
|
+
ot = "10 5";
|
|
15248
15249
|
break;
|
|
15249
15250
|
case "dotted":
|
|
15250
|
-
|
|
15251
|
+
ot = "2 6";
|
|
15251
15252
|
break;
|
|
15252
15253
|
}
|
|
15253
15254
|
const $t = N ? /* @__PURE__ */ d.jsx(
|
|
@@ -15255,7 +15256,7 @@ const ki = M(
|
|
|
15255
15256
|
{
|
|
15256
15257
|
attributeName: "stroke-dashoffset",
|
|
15257
15258
|
from: "0",
|
|
15258
|
-
to:
|
|
15259
|
+
to: ot ? `-${ot.split(" ").reduce((Tn, _c) => +Tn + +_c, 0)}` : "-15",
|
|
15259
15260
|
dur: `${T}s`,
|
|
15260
15261
|
repeatCount: "indefinite"
|
|
15261
15262
|
}
|
|
@@ -15267,10 +15268,10 @@ const ki = M(
|
|
|
15267
15268
|
fill: k,
|
|
15268
15269
|
stroke: C,
|
|
15269
15270
|
strokeWidth: P,
|
|
15270
|
-
strokeDasharray:
|
|
15271
|
+
strokeDasharray: ot,
|
|
15271
15272
|
strokeLinecap: J ? "round" : "butt",
|
|
15272
15273
|
strokeLinejoin: J ? "round" : "miter",
|
|
15273
|
-
vectorEffect:
|
|
15274
|
+
vectorEffect: G ? "non-scaling-stroke" : void 0,
|
|
15274
15275
|
markerStart: X?.position === "start" || X?.position === "both" ? Ci : void 0,
|
|
15275
15276
|
markerEnd: !X || X.position === "end" || X.position === "both" ? Ci : void 0,
|
|
15276
15277
|
children: $t
|
|
@@ -15281,8 +15282,8 @@ const ki = M(
|
|
|
15281
15282
|
l && /* @__PURE__ */ d.jsx(
|
|
15282
15283
|
"text",
|
|
15283
15284
|
{
|
|
15284
|
-
x:
|
|
15285
|
-
y:
|
|
15285
|
+
x: g?.x ?? 0,
|
|
15286
|
+
y: g?.y ?? 0,
|
|
15286
15287
|
textAnchor: "middle",
|
|
15287
15288
|
dominantBaseline: "middle",
|
|
15288
15289
|
fontFamily: u,
|
|
@@ -15381,78 +15382,81 @@ const El = Ml(
|
|
|
15381
15382
|
t.constructor.name
|
|
15382
15383
|
) : null;
|
|
15383
15384
|
});
|
|
15384
|
-
})
|
|
15385
|
+
});
|
|
15386
|
+
function wm(i, t, e) {
|
|
15387
|
+
Si(() => {
|
|
15388
|
+
const n = t.current, s = e.current;
|
|
15389
|
+
if (!n || !s) return;
|
|
15390
|
+
const r = /* @__PURE__ */ o(() => {
|
|
15391
|
+
const l = s.getBoundingClientRect(), c = { height: Math.max(1, l.height), width: Math.max(1, l.width) };
|
|
15392
|
+
n instanceof HTMLTextAreaElement && (n.style.width = `calc(${Math.ceil(c.width) + 2}px * var(--diagram-canvas-scale, 1))`, n.style.height = `calc(${Math.ceil(c.height) + 2}px * var(--diagram-canvas-scale, 1))`), (Math.abs(c.width - i.size.width) > 0.1 || Math.abs(c.height - i.size.height) > 0.1) && i.setSize(c);
|
|
15393
|
+
}, "update");
|
|
15394
|
+
r();
|
|
15395
|
+
const a = typeof ResizeObserver > "u" ? null : new ResizeObserver(r);
|
|
15396
|
+
return a?.observe(s), () => a?.disconnect();
|
|
15397
|
+
}, [i, i.draft, i.isEditing, i.text, t, e]);
|
|
15398
|
+
}
|
|
15399
|
+
o(wm, "useEdgeLabelMeasurement");
|
|
15400
|
+
const vm = M(
|
|
15385
15401
|
({ edge: i, label: t }) => {
|
|
15386
15402
|
const e = q(null), n = q(null), s = q(null), r = {
|
|
15387
15403
|
"--edge-label-x": `${t.position.x}px`,
|
|
15388
15404
|
"--edge-label-y": `${t.position.y}px`,
|
|
15389
15405
|
"--edge-label-text-align": t.alignment
|
|
15390
15406
|
}, a = i.diagram?.rules.allowEdition !== !1;
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
|
|
15398
|
-
|
|
15399
|
-
|
|
15400
|
-
|
|
15401
|
-
|
|
15402
|
-
|
|
15403
|
-
|
|
15404
|
-
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
15414
|
-
|
|
15415
|
-
|
|
15416
|
-
style: r,
|
|
15417
|
-
children: t.text
|
|
15418
|
-
}
|
|
15419
|
-
);
|
|
15420
|
-
const l = /* @__PURE__ */ o(() => {
|
|
15421
|
-
const u = s.current;
|
|
15422
|
-
u && u.autopanTimer !== null && (clearInterval(u.autopanTimer), u.autopanTimer = null);
|
|
15423
|
-
}, "clearDragAutopan"), c = /* @__PURE__ */ o(() => {
|
|
15424
|
-
const u = s.current;
|
|
15425
|
-
if (!u?.moved || !i.diagram) return;
|
|
15426
|
-
u.autopan.displace(u.latestPointer);
|
|
15427
|
-
const g = i.diagram.canvas.inverseFit(u.latestPointer).substract(u.startMouse), m = u.startPosition.copy().sum(g), b = i.diagram.getExtension(Gt)?.align(i, t, m) ?? m;
|
|
15407
|
+
wm(t, e, n);
|
|
15408
|
+
const l = /* @__PURE__ */ d.jsx("span", { "aria-hidden": "true", className: "edge-screen-label edge-label-measure", ref: n, children: t.isEditing ? t.draft || "M" : t.text });
|
|
15409
|
+
if (!a)
|
|
15410
|
+
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
15411
|
+
l,
|
|
15412
|
+
/* @__PURE__ */ d.jsx(
|
|
15413
|
+
"span",
|
|
15414
|
+
{
|
|
15415
|
+
className: "edge-screen-label",
|
|
15416
|
+
"data-edge-id": i.id,
|
|
15417
|
+
"data-edge-label-id": t.id,
|
|
15418
|
+
ref: e,
|
|
15419
|
+
style: r,
|
|
15420
|
+
children: t.text
|
|
15421
|
+
}
|
|
15422
|
+
)
|
|
15423
|
+
] });
|
|
15424
|
+
const c = /* @__PURE__ */ o(() => {
|
|
15425
|
+
const g = s.current;
|
|
15426
|
+
g && g.autopanTimer !== null && (clearInterval(g.autopanTimer), g.autopanTimer = null);
|
|
15427
|
+
}, "clearDragAutopan"), h = /* @__PURE__ */ o(() => {
|
|
15428
|
+
const g = s.current;
|
|
15429
|
+
if (!g?.moved || !i.diagram) return;
|
|
15430
|
+
g.autopan.displace(g.latestPointer);
|
|
15431
|
+
const m = i.diagram.canvas.inverseFit(g.latestPointer).substract(g.startMouse), b = g.startPosition.copy().sum(m), x = i.diagram.getExtension(Gt)?.align(i, t, b) ?? b;
|
|
15428
15432
|
t.setPosition(
|
|
15429
|
-
i.diagram.getExtension(yi)?.constrain(
|
|
15433
|
+
i.diagram.getExtension(yi)?.constrain(g.startPosition, x, b) ?? x
|
|
15430
15434
|
);
|
|
15431
|
-
}, "updateDraggedLabel"),
|
|
15432
|
-
if (
|
|
15433
|
-
|
|
15434
|
-
const p = i.diagram,
|
|
15435
|
-
let
|
|
15436
|
-
const
|
|
15437
|
-
if (!
|
|
15438
|
-
|
|
15439
|
-
const
|
|
15435
|
+
}, "updateDraggedLabel"), u = /* @__PURE__ */ o((g) => {
|
|
15436
|
+
if (g.button !== 0 || !i.diagram) return;
|
|
15437
|
+
g.preventDefault(), g.stopPropagation(), g.nativeEvent.stopImmediatePropagation();
|
|
15438
|
+
const p = i.diagram, m = p.getExtension(Gt), b = new At(p), x = new f(g.nativeEvent), y = p.canvas.inverseFit(x), w = t.position.copy();
|
|
15439
|
+
let v = x, k = !1, C = null;
|
|
15440
|
+
const P = /* @__PURE__ */ o(() => {
|
|
15441
|
+
if (!k) return;
|
|
15442
|
+
b.displace(v);
|
|
15443
|
+
const J = p.canvas.inverseFit(v).substract(y), X = w.copy().sum(J), ot = m?.align(i, t, X) ?? X;
|
|
15440
15444
|
t.setPosition(
|
|
15441
|
-
p.getExtension(yi)?.constrain(
|
|
15445
|
+
p.getExtension(yi)?.constrain(w, ot, X) ?? ot
|
|
15442
15446
|
);
|
|
15443
|
-
}, "update"),
|
|
15444
|
-
|
|
15445
|
-
}, "move"),
|
|
15446
|
-
|
|
15447
|
-
}, "cleanup"),
|
|
15448
|
-
|
|
15449
|
-
}, "finish"),
|
|
15450
|
-
|
|
15447
|
+
}, "update"), L = /* @__PURE__ */ o((J) => {
|
|
15448
|
+
v = new f(J), !(!k && v.copy().substract(x).norm < 5) && (k = !0, C === null && (C = setInterval(P, 30)), P());
|
|
15449
|
+
}, "move"), N = /* @__PURE__ */ o(() => {
|
|
15450
|
+
C !== null && clearInterval(C), document.removeEventListener("pointermove", L), document.removeEventListener("pointerup", T), document.removeEventListener("pointercancel", G), m?.clear();
|
|
15451
|
+
}, "cleanup"), T = /* @__PURE__ */ o(() => {
|
|
15452
|
+
N(), k && t.commitPosition();
|
|
15453
|
+
}, "finish"), G = /* @__PURE__ */ o(() => {
|
|
15454
|
+
N(), t.setPosition(w);
|
|
15451
15455
|
}, "cancel");
|
|
15452
|
-
|
|
15456
|
+
m?.clear(), document.addEventListener("pointermove", L, { passive: !1 }), document.addEventListener("pointerup", T, { once: !0 }), document.addEventListener("pointercancel", G, { once: !0 });
|
|
15453
15457
|
}, "startEditingDrag");
|
|
15454
15458
|
if (t.isEditing) {
|
|
15455
|
-
const
|
|
15459
|
+
const g = /* @__PURE__ */ o(() => t.confirmEdit(), "confirmEdit");
|
|
15456
15460
|
return /* @__PURE__ */ d.jsxs(
|
|
15457
15461
|
"div",
|
|
15458
15462
|
{
|
|
@@ -15462,22 +15466,14 @@ const El = Ml(
|
|
|
15462
15466
|
onPointerDown: /* @__PURE__ */ o((p) => p.stopPropagation(), "onPointerDown"),
|
|
15463
15467
|
style: r,
|
|
15464
15468
|
children: [
|
|
15465
|
-
|
|
15466
|
-
"span",
|
|
15467
|
-
{
|
|
15468
|
-
"aria-hidden": "true",
|
|
15469
|
-
className: "edge-label-editor__measure",
|
|
15470
|
-
ref: n,
|
|
15471
|
-
children: t.draft || "M"
|
|
15472
|
-
}
|
|
15473
|
-
),
|
|
15469
|
+
l,
|
|
15474
15470
|
/* @__PURE__ */ d.jsx(
|
|
15475
15471
|
"textarea",
|
|
15476
15472
|
{
|
|
15477
15473
|
"aria-label": "Edge label",
|
|
15478
15474
|
autoFocus: !0,
|
|
15479
15475
|
className: "edge-screen-label edge-screen-label--editing",
|
|
15480
|
-
onBlur:
|
|
15476
|
+
onBlur: g,
|
|
15481
15477
|
onChange: /* @__PURE__ */ o((p) => t.setDraft(p.target.value), "onChange"),
|
|
15482
15478
|
onClick: /* @__PURE__ */ o((p) => p.stopPropagation(), "onClick"),
|
|
15483
15479
|
onDoubleClick: /* @__PURE__ */ o((p) => p.stopPropagation(), "onDoubleClick"),
|
|
@@ -15489,7 +15485,7 @@ const El = Ml(
|
|
|
15489
15485
|
p.stopPropagation();
|
|
15490
15486
|
return;
|
|
15491
15487
|
}
|
|
15492
|
-
p.preventDefault(),
|
|
15488
|
+
p.preventDefault(), g();
|
|
15493
15489
|
} else p.key === "Escape" && (p.preventDefault(), t.cancelEdit());
|
|
15494
15490
|
p.stopPropagation();
|
|
15495
15491
|
}, "onKeyDown"),
|
|
@@ -15504,7 +15500,7 @@ const El = Ml(
|
|
|
15504
15500
|
"button",
|
|
15505
15501
|
{
|
|
15506
15502
|
"aria-label": "Move label",
|
|
15507
|
-
onPointerDown:
|
|
15503
|
+
onPointerDown: u,
|
|
15508
15504
|
title: "Move label",
|
|
15509
15505
|
type: "button",
|
|
15510
15506
|
children: /* @__PURE__ */ d.jsx(Hd, {})
|
|
@@ -15573,47 +15569,50 @@ const El = Ml(
|
|
|
15573
15569
|
}
|
|
15574
15570
|
);
|
|
15575
15571
|
}
|
|
15576
|
-
return /* @__PURE__ */ d.
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
|
|
15592
|
-
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
|
|
15598
|
-
|
|
15599
|
-
|
|
15600
|
-
|
|
15601
|
-
|
|
15602
|
-
|
|
15603
|
-
|
|
15604
|
-
|
|
15605
|
-
|
|
15606
|
-
|
|
15607
|
-
|
|
15608
|
-
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
|
|
15572
|
+
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
15573
|
+
l,
|
|
15574
|
+
/* @__PURE__ */ d.jsx(
|
|
15575
|
+
"span",
|
|
15576
|
+
{
|
|
15577
|
+
className: "edge-screen-label",
|
|
15578
|
+
"data-edge-id": i.id,
|
|
15579
|
+
"data-edge-label-id": t.id,
|
|
15580
|
+
ref: e,
|
|
15581
|
+
style: r,
|
|
15582
|
+
onPointerDown: /* @__PURE__ */ o((g) => {
|
|
15583
|
+
g.button !== 0 || !i.diagram || (g.preventDefault(), g.stopPropagation(), g.currentTarget.setPointerCapture(g.pointerId), s.current = {
|
|
15584
|
+
autopan: new At(i.diagram),
|
|
15585
|
+
autopanTimer: null,
|
|
15586
|
+
latestPointer: new f(g.nativeEvent),
|
|
15587
|
+
pointerId: g.pointerId,
|
|
15588
|
+
startMouse: i.diagram.canvas.inverseFit(
|
|
15589
|
+
new f(g.nativeEvent)
|
|
15590
|
+
),
|
|
15591
|
+
startMouseScreen: new f(g.nativeEvent),
|
|
15592
|
+
startPosition: t.position.copy(),
|
|
15593
|
+
moved: !1
|
|
15594
|
+
}, i.diagram?.getExtension(Gt)?.clear());
|
|
15595
|
+
}, "onPointerDown"),
|
|
15596
|
+
onPointerMove: /* @__PURE__ */ o((g) => {
|
|
15597
|
+
const p = s.current;
|
|
15598
|
+
!p || p.pointerId !== g.pointerId || !i.diagram || (p.latestPointer = new f(g.nativeEvent), p.latestPointer.copy().substract(p.startMouseScreen).norm < 5 && !p.moved) || (p.moved = !0, p.autopanTimer === null && (p.autopanTimer = setInterval(h, 30)), h());
|
|
15599
|
+
}, "onPointerMove"),
|
|
15600
|
+
onPointerUp: /* @__PURE__ */ o((g) => {
|
|
15601
|
+
const p = s.current;
|
|
15602
|
+
!p || p.pointerId !== g.pointerId || (g.stopPropagation(), c(), g.currentTarget.hasPointerCapture(g.pointerId) && g.currentTarget.releasePointerCapture(g.pointerId), p.moved && t.position.copy(!1).substract(p.startPosition).norm > 1e-3 && t.commitPosition(), p.moved || t.beginEdit(), i.diagram?.getExtension(Gt)?.clear(), s.current = null);
|
|
15603
|
+
}, "onPointerUp"),
|
|
15604
|
+
onPointerCancel: /* @__PURE__ */ o((g) => {
|
|
15605
|
+
const p = s.current;
|
|
15606
|
+
!p || p.pointerId !== g.pointerId || (c(), t.setPosition(p.startPosition), i.diagram?.getExtension(Gt)?.clear(), s.current = null);
|
|
15607
|
+
}, "onPointerCancel"),
|
|
15608
|
+
children: t.text
|
|
15609
|
+
}
|
|
15610
|
+
)
|
|
15611
|
+
] });
|
|
15613
15612
|
}
|
|
15614
|
-
),
|
|
15615
|
-
({ edge: i }) => i.labels.map((t) => /* @__PURE__ */ d.jsx(
|
|
15616
|
-
),
|
|
15613
|
+
), _m = M(
|
|
15614
|
+
({ edge: i }) => i.labels.map((t) => /* @__PURE__ */ d.jsx(vm, { edge: i, label: t }, t.id))
|
|
15615
|
+
), Em = M(({ node: i }) => {
|
|
15617
15616
|
const t = i.RenderScreen;
|
|
15618
15617
|
return t ? /* @__PURE__ */ d.jsx(
|
|
15619
15618
|
t,
|
|
@@ -15623,14 +15622,14 @@ const El = Ml(
|
|
|
15623
15622
|
scale: i.diagram?.canvas.scale ?? 1
|
|
15624
15623
|
}
|
|
15625
15624
|
) : null;
|
|
15626
|
-
}),
|
|
15625
|
+
}), km = M(() => {
|
|
15627
15626
|
const i = nt.use();
|
|
15628
15627
|
return /* @__PURE__ */ d.jsxs("div", { className: "screen_renderers", children: [
|
|
15629
|
-
i.nodes.map((t) => /* @__PURE__ */ d.jsx(
|
|
15630
|
-
i.edges.map((t) => /* @__PURE__ */ d.jsx(
|
|
15628
|
+
i.nodes.map((t) => /* @__PURE__ */ d.jsx(Em, { node: t }, t.id)),
|
|
15629
|
+
i.edges.map((t) => /* @__PURE__ */ d.jsx(_m, { edge: t }, t.id)),
|
|
15631
15630
|
/* @__PURE__ */ d.jsx(ym, {})
|
|
15632
15631
|
] });
|
|
15633
|
-
}),
|
|
15632
|
+
}), Sm = M(({ gateway: i }) => {
|
|
15634
15633
|
const e = nt.use().getExtension(Oe);
|
|
15635
15634
|
return /* @__PURE__ */ d.jsx(
|
|
15636
15635
|
Ee,
|
|
@@ -15660,7 +15659,7 @@ const El = Ml(
|
|
|
15660
15659
|
},
|
|
15661
15660
|
i.id
|
|
15662
15661
|
);
|
|
15663
|
-
}),
|
|
15662
|
+
}), Mm = M(({ node: i }) => {
|
|
15664
15663
|
const e = nt.use().getExtension(Oe);
|
|
15665
15664
|
return /* @__PURE__ */ d.jsx(
|
|
15666
15665
|
"path",
|
|
@@ -15684,10 +15683,10 @@ const El = Ml(
|
|
|
15684
15683
|
}, "onMouseOut")
|
|
15685
15684
|
}
|
|
15686
15685
|
);
|
|
15687
|
-
}),
|
|
15686
|
+
}), Cm = M(({ node: i }) => {
|
|
15688
15687
|
const t = i.RenderOverlay;
|
|
15689
15688
|
return t ? /* @__PURE__ */ d.jsx(t, { node: i, box: i.box }) : null;
|
|
15690
|
-
}),
|
|
15689
|
+
}), Am = M(() => {
|
|
15691
15690
|
const i = nt.use();
|
|
15692
15691
|
return /* @__PURE__ */ d.jsx(
|
|
15693
15692
|
"div",
|
|
@@ -15696,10 +15695,10 @@ const El = Ml(
|
|
|
15696
15695
|
width: `${i.canvas.size.x}px`,
|
|
15697
15696
|
height: `${i.canvas.size.y}px`
|
|
15698
15697
|
},
|
|
15699
|
-
children: i.nodes.map((t) => /* @__PURE__ */ d.jsx(
|
|
15698
|
+
children: i.nodes.map((t) => /* @__PURE__ */ d.jsx(Cm, { node: t }, t.id))
|
|
15700
15699
|
}
|
|
15701
15700
|
);
|
|
15702
|
-
}),
|
|
15701
|
+
}), Im = M(({ node: i }) => i.parent ? /* @__PURE__ */ d.jsx(d.Fragment, { children: !i.RenderOverlay && /* @__PURE__ */ d.jsx(
|
|
15703
15702
|
Ee,
|
|
15704
15703
|
{
|
|
15705
15704
|
paths: [
|
|
@@ -15751,15 +15750,15 @@ const El = Ml(
|
|
|
15751
15750
|
}, "onEndpointMouseDown")
|
|
15752
15751
|
}
|
|
15753
15752
|
)
|
|
15754
|
-
),
|
|
15753
|
+
), jm = xe(
|
|
15755
15754
|
M(() => {
|
|
15756
15755
|
const i = nt.use(), t = i.getExtension(V), e = t?.selectedNodes ?? [], n = t?.selectedEdges ?? [], s = i.rules.allowEdition, r = e.length + n.length > 1, a = [
|
|
15757
15756
|
...i.nodes.filter((c) => !e.includes(c)),
|
|
15758
15757
|
...e
|
|
15759
15758
|
], l = r || !s ? [] : a.filter((c) => c.hovered || c.selected).flatMap((c) => c.gateways);
|
|
15760
15759
|
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
15761
|
-
a.map((c) => /* @__PURE__ */ d.jsx(
|
|
15762
|
-
s && a.filter((c) => c.edgesAsGateways).map((c) => /* @__PURE__ */ d.jsx(
|
|
15760
|
+
a.map((c) => /* @__PURE__ */ d.jsx(Im, { node: c }, c.id)),
|
|
15761
|
+
s && a.filter((c) => c.edgesAsGateways).map((c) => /* @__PURE__ */ d.jsx(Mm, { node: c }, `edge-gateway-${c.id}`)),
|
|
15763
15762
|
i.edges.filter((c) => !n.includes(c)).map((c) => /* @__PURE__ */ d.jsx(
|
|
15764
15763
|
kl,
|
|
15765
15764
|
{
|
|
@@ -15770,7 +15769,7 @@ const El = Ml(
|
|
|
15770
15769
|
c.id
|
|
15771
15770
|
)),
|
|
15772
15771
|
l.map((c) => /* @__PURE__ */ d.jsx(
|
|
15773
|
-
|
|
15772
|
+
Sm,
|
|
15774
15773
|
{
|
|
15775
15774
|
gateway: c
|
|
15776
15775
|
},
|
|
@@ -15788,24 +15787,24 @@ const El = Ml(
|
|
|
15788
15787
|
] });
|
|
15789
15788
|
})
|
|
15790
15789
|
);
|
|
15791
|
-
function
|
|
15790
|
+
function Pm() {
|
|
15792
15791
|
return [
|
|
15793
|
-
/* @__PURE__ */ d.jsx(
|
|
15794
|
-
/* @__PURE__ */ d.jsx(
|
|
15792
|
+
/* @__PURE__ */ d.jsx(jm, {}, "ScalableShapes"),
|
|
15793
|
+
/* @__PURE__ */ d.jsx(Am, {}, "RenderNodeOverlays")
|
|
15795
15794
|
];
|
|
15796
15795
|
}
|
|
15797
|
-
o(
|
|
15798
|
-
function
|
|
15796
|
+
o(Pm, "shapes");
|
|
15797
|
+
function Nm(i) {
|
|
15799
15798
|
if (!(i instanceof Element)) return null;
|
|
15800
15799
|
const t = i.closest("[data-gateway-parent]");
|
|
15801
15800
|
return t ? t.getAttribute("data-gateway-parent") : i.closest("[data-id]")?.getAttribute("data-id") ?? null;
|
|
15802
15801
|
}
|
|
15803
|
-
o(
|
|
15804
|
-
const
|
|
15802
|
+
o(Nm, "hoverOwnerId");
|
|
15803
|
+
const Tm = M(({ children: i }) => {
|
|
15805
15804
|
const t = nt.use(), e = t.getExtension(Y);
|
|
15806
15805
|
t.canvas.setGridSize(e?.gridSize ?? 50);
|
|
15807
15806
|
const n = [], s = [], r = [];
|
|
15808
|
-
return Pc.forEach([...bm(i), ...
|
|
15807
|
+
return Pc.forEach([...bm(i), ...Pm()], (a) => {
|
|
15809
15808
|
a.type.__scalable ? n.push(a) : a.type.__scalableBack ? r.push(a) : s.push(a);
|
|
15810
15809
|
}), /* @__PURE__ */ d.jsxs(
|
|
15811
15810
|
"div",
|
|
@@ -15813,7 +15812,7 @@ const Nm = M(({ children: i }) => {
|
|
|
15813
15812
|
className: `canvas__frame ${t.showGrid ? "canvas__frame--grid" : ""}`,
|
|
15814
15813
|
onPointerLeave: /* @__PURE__ */ o(() => t.clearNodeHover(), "onPointerLeave"),
|
|
15815
15814
|
onPointerMove: /* @__PURE__ */ o((a) => {
|
|
15816
|
-
const l = t.getNodeById(
|
|
15815
|
+
const l = t.getNodeById(Nm(a.target) ?? "");
|
|
15817
15816
|
l ? l.setHovered(!0) : t.clearNodeHover();
|
|
15818
15817
|
}, "onPointerMove"),
|
|
15819
15818
|
children: [
|
|
@@ -15822,16 +15821,16 @@ const Nm = M(({ children: i }) => {
|
|
|
15822
15821
|
s.length && /* @__PURE__ */ d.jsx("div", { className: "scalable_components", children: s }),
|
|
15823
15822
|
n.length && /* @__PURE__ */ d.jsx(El, { className: "foreground", children: n })
|
|
15824
15823
|
] }),
|
|
15825
|
-
/* @__PURE__ */ d.jsx(
|
|
15824
|
+
/* @__PURE__ */ d.jsx(km, {})
|
|
15826
15825
|
]
|
|
15827
15826
|
}
|
|
15828
15827
|
);
|
|
15829
15828
|
});
|
|
15830
|
-
function
|
|
15829
|
+
function Lm({ children: i, className: t, ...e }) {
|
|
15831
15830
|
return /* @__PURE__ */ d.jsx("div", { ...e, className: ["stage", t].filter(Boolean).join(" "), children: i });
|
|
15832
15831
|
}
|
|
15833
|
-
o(
|
|
15834
|
-
const
|
|
15832
|
+
o(Lm, "Stage");
|
|
15833
|
+
const Dm = xe(
|
|
15835
15834
|
M(() => {
|
|
15836
15835
|
const i = nt.use(), t = i.getExtension(te), e = i.getExtension(Gt), n = i.getExtension(mi), s = [
|
|
15837
15836
|
...t?.proposals ?? [],
|
|
@@ -15880,7 +15879,7 @@ const Lm = xe(
|
|
|
15880
15879
|
})
|
|
15881
15880
|
] });
|
|
15882
15881
|
})
|
|
15883
|
-
),
|
|
15882
|
+
), zm = xe(
|
|
15884
15883
|
M(() => {
|
|
15885
15884
|
const t = nt.use().getExtension(Fl);
|
|
15886
15885
|
return t?.enabled ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
@@ -15905,8 +15904,8 @@ const Lm = xe(
|
|
|
15905
15904
|
)
|
|
15906
15905
|
] }) : null;
|
|
15907
15906
|
})
|
|
15908
|
-
), St = 8, qn = 2,
|
|
15909
|
-
function
|
|
15907
|
+
), St = 8, qn = 2, Om = 120;
|
|
15908
|
+
function Fm(i, t) {
|
|
15910
15909
|
const e = Math.max(
|
|
15911
15910
|
St,
|
|
15912
15911
|
Math.min(i.x, window.innerWidth - t.width - St)
|
|
@@ -15916,40 +15915,40 @@ function Om(i, t) {
|
|
|
15916
15915
|
);
|
|
15917
15916
|
return { x: e, y: n };
|
|
15918
15917
|
}
|
|
15919
|
-
o(
|
|
15920
|
-
function
|
|
15918
|
+
o(Fm, "clampPosition");
|
|
15919
|
+
function $m({
|
|
15921
15920
|
item: i,
|
|
15922
15921
|
onAction: t
|
|
15923
15922
|
}) {
|
|
15924
|
-
const e = !!i.submenu?.length, n = q(null), s = q(null), r = q(null), [a, l] =
|
|
15923
|
+
const e = !!i.submenu?.length, n = q(null), s = q(null), r = q(null), [a, l] = vt(!1), [c, h] = vt(!1), [u, g] = vt({
|
|
15925
15924
|
left: 0,
|
|
15926
15925
|
top: -4,
|
|
15927
15926
|
openToLeft: !1
|
|
15928
|
-
}),
|
|
15927
|
+
}), p = Cl(() => {
|
|
15929
15928
|
if (!n.current || !s.current)
|
|
15930
15929
|
return;
|
|
15931
15930
|
const v = n.current.getBoundingClientRect(), k = s.current.getBoundingClientRect();
|
|
15932
15931
|
let C = v.width - qn, P = !1;
|
|
15933
15932
|
v.right - qn + k.width > window.innerWidth - St && (C = -k.width + qn, P = !0), v.left + C < St && (C = St - v.left, P = !1);
|
|
15934
15933
|
let L = -4, N = v.top + L;
|
|
15935
|
-
N + k.height > window.innerHeight - St && (L -= N + k.height - (window.innerHeight - St), N = v.top + L), N < St && (L += St - N),
|
|
15934
|
+
N + k.height > window.innerHeight - St && (L -= N + k.height - (window.innerHeight - St), N = v.top + L), N < St && (L += St - N), g({ left: C, top: L, openToLeft: P }), h(!0);
|
|
15936
15935
|
}, []);
|
|
15937
15936
|
qt(() => {
|
|
15938
15937
|
a || h(!1);
|
|
15939
15938
|
}, [a]), qt(() => () => {
|
|
15940
15939
|
r.current !== null && window.clearTimeout(r.current);
|
|
15941
15940
|
}, []), Si(() => {
|
|
15942
|
-
a &&
|
|
15943
|
-
}, [a,
|
|
15941
|
+
a && p();
|
|
15942
|
+
}, [a, p]), qt(() => {
|
|
15944
15943
|
if (!a)
|
|
15945
15944
|
return;
|
|
15946
15945
|
const v = /* @__PURE__ */ o(() => {
|
|
15947
|
-
|
|
15946
|
+
p();
|
|
15948
15947
|
}, "handleResize");
|
|
15949
15948
|
return window.addEventListener("resize", v), () => {
|
|
15950
15949
|
window.removeEventListener("resize", v);
|
|
15951
15950
|
};
|
|
15952
|
-
}, [a,
|
|
15951
|
+
}, [a, p]);
|
|
15953
15952
|
const m = /* @__PURE__ */ o(() => {
|
|
15954
15953
|
r.current !== null && (window.clearTimeout(r.current), r.current = null);
|
|
15955
15954
|
}, "clearCloseTimeout"), b = /* @__PURE__ */ o(() => {
|
|
@@ -15959,7 +15958,7 @@ function Fm({
|
|
|
15959
15958
|
}, "closeSubmenu"), y = /* @__PURE__ */ o(() => {
|
|
15960
15959
|
e && (m(), r.current = window.setTimeout(() => {
|
|
15961
15960
|
l(!1), r.current = null;
|
|
15962
|
-
},
|
|
15961
|
+
}, Om));
|
|
15963
15962
|
}, "scheduleCloseSubmenu"), w = /* @__PURE__ */ o((v) => {
|
|
15964
15963
|
const k = v.relatedTarget;
|
|
15965
15964
|
(!k || !v.currentTarget.contains(k)) && x();
|
|
@@ -16012,13 +16011,13 @@ function Fm({
|
|
|
16012
16011
|
}
|
|
16013
16012
|
);
|
|
16014
16013
|
}
|
|
16015
|
-
o(
|
|
16014
|
+
o($m, "MenuItem");
|
|
16016
16015
|
function vc({
|
|
16017
16016
|
items: i,
|
|
16018
16017
|
onAction: t
|
|
16019
16018
|
}) {
|
|
16020
16019
|
return /* @__PURE__ */ d.jsx("ul", { className: "diagram__context_menu_list", children: i.map((e, n) => /* @__PURE__ */ d.jsx(
|
|
16021
|
-
|
|
16020
|
+
$m,
|
|
16022
16021
|
{
|
|
16023
16022
|
item: e,
|
|
16024
16023
|
onAction: t
|
|
@@ -16027,14 +16026,14 @@ function vc({
|
|
|
16027
16026
|
)) });
|
|
16028
16027
|
}
|
|
16029
16028
|
o(vc, "MenuItems");
|
|
16030
|
-
const
|
|
16031
|
-
const t = q(null), [e, n] =
|
|
16029
|
+
const Rm = M(({ menu: i }) => {
|
|
16030
|
+
const t = q(null), [e, n] = vt(i.position);
|
|
16032
16031
|
return qt(() => {
|
|
16033
16032
|
i.opened && n(i.position);
|
|
16034
16033
|
}, [i.openVersion, i.opened, i.position]), Si(() => {
|
|
16035
16034
|
if (!i.opened || !t.current)
|
|
16036
16035
|
return;
|
|
16037
|
-
const { width: s, height: r } = t.current.getBoundingClientRect(), { x: a, y: l } =
|
|
16036
|
+
const { width: s, height: r } = t.current.getBoundingClientRect(), { x: a, y: l } = Fm(i.position, { width: s, height: r });
|
|
16038
16037
|
(a !== e.x || l !== e.y) && n({ x: a, y: l });
|
|
16039
16038
|
}, [i.openVersion, i.opened, i.position, e.x, e.y]), qt(() => {
|
|
16040
16039
|
if (!i.opened)
|
|
@@ -16091,7 +16090,7 @@ const $m = M(({ menu: i }) => {
|
|
|
16091
16090
|
_opened = !1;
|
|
16092
16091
|
_position = { x: 0, y: 0 };
|
|
16093
16092
|
_openVersion = 0;
|
|
16094
|
-
Component = /* @__PURE__ */ o(() => /* @__PURE__ */ d.jsx(
|
|
16093
|
+
Component = /* @__PURE__ */ o(() => /* @__PURE__ */ d.jsx(Rm, { menu: this }), "Component");
|
|
16095
16094
|
constructor() {
|
|
16096
16095
|
ne(
|
|
16097
16096
|
this,
|
|
@@ -16143,10 +16142,10 @@ o(no, "ContextMenuStore");
|
|
|
16143
16142
|
let Ls = no;
|
|
16144
16143
|
const Jn = new Ls(), Ze = /* @__PURE__ */ o(() => {
|
|
16145
16144
|
}, "noop");
|
|
16146
|
-
function
|
|
16145
|
+
function Hm() {
|
|
16147
16146
|
return typeof navigator < "u" && !!navigator.clipboard?.writeText && !!navigator.clipboard?.readText;
|
|
16148
16147
|
}
|
|
16149
|
-
o(
|
|
16148
|
+
o(Hm, "hasClipboardSupport");
|
|
16150
16149
|
function Sl(i) {
|
|
16151
16150
|
return () => {
|
|
16152
16151
|
i().catch(() => {
|
|
@@ -16154,10 +16153,10 @@ function Sl(i) {
|
|
|
16154
16153
|
};
|
|
16155
16154
|
}
|
|
16156
16155
|
o(Sl, "runAsync");
|
|
16157
|
-
function
|
|
16156
|
+
function Gm(i, t, e) {
|
|
16158
16157
|
const n = i.getExtension(V), s = t.closest(".diagram__node")?.dataset.id, r = t.closest(".edge")?.dataset.id, a = s ? i.getNodeById(s) : void 0, l = r ? i.getEdgeById(r) : void 0;
|
|
16159
16158
|
a && !a.selected ? (n.clearSelection(), n.selectNode(a)) : l && !l.state.selected && (n.clearSelection(), n.selectEdge(l));
|
|
16160
|
-
const c = n.selectedNodes, h = n.selectedEdges, u = c.length + h.length > 0,
|
|
16159
|
+
const c = n.selectedNodes, h = n.selectedEdges, u = c.length + h.length > 0, g = i.rules.allowEdition, p = Hm(), m = p && c.length > 0, b = /* @__PURE__ */ o(() => {
|
|
16161
16160
|
n.selectedNodes.forEach((v) => {
|
|
16162
16161
|
i.delete(v);
|
|
16163
16162
|
}), n.selectedEdges.forEach((v) => {
|
|
@@ -16174,7 +16173,7 @@ function Hm(i, t, e) {
|
|
|
16174
16173
|
i.canvas.centerOnPoint(a.box.middle);
|
|
16175
16174
|
}, "onClick")
|
|
16176
16175
|
},
|
|
16177
|
-
...
|
|
16176
|
+
...g ? [
|
|
16178
16177
|
{
|
|
16179
16178
|
label: "Delete node",
|
|
16180
16179
|
onClick: /* @__PURE__ */ o(() => {
|
|
@@ -16184,7 +16183,7 @@ function Hm(i, t, e) {
|
|
|
16184
16183
|
}
|
|
16185
16184
|
] : []
|
|
16186
16185
|
]
|
|
16187
|
-
}) : l &&
|
|
16186
|
+
}) : l && g && x.push({
|
|
16188
16187
|
label: "Edge",
|
|
16189
16188
|
onClick: Ze,
|
|
16190
16189
|
submenu: [
|
|
@@ -16196,7 +16195,7 @@ function Hm(i, t, e) {
|
|
|
16196
16195
|
danger: !0
|
|
16197
16196
|
}
|
|
16198
16197
|
]
|
|
16199
|
-
}), u &&
|
|
16198
|
+
}), u && g && x.push({
|
|
16200
16199
|
label: "Delete selection",
|
|
16201
16200
|
onClick: b,
|
|
16202
16201
|
danger: !0
|
|
@@ -16229,13 +16228,13 @@ function Hm(i, t, e) {
|
|
|
16229
16228
|
disabled: !m
|
|
16230
16229
|
}
|
|
16231
16230
|
];
|
|
16232
|
-
|
|
16231
|
+
g && y.push({
|
|
16233
16232
|
label: "Paste",
|
|
16234
16233
|
onClick: Sl(async () => {
|
|
16235
16234
|
const v = await navigator.clipboard.readText();
|
|
16236
16235
|
v.trim().length && i.paste(v);
|
|
16237
16236
|
}),
|
|
16238
|
-
disabled: !
|
|
16237
|
+
disabled: !p
|
|
16239
16238
|
}), x.push({
|
|
16240
16239
|
label: "Selection",
|
|
16241
16240
|
onClick: Ze,
|
|
@@ -16279,8 +16278,8 @@ function Hm(i, t, e) {
|
|
|
16279
16278
|
]
|
|
16280
16279
|
}), x;
|
|
16281
16280
|
}
|
|
16282
|
-
o(
|
|
16283
|
-
const
|
|
16281
|
+
o(Gm, "buildDiagramContextMenu");
|
|
16282
|
+
const Bm = M(() => {
|
|
16284
16283
|
const i = nt.use();
|
|
16285
16284
|
return /* @__PURE__ */ d.jsx("div", { className: "diagram__extension_ui", children: i.extensions.map((t) => {
|
|
16286
16285
|
const e = t.RenderUI;
|
|
@@ -16293,7 +16292,7 @@ const Gm = M(() => {
|
|
|
16293
16292
|
t.constructor.name
|
|
16294
16293
|
) : null;
|
|
16295
16294
|
}) });
|
|
16296
|
-
}),
|
|
16295
|
+
}), Um = M(
|
|
16297
16296
|
({ diagram: i, leftPanel: t, toolbar: e }) => {
|
|
16298
16297
|
const n = /* @__PURE__ */ o((s) => {
|
|
16299
16298
|
const r = s.target;
|
|
@@ -16303,7 +16302,7 @@ const Gm = M(() => {
|
|
|
16303
16302
|
return;
|
|
16304
16303
|
}
|
|
16305
16304
|
s.preventDefault(), Jn.open(
|
|
16306
|
-
|
|
16305
|
+
Gm(i, r, {
|
|
16307
16306
|
x: s.clientX,
|
|
16308
16307
|
y: s.clientY
|
|
16309
16308
|
}),
|
|
@@ -16315,28 +16314,28 @@ const Gm = M(() => {
|
|
|
16315
16314
|
}
|
|
16316
16315
|
}, "handleContextMenu");
|
|
16317
16316
|
return /* @__PURE__ */ d.jsxs(i.Context, { children: [
|
|
16318
|
-
/* @__PURE__ */ d.jsxs(
|
|
16317
|
+
/* @__PURE__ */ d.jsxs(Lm, { onContextMenu: n, children: [
|
|
16319
16318
|
t,
|
|
16320
|
-
/* @__PURE__ */ d.jsxs(
|
|
16319
|
+
/* @__PURE__ */ d.jsxs(Tm, { children: [
|
|
16321
16320
|
/* @__PURE__ */ d.jsx(xm, {}),
|
|
16322
16321
|
/* @__PURE__ */ d.jsx(um, {}),
|
|
16323
16322
|
/* @__PURE__ */ d.jsx(pm, {}),
|
|
16324
|
-
/* @__PURE__ */ d.jsx(
|
|
16323
|
+
/* @__PURE__ */ d.jsx(Dm, {}),
|
|
16325
16324
|
/* @__PURE__ */ d.jsx(fm, {}),
|
|
16326
|
-
/* @__PURE__ */ d.jsx(
|
|
16325
|
+
/* @__PURE__ */ d.jsx(zm, {})
|
|
16327
16326
|
] }),
|
|
16328
|
-
/* @__PURE__ */ d.jsx(
|
|
16327
|
+
/* @__PURE__ */ d.jsx(Bm, {})
|
|
16329
16328
|
] }),
|
|
16330
16329
|
/* @__PURE__ */ d.jsx(Jn.Component, {}),
|
|
16331
16330
|
e
|
|
16332
16331
|
] });
|
|
16333
16332
|
}
|
|
16334
16333
|
);
|
|
16335
|
-
function
|
|
16334
|
+
function Xm(i) {
|
|
16336
16335
|
i.currentTarget.contains(i.target) && (i.stopPropagation(), i.nativeEvent?.stopImmediatePropagation?.());
|
|
16337
16336
|
}
|
|
16338
|
-
o(
|
|
16339
|
-
function
|
|
16337
|
+
o(Xm, "stopDiagramControlEvent");
|
|
16338
|
+
function qm(i, t = "button,input,select,textarea,[role='menu'],[data-diagram-control],.toolbar,.ui-toolbar,.mr__properties_panel,.shared-modal") {
|
|
16340
16339
|
const e = q(null), n = q(null), s = Cl(() => {
|
|
16341
16340
|
const r = n.current;
|
|
16342
16341
|
n.current = null, r && e.current?.hasPointerCapture(r.id) && e.current.releasePointerCapture(r.id), e.current?.classList.remove("diagram-pointer-dragging");
|
|
@@ -16372,15 +16371,15 @@ function Xm(i, t = "button,input,select,textarea,[role='menu'],[data-diagram-con
|
|
|
16372
16371
|
}
|
|
16373
16372
|
};
|
|
16374
16373
|
}
|
|
16375
|
-
o(
|
|
16376
|
-
function
|
|
16374
|
+
o(qm, "useDiagramPointerCapture");
|
|
16375
|
+
function Jm(i, t) {
|
|
16377
16376
|
const e = /* @__PURE__ */ o(() => i.querySelectorAll(".diagram-attribute-edge,.diagram-attribute-related").forEach((a) => a.classList.remove("diagram-attribute-edge", "diagram-attribute-related")), "clear"), n = /* @__PURE__ */ o((a) => a instanceof Element ? a.closest("[data-attribute-id]") : null, "row"), s = /* @__PURE__ */ o((a) => {
|
|
16378
16377
|
const l = n(a.target);
|
|
16379
16378
|
if (!l || !i.contains(l)) return;
|
|
16380
16379
|
e();
|
|
16381
|
-
const c = t.edges.filter((
|
|
16382
|
-
i.querySelectorAll("[data-id]").forEach((
|
|
16383
|
-
h.has(
|
|
16380
|
+
const c = t.edges.filter((p) => p instanceof It && (p.sourceAttributeIds.includes(l.dataset.attributeId) || p.targetAttributeIds.includes(l.dataset.attributeId))), h = new Set(c.map((p) => p.id)), u = new Set(c.flatMap((p) => [p.from?.parent?.id, p.to?.parent?.id])), g = l.closest("[data-id]")?.getAttribute("data-id");
|
|
16381
|
+
i.querySelectorAll("[data-id]").forEach((p) => {
|
|
16382
|
+
h.has(p.dataset.id) && p.classList.add("diagram-attribute-edge"), u.has(p.dataset.id) && p.dataset.id !== g && p.classList.add("diagram-attribute-related");
|
|
16384
16383
|
});
|
|
16385
16384
|
}, "over"), r = /* @__PURE__ */ o((a) => {
|
|
16386
16385
|
n(a.target) !== n(a.relatedTarget) && e();
|
|
@@ -16389,9 +16388,9 @@ function qm(i, t) {
|
|
|
16389
16388
|
e(), i.removeEventListener("pointerover", s), i.removeEventListener("pointerout", r);
|
|
16390
16389
|
};
|
|
16391
16390
|
}
|
|
16392
|
-
o(
|
|
16391
|
+
o(Jm, "bindAttributeRelationshipHover");
|
|
16393
16392
|
const zi = /* @__PURE__ */ new WeakMap();
|
|
16394
|
-
function
|
|
16393
|
+
function Qm(i, t, e = {}) {
|
|
16395
16394
|
const n = i.canvas.frameDimensions;
|
|
16396
16395
|
if (n.width <= 0 || n.height <= 0) return !1;
|
|
16397
16396
|
zi.get(i)?.();
|
|
@@ -16409,12 +16408,12 @@ function Jm(i, t, e = {}) {
|
|
|
16409
16408
|
}, "dismiss");
|
|
16410
16409
|
return a?.addEventListener("mousedown", h, !0), l = i.canvas.onDetach(c), e.attributeId && a && requestAnimationFrame(() => {
|
|
16411
16410
|
if (zi.get(i) !== c) return;
|
|
16412
|
-
i.canvas.element?.querySelectorAll("[data-attribute-id]").forEach((
|
|
16413
|
-
|
|
16411
|
+
i.canvas.element?.querySelectorAll("[data-attribute-id]").forEach((g) => {
|
|
16412
|
+
g.dataset.attributeId === e.attributeId && g.classList.add("diagram-reference-attribute");
|
|
16414
16413
|
});
|
|
16415
16414
|
}), zi.set(i, c), !0;
|
|
16416
16415
|
}
|
|
16417
|
-
o(
|
|
16416
|
+
o(Qm, "revealDiagramNode");
|
|
16418
16417
|
export {
|
|
16419
16418
|
wo as AgentDiagram,
|
|
16420
16419
|
Cs as BPMDiagram,
|
|
@@ -16431,21 +16430,83 @@ export {
|
|
|
16431
16430
|
gn as BPMNExecutionTaskNode,
|
|
16432
16431
|
mn as BPMNExecutionTextAnnotationNode,
|
|
16433
16432
|
fn as BPMNExecutionUnknownNode,
|
|
16434
|
-
|
|
16433
|
+
gt as BPMNNodeExecutionState,
|
|
16435
16434
|
Ft as BPMN_LABELS,
|
|
16435
|
+
hd as Canvas,
|
|
16436
16436
|
Ko as CommunicationDiagram,
|
|
16437
16437
|
f as Coordinates,
|
|
16438
|
+
ms as Creator,
|
|
16439
|
+
li as DCanvasEvent,
|
|
16440
|
+
st as DChangeEvent,
|
|
16441
|
+
Ri as DClickEvent,
|
|
16442
|
+
Gi as DDeleteEdgeEvent,
|
|
16443
|
+
Te as DDeleteNodeEvent,
|
|
16444
|
+
ss as DDisplaceEvent,
|
|
16445
|
+
Hi as DDoubleClickEvent,
|
|
16446
|
+
Zi as DDragEdgeSegmentEvent,
|
|
16447
|
+
Qt as DDragEvent,
|
|
16448
|
+
jt as DDragNodeEvent,
|
|
16449
|
+
Vi as DEdgeDragStartEvent,
|
|
16450
|
+
Wi as DEdgeEndpointDragStartEvent,
|
|
16451
|
+
we as DEdgeLabelChangeEvent,
|
|
16452
|
+
Bi as DEdgeSelectionEvent,
|
|
16453
|
+
$i as DEvent,
|
|
16454
|
+
he as DKeyDownEvent,
|
|
16455
|
+
ns as DKeyPressEvent,
|
|
16456
|
+
oi as DKeyUpEvent,
|
|
16457
|
+
ai as DKeyboardEvent,
|
|
16458
|
+
Zt as DMouseDownEvent,
|
|
16459
|
+
Yt as DMouseEvent,
|
|
16460
|
+
Kt as DMouseMoveEvent,
|
|
16461
|
+
dt as DMouseUpEvent,
|
|
16462
|
+
Mt as DNodeChangeTypeEvent,
|
|
16463
|
+
as as DNodeConnectionIntentEvent,
|
|
16464
|
+
pi as DNodeSelectionEvent,
|
|
16465
|
+
hi as DNodesConnectActionEvent,
|
|
16466
|
+
di as DNodesConnectionEvent,
|
|
16467
|
+
rs as DResetGraphEvent,
|
|
16468
|
+
ci as DScaleEvent,
|
|
16469
|
+
ui as DSelectionEvent,
|
|
16470
|
+
Ne as DUIEvent,
|
|
16471
|
+
is as DWheelEvent,
|
|
16438
16472
|
nt as Diagram,
|
|
16439
|
-
|
|
16473
|
+
Um as DiagramEditor,
|
|
16474
|
+
H as DiagramExtension,
|
|
16475
|
+
S as Dimensions,
|
|
16476
|
+
mi as DistancesBalancer,
|
|
16477
|
+
fs as Dragger,
|
|
16478
|
+
ee as Edge,
|
|
16479
|
+
qe as EdgeLabel,
|
|
16480
|
+
W as EdgePoint,
|
|
16481
|
+
Yi as EdgePointPositionProposal,
|
|
16482
|
+
Oe as EdgesDragger,
|
|
16483
|
+
$e as EditableDiagram,
|
|
16484
|
+
me as Element,
|
|
16485
|
+
Lt as Gateway,
|
|
16486
|
+
Y as GridSnap,
|
|
16487
|
+
fi as History,
|
|
16488
|
+
gs as Hotkeys,
|
|
16489
|
+
Gt as LabelsAligner,
|
|
16440
16490
|
xl as MRDiagram,
|
|
16441
16491
|
It as MRForeignKeyEdge,
|
|
16492
|
+
ei as MRModelerExtension,
|
|
16442
16493
|
Jt as MRTableNode,
|
|
16494
|
+
xi as Measurer,
|
|
16495
|
+
Mi as Node,
|
|
16496
|
+
gi as NodePositionProposal,
|
|
16497
|
+
te as NodesAligner,
|
|
16498
|
+
Fe as NodesConnector,
|
|
16499
|
+
xs as NodesResizer,
|
|
16500
|
+
Fl as PathFindingRenderer,
|
|
16501
|
+
V as Selector,
|
|
16502
|
+
ws as StraightDrag,
|
|
16503
|
+
yi as StraightLabelsDrag,
|
|
16443
16504
|
ts as ToolsStates,
|
|
16444
|
-
|
|
16505
|
+
Jm as bindAttributeRelationshipHover,
|
|
16445
16506
|
Ao as configureBPMNLabels,
|
|
16446
16507
|
et as customRendererProps,
|
|
16447
|
-
|
|
16448
|
-
|
|
16449
|
-
|
|
16508
|
+
Qm as revealDiagramNode,
|
|
16509
|
+
Xm as stopDiagramControlEvent,
|
|
16510
|
+
qm as useDiagramPointerCapture
|
|
16450
16511
|
};
|
|
16451
16512
|
//# sourceMappingURL=index.es.js.map
|