@likec4/core 1.34.2 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +1 -1
  2. package/dist/builder/index.d.mts +15 -4
  3. package/dist/builder/index.mjs +19 -15
  4. package/dist/compute-view/index.d.mts +3 -3
  5. package/dist/compute-view/index.mjs +16 -13
  6. package/dist/compute-view/relationships-view/index.d.mts +3 -3
  7. package/dist/compute-view/relationships-view/index.mjs +2 -2
  8. package/dist/index.d.mts +3 -3
  9. package/dist/index.mjs +14 -9
  10. package/dist/model/connection/deployment/index.d.mts +5 -5
  11. package/dist/model/connection/deployment/index.mjs +5 -4
  12. package/dist/model/connection/index.d.mts +6 -6
  13. package/dist/model/connection/index.mjs +6 -5
  14. package/dist/model/connection/model/index.d.mts +5 -5
  15. package/dist/model/connection/model/index.mjs +3 -3
  16. package/dist/model/index.d.mts +33 -9
  17. package/dist/model/index.mjs +12 -10
  18. package/dist/shared/{core.DAj3LuFH.d.mts → core.BFb3p5d-.d.mts} +4 -2
  19. package/dist/shared/{core.PqNe5WxQ.mjs → core.BlwZ4tBa.mjs} +98 -92
  20. package/dist/shared/core.BpJu1RrF.mjs +5 -0
  21. package/dist/shared/{core.CJSFKrYf.d.mts → core.Bt3kuGUN.d.mts} +3 -3
  22. package/dist/shared/{core.D5qVzkws.mjs → core.Bus32P0S.mjs} +4 -3
  23. package/dist/shared/{core.4SpVCM9m.mjs → core.BvIGRozf.mjs} +364 -28
  24. package/dist/shared/{core.C80Z37Eu.mjs → core.C1GV0WWV.mjs} +1 -1
  25. package/dist/shared/{core.DXRAwwDB.mjs → core.CaJp8Amg.mjs} +3 -2
  26. package/dist/shared/{core.D56nCp7e.mjs → core.CaaYNQDM.mjs} +1 -3
  27. package/dist/shared/core.CnIyafWn.mjs +3 -0
  28. package/dist/shared/{core.D3xEWj5B.d.mts → core.D8bTI5KC.d.mts} +2 -2
  29. package/dist/shared/{core.Di7__sMg.d.mts → core.DHYd2-VU.d.mts} +3 -3
  30. package/dist/shared/{core.C_C-3c1S.mjs → core.DQj9iv_y.mjs} +3 -5
  31. package/dist/shared/{core.DrS4Bf4y.d.mts → core.DoNP3Yl-.d.mts} +187 -11
  32. package/dist/shared/{core.IWLie-Ma.d.mts → core.DxDn5nB5.d.mts} +24 -6
  33. package/dist/shared/{core.CtKXPqN_.mjs → core.HUONfQfd.mjs} +1 -1
  34. package/dist/shared/{core.BTnf14gD.mjs → core.Y3j3s-oq.mjs} +2 -2
  35. package/dist/shared/{core.Br7Fab9l.mjs → core._jnYNUQ-.mjs} +8 -70
  36. package/dist/shared/{core.XptQjhMA.mjs → core.b2BzqGz0.mjs} +2 -2
  37. package/dist/shared/{core.BMCb0wJI.mjs → core.yaRvRnMW.mjs} +1 -1
  38. package/dist/theme/index.mjs +34 -3510
  39. package/dist/types/_aux.d.mts +1 -1
  40. package/dist/types/index.d.mts +3 -3
  41. package/dist/types/index.mjs +6 -4
  42. package/dist/types/scalar.d.mts +2 -0
  43. package/dist/types/scalar.mjs +68 -0
  44. package/dist/utils/index.d.mts +6 -8
  45. package/dist/utils/index.mjs +5 -5
  46. package/dist/utils/iterable/index.d.mts +18 -1
  47. package/dist/utils/iterable/index.mjs +22 -2
  48. package/package.json +11 -16
  49. package/src/builder/Builder.ts +17 -6
  50. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +9 -0
  51. package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +3 -0
  52. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +3 -0
  53. package/src/builder/_types.ts +10 -0
  54. package/src/compute-view/dynamic-view/compute.ts +2 -0
  55. package/src/compute-view/element-view/__test__/fixture.ts +1 -0
  56. package/src/compute-view/element-view/predicates/relation-direct.ts +8 -2
  57. package/src/compute-view/utils/applyCustomRelationProperties.ts +2 -0
  58. package/src/model/DeploymentModel.ts +1 -1
  59. package/src/model/LikeC4Model.ts +162 -13
  60. package/src/model/index.ts +8 -0
  61. package/src/model/types.ts +1 -8
  62. package/src/model/utils.ts +66 -0
  63. package/src/model/view/LikeC4ViewModel.ts +62 -7
  64. package/src/model/view/LikeC4ViewsFolder.ts +151 -0
  65. package/src/theme/__test__/theme-index.ts +29 -0
  66. package/src/theme/element.ts +0 -19
  67. package/src/theme/index.ts +49 -3
  68. package/src/types/_aux.ts +6 -0
  69. package/src/types/index.ts +1 -0
  70. package/src/types/model-data.ts +2 -0
  71. package/src/types/model-dump.ts +8 -1
  72. package/src/types/model-spec.ts +4 -0
  73. package/src/types/project.ts +9 -0
  74. package/src/types/view-computed.ts +1 -1
  75. package/src/types/view-parsed.dynamic.ts +2 -2
  76. package/src/utils/compare-natural.ts +14 -12
  77. package/src/utils/index.ts +1 -0
  78. package/src/utils/iterable/first.ts +48 -0
  79. package/src/utils/iterable/index.ts +1 -0
@@ -1,66 +1,65 @@
1
- import { n as a$4, t as t$3, r as r$3, j as isElementModel, f as isNestedElementOfDeployedInstanceModel, d as isDeployedInstanceModel, i as isDeploymentNodeModel, e as isDeploymentElementModel, L as LikeC4Model } from './core.4SpVCM9m.mjs';
2
- import { u as u$6 } from './core.DbRvwARP.mjs';
1
+ import { s as a$2, t as t$3, u as a$3, r as r$3, m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.BvIGRozf.mjs';
2
+ import { u as u$5 } from './core.DbRvwARP.mjs';
3
3
  import { m as m$2 } from './core.ByrmCl9I.mjs';
4
- import { i as i$a, t as t$4, n as n$3, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.D5qVzkws.mjs';
5
- import { p as p$1, f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.BTnf14gD.mjs';
6
- import { u as a$3, C, t as s, r as getDefaultExportFromCjs, j as isDescendantOf, m as sortParentsFirst, i as isAncestor, p as parentFqn, e as compareByFqnHierarchically, o as isNonEmptyArray, n as nameFromFqn, s as sortByFqnHierarchically, d as commonAncestor, b as ancestorsFqn, k as isSameHierarchy } from './core.C_C-3c1S.mjs';
7
- import { c as commonHead, r as requireForeach, a as requireIterator, u as u$7, o as objectHash, d as d$5, S as Stack } from './core.CtKXPqN_.mjs';
4
+ import { i as i$a, t as t$4, n as n$2, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.Bus32P0S.mjs';
5
+ import { p as p$1, f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.Y3j3s-oq.mjs';
6
+ import { u as a$1, C, t as s, r as getDefaultExportFromCjs, j as isDescendantOf, m as sortParentsFirst, i as isAncestor, p as parentFqn, e as compareByFqnHierarchically, o as isNonEmptyArray, n as nameFromFqn, s as sortByFqnHierarchically, d as commonAncestor, b as ancestorsFqn, k as isSameHierarchy } from './core.DQj9iv_y.mjs';
7
+ import { c as commonHead, r as requireForeach, a as requireIterator, u as u$6, o as objectHash, d as d$5, S as Stack } from './core.HUONfQfd.mjs';
8
8
  import { a as nonNullable, i as invariant, n as nonexhaustive } from './core.D4npX2q8.mjs';
9
- import { n as n$1, a as DefaultElementShape, D as DefaultThemeColor, f as DefaultArrowType, e as DefaultLineStyle, g as DefaultRelationshipColor } from './core.D56nCp7e.mjs';
9
+ import { n } from './core.CnIyafWn.mjs';
10
10
  import { d as difference, a as intersection, u as union, i as i$b, h as hasIntersection } from './core.CpwrZi3D.mjs';
11
- import { a as isIterable, n as n$2, l as l$6, b as iunique, i as iflat } from './core.8KM0D6va.mjs';
11
+ import { a as isIterable, n as n$1, l as l$5, b as iunique, i as iflat } from './core.8KM0D6va.mjs';
12
12
  import { o as o$7 } from './core.BgvIuGGU.mjs';
13
- import { w as whereOperatorAsPredicate, F as FqnRef, y, m as isGroupElementKind, G as GroupElementKind, a as _type, _ as _stage, t as n$4, p as stepEdgeId } from './core.Br7Fab9l.mjs';
14
- import { M as ModelFqnExpr, c as isViewRuleStyle, F as FqnExpr, R as RelationExpr, s as o$8, i as isViewRulePredicate, o as isViewRuleAutoLayout, r as isViewRuleGroup, m as isViewRuleGlobalPredicateRef, l as isViewRuleGlobalStyle, q as isDynamicViewParallelSteps, a as ModelRelationExpr, b as ModelExpression, k as isDynamicView, j as isDeploymentView, f as isElementView } from './core.DXRAwwDB.mjs';
13
+ import { w as whereOperatorAsPredicate, F as FqnRef, y, a as _type, _ as _stage, n as n$3 } from './core._jnYNUQ-.mjs';
14
+ import { M as ModelFqnExpr, c as isViewRuleStyle, F as FqnExpr, R as RelationExpr, s as o$8, i as isViewRulePredicate, o as isViewRuleAutoLayout, r as isViewRuleGroup, m as isViewRuleGlobalPredicateRef, l as isViewRuleGlobalStyle, q as isDynamicViewParallelSteps, a as ModelRelationExpr, b as ModelExpression, k as isDynamicView, j as isDeploymentView, f as isElementView } from './core.CaJp8Amg.mjs';
15
+ import { isGroupElementKind, GroupElementKind, stepEdgeId } from '../types/scalar.mjs';
16
+ import { a as DefaultElementShape, D as DefaultThemeColor, f as DefaultArrowType, e as DefaultLineStyle, g as DefaultRelationshipColor } from './core.CaaYNQDM.mjs';
17
+ import { k } from './core.BpJu1RrF.mjs';
15
18
  import { a as toSet, t as toArray, i as imap } from './core.Btl47GOn.mjs';
16
- import { D as DefaultMap } from './core.BMCb0wJI.mjs';
19
+ import { D as DefaultMap } from './core.yaRvRnMW.mjs';
17
20
  import { i as ifilter } from './core.BH9nN-_I.mjs';
18
- import { C as Connection, c as customInspectSymbol } from './core.C80Z37Eu.mjs';
21
+ import { C as Connection, c as customInspectSymbol } from './core.C1GV0WWV.mjs';
19
22
  import { i as isome } from './core.BoyJPEen.mjs';
20
23
 
21
24
  function d$4(...e){return e.length===2?(n,...r)=>t$2(n,...e,...r):t$2(...e)}var t$2=(e,n,r,...a)=>n(e,...a)?typeof r=="function"?r(e,...a):r.onTrue(e,...a):typeof r=="function"?e:r.onFalse(e,...a);
22
25
 
23
- function l$5(...r){return u$6(o$6,r,u$5)}var o$6=(r,e)=>e<0?[]:r.slice(0,e);function u$5(r){if(r<=0)return a$3;let e=r;return a=>(e-=1,{done:e<=0,hasNext:true,next:a})}
26
+ function l$4(...r){return u$5(o$6,r,u$4)}var o$6=(r,e)=>e<0?[]:r.slice(0,e);function u$4(r){if(r<=0)return a$1;let e=r;return a=>(e-=1,{done:e<=0,hasNext:true,next:a})}
24
27
 
25
- function l$4(...e){return u$6(u$4,e)}var u$4=(e,a,n)=>e.reduce(a,n);
28
+ function l$3(...e){return u$5(u$3,e)}var u$3=(e,a,n)=>e.reduce(a,n);
26
29
 
27
- function t$1(...e){return u$6(r$2,e)}function r$2(e){return [...e].reverse()}
30
+ function t$1(...e){return u$5(r$2,e)}function r$2(e){return [...e].reverse()}
28
31
 
29
- function d$3(...r){return u$6(i$9,r)}var i$9=(r,t)=>{let a=[[],[]];for(let[o,e]of r.entries())t(e,o,r)?a[0].push(e):a[1].push(e);return a};
32
+ function d$3(...r){return u$5(i$9,r)}var i$9=(r,t)=>{let a=[[],[]];for(let[o,e]of r.entries())t(e,o,r)?a[0].push(e):a[1].push(e);return a};
30
33
 
31
- function i$8(...e){return u$6(o$5,e)}function o$5(e,n){let t={};for(let r of n)r in e&&(t[r]=e[r]);return t}
34
+ function i$8(...e){return u$5(o$5,e)}function o$5(e,n){let t={};for(let r of n)r in e&&(t[r]=e[r]);return t}
32
35
 
33
- function d$2(...e){return u$6(i$7,e)}function i$7(e,o){let t={};for(let[r,n]of Object.entries(e))o(n,r,e)&&(t[r]=n);return t}
36
+ function d$2(...e){return u$5(i$7,e)}function i$7(e,o){let t={};for(let[r,n]of Object.entries(e))o(n,r,e)&&(t[r]=n);return t}
34
37
 
35
38
  function i$6(...n){return o=>C(o,...n)}
36
39
 
37
- function d$1(...e){return u$6(l$3,e)}function l$3(e,a){let t={...e};for(let[n,o]of Object.entries(t))a(o,n,e)&&delete t[n];return t}
40
+ function d$1(...e){return u$5(l$2,e)}function l$2(e,a){let t={...e};for(let[n,o]of Object.entries(t))a(o,n,e)&&delete t[n];return t}
38
41
 
39
- function l$2(...n){return u$6(d,n)}function d(n,o){let e={};for(let[a,t]of n.entries()){let[y,u]=o(t,a,n);e[y]=u;}return e}
42
+ function l$1(...n){return u$5(d,n)}function d(n,o){let e={};for(let[a,t]of n.entries()){let[y,u]=o(t,a,n);e[y]=u;}return e}
40
43
 
41
- function i$5(...e){return u$6(o$4,e)}function o$4(e,r){let a={};for(let[n,u]of Object.entries(e)){let l=r(u,n,e);a[n]=l;}return a}
42
-
43
- function a$2(...e){return u$6(n,e)}var n=e=>e.at(-1);
44
+ function i$5(...e){return u$5(o$4,e)}function o$4(e,r){let a={};for(let[n,u]of Object.entries(e)){let l=r(u,n,e);a[n]=l;}return a}
44
45
 
45
46
  function e(o){return typeof o=="boolean"}
46
47
 
47
- function i$4(...e){return u$6(p,e)}var p=(e,d)=>{let r=Object.create(null);for(let n=0;n<e.length;n++){let t=e[n],y=d(t,n,e);if(y!==void 0){let o=r[y];o===void 0?r[y]=[t]:o.push(t);}}return Object.setPrototypeOf(r,Object.prototype),r};
48
-
49
- function k(...n){return u$6(u$3,n)}function u$3(n,e){if(n===e||Object.is(n,e))return true;if(typeof n!="object"||typeof e!="object"||n===null||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e))return false;if(Array.isArray(n))return l$1(n,e);if(n instanceof Map)return a$1(n,e);if(n instanceof Set)return c(n,e);if(n instanceof Date)return n.getTime()===e.getTime();if(n instanceof RegExp)return n.toString()===e.toString();if(Object.keys(n).length!==Object.keys(e).length)return false;for(let[r,t]of Object.entries(n))if(!(r in e)||!u$3(t,e[r]))return false;return true}function l$1(n,e){if(n.length!==e.length)return false;for(let[r,t]of n.entries())if(!u$3(t,e[r]))return false;return true}function a$1(n,e){if(n.size!==e.size)return false;for(let[r,t]of n.entries())if(!e.has(r)||!u$3(t,e.get(r)))return false;return true}function c(n,e){if(n.size!==e.size)return false;let r=[...e];for(let t of n){let o=false;for(let[s,f]of r.entries())if(u$3(t,f)){o=true,r.splice(s,1);break}if(!o)return false}return true}
48
+ function i$4(...e){return u$5(p,e)}var p=(e,d)=>{let r=Object.create(null);for(let n=0;n<e.length;n++){let t=e[n],y=d(t,n,e);if(y!==void 0){let o=r[y];o===void 0?r[y]=[t]:o.push(t);}}return Object.setPrototypeOf(r,Object.prototype),r};
50
49
 
51
- function u$2(...e){return u$6(i$3,e)}function i$3(e,a){let r={};for(let[o,n]of e.entries()){let d=a(n,o,e);r[d]=n;}return r}
50
+ function u$2(...e){return u$5(i$3,e)}function i$3(e,a){let r={};for(let[o,n]of e.entries()){let d=a(n,o,e);r[d]=n;}return r}
52
51
 
53
- function u$1(...a){return u$6(o$3,a,l)}var o$3=(a,r)=>a.flatMap(r),l=a=>(r,t,y)=>{let n=a(r,t,y);return Array.isArray(n)?{done:false,hasNext:true,hasMany:true,next:n}:{done:false,hasNext:true,next:n}};
52
+ function u$1(...a){return u$5(o$3,a,l)}var o$3=(a,r)=>a.flatMap(r),l=a=>(r,t,y)=>{let n=a(r,t,y);return Array.isArray(n)?{done:false,hasNext:true,hasMany:true,next:n}:{done:false,hasNext:true,next:n}};
54
53
 
55
- function u(...e){return u$6(o$2,e,i$2)}function o$2(e,a){return e.forEach(a),e}var i$2=e=>(a,n,t)=>(e(a,n,t),{done:false,hasNext:true,next:a});
54
+ function u(...e){return u$5(o$2,e,i$2)}function o$2(e,a){return e.forEach(a),e}var i$2=e=>(a,n,t)=>(e(a,n,t),{done:false,hasNext:true,next:a});
56
55
 
57
- function m$1(...e){return u$6(o$1,e,i$1)}var o$1=(e,n)=>e.filter(n),i$1=e=>(n,a,d)=>e(n,a,d)?{done:false,hasNext:true,next:n}:s;
56
+ function m$1(...e){return u$5(o$1,e,i$1)}var o$1=(e,n)=>e.filter(n),i$1=e=>(n,a,d)=>e(n,a,d)?{done:false,hasNext:true,next:n}:s;
58
57
 
59
- function o(...e){return u$6(t,e)}var t=(e,r)=>{for(let n=e.length-1;n>=0;n--){let a=e[n];if(r(a,n,e))return a}};
58
+ function o(...e){return u$5(t,e)}var t=(e,r)=>{for(let n=e.length-1;n>=0;n--){let a=e[n];if(r(a,n,e))return a}};
60
59
 
61
- function m(...e){return u$6(i,e)}function i(e,t){for(let[n,o]of e.entries())if(!t(o,n,e))return e.slice(n);return []}
60
+ function m(...e){return u$5(i,e)}function i(e,t){for(let[n,o]of e.entries())if(!t(o,n,e))return e.slice(n);return []}
62
61
 
63
- function a(...e){return u$6(r$1,e)}var r$1=(e,t)=>[...e,...t];
62
+ function a(...e){return u$5(r$1,e)}var r$1=(e,t)=>[...e,...t];
64
63
 
65
64
  function r(n){return ()=>n}
66
65
 
@@ -106,7 +105,7 @@ function buildElementNotations(nodes) {
106
105
  kinds
107
106
  }))
108
107
  ),
109
- a$4(
108
+ a$2(
110
109
  p$1("shape"),
111
110
  p$1("title"),
112
111
  [
@@ -139,7 +138,7 @@ function linkNodesWithEdges(nodesMap, edges) {
139
138
  const sourceAncestors = ancestorsOfNode(source, nodesMap);
140
139
  const targetAncestors = ancestorsOfNode(target, nodesMap);
141
140
  const hasAncestors = sourceAncestors.length > 0 && targetAncestors.length > 0;
142
- const edgeParent = hasAncestors ? a$2(
141
+ const edgeParent = hasAncestors ? a$3(
143
142
  commonHead(
144
143
  t$1(sourceAncestors),
145
144
  t$1(targetAncestors)
@@ -1202,7 +1201,7 @@ function topologicalSort(param) {
1202
1201
  if (target.parent && target.parent !== edge.parent) {
1203
1202
  C(
1204
1203
  ancestorsOfNode(target, param.nodes),
1205
- u$7((ancestor) => ancestor.inEdges.includes(edge.id)),
1204
+ u$6((ancestor) => ancestor.inEdges.includes(edge.id)),
1206
1205
  u((ancestor) => {
1207
1206
  g.mergeNode(ancestor.id);
1208
1207
  if (!willCreateCycle(g, edge.source, ancestor.id)) {
@@ -1268,19 +1267,19 @@ function calcViewLayoutHash(view) {
1268
1267
  autoLayout: view.autoLayout,
1269
1268
  nodes: C(
1270
1269
  view.nodes,
1271
- m$2((n) => ({
1272
- id: n.id,
1273
- icon: n$1(n.icon) ? "Y" : "N",
1274
- title: n.title,
1275
- description: n.description?.md ?? n.description?.txt ?? null,
1276
- technology: n.technology ?? null,
1277
- shape: n.shape,
1278
- size: n.style.size ?? null,
1279
- textSize: n.style.textSize ?? null,
1280
- padding: n.style.padding ?? null,
1281
- children: n.children
1270
+ m$2((n$1) => ({
1271
+ id: n$1.id,
1272
+ icon: n(n$1.icon) ? "Y" : "N",
1273
+ title: n$1.title,
1274
+ description: n$1.description?.md ?? n$1.description?.txt ?? null,
1275
+ technology: n$1.technology ?? null,
1276
+ shape: n$1.shape,
1277
+ size: n$1.style.size ?? null,
1278
+ textSize: n$1.style.textSize ?? null,
1279
+ padding: n$1.style.padding ?? null,
1280
+ children: n$1.children
1282
1281
  })),
1283
- l$2(({ id, ...node }) => [id, node])
1282
+ l$1(({ id, ...node }) => [id, node])
1284
1283
  ),
1285
1284
  edges: C(
1286
1285
  view.edges,
@@ -1295,7 +1294,7 @@ function calcViewLayoutHash(view) {
1295
1294
  tail: e.tail,
1296
1295
  line: e.line
1297
1296
  })),
1298
- l$2(({ source, target, ...edge }) => [`${source}:${target}`, edge])
1297
+ l$1(({ source, target, ...edge }) => [`${source}:${target}`, edge])
1299
1298
  )
1300
1299
  };
1301
1300
  view.hash = objectHash(tohash);
@@ -1739,29 +1738,29 @@ function applyViewRuleStyle(rule, predicates, nodes) {
1739
1738
  u((n) => {
1740
1739
  n.shape = rule.style.shape ?? n.shape;
1741
1740
  n.color = rule.style.color ?? n.color;
1742
- if (n$2(rule.style.icon)) {
1741
+ if (n$1(rule.style.icon)) {
1743
1742
  n.icon = rule.style.icon;
1744
1743
  }
1745
- if (n$2(rule.notation)) {
1744
+ if (n$1(rule.notation)) {
1746
1745
  n.notation = rule.notation;
1747
1746
  }
1748
1747
  let styleOverride;
1749
- if (n$2(rule.style.border)) {
1748
+ if (n$1(rule.style.border)) {
1750
1749
  styleOverride = { border: rule.style.border };
1751
1750
  }
1752
- if (n$2(rule.style.opacity)) {
1751
+ if (n$1(rule.style.opacity)) {
1753
1752
  styleOverride = { ...styleOverride, opacity: rule.style.opacity };
1754
1753
  }
1755
- if (n$2(rule.style.multiple)) {
1754
+ if (n$1(rule.style.multiple)) {
1756
1755
  styleOverride = { ...styleOverride, multiple: rule.style.multiple };
1757
1756
  }
1758
- if (n$2(rule.style.padding)) {
1757
+ if (n$1(rule.style.padding)) {
1759
1758
  styleOverride = { ...styleOverride, padding: rule.style.padding };
1760
1759
  }
1761
- if (n$2(rule.style.size)) {
1760
+ if (n$1(rule.style.size)) {
1762
1761
  styleOverride = { ...styleOverride, size: rule.style.size };
1763
1762
  }
1764
- if (n$2(rule.style.textSize)) {
1763
+ if (n$1(rule.style.textSize)) {
1765
1764
  styleOverride = { ...styleOverride, textSize: rule.style.textSize };
1766
1765
  }
1767
1766
  if (styleOverride) {
@@ -1925,33 +1924,33 @@ function pickRelationshipProps(relation) {
1925
1924
  function mergePropsFromRelationships(relations, prefer) {
1926
1925
  const allprops = C(
1927
1926
  relations,
1928
- l$4(
1927
+ l$3(
1929
1928
  (acc, r) => {
1930
- if (n$1(r.title) && !acc.title.includes(r.title)) {
1929
+ if (n(r.title) && !acc.title.includes(r.title)) {
1931
1930
  acc.title.push(r.title);
1932
1931
  }
1933
- if (n$1(r.description) && !acc.description.some(k(r.description))) {
1932
+ if (n(r.description) && !acc.description.some(k(r.description))) {
1934
1933
  acc.description.push(r.description);
1935
1934
  }
1936
- if (n$1(r.technology) && !acc.technology.includes(r.technology)) {
1935
+ if (n(r.technology) && !acc.technology.includes(r.technology)) {
1937
1936
  acc.technology.push(r.technology);
1938
1937
  }
1939
- if (n$1(r.kind) && !acc.kind.includes(r.kind)) {
1938
+ if (n(r.kind) && !acc.kind.includes(r.kind)) {
1940
1939
  acc.kind.push(r.kind);
1941
1940
  }
1942
- if (n$1(r.color) && !acc.color.includes(r.color)) {
1941
+ if (n(r.color) && !acc.color.includes(r.color)) {
1943
1942
  acc.color.push(r.color);
1944
1943
  }
1945
- if (n$1(r.line) && !acc.line.includes(r.line)) {
1944
+ if (n(r.line) && !acc.line.includes(r.line)) {
1946
1945
  acc.line.push(r.line);
1947
1946
  }
1948
- if (n$1(r.head) && !acc.head.includes(r.head)) {
1947
+ if (n(r.head) && !acc.head.includes(r.head)) {
1949
1948
  acc.head.push(r.head);
1950
1949
  }
1951
- if (n$1(r.tail) && !acc.tail.includes(r.tail)) {
1950
+ if (n(r.tail) && !acc.tail.includes(r.tail)) {
1952
1951
  acc.tail.push(r.tail);
1953
1952
  }
1954
- if (n$1(r.navigateTo) && !acc.navigateTo.includes(r.navigateTo)) {
1953
+ if (n(r.navigateTo) && !acc.navigateTo.includes(r.navigateTo)) {
1955
1954
  acc.navigateTo.push(r.navigateTo);
1956
1955
  }
1957
1956
  if (r.tags) {
@@ -1995,12 +1994,12 @@ function mergePropsFromRelationships(relations, prefer) {
1995
1994
  ...isNonEmptyArray(allprops.links) && { links: allprops.links },
1996
1995
  ...isNonEmptyArray(tags) && { tags }
1997
1996
  },
1998
- n$1
1997
+ n
1999
1998
  );
2000
1999
  if (prefer) {
2001
2000
  return {
2002
2001
  ...merged,
2003
- ...d$2(pickRelationshipProps(prefer), n$1)
2002
+ ...d$2(pickRelationshipProps(prefer), n)
2004
2003
  };
2005
2004
  }
2006
2005
  return merged;
@@ -2161,7 +2160,7 @@ function toNodeSource(el) {
2161
2160
  deploymentRef: instance.id,
2162
2161
  modelRef: element.id,
2163
2162
  ...notation && { notation },
2164
- ...!n$3(metadata) && { metadata }
2163
+ ...!n$2(metadata) && { metadata }
2165
2164
  };
2166
2165
  }
2167
2166
  function toComputedEdges$1(connections) {
@@ -2314,7 +2313,7 @@ function findRedundantConnections$1(connections) {
2314
2313
  return C(
2315
2314
  connections,
2316
2315
  mergeConnections,
2317
- l$4((redundants, connection) => {
2316
+ l$3((redundants, connection) => {
2318
2317
  const { source, target, relations } = connection;
2319
2318
  if (source.isInstance() && target.isInstance()) {
2320
2319
  return redundants;
@@ -2410,7 +2409,7 @@ let StageInclude$1 = class StageInclude extends AbstractStageInclude {
2410
2409
  ),
2411
2410
  // Filter out common ancestors
2412
2411
  m(([sourceAncestor, targetAncestor]) => sourceAncestor === targetAncestor),
2413
- l$5(1),
2412
+ l$4(1),
2414
2413
  u(([sourceAncestor, targetAncestor]) => {
2415
2414
  if (source === sourceAncestor && target === targetAncestor) {
2416
2415
  this.addImplicit(boundary);
@@ -2711,10 +2710,10 @@ const DirectRelationPredicate = {
2711
2710
  }
2712
2711
  }
2713
2712
  stage.addConnections(connections);
2714
- if (FqnExpr.isDeploymentRef(source) && l$6(source.selector)) {
2713
+ if (FqnExpr.isDeploymentRef(source) && l$5(source.selector)) {
2715
2714
  stage.addImplicit(model.element(source.ref.deployment));
2716
2715
  }
2717
- if (FqnExpr.isDeploymentRef(target) && l$6(target.selector)) {
2716
+ if (FqnExpr.isDeploymentRef(target) && l$5(target.selector)) {
2718
2717
  stage.addImplicit(model.element(target.ref.deployment));
2719
2718
  }
2720
2719
  return stage;
@@ -3112,7 +3111,7 @@ function findConnectedElements(stage) {
3112
3111
  stage.mergedConnections(),
3113
3112
  cleanCrossBoundary,
3114
3113
  cleanRedundantRelationships,
3115
- l$4((acc, c) => {
3114
+ l$3((acc, c) => {
3116
3115
  acc.add(c.source);
3117
3116
  acc.add(c.target);
3118
3117
  return acc;
@@ -3378,8 +3377,8 @@ function applyCustomElementProperties(_rules, _nodes) {
3378
3377
  textSize,
3379
3378
  description,
3380
3379
  ...rest
3381
- } = d$1(props, n$4);
3382
- const notEmpty = !n$3(rest);
3380
+ } = d$1(props, n$3);
3381
+ const notEmpty = !n$2(rest);
3383
3382
  const satisfies = elementExprToPredicate(expr);
3384
3383
  nodes.forEach((node, i) => {
3385
3384
  if (isGroupElementKind(node) || !satisfies(node)) {
@@ -3438,14 +3437,14 @@ function resolveGlobalRulesInElementView(rules, globals) {
3438
3437
  return rules.reduce((acc, rule) => {
3439
3438
  if (isViewRuleGlobalPredicateRef(rule)) {
3440
3439
  const globalPredicates = globals.predicates[rule.predicateId];
3441
- if (n$4(globalPredicates)) {
3440
+ if (n$3(globalPredicates)) {
3442
3441
  return acc;
3443
3442
  }
3444
3443
  return acc.concat(globalPredicates);
3445
3444
  }
3446
3445
  if (isViewRuleGlobalStyle(rule)) {
3447
3446
  const globalStyles = globals.styles[rule.styleId];
3448
- if (n$4(globalStyles)) {
3447
+ if (n$3(globalStyles)) {
3449
3448
  return acc;
3450
3449
  }
3451
3450
  return acc.concat(globalStyles);
@@ -3458,14 +3457,14 @@ function resolveGlobalRulesInDynamicView(rules, globals) {
3458
3457
  return rules.reduce((acc, rule) => {
3459
3458
  if (isViewRuleGlobalPredicateRef(rule)) {
3460
3459
  const globalPredicates = globals.dynamicPredicates[rule.predicateId];
3461
- if (n$4(globalPredicates)) {
3460
+ if (n$3(globalPredicates)) {
3462
3461
  return acc;
3463
3462
  }
3464
3463
  return acc.concat(globalPredicates);
3465
3464
  }
3466
3465
  if (isViewRuleGlobalStyle(rule)) {
3467
3466
  const globalStyles = globals.styles[rule.styleId];
3468
- if (n$4(globalStyles)) {
3467
+ if (n$3(globalStyles)) {
3469
3468
  return acc;
3470
3469
  }
3471
3470
  return acc.concat(globalStyles);
@@ -3505,7 +3504,7 @@ class DynamicViewCompute {
3505
3504
  color,
3506
3505
  line
3507
3506
  } = this.findRelations(source, target);
3508
- const navigateTo = n$1(stepNavigateTo) && stepNavigateTo !== this.view.id ? stepNavigateTo : derivedNavigateTo;
3507
+ const navigateTo = n(stepNavigateTo) && stepNavigateTo !== this.view.id ? stepNavigateTo : derivedNavigateTo;
3509
3508
  this.steps.push({
3510
3509
  id,
3511
3510
  ...step,
@@ -3648,7 +3647,7 @@ class DynamicViewCompute {
3648
3647
  const alltags = C(
3649
3648
  relationships,
3650
3649
  u$1((r) => r.tags),
3651
- m$1(n$1),
3650
+ m$1(n),
3652
3651
  i$a()
3653
3652
  );
3654
3653
  const tags = i$b(alltags, 1) ? alltags : null;
@@ -3658,17 +3657,17 @@ class DynamicViewCompute {
3658
3657
  const navigateTo = relationNavigateTo && relationNavigateTo !== this.view.id ? relationNavigateTo : C(
3659
3658
  relationships,
3660
3659
  m$2((r) => r.$relationship.navigateTo),
3661
- m$1(n$1),
3660
+ m$1(n),
3662
3661
  m$1((v) => v !== this.view.id),
3663
3662
  i$a(),
3664
3663
  t$4()
3665
3664
  );
3666
3665
  const commonProperties = C(
3667
3666
  relationships,
3668
- l$4((acc, { title, $relationship: r }) => {
3669
- n$1(title) && acc.title.add(title);
3670
- n$1(r.color) && acc.color.add(r.color);
3671
- n$1(r.line) && acc.line.add(r.line);
3667
+ l$3((acc, { title, $relationship: r }) => {
3668
+ n(title) && acc.title.add(title);
3669
+ n(r.color) && acc.color.add(r.color);
3670
+ n(r.line) && acc.line.add(r.line);
3672
3671
  return acc;
3673
3672
  }, {
3674
3673
  color: /* @__PURE__ */ new Set(),
@@ -3740,10 +3739,11 @@ function applyCustomRelationProperties(_rules, nodes, _edges) {
3740
3739
  expr,
3741
3740
  title,
3742
3741
  description,
3742
+ notes,
3743
3743
  ...customprops
3744
3744
  }
3745
3745
  } of rules) {
3746
- const props = d$1(customprops, n$4);
3746
+ const props = d$1(customprops, n$3);
3747
3747
  const satisfies = relationExpressionToPredicates(expr);
3748
3748
  edges.forEach((edge, i) => {
3749
3749
  let source, target;
@@ -3766,6 +3766,7 @@ function applyCustomRelationProperties(_rules, nodes, _edges) {
3766
3766
  ...edge,
3767
3767
  ...props,
3768
3768
  ...description && { description: { txt: description } },
3769
+ ...notes && { notes: { txt: notes } },
3769
3770
  label: title ?? edge.label,
3770
3771
  isCustomized: true
3771
3772
  };
@@ -3909,7 +3910,7 @@ class StageInclude extends AbstractStageInclude {
3909
3910
  ),
3910
3911
  // Filter out common ancestors
3911
3912
  m(([sourceAncestor, targetAncestor]) => sourceAncestor === targetAncestor),
3912
- l$5(1),
3913
+ l$4(1),
3913
3914
  u(([sourceAncestor, targetAncestor]) => {
3914
3915
  if (sourceAncestor === source && targetAncestor === target) {
3915
3916
  this.addImplicitWithinScope(boundary);
@@ -4065,7 +4066,7 @@ function findRedundantConnections(connections) {
4065
4066
  return C(
4066
4067
  [...connections],
4067
4068
  mergeConnections,
4068
- l$4((reducedConnections, connection, _, all) => {
4069
+ l$3((reducedConnections, connection, _, all) => {
4069
4070
  const descendants = findDescendantConnections(all, connection);
4070
4071
  const nestedRelations = union(
4071
4072
  ...descendants.map(p$1("relations"))
@@ -4354,6 +4355,7 @@ function buildNodes(memory) {
4354
4355
  }
4355
4356
 
4356
4357
  const isWildcard = ModelFqnExpr.isWildcard;
4358
+ const isAncestorOrDescendantOf = (a, b) => a.isAncestorOf(b) || a.isDescendantOf(b);
4357
4359
  const DirectRelationExprPredicate = {
4358
4360
  include: ({ expr: { source, target, isBidirectional = false }, memory, model, stage, where, filterWhere }) => {
4359
4361
  const sourceIsWildcard = isWildcard(source);
@@ -4407,6 +4409,7 @@ const DirectRelationExprPredicate = {
4407
4409
  ([outgoing, incoming]) => a(
4408
4410
  C(
4409
4411
  outgoing,
4412
+ m$1((r) => !isAncestorOrDescendantOf(source2, r.target)),
4410
4413
  m$2(
4411
4414
  (outgoing2) => new ConnectionModel(
4412
4415
  source2,
@@ -4417,6 +4420,7 @@ const DirectRelationExprPredicate = {
4417
4420
  ),
4418
4421
  C(
4419
4422
  incoming,
4423
+ m$1((r) => !isAncestorOrDescendantOf(source2, r.source)),
4420
4424
  m$2(
4421
4425
  (incoming2) => new ConnectionModel(
4422
4426
  incoming2.source,
@@ -4462,6 +4466,7 @@ const DirectRelationExprPredicate = {
4462
4466
  ([incoming, outgoing]) => a(
4463
4467
  C(
4464
4468
  outgoing,
4469
+ m$1((r) => !isAncestorOrDescendantOf(target2, r.target)),
4465
4470
  m$2(
4466
4471
  (outgoing2) => new ConnectionModel(
4467
4472
  target2,
@@ -4472,6 +4477,7 @@ const DirectRelationExprPredicate = {
4472
4477
  ),
4473
4478
  C(
4474
4479
  incoming,
4480
+ m$1((r) => !isAncestorOrDescendantOf(target2, r.source)),
4475
4481
  m$2(
4476
4482
  (incoming2) => new ConnectionModel(
4477
4483
  incoming2.source,
@@ -5227,4 +5233,4 @@ function computeLikeC4Model(parsed) {
5227
5233
  return LikeC4Model.create(computeParsedModelData(parsed));
5228
5234
  }
5229
5235
 
5230
- export { Graph as G, computeParsedModelData as a, computeView as b, computeLikeC4Model as c, d$2 as d, i$5 as i, l$2 as l, topologicalSortExports as t, unsafeComputeView as u, willCreateCycle as w };
5236
+ export { Graph as G, computeParsedModelData as a, computeView as b, computeLikeC4Model as c, d$2 as d, i$5 as i, l$1 as l, topologicalSortExports as t, unsafeComputeView as u, willCreateCycle as w };
@@ -0,0 +1,5 @@
1
+ import { u as u$1 } from './core.DbRvwARP.mjs';
2
+
3
+ function k(...n){return u$1(u,n)}function u(n,e){if(n===e||Object.is(n,e))return true;if(typeof n!="object"||typeof e!="object"||n===null||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e))return false;if(Array.isArray(n))return l(n,e);if(n instanceof Map)return a(n,e);if(n instanceof Set)return c(n,e);if(n instanceof Date)return n.getTime()===e.getTime();if(n instanceof RegExp)return n.toString()===e.toString();if(Object.keys(n).length!==Object.keys(e).length)return false;for(let[r,t]of Object.entries(n))if(!(r in e)||!u(t,e[r]))return false;return true}function l(n,e){if(n.length!==e.length)return false;for(let[r,t]of n.entries())if(!u(t,e[r]))return false;return true}function a(n,e){if(n.size!==e.size)return false;for(let[r,t]of n.entries())if(!e.has(r)||!u(t,e.get(r)))return false;return true}function c(n,e){if(n.size!==e.size)return false;let r=[...e];for(let t of n){let o=false;for(let[s,f]of r.entries())if(u(t,f)){o=true,r.splice(s,1);break}if(!o)return false}return true}
4
+
5
+ export { k };
@@ -1,6 +1,6 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.D3xEWj5B.mjs';
2
- import { E as ElementModel, R as RelationshipModel } from './core.DrS4Bf4y.mjs';
3
- import { A as Any, U as Unknown, B as EdgeId } from './core.DAj3LuFH.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.D8bTI5KC.mjs';
2
+ import { E as ElementModel, R as RelationshipModel } from './core.DoNP3Yl-.mjs';
3
+ import { A as Any, U as Unknown, C as EdgeId } from './core.BFb3p5d-.mjs';
4
4
 
5
5
  /**
6
6
  * Connection refers to any relationships between two elements,
@@ -1,10 +1,11 @@
1
- import { c as customInspectSymbol } from './core.C80Z37Eu.mjs';
1
+ import { c as customInspectSymbol } from './core.C1GV0WWV.mjs';
2
2
  import { a as intersection, d as difference, u as union, b as stringHash, e as equals } from './core.CpwrZi3D.mjs';
3
- import { C, t as s, g as hierarchyLevel, d as commonAncestor, k as isSameHierarchy } from './core.C_C-3c1S.mjs';
3
+ import { C, t as s, g as hierarchyLevel, d as commonAncestor, k as isSameHierarchy } from './core.DQj9iv_y.mjs';
4
4
  import { u } from './core.DbRvwARP.mjs';
5
- import { b as DefaultShapeSize, R as RichText, n as n$1, D as DefaultThemeColor, e as DefaultLineStyle, a as DefaultElementShape } from './core.D56nCp7e.mjs';
5
+ import { n as n$1 } from './core.CnIyafWn.mjs';
6
6
  import { a as nonNullable, i as invariant } from './core.D4npX2q8.mjs';
7
7
  import { m as memoizeProp } from './core.B0oEIXqd.mjs';
8
+ import { b as DefaultShapeSize, R as RichText, D as DefaultThemeColor, e as DefaultLineStyle, a as DefaultElementShape } from './core.CaaYNQDM.mjs';
8
9
 
9
10
  function y(t,i){let a=i.length-t.length;if(a===1){let[n,...r]=i;return C(n,{lazy:t,lazyArgs:r})}if(a===0){let n={lazy:t,lazyArgs:i};return Object.assign(e=>C(e,n),n)}throw new Error("Wrong number of arguments")}
10
11