@likec4/core 1.46.0 → 1.46.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/builder/index.d.mts +1 -1
  2. package/dist/builder/index.mjs +5 -5
  3. package/dist/compute-view/index.d.mts +1 -1
  4. package/dist/compute-view/index.mjs +4 -4
  5. package/dist/compute-view/relationships-view/index.d.mts +1 -1
  6. package/dist/index.mjs +2 -2
  7. package/dist/model/connection/deployment/index.d.mts +3 -3
  8. package/dist/model/connection/deployment/index.mjs +2 -2
  9. package/dist/model/connection/index.d.mts +4 -4
  10. package/dist/model/connection/index.mjs +3 -3
  11. package/dist/model/connection/model/index.d.mts +3 -3
  12. package/dist/model/connection/model/index.mjs +2 -2
  13. package/dist/model/index.d.mts +5 -5
  14. package/dist/model/index.mjs +4 -4
  15. package/dist/shared/{core.CQPEY2wQ.mjs → core.78IWAHAE.mjs} +1 -1
  16. package/dist/shared/{core.DqlrMlsf.mjs → core.BFd1lU9R.mjs} +1 -1
  17. package/dist/shared/{core.DbQpDoJS.mjs → core.CRhT4Iio.mjs} +9 -6
  18. package/dist/shared/{core.BK-tI3Q3.mjs → core.DEK-BO3_.mjs} +2 -2
  19. package/dist/shared/{core.BLG-ADpi.d.mts → core.DK3pdsTf.d.mts} +1 -0
  20. package/dist/shared/{core.Qv7vZIwZ.mjs → core.DSalPD6v.mjs} +258 -188
  21. package/dist/shared/{core.DU8pv3Q6.mjs → core.DVfPJPJj.mjs} +15 -14
  22. package/dist/shared/{core.Byj60hH6.d.mts → core.DezoCAzf.d.mts} +1 -1
  23. package/dist/shared/{core.D4Y4U8Lp.d.mts → core.I8sCl3WM.d.mts} +2 -2
  24. package/dist/shared/{core.CQYL_Z-_.d.mts → core.e5GJ61_a.d.mts} +2 -2
  25. package/dist/shared/{core.DJpiszim.mjs → core.xgoPk2RG.mjs} +124 -126
  26. package/dist/types/index.mjs +1 -1
  27. package/package.json +9 -9
@@ -1,10 +1,10 @@
1
- import { t as t$3, e as e$3, a as DeploymentNodeModel, b as DeployedInstanceModel, c as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.DbQpDoJS.mjs';
1
+ import { t as t$3, e as e$3, a as DeploymentNodeModel, b as DeployedInstanceModel, c as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.CRhT4Iio.mjs';
2
2
  import { e as e$2 } from './core.BKlholso.mjs';
3
3
  import { n as n$1 } from './core.BhNcrwzK.mjs';
4
4
  import { c as splitGlobalFqn, h as extractStep, g as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.D0WZutNd.mjs';
5
5
  import { m as hierarchyLevel, n as nameFromFqn, i as isAncestor, g as commonAncestor, s as sortNaturalByFqn, f as sortParentsFirst, p as parentFqn, a as ancestorsFqn } from './core.CdNCAwq7.mjs';
6
6
  import { m as memoizeProp } from './core.CLSZtnFh.mjs';
7
- import { R as RichText, e as exact } from './core.BK-tI3Q3.mjs';
7
+ import { R as RichText, e as exact } from './core.DEK-BO3_.mjs';
8
8
  import { preferSummary, preferDescription } from '../types/_aux.mjs';
9
9
  import { i as ihead } from './core.uFk_o9X6.mjs';
10
10
  import { t as t$6, b as compareNaturalHierarchically, c as compareNatural } from './core.3ZhnKAlZ.mjs';
@@ -12,7 +12,7 @@ import { t as t$2, a as t$4 } from './core.BsSXS-_R.mjs';
12
12
  import { t as t$5, e as e$4 } from './core.Coi_LOUZ.mjs';
13
13
  import { t as t$8 } from './core.CbT8JVYL.mjs';
14
14
  import { t as t$7 } from './core.BkVA6gjl.mjs';
15
- import { c as calcDriftsFromSnapshot, a as applyManualLayout, h as t$9 } from './core.Qv7vZIwZ.mjs';
15
+ import { c as calcDriftsFromSnapshot, a as applyManualLayout, h as t$9 } from './core.DSalPD6v.mjs';
16
16
  import { L as LikeC4Styles } from './core.BspBF3SJ.mjs';
17
17
  import { g as getOrCreate } from './core.DcS-0zys.mjs';
18
18
  import { D as DefaultMap } from './core.BbE4y-yl.mjs';
@@ -21,8 +21,8 @@ import { FqnRef } from '../types/fqnRef.mjs';
21
21
  import { c as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.DH7TXqXf.mjs';
22
22
  import { i as ifind } from './core.CmPXpJ8l.mjs';
23
23
  import { i as ifilter } from './core.DRJma0Ol.mjs';
24
- import './core.DqlrMlsf.mjs';
25
- import './core.CQPEY2wQ.mjs';
24
+ import './core.BFd1lU9R.mjs';
25
+ import './core.78IWAHAE.mjs';
26
26
 
27
27
  function e$1(e){if(e==null||e===``)return true;if(typeof e!=`object`)return false;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return false;return Object.getOwnPropertySymbols(e).length===0}
28
28
 
@@ -81,7 +81,7 @@ class ElementModel {
81
81
  * It includes tags from the element and its kind.
82
82
  */
83
83
  get tags() {
84
- return memoizeProp(this, Symbol.for("tags"), () => {
84
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("tags"), () => {
85
85
  return n$1([
86
86
  ...this.$element.tags ?? [],
87
87
  ...this.$model.specification.elements[this.$element.kind]?.tags ?? []
@@ -119,7 +119,7 @@ class ElementModel {
119
119
  return this.$element.links ?? [];
120
120
  }
121
121
  get defaultView() {
122
- return memoizeProp(this, Symbol.for("defaultView"), () => ihead(this.scopedViews()) ?? null);
122
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("defaultView"), () => ihead(this.scopedViews()) ?? null);
123
123
  }
124
124
  get isRoot() {
125
125
  return this.parent === null;
@@ -226,16 +226,16 @@ class ElementModel {
226
226
  return;
227
227
  }
228
228
  get allOutgoing() {
229
- return memoizeProp(this, Symbol.for("allOutgoing"), () => new Set(this.outgoing()));
229
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("allOutgoing"), () => new Set(this.outgoing()));
230
230
  }
231
231
  get allIncoming() {
232
- return memoizeProp(this, Symbol.for("allIncoming"), () => new Set(this.incoming()));
232
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("allIncoming"), () => new Set(this.incoming()));
233
233
  }
234
234
  /**
235
235
  * Iterate over all views that include this element.
236
236
  */
237
237
  views() {
238
- return memoizeProp(this, Symbol.for("views"), () => {
238
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("views"), () => {
239
239
  const views = /* @__PURE__ */ new Set();
240
240
  for (const view of this.$model.views()) {
241
241
  if (view.includesElement(this.id)) {
@@ -250,7 +250,7 @@ class ElementModel {
250
250
  * It is possible that element is not included in the view.
251
251
  */
252
252
  scopedViews() {
253
- return memoizeProp(this, Symbol.for("scopedViews"), () => {
253
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("scopedViews"), () => {
254
254
  const views = /* @__PURE__ */ new Set();
255
255
  for (const vm of this.$model.views()) {
256
256
  if (vm.isScopedElementView() && vm.viewOf.id === this.id) {
@@ -469,7 +469,8 @@ class LikeC4DeploymentModel {
469
469
  * Returns a specific relationship by its ID.
470
470
  */
471
471
  relationship(id) {
472
- return nonNullable(this.#relations.get(getId(id)), `DeploymentRelationModel ${id} not found`);
472
+ const relationId = getId(id);
473
+ return nonNullable(this.#relations.get(relationId), `DeploymentRelationModel ${relationId} not found`);
473
474
  }
474
475
  findRelationship(id) {
475
476
  return this.#relations.get(id) ?? null;
@@ -1706,7 +1707,7 @@ class LikeC4Model {
1706
1707
  * If the project is not defined in the model, it returns a default project with the ID "default".
1707
1708
  */
1708
1709
  get project() {
1709
- return this.$data.project ?? memoizeProp(this, Symbol.for("project"), () => ({
1710
+ return this.$data.project ?? memoizeProp(this, /* @__PURE__ */ Symbol.for("project"), () => ({
1710
1711
  id: this.projectId
1711
1712
  }));
1712
1713
  }
@@ -1714,7 +1715,7 @@ class LikeC4Model {
1714
1715
  return this.$data.specification;
1715
1716
  }
1716
1717
  get globals() {
1717
- return memoizeProp(this, Symbol.for("globals"), () => ({
1718
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("globals"), () => ({
1718
1719
  predicates: {
1719
1720
  ...this.$data.globals?.predicates
1720
1721
  },
@@ -1,4 +1,4 @@
1
- import { E as ElementModel, e as DeploymentElementModel } from './core.BLG-ADpi.mjs';
1
+ import { E as ElementModel, e as DeploymentElementModel } from './core.DK3pdsTf.mjs';
2
2
  import { A as Any } from './core.BkSYCfRg.mjs';
3
3
  import { F as Fqn } from './core.CDdf8izT.mjs';
4
4
 
@@ -1,5 +1,5 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.Byj60hH6.mjs';
2
- import { E as ElementModel, R as RelationshipModel } from './core.BLG-ADpi.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.DezoCAzf.mjs';
2
+ import { E as ElementModel, R as RelationshipModel } from './core.DK3pdsTf.mjs';
3
3
  import { A as Any, U as Unknown, z as EdgeId } from './core.BkSYCfRg.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.Byj60hH6.mjs';
2
- import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.BLG-ADpi.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.DezoCAzf.mjs';
2
+ import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.DK3pdsTf.mjs';
3
3
  import { A as Any, z as EdgeId } from './core.BkSYCfRg.mjs';
4
4
  import { c as IteratorLike } from './core.DB0Ue5Wx.mjs';
5
5
 
@@ -1,37 +1,37 @@
1
- import { n as n$d, b as t$i, d as t$k, e as t$l, f as t$n, g as buildElementNotations, t as t$q } from './core.Qv7vZIwZ.mjs';
1
+ import { n as n$d, b as t$i, d as t$j, e as t$l, f as t$m, g as buildElementNotations, t as t$q } from './core.DSalPD6v.mjs';
2
2
  import { t as t$a, a as t$b } from './core.BsSXS-_R.mjs';
3
3
  import { t as t$e } from './core.CbT8JVYL.mjs';
4
- import { a as t$c, t as t$j, i as isElementModel, b as isNestedElementOfDeployedInstanceModel, c as isDeployedInstanceModel, d as isDeploymentNodeModel, e as isDeploymentElementModel, L as LikeC4Model } from './core.DU8pv3Q6.mjs';
5
- import { c as commonHead, t as t$f, o as objectHash, b as t$m, a as compareRelations, S as Stack } from './core.xeuDd__E.mjs';
4
+ import { a as t$c, t as t$k, i as isElementModel, b as isNestedElementOfDeployedInstanceModel, c as isDeployedInstanceModel, d as isDeploymentNodeModel, e as isDeploymentElementModel, L as LikeC4Model } from './core.DVfPJPJj.mjs';
5
+ import { c as commonHead, t as t$f, o as objectHash, b as t$n, a as compareRelations, S as Stack } from './core.xeuDd__E.mjs';
6
6
  import { a as nonNullable, i as invariant, n as nonexhaustive } from './core.D4npX2q8.mjs';
7
7
  import { G as Graph } from './core.CmGY9blO.mjs';
8
- import { r as requireIterables, e as exact, t as t$o } from './core.BK-tI3Q3.mjs';
8
+ import { r as requireIterables, e as exact, t as t$o } from './core.DEK-BO3_.mjs';
9
9
  import { b as requireIterator } from './core.CBLX4mT8.mjs';
10
10
  import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
11
11
  import { n as n$c, t as t$d } from './core.3ZhnKAlZ.mjs';
12
12
  import { e as e$4 } from './core.BKlholso.mjs';
13
13
  import { f as flattenMarkdownOrString, i as isGroupElementKind, G as GroupElementKind, e as stepEdgeId } from './core.D0WZutNd.mjs';
14
- import { b as isDescendantOf, f as sortParentsFirst, i as isAncestor, p as parentFqn, j as compareByFqnHierarchically, c as isNonEmptyArray, n as nameFromFqn, o as sortByFqnHierarchically, g as commonAncestor, a as ancestorsFqn, d as isSameHierarchy } from './core.CdNCAwq7.mjs';
14
+ import { b as isDescendantOf, f as sortParentsFirst, i as isAncestor, p as parentFqn, j as compareByFqnHierarchically, c as isNonEmptyArray, o as sortByFqnHierarchically, g as commonAncestor, a as ancestorsFqn, d as isSameHierarchy } from './core.CdNCAwq7.mjs';
15
15
  import { d as difference, i as intersection, u as union, h as hasIntersection } from './core.DbfO90vF.mjs';
16
- import { e as e$8 } from './core.Coi_LOUZ.mjs';
17
- import { w as whereOperatorAsPredicate, m as isViewRuleStyle, v as t$g, l as isViewRulePredicate, a as _type, _ as _stage, u as e$b, t as isDynamicView, s as isDeploymentView, p as isElementView } from './core.DH7TXqXf.mjs';
18
- import { n as n$e } from './core.BhNcrwzK.mjs';
16
+ import { e as e$9 } from './core.Coi_LOUZ.mjs';
17
+ import { w as whereOperatorAsPredicate, m as isViewRuleStyle, v as t$g, u as e$8, l as isViewRulePredicate, a as _type, _ as _stage, t as isDynamicView, s as isDeploymentView, p as isElementView } from './core.DH7TXqXf.mjs';
18
+ import { e as e$5, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.CRhT4Iio.mjs';
19
19
  import { e as e$6, a as iunique, i as iflat } from './core.C4x8aaWa.mjs';
20
- import { e as e$5, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.DbQpDoJS.mjs';
21
20
  import { e as e$7 } from './core.BoYfZOBm.mjs';
22
21
  import { ModelFqnExpr, ModelRelationExpr, ModelExpression } from '../types/expression-model.mjs';
23
22
  import { FqnRef } from '../types/fqnRef.mjs';
24
23
  import { preferSummary } from '../types/_aux.mjs';
25
24
  import { a as t$h } from './core.BspBF3SJ.mjs';
25
+ import { n as n$e } from './core.BhNcrwzK.mjs';
26
26
  import { FqnExpr, RelationExpr } from '../types/expression.mjs';
27
- import { f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, p as findConnection$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.CQPEY2wQ.mjs';
27
+ import { f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, p as findConnection$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.78IWAHAE.mjs';
28
28
  import { t as toSet, a as toArray, i as imap } from './core.C3JowhaZ.mjs';
29
29
  import { D as DefaultMap } from './core.BbE4y-yl.mjs';
30
30
  import { i as ifilter } from './core.DRJma0Ol.mjs';
31
- import { C as Connection, c as customInspectSymbol } from './core.DqlrMlsf.mjs';
31
+ import { C as Connection, c as customInspectSymbol } from './core.BFd1lU9R.mjs';
32
32
  import { i as isome } from './core.FZ305VYd.mjs';
33
- import { i as isIterable, e as e$9 } from './core.RfnaEmgA.mjs';
34
- import { k as e$a, c as isViewRuleAutoLayout, h as isViewRuleGroup, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, e as isDynamicStepsParallel, f as isDynamicStepsSeries, j as isViewRuleRank } from './core.om36dXXW.mjs';
33
+ import { i as isIterable, e as e$a } from './core.RfnaEmgA.mjs';
34
+ import { k as e$b, c as isViewRuleAutoLayout, h as isViewRuleGroup, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, e as isDynamicStepsParallel, f as isDynamicStepsSeries, j as isViewRuleRank } from './core.om36dXXW.mjs';
35
35
  import { t as t$p } from './core.q10OP9oJ.mjs';
36
36
 
37
37
  function e$3(e){return ()=>e}
@@ -1506,14 +1506,7 @@ function buildComputedNodes({ defaults }, elements, groups) {
1506
1506
  function pickRelationshipProps(relation) {
1507
1507
  const {
1508
1508
  title,
1509
- description = null,
1510
- technology = null,
1511
- kind = null,
1512
- color = null,
1513
- line = null,
1514
- head = null,
1515
- tail = null,
1516
- navigateTo = null
1509
+ description = null
1517
1510
  } = relation;
1518
1511
  return {
1519
1512
  // Pick description only if title is present
@@ -1521,13 +1514,7 @@ function pickRelationshipProps(relation) {
1521
1514
  title,
1522
1515
  description
1523
1516
  },
1524
- technology,
1525
- kind,
1526
- color,
1527
- line,
1528
- head,
1529
- tail,
1530
- navigateTo
1517
+ ...t$i(relation, ["color", "technology", "head", "line", "tail", "kind", "navigateTo"])
1531
1518
  };
1532
1519
  }
1533
1520
  function mergePropsFromRelationships(relations, prefer) {
@@ -1581,14 +1568,12 @@ function mergePropsFromRelationships(relations, prefer) {
1581
1568
  }
1582
1569
  )
1583
1570
  );
1584
- let technology = t$5(allprops.technology);
1585
- let title = t$5(allprops.title) ?? (allprops.title.length > 1 ? "[...]" : null);
1571
+ let title = t$5(allprops.title) ?? (allprops.title.length > 1 ? "[...]" : void 0);
1586
1572
  const tags = n$e(allprops.tags);
1587
1573
  let merged = exact({
1588
- // If there is no title, but there is technology, use technology as title
1589
- title: title ?? (technology ? `[${technology}]` : null),
1574
+ title,
1590
1575
  description: t$5(allprops.description),
1591
- technology,
1576
+ technology: t$5(allprops.technology),
1592
1577
  kind: t$5(allprops.kind),
1593
1578
  head: t$5(allprops.head),
1594
1579
  tail: t$5(allprops.tail),
@@ -1598,10 +1583,15 @@ function mergePropsFromRelationships(relations, prefer) {
1598
1583
  ...isNonEmptyArray(tags) && { tags }
1599
1584
  });
1600
1585
  if (prefer) {
1601
- return {
1586
+ const preferred = pickRelationshipProps(prefer);
1587
+ merged = t$3({
1602
1588
  ...merged,
1603
- ...t$3(pickRelationshipProps(prefer), e$4)
1604
- };
1589
+ ...preferred
1590
+ }, e$4);
1591
+ }
1592
+ if (e$8(merged.title) && e$4(merged.technology)) {
1593
+ merged.title = `[${merged.technology}]`;
1594
+ delete merged.technology;
1605
1595
  }
1606
1596
  return merged;
1607
1597
  }
@@ -1701,56 +1691,27 @@ function deploymentExpressionToPredicate(target) {
1701
1691
  function instanceSummary(model) {
1702
1692
  return preferSummary(model.$instance) ?? preferSummary(model.element.$element);
1703
1693
  }
1704
- function toNodeSource(el) {
1705
- if (el.isDeploymentNode()) {
1706
- const onlyOneInstance = el.onlyOneInstance();
1707
- let {
1708
- title,
1709
- id,
1710
- description: description2,
1711
- summary,
1712
- metadata: _metadata,
1713
- // omit
1714
- style: {
1715
- icon: icon2,
1716
- shape: shape2,
1717
- color: color2
1718
- },
1719
- element: _element,
1720
- // omit
1721
- tags: _tags,
1722
- // omit
1723
- ...$node
1724
- } = el.$node;
1725
- let tags = [...el.tags];
1726
- summary ??= description2;
1727
- if (onlyOneInstance) {
1728
- tags = n$e([...tags, ...onlyOneInstance.tags]);
1729
- if (title === nameFromFqn(el.id)) {
1730
- title = onlyOneInstance.title;
1731
- }
1732
- icon2 ??= onlyOneInstance.style.icon;
1733
- color2 ??= onlyOneInstance.style.color;
1734
- shape2 ??= onlyOneInstance.style.shape;
1735
- summary ??= instanceSummary(onlyOneInstance);
1736
- }
1737
- return exact({
1738
- id,
1739
- deploymentRef: id,
1740
- title,
1741
- ...$node,
1742
- color: color2 ?? el.color,
1743
- shape: shape2 ?? el.shape,
1744
- ...onlyOneInstance && {
1745
- modelRef: onlyOneInstance.element.id
1746
- },
1747
- icon: icon2,
1748
- description: summary,
1749
- tags,
1750
- style: n$6(el.style, ["icon", "shape", "color"])
1751
- });
1752
- }
1753
- invariant(el.isInstance(), "Expected Instance");
1694
+ function deploymentNodeToNodeSource(el) {
1695
+ const id = el.id;
1696
+ const onlyOneInstance = el.onlyOneInstance();
1697
+ return exact({
1698
+ id,
1699
+ deploymentRef: id,
1700
+ title: el.title,
1701
+ kind: el.kind,
1702
+ technology: el.technology ?? void 0,
1703
+ links: t$b(el.links, 1) ? [...el.links] : void 0,
1704
+ notation: el.$node.notation ?? void 0,
1705
+ color: el.color,
1706
+ shape: el.shape,
1707
+ modelRef: onlyOneInstance?.element.id,
1708
+ icon: el.style.icon,
1709
+ description: preferSummary(el.$node) ?? void 0,
1710
+ tags: [...el.tags],
1711
+ style: n$6(el.style, ["icon", "shape", "color"])
1712
+ });
1713
+ }
1714
+ function instanceToNodeSource(el) {
1754
1715
  const instance = el.$instance;
1755
1716
  const element = el.element;
1756
1717
  const { icon, color, shape, ...style } = el.style;
@@ -1758,15 +1719,12 @@ function toNodeSource(el) {
1758
1719
  ...element.links,
1759
1720
  ...instance.links ?? []
1760
1721
  ];
1761
- const notation = instance.notation ?? element.$element.notation;
1762
- const description = instanceSummary(el);
1763
- const technology = el.technology ?? void 0;
1764
1722
  return exact({
1765
1723
  id: el.id,
1766
1724
  kind: "instance",
1767
1725
  title: el.title,
1768
- description,
1769
- technology,
1726
+ description: instanceSummary(el) ?? void 0,
1727
+ technology: el.technology ?? void 0,
1770
1728
  tags: [...el.tags],
1771
1729
  links: t$b(links, 1) ? links : void 0,
1772
1730
  icon,
@@ -1775,9 +1733,15 @@ function toNodeSource(el) {
1775
1733
  style,
1776
1734
  deploymentRef: instance.id,
1777
1735
  modelRef: element.id,
1778
- notation
1736
+ notation: instance.notation
1779
1737
  });
1780
1738
  }
1739
+ function toNodeSource(el) {
1740
+ if (el.isInstance()) {
1741
+ return instanceToNodeSource(el);
1742
+ }
1743
+ return deploymentNodeToNodeSource(el);
1744
+ }
1781
1745
  function toComputedEdges$1(connections) {
1782
1746
  return connections.reduce((acc, e) => {
1783
1747
  const relations = [
@@ -1826,7 +1790,41 @@ function toComputedEdges$1(connections) {
1826
1790
  }, []);
1827
1791
  }
1828
1792
  function buildNodes$1(model, memory) {
1829
- return buildComputedNodes(model.$styles, [...memory.final].map(toNodeSource));
1793
+ const nodesMap = buildComputedNodes(model.$styles, [...memory.final].map(toNodeSource));
1794
+ for (const node of nodesMap.values()) {
1795
+ if (!node.deploymentRef || !node.modelRef || node.children.length > 0) {
1796
+ continue;
1797
+ }
1798
+ const deploymentNode = model.deployment.element(node.deploymentRef);
1799
+ const onlyOneInstance = deploymentNode.isDeploymentNode() && deploymentNode.onlyOneInstance();
1800
+ if (!onlyOneInstance) {
1801
+ continue;
1802
+ }
1803
+ if (node.title === deploymentNode.name) {
1804
+ node.title = onlyOneInstance.title;
1805
+ }
1806
+ node.description ??= instanceSummary(onlyOneInstance) ?? null;
1807
+ node.technology ??= onlyOneInstance.technology;
1808
+ if (e$5(node.tags)) {
1809
+ node.tags = [...onlyOneInstance.tags];
1810
+ }
1811
+ if ((!node.links || e$5(node.links)) && t$b(onlyOneInstance.links, 1)) {
1812
+ node.links = [...onlyOneInstance.links];
1813
+ }
1814
+ const defaults = model.$styles.defaults;
1815
+ if (node.shape === defaults.shape && node.shape !== onlyOneInstance.shape) {
1816
+ node.shape = onlyOneInstance.shape;
1817
+ node.notation = null;
1818
+ }
1819
+ if (node.color === defaults.color && node.color !== onlyOneInstance.color) {
1820
+ node.color = onlyOneInstance.color;
1821
+ node.notation = null;
1822
+ }
1823
+ if (!node.icon && onlyOneInstance.icon) {
1824
+ node.icon = onlyOneInstance.icon;
1825
+ }
1826
+ }
1827
+ return nodesMap;
1830
1828
  }
1831
1829
  function applyDeploymentViewRuleStyles(rules, nodes) {
1832
1830
  for (const rule of rules) {
@@ -1857,17 +1855,17 @@ function findCrossBoundarySameSourceOrTarget(connections) {
1857
1855
  }
1858
1856
  t$d(
1859
1857
  sameRelationGroup,
1860
- t$l((conn) => [
1858
+ t$m((conn) => [
1861
1859
  { group: `$source-${conn.source.id}`, conn },
1862
1860
  { group: `$target-${conn.target.id}`, conn }
1863
1861
  ]),
1864
- t$k(e$8("group")),
1865
- t$j(),
1862
+ t$l(e$9("group")),
1863
+ t$k(),
1866
1864
  n$d(t$b(2)),
1867
1865
  t$7(
1868
1866
  // In each group, sort by hierarchy, first are deepest
1869
- t$i(
1870
- t$e(e$8("conn")),
1867
+ t$j(
1868
+ t$e(e$9("conn")),
1871
1869
  sortConnectionsByBoundaryHierarchy("desc"),
1872
1870
  // Drop first, as it is the deepest
1873
1871
  // Drop if boundary is same as previous
@@ -2029,7 +2027,7 @@ let StageInclude$1 = class StageInclude extends AbstractStageInclude {
2029
2027
  // filter(c => this._connections.some(c2 => c2.id === c.id)),
2030
2028
  t$7(({ source, target, boundary }) => {
2031
2029
  t$d(
2032
- t$m(
2030
+ t$n(
2033
2031
  [...toArray(source.ancestors()).reverse(), source],
2034
2032
  [...toArray(target.ancestors()).reverse(), target]
2035
2033
  ),
@@ -2290,7 +2288,7 @@ const DirectRelationPredicate = {
2290
2288
  }
2291
2289
  connections = t$d(
2292
2290
  sources,
2293
- t$l((source2) => {
2291
+ t$m((source2) => {
2294
2292
  const targets = resolveAscendingSiblings(source2);
2295
2293
  return findConnectionsBetween$2(source2, targets, dir);
2296
2294
  }),
@@ -2310,7 +2308,7 @@ const DirectRelationPredicate = {
2310
2308
  }
2311
2309
  connections = t$d(
2312
2310
  targets,
2313
- t$l((target2) => {
2311
+ t$m((target2) => {
2314
2312
  const sources = resolveAscendingSiblings(target2);
2315
2313
  return [...sources].flatMap((source2) => findConnection$2(source2, target2, dir));
2316
2314
  }),
@@ -2328,17 +2326,17 @@ const DirectRelationPredicate = {
2328
2326
  const isTarget = filterIncomingConnections(targets);
2329
2327
  connections = t$d(
2330
2328
  sources,
2331
- t$l((s) => findConnectionsBetween$2(s, targets, dir)),
2329
+ t$m((s) => findConnectionsBetween$2(s, targets, dir)),
2332
2330
  n$d((c) => isSource(c) && isTarget(c)),
2333
2331
  applyPredicate(where)
2334
2332
  );
2335
2333
  }
2336
2334
  }
2337
2335
  stage.addConnections(connections);
2338
- if (FqnExpr.isDeploymentRef(source) && e$9(source.selector)) {
2336
+ if (FqnExpr.isDeploymentRef(source) && e$a(source.selector)) {
2339
2337
  stage.addImplicit(model.element(source.ref.deployment));
2340
2338
  }
2341
- if (FqnExpr.isDeploymentRef(target) && e$9(target.selector)) {
2339
+ if (FqnExpr.isDeploymentRef(target) && e$a(target.selector)) {
2342
2340
  stage.addImplicit(model.element(target.ref.deployment));
2343
2341
  }
2344
2342
  return stage;
@@ -2573,7 +2571,7 @@ function applyPredicate(...args) {
2573
2571
  if (where === null) {
2574
2572
  return c;
2575
2573
  }
2576
- if (e$a(c)) {
2574
+ if (e$b(c)) {
2577
2575
  return c.map((x) => applyPredicate(x, where)).filter((x) => x.nonEmpty());
2578
2576
  }
2579
2577
  return c.update({
@@ -2586,7 +2584,7 @@ function applyElementPredicate(...args) {
2586
2584
  return (x) => applyElementPredicate(x, args[0]);
2587
2585
  }
2588
2586
  const [c, where] = args;
2589
- if (e$a(c)) {
2587
+ if (e$b(c)) {
2590
2588
  return c.filter((x) => applyElementPredicate(x, where));
2591
2589
  }
2592
2590
  return where?.(toFilterable(c, c)) ?? true;
@@ -2609,7 +2607,7 @@ function toFilterable(relationEndpoint, connectionEndpoint) {
2609
2607
  };
2610
2608
  }
2611
2609
  if (isNestedElementOfDeployedInstanceModel(relationEndpoint)) {
2612
- return t$n(relationEndpoint.element, ["tags", "kind"]);
2610
+ return t$i(relationEndpoint.element, ["tags", "kind"]);
2613
2611
  }
2614
2612
  if (isDeployedInstanceModel(relationEndpoint)) {
2615
2613
  return {
@@ -2618,7 +2616,7 @@ function toFilterable(relationEndpoint, connectionEndpoint) {
2618
2616
  };
2619
2617
  }
2620
2618
  if (isDeploymentNodeModel(relationEndpoint)) {
2621
- return t$n(relationEndpoint, ["tags", "kind"]);
2619
+ return t$i(relationEndpoint, ["tags", "kind"]);
2622
2620
  }
2623
2621
  nonexhaustive(relationEndpoint);
2624
2622
  }
@@ -3002,7 +3000,7 @@ function applyCustomElementProperties(_rules, _nodes) {
3002
3000
  textSize,
3003
3001
  description,
3004
3002
  ...rest
3005
- } = t$o(props, e$b);
3003
+ } = t$o(props, e$8);
3006
3004
  const style = exact({
3007
3005
  border,
3008
3006
  opacity,
@@ -3052,14 +3050,14 @@ function resolveGlobalRulesInElementView(rules, globals) {
3052
3050
  return rules.reduce((acc, rule) => {
3053
3051
  if (isViewRuleGlobalPredicateRef(rule)) {
3054
3052
  const globalPredicates = globals.predicates[rule.predicateId];
3055
- if (e$b(globalPredicates)) {
3053
+ if (e$8(globalPredicates)) {
3056
3054
  return acc;
3057
3055
  }
3058
3056
  return acc.concat(globalPredicates);
3059
3057
  }
3060
3058
  if (isViewRuleGlobalStyle(rule)) {
3061
3059
  const globalStyles = globals.styles[rule.styleId];
3062
- if (e$b(globalStyles)) {
3060
+ if (e$8(globalStyles)) {
3063
3061
  return acc;
3064
3062
  }
3065
3063
  return acc.concat(globalStyles);
@@ -3072,14 +3070,14 @@ function resolveGlobalRulesInDynamicView(rules, globals) {
3072
3070
  return rules.reduce((acc, rule) => {
3073
3071
  if (isViewRuleGlobalPredicateRef(rule)) {
3074
3072
  const globalPredicates = globals.dynamicPredicates[rule.predicateId];
3075
- if (e$b(globalPredicates)) {
3073
+ if (e$8(globalPredicates)) {
3076
3074
  return acc;
3077
3075
  }
3078
3076
  return acc.concat(globalPredicates);
3079
3077
  }
3080
3078
  if (isViewRuleGlobalStyle(rule)) {
3081
3079
  const globalStyles = globals.styles[rule.styleId];
3082
- if (e$b(globalStyles)) {
3080
+ if (e$8(globalStyles)) {
3083
3081
  return acc;
3084
3082
  }
3085
3083
  return acc.concat(globalStyles);
@@ -3141,7 +3139,7 @@ function elementsFromSteps(model, steps) {
3141
3139
  actors.push(target);
3142
3140
  }
3143
3141
  };
3144
- for (const step of t$l(steps, flattenSteps)) {
3142
+ for (const step of t$m(steps, flattenSteps)) {
3145
3143
  const source = model.element(step.source);
3146
3144
  const target = model.element(step.target);
3147
3145
  let sourceColumn = actors.indexOf(source);
@@ -3176,7 +3174,7 @@ function findRelations(source, target, currentViewId) {
3176
3174
  }
3177
3175
  const alltags = t$d(
3178
3176
  relationships,
3179
- t$l((r) => r.tags),
3177
+ t$m((r) => r.tags),
3180
3178
  n$e()
3181
3179
  );
3182
3180
  const tags = t$b(alltags, 1) ? alltags : void 0;
@@ -3189,7 +3187,7 @@ function findRelations(source, target, currentViewId) {
3189
3187
  if (!navigateTo) {
3190
3188
  navigateTo = t$d(
3191
3189
  relationships,
3192
- t$l(
3190
+ t$m(
3193
3191
  (r) => r.$relationship.navigateTo && r.$relationship.navigateTo !== currentViewId ? r.$relationship.navigateTo : []
3194
3192
  ),
3195
3193
  n$e(),
@@ -3461,7 +3459,7 @@ function applyCustomRelationProperties(_rules, nodes, _edges) {
3461
3459
  } of rules) {
3462
3460
  const description = _description ? { description: { txt: _description } } : {};
3463
3461
  const notes = _notes ? { notes: { txt: _notes } } : {};
3464
- const props = t$o(customprops, e$b);
3462
+ const props = t$o(customprops, e$8);
3465
3463
  const satisfies = relationExpressionToPredicates(expr);
3466
3464
  edges.forEach((edge, i) => {
3467
3465
  let source, target;
@@ -3479,7 +3477,7 @@ function applyCustomRelationProperties(_rules, nodes, _edges) {
3479
3477
  if (!source || !target) {
3480
3478
  return;
3481
3479
  }
3482
- if (satisfies({ source, target, ...t$n(edge, ["kind", "tags"]) })) {
3480
+ if (satisfies({ source, target, ...t$i(edge, ["kind", "tags"]) })) {
3483
3481
  edges[i] = {
3484
3482
  ...edge,
3485
3483
  ...props,
@@ -3622,7 +3620,7 @@ class StageInclude extends AbstractStageInclude {
3622
3620
  connections,
3623
3621
  t$7(({ source, target, boundary }) => {
3624
3622
  t$d(
3625
- t$m(
3623
+ t$n(
3626
3624
  [...toArray(source.ancestors()).reverse(), source],
3627
3625
  [...toArray(target.ancestors()).reverse(), target]
3628
3626
  ),
@@ -3787,7 +3785,7 @@ function findRedundantConnections(connections) {
3787
3785
  t$2((reducedConnections, connection, _, all) => {
3788
3786
  const descendants = findDescendantConnections(all, connection);
3789
3787
  const nestedRelations = union(
3790
- ...descendants.map(e$8("relations"))
3788
+ ...descendants.map(e$9("relations"))
3791
3789
  );
3792
3790
  let accum = intersection(connection.relations, nestedRelations);
3793
3791
  if (descendants.length > 0) {
@@ -4121,7 +4119,7 @@ const DirectRelationExprPredicate = {
4121
4119
  const sources = resolveElements(model, source);
4122
4120
  const connections2 = t$d(
4123
4121
  sources,
4124
- t$l(
4122
+ t$m(
4125
4123
  (source2) => t$d(
4126
4124
  source2,
4127
4125
  e(e$3(isBidirectional === true), {
@@ -4179,7 +4177,7 @@ const DirectRelationExprPredicate = {
4179
4177
  const targets = resolveElements(model, target);
4180
4178
  const connections2 = t$d(
4181
4179
  targets,
4182
- t$l(
4180
+ t$m(
4183
4181
  (target2) => t$d(
4184
4182
  target2,
4185
4183
  e(e$3(isBidirectional === true), {
@@ -4257,8 +4255,8 @@ const DirectRelationExprPredicate = {
4257
4255
  case (sourceIsWildcard && targetIsWildcard): {
4258
4256
  relations = t$d(
4259
4257
  memory.connections,
4260
- t$l(t$i(
4261
- e$8("relations"),
4258
+ t$m(t$j(
4259
+ e$9("relations"),
4262
4260
  ifilter(where),
4263
4261
  toArray()
4264
4262
  )),
@@ -4271,7 +4269,7 @@ const DirectRelationExprPredicate = {
4271
4269
  const sources = resolveElements(model, source);
4272
4270
  relations = t$d(
4273
4271
  sources,
4274
- t$l(
4272
+ t$m(
4275
4273
  (source2) => t$d(
4276
4274
  source2,
4277
4275
  e(e$3(isBidirectional === true), {
@@ -4291,7 +4289,7 @@ const DirectRelationExprPredicate = {
4291
4289
  const targets = resolveElements(model, target);
4292
4290
  relations = t$d(
4293
4291
  targets,
4294
- t$l(
4292
+ t$m(
4295
4293
  (target2) => t$d(
4296
4294
  target2,
4297
4295
  e(e$3(isBidirectional === true), {
@@ -1,4 +1,4 @@
1
- export { R as RichText, e as exact } from '../shared/core.BK-tI3Q3.mjs';
1
+ export { R as RichText, e as exact } from '../shared/core.DEK-BO3_.mjs';
2
2
  export { preferDescription, preferSummary } from './_aux.mjs';
3
3
  export { b as _layout, _ as _stage, a as _type, j as isAndOperator, n as isComputedView, d as isDeployedInstance, c as isDeploymentNode, s as isDeploymentView, o as isDiagramView, t as isDynamicView, p as isElementView, r as isExtendsElementView, f as isKindEqual, o as isLayoutedView, h as isNotOperator, i as isOnStage, k as isOrOperator, g as isParticipantOperator, q as isScopedElementView, e as isTagEqual, l as isViewRulePredicate, m as isViewRuleStyle, w as whereOperatorAsPredicate } from '../shared/core.DH7TXqXf.mjs';
4
4
  export { Expression, FqnExpr, RelationExpr } from './expression.mjs';