@omg-dev/app 0.5.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.
Files changed (114) hide show
  1. package/dist-lib/{ChangelogPage-BzsTWlhq.js → ChangelogPage-CirRyMnC.js} +54 -1
  2. package/dist-lib/{File-B-qYa2zY.js → File-DQRr5F_e.js} +1761 -1826
  3. package/dist-lib/FileEditor-BrI3dfcp.js +6895 -0
  4. package/dist-lib/FileTreePane-J8P-OiHb.js +8413 -0
  5. package/dist-lib/{FileViewer-Clmf04v1.js → FileViewer-DRrfus7c.js} +1 -1
  6. package/dist-lib/{SessionFilesPanel-K4lGGdJ4.js → SessionFilesPanel-W4QKB0HL.js} +64 -64
  7. package/dist-lib/{TermView-CWr-zJmM.js → TermView-CoD-VkHs.js} +495 -520
  8. package/dist-lib/{abnfDiagram-VRR7QNED-Chn1Z_p9.js → abnfDiagram-VRR7QNED-CiXfOnAu.js} +4 -4
  9. package/dist-lib/{arc-B652oHQ-.js → arc-QOMNKQA5.js} +1 -1
  10. package/dist-lib/{architectureDiagram-ZJ3FMSHR-CMatArpz.js → architectureDiagram-ZJ3FMSHR-BcFBTmfD.js} +2059 -2064
  11. package/dist-lib/{blockDiagram-677ZJIJ3-CEOPfI9A.js → blockDiagram-677ZJIJ3-Qj8-RIV3.js} +920 -925
  12. package/dist-lib/{c4Diagram-LMCZKHZV-DcUHrESL.js → c4Diagram-LMCZKHZV-BpinEmj4.js} +598 -593
  13. package/dist-lib/{channel-B5lJFbed.js → channel-D6YHMmF7.js} +1 -1
  14. package/dist-lib/{chat-engine-P0yDhFOX.js → chat-engine-CRzDKNTH.js} +1173 -1218
  15. package/dist-lib/chunk-2Q5K7J3B-CFSi414U.js +18 -0
  16. package/dist-lib/{chunk-32BRIVSS-IYmNSvH8.js → chunk-32BRIVSS-DvywQiCk.js} +1 -1
  17. package/dist-lib/{chunk-5VM5RSS4-DO2g-xIj.js → chunk-5VM5RSS4-xd6XuI9Q.js} +1 -1
  18. package/dist-lib/{chunk-BO2N2NFS-kYiI5SD9.js → chunk-BO2N2NFS-BbJdm-59.js} +4892 -4903
  19. package/dist-lib/{chunk-EX3LRPZG-N96wfks9.js → chunk-EX3LRPZG-BLDKx-Yg.js} +507 -514
  20. package/dist-lib/chunk-JWPE2WC7-DnwG7Xzp.js +8 -0
  21. package/dist-lib/chunk-MOJQB5TN-BrENeFT5.js +670 -0
  22. package/dist-lib/chunk-RYQCIY6F-I-J4fVFd.js +313 -0
  23. package/dist-lib/{chunk-V7JOEXUC-DQwf2vkP.js → chunk-V7JOEXUC-Bkakcs1-.js} +458 -453
  24. package/dist-lib/chunk-VR4S4FIN-BDq3jZ0m.js +19 -0
  25. package/dist-lib/{chunk-XXDRQBXY-Ccv4aRcn.js → chunk-XXDRQBXY-DRKeYnrF.js} +1 -1
  26. package/dist-lib/{classDiagram-v2-EOCWNBFH-DOn-rhuL.js → classDiagram-OUVF2IWQ-DISUfvR5.js} +2 -2
  27. package/dist-lib/{classDiagram-OUVF2IWQ-DOn-rhuL.js → classDiagram-v2-EOCWNBFH-DISUfvR5.js} +2 -2
  28. package/dist-lib/{coding-agents-page-DCafIpWL.js → coding-agents-page-OER8HHRF.js} +152 -131
  29. package/dist-lib/computer-page-D9cSNLa9.js +8990 -0
  30. package/dist-lib/{cose-bilkent-JH36ORCC-C-tACTrT.js → cose-bilkent-JH36ORCC-DCfmoChv.js} +281 -281
  31. package/dist-lib/{create-BrnHvSDE.js → create-CBk9uwJH.js} +2 -2
  32. package/dist-lib/cynefin-VYW2F7L2-XAY3mHv8.js +24430 -0
  33. package/dist-lib/{cynefinDiagram-TSTJHNR4-Be7CamD2.js → cynefinDiagram-TSTJHNR4-CrgvPEr1.js} +3 -3
  34. package/dist-lib/{cytoscape.esm-B0ledd6M.js → cytoscape.esm-BB6Ga9He.js} +3 -3
  35. package/dist-lib/dagre-VKFMJZFB-CE5k06mJ.js +343 -0
  36. package/dist-lib/{diagram-FQU43EPY-Jg12ow4Z.js → diagram-FQU43EPY-gOcCiJEN.js} +136 -139
  37. package/dist-lib/diagram-G47NLZAW-BVJLfRsd.js +531 -0
  38. package/dist-lib/diagram-NH7WQ7WH-u6QnHasL.js +145 -0
  39. package/dist-lib/diagram-OA4YK3LP-D4Kcl3uM.js +350 -0
  40. package/dist-lib/{diagram-WEI45ONY-D1kKPOc_.js → diagram-WEI45ONY-6a__oIb0.js} +38 -42
  41. package/dist-lib/{ebnfDiagram-CCIWWBDH-BhQWrGMc.js → ebnfDiagram-CCIWWBDH-PXSrB6lG.js} +4 -4
  42. package/dist-lib/{embedded-CLYU5z7h.js → embedded-DqTPdMCh.js} +10561 -10581
  43. package/dist-lib/{engine-compile-BeDRSL6Y.js → engine-compile-D_stzVMa.js} +2939 -2991
  44. package/dist-lib/{erDiagram-Q63AITRT-D2q6Nmwa.js → erDiagram-Q63AITRT-BbsttUCs.js} +286 -284
  45. package/dist-lib/flowDiagram-23GEKE2U-CX5x3zVA.js +1641 -0
  46. package/dist-lib/{ganttDiagram-NO4QXBWP-C_Lj-cJB.js → ganttDiagram-NO4QXBWP-Bq0aSPs8.js} +2 -2
  47. package/dist-lib/gitGraphDiagram-IHSO6WYX-BjAezjIv.js +815 -0
  48. package/dist-lib/{graph-B68L3K2T.js → graph-DAHC4kPm.js} +2 -2
  49. package/dist-lib/{highlighted-body-OFNGDK62-C2DGVKV8.js → highlighted-body-OFNGDK62-DWhG_ijx.js} +1 -1
  50. package/dist-lib/index-B0neMIbR.js +16520 -0
  51. package/dist-lib/index-BBC0E3Qg.js +4994 -0
  52. package/dist-lib/{index-Dtkd4mEk.js → index-CE7H8LiZ.js} +2 -2
  53. package/dist-lib/{index-DWkBvb-9.js → index-FgVvPpIY.js} +2 -2
  54. package/dist-lib/index.js +1 -1
  55. package/dist-lib/{infoDiagram-FWYZ7A6U-BbUkT0KS.js → infoDiagram-FWYZ7A6U-Bo_FNR91.js} +2 -2
  56. package/dist-lib/ishikawaDiagram-FXEZZL3T-C5bGD-Eb.js +624 -0
  57. package/dist-lib/{journeyDiagram-5HDEW3XC-CgykmVSC.js → journeyDiagram-5HDEW3XC-C8qM7SxF.js} +4 -4
  58. package/dist-lib/kanban-definition-HUTT4EX6-C-EK5Puz.js +724 -0
  59. package/dist-lib/{katex-jHfnQmlp.js → katex-DoRnZ_sp.js} +1 -1
  60. package/dist-lib/keyboard-Yfa1ETse.js +21 -0
  61. package/dist-lib/{layout-BGrtsiRL.js → layout-DBbo_M5I.js} +2 -2
  62. package/dist-lib/{linear-B5ZSwawJ.js → linear-zGzX0-I0.js} +1 -1
  63. package/dist-lib/{map-hbfFlSln.js → map-DRdzG8Ho.js} +1 -1
  64. package/dist-lib/mermaid-GHXKKRXX-hOE9C3qW.js +4 -0
  65. package/dist-lib/{mindmap-definition-LN4V7U3C-CfhfeEht.js → mindmap-definition-LN4V7U3C-DlVCRx6k.js} +310 -311
  66. package/dist-lib/{pegDiagram-2B236MQR-CYDAJHPF.js → pegDiagram-2B236MQR-DrKNikeG.js} +4 -4
  67. package/dist-lib/{pieDiagram-ENE6RG2P-udKxQm4p.js → pieDiagram-ENE6RG2P-Fm_jc0HL.js} +83 -84
  68. package/dist-lib/quadrantDiagram-ABIIQ3AL-zDRY0VtB.js +1029 -0
  69. package/dist-lib/{railroadDiagram-RFXS5EU6-q0Svkmuy.js → railroadDiagram-RFXS5EU6-BQuFX39y.js} +4 -4
  70. package/dist-lib/{requirementDiagram-TGXJPOKE-tNxRI1gc.js → requirementDiagram-TGXJPOKE-BWwBQZXn.js} +269 -268
  71. package/dist-lib/{resume-session-sheet-CHwpwguS.js → resume-session-sheet-bjDJmwq6.js} +2 -3
  72. package/dist-lib/sankeyDiagram-HTMAVEWB-BjRyuB6L.js +859 -0
  73. package/dist-lib/{sequenceDiagram-DBY2YBRQ-Dvl2_CXL.js → sequenceDiagram-DBY2YBRQ-69pcw_2M.js} +892 -899
  74. package/dist-lib/{session-token-usage-BUz6b-IB.js → session-token-usage-D2zDt9P7.js} +82 -83
  75. package/dist-lib/{shadow-text-size-CBCTdbYU.js → shadow-text-size-smWA4wIU.js} +1 -2
  76. package/dist-lib/{shipped-page-CXy85bsL.js → shipped-page-Cr7dCCc2.js} +232 -235
  77. package/dist-lib/sizeCapture-X5ZJPWSS-DqkV8s1N.js +46 -0
  78. package/dist-lib/{stateDiagram-2N3HPSRC-CnWB7HvU.js → stateDiagram-2N3HPSRC-0vE3REl_.js} +4 -4
  79. package/dist-lib/{stateDiagram-v2-6OUMAXLB-DnZ0UI2p.js → stateDiagram-v2-6OUMAXLB-u_56Obsh.js} +2 -2
  80. package/dist-lib/{streamdown-response-CUB9sK6V.js → streamdown-response-Qq9_RgFv.js} +290 -297
  81. package/dist-lib/styles.css +1 -1
  82. package/dist-lib/swimlanes-5IMT3BWC-H0raIBd1.js +5332 -0
  83. package/dist-lib/{swimlanesDiagram-G3AALYLV-CKyOeqF_.js → swimlanesDiagram-G3AALYLV-By52HaDu.js} +2 -2
  84. package/dist-lib/timeline-definition-FHXFAJF6-h1LLYUQk.js +1055 -0
  85. package/dist-lib/vennDiagram-L72KCM5P-B4wDw_Kh.js +1578 -0
  86. package/dist-lib/wardleyDiagram-EHGQE667-DLMBGiwD.js +678 -0
  87. package/dist-lib/{xychartDiagram-FW5EYKEG-m3s7caPv.js → xychartDiagram-FW5EYKEG-BHvf5Noj.js} +526 -496
  88. package/package.json +4 -3
  89. package/dist-lib/FileEditor-BIz0qCyW.js +0 -6892
  90. package/dist-lib/FileTreePane-BG2k7gTc.js +0 -8422
  91. package/dist-lib/chunk-2Q5K7J3B-Ex8Ly28R.js +0 -15
  92. package/dist-lib/chunk-JWPE2WC7-DFPBClX_.js +0 -9
  93. package/dist-lib/chunk-MOJQB5TN-dusfI9ob.js +0 -664
  94. package/dist-lib/chunk-RYQCIY6F-fkeERzIG.js +0 -315
  95. package/dist-lib/chunk-VR4S4FIN-hOZG7eF3.js +0 -20
  96. package/dist-lib/cynefin-VYW2F7L2-DQXPWaog.js +0 -23853
  97. package/dist-lib/dagre-VKFMJZFB-BhCjK7XQ.js +0 -346
  98. package/dist-lib/diagram-G47NLZAW-C3_z2t6T.js +0 -530
  99. package/dist-lib/diagram-NH7WQ7WH-DUdK08IT.js +0 -143
  100. package/dist-lib/diagram-OA4YK3LP-TUUyRYY3.js +0 -353
  101. package/dist-lib/flowDiagram-23GEKE2U-DU3S3biU.js +0 -1645
  102. package/dist-lib/gitGraphDiagram-IHSO6WYX-CvGu0XAR.js +0 -828
  103. package/dist-lib/index-DcwavxA1.js +0 -5062
  104. package/dist-lib/index-JkCQXUYs.js +0 -16566
  105. package/dist-lib/ishikawaDiagram-FXEZZL3T-D_Y6Tuyb.js +0 -622
  106. package/dist-lib/kanban-definition-HUTT4EX6-CPFLTskY.js +0 -726
  107. package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +0 -4
  108. package/dist-lib/quadrantDiagram-ABIIQ3AL-BmDmLczk.js +0 -1025
  109. package/dist-lib/sankeyDiagram-HTMAVEWB-B9Bl7f2P.js +0 -847
  110. package/dist-lib/sizeCapture-X5ZJPWSS-B1EeO3N9.js +0 -47
  111. package/dist-lib/swimlanes-5IMT3BWC-CvqDJcS9.js +0 -5353
  112. package/dist-lib/timeline-definition-FHXFAJF6-b15X0Oru.js +0 -1066
  113. package/dist-lib/vennDiagram-L72KCM5P-C4lh5m77.js +0 -1585
  114. package/dist-lib/wardleyDiagram-EHGQE667-Cev6fT_D.js +0 -684
@@ -1,684 +0,0 @@
1
- import { p as zt } from "./chunk-JWPE2WC7-DFPBClX_.js";
2
- import { s as Lt, g as Tt, p as At, o as Xt, a as Et, b as Yt, _ as y, W as It, z as Bt, B as Q, l as et, F as Ft, e as Rt, q as Ot, c as V } from "./index-JkCQXUYs.js";
3
- import { p as Wt } from "./cynefin-VYW2F7L2-DQXPWaog.js";
4
- var G = /* @__PURE__ */ y((a, o) => {
5
- const e = a <= 1 ? a * 100 : a;
6
- if (e < 0 || e > 100)
7
- throw new Error(
8
- `${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`
9
- );
10
- return e;
11
- }, "toPercent"), E = /* @__PURE__ */ y((a, o, e) => ({
12
- x: G(o, `${e} evolution`),
13
- y: G(a, `${e} visibility`)
14
- }), "toCoordinates"), tt = /* @__PURE__ */ y((a) => {
15
- if (a) {
16
- if (a === "+<>")
17
- return "bidirectional";
18
- if (a === "+<")
19
- return "backward";
20
- if (a === "+>")
21
- return "forward";
22
- }
23
- }, "getFlowFromPort"), Dt = /* @__PURE__ */ y((a) => {
24
- if (!(a != null && a.startsWith("+")))
25
- return {};
26
- const o = /^\+'([^']*)'/.exec(a), e = o == null ? void 0 : o[1];
27
- return a.includes("<>") ? { flow: "bidirectional", label: e } : a.includes("<") ? { flow: "backward", label: e } : a.includes(">") ? { flow: "forward", label: e } : { label: e };
28
- }, "extractFlowFromArrow"), Gt = /* @__PURE__ */ y((a, o) => {
29
- if (zt(a, o), a.size && o.setSize(a.size.width, a.size.height), a.evolution) {
30
- const e = a.evolution.stages.map((r) => r.secondName ? `${r.name.trim()} / ${r.secondName.trim()}` : r.name.trim()), p = a.evolution.stages.filter((r) => r.boundary !== void 0).map((r) => r.boundary);
31
- o.updateAxes({ stages: e, stageBoundaries: p });
32
- }
33
- if (a.anchors.forEach((e) => {
34
- const p = E(e.visibility, e.evolution, `Anchor "${e.name}"`);
35
- o.addNode(e.name, e.name, p.x, p.y, "anchor");
36
- }), a.components.forEach((e) => {
37
- var v;
38
- const p = E(
39
- e.visibility,
40
- e.evolution,
41
- `Component "${e.name}"`
42
- ), r = e.label ? (e.label.negX ? -1 : 1) * e.label.offsetX : void 0, d = e.label ? (e.label.negY ? -1 : 1) * e.label.offsetY : void 0, m = (v = e.decorator) == null ? void 0 : v.strategy;
43
- o.addNode(
44
- e.name,
45
- e.name,
46
- p.x,
47
- p.y,
48
- "component",
49
- r,
50
- d,
51
- e.inertia,
52
- m
53
- );
54
- }), a.notes.forEach((e) => {
55
- const p = E(e.visibility, e.evolution, `Note "${e.text}"`);
56
- o.addNote(e.text, p.x, p.y);
57
- }), a.pipelines.forEach((e) => {
58
- const p = o.getNode(e.parent);
59
- if (!p || typeof p.y != "number")
60
- throw new Error(
61
- `Pipeline "${e.parent}" must reference an existing component with coordinates.`
62
- );
63
- const r = p.y;
64
- o.startPipeline(e.parent), e.components.forEach((d) => {
65
- const m = `${e.parent}_${d.name}`, v = d.label ? (d.label.negX ? -1 : 1) * d.label.offsetX : void 0, g = d.label ? (d.label.negY ? -1 : 1) * d.label.offsetY : void 0, L = G(d.evolution, `Pipeline component "${d.name}" evolution`);
66
- o.addNode(
67
- m,
68
- d.name,
69
- L,
70
- r,
71
- "pipeline-component",
72
- v,
73
- g
74
- ), o.addPipelineComponent(e.parent, m);
75
- });
76
- }), a.links.forEach((e) => {
77
- const p = !!e.arrow && (e.arrow.includes("-.->") || e.arrow.includes(".-."));
78
- let r = tt(e.fromPort) ?? tt(e.toPort);
79
- const { flow: d, label: m } = Dt(e.arrow);
80
- !r && d && (r = d);
81
- const v = e.linkLabel, g = m ?? v;
82
- o.addLink(o.resolveNodeId(e.from), o.resolveNodeId(e.to), p, g, r);
83
- }), a.evolves.forEach((e) => {
84
- const p = o.getNode(e.component);
85
- if ((p == null ? void 0 : p.y) !== void 0) {
86
- const r = G(e.target, `Evolve target for "${e.component}"`);
87
- o.addTrend(e.component, r, p.y);
88
- }
89
- }), a.annotations.length > 0) {
90
- const e = a.annotations[0], p = E(e.x, e.y, "Annotations box");
91
- o.setAnnotationsBox(p.x, p.y);
92
- }
93
- a.annotation.forEach((e) => {
94
- const p = E(e.x, e.y, `Annotation ${e.number}`);
95
- o.addAnnotation(e.number, [{ x: p.x, y: p.y }], e.text);
96
- }), a.accelerators.forEach((e) => {
97
- const p = E(e.x, e.y, `Accelerator "${e.name}"`);
98
- o.addAccelerator(e.name, p.x, p.y);
99
- }), a.deaccelerators.forEach((e) => {
100
- const p = E(
101
- e.x,
102
- e.y,
103
- `Deaccelerator "${e.name}"`
104
- );
105
- o.addDeaccelerator(e.name, p.x, p.y);
106
- });
107
- }, "populateDb"), at = {
108
- parser: {
109
- // @ts-expect-error - WardleyDB is not assignable to DiagramDB
110
- yy: void 0
111
- },
112
- parse: /* @__PURE__ */ y(async (a) => {
113
- var p;
114
- const o = await Wt("wardley", a);
115
- et.debug(o);
116
- const e = (p = at.parser) == null ? void 0 : p.yy;
117
- if (!e || typeof e.addNode != "function")
118
- throw new Error(
119
- "parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
120
- );
121
- Gt(o, e);
122
- }, "parse")
123
- }, I, qt = (I = class {
124
- constructor() {
125
- this.nodes = /* @__PURE__ */ new Map(), this.links = [], this.trends = /* @__PURE__ */ new Map(), this.pipelines = /* @__PURE__ */ new Map(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.axes = {};
126
- }
127
- addNode(o) {
128
- const e = this.nodes.get(o.id) ?? { id: o.id, label: o.label }, p = {
129
- ...e,
130
- ...o,
131
- className: o.className ?? e.className,
132
- labelOffsetX: o.labelOffsetX ?? e.labelOffsetX,
133
- labelOffsetY: o.labelOffsetY ?? e.labelOffsetY
134
- };
135
- this.nodes.set(o.id, p);
136
- }
137
- addLink(o) {
138
- this.links.push(o);
139
- }
140
- addTrend(o) {
141
- this.trends.set(o.nodeId, o);
142
- }
143
- startPipeline(o) {
144
- this.pipelines.set(o, { nodeId: o, componentIds: [] });
145
- const e = this.nodes.get(o);
146
- e && (e.isPipelineParent = !0);
147
- }
148
- addPipelineComponent(o, e) {
149
- const p = this.pipelines.get(o);
150
- p && p.componentIds.push(e);
151
- const r = this.nodes.get(e);
152
- r && (r.inPipeline = !0);
153
- }
154
- addAnnotation(o) {
155
- this.annotations.push(o);
156
- }
157
- addNote(o) {
158
- this.notes.push(o);
159
- }
160
- addAccelerator(o) {
161
- this.accelerators.push(o);
162
- }
163
- addDeaccelerator(o) {
164
- this.deaccelerators.push(o);
165
- }
166
- setAnnotationsBox(o, e) {
167
- this.annotationsBox = { x: o, y: e };
168
- }
169
- setAxes(o) {
170
- this.axes = {
171
- ...this.axes,
172
- ...o
173
- };
174
- }
175
- setSize(o, e) {
176
- this.size = { width: o, height: e };
177
- }
178
- getNode(o) {
179
- return this.nodes.get(o);
180
- }
181
- /**
182
- * Resolve a name to a node ID. Tries exact ID match first,
183
- * then falls back to finding a node whose label matches the name
184
- * (handles pipeline components which have synthetic IDs like "Parent_Child").
185
- */
186
- resolveNodeId(o) {
187
- if (this.nodes.has(o))
188
- return o;
189
- for (const [e, p] of this.nodes)
190
- if (p.label === o)
191
- return e;
192
- return o;
193
- }
194
- build() {
195
- const o = [];
196
- for (const e of this.nodes.values()) {
197
- if (typeof e.x != "number" || typeof e.y != "number")
198
- throw new Error(`Node "${e.label}" is missing coordinates`);
199
- o.push(e);
200
- }
201
- return {
202
- nodes: o,
203
- links: [...this.links],
204
- trends: [...this.trends.values()],
205
- pipelines: [...this.pipelines.values()],
206
- annotations: [...this.annotations],
207
- notes: [...this.notes],
208
- accelerators: [...this.accelerators],
209
- deaccelerators: [...this.deaccelerators],
210
- annotationsBox: this.annotationsBox,
211
- axes: { ...this.axes },
212
- size: this.size
213
- };
214
- }
215
- clear() {
216
- this.nodes.clear(), this.links = [], this.trends.clear(), this.pipelines.clear(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.annotationsBox = void 0, this.axes = {}, this.size = void 0;
217
- }
218
- }, y(I, "WardleyBuilder"), I), b = new qt();
219
- function rt() {
220
- return V()["wardley-beta"];
221
- }
222
- y(rt, "getConfig");
223
- function ot(a, o, e, p, r, d, m, v, g) {
224
- b.addNode({
225
- id: a,
226
- label: o,
227
- x: e,
228
- y: p,
229
- className: r,
230
- labelOffsetX: d,
231
- labelOffsetY: m,
232
- inertia: v,
233
- sourceStrategy: g
234
- });
235
- }
236
- y(ot, "addNode");
237
- function st(a, o, e = !1, p, r) {
238
- b.addLink({
239
- source: a,
240
- target: o,
241
- dashed: e,
242
- label: p,
243
- flow: r
244
- });
245
- }
246
- y(st, "addLink");
247
- function nt(a, o, e) {
248
- b.addTrend({ nodeId: a, targetX: o, targetY: e });
249
- }
250
- y(nt, "addTrend");
251
- function it(a, o, e) {
252
- b.addAnnotation({
253
- number: a,
254
- coordinates: o,
255
- text: e
256
- });
257
- }
258
- y(it, "addAnnotation");
259
- function dt(a, o, e) {
260
- b.addNote({
261
- text: a,
262
- x: o,
263
- y: e
264
- });
265
- }
266
- y(dt, "addNote");
267
- function lt(a, o, e) {
268
- b.addAccelerator({
269
- name: a,
270
- x: o,
271
- y: e
272
- });
273
- }
274
- y(lt, "addAccelerator");
275
- function ct(a, o, e) {
276
- b.addDeaccelerator({
277
- name: a,
278
- x: o,
279
- y: e
280
- });
281
- }
282
- y(ct, "addDeaccelerator");
283
- function pt(a, o) {
284
- b.setAnnotationsBox(a, o);
285
- }
286
- y(pt, "setAnnotationsBox");
287
- function ht(a, o) {
288
- b.setSize(a, o);
289
- }
290
- y(ht, "setSize");
291
- function xt(a) {
292
- b.startPipeline(a);
293
- }
294
- y(xt, "startPipeline");
295
- function ft(a, o) {
296
- b.addPipelineComponent(a, o);
297
- }
298
- y(ft, "addPipelineComponent");
299
- function gt(a) {
300
- b.setAxes(a);
301
- }
302
- y(gt, "updateAxes");
303
- function ut(a) {
304
- return b.getNode(a);
305
- }
306
- y(ut, "getNode");
307
- function yt(a) {
308
- return b.resolveNodeId(a);
309
- }
310
- y(yt, "resolveNodeId");
311
- function mt() {
312
- return b.build();
313
- }
314
- y(mt, "getWardleyData");
315
- function wt() {
316
- b.clear(), Ot();
317
- }
318
- y(wt, "clear");
319
- var Ht = {
320
- getConfig: rt,
321
- addNode: ot,
322
- addLink: st,
323
- addTrend: nt,
324
- addAnnotation: it,
325
- addNote: dt,
326
- addAccelerator: lt,
327
- addDeaccelerator: ct,
328
- setAnnotationsBox: pt,
329
- setSize: ht,
330
- startPipeline: xt,
331
- addPipelineComponent: ft,
332
- updateAxes: gt,
333
- getNode: ut,
334
- resolveNodeId: yt,
335
- getWardleyData: mt,
336
- clear: wt,
337
- setAccTitle: Yt,
338
- getAccTitle: Et,
339
- setDiagramTitle: Xt,
340
- getDiagramTitle: At,
341
- getAccDescription: Tt,
342
- setAccDescription: Lt
343
- }, jt = ["Genesis", "Custom Built", "Product", "Commodity"], Vt = /* @__PURE__ */ y(() => {
344
- var o, e, p, r, d, m, v, g, L, M, k, N;
345
- const { themeVariables: a } = V();
346
- return {
347
- backgroundColor: ((o = a.wardley) == null ? void 0 : o.backgroundColor) ?? a.background ?? "#fff",
348
- axisColor: ((e = a.wardley) == null ? void 0 : e.axisColor) ?? "#000",
349
- axisTextColor: ((p = a.wardley) == null ? void 0 : p.axisTextColor) ?? a.primaryTextColor ?? "#222",
350
- gridColor: ((r = a.wardley) == null ? void 0 : r.gridColor) ?? "rgba(100, 100, 100, 0.2)",
351
- componentFill: ((d = a.wardley) == null ? void 0 : d.componentFill) ?? "#fff",
352
- componentStroke: ((m = a.wardley) == null ? void 0 : m.componentStroke) ?? "#000",
353
- componentLabelColor: ((v = a.wardley) == null ? void 0 : v.componentLabelColor) ?? a.primaryTextColor ?? "#222",
354
- linkStroke: ((g = a.wardley) == null ? void 0 : g.linkStroke) ?? "#000",
355
- evolutionStroke: ((L = a.wardley) == null ? void 0 : L.evolutionStroke) ?? "#dc3545",
356
- annotationStroke: ((M = a.wardley) == null ? void 0 : M.annotationStroke) ?? "#000",
357
- annotationTextColor: ((k = a.wardley) == null ? void 0 : k.annotationTextColor) ?? a.primaryTextColor ?? "#222",
358
- annotationFill: ((N = a.wardley) == null ? void 0 : N.annotationFill) ?? a.background ?? "#fff"
359
- };
360
- }, "getTheme"), _t = /* @__PURE__ */ y(() => {
361
- const a = V()["wardley-beta"];
362
- return {
363
- width: (a == null ? void 0 : a.width) ?? 900,
364
- height: (a == null ? void 0 : a.height) ?? 600,
365
- padding: (a == null ? void 0 : a.padding) ?? 48,
366
- nodeRadius: (a == null ? void 0 : a.nodeRadius) ?? 6,
367
- nodeLabelOffset: (a == null ? void 0 : a.nodeLabelOffset) ?? 8,
368
- axisFontSize: (a == null ? void 0 : a.axisFontSize) ?? 12,
369
- labelFontSize: (a == null ? void 0 : a.labelFontSize) ?? 10,
370
- showGrid: (a == null ? void 0 : a.showGrid) ?? !1,
371
- useMaxWidth: (a == null ? void 0 : a.useMaxWidth) ?? !0
372
- };
373
- }, "getConfigValues"), Zt = /* @__PURE__ */ y((a, o, e, p) => {
374
- var J, K;
375
- et.debug(`Rendering Wardley map
376
- ` + a);
377
- const r = _t(), d = Vt(), m = r.nodeRadius * 1.6, v = p.db, g = v.getWardleyData(), L = v.getDiagramTitle(), M = ((J = g.size) == null ? void 0 : J.width) ?? r.width, k = ((K = g.size) == null ? void 0 : K.height) ?? r.height, N = Ft(o);
378
- N.selectAll("*").remove(), Rt(N, k, M, r.useMaxWidth), N.attr("viewBox", `0 0 ${M} ${k}`);
379
- const P = N.append("g").attr("class", "wardley-map"), q = N.append("defs");
380
- q.append("marker").attr("id", `arrow-${o}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.evolutionStroke).attr("stroke", "none"), q.append("marker").attr("id", `link-arrow-end-${o}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), q.append("marker").attr("id", `link-arrow-start-${o}`).attr("viewBox", "0 0 10 10").attr("refX", 1).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), P.append("rect").attr("class", "wardley-background").attr("width", M).attr("height", k).attr("fill", d.backgroundColor);
381
- const B = M - r.padding * 2, F = k - r.padding * 2;
382
- L && P.append("text").attr("class", "wardley-title").attr("x", M / 2).attr("y", r.padding / 2).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize * 1.05).attr("font-weight", "bold").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(L);
383
- const T = /* @__PURE__ */ y((t) => r.padding + t / 100 * B, "projectX"), A = /* @__PURE__ */ y((t) => k - r.padding - t / 100 * F, "projectY"), O = P.append("g").attr("class", "wardley-axes");
384
- O.append("line").attr("x1", r.padding).attr("x2", M - r.padding).attr("y1", k - r.padding).attr("y2", k - r.padding).attr("stroke", d.axisColor).attr("stroke-width", 1), O.append("line").attr("x1", r.padding).attr("x2", r.padding).attr("y1", r.padding).attr("y2", k - r.padding).attr("stroke", d.axisColor).attr("stroke-width", 1);
385
- const kt = g.axes.xLabel ?? "Evolution", bt = g.axes.yLabel ?? "Visibility";
386
- O.append("text").attr("class", "wardley-axis-label wardley-axis-label-x").attr("x", r.padding + B / 2).attr("y", k - r.padding / 4).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").text(kt), O.append("text").attr("class", "wardley-axis-label wardley-axis-label-y").attr("x", r.padding / 3).attr("y", r.padding + F / 2).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").attr(
387
- "transform",
388
- `rotate(-90 ${r.padding / 3} ${r.padding + F / 2})`
389
- ).text(bt);
390
- const R = g.axes.stages && g.axes.stages.length > 0 ? g.axes.stages : jt;
391
- if (R.length > 0) {
392
- const t = P.append("g").attr("class", "wardley-stages"), n = g.axes.stageBoundaries, s = [];
393
- if (n && n.length === R.length) {
394
- let i = 0;
395
- n.forEach((h) => {
396
- s.push({ start: i, end: h }), i = h;
397
- });
398
- } else {
399
- const i = 1 / R.length;
400
- R.forEach((h, l) => {
401
- s.push({
402
- start: l * i,
403
- end: (l + 1) * i
404
- });
405
- });
406
- }
407
- R.forEach((i, h) => {
408
- const l = s[h], x = r.padding + l.start * B, f = r.padding + l.end * B, u = (x + f) / 2;
409
- h > 0 && t.append("line").attr("x1", x).attr("x2", x).attr("y1", r.padding).attr("y2", k - r.padding).attr("stroke", "#000").attr("stroke-width", 1).attr("stroke-dasharray", "5 5").attr("opacity", 0.8), t.append("text").attr("class", "wardley-stage-label").attr("x", u).attr("y", k - r.padding / 1.5).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize - 2).attr("text-anchor", "middle").text(i);
410
- });
411
- }
412
- if (r.showGrid) {
413
- const t = P.append("g").attr("class", "wardley-grid");
414
- for (let n = 1; n < 4; n++) {
415
- const s = n / 4, i = r.padding + B * s;
416
- t.append("line").attr("x1", i).attr("x2", i).attr("y1", r.padding).attr("y2", k - r.padding).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6"), t.append("line").attr("x1", r.padding).attr("x2", M - r.padding).attr("y1", k - r.padding - F * s).attr("y2", k - r.padding - F * s).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6");
417
- }
418
- }
419
- const c = /* @__PURE__ */ new Map();
420
- if (g.nodes.forEach((t) => {
421
- c.set(t.id, {
422
- x: T(t.x),
423
- y: A(t.y),
424
- node: t
425
- });
426
- }), g.pipelines.length > 0) {
427
- const t = P.append("g").attr("class", "wardley-pipelines"), n = P.append("g").attr("class", "wardley-pipeline-links");
428
- g.pipelines.forEach((s) => {
429
- if (s.componentIds.length === 0)
430
- return;
431
- const i = s.componentIds.map((f) => ({ id: f, pos: c.get(f), node: g.nodes.find((u) => u.id === f) })).filter((f) => f.pos && f.node).sort((f, u) => f.node.x - u.node.x);
432
- for (let f = 0; f < i.length - 1; f++) {
433
- const u = i[f], w = i[f + 1];
434
- n.append("line").attr("class", "wardley-pipeline-evolution-link").attr("x1", u.pos.x).attr("y1", u.pos.y).attr("x2", w.pos.x).attr("y2", w.pos.y).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4");
435
- }
436
- let h = 1 / 0, l = -1 / 0, x = 0;
437
- if (s.componentIds.forEach((f) => {
438
- const u = c.get(f);
439
- u && (h = Math.min(h, u.x), l = Math.max(l, u.x), x = u.y);
440
- }), h !== 1 / 0 && l !== -1 / 0) {
441
- const u = r.nodeRadius * 4, w = x - u / 2, S = c.get(s.nodeId);
442
- if (S) {
443
- const z = (h + l) / 2;
444
- S.x = z, S.y = w - m / 6;
445
- }
446
- t.append("rect").attr("class", "wardley-pipeline-box").attr("x", h - 15).attr("y", w).attr("width", l - h + 30).attr("height", u).attr("fill", "none").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
447
- }
448
- });
449
- }
450
- const _ = P.append("g").attr("class", "wardley-links"), Z = /* @__PURE__ */ new Map();
451
- g.pipelines.forEach((t) => {
452
- Z.set(t.nodeId, new Set(t.componentIds));
453
- });
454
- const U = g.links.filter((t) => {
455
- if (!c.has(t.source) || !c.has(t.target))
456
- return !1;
457
- const n = Z.get(t.target);
458
- return !(n != null && n.has(t.source));
459
- });
460
- _.selectAll("line").data(U).enter().append("line").attr("class", (t) => `wardley-link${t.dashed ? " wardley-link--dashed" : ""}`).attr("x1", (t) => {
461
- const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.source).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = s.x - n.x, x = s.y - n.y, f = Math.sqrt(l * l + x * x);
462
- return n.x + l / f * h;
463
- }).attr("y1", (t) => {
464
- const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.source).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = s.x - n.x, x = s.y - n.y, f = Math.sqrt(l * l + x * x);
465
- return n.y + x / f * h;
466
- }).attr("x2", (t) => {
467
- const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.target).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = n.x - s.x, x = n.y - s.y, f = Math.sqrt(l * l + x * x);
468
- return s.x + l / f * h;
469
- }).attr("y2", (t) => {
470
- const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.target).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = n.x - s.x, x = n.y - s.y, f = Math.sqrt(l * l + x * x);
471
- return s.y + x / f * h;
472
- }).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", (t) => t.dashed ? "6 6" : null).attr("marker-end", (t) => t.flow === "forward" || t.flow === "bidirectional" ? `url(#link-arrow-end-${o})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${o})` : null), _.selectAll("text").data(U.filter((t) => t.label)).enter().append("text").attr("class", "wardley-link-label").attr("x", (t) => {
473
- const n = c.get(t.source), s = c.get(t.target), i = (n.x + s.x) / 2, h = s.y - n.y, l = s.x - n.x, x = Math.sqrt(l * l + h * h), f = 8, u = h / x;
474
- return i + u * f;
475
- }).attr("y", (t) => {
476
- const n = c.get(t.source), s = c.get(t.target), i = (n.y + s.y) / 2, h = s.x - n.x, l = s.y - n.y, x = Math.sqrt(h * h + l * l), f = 8, u = -h / x;
477
- return i + u * f;
478
- }).attr("fill", d.axisTextColor).attr("font-size", r.labelFontSize).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("transform", (t) => {
479
- const n = c.get(t.source), s = c.get(t.target), i = (n.x + s.x) / 2, h = (n.y + s.y) / 2, l = s.x - n.x, x = s.y - n.y, f = Math.sqrt(l * l + x * x), u = 8, w = x / f, S = -l / f, z = i + w * u, W = h + S * u;
480
- let Y = Math.atan2(x, l) * 180 / Math.PI;
481
- return (Y > 90 || Y < -90) && (Y += 180), `rotate(${Y} ${z} ${W})`;
482
- }).text((t) => t.label);
483
- const $t = P.append("g").attr("class", "wardley-trends"), vt = g.trends.map((t) => {
484
- const n = c.get(t.nodeId);
485
- if (!n)
486
- return null;
487
- const s = T(t.targetX), i = A(t.targetY), h = s - n.x, l = i - n.y, x = Math.sqrt(h * h + l * l), f = r.nodeRadius + 2, u = x > f ? s - h / x * f : s, w = x > f ? i - l / x * f : i;
488
- return {
489
- origin: n,
490
- targetX: s,
491
- targetY: i,
492
- adjustedX2: u,
493
- adjustedY2: w
494
- };
495
- }).filter((t) => t !== null);
496
- $t.selectAll("line").data(vt).enter().append("line").attr("class", "wardley-trend").attr("x1", (t) => t.origin.x).attr("y1", (t) => t.origin.y).attr("x2", (t) => t.adjustedX2).attr("y2", (t) => t.adjustedY2).attr("stroke", d.evolutionStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4").attr("marker-end", `url(#arrow-${o})`);
497
- const C = P.append("g").attr("class", "wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr(
498
- "class",
499
- (t) => ["wardley-node", t.className ? `wardley-node--${t.className}` : ""].filter(Boolean).join(" ")
500
- );
501
- C.filter((t) => t.sourceStrategy === "outsource").append("circle").attr("class", "wardley-outsource-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "#666").attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter((t) => t.sourceStrategy === "buy").append("circle").attr("class", "wardley-buy-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "#ccc").attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter((t) => t.sourceStrategy === "build").append("circle").attr("class", "wardley-build-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "#eee").attr("stroke", "#000").attr("stroke-width", 1);
502
- const X = C.filter((t) => t.sourceStrategy === "market");
503
- X.append("circle").attr("class", "wardley-market-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter(
504
- (t) => !t.isPipelineParent && t.sourceStrategy !== "market" && t.className !== "anchor"
505
- ).append("circle").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1);
506
- const H = r.nodeRadius * 0.7, $ = r.nodeRadius * 1.2;
507
- if (X.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x).attr("y1", (t) => c.get(t.id).y - $).attr("x2", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), X.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), X.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x).attr("y2", (t) => c.get(t.id).y - $).attr("stroke", d.componentStroke).attr("stroke-width", 1), X.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y - $).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), X.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), X.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), C.filter((t) => t.isPipelineParent === !0).append("rect").attr("x", (t) => c.get(t.id).x - m / 2).attr("y", (t) => c.get(t.id).y - m / 2).attr("width", m).attr("height", m).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter((t) => t.inertia === !0).append("line").attr("class", "wardley-inertia").attr("x1", (t) => {
508
- const n = c.get(t.id);
509
- let s = t.isPipelineParent ? m / 2 + 15 : r.nodeRadius + 15;
510
- return t.sourceStrategy && (s += r.nodeRadius + 10), n.x + s;
511
- }).attr("y1", (t) => {
512
- const n = c.get(t.id), s = t.isPipelineParent ? m : r.nodeRadius * 2;
513
- return n.y - s / 2;
514
- }).attr("x2", (t) => {
515
- const n = c.get(t.id);
516
- let s = t.isPipelineParent ? m / 2 + 15 : r.nodeRadius + 15;
517
- return t.sourceStrategy && (s += r.nodeRadius + 10), n.x + s;
518
- }).attr("y2", (t) => {
519
- const n = c.get(t.id), s = t.isPipelineParent ? m : r.nodeRadius * 2;
520
- return n.y + s / 2;
521
- }).attr("stroke", d.componentStroke).attr("stroke-width", 6), C.append("text").attr("x", (t) => {
522
- const n = c.get(t.id);
523
- if (t.className === "anchor")
524
- return t.labelOffsetX !== void 0 ? n.x + t.labelOffsetX : n.x;
525
- let s = r.nodeLabelOffset;
526
- t.sourceStrategy && t.labelOffsetX === void 0 && (s += 10);
527
- const i = t.labelOffsetX ?? s;
528
- return n.x + i;
529
- }).attr("y", (t) => {
530
- const n = c.get(t.id);
531
- if (t.className === "anchor")
532
- return t.labelOffsetY !== void 0 ? n.y + t.labelOffsetY : n.y - 3;
533
- let s = -r.nodeLabelOffset;
534
- t.sourceStrategy && t.labelOffsetY === void 0 && (s -= 10);
535
- const i = t.labelOffsetY ?? s;
536
- return n.y + i;
537
- }).attr("class", "wardley-node-label").attr("fill", (t) => t.className === "evolved" ? d.evolutionStroke : t.className === "anchor" ? "#000" : d.componentLabelColor).attr("font-size", r.labelFontSize).attr("font-weight", (t) => t.className === "anchor" ? "bold" : "normal").attr("text-anchor", (t) => t.className === "anchor" ? "middle" : "start").attr("dominant-baseline", (t) => t.className === "anchor" ? "middle" : "auto").text((t) => t.label), g.annotations.length > 0) {
538
- const t = P.append("g").attr("class", "wardley-annotations");
539
- if (g.annotations.forEach((n) => {
540
- const s = n.coordinates.map((i) => ({
541
- x: T(i.x),
542
- y: A(i.y)
543
- }));
544
- if (s.length > 1)
545
- for (let i = 0; i < s.length - 1; i++)
546
- t.append("line").attr("class", "wardley-annotation-line").attr("x1", s[i].x).attr("y1", s[i].y).attr("x2", s[i + 1].x).attr("y2", s[i + 1].y).attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("stroke-dasharray", "4 4");
547
- s.forEach((i) => {
548
- const h = t.append("g").attr("class", "wardley-annotation");
549
- h.append("circle").attr("cx", i.x).attr("cy", i.y).attr("r", 10).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5), h.append("text").attr("x", i.x).attr("y", i.y).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.number);
550
- });
551
- }), g.annotationsBox) {
552
- let n = T(g.annotationsBox.x), s = A(g.annotationsBox.y);
553
- const i = 10, h = 16, l = 11, x = t.append("g").attr("class", "wardley-annotations-box"), f = [...g.annotations].filter((w) => w.text).sort((w, S) => w.number - S.number), u = [];
554
- if (f.forEach((w, S) => {
555
- const z = x.append("text").attr("x", n + i).attr("y", s + i + (S + 1) * h).attr("font-size", l).attr("fill", d.axisTextColor).attr("text-anchor", "start").attr("dominant-baseline", "middle").text(`${w.number}. ${w.text}`);
556
- u.push(z);
557
- }), u.length > 0) {
558
- let w = 0, S = 0;
559
- u.forEach((j) => {
560
- const D = j.node(), Nt = D.getComputedTextLength();
561
- w = Math.max(w, Nt);
562
- const Ct = D.getBBox();
563
- S = Math.max(S, Ct.height);
564
- });
565
- const z = w + i * 2 + 105, W = f.length * h + i * 2 + S / 2, Y = r.padding, Pt = M - r.padding - z, St = r.padding, Mt = k - r.padding - W;
566
- n = Math.max(Y, Math.min(n, Pt)), s = Math.max(St, Math.min(s, Mt)), u.forEach((j, D) => {
567
- j.attr("x", n + i).attr("y", s + i + (D + 1) * h);
568
- }), x.insert("rect", "text").attr("x", n).attr("y", s).attr("width", z).attr("height", W).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
569
- }
570
- }
571
- }
572
- if (g.notes.length > 0) {
573
- const t = P.append("g").attr("class", "wardley-notes");
574
- g.notes.forEach((n) => {
575
- const s = T(n.x), i = A(n.y);
576
- t.append("text").attr("x", s).attr("y", i).attr("text-anchor", "start").attr("font-size", 11).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.text);
577
- });
578
- }
579
- if (g.accelerators.length > 0) {
580
- const t = P.append("g").attr("class", "wardley-accelerators");
581
- g.accelerators.forEach((n) => {
582
- const s = T(n.x), i = A(n.y), h = 60, l = 30, x = 20, f = `
583
- M ${s} ${i - l / 2}
584
- L ${s + h - x} ${i - l / 2}
585
- L ${s + h - x} ${i - l / 2 - 8}
586
- L ${s + h} ${i}
587
- L ${s + h - x} ${i + l / 2 + 8}
588
- L ${s + h - x} ${i + l / 2}
589
- L ${s} ${i + l / 2}
590
- Z
591
- `;
592
- t.append("path").attr("d", f).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", s + h / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.name);
593
- });
594
- }
595
- if (g.deaccelerators.length > 0) {
596
- const t = P.append("g").attr("class", "wardley-deaccelerators");
597
- g.deaccelerators.forEach((n) => {
598
- const s = T(n.x), i = A(n.y), h = 60, l = 30, x = 20, f = `
599
- M ${s + h} ${i - l / 2}
600
- L ${s + x} ${i - l / 2}
601
- L ${s + x} ${i - l / 2 - 8}
602
- L ${s} ${i}
603
- L ${s + x} ${i + l / 2 + 8}
604
- L ${s + x} ${i + l / 2}
605
- L ${s + h} ${i + l / 2}
606
- Z
607
- `;
608
- t.append("path").attr("d", f).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", s + h / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.name);
609
- });
610
- }
611
- }, "draw"), Ut = {
612
- draw: Zt
613
- }, Jt = /* @__PURE__ */ y(({
614
- wardley: a
615
- } = {}) => {
616
- const o = It(), e = Bt(), p = Q(o, e.themeVariables), r = Q(p.wardley, a);
617
- return `
618
- .wardley-background {
619
- fill: ${r.backgroundColor};
620
- }
621
- .wardley-axes line, .wardley-axes path {
622
- stroke: ${r.axisColor};
623
- }
624
- .wardley-axis-label {
625
- fill: ${r.axisTextColor};
626
- }
627
- .wardley-stage-label {
628
- fill: ${r.axisTextColor};
629
- }
630
- .wardley-grid line {
631
- stroke: ${r.gridColor};
632
- }
633
- .wardley-node circle {
634
- fill: ${r.componentFill};
635
- stroke: ${r.componentStroke};
636
- }
637
- .wardley-node-label {
638
- fill: ${r.componentLabelColor};
639
- }
640
- .wardley-link {
641
- stroke: ${r.linkStroke};
642
- }
643
- .wardley-link--dashed {
644
- stroke-dasharray: 4 4;
645
- }
646
- .wardley-link-label {
647
- fill: ${r.axisTextColor};
648
- }
649
- .wardley-trend line {
650
- stroke: ${r.evolutionStroke};
651
- }
652
- .wardley-annotation-line {
653
- stroke: ${r.annotationStroke};
654
- }
655
- .wardley-annotation circle {
656
- fill: ${r.annotationFill};
657
- stroke: ${r.annotationStroke};
658
- }
659
- .wardley-annotation text {
660
- fill: ${r.annotationTextColor};
661
- }
662
- .wardley-annotations-box rect {
663
- fill: ${r.annotationFill};
664
- stroke: ${r.annotationStroke};
665
- }
666
- .wardley-annotations-box text {
667
- fill: ${r.annotationTextColor};
668
- }
669
- .wardley-pipeline-box {
670
- stroke: ${r.componentStroke};
671
- }
672
- .wardley-notes text {
673
- fill: ${r.axisTextColor};
674
- }
675
- `;
676
- }, "styles"), ae = {
677
- parser: at,
678
- db: Ht,
679
- renderer: Ut,
680
- styles: Jt
681
- };
682
- export {
683
- ae as diagram
684
- };