@miragon/wardley-renderer 0.6.1 → 0.6.2

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/dist/index.js CHANGED
@@ -10,21 +10,21 @@ import ie from "diagram-js/lib/navigation/movecanvas";
10
10
  import ae from "diagram-js/lib/features/keyboard";
11
11
  import oe from "diagram-js/lib/features/modeling";
12
12
  import se from "diagram-js/lib/features/move";
13
- import ce from "diagram-js/lib/features/create";
14
- import le from "diagram-js/lib/features/connect";
15
- import ue from "diagram-js/lib/features/context-pad";
16
- import de from "diagram-js/lib/features/palette";
17
- import fe from "diagram-js/lib/features/rules";
18
- import pe from "diagram-js/lib/features/outline";
19
- import me from "diagram-js/lib/features/resize";
20
- import he from "diagram-js/lib/features/popup-menu";
21
- import ge from "diagram-js/lib/features/mouse";
22
- import _e from "diagram-js/lib/features/lasso-tool";
23
- import ve from "diagram-js/lib/features/rules/RuleProvider";
24
- import ye from "diagram-js/lib/features/connection-preview";
25
- import be from "diagram-js/lib/features/ordering/OrderingProvider";
13
+ import m from "diagram-js/lib/features/create";
14
+ import ce from "diagram-js/lib/features/connect";
15
+ import le from "diagram-js/lib/features/context-pad";
16
+ import ue from "diagram-js/lib/features/palette";
17
+ import de from "diagram-js/lib/features/rules";
18
+ import fe from "diagram-js/lib/features/outline";
19
+ import pe from "diagram-js/lib/features/resize";
20
+ import me from "diagram-js/lib/features/popup-menu";
21
+ import he from "diagram-js/lib/features/mouse";
22
+ import ge from "diagram-js/lib/features/lasso-tool";
23
+ import _e from "diagram-js/lib/features/rules/RuleProvider";
24
+ import ve from "diagram-js/lib/features/connection-preview";
25
+ import ye from "diagram-js/lib/features/ordering/OrderingProvider";
26
26
  //#region src/theme/palette.ts
27
- var m = {
27
+ var h = {
28
28
  blau: "#335DE5",
29
29
  blauLink: "#2B50D4",
30
30
  blauHell: "#6B8AFF",
@@ -39,52 +39,52 @@ var m = {
39
39
  navy: "#080A20",
40
40
  gradientBrand: "linear-gradient(120deg, #335DE5 30%, #00E676)"
41
41
  };
42
- m.grau, m.schwarz, m.weiss, m.blau, m.gruen, m.danger, m.navy;
42
+ h.grau, h.schwarz, h.weiss, h.blau, h.gruen, h.danger, h.navy;
43
43
  //#endregion
44
44
  //#region src/draw/styles.ts
45
- var h = {
45
+ var g = {
46
46
  width: a.width,
47
47
  height: a.height,
48
48
  marginLeft: 66,
49
49
  marginTop: 38,
50
50
  marginRight: 44,
51
51
  marginBottom: 58
52
- }, xe = {
52
+ }, be = {
53
53
  width: 480,
54
54
  height: 320
55
- }, Se = 8, Ce = 6, we = 7.5;
56
- function g(e) {
55
+ }, xe = 7.5;
56
+ function _(e) {
57
57
  let t = (e && e.length ? e : "note").split("\n"), n = Math.max(1, ...t.map((e) => e.length));
58
58
  return {
59
59
  lines: t,
60
- width: Math.max(34, Math.round(n * we) + Se * 2),
61
- height: Math.max(34, t.length * 17 + Ce * 2)
60
+ width: Math.max(34, Math.round(n * xe) + 16),
61
+ height: Math.max(34, t.length * 17 + 12)
62
62
  };
63
63
  }
64
- var _ = {
65
- paper: m.grau,
66
- ink: m.schwarz,
64
+ var v = {
65
+ paper: h.grau,
66
+ ink: h.schwarz,
67
67
  inkSoft: "#5B5B5B",
68
68
  axis: "rgba(51,93,229,0.22)",
69
69
  axisText: "#6E7797",
70
70
  grid: "rgba(51,93,229,0.12)",
71
71
  band: "rgba(51,93,229,0.04)",
72
- stroke: m.schwarz,
73
- componentFill: m.weiss,
74
- anchorFill: m.schwarz,
72
+ stroke: h.schwarz,
73
+ componentFill: h.weiss,
74
+ anchorFill: h.schwarz,
75
75
  dependency: "#9E9E9E",
76
- accent: m.blau,
76
+ accent: h.blau,
77
77
  accentSoft: "rgba(51,93,229,0.12)",
78
- flow: m.blau,
79
- movement: m.danger,
80
- inertia: m.schwarz,
78
+ flow: h.blau,
79
+ movement: h.danger,
80
+ inertia: h.schwarz,
81
81
  noteText: "#5B5B5B",
82
- pipeline: m.schwarz,
82
+ pipeline: h.schwarz,
83
83
  annotationFill: "#FBF3E0",
84
- plotBackground: m.weiss,
84
+ plotBackground: h.weiss,
85
85
  accelerator: "#00C853",
86
- deaccelerator: m.danger
87
- }, Te = [
86
+ deaccelerator: h.danger
87
+ }, Se = [
88
88
  {
89
89
  id: "green",
90
90
  name: "Green · good",
@@ -125,7 +125,7 @@ var _ = {
125
125
  name: "Slate · neutral",
126
126
  value: "#4A4A4A"
127
127
  }
128
- ], v = {
128
+ ], y = {
129
129
  pioneers: {
130
130
  fill: "rgba(51,93,229,0.07)",
131
131
  stroke: "#335DE5"
@@ -138,7 +138,7 @@ var _ = {
138
138
  fill: "rgba(0,200,83,0.08)",
139
139
  stroke: "#00C853"
140
140
  }
141
- }, y = {
141
+ }, b = {
142
142
  family: "'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
143
143
  label: 13,
144
144
  axis: 12,
@@ -146,14 +146,14 @@ var _ = {
146
146
  };
147
147
  //#endregion
148
148
  //#region src/io/saveSvg.ts
149
- function Ee(e, t) {
149
+ function Ce(e, t) {
150
150
  let n = e.getContainer().querySelector("svg");
151
151
  if (!n) throw Error("No SVG found in the canvas container.");
152
152
  let r = n.cloneNode(!0), i = t ?? {
153
153
  x: 0,
154
154
  y: 0,
155
- width: h.marginLeft + h.width + h.marginRight,
156
- height: h.marginTop + h.height + h.marginBottom
155
+ width: g.marginLeft + g.width + g.marginRight,
156
+ height: g.marginTop + g.height + g.marginBottom
157
157
  };
158
158
  r.setAttribute("xmlns", "http://www.w3.org/2000/svg"), r.setAttribute("viewBox", `${i.x} ${i.y} ${i.width} ${i.height}`), r.setAttribute("width", String(i.width)), r.setAttribute("height", String(i.height));
159
159
  let a = r.querySelector(".viewport");
@@ -161,13 +161,13 @@ function Ee(e, t) {
161
161
  }
162
162
  //#endregion
163
163
  //#region src/io/types.ts
164
- var De = "wardley-root";
164
+ var we = "wardley-root";
165
165
  //#endregion
166
166
  //#region src/WardleyBaseViewer.ts
167
- function Oe(e) {
167
+ function Te(e) {
168
168
  return typeof e == "number" ? `${e}px` : e;
169
169
  }
170
- var ke = class {
170
+ var Ee = class {
171
171
  _diagram;
172
172
  _container;
173
173
  _options;
@@ -176,7 +176,7 @@ var ke = class {
176
176
  }
177
177
  _createContainer(e) {
178
178
  let t = e.container ?? document.createElement("div");
179
- return t.classList.add("wardley-container"), t.style.width = Oe(e.width ?? "100%"), t.style.height = Oe(e.height ?? (e.container ? "100%" : "600px")), t;
179
+ return t.classList.add("wardley-container"), t.style.width = Te(e.width ?? "100%"), t.style.height = Te(e.height ?? (e.container ? "100%" : "600px")), t;
180
180
  }
181
181
  _ensureDiagram() {
182
182
  if (!this._diagram) {
@@ -263,7 +263,7 @@ var ke = class {
263
263
  return n(this.exportMap());
264
264
  }
265
265
  async saveSVG() {
266
- return Ee(this.get("canvas"), this.get("evolutionGrid").outerBounds());
266
+ return Ce(this.get("canvas"), this.get("evolutionGrid").outerBounds());
267
267
  }
268
268
  attachTo(e) {
269
269
  e.appendChild(this._container), this.get("canvas").resized();
@@ -280,7 +280,7 @@ var ke = class {
280
280
  get container() {
281
281
  return this._container;
282
282
  }
283
- }, Ae = class {
283
+ }, De = class {
284
284
  elementFactory;
285
285
  grid;
286
286
  elementRegistry;
@@ -319,13 +319,13 @@ var ke = class {
319
319
  ...e.labelOffset ? { labelOffset: e.labelOffset } : {},
320
320
  ...e.pipelineId ? { pipelineId: e.pipelineId } : {}
321
321
  });
322
- return e.pipelineId && (t.y += 30 / 2), t;
322
+ return e.pipelineId && (t.y += 15), t;
323
323
  }
324
324
  createAnchor(e) {
325
325
  return this.node("anchor", e.id, e.label, e.position.visibility, e.position.evolution, e, { ...e.labelOffset ? { labelOffset: e.labelOffset } : {} });
326
326
  }
327
327
  createNote(e) {
328
- let { width: t, height: n } = g(e.label), r = this.grid.toCanvas(e.position);
328
+ let { width: t, height: n } = _(e.label), r = this.grid.toCanvas(e.position);
329
329
  return this.elementFactory.createShape({
330
330
  id: e.id,
331
331
  x: r.x - t / 2,
@@ -450,7 +450,7 @@ var ke = class {
450
450
  isFrame: !0
451
451
  });
452
452
  if (e === "note") {
453
- let { width: e, height: t } = g(r);
453
+ let { width: e, height: t } = _(r);
454
454
  return this.elementFactory.createShape({
455
455
  width: e,
456
456
  height: t,
@@ -487,8 +487,8 @@ var ke = class {
487
487
  }), c = a?.color;
488
488
  return this.elementFactory.createShape({
489
489
  id: t,
490
- x: s.x - 34 / 2,
491
- y: s.y - 34 / 2,
490
+ x: s.x - 17,
491
+ y: s.y - 17,
492
492
  width: 34,
493
493
  height: 34,
494
494
  wardleyType: e,
@@ -506,7 +506,7 @@ var ke = class {
506
506
  id: t.id,
507
507
  source: n,
508
508
  target: r,
509
- waypoints: [je(n), je(r)],
509
+ waypoints: [Oe(n), Oe(r)],
510
510
  wardleyType: e,
511
511
  bidirectional: i,
512
512
  ...a ? { flowValue: a } : {},
@@ -515,7 +515,7 @@ var ke = class {
515
515
  });
516
516
  }
517
517
  };
518
- function je(e) {
518
+ function Oe(e) {
519
519
  return e.wardleyType === "pipeline" ? {
520
520
  x: e.x + e.width / 2,
521
521
  y: e.y
@@ -526,55 +526,55 @@ function je(e) {
526
526
  }
527
527
  //#endregion
528
528
  //#region src/model/di-types.ts
529
- function b(e) {
530
- return typeof e == "object" && !!e;
531
- }
532
529
  function x(e) {
533
- return b(e) && typeof e.wardleyType == "string" && "evolution" in e;
530
+ return typeof e == "object" && !!e;
534
531
  }
535
532
  function S(e) {
536
- return b(e) && typeof e.wardleyType == "string" && "waypoints" in e;
537
- }
538
- function Me(e) {
539
- return x(e) && e.wardleyType === "component";
533
+ return x(e) && typeof e.wardleyType == "string" && "evolution" in e;
540
534
  }
541
535
  function C(e) {
542
- return x(e) && e.wardleyType === "pipeline";
536
+ return x(e) && typeof e.wardleyType == "string" && "waypoints" in e;
537
+ }
538
+ function w(e) {
539
+ return S(e) && e.wardleyType === "component";
543
540
  }
544
- function Ne(e) {
545
- return x(e) && e.wardleyType === "attitude";
541
+ function T(e) {
542
+ return S(e) && e.wardleyType === "pipeline";
543
+ }
544
+ function ke(e) {
545
+ return S(e) && e.wardleyType === "attitude";
546
546
  }
547
547
  //#endregion
548
548
  //#region src/model/index.ts
549
- var Pe = { wardleyElementFactory: ["type", Ae] }, Fe = "wardley-axes";
550
- function Ie(e) {
549
+ var E = { wardleyElementFactory: ["type", De] }, Ae = "wardley-axes";
550
+ function D(e) {
551
551
  return e < 0 ? 0 : e > 1 ? 1 : e;
552
552
  }
553
- var Le = class {
553
+ var O = class {
554
554
  canvas;
555
555
  static $inject = ["canvas"];
556
556
  boundaries = o;
557
557
  labels = i;
558
558
  yAxisLabel = "Value Chain";
559
559
  yAxisEndLabels = ["invisible", "visible"];
560
- plotWidth = h.width;
561
- plotHeight = h.height;
560
+ plotWidth = g.width;
561
+ plotHeight = g.height;
562
562
  constructor(e) {
563
563
  this.canvas = e;
564
564
  }
565
565
  configure(e) {
566
- this.boundaries = e.stageBoundaries ?? o, this.labels = e.evolutionLabels ?? i, this.yAxisLabel = e.yAxisLabel ?? "Value Chain", this.yAxisEndLabels = e.yAxisEndLabels ?? ["invisible", "visible"], this.plotWidth = Math.max(e.size?.width ?? h.width, xe.width), this.plotHeight = Math.max(e.size?.height ?? h.height, xe.height);
566
+ this.boundaries = e.stageBoundaries ?? o, this.labels = e.evolutionLabels ?? i, this.yAxisLabel = e.yAxisLabel ?? "Value Chain", this.yAxisEndLabels = e.yAxisEndLabels ?? ["invisible", "visible"], this.plotWidth = Math.max(e.size?.width ?? g.width, be.width), this.plotHeight = Math.max(e.size?.height ?? g.height, be.height);
567
567
  }
568
568
  toCanvas(e) {
569
569
  return {
570
- x: h.marginLeft + e.evolution * this.plotWidth,
571
- y: h.marginTop + (1 - e.visibility) * this.plotHeight
570
+ x: g.marginLeft + e.evolution * this.plotWidth,
571
+ y: g.marginTop + (1 - e.visibility) * this.plotHeight
572
572
  };
573
573
  }
574
574
  fromCanvas(e) {
575
575
  return {
576
- evolution: Ie((e.x - h.marginLeft) / this.plotWidth),
577
- visibility: Ie(1 - (e.y - h.marginTop) / this.plotHeight)
576
+ evolution: D((e.x - g.marginLeft) / this.plotWidth),
577
+ visibility: D(1 - (e.y - g.marginTop) / this.plotHeight)
578
578
  };
579
579
  }
580
580
  stageOf(e) {
@@ -593,17 +593,17 @@ var Le = class {
593
593
  return {
594
594
  x: 0,
595
595
  y: 0,
596
- width: h.marginLeft + this.plotWidth + h.marginRight,
597
- height: h.marginTop + this.plotHeight + h.marginBottom
596
+ width: g.marginLeft + this.plotWidth + g.marginRight,
597
+ height: g.marginTop + this.plotHeight + g.marginBottom
598
598
  };
599
599
  }
600
600
  render() {
601
- let e = this.canvas.getLayer(Fe, -1);
601
+ let e = this.canvas.getLayer(Ae, -1);
602
602
  d(e);
603
- let t = h.marginLeft, n = h.marginTop, r = t + this.plotWidth, i = n + this.plotHeight;
604
- l(e, Re(t, n, this.plotWidth, this.plotHeight, {
605
- fill: _.plotBackground,
606
- stroke: _.grid
603
+ let t = g.marginLeft, n = g.marginTop, r = t + this.plotWidth, i = n + this.plotHeight;
604
+ l(e, je(t, n, this.plotWidth, this.plotHeight, {
605
+ fill: v.plotBackground,
606
+ stroke: v.grid
607
607
  }));
608
608
  let a = [
609
609
  0,
@@ -612,45 +612,45 @@ var Le = class {
612
612
  ];
613
613
  for (let r = 0; r < 4; r++) {
614
614
  let o = t + a[r] * this.plotWidth, s = t + a[r + 1] * this.plotWidth;
615
- r % 2 == 1 && l(e, Re(o, n, s - o, this.plotHeight, {
616
- fill: _.band,
615
+ r % 2 == 1 && l(e, je(o, n, s - o, this.plotHeight, {
616
+ fill: v.band,
617
617
  stroke: "none"
618
- })), r > 0 && l(e, w(o, n, o, i, {
619
- stroke: _.grid,
618
+ })), r > 0 && l(e, k(o, n, o, i, {
619
+ stroke: v.grid,
620
620
  "stroke-dasharray": "3 5"
621
621
  }));
622
622
  let c = (o + s) / 2;
623
- l(e, T(this.labels[r].toUpperCase(), c, i + 18, {
623
+ l(e, A(this.labels[r].toUpperCase(), c, i + 18, {
624
624
  "text-anchor": "middle",
625
- "font-size": y.stage,
625
+ "font-size": b.stage,
626
626
  "letter-spacing": "0.08em",
627
- fill: _.axisText
627
+ fill: v.axisText
628
628
  }));
629
629
  }
630
- l(e, w(t, i, r + 10, i, { stroke: _.axis })), l(e, ze(r + 10, i, "right")), l(e, T("Evolution", r + 6, i + 38, {
630
+ l(e, k(t, i, r + 10, i, { stroke: v.axis })), l(e, Me(r + 10, i, "right")), l(e, A("Evolution", r + 6, i + 38, {
631
631
  "text-anchor": "end",
632
- "font-size": y.axis,
633
- fill: _.axisText,
632
+ "font-size": b.axis,
633
+ fill: v.axisText,
634
634
  "font-style": "italic"
635
- })), l(e, w(t, i, t, n - 10, { stroke: _.axis })), l(e, ze(t, n - 10, "up"));
636
- let o = T(this.yAxisLabel, 0, 0, {
635
+ })), l(e, k(t, i, t, n - 10, { stroke: v.axis })), l(e, Me(t, n - 10, "up"));
636
+ let o = A(this.yAxisLabel, 0, 0, {
637
637
  "text-anchor": "middle",
638
- "font-size": y.axis,
639
- fill: _.axisText,
638
+ "font-size": b.axis,
639
+ fill: v.axisText,
640
640
  "font-style": "italic"
641
641
  });
642
- u(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), l(e, o), l(e, T(this.yAxisEndLabels[1], t - 10, n + 11, {
642
+ u(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), l(e, o), l(e, A(this.yAxisEndLabels[1], t - 10, n + 11, {
643
643
  "text-anchor": "end",
644
- "font-size": y.stage,
645
- fill: _.axisText
646
- })), l(e, T(this.yAxisEndLabels[0], t - 10, i - 2, {
644
+ "font-size": b.stage,
645
+ fill: v.axisText
646
+ })), l(e, A(this.yAxisEndLabels[0], t - 10, i - 2, {
647
647
  "text-anchor": "end",
648
- "font-size": y.stage,
649
- fill: _.axisText
648
+ "font-size": b.stage,
649
+ fill: v.axisText
650
650
  }));
651
651
  }
652
652
  };
653
- function Re(e, t, n, r, i) {
653
+ function je(e, t, n, r, i) {
654
654
  return u(f("rect"), {
655
655
  x: e,
656
656
  y: t,
@@ -660,7 +660,7 @@ function Re(e, t, n, r, i) {
660
660
  ...i
661
661
  });
662
662
  }
663
- function w(e, t, n, r, i) {
663
+ function k(e, t, n, r, i) {
664
664
  return u(f("line"), {
665
665
  x1: e,
666
666
  y1: t,
@@ -670,31 +670,31 @@ function w(e, t, n, r, i) {
670
670
  ...i
671
671
  });
672
672
  }
673
- function T(e, t, n, r) {
673
+ function A(e, t, n, r) {
674
674
  let i = u(f("text"), {
675
675
  x: t,
676
676
  y: n,
677
- "font-family": y.family,
677
+ "font-family": b.family,
678
678
  ...r
679
679
  });
680
680
  return i.textContent = e, i;
681
681
  }
682
- function ze(e, t, n) {
682
+ function Me(e, t, n) {
683
683
  let r = n === "right" ? `${e - 5},${t - 5} ${e + 2},${t} ${e - 5},${t + 5}` : `${e - 5},${t + 5} ${e},${t - 2} ${e + 5},${t + 5}`;
684
684
  return u(f("polygon"), {
685
685
  points: r,
686
- fill: _.axis
686
+ fill: v.axis
687
687
  });
688
688
  }
689
689
  //#endregion
690
690
  //#region src/evolution-grid/EvolutionConstraintBehavior.ts
691
- var Be = [
691
+ var Ne = [
692
692
  "shape.move",
693
693
  "shape.create",
694
694
  "shape.resize",
695
695
  "elements.move",
696
696
  "elements.create"
697
- ], Ve = class extends ee {
697
+ ], Pe = class extends ee {
698
698
  eventBus;
699
699
  grid;
700
700
  elementRegistry;
@@ -706,13 +706,13 @@ var Be = [
706
706
  constructor(e, t, n) {
707
707
  super(e), this.eventBus = e, this.grid = t, this.elementRegistry = n;
708
708
  let r = (e) => this.syncAll(e.context);
709
- this.postExecuted(Be, r), this.reverted(Be, r);
709
+ this.postExecuted(Ne, r), this.reverted(Ne, r);
710
710
  let i = (e) => {
711
711
  if ([
712
712
  e.context?.shape,
713
713
  e.context?.element,
714
714
  ...e.context?.elements ?? []
715
- ].some((e) => x(e) && e.wardleyType === "component")) for (let e of this.elementRegistry.filter((e) => C(e))) this.eventBus.fire("element.changed", { element: e });
715
+ ].some((e) => S(e) && e.wardleyType === "component")) for (let e of this.elementRegistry.filter((e) => T(e))) this.eventBus.fire("element.changed", { element: e });
716
716
  };
717
717
  this.postExecuted([
718
718
  "shape.create",
@@ -731,7 +731,7 @@ var Be = [
731
731
  ...e.shapes ?? [],
732
732
  ...e.elements ?? []
733
733
  ];
734
- for (let e of t) x(e) && this.syncFromGeometry(e);
734
+ for (let e of t) S(e) && this.syncFromGeometry(e);
735
735
  }
736
736
  syncFromGeometry(e) {
737
737
  let t = e.y + e.height / 2;
@@ -742,8 +742,8 @@ var Be = [
742
742
  }), r = this.grid.fromCanvas({
743
743
  x: e.x + e.width,
744
744
  y: t
745
- }), [i, a] = We(n.evolution, r.evolution);
746
- e.evolutionStart = i, e.evolutionEnd = a, e.evolution = Ue((i + a) / 2), e.visibility = n.visibility;
745
+ }), [i, a] = Le(n.evolution, r.evolution);
746
+ e.evolutionStart = i, e.evolutionEnd = a, e.evolution = Ie((i + a) / 2), e.visibility = n.visibility;
747
747
  let o = this.grid.toCanvas({
748
748
  visibility: e.visibility,
749
749
  evolution: i
@@ -779,14 +779,14 @@ var Be = [
779
779
  (Math.abs(t - e.x) > .5 || Math.abs(n - e.y) > .5 || r !== void 0 && Math.abs(r - e.width) > .5 || i !== void 0 && Math.abs(i - e.height) > .5) && (e.x = t, e.y = n, r !== void 0 && (e.width = r), i !== void 0 && (e.height = i), this.fireChanged(e));
780
780
  }
781
781
  updateMembership(e) {
782
- let t = e.x + e.width / 2, n = e.y + e.height / 2, r = this.elementRegistry.filter((e) => C(e)).find((r) => r.wardleyLabel !== e.wardleyLabel && t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height);
782
+ let t = e.x + e.width / 2, n = e.y + e.height / 2, r = this.elementRegistry.filter((e) => T(e)).find((r) => r.wardleyLabel !== e.wardleyLabel && t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height);
783
783
  r ? (e.pipelineId = r.id, this.glueToPipeline(e, r)) : e.pipelineId && delete e.pipelineId;
784
784
  }
785
785
  glueToPipeline(e, t) {
786
786
  e.y = t.y + t.height / 2 - e.height / 2, e.visibility = t.visibility, this.fireChanged(e);
787
787
  }
788
788
  reconcileMembership(e) {
789
- let t = this.elementRegistry.filter((e) => x(e) && e.wardleyType === "component");
789
+ let t = this.elementRegistry.filter((e) => S(e) && e.wardleyType === "component");
790
790
  for (let n of t) {
791
791
  if (n.wardleyLabel === e.wardleyLabel) continue;
792
792
  let t = n.x + n.width / 2, r = n.y + n.height / 2, i = t >= e.x && t <= e.x + e.width && r >= e.y && r <= e.y + e.height;
@@ -805,22 +805,22 @@ var Be = [
805
805
  this.eventBus.fire("element.changed", { element: e });
806
806
  for (let t of [...e.incoming ?? [], ...e.outgoing ?? []]) this.eventBus.fire("element.changed", { element: t });
807
807
  }
808
- }, He = .001;
809
- function Ue(e) {
808
+ }, Fe = .001;
809
+ function Ie(e) {
810
810
  return e < 0 ? 0 : e > 1 ? 1 : e;
811
811
  }
812
- function We(e, t) {
813
- let n = Ue(Math.max(t, e + He));
814
- return [Math.max(0, Math.min(e, n - He)), n];
812
+ function Le(e, t) {
813
+ let n = Ie(Math.max(t, e + Fe));
814
+ return [Math.max(0, Math.min(e, n - Fe)), n];
815
815
  }
816
816
  //#endregion
817
817
  //#region src/evolution-grid/index.ts
818
- var E = { evolutionGrid: ["type", Le] }, Ge = {
818
+ var j = { evolutionGrid: ["type", O] }, Re = {
819
819
  __init__: ["evolutionConstraintBehavior"],
820
- __depends__: [E],
821
- evolutionConstraintBehavior: ["type", Ve]
822
- }, D = "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z", Ke = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z", qe = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z", Je = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z", O = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", k = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Ye = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", Xe = "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z", Ze = "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z", Qe = "M4 7v2c0 .55-.45 1-1 1H2v2h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h1v-2H7c-.55 0-1-.45-1-1v-2c0-.84-.35-1.61-.92-2.18L4.85 12l.23-.82C5.65 10.61 6 9.84 6 9V7c0-.55.45-1 1-1h1V4H7C5.35 4 4 5.35 4 7zm16 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-1v2h1c.55 0 1 .45 1 1v2c0 .84.35 1.61.92 2.18l.23.82-.23.82c-.57.57-.92 1.34-.92 2.18v2c0 .55-.45 1-1 1h-1v2h1c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-2h-1z", $e = "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z", et = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", tt = "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z", nt = "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z", rt = "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z", it = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z", at = "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z", ot = "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z", A = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z", j = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z", st = "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z", ct = "M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z", lt = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", ut = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", dt = "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";
823
- function M(e, t, n, r, i) {
820
+ __depends__: [j],
821
+ evolutionConstraintBehavior: ["type", Pe]
822
+ }, M = "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z", ze = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z", Be = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z", Ve = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z", N = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", P = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", He = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", Ue = "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z", We = "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z", Ge = "M4 7v2c0 .55-.45 1-1 1H2v2h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h1v-2H7c-.55 0-1-.45-1-1v-2c0-.84-.35-1.61-.92-2.18L4.85 12l.23-.82C5.65 10.61 6 9.84 6 9V7c0-.55.45-1 1-1h1V4H7C5.35 4 4 5.35 4 7zm16 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-1v2h1c.55 0 1 .45 1 1v2c0 .84.35 1.61.92 2.18l.23.82-.23.82c-.57.57-.92 1.34-.92 2.18v2c0 .55-.45 1-1 1h-1v2h1c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-2h-1z", Ke = "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z", qe = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", Je = "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z", Ye = "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z", Xe = "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z", Ze = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z", Qe = "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z", $e = "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z", et = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z", tt = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z", nt = "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z", rt = "M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z", it = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", at = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", ot = "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";
823
+ function st(e, t, n, r, i) {
824
824
  let a = f("g"), o = r / 24;
825
825
  return u(a, {
826
826
  transform: `translate(${t - r / 2}, ${n - r / 2}) scale(${o})`,
@@ -828,12 +828,12 @@ function M(e, t, n, r, i) {
828
828
  stroke: "none"
829
829
  }), l(a, u(f("path"), { d: e })), a;
830
830
  }
831
- function N(e, t = 18) {
831
+ function ct(e, t = 18) {
832
832
  return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
833
833
  }
834
834
  //#endregion
835
835
  //#region src/draw/WardleyRenderer.ts
836
- var ft = 1500, P = class extends te {
836
+ var lt = 1500, ut = class extends te {
837
837
  grid;
838
838
  elementRegistry;
839
839
  static $inject = [
@@ -842,10 +842,10 @@ var ft = 1500, P = class extends te {
842
842
  "elementRegistry"
843
843
  ];
844
844
  constructor(e, t, n) {
845
- super(e, ft), this.grid = t, this.elementRegistry = n;
845
+ super(e, lt), this.grid = t, this.elementRegistry = n;
846
846
  }
847
847
  canRender(e) {
848
- return x(e) || S(e);
848
+ return S(e) || C(e);
849
849
  }
850
850
  drawShape(e, t) {
851
851
  let n = t;
@@ -865,7 +865,7 @@ var ft = 1500, P = class extends te {
865
865
  let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = u(f(t.closed ? "polygon" : "polyline"), {
866
866
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
867
867
  fill: "none",
868
- stroke: t.color ?? _.ink,
868
+ stroke: t.color ?? v.ink,
869
869
  "stroke-width": 2,
870
870
  "stroke-linecap": "round",
871
871
  "stroke-linejoin": "round",
@@ -874,7 +874,7 @@ var ft = 1500, P = class extends te {
874
874
  return l(e, i), i;
875
875
  }
876
876
  drawConnection(e, t) {
877
- let n = t, r = n.wardleyType === "flow", i = r ? _.flow : _.dependency, [a, o] = yt(n), s = u(f("polyline"), {
877
+ let n = t, r = n.wardleyType === "flow", i = r ? v.flow : v.dependency, [a, o] = _t(n), s = u(f("polyline"), {
878
878
  points: `${a.x},${a.y} ${o.x},${o.y}`,
879
879
  fill: "none",
880
880
  stroke: i,
@@ -886,12 +886,12 @@ var ft = 1500, P = class extends te {
886
886
  return r && n.flowValue && l(e, I(n.flowValue, c, d - 5, {
887
887
  "text-anchor": "middle",
888
888
  "font-size": 11,
889
- fill: _.flow
889
+ fill: v.flow
890
890
  })), n.linkLabel && l(e, I(n.linkLabel, c, d + (n.flowValue ? 12 : -4), {
891
891
  "text-anchor": "middle",
892
892
  "font-size": 11,
893
893
  "font-style": "italic",
894
- fill: _.axisText
894
+ fill: v.axisText
895
895
  })), s;
896
896
  }
897
897
  getShapePath(e) {
@@ -904,9 +904,9 @@ var ft = 1500, P = class extends te {
904
904
  }
905
905
  drawComponent(e, t) {
906
906
  let n = t.width / 2, r = t.height / 2, i = t.decorators;
907
- t.movement && this.drawMovement(e, t, n, r), i?.inertia && pt(e, n, r);
908
- let a = t.color ?? _.stroke, o = F(n, r, 15, {
909
- fill: _.componentFill,
907
+ t.movement && this.drawMovement(e, t, n, r), i?.inertia && dt(e, n, r);
908
+ let a = t.color ?? v.stroke, o = F(n, r, 15, {
909
+ fill: v.componentFill,
910
910
  stroke: a,
911
911
  "stroke-width": 2
912
912
  });
@@ -914,7 +914,7 @@ var ft = 1500, P = class extends te {
914
914
  fill: "none",
915
915
  stroke: a,
916
916
  "stroke-width": 1.5
917
- })), mt(e, n, r, a, i), ht(e, t, n, r), o;
917
+ })), ft(e, n, r, a, i), pt(e, t, n, r), o;
918
918
  }
919
919
  drawMovement(e, t, n, r) {
920
920
  let i = t.movement;
@@ -926,8 +926,8 @@ var ft = 1500, P = class extends te {
926
926
  visibility: t.visibility,
927
927
  evolution: i.targetEvolution
928
928
  }).x - a.x, s = n + o, c = s - (Math.sign(o) || 1) * 17;
929
- l(e, gt(n, r, c, r, {
930
- stroke: _.movement,
929
+ l(e, mt(n, r, c, r, {
930
+ stroke: v.movement,
931
931
  "stroke-width": 1.5,
932
932
  "stroke-dasharray": "6 4"
933
933
  })), l(e, L({
@@ -936,22 +936,22 @@ var ft = 1500, P = class extends te {
936
936
  }, {
937
937
  x: c,
938
938
  y: r
939
- }, _.movement)), l(e, F(s, r, 15, {
940
- fill: _.paper,
941
- stroke: _.movement,
939
+ }, v.movement)), l(e, F(s, r, 15, {
940
+ fill: v.paper,
941
+ stroke: v.movement,
942
942
  "stroke-width": 2,
943
943
  class: "wardley-evolve-handle"
944
944
  })), l(e, I(i.newLabel ?? t.wardleyLabel, s + 15 + 7, r - 4, {
945
945
  "font-weight": "500",
946
- fill: _.movement
946
+ fill: v.movement
947
947
  })), i.method && l(e, I(i.method, s + 15 + 7, r + 11, {
948
948
  "font-size": 10.5,
949
- fill: _.movement
949
+ fill: v.movement
950
950
  }));
951
951
  }
952
952
  drawAnchor(e, t) {
953
- let n = t.width / 2, r = t.height / 2, i = M(D, n, r, 26, t.color ?? _.ink);
954
- return l(e, i), l(e, I(t.wardleyLabel, n + (t.labelOffset?.dx ?? 0), r - 26 / 2 - 4 + (t.labelOffset?.dy ?? 0), {
953
+ let n = t.width / 2, r = t.height / 2, i = st(M, n, r, 26, t.color ?? v.ink);
954
+ return l(e, i), l(e, I(t.wardleyLabel, n + (t.labelOffset?.dx ?? 0), r - 13 - 4 + (t.labelOffset?.dy ?? 0), {
955
955
  "text-anchor": "middle",
956
956
  "font-weight": "700",
957
957
  ...t.color ? { fill: t.color } : {}
@@ -965,17 +965,17 @@ var ft = 1500, P = class extends te {
965
965
  height: Math.max(t.height, 1),
966
966
  rx: 4,
967
967
  fill: "none",
968
- stroke: r ?? _.pipeline,
968
+ stroke: r ?? v.pipeline,
969
969
  "stroke-width": 1.25,
970
970
  "stroke-dasharray": "6 3"
971
971
  });
972
- return l(e, i), !this.elementRegistry.filter((e) => x(e) && e.wardleyType === "component").some((e) => e.wardleyLabel === t.wardleyLabel) && (l(e, u(f("rect"), {
972
+ return l(e, i), !this.elementRegistry.filter((e) => S(e) && e.wardleyType === "component").some((e) => e.wardleyLabel === t.wardleyLabel) && (l(e, u(f("rect"), {
973
973
  x: n / 2 - 8,
974
974
  y: -8,
975
975
  width: 16,
976
976
  height: 16,
977
- fill: _.componentFill,
978
- stroke: r ?? _.stroke,
977
+ fill: v.componentFill,
978
+ stroke: r ?? v.stroke,
979
979
  "stroke-width": 2
980
980
  })), l(e, I(t.wardleyLabel, n / 2 + 8 + 6, -4, {
981
981
  "font-weight": "500",
@@ -985,7 +985,7 @@ var ft = 1500, P = class extends te {
985
985
  drawNote(e, t) {
986
986
  let n = t.color, r = (t.wardleyLabel ?? "").split("\n"), i = t.width / 2, a = t.height / 2 - (r.length - 1) * 17 / 2 + 4, o = {
987
987
  "text-anchor": "middle",
988
- fill: n ?? _.noteText,
988
+ fill: n ?? v.noteText,
989
989
  "font-style": "italic",
990
990
  ...n ? { "font-weight": "600" } : {}
991
991
  }, s;
@@ -995,7 +995,7 @@ var ft = 1500, P = class extends te {
995
995
  }), s ?? f("text");
996
996
  }
997
997
  drawAttitude(e, t) {
998
- let n = v[t.attitudeKind ?? "pioneers"] ?? v.pioneers, r = t.color ?? n.stroke, i = u(f("rect"), {
998
+ let n = y[t.attitudeKind ?? "pioneers"] ?? y.pioneers, r = t.color ?? n.stroke, i = u(f("rect"), {
999
999
  x: 0,
1000
1000
  y: 0,
1001
1001
  width: Math.max(t.width, 1),
@@ -1006,7 +1006,7 @@ var ft = 1500, P = class extends te {
1006
1006
  "stroke-width": 1.25,
1007
1007
  "stroke-dasharray": "5 4"
1008
1008
  });
1009
- return l(e, i), l(e, I(t.wardleyLabel && t.wardleyLabel !== t.attitudeKind ? t.wardleyLabel : bt(t.attitudeKind ?? "pioneers"), 10, 18, {
1009
+ return l(e, i), l(e, I(t.wardleyLabel && t.wardleyLabel !== t.attitudeKind ? t.wardleyLabel : vt(t.attitudeKind ?? "pioneers"), 10, 18, {
1010
1010
  fill: r,
1011
1011
  "font-weight": "700",
1012
1012
  "letter-spacing": "0.04em"
@@ -1014,8 +1014,8 @@ var ft = 1500, P = class extends te {
1014
1014
  }
1015
1015
  drawAnnotation(e, t) {
1016
1016
  let n = t.width / 2, r = t.height / 2, i = F(n, r, 10, {
1017
- fill: _.annotationFill,
1018
- stroke: t.color ?? _.stroke,
1017
+ fill: v.annotationFill,
1018
+ stroke: t.color ?? v.stroke,
1019
1019
  "stroke-width": 1.25
1020
1020
  });
1021
1021
  return l(e, i), l(e, I(String(t.annotationNumber ?? ""), n, r + 4, {
@@ -1024,21 +1024,21 @@ var ft = 1500, P = class extends te {
1024
1024
  "font-weight": "700"
1025
1025
  }, !1)), t.wardleyLabel && l(e, I(t.wardleyLabel, n + 15, r + 4, {
1026
1026
  "font-size": 12,
1027
- fill: _.noteText
1027
+ fill: v.noteText
1028
1028
  })), i;
1029
1029
  }
1030
1030
  drawAccelerator(e, t) {
1031
- let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a = M(i ? A : j, n, r, 24, t.color ?? (i ? _.accelerator : _.deaccelerator));
1031
+ let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a = st(i ? et : tt, n, r, 24, t.color ?? (i ? v.accelerator : v.deaccelerator));
1032
1032
  return l(e, a), t.wardleyLabel && l(e, I(t.wardleyLabel, n + 15, r + 5, { "font-size": 12 })), a;
1033
1033
  }
1034
1034
  drawSubmap(e, t) {
1035
- let n = t.width / 2, r = t.height / 2, i = t.color ?? _.stroke, a = u(f("rect"), {
1035
+ let n = t.width / 2, r = t.height / 2, i = t.color ?? v.stroke, a = u(f("rect"), {
1036
1036
  x: n - 16,
1037
1037
  y: r - 16,
1038
1038
  width: 32,
1039
1039
  height: 32,
1040
1040
  rx: 3,
1041
- fill: _.componentFill,
1041
+ fill: v.componentFill,
1042
1042
  stroke: i,
1043
1043
  "stroke-width": 2
1044
1044
  });
@@ -1057,15 +1057,15 @@ var ft = 1500, P = class extends te {
1057
1057
  })), a;
1058
1058
  }
1059
1059
  };
1060
- function pt(e, t, n) {
1060
+ function dt(e, t, n) {
1061
1061
  let r = t + 15 + 3;
1062
- l(e, gt(r, n - 13, r, n + 13, {
1063
- stroke: _.inertia,
1062
+ l(e, mt(r, n - 13, r, n + 13, {
1063
+ stroke: v.inertia,
1064
1064
  "stroke-width": 3,
1065
1065
  "stroke-linecap": "round"
1066
1066
  }));
1067
1067
  }
1068
- function mt(e, t, n, r, i) {
1068
+ function ft(e, t, n, r, i) {
1069
1069
  if (i?.ecosystem && l(e, F(t, n, 18.5, {
1070
1070
  fill: "none",
1071
1071
  stroke: r,
@@ -1078,14 +1078,14 @@ function mt(e, t, n, r, i) {
1078
1078
  [3.4, 2.4]
1079
1079
  ]) l(e, F(t + i, n + a, 1.7, { fill: r }));
1080
1080
  }
1081
- function ht(e, t, n, r) {
1081
+ function pt(e, t, n, r) {
1082
1082
  let i = t.decorators, a = n + 15 + 7 + (t.labelOffset?.dx ?? 0), o = r - 4 + (t.labelOffset?.dy ?? 0);
1083
1083
  l(e, I(t.wardleyLabel, a, o, {
1084
1084
  "font-weight": "500",
1085
1085
  ...t.color ? { fill: t.color } : {}
1086
1086
  })), i?.method && l(e, I(i.method, a, o + 15, {
1087
1087
  "font-size": 10.5,
1088
- fill: _.axisText
1088
+ fill: v.axisText
1089
1089
  }));
1090
1090
  }
1091
1091
  function F(e, t, n, r) {
@@ -1097,7 +1097,7 @@ function F(e, t, n, r) {
1097
1097
  ...r
1098
1098
  });
1099
1099
  }
1100
- function gt(e, t, n, r, i) {
1100
+ function mt(e, t, n, r, i) {
1101
1101
  return u(f("line"), {
1102
1102
  x1: e,
1103
1103
  y1: t,
@@ -1108,16 +1108,16 @@ function gt(e, t, n, r, i) {
1108
1108
  }
1109
1109
  function I(e, t, n, r = {}, i = !0) {
1110
1110
  let a = i ? {
1111
- stroke: _.paper,
1111
+ stroke: v.paper,
1112
1112
  "stroke-width": 3.5,
1113
1113
  "paint-order": "stroke",
1114
1114
  "stroke-linejoin": "round"
1115
1115
  } : {}, o = u(f("text"), {
1116
1116
  x: t,
1117
1117
  y: n,
1118
- "font-family": y.family,
1119
- "font-size": y.label,
1120
- fill: _.ink,
1118
+ "font-family": b.family,
1119
+ "font-size": b.label,
1120
+ fill: v.ink,
1121
1121
  ...a,
1122
1122
  ...r
1123
1123
  });
@@ -1130,10 +1130,10 @@ function L(e, t, n, r = 10, i = 5) {
1130
1130
  fill: n
1131
1131
  });
1132
1132
  }
1133
- function _t(e) {
1133
+ function ht(e) {
1134
1134
  return e.wardleyType === "component" ? 17 : e.wardleyType === "anchor" ? 14 : e.wardleyType === "pipeline" ? 10 : Math.min(e.width, e.height) / 2;
1135
1135
  }
1136
- function vt(e) {
1136
+ function gt(e) {
1137
1137
  return e.wardleyType === "pipeline" ? {
1138
1138
  x: e.x + e.width / 2,
1139
1139
  y: e.y
@@ -1142,7 +1142,7 @@ function vt(e) {
1142
1142
  y: e.y + e.height / 2
1143
1143
  };
1144
1144
  }
1145
- function yt(e) {
1145
+ function _t(e) {
1146
1146
  let t = e.source, n = e.target, r = e.waypoints;
1147
1147
  if (!t || !n) {
1148
1148
  let e = r[0] ?? {
@@ -1151,7 +1151,7 @@ function yt(e) {
1151
1151
  };
1152
1152
  return [e, r[r.length - 1] ?? e];
1153
1153
  }
1154
- let i = vt(t), a = vt(n), o = a.x - i.x, s = a.y - i.y, c = Math.hypot(o, s) || 1, l = o / c, u = s / c, d = _t(t), f = _t(n);
1154
+ let i = gt(t), a = gt(n), o = a.x - i.x, s = a.y - i.y, c = Math.hypot(o, s) || 1, l = o / c, u = s / c, d = ht(t), f = ht(n);
1155
1155
  return c <= d + f + 2 ? [i, a] : [{
1156
1156
  x: i.x + l * d,
1157
1157
  y: i.y + u * d
@@ -1160,15 +1160,15 @@ function yt(e) {
1160
1160
  y: a.y - u * f
1161
1161
  }];
1162
1162
  }
1163
- function bt(e) {
1163
+ function vt(e) {
1164
1164
  return e && e.charAt(0).toUpperCase() + e.slice(1);
1165
1165
  }
1166
1166
  //#endregion
1167
1167
  //#region src/draw/index.ts
1168
- var xt = {
1168
+ var yt = {
1169
1169
  __init__: ["wardleyRenderer"],
1170
- wardleyRenderer: ["type", P]
1171
- }, St = /* @__PURE__ */ new Set(["attitude", "pipeline"]), Ct = {
1170
+ wardleyRenderer: ["type", ut]
1171
+ }, bt = /* @__PURE__ */ new Set(["attitude", "pipeline"]), xt = {
1172
1172
  attitude: 0,
1173
1173
  pipeline: 1,
1174
1174
  note: 2,
@@ -1177,7 +1177,7 @@ var xt = {
1177
1177
  annotation: 5,
1178
1178
  submap: 3,
1179
1179
  accelerator: 3
1180
- }, wt = class {
1180
+ }, St = class {
1181
1181
  canvas;
1182
1182
  elementFactory;
1183
1183
  factory;
@@ -1208,8 +1208,8 @@ var xt = {
1208
1208
  r = void 0;
1209
1209
  }
1210
1210
  let i;
1211
- r && r.id === "wardley-root" ? i = r : (i = this.elementFactory.createRoot({ id: De }), this.canvas.setRootElement(i)), i.businessObject = n, this.grid.render();
1212
- let a = /* @__PURE__ */ new Map(), o = [...e.elements].sort((e, t) => (Ct[e.elementType] ?? 9) - (Ct[t.elementType] ?? 9)), s = o.filter((e) => St.has(e.elementType)), c = o.filter((e) => !St.has(e.elementType)), l = 0;
1211
+ r && r.id === "wardley-root" ? i = r : (i = this.elementFactory.createRoot({ id: we }), this.canvas.setRootElement(i)), i.businessObject = n, this.grid.render();
1212
+ let a = /* @__PURE__ */ new Map(), o = [...e.elements].sort((e, t) => (xt[e.elementType] ?? 9) - (xt[t.elementType] ?? 9)), s = o.filter((e) => bt.has(e.elementType)), c = o.filter((e) => !bt.has(e.elementType)), l = 0;
1213
1213
  for (let e of s) {
1214
1214
  let t = this.createShape(e);
1215
1215
  t && (this.canvas.addShape(t, i), a.set(e.id, t), l++);
@@ -1266,7 +1266,7 @@ function R(e) {
1266
1266
  for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
1267
1267
  return t;
1268
1268
  }
1269
- var Tt = class {
1269
+ var Ct = class {
1270
1270
  elementRegistry;
1271
1271
  canvas;
1272
1272
  grid;
@@ -1281,48 +1281,49 @@ var Tt = class {
1281
1281
  export() {
1282
1282
  let e = this.canvas.getRootElement().businessObject, t = e?.config ?? { title: "Untitled Map" }, n = [], i = [];
1283
1283
  for (let e of this.elementRegistry.getAll()) if (e.id !== "wardley-root") {
1284
- if (S(e)) if (e.businessObject) i.push(e.businessObject);
1285
- else {
1286
- let t = {
1287
- id: e.id,
1288
- from: e.source?.id ?? "",
1289
- to: e.target?.id ?? ""
1290
- };
1291
- i.push(e.wardleyType === "flow" ? {
1292
- ...t,
1293
- edgeType: "flow",
1294
- ...e.bidirectional ? { bidirectional: !0 } : {}
1295
- } : {
1296
- ...t,
1297
- edgeType: "dependency"
1298
- });
1299
- }
1300
- else if (x(e)) {
1284
+ if (C(e)) {
1285
+ if (e.businessObject) i.push(e.businessObject);
1286
+ else {
1287
+ let t = {
1288
+ id: e.id,
1289
+ from: e.source?.id ?? "",
1290
+ to: e.target?.id ?? ""
1291
+ };
1292
+ i.push(e.wardleyType === "flow" ? {
1293
+ ...t,
1294
+ edgeType: "flow",
1295
+ ...e.bidirectional ? { bidirectional: !0 } : {}
1296
+ } : {
1297
+ ...t,
1298
+ edgeType: "dependency"
1299
+ });
1300
+ }
1301
+ } else if (S(e)) {
1301
1302
  let t = this.buildElement(e);
1302
1303
  t && n.push(t);
1303
1304
  }
1304
1305
  }
1305
- let a = new Set(n.filter((e) => e.elementType === "pipeline").map((e) => e.id));
1306
- return c({
1306
+ let a = new Set(n.filter((e) => e.elementType === "pipeline").map((e) => e.id)), o = n.map((e) => {
1307
+ if (e.elementType === "component" && e.pipelineId && !a.has(e.pipelineId)) {
1308
+ let { pipelineId: t, ...n } = e;
1309
+ return n;
1310
+ }
1311
+ if (e.elementType === "pipeline") {
1312
+ let t = n.filter((t) => t.elementType === "component" && t.pipelineId === e.id).map((e) => e.id);
1313
+ return {
1314
+ ...e,
1315
+ childIds: t
1316
+ };
1317
+ }
1318
+ return e;
1319
+ }), s = {
1307
1320
  schemaVersion: r,
1308
1321
  config: t,
1309
- elements: n.map((e) => {
1310
- if (e.elementType === "component" && e.pipelineId && !a.has(e.pipelineId)) {
1311
- let { pipelineId: t, ...n } = e;
1312
- return n;
1313
- }
1314
- if (e.elementType === "pipeline") {
1315
- let t = n.filter((t) => t.elementType === "component" && t.pipelineId === e.id).map((e) => e.id);
1316
- return {
1317
- ...e,
1318
- childIds: t
1319
- };
1320
- }
1321
- return e;
1322
- }),
1322
+ elements: o,
1323
1323
  edges: i,
1324
1324
  ...e?.rawPassthrough ? { rawPassthrough: e.rawPassthrough } : {}
1325
- });
1325
+ };
1326
+ return c(s);
1326
1327
  }
1327
1328
  buildElement(e) {
1328
1329
  let t = {
@@ -1431,23 +1432,23 @@ var Tt = class {
1431
1432
  } : void 0;
1432
1433
  }
1433
1434
  }
1434
- }, Et = {
1435
- wardleyImporter: ["type", wt],
1436
- wardleyExporter: ["type", Tt]
1437
- }, Dt = class extends ke {
1435
+ }, wt = {
1436
+ wardleyImporter: ["type", St],
1437
+ wardleyExporter: ["type", Ct]
1438
+ }, Tt = class extends Ee {
1438
1439
  _getModules() {
1439
1440
  return [
1440
- Pe,
1441
1441
  E,
1442
- xt,
1443
- Et
1442
+ j,
1443
+ yt,
1444
+ wt
1444
1445
  ];
1445
1446
  }
1446
- }, Ot = 180, kt = 80, At = 120, jt = .5, Mt = (e, t, n) => e < t ? t : e > n ? n : e;
1447
- function Nt(e, t, n, r) {
1448
- return t <= r ? Mt(e, n, n + r - t) : n + r / 2 - t / 2;
1447
+ }, Et = 180, Dt = 80, Ot = 120, kt = .5, At = (e, t, n) => e < t ? t : e > n ? n : e;
1448
+ function jt(e, t, n, r) {
1449
+ return t <= r ? At(e, n, n + r - t) : n + r / 2 - t / 2;
1449
1450
  }
1450
- var Pt = class {
1451
+ var Mt = class {
1451
1452
  canvas;
1452
1453
  grid;
1453
1454
  static $inject = [
@@ -1464,8 +1465,8 @@ var Pt = class {
1464
1465
  constrain(e) {
1465
1466
  let t = e ?? this.canvas.viewbox(), n = this.grid.outerBounds();
1466
1467
  if (!(n.width > 0) || !(n.height > 0) || !(t.width > 0) || !(t.height > 0)) return;
1467
- let r = Nt(t.x, t.width, n.x - At, n.width + 2 * At), i = Nt(t.y, t.height, n.y - Ot, n.height + Ot + kt);
1468
- if (!(Math.abs(r - t.x) < jt && Math.abs(i - t.y) < jt)) {
1468
+ let r = jt(t.x, t.width, n.x - Ot, n.width + 240), i = jt(t.y, t.height, n.y - Et, n.height + Et + Dt);
1469
+ if (!(Math.abs(r - t.x) < kt && Math.abs(i - t.y) < kt)) {
1469
1470
  this.applying = !0;
1470
1471
  try {
1471
1472
  this.canvas.viewbox({
@@ -1479,10 +1480,10 @@ var Pt = class {
1479
1480
  }
1480
1481
  }
1481
1482
  }
1482
- }, Ft = {
1483
+ }, Nt = {
1483
1484
  __init__: ["panConstraint"],
1484
- panConstraint: ["type", Pt]
1485
- }, It = class extends Dt {
1485
+ panConstraint: ["type", Mt]
1486
+ }, Pt = class extends Tt {
1486
1487
  _getModules() {
1487
1488
  return [
1488
1489
  ...super._getModules(),
@@ -1490,47 +1491,47 @@ var Pt = class {
1490
1491
  re,
1491
1492
  ie,
1492
1493
  ae,
1493
- Ft
1494
+ Nt
1494
1495
  ];
1495
1496
  }
1496
1497
  };
1497
1498
  //#endregion
1498
1499
  //#region src/modeling/cmd/UpdatePropertiesHandler.ts
1499
- function Lt(e, t, n) {
1500
+ function Ft(e, t, n) {
1500
1501
  n === void 0 ? delete e[t] : e[t] = n;
1501
1502
  }
1502
- var Rt = class {
1503
+ var It = class {
1503
1504
  execute(e) {
1504
1505
  let { element: t, properties: n } = e, r = t, i = {};
1505
- for (let e of Object.keys(n)) i[e] = r[e], Lt(r, e, n[e]);
1506
+ for (let e of Object.keys(n)) i[e] = r[e], Ft(r, e, n[e]);
1506
1507
  return e.oldProperties = i, [t];
1507
1508
  }
1508
1509
  revert(e) {
1509
1510
  let { element: t, oldProperties: n } = e, r = t;
1510
- if (n) for (let e of Object.keys(n)) Lt(r, e, n[e]);
1511
+ if (n) for (let e of Object.keys(n)) Ft(r, e, n[e]);
1511
1512
  return [t];
1512
1513
  }
1513
- }, zt = "element.updateProperties";
1514
- function Bt(e) {
1514
+ }, Lt = "element.updateProperties";
1515
+ function Rt(e) {
1515
1516
  let t = {};
1516
1517
  for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
1517
1518
  return t;
1518
1519
  }
1519
- var Vt = class {
1520
+ var zt = class {
1520
1521
  commandStack;
1521
1522
  static $inject = ["commandStack"];
1522
1523
  constructor(e) {
1523
- this.commandStack = e, e.registerHandler(zt, Rt);
1524
+ this.commandStack = e, e.registerHandler(Lt, It);
1524
1525
  }
1525
1526
  updateProperties(e, t) {
1526
- this.commandStack.execute(zt, {
1527
+ this.commandStack.execute(Lt, {
1527
1528
  element: e,
1528
1529
  properties: t
1529
1530
  });
1530
1531
  }
1531
1532
  updateLabel(e, t) {
1532
1533
  if (e.wardleyType === "note") {
1533
- let { width: n, height: r } = g(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
1534
+ let { width: n, height: r } = _(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
1534
1535
  this.updateProperties(e, {
1535
1536
  wardleyLabel: t,
1536
1537
  width: n,
@@ -1543,8 +1544,8 @@ var Vt = class {
1543
1544
  this.updateProperties(e, { wardleyLabel: t });
1544
1545
  }
1545
1546
  evolveComponent(e, t, n = {}) {
1546
- let r = Ht(t);
1547
- r <= e.evolution || this.updateProperties(e, { movement: Bt({
1547
+ let r = Bt(t);
1548
+ r <= e.evolution || this.updateProperties(e, { movement: Rt({
1548
1549
  targetEvolution: r,
1549
1550
  newLabel: n.newLabel,
1550
1551
  method: n.method
@@ -1569,12 +1570,12 @@ var Vt = class {
1569
1570
  this.updateProperties(e, { color: t });
1570
1571
  }
1571
1572
  };
1572
- function Ht(e) {
1573
+ function Bt(e) {
1573
1574
  return e < 0 ? 0 : e > 1 ? 1 : e;
1574
1575
  }
1575
1576
  //#endregion
1576
1577
  //#region src/modeling/WardleyCopyPaste.ts
1577
- var Ut = 24, Wt = [
1578
+ var Vt = 24, Ht = [
1578
1579
  "wardleyType",
1579
1580
  "evolution",
1580
1581
  "visibility",
@@ -1591,13 +1592,13 @@ var Ut = 24, Wt = [
1591
1592
  "drawingPoints",
1592
1593
  "closed",
1593
1594
  "strokeStyle"
1594
- ], Gt = [
1595
+ ], Ut = [
1595
1596
  "wardleyType",
1596
1597
  "bidirectional",
1597
1598
  "flowValue",
1598
1599
  "linkLabel"
1599
1600
  ];
1600
- function Kt(e, t) {
1601
+ function Wt(e, t) {
1601
1602
  let n = {};
1602
1603
  for (let r of t) {
1603
1604
  let t = e[r];
@@ -1605,7 +1606,7 @@ function Kt(e, t) {
1605
1606
  }
1606
1607
  return n;
1607
1608
  }
1608
- var qt = class {
1609
+ var Gt = class {
1609
1610
  selection;
1610
1611
  modeling;
1611
1612
  elementFactory;
@@ -1628,21 +1629,21 @@ var qt = class {
1628
1629
  this.selection = e, this.modeling = t, this.elementFactory = n, this.elementRegistry = r, this.canvas = i, this.create = a, this.mouse = o;
1629
1630
  }
1630
1631
  copy() {
1631
- let e = this.selection.get().filter((e) => x(e));
1632
+ let e = this.selection.get().filter((e) => S(e));
1632
1633
  if (!e.length) return !1;
1633
1634
  let t = new Map(e.map((e, t) => [e, t])), n = [], r = /* @__PURE__ */ new Set();
1634
1635
  for (let i of e) for (let e of [...i.incoming ?? [], ...i.outgoing ?? []]) {
1635
- if (!S(e) || r.has(e)) continue;
1636
+ if (!C(e) || r.has(e)) continue;
1636
1637
  let i = t.get(e.source), a = t.get(e.target);
1637
- i === void 0 || a === void 0 || (r.add(e), n.push({
1638
+ i !== void 0 && a !== void 0 && (r.add(e), n.push({
1638
1639
  sourceIdx: i,
1639
1640
  targetIdx: a,
1640
- props: Kt(e, Gt)
1641
+ props: Wt(e, Ut)
1641
1642
  }));
1642
1643
  }
1643
1644
  return this.clipboard = {
1644
1645
  shapes: e.map((e) => ({
1645
- props: Kt(e, Wt),
1646
+ props: Wt(e, Ht),
1646
1647
  x: e.x,
1647
1648
  y: e.y,
1648
1649
  width: e.width,
@@ -1676,13 +1677,13 @@ var qt = class {
1676
1677
  ...structuredClone(e.props),
1677
1678
  source: n[e.sourceIdx],
1678
1679
  target: n[e.targetIdx],
1679
- waypoints: [Jt(n[e.sourceIdx]), Jt(n[e.targetIdx])]
1680
+ waypoints: [Kt(n[e.sourceIdx]), Kt(n[e.targetIdx])]
1680
1681
  }))
1681
1682
  };
1682
1683
  }
1683
1684
  insertWithOffset(e) {
1684
1685
  this.pasteCount++;
1685
- let t = Ut * this.pasteCount, n = Yt(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1686
+ let t = Vt * this.pasteCount, n = qt(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1686
1687
  x: n.cx + t,
1687
1688
  y: n.cy + t
1688
1689
  }, this.canvas.getRootElement());
@@ -1701,13 +1702,13 @@ var qt = class {
1701
1702
  });
1702
1703
  }
1703
1704
  };
1704
- function Jt(e) {
1705
+ function Kt(e) {
1705
1706
  return {
1706
1707
  x: e.x + e.width / 2,
1707
1708
  y: e.y + e.height / 2
1708
1709
  };
1709
1710
  }
1710
- function Yt(e) {
1711
+ function qt(e) {
1711
1712
  let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y)), r = Math.max(...e.map((e) => e.x + e.width)), i = Math.max(...e.map((e) => e.y + e.height));
1712
1713
  return {
1713
1714
  cx: (t + r) / 2,
@@ -1716,13 +1717,13 @@ function Yt(e) {
1716
1717
  }
1717
1718
  //#endregion
1718
1719
  //#region src/modeling/index.ts
1719
- var Xt = {
1720
- __depends__: [ge, ce],
1720
+ var Jt = {
1721
+ __depends__: [he, m],
1721
1722
  __init__: ["wardleyModeling"],
1722
- wardleyModeling: ["type", Vt],
1723
- wardleyCopyPaste: ["type", qt]
1724
- }, Zt = {
1725
- __depends__: [_e],
1723
+ wardleyModeling: ["type", zt],
1724
+ wardleyCopyPaste: ["type", Gt]
1725
+ }, Yt = {
1726
+ __depends__: [ge],
1726
1727
  __init__: ["wardleyLassoBehavior"],
1727
1728
  wardleyLassoBehavior: ["type", class {
1728
1729
  static $inject = [
@@ -1744,19 +1745,19 @@ var Xt = {
1744
1745
  });
1745
1746
  }
1746
1747
  }]
1747
- }, Qt = /* @__PURE__ */ new Set([
1748
+ }, Xt = /* @__PURE__ */ new Set([
1748
1749
  "component",
1749
1750
  "anchor",
1750
1751
  "submap",
1751
1752
  "pipeline"
1752
1753
  ]);
1753
1754
  function z(e) {
1754
- return x(e) && Qt.has(e.wardleyType);
1755
+ return S(e) && Xt.has(e.wardleyType);
1755
1756
  }
1756
- function $t(e, t) {
1757
+ function Zt(e, t) {
1757
1758
  return (e.outgoing ?? []).some((e) => e.target === t) || (e.incoming ?? []).some((e) => e.source === t);
1758
1759
  }
1759
- var en = class extends ve {
1760
+ var Qt = class extends _e {
1760
1761
  static $inject = ["eventBus"];
1761
1762
  constructor(e) {
1762
1763
  super(e);
@@ -1764,13 +1765,13 @@ var en = class extends ve {
1764
1765
  init() {
1765
1766
  this.addRule("connection.start", (e) => z(e.source)), this.addRule("connection.create", (e) => {
1766
1767
  let { source: t, target: n } = e;
1767
- return !z(t) || !z(n) || t === n || $t(t, n) ? !1 : { wardleyType: "dependency" };
1768
- }), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => C(e.shape) || Ne(e.shape));
1768
+ return !z(t) || !z(n) || t === n || Zt(t, n) ? !1 : { wardleyType: "dependency" };
1769
+ }), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => T(e.shape) || ke(e.shape));
1769
1770
  }
1770
- }, tn = {
1771
+ }, $t = {
1771
1772
  __init__: ["wardleyRules"],
1772
- wardleyRules: ["type", en]
1773
- }, nn = 8, rn = {
1773
+ wardleyRules: ["type", Qt]
1774
+ }, en = 8, tn = {
1774
1775
  __init__: ["stageSnapping"],
1775
1776
  stageSnapping: ["type", class {
1776
1777
  static $inject = ["eventBus", "evolutionGrid"];
@@ -1786,7 +1787,7 @@ var en = class extends ve {
1786
1787
  let t = e.context?.shape;
1787
1788
  if (!t) return;
1788
1789
  let r = t.x + t.width / 2 + e.dx;
1789
- for (let t of n()) if (Math.abs(r - t) <= nn) {
1790
+ for (let t of n()) if (Math.abs(r - t) <= en) {
1790
1791
  let n = t - r;
1791
1792
  e.dx += n, e.x += n;
1792
1793
  break;
@@ -1798,7 +1799,7 @@ var en = class extends ve {
1798
1799
  "resize.end"
1799
1800
  ], 1500, (e) => {
1800
1801
  if (!e.originalEvent?.shiftKey && typeof e.x == "number") {
1801
- for (let t of n()) if (Math.abs(e.x - t) <= nn) {
1802
+ for (let t of n()) if (Math.abs(e.x - t) <= en) {
1802
1803
  r(e, t);
1803
1804
  break;
1804
1805
  }
@@ -1806,30 +1807,30 @@ var en = class extends ve {
1806
1807
  });
1807
1808
  }
1808
1809
  }]
1809
- }, B = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="wardley-palette-svg">${e}</svg>`, V = (e = "") => `<circle cx="12" cy="12" r="7" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="2"/>${e}`, H = {
1810
- draw: B(`<polyline points="3,18 8.5,7 14,14 21,4" fill="none" stroke="${_.ink}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><circle cx="3" cy="18" r="2.2" fill="${_.componentFill}" stroke="${_.ink}" stroke-width="1.4"/>`),
1811
- lasso: B(`<rect x="3" y="3" width="13" height="13" rx="2" fill="none" stroke="${_.ink}" stroke-width="1.5" stroke-dasharray="3 2.5"/><path d="M13.5 13.5l7 2.7-3 1.3-1.3 3z" fill="${_.ink}"/>`),
1810
+ }, B = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="wardley-palette-svg">${e}</svg>`, V = (e = "") => `<circle cx="12" cy="12" r="7" fill="${v.componentFill}" stroke="${v.stroke}" stroke-width="2"/>${e}`, H = {
1811
+ draw: B(`<polyline points="3,18 8.5,7 14,14 21,4" fill="none" stroke="${v.ink}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><circle cx="3" cy="18" r="2.2" fill="${v.componentFill}" stroke="${v.ink}" stroke-width="1.4"/>`),
1812
+ lasso: B(`<rect x="3" y="3" width="13" height="13" rx="2" fill="none" stroke="${v.ink}" stroke-width="1.5" stroke-dasharray="3 2.5"/><path d="M13.5 13.5l7 2.7-3 1.3-1.3 3z" fill="${v.ink}"/>`),
1812
1813
  component: B(V()),
1813
- market: B(V(`<circle cx="12" cy="10" r="1.4" fill="${_.stroke}"/><circle cx="10.2" cy="13.4" r="1.4" fill="${_.stroke}"/><circle cx="13.8" cy="13.4" r="1.4" fill="${_.stroke}"/>`)),
1814
- ecosystem: B(V(`<circle cx="12" cy="12" r="10" fill="none" stroke="${_.stroke}" stroke-width="1.25" stroke-dasharray="1.5 3" stroke-linecap="round"/>`)),
1815
- anchor: B(`<path d="${D}" fill="${_.ink}"/>`),
1816
- pipeline: B(`<rect x="9.5" y="2.5" width="5.5" height="5.5" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.5"/><rect x="2" y="10" width="20" height="9" rx="2" fill="none" stroke="${_.pipeline}" stroke-width="1.25" stroke-dasharray="3 2"/><circle cx="7" cy="14.5" r="2.2" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.2"/><circle cx="17" cy="14.5" r="2.2" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.2"/>`),
1817
- note: B(`<g stroke="${_.noteText}" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="13" y2="16"/></g>`),
1818
- annotation: B(`<circle cx="12" cy="12" r="8" fill="${_.annotationFill}" stroke="${_.stroke}" stroke-width="1.25"/>` + ((e, t) => `<text x="12" text-anchor="middle" font-family="${y.family}" ${t}>${e}</text>`)("1", `y="16" font-size="11" font-weight="700" fill="${_.stroke}"`)),
1819
- accelerator: B(`<path d="${A}" fill="${_.accelerator}"/>`),
1820
- deaccelerator: B(`<path d="${j}" fill="${_.deaccelerator}"/>`),
1821
- submap: B(`<rect x="4" y="4" width="16" height="16" rx="3" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="2"/><rect x="7.5" y="7.5" width="9" height="9" rx="1.5" fill="none" stroke="${_.stroke}" stroke-width="1"/>`)
1814
+ market: B(V(`<circle cx="12" cy="10" r="1.4" fill="${v.stroke}"/><circle cx="10.2" cy="13.4" r="1.4" fill="${v.stroke}"/><circle cx="13.8" cy="13.4" r="1.4" fill="${v.stroke}"/>`)),
1815
+ ecosystem: B(V(`<circle cx="12" cy="12" r="10" fill="none" stroke="${v.stroke}" stroke-width="1.25" stroke-dasharray="1.5 3" stroke-linecap="round"/>`)),
1816
+ anchor: B(`<path d="${M}" fill="${v.ink}"/>`),
1817
+ pipeline: B(`<rect x="9.5" y="2.5" width="5.5" height="5.5" fill="${v.componentFill}" stroke="${v.stroke}" stroke-width="1.5"/><rect x="2" y="10" width="20" height="9" rx="2" fill="none" stroke="${v.pipeline}" stroke-width="1.25" stroke-dasharray="3 2"/><circle cx="7" cy="14.5" r="2.2" fill="${v.componentFill}" stroke="${v.stroke}" stroke-width="1.2"/><circle cx="17" cy="14.5" r="2.2" fill="${v.componentFill}" stroke="${v.stroke}" stroke-width="1.2"/>`),
1818
+ note: B(`<g stroke="${v.noteText}" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="13" y2="16"/></g>`),
1819
+ annotation: B(`<circle cx="12" cy="12" r="8" fill="${v.annotationFill}" stroke="${v.stroke}" stroke-width="1.25"/>` + ((e, t) => `<text x="12" text-anchor="middle" font-family="${b.family}" ${t}>${e}</text>`)("1", `y="16" font-size="11" font-weight="700" fill="${v.stroke}"`)),
1820
+ accelerator: B(`<path d="${et}" fill="${v.accelerator}"/>`),
1821
+ deaccelerator: B(`<path d="${tt}" fill="${v.deaccelerator}"/>`),
1822
+ submap: B(`<rect x="4" y="4" width="16" height="16" rx="3" fill="${v.componentFill}" stroke="${v.stroke}" stroke-width="2"/><rect x="7.5" y="7.5" width="9" height="9" rx="1.5" fill="none" stroke="${v.stroke}" stroke-width="1"/>`)
1822
1823
  };
1823
1824
  function U(e) {
1824
- let t = v[e] ?? {
1825
- fill: _.band,
1826
- stroke: _.dependency
1825
+ let t = y[e] ?? {
1826
+ fill: v.band,
1827
+ stroke: v.dependency
1827
1828
  };
1828
1829
  return B(`<rect x="2" y="6" width="20" height="12" rx="3" fill="${t.fill}" stroke="${t.stroke}" stroke-width="1.5" stroke-dasharray="3 2"/>`);
1829
1830
  }
1830
1831
  //#endregion
1831
1832
  //#region src/palette/WardleyPaletteProvider.ts
1832
- var W = "wardley-1-blocks", G = "wardley-2-strategy", an = [
1833
+ var W = "wardley-1-blocks", G = "wardley-2-strategy", nn = [
1833
1834
  {
1834
1835
  key: "component",
1835
1836
  type: "component",
@@ -1933,7 +1934,7 @@ var W = "wardley-1-blocks", G = "wardley-2-strategy", an = [
1933
1934
  icon: H.note,
1934
1935
  group: "wardley-3-notes"
1935
1936
  }
1936
- ], on = {
1937
+ ], rn = {
1937
1938
  __init__: ["wardleyPaletteProvider"],
1938
1939
  wardleyPaletteProvider: ["type", class {
1939
1940
  create;
@@ -1963,7 +1964,7 @@ var W = "wardley-1-blocks", G = "wardley-2-strategy", an = [
1963
1964
  html: `<div class="entry wardley-palette-entry" title="Draw — click point by point, double-click/Enter finishes, click the start point to close">${H.draw}</div>`,
1964
1965
  action: { click: () => this.drawTool.toggle() }
1965
1966
  };
1966
- for (let t of an) {
1967
+ for (let t of nn) {
1967
1968
  let n = (e) => {
1968
1969
  let n = this.factory.createNew(t.type, t.label, t.extra ?? {});
1969
1970
  this.create.start(e, n);
@@ -1987,14 +1988,14 @@ var W = "wardley-1-blocks", G = "wardley-2-strategy", an = [
1987
1988
  }, J = {
1988
1989
  id: "method",
1989
1990
  name: "Sourcing"
1990
- }, sn = {
1991
+ }, an = {
1991
1992
  id: "props",
1992
1993
  name: "Properties"
1993
1994
  };
1994
1995
  function Y(e, t) {
1995
1996
  return e ? `✓ ${t}` : t;
1996
1997
  }
1997
- var cn = class {
1998
+ var on = class {
1998
1999
  modeling;
1999
2000
  static $inject = ["popupMenu", "wardleyModeling"];
2000
2001
  constructor(e, t) {
@@ -2002,7 +2003,7 @@ var cn = class {
2002
2003
  }
2003
2004
  getPopupMenuEntries(e) {
2004
2005
  let t = Array.isArray(e) ? e[0] : e;
2005
- return Me(t) ? this.componentEntries(t) : {};
2006
+ return w(t) ? this.componentEntries(t) : {};
2006
2007
  }
2007
2008
  componentEntries(e) {
2008
2009
  let t = e.decorators ?? {}, n = t.ecosystem ? "ecosystem" : t.market ? "market" : "normal", r = t.method;
@@ -2044,23 +2045,23 @@ var cn = class {
2044
2045
  },
2045
2046
  "prop-inertia": {
2046
2047
  label: Y(!!t.inertia, "Inertia"),
2047
- group: sn,
2048
+ group: an,
2048
2049
  action: () => this.modeling.toggleInertia(e)
2049
2050
  }
2050
2051
  };
2051
2052
  }
2052
- }, ln = {
2053
+ }, sn = {
2053
2054
  __init__: ["wardleyElementSettings"],
2054
- wardleyElementSettings: ["type", cn]
2055
+ wardleyElementSettings: ["type", on]
2055
2056
  };
2056
2057
  //#endregion
2057
2058
  //#region src/context-pad/WardleyContextPadProvider.ts
2058
2059
  function X(e, t, n = !1) {
2059
- return `<div class="entry wardley-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${N(e)}</div>`;
2060
+ return `<div class="entry wardley-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${ct(e)}</div>`;
2060
2061
  }
2061
2062
  //#endregion
2062
2063
  //#region src/context-pad/index.ts
2063
- var un = {
2064
+ var cn = {
2064
2065
  __init__: ["wardleyContextPadProvider"],
2065
2066
  wardleyContextPadProvider: ["type", class {
2066
2067
  modeling;
@@ -2088,24 +2089,24 @@ var un = {
2088
2089
  this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.wardleyModeling = a, this.labelEditing = o, this.evolveDragging = s, this.factory = c, this.colorPicker = l, e.registerProvider(this);
2089
2090
  }
2090
2091
  getContextPadEntries(e) {
2091
- if (S(e)) {
2092
+ if (C(e)) {
2092
2093
  let t = e, n = t.wardleyType === "flow";
2093
2094
  return {
2094
2095
  "edit-value": {
2095
2096
  group: "edit",
2096
2097
  title: n ? "Edit flow value" : "Edit link annotation",
2097
- html: X(O, n ? "Edit flow value" : "Edit link annotation"),
2098
+ html: X(N, n ? "Edit flow value" : "Edit link annotation"),
2098
2099
  action: { click: () => this.labelEditing.activateConnection(t) }
2099
2100
  },
2100
2101
  delete: {
2101
2102
  group: "edit",
2102
2103
  title: "Delete connection",
2103
- html: X(k, "Delete connection"),
2104
+ html: X(P, "Delete connection"),
2104
2105
  action: { click: () => this.modeling.removeElements([e]) }
2105
2106
  }
2106
2107
  };
2107
2108
  }
2108
- if (!x(e)) return {};
2109
+ if (!S(e)) return {};
2109
2110
  let t = e, n = {};
2110
2111
  if (t.wardleyType === "component" || t.wardleyType === "anchor" || t.wardleyType === "submap" || t.wardleyType === "pipeline") {
2111
2112
  let e = (e) => {
@@ -2115,7 +2116,7 @@ var un = {
2115
2116
  n.append = {
2116
2117
  group: "edit",
2117
2118
  title: "Append component (auto-connect)",
2118
- html: X(Ke, "Append component", !0),
2119
+ html: X(ze, "Append component", !0),
2119
2120
  action: {
2120
2121
  click: e,
2121
2122
  dragstart: e
@@ -2127,7 +2128,7 @@ var un = {
2127
2128
  n.connect = {
2128
2129
  group: "edit",
2129
2130
  title: "Connect to existing element",
2130
- html: X(qe, "Connect to existing element", !0),
2131
+ html: X(Be, "Connect to existing element", !0),
2131
2132
  action: {
2132
2133
  click: r,
2133
2134
  dragstart: r
@@ -2138,7 +2139,7 @@ var un = {
2138
2139
  if (t.movement) n["evolve-clear"] = {
2139
2140
  group: "wardley",
2140
2141
  title: "Remove evolve",
2141
- html: X(Ye, "Remove evolve"),
2142
+ html: X(He, "Remove evolve"),
2142
2143
  action: { click: () => this.wardleyModeling.clearMovement(t) }
2143
2144
  };
2144
2145
  else if (t.evolution < .999) {
@@ -2146,7 +2147,7 @@ var un = {
2146
2147
  n.evolve = {
2147
2148
  group: "wardley",
2148
2149
  title: "Evolve: drag to set the target maturity",
2149
- html: X(Je, "Evolve: drag to set the target maturity", !0),
2150
+ html: X(Ve, "Evolve: drag to set the target maturity", !0),
2150
2151
  action: {
2151
2152
  click: e,
2152
2153
  dragstart: e
@@ -2156,7 +2157,7 @@ var un = {
2156
2157
  n.settings = {
2157
2158
  group: "wardley",
2158
2159
  title: "Settings (type, sourcing, inertia)",
2159
- html: X(at, "Settings"),
2160
+ html: X(Qe, "Settings"),
2160
2161
  action: { click: (e) => {
2161
2162
  let n = e;
2162
2163
  this.popupMenu.open(t, K, {
@@ -2171,14 +2172,14 @@ var un = {
2171
2172
  n["stroke-style"] = {
2172
2173
  group: "wardley",
2173
2174
  title: r,
2174
- html: X(st, r),
2175
+ html: X(nt, r),
2175
2176
  action: { click: () => this.wardleyModeling.updateProperties(t, { strokeStyle: e }) }
2176
2177
  };
2177
2178
  }
2178
2179
  n.color = {
2179
2180
  group: "wardley",
2180
2181
  title: "Color",
2181
- html: X(ot, "Color"),
2182
+ html: X($e, "Color"),
2182
2183
  action: { click: (e) => {
2183
2184
  let n = e;
2184
2185
  this.colorPicker.open(t, n.clientX, n.clientY);
@@ -2188,17 +2189,17 @@ var un = {
2188
2189
  return i && (n["open-link"] = {
2189
2190
  group: "wardley",
2190
2191
  title: `Open link (${i})`,
2191
- html: X(qe, "Open link"),
2192
+ html: X(Be, "Open link"),
2192
2193
  action: { click: () => window.open(i, "_blank", "noopener") }
2193
2194
  }), t.wardleyType !== "drawing" && (n["edit-label"] = {
2194
2195
  group: "edit",
2195
2196
  title: "Edit label",
2196
- html: X(O, "Edit label"),
2197
+ html: X(N, "Edit label"),
2197
2198
  action: { click: () => this.labelEditing.activate(t) }
2198
2199
  }), n.delete = {
2199
2200
  group: "edit",
2200
2201
  title: "Delete",
2201
- html: X(k, "Delete"),
2202
+ html: X(P, "Delete"),
2202
2203
  action: { click: () => this.modeling.removeElements([t]) }
2203
2204
  }, n;
2204
2205
  }
@@ -2206,10 +2207,10 @@ var un = {
2206
2207
  };
2207
2208
  //#endregion
2208
2209
  //#region src/label-editing/WardleyLabelEditing.ts
2209
- function dn(e) {
2210
+ function ln(e) {
2210
2211
  return e.replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
2211
2212
  }
2212
- var fn = class {
2213
+ var un = class {
2213
2214
  canvas;
2214
2215
  modeling;
2215
2216
  factory;
@@ -2222,7 +2223,7 @@ var fn = class {
2222
2223
  active = null;
2223
2224
  constructor(e, t, n, r) {
2224
2225
  this.canvas = t, this.modeling = n, this.factory = r, e.on("element.dblclick", (e) => {
2225
- x(e.element) ? this.activate(e.element) : S(e.element) && this.activateConnection(e.element);
2226
+ S(e.element) ? this.activate(e.element) : C(e.element) && this.activateConnection(e.element);
2226
2227
  }), e.on([
2227
2228
  "element.mousedown",
2228
2229
  "drag.init",
@@ -2241,7 +2242,7 @@ var fn = class {
2241
2242
  c || (c = !0, s.removeEventListener("keydown", d), s.removeEventListener("blur", f), s.remove(), this.active = null);
2242
2243
  }, u = () => {
2243
2244
  if (c) return;
2244
- let t = dn(s.value), n = t && t !== e.wardleyLabel;
2245
+ let t = ln(s.value), n = t && t !== e.wardleyLabel;
2245
2246
  if (l(), !n) return;
2246
2247
  let r = i ? t : this.factory.uniqueLabel(t, e.id);
2247
2248
  this.modeling.updateLabel(e, r);
@@ -2296,10 +2297,10 @@ var fn = class {
2296
2297
  cancel() {
2297
2298
  this.active?.cleanup();
2298
2299
  }
2299
- }, pn = {
2300
+ }, dn = {
2300
2301
  __init__: ["wardleyLabelEditing"],
2301
- wardleyLabelEditing: ["type", fn]
2302
- }, mn = 2, hn = 10, gn = {
2302
+ wardleyLabelEditing: ["type", un]
2303
+ }, fn = 2, pn = 10, mn = {
2303
2304
  arrowleft: {
2304
2305
  x: -1,
2305
2306
  y: 0
@@ -2316,7 +2317,7 @@ var fn = class {
2316
2317
  x: 0,
2317
2318
  y: 1
2318
2319
  }
2319
- }, _n = class {
2320
+ }, hn = class {
2320
2321
  static $inject = [
2321
2322
  "canvas",
2322
2323
  "commandStack",
@@ -2333,7 +2334,7 @@ var fn = class {
2333
2334
  let u = e.getContainer();
2334
2335
  u.hasAttribute("tabindex") || u.setAttribute("tabindex", "0");
2335
2336
  let d = (e) => {
2336
- if (vn(e.target)) return;
2337
+ if (gn(e.target)) return;
2337
2338
  let l = e.ctrlKey || e.metaKey, u = e.key.toLowerCase();
2338
2339
  if (l && u === "z" && !e.shiftKey) e.preventDefault(), t.undo();
2339
2340
  else if (l && u === "z" && e.shiftKey || l && u === "y") e.preventDefault(), t.redo();
@@ -2354,11 +2355,11 @@ var fn = class {
2354
2355
  e.preventDefault();
2355
2356
  let t = s.getLastMoveEvent();
2356
2357
  c.activateSelection(t ?? e, !!t);
2357
- } else if (u in gn && !l) {
2358
+ } else if (u in mn && !l) {
2358
2359
  let t = n.get();
2359
2360
  if (t.length) {
2360
2361
  e.preventDefault();
2361
- let n = e.shiftKey ? hn : mn, i = gn[u];
2362
+ let n = e.shiftKey ? pn : fn, i = mn[u];
2362
2363
  r.moveElements(t, {
2363
2364
  x: i.x * n,
2364
2365
  y: i.y * n
@@ -2369,21 +2370,21 @@ var fn = class {
2369
2370
  document.addEventListener("keydown", d), l.on("diagram.destroy", () => document.removeEventListener("keydown", d));
2370
2371
  }
2371
2372
  };
2372
- function vn(e) {
2373
+ function gn(e) {
2373
2374
  if (!(e instanceof HTMLElement)) return !1;
2374
2375
  let t = e.tagName;
2375
2376
  return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
2376
2377
  }
2377
2378
  //#endregion
2378
2379
  //#region src/keyboard/index.ts
2379
- var yn = {
2380
+ var _n = {
2380
2381
  __init__: ["wardleyKeyboard"],
2381
- wardleyKeyboard: ["type", _n]
2382
- }, Z = "wardley.evolve", bn = .005, xn = "wardley-evolve-handle";
2383
- function Sn(e) {
2382
+ wardleyKeyboard: ["type", hn]
2383
+ }, Z = "wardley.evolve", vn = .005, yn = "wardley-evolve-handle";
2384
+ function bn(e) {
2384
2385
  return e < 0 ? 0 : e > 1 ? 1 : e;
2385
2386
  }
2386
- var Cn = class {
2387
+ var Q = class {
2387
2388
  dragging;
2388
2389
  static $inject = [
2389
2390
  "eventBus",
@@ -2399,32 +2400,32 @@ var Cn = class {
2399
2400
  n === void 0 ? delete t.movement : t.movement = n, e.fire("element.changed", { element: t });
2400
2401
  }, s = (e, t) => {
2401
2402
  let r = i.getContainer().getBoundingClientRect(), a = i.viewbox(), o = a.x + (e - r.left) * (a.width / r.width);
2402
- return Sn(n.fromCanvas({
2403
+ return bn(n.fromCanvas({
2403
2404
  x: o,
2404
2405
  y: t
2405
2406
  }).evolution);
2406
2407
  };
2407
2408
  i.getContainer().addEventListener("mousedown", (e) => {
2408
2409
  let t = e.target;
2409
- if (!t?.closest(`.${xn}`)) return;
2410
+ if (!t?.closest(`.${yn}`)) return;
2410
2411
  let n = t.closest("[data-element-id]")?.getAttribute("data-element-id"), i = n ? a.get(n) : void 0;
2411
2412
  if (!i || i.wardleyType !== "component") return;
2412
2413
  e.stopPropagation(), e.preventDefault();
2413
2414
  let c = i.movement, l = i.y + i.height / 2, u, d = (e) => {
2414
2415
  u = s(e.clientX, l), o(i, { targetEvolution: u });
2415
2416
  }, f = () => {
2416
- document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), o(i, c), u !== void 0 && Math.abs(u - i.evolution) > bn && r.evolveComponent(i, u);
2417
+ document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), o(i, c), u !== void 0 && Math.abs(u - i.evolution) > vn && r.evolveComponent(i, u);
2417
2418
  };
2418
2419
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
2419
2420
  }, !0), e.on(`${Z}.move`, (e) => {
2420
- let { shape: t } = e.context, r = t.y + t.height / 2, i = Sn(n.fromCanvas({
2421
+ let { shape: t } = e.context, r = t.y + t.height / 2, i = bn(n.fromCanvas({
2421
2422
  x: e.x,
2422
2423
  y: r
2423
2424
  }).evolution);
2424
2425
  e.context.target = i, o(t, { targetEvolution: i });
2425
2426
  }), e.on(`${Z}.end`, (e) => {
2426
2427
  let t = e.context, { shape: n, target: i } = t;
2427
- o(n, t.originalMovement), i !== void 0 && Math.abs(i - n.evolution) > bn && r.evolveComponent(n, i), t.committed = !0;
2428
+ o(n, t.originalMovement), i !== void 0 && Math.abs(i - n.evolution) > vn && r.evolveComponent(n, i), t.committed = !0;
2428
2429
  }), e.on(`${Z}.cleanup`, (e) => {
2429
2430
  let t = e.context;
2430
2431
  t && !t.committed && o(t.shape, t.originalMovement);
@@ -2440,10 +2441,10 @@ var Cn = class {
2440
2441
  data: { context: n }
2441
2442
  });
2442
2443
  }
2443
- }, wn = {
2444
+ }, xn = {
2444
2445
  __init__: ["wardleyEvolveDragging"],
2445
- wardleyEvolveDragging: ["type", Cn]
2446
- }, Tn = 500, En = class {
2446
+ wardleyEvolveDragging: ["type", Q]
2447
+ }, Sn = 500, Cn = class {
2447
2448
  static $inject = ["injector", "eventBus"];
2448
2449
  constructor(e, t) {
2449
2450
  let n = e.get("connectionPreview", !1), r = e.get("wardleyLabelEditing", !1);
@@ -2468,18 +2469,18 @@ var Cn = class {
2468
2469
  "create.cleanup"
2469
2470
  ], (e) => {
2470
2471
  n.cleanUp(e.context);
2471
- })), r && t.on("create.end", Tn, (e) => {
2472
+ })), r && t.on("create.end", Sn, (e) => {
2472
2473
  let { context: t } = e;
2473
2474
  if (!t.source || !t.canExecute || !t.shape) return;
2474
2475
  let n = t.shape;
2475
2476
  setTimeout(() => r.activate(n), 0);
2476
2477
  });
2477
2478
  }
2478
- }, Dn = {
2479
- __depends__: [ye],
2479
+ }, wn = {
2480
+ __depends__: [ve],
2480
2481
  __init__: ["wardleyAppendBehavior"],
2481
- wardleyAppendBehavior: ["type", En]
2482
- }, Q = class {
2482
+ wardleyAppendBehavior: ["type", Cn]
2483
+ }, Tn = class {
2483
2484
  canvas;
2484
2485
  modeling;
2485
2486
  static $inject = [
@@ -2509,7 +2510,7 @@ var Cn = class {
2509
2510
  value: void 0,
2510
2511
  title: "No color",
2511
2512
  cls: "wardley-cp-none"
2512
- }, ...Te.map((e) => ({
2513
+ }, ...Se.map((e) => ({
2513
2514
  value: e.value,
2514
2515
  title: e.name,
2515
2516
  cls: ""
@@ -2529,36 +2530,36 @@ var Cn = class {
2529
2530
  close() {
2530
2531
  this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
2531
2532
  }
2532
- }, On = {
2533
+ }, En = {
2533
2534
  __init__: ["wardleyColorPicker"],
2534
- wardleyColorPicker: ["type", Q]
2535
+ wardleyColorPicker: ["type", Tn]
2535
2536
  };
2536
2537
  //#endregion
2537
2538
  //#region src/ordering/WardleyOrderingProvider.ts
2538
2539
  function $(e) {
2539
- return x(e) && (e.wardleyType === "attitude" || e.wardleyType === "pipeline");
2540
+ return S(e) && (e.wardleyType === "attitude" || e.wardleyType === "pipeline");
2540
2541
  }
2541
2542
  //#endregion
2542
2543
  //#region src/ordering/index.ts
2543
- var kn = {
2544
+ var Dn = {
2544
2545
  __init__: ["wardleyOrderingProvider"],
2545
- wardleyOrderingProvider: ["type", class extends be {
2546
+ wardleyOrderingProvider: ["type", class extends ye {
2546
2547
  static $inject = ["eventBus"];
2547
2548
  constructor(e) {
2548
2549
  super(e);
2549
2550
  }
2550
2551
  getOrdering(e, t) {
2551
2552
  let n = t.children ?? [];
2552
- return S(e) ? {
2553
+ return C(e) ? {
2553
2554
  parent: t,
2554
- index: n.filter((t) => t !== e && ($(t) || S(t))).length
2555
+ index: n.filter((t) => t !== e && ($(t) || C(t))).length
2555
2556
  } : $(e) ? {
2556
2557
  parent: t,
2557
2558
  index: n.filter((t) => t !== e && $(t)).length
2558
2559
  } : { parent: t };
2559
2560
  }
2560
2561
  }]
2561
- }, An = 12, jn = class {
2562
+ }, On = 12, kn = class {
2562
2563
  canvas;
2563
2564
  eventBus;
2564
2565
  modeling;
@@ -2635,12 +2636,12 @@ var kn = {
2635
2636
  if (e.button !== 0 || this.isChromeTarget(e)) return;
2636
2637
  e.preventDefault(), e.stopPropagation();
2637
2638
  let t = this.toCanvasPoint(e), n = this.points[0];
2638
- if (n && this.points.length >= 3 && Mn(t, n) <= An) {
2639
+ if (n && this.points.length >= 3 && An(t, n) <= On) {
2639
2640
  this.finishClosed();
2640
2641
  return;
2641
2642
  }
2642
2643
  let r = this.points[this.points.length - 1];
2643
- if (r && Mn(t, r) <= An) {
2644
+ if (r && An(t, r) <= On) {
2644
2645
  this.points.length >= 2 && this.finish();
2645
2646
  return;
2646
2647
  }
@@ -2661,7 +2662,7 @@ var kn = {
2661
2662
  l(t, u(f("polyline"), {
2662
2663
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
2663
2664
  fill: "none",
2664
- stroke: _.ink,
2665
+ stroke: v.ink,
2665
2666
  "stroke-width": 2,
2666
2667
  "stroke-linecap": "round",
2667
2668
  "stroke-linejoin": "round",
@@ -2672,8 +2673,8 @@ var kn = {
2672
2673
  cx: r.x,
2673
2674
  cy: r.y,
2674
2675
  r: this.points.length >= 3 ? 5 : 3,
2675
- fill: _.paper,
2676
- stroke: _.ink,
2676
+ fill: v.paper,
2677
+ stroke: v.ink,
2677
2678
  "stroke-width": 1.5
2678
2679
  })), this.points.length >= 2) {
2679
2680
  let e = this.points[this.points.length - 1];
@@ -2681,8 +2682,8 @@ var kn = {
2681
2682
  cx: e.x,
2682
2683
  cy: e.y,
2683
2684
  r: 5,
2684
- fill: _.paper,
2685
- stroke: _.ink,
2685
+ fill: v.paper,
2686
+ stroke: v.ink,
2686
2687
  "stroke-width": 1.5
2687
2688
  }));
2688
2689
  }
@@ -2692,12 +2693,12 @@ var kn = {
2692
2693
  this.layer &&= (p(this.layer), null);
2693
2694
  }
2694
2695
  };
2695
- function Mn(e, t) {
2696
+ function An(e, t) {
2696
2697
  return Math.hypot(e.x - t.x, e.y - t.y);
2697
2698
  }
2698
2699
  //#endregion
2699
2700
  //#region src/draw-tool/WardleyDrawingHandles.ts
2700
- var Nn = class {
2701
+ var jn = class {
2701
2702
  eventBus;
2702
2703
  canvas;
2703
2704
  modeling;
@@ -2714,7 +2715,7 @@ var Nn = class {
2714
2715
  constructor(e, t, n, r) {
2715
2716
  this.eventBus = e, this.canvas = t, this.modeling = n, this.grid = r, e.on("selection.changed", (e) => {
2716
2717
  let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
2717
- this.attach(x(n) && n.wardleyType === "drawing" ? n : null);
2718
+ this.attach(S(n) && n.wardleyType === "drawing" ? n : null);
2718
2719
  }), e.on("element.changed", (e) => {
2719
2720
  this.shape && e.element === this.shape && this.render();
2720
2721
  }), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
@@ -2737,8 +2738,8 @@ var Nn = class {
2737
2738
  cx: e.x,
2738
2739
  cy: e.y,
2739
2740
  r: 5,
2740
- fill: _.paper,
2741
- stroke: _.ink,
2741
+ fill: v.paper,
2742
+ stroke: v.ink,
2742
2743
  "stroke-width": 1.5,
2743
2744
  class: "wardley-drawing-handle"
2744
2745
  });
@@ -2775,7 +2776,7 @@ var Nn = class {
2775
2776
  let n = this.canvas.getLayer("wardley-drawing-handles", 1100), r = u(f(t ? "polygon" : "polyline"), {
2776
2777
  points: e.map((e) => `${e.x},${e.y}`).join(" "),
2777
2778
  fill: "none",
2778
- stroke: _.ink,
2779
+ stroke: v.ink,
2779
2780
  "stroke-width": 1.5,
2780
2781
  "stroke-dasharray": "5 4",
2781
2782
  "pointer-events": "none"
@@ -2798,20 +2799,20 @@ var Nn = class {
2798
2799
  };
2799
2800
  //#endregion
2800
2801
  //#region src/draw-tool/WardleyDrawingHitProvider.ts
2801
- function Pn(e) {
2802
- return x(e) && e.wardleyType === "drawing";
2802
+ function Mn(e) {
2803
+ return S(e) && e.wardleyType === "drawing";
2803
2804
  }
2804
- var Fn = class {
2805
+ var Nn = class {
2805
2806
  static $inject = ["eventBus", "interactionEvents"];
2806
2807
  constructor(e, t) {
2807
2808
  e.on("interactionEvents.createHit", (e) => {
2808
- if (!(!Pn(e.element) || !e.gfx)) return In(e.element, e.gfx), !1;
2809
+ if (Mn(e.element) && e.gfx) return Pn(e.element, e.gfx), !1;
2809
2810
  }), e.on("interactionEvents.updateHit", (e) => {
2810
- if (!(!Pn(e.element) || !e.gfx)) return t.removeHits(e.gfx), In(e.element, e.gfx), !1;
2811
+ if (Mn(e.element) && e.gfx) return t.removeHits(e.gfx), Pn(e.element, e.gfx), !1;
2811
2812
  });
2812
2813
  }
2813
2814
  };
2814
- function In(e, t) {
2815
+ function Pn(e, t) {
2815
2816
  let n = e.drawingPoints ?? [], r = f(e.closed ? "polygon" : "polyline");
2816
2817
  u(r, {
2817
2818
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
@@ -2824,44 +2825,44 @@ function In(e, t) {
2824
2825
  }
2825
2826
  //#endregion
2826
2827
  //#region src/draw-tool/index.ts
2827
- var Ln = {
2828
+ var Fn = {
2828
2829
  __init__: [
2829
2830
  "wardleyDrawTool",
2830
2831
  "wardleyDrawingHandles",
2831
2832
  "wardleyDrawingHitProvider"
2832
2833
  ],
2833
- wardleyDrawTool: ["type", jn],
2834
- wardleyDrawingHandles: ["type", Nn],
2835
- wardleyDrawingHitProvider: ["type", Fn]
2836
- }, Rn = class extends It {
2834
+ wardleyDrawTool: ["type", kn],
2835
+ wardleyDrawingHandles: ["type", jn],
2836
+ wardleyDrawingHitProvider: ["type", Nn]
2837
+ }, In = class extends Pt {
2837
2838
  _getModules() {
2838
2839
  return [
2839
2840
  ...super._getModules(),
2840
2841
  oe,
2841
- fe,
2842
+ de,
2842
2843
  se,
2844
+ m,
2843
2845
  ce,
2844
2846
  le,
2845
2847
  ue,
2846
- de,
2848
+ fe,
2847
2849
  pe,
2848
2850
  me,
2849
- he,
2850
- Xt,
2851
+ Jt,
2852
+ $t,
2853
+ Re,
2851
2854
  tn,
2852
- Ge,
2853
2855
  rn,
2854
- on,
2855
- un,
2856
- pn,
2857
- yn,
2856
+ cn,
2857
+ dn,
2858
+ _n,
2859
+ xn,
2860
+ sn,
2858
2861
  wn,
2859
- ln,
2862
+ En,
2863
+ Yt,
2860
2864
  Dn,
2861
- On,
2862
- Zt,
2863
- kn,
2864
- Ln
2865
+ Fn
2865
2866
  ];
2866
2867
  }
2867
2868
  undo() {
@@ -2878,6 +2879,6 @@ var Ln = {
2878
2879
  }
2879
2880
  };
2880
2881
  //#endregion
2881
- export { _ as COLORS, Le as EvolutionGrid, ut as ICON_ADD, ct as ICON_ASPECT_RATIO, $e as ICON_CODE, Qe as ICON_DATA_OBJECT, k as ICON_DELETE, et as ICON_DOWNLOAD, O as ICON_EDIT, nt as ICON_FOLDER_OPEN, rt as ICON_IMAGE, lt as ICON_MENU, it as ICON_NEW, D as ICON_PERSON, Ze as ICON_REDO, tt as ICON_SHARE, Xe as ICON_UNDO, dt as ICON_VISIBILITY, m as MIRAGON, Rn as Modeler, Te as NOTE_COLORS, It as NavigatedViewer, h as PLOT, K as POPUP_PROVIDER_ID, Pt as PanConstraint, Ft as PanConstraintModule, De as ROOT_ID, Dt as Viewer, En as WardleyAppendBehavior, ke as WardleyBaseViewer, Q as WardleyColorPicker, Ae as WardleyElementFactory, cn as WardleyElementSettingsProvider, Cn as WardleyEvolveDragging, Tt as WardleyExporter, wt as WardleyImporter, fn as WardleyLabelEditing, Vt as WardleyModeling, P as WardleyRenderer, en as WardleyRules, Ge as evolutionConstraintModule, E as evolutionGridModule, N as iconMarkup, Et as ioModule, Me as isComponent, C as isPipeline, S as isWardleyConnection, x as isWardleyShape, pn as labelEditingModule, Ee as saveSVG, rn as stageSnappingModule, Dn as wardleyAppendModule, On as wardleyColorPickerModule, un as wardleyContextPadModule, xt as wardleyDrawModule, wn as wardleyEvolveModule, yn as wardleyKeyboardModule, Pe as wardleyModelModule, Xt as wardleyModelingModule, on as wardleyPaletteModule, ln as wardleyPopupModule, tn as wardleyRulesModule };
2882
+ export { v as COLORS, O as EvolutionGrid, at as ICON_ADD, rt as ICON_ASPECT_RATIO, Ke as ICON_CODE, Ge as ICON_DATA_OBJECT, P as ICON_DELETE, qe as ICON_DOWNLOAD, N as ICON_EDIT, Ye as ICON_FOLDER_OPEN, Xe as ICON_IMAGE, it as ICON_MENU, Ze as ICON_NEW, M as ICON_PERSON, We as ICON_REDO, Je as ICON_SHARE, Ue as ICON_UNDO, ot as ICON_VISIBILITY, h as MIRAGON, In as Modeler, Se as NOTE_COLORS, Pt as NavigatedViewer, g as PLOT, K as POPUP_PROVIDER_ID, Mt as PanConstraint, Nt as PanConstraintModule, we as ROOT_ID, Tt as Viewer, Cn as WardleyAppendBehavior, Ee as WardleyBaseViewer, Tn as WardleyColorPicker, De as WardleyElementFactory, on as WardleyElementSettingsProvider, Q as WardleyEvolveDragging, Ct as WardleyExporter, St as WardleyImporter, un as WardleyLabelEditing, zt as WardleyModeling, ut as WardleyRenderer, Qt as WardleyRules, Re as evolutionConstraintModule, j as evolutionGridModule, ct as iconMarkup, wt as ioModule, w as isComponent, T as isPipeline, C as isWardleyConnection, S as isWardleyShape, dn as labelEditingModule, Ce as saveSVG, tn as stageSnappingModule, wn as wardleyAppendModule, En as wardleyColorPickerModule, cn as wardleyContextPadModule, yt as wardleyDrawModule, xn as wardleyEvolveModule, _n as wardleyKeyboardModule, E as wardleyModelModule, Jt as wardleyModelingModule, rn as wardleyPaletteModule, sn as wardleyPopupModule, $t as wardleyRulesModule };
2882
2883
 
2883
2884
  //# sourceMappingURL=index.js.map