@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6

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 (158) hide show
  1. package/README.md +79 -8
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +340 -217
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,675 @@
1
+ import { p as Mt } from "./chunk-JWPE2WC7-CDBrSjU7.js";
2
+ import { s as Nt, g as Tt, x as zt, v as Lt, a as At, b as Xt, _ as u, Y as Et, O as Yt, Q as U, l as K, T as It, d as Bt, D as Ft, c as V } from "./mermaid.core-yQghUlIz.js";
3
+ import { p as Ot } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
4
+ var G = /* @__PURE__ */ u((o, r) => {
5
+ const e = o <= 1 ? o * 100 : o;
6
+ if (e < 0 || e > 100)
7
+ throw new Error(
8
+ `${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`
9
+ );
10
+ return e;
11
+ }, "toPercent"), A = /* @__PURE__ */ u((o, r, e) => ({
12
+ x: G(r, `${e} evolution`),
13
+ y: G(o, `${e} visibility`)
14
+ }), "toCoordinates"), J = /* @__PURE__ */ u((o) => {
15
+ if (o) {
16
+ if (o === "+<>")
17
+ return "bidirectional";
18
+ if (o === "+<")
19
+ return "backward";
20
+ if (o === "+>")
21
+ return "forward";
22
+ }
23
+ }, "getFlowFromPort"), Rt = /* @__PURE__ */ u((o) => {
24
+ if (!o?.startsWith("+"))
25
+ return {};
26
+ const e = /^\+'([^']*)'/.exec(o)?.[1];
27
+ return o.includes("<>") ? { flow: "bidirectional", label: e } : o.includes("<") ? { flow: "backward", label: e } : o.includes(">") ? { flow: "forward", label: e } : { label: e };
28
+ }, "extractFlowFromArrow"), Wt = /* @__PURE__ */ u((o, r) => {
29
+ if (Mt(o, r), o.size && r.setSize(o.size.width, o.size.height), o.evolution) {
30
+ const e = o.evolution.stages.map((a) => a.secondName ? `${a.name.trim()} / ${a.secondName.trim()}` : a.name.trim()), h = o.evolution.stages.filter((a) => a.boundary !== void 0).map((a) => a.boundary);
31
+ r.updateAxes({ stages: e, stageBoundaries: h });
32
+ }
33
+ if (o.anchors.forEach((e) => {
34
+ const h = A(e.visibility, e.evolution, `Anchor "${e.name}"`);
35
+ r.addNode(e.name, e.name, h.x, h.y, "anchor");
36
+ }), o.components.forEach((e) => {
37
+ const h = A(
38
+ e.visibility,
39
+ e.evolution,
40
+ `Component "${e.name}"`
41
+ ), a = 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, w = e.decorator?.strategy;
42
+ r.addNode(
43
+ e.name,
44
+ e.name,
45
+ h.x,
46
+ h.y,
47
+ "component",
48
+ a,
49
+ d,
50
+ e.inertia,
51
+ w
52
+ );
53
+ }), o.notes.forEach((e) => {
54
+ const h = A(e.visibility, e.evolution, `Note "${e.text}"`);
55
+ r.addNote(e.text, h.x, h.y);
56
+ }), o.pipelines.forEach((e) => {
57
+ const h = r.getNode(e.parent);
58
+ if (!h || typeof h.y != "number")
59
+ throw new Error(
60
+ `Pipeline "${e.parent}" must reference an existing component with coordinates.`
61
+ );
62
+ const a = h.y;
63
+ r.startPipeline(e.parent), e.components.forEach((d) => {
64
+ const w = `${e.parent}_${d.name}`, C = 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, O = G(d.evolution, `Pipeline component "${d.name}" evolution`);
65
+ r.addNode(
66
+ w,
67
+ d.name,
68
+ O,
69
+ a,
70
+ "pipeline-component",
71
+ C,
72
+ g
73
+ ), r.addPipelineComponent(e.parent, w);
74
+ });
75
+ }), o.links.forEach((e) => {
76
+ const h = !!e.arrow && (e.arrow.includes("-.->") || e.arrow.includes(".-."));
77
+ let a = J(e.fromPort) ?? J(e.toPort);
78
+ const { flow: d, label: w } = Rt(e.arrow);
79
+ !a && d && (a = d);
80
+ const C = e.linkLabel, g = w ?? C;
81
+ r.addLink(r.resolveNodeId(e.from), r.resolveNodeId(e.to), h, g, a);
82
+ }), o.evolves.forEach((e) => {
83
+ const h = r.getNode(e.component);
84
+ if (h?.y !== void 0) {
85
+ const a = G(e.target, `Evolve target for "${e.component}"`);
86
+ r.addTrend(e.component, a, h.y);
87
+ }
88
+ }), o.annotations.length > 0) {
89
+ const e = o.annotations[0], h = A(e.x, e.y, "Annotations box");
90
+ r.setAnnotationsBox(h.x, h.y);
91
+ }
92
+ o.annotation.forEach((e) => {
93
+ const h = A(e.x, e.y, `Annotation ${e.number}`);
94
+ r.addAnnotation(e.number, [{ x: h.x, y: h.y }], e.text);
95
+ }), o.accelerators.forEach((e) => {
96
+ const h = A(e.x, e.y, `Accelerator "${e.name}"`);
97
+ r.addAccelerator(e.name, h.x, h.y);
98
+ }), o.deaccelerators.forEach((e) => {
99
+ const h = A(
100
+ e.x,
101
+ e.y,
102
+ `Deaccelerator "${e.name}"`
103
+ );
104
+ r.addDeaccelerator(e.name, h.x, h.y);
105
+ });
106
+ }, "populateDb"), tt = {
107
+ parser: {
108
+ // @ts-expect-error - WardleyDB is not assignable to DiagramDB
109
+ yy: void 0
110
+ },
111
+ parse: /* @__PURE__ */ u(async (o) => {
112
+ const r = await Ot("wardley", o);
113
+ K.debug(r);
114
+ const e = tt.parser?.yy;
115
+ if (!e || typeof e.addNode != "function")
116
+ throw new Error(
117
+ "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."
118
+ );
119
+ Wt(r, e);
120
+ }, "parse")
121
+ }, E, Dt = (E = class {
122
+ constructor() {
123
+ 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 = {};
124
+ }
125
+ addNode(r) {
126
+ const e = this.nodes.get(r.id) ?? { id: r.id, label: r.label }, h = {
127
+ ...e,
128
+ ...r,
129
+ className: r.className ?? e.className,
130
+ labelOffsetX: r.labelOffsetX ?? e.labelOffsetX,
131
+ labelOffsetY: r.labelOffsetY ?? e.labelOffsetY
132
+ };
133
+ this.nodes.set(r.id, h);
134
+ }
135
+ addLink(r) {
136
+ this.links.push(r);
137
+ }
138
+ addTrend(r) {
139
+ this.trends.set(r.nodeId, r);
140
+ }
141
+ startPipeline(r) {
142
+ this.pipelines.set(r, { nodeId: r, componentIds: [] });
143
+ const e = this.nodes.get(r);
144
+ e && (e.isPipelineParent = !0);
145
+ }
146
+ addPipelineComponent(r, e) {
147
+ const h = this.pipelines.get(r);
148
+ h && h.componentIds.push(e);
149
+ const a = this.nodes.get(e);
150
+ a && (a.inPipeline = !0);
151
+ }
152
+ addAnnotation(r) {
153
+ this.annotations.push(r);
154
+ }
155
+ addNote(r) {
156
+ this.notes.push(r);
157
+ }
158
+ addAccelerator(r) {
159
+ this.accelerators.push(r);
160
+ }
161
+ addDeaccelerator(r) {
162
+ this.deaccelerators.push(r);
163
+ }
164
+ setAnnotationsBox(r, e) {
165
+ this.annotationsBox = { x: r, y: e };
166
+ }
167
+ setAxes(r) {
168
+ this.axes = {
169
+ ...this.axes,
170
+ ...r
171
+ };
172
+ }
173
+ setSize(r, e) {
174
+ this.size = { width: r, height: e };
175
+ }
176
+ getNode(r) {
177
+ return this.nodes.get(r);
178
+ }
179
+ /**
180
+ * Resolve a name to a node ID. Tries exact ID match first,
181
+ * then falls back to finding a node whose label matches the name
182
+ * (handles pipeline components which have synthetic IDs like "Parent_Child").
183
+ */
184
+ resolveNodeId(r) {
185
+ if (this.nodes.has(r))
186
+ return r;
187
+ for (const [e, h] of this.nodes)
188
+ if (h.label === r)
189
+ return e;
190
+ return r;
191
+ }
192
+ build() {
193
+ const r = [];
194
+ for (const e of this.nodes.values()) {
195
+ if (typeof e.x != "number" || typeof e.y != "number")
196
+ throw new Error(`Node "${e.label}" is missing coordinates`);
197
+ r.push(e);
198
+ }
199
+ return {
200
+ nodes: r,
201
+ links: [...this.links],
202
+ trends: [...this.trends.values()],
203
+ pipelines: [...this.pipelines.values()],
204
+ annotations: [...this.annotations],
205
+ notes: [...this.notes],
206
+ accelerators: [...this.accelerators],
207
+ deaccelerators: [...this.deaccelerators],
208
+ annotationsBox: this.annotationsBox,
209
+ axes: { ...this.axes },
210
+ size: this.size
211
+ };
212
+ }
213
+ clear() {
214
+ 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;
215
+ }
216
+ }, u(E, "WardleyBuilder"), E), k = new Dt();
217
+ function et() {
218
+ return V()["wardley-beta"];
219
+ }
220
+ u(et, "getConfig");
221
+ function at(o, r, e, h, a, d, w, C, g) {
222
+ k.addNode({
223
+ id: o,
224
+ label: r,
225
+ x: e,
226
+ y: h,
227
+ className: a,
228
+ labelOffsetX: d,
229
+ labelOffsetY: w,
230
+ inertia: C,
231
+ sourceStrategy: g
232
+ });
233
+ }
234
+ u(at, "addNode");
235
+ function rt(o, r, e = !1, h, a) {
236
+ k.addLink({
237
+ source: o,
238
+ target: r,
239
+ dashed: e,
240
+ label: h,
241
+ flow: a
242
+ });
243
+ }
244
+ u(rt, "addLink");
245
+ function ot(o, r, e) {
246
+ k.addTrend({ nodeId: o, targetX: r, targetY: e });
247
+ }
248
+ u(ot, "addTrend");
249
+ function nt(o, r, e) {
250
+ k.addAnnotation({
251
+ number: o,
252
+ coordinates: r,
253
+ text: e
254
+ });
255
+ }
256
+ u(nt, "addAnnotation");
257
+ function st(o, r, e) {
258
+ k.addNote({
259
+ text: o,
260
+ x: r,
261
+ y: e
262
+ });
263
+ }
264
+ u(st, "addNote");
265
+ function it(o, r, e) {
266
+ k.addAccelerator({
267
+ name: o,
268
+ x: r,
269
+ y: e
270
+ });
271
+ }
272
+ u(it, "addAccelerator");
273
+ function dt(o, r, e) {
274
+ k.addDeaccelerator({
275
+ name: o,
276
+ x: r,
277
+ y: e
278
+ });
279
+ }
280
+ u(dt, "addDeaccelerator");
281
+ function lt(o, r) {
282
+ k.setAnnotationsBox(o, r);
283
+ }
284
+ u(lt, "setAnnotationsBox");
285
+ function ct(o, r) {
286
+ k.setSize(o, r);
287
+ }
288
+ u(ct, "setSize");
289
+ function pt(o) {
290
+ k.startPipeline(o);
291
+ }
292
+ u(pt, "startPipeline");
293
+ function ft(o, r) {
294
+ k.addPipelineComponent(o, r);
295
+ }
296
+ u(ft, "addPipelineComponent");
297
+ function ht(o) {
298
+ k.setAxes(o);
299
+ }
300
+ u(ht, "updateAxes");
301
+ function xt(o) {
302
+ return k.getNode(o);
303
+ }
304
+ u(xt, "getNode");
305
+ function gt(o) {
306
+ return k.resolveNodeId(o);
307
+ }
308
+ u(gt, "resolveNodeId");
309
+ function yt() {
310
+ return k.build();
311
+ }
312
+ u(yt, "getWardleyData");
313
+ function ut() {
314
+ k.clear(), Ft();
315
+ }
316
+ u(ut, "clear");
317
+ var Gt = {
318
+ getConfig: et,
319
+ addNode: at,
320
+ addLink: rt,
321
+ addTrend: ot,
322
+ addAnnotation: nt,
323
+ addNote: st,
324
+ addAccelerator: it,
325
+ addDeaccelerator: dt,
326
+ setAnnotationsBox: lt,
327
+ setSize: ct,
328
+ startPipeline: pt,
329
+ addPipelineComponent: ft,
330
+ updateAxes: ht,
331
+ getNode: xt,
332
+ resolveNodeId: gt,
333
+ getWardleyData: yt,
334
+ clear: ut,
335
+ setAccTitle: Xt,
336
+ getAccTitle: At,
337
+ setDiagramTitle: Lt,
338
+ getDiagramTitle: zt,
339
+ getAccDescription: Tt,
340
+ setAccDescription: Nt
341
+ }, qt = ["Genesis", "Custom Built", "Product", "Commodity"], Ht = /* @__PURE__ */ u(() => {
342
+ const { themeVariables: o } = V();
343
+ return {
344
+ backgroundColor: o.wardley?.backgroundColor ?? o.background ?? "#fff",
345
+ axisColor: o.wardley?.axisColor ?? "#000",
346
+ axisTextColor: o.wardley?.axisTextColor ?? o.primaryTextColor ?? "#222",
347
+ gridColor: o.wardley?.gridColor ?? "rgba(100, 100, 100, 0.2)",
348
+ componentFill: o.wardley?.componentFill ?? "#fff",
349
+ componentStroke: o.wardley?.componentStroke ?? "#000",
350
+ componentLabelColor: o.wardley?.componentLabelColor ?? o.primaryTextColor ?? "#222",
351
+ linkStroke: o.wardley?.linkStroke ?? "#000",
352
+ evolutionStroke: o.wardley?.evolutionStroke ?? "#dc3545",
353
+ annotationStroke: o.wardley?.annotationStroke ?? "#000",
354
+ annotationTextColor: o.wardley?.annotationTextColor ?? o.primaryTextColor ?? "#222",
355
+ annotationFill: o.wardley?.annotationFill ?? o.background ?? "#fff"
356
+ };
357
+ }, "getTheme"), jt = /* @__PURE__ */ u(() => {
358
+ const o = V()["wardley-beta"];
359
+ return {
360
+ width: o?.width ?? 900,
361
+ height: o?.height ?? 600,
362
+ padding: o?.padding ?? 48,
363
+ nodeRadius: o?.nodeRadius ?? 6,
364
+ nodeLabelOffset: o?.nodeLabelOffset ?? 8,
365
+ axisFontSize: o?.axisFontSize ?? 12,
366
+ labelFontSize: o?.labelFontSize ?? 10,
367
+ showGrid: o?.showGrid ?? !1,
368
+ useMaxWidth: o?.useMaxWidth ?? !0
369
+ };
370
+ }, "getConfigValues"), Vt = /* @__PURE__ */ u((o, r, e, h) => {
371
+ K.debug(`Rendering Wardley map
372
+ ` + o);
373
+ const a = jt(), d = Ht(), w = a.nodeRadius * 1.6, C = h.db, g = C.getWardleyData(), O = C.getDiagramTitle(), S = g.size?.width ?? a.width, b = g.size?.height ?? a.height, Y = It(r);
374
+ Y.selectAll("*").remove(), Bt(Y, b, S, a.useMaxWidth), Y.attr("viewBox", `0 0 ${S} ${b}`);
375
+ const v = Y.append("g").attr("class", "wardley-map"), q = Y.append("defs");
376
+ q.append("marker").attr("id", `arrow-${r}`).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-${r}`).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-${r}`).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"), v.append("rect").attr("class", "wardley-background").attr("width", S).attr("height", b).attr("fill", d.backgroundColor);
377
+ const I = S - a.padding * 2, B = b - a.padding * 2;
378
+ O && v.append("text").attr("class", "wardley-title").attr("x", S / 2).attr("y", a.padding / 2).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize * 1.05).attr("font-weight", "bold").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(O);
379
+ const T = /* @__PURE__ */ u((t) => a.padding + t / 100 * I, "projectX"), z = /* @__PURE__ */ u((t) => b - a.padding - t / 100 * B, "projectY"), R = v.append("g").attr("class", "wardley-axes");
380
+ R.append("line").attr("x1", a.padding).attr("x2", S - a.padding).attr("y1", b - a.padding).attr("y2", b - a.padding).attr("stroke", d.axisColor).attr("stroke-width", 1), R.append("line").attr("x1", a.padding).attr("x2", a.padding).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", d.axisColor).attr("stroke-width", 1);
381
+ const wt = g.axes.xLabel ?? "Evolution", mt = g.axes.yLabel ?? "Visibility";
382
+ R.append("text").attr("class", "wardley-axis-label wardley-axis-label-x").attr("x", a.padding + I / 2).attr("y", b - a.padding / 4).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").text(wt), R.append("text").attr("class", "wardley-axis-label wardley-axis-label-y").attr("x", a.padding / 3).attr("y", a.padding + B / 2).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").attr(
383
+ "transform",
384
+ `rotate(-90 ${a.padding / 3} ${a.padding + B / 2})`
385
+ ).text(mt);
386
+ const F = g.axes.stages && g.axes.stages.length > 0 ? g.axes.stages : qt;
387
+ if (F.length > 0) {
388
+ const t = v.append("g").attr("class", "wardley-stages"), s = g.axes.stageBoundaries, n = [];
389
+ if (s && s.length === F.length) {
390
+ let i = 0;
391
+ s.forEach((p) => {
392
+ n.push({ start: i, end: p }), i = p;
393
+ });
394
+ } else {
395
+ const i = 1 / F.length;
396
+ F.forEach((p, l) => {
397
+ n.push({
398
+ start: l * i,
399
+ end: (l + 1) * i
400
+ });
401
+ });
402
+ }
403
+ F.forEach((i, p) => {
404
+ const l = n[p], f = a.padding + l.start * I, x = a.padding + l.end * I, y = (f + x) / 2;
405
+ p > 0 && t.append("line").attr("x1", f).attr("x2", f).attr("y1", a.padding).attr("y2", b - a.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", y).attr("y", b - a.padding / 1.5).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize - 2).attr("text-anchor", "middle").text(i);
406
+ });
407
+ }
408
+ if (a.showGrid) {
409
+ const t = v.append("g").attr("class", "wardley-grid");
410
+ for (let s = 1; s < 4; s++) {
411
+ const n = s / 4, i = a.padding + I * n;
412
+ t.append("line").attr("x1", i).attr("x2", i).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6"), t.append("line").attr("x1", a.padding).attr("x2", S - a.padding).attr("y1", b - a.padding - B * n).attr("y2", b - a.padding - B * n).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6");
413
+ }
414
+ }
415
+ const c = /* @__PURE__ */ new Map();
416
+ if (g.nodes.forEach((t) => {
417
+ c.set(t.id, {
418
+ x: T(t.x),
419
+ y: z(t.y),
420
+ node: t
421
+ });
422
+ }), g.pipelines.length > 0) {
423
+ const t = v.append("g").attr("class", "wardley-pipelines"), s = v.append("g").attr("class", "wardley-pipeline-links");
424
+ g.pipelines.forEach((n) => {
425
+ if (n.componentIds.length === 0)
426
+ return;
427
+ const i = n.componentIds.map((x) => ({ id: x, pos: c.get(x), node: g.nodes.find((y) => y.id === x) })).filter((x) => x.pos && x.node).sort((x, y) => x.node.x - y.node.x);
428
+ for (let x = 0; x < i.length - 1; x++) {
429
+ const y = i[x], m = i[x + 1];
430
+ s.append("line").attr("class", "wardley-pipeline-evolution-link").attr("x1", y.pos.x).attr("y1", y.pos.y).attr("x2", m.pos.x).attr("y2", m.pos.y).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4");
431
+ }
432
+ let p = 1 / 0, l = -1 / 0, f = 0;
433
+ if (n.componentIds.forEach((x) => {
434
+ const y = c.get(x);
435
+ y && (p = Math.min(p, y.x), l = Math.max(l, y.x), f = y.y);
436
+ }), p !== 1 / 0 && l !== -1 / 0) {
437
+ const y = a.nodeRadius * 4, m = f - y / 2, P = c.get(n.nodeId);
438
+ if (P) {
439
+ const N = (p + l) / 2;
440
+ P.x = N, P.y = m - w / 6;
441
+ }
442
+ t.append("rect").attr("class", "wardley-pipeline-box").attr("x", p - 15).attr("y", m).attr("width", l - p + 30).attr("height", y).attr("fill", "none").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
443
+ }
444
+ });
445
+ }
446
+ const _ = v.append("g").attr("class", "wardley-links"), Z = /* @__PURE__ */ new Map();
447
+ g.pipelines.forEach((t) => {
448
+ Z.set(t.nodeId, new Set(t.componentIds));
449
+ });
450
+ const Q = g.links.filter((t) => !(!c.has(t.source) || !c.has(t.target) || Z.get(t.target)?.has(t.source)));
451
+ _.selectAll("line").data(Q).enter().append("line").attr("class", (t) => `wardley-link${t.dashed ? " wardley-link--dashed" : ""}`).attr("x1", (t) => {
452
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f);
453
+ return s.x + l / x * p;
454
+ }).attr("y1", (t) => {
455
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f);
456
+ return s.y + f / x * p;
457
+ }).attr("x2", (t) => {
458
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - n.x, f = s.y - n.y, x = Math.sqrt(l * l + f * f);
459
+ return n.x + l / x * p;
460
+ }).attr("y2", (t) => {
461
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - n.x, f = s.y - n.y, x = Math.sqrt(l * l + f * f);
462
+ return n.y + f / x * p;
463
+ }).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-${r})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${r})` : null), _.selectAll("text").data(Q.filter((t) => t.label)).enter().append("text").attr("class", "wardley-link-label").attr("x", (t) => {
464
+ const s = c.get(t.source), n = c.get(t.target), i = (s.x + n.x) / 2, p = n.y - s.y, l = n.x - s.x, f = Math.sqrt(l * l + p * p), x = 8, y = p / f;
465
+ return i + y * x;
466
+ }).attr("y", (t) => {
467
+ const s = c.get(t.source), n = c.get(t.target), i = (s.y + n.y) / 2, p = n.x - s.x, l = n.y - s.y, f = Math.sqrt(p * p + l * l), x = 8, y = -p / f;
468
+ return i + y * x;
469
+ }).attr("fill", d.axisTextColor).attr("font-size", a.labelFontSize).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("transform", (t) => {
470
+ const s = c.get(t.source), n = c.get(t.target), i = (s.x + n.x) / 2, p = (s.y + n.y) / 2, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f), y = 8, m = f / x, P = -l / x, N = i + m * y, W = p + P * y;
471
+ let X = Math.atan2(f, l) * 180 / Math.PI;
472
+ return (X > 90 || X < -90) && (X += 180), `rotate(${X} ${N} ${W})`;
473
+ }).text((t) => t.label);
474
+ const kt = v.append("g").attr("class", "wardley-trends"), bt = g.trends.map((t) => {
475
+ const s = c.get(t.nodeId);
476
+ if (!s)
477
+ return null;
478
+ const n = T(t.targetX), i = z(t.targetY), p = n - s.x, l = i - s.y, f = Math.sqrt(p * p + l * l), x = a.nodeRadius + 2, y = f > x ? n - p / f * x : n, m = f > x ? i - l / f * x : i;
479
+ return {
480
+ origin: s,
481
+ targetX: n,
482
+ targetY: i,
483
+ adjustedX2: y,
484
+ adjustedY2: m
485
+ };
486
+ }).filter((t) => t !== null);
487
+ kt.selectAll("line").data(bt).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-${r})`);
488
+ const M = v.append("g").attr("class", "wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr(
489
+ "class",
490
+ (t) => ["wardley-node", t.className ? `wardley-node--${t.className}` : ""].filter(Boolean).join(" ")
491
+ );
492
+ M.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", a.nodeRadius * 2).attr("fill", "#666").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.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", a.nodeRadius * 2).attr("fill", "#ccc").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.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", a.nodeRadius * 2).attr("fill", "#eee").attr("stroke", "#000").attr("stroke-width", 1);
493
+ const L = M.filter((t) => t.sourceStrategy === "market");
494
+ L.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", a.nodeRadius * 2).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter(
495
+ (t) => !t.isPipelineParent && t.sourceStrategy !== "market" && t.className !== "anchor"
496
+ ).append("circle").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1);
497
+ const H = a.nodeRadius * 0.7, $ = a.nodeRadius * 1.2;
498
+ if (L.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), L.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), L.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), L.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), L.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), L.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), M.filter((t) => t.isPipelineParent === !0).append("rect").attr("x", (t) => c.get(t.id).x - w / 2).attr("y", (t) => c.get(t.id).y - w / 2).attr("width", w).attr("height", w).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.inertia === !0).append("line").attr("class", "wardley-inertia").attr("x1", (t) => {
499
+ const s = c.get(t.id);
500
+ let n = t.isPipelineParent ? w / 2 + 15 : a.nodeRadius + 15;
501
+ return t.sourceStrategy && (n += a.nodeRadius + 10), s.x + n;
502
+ }).attr("y1", (t) => {
503
+ const s = c.get(t.id), n = t.isPipelineParent ? w : a.nodeRadius * 2;
504
+ return s.y - n / 2;
505
+ }).attr("x2", (t) => {
506
+ const s = c.get(t.id);
507
+ let n = t.isPipelineParent ? w / 2 + 15 : a.nodeRadius + 15;
508
+ return t.sourceStrategy && (n += a.nodeRadius + 10), s.x + n;
509
+ }).attr("y2", (t) => {
510
+ const s = c.get(t.id), n = t.isPipelineParent ? w : a.nodeRadius * 2;
511
+ return s.y + n / 2;
512
+ }).attr("stroke", d.componentStroke).attr("stroke-width", 6), M.append("text").attr("x", (t) => {
513
+ const s = c.get(t.id);
514
+ if (t.className === "anchor")
515
+ return t.labelOffsetX !== void 0 ? s.x + t.labelOffsetX : s.x;
516
+ let n = a.nodeLabelOffset;
517
+ t.sourceStrategy && t.labelOffsetX === void 0 && (n += 10);
518
+ const i = t.labelOffsetX ?? n;
519
+ return s.x + i;
520
+ }).attr("y", (t) => {
521
+ const s = c.get(t.id);
522
+ if (t.className === "anchor")
523
+ return t.labelOffsetY !== void 0 ? s.y + t.labelOffsetY : s.y - 3;
524
+ let n = -a.nodeLabelOffset;
525
+ t.sourceStrategy && t.labelOffsetY === void 0 && (n -= 10);
526
+ const i = t.labelOffsetY ?? n;
527
+ return s.y + i;
528
+ }).attr("class", "wardley-node-label").attr("fill", (t) => t.className === "evolved" ? d.evolutionStroke : t.className === "anchor" ? "#000" : d.componentLabelColor).attr("font-size", a.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) {
529
+ const t = v.append("g").attr("class", "wardley-annotations");
530
+ if (g.annotations.forEach((s) => {
531
+ const n = s.coordinates.map((i) => ({
532
+ x: T(i.x),
533
+ y: z(i.y)
534
+ }));
535
+ if (n.length > 1)
536
+ for (let i = 0; i < n.length - 1; i++)
537
+ t.append("line").attr("class", "wardley-annotation-line").attr("x1", n[i].x).attr("y1", n[i].y).attr("x2", n[i + 1].x).attr("y2", n[i + 1].y).attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("stroke-dasharray", "4 4");
538
+ n.forEach((i) => {
539
+ const p = t.append("g").attr("class", "wardley-annotation");
540
+ p.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), p.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(s.number);
541
+ });
542
+ }), g.annotationsBox) {
543
+ let s = T(g.annotationsBox.x), n = z(g.annotationsBox.y);
544
+ const i = 10, p = 16, l = 11, f = t.append("g").attr("class", "wardley-annotations-box"), x = [...g.annotations].filter((m) => m.text).sort((m, P) => m.number - P.number), y = [];
545
+ if (x.forEach((m, P) => {
546
+ const N = f.append("text").attr("x", s + i).attr("y", n + i + (P + 1) * p).attr("font-size", l).attr("fill", d.axisTextColor).attr("text-anchor", "start").attr("dominant-baseline", "middle").text(`${m.number}. ${m.text}`);
547
+ y.push(N);
548
+ }), y.length > 0) {
549
+ let m = 0, P = 0;
550
+ y.forEach((j) => {
551
+ const D = j.node(), Ct = D.getComputedTextLength();
552
+ m = Math.max(m, Ct);
553
+ const St = D.getBBox();
554
+ P = Math.max(P, St.height);
555
+ });
556
+ const N = m + i * 2 + 105, W = x.length * p + i * 2 + P / 2, X = a.padding, $t = S - a.padding - N, vt = a.padding, Pt = b - a.padding - W;
557
+ s = Math.max(X, Math.min(s, $t)), n = Math.max(vt, Math.min(n, Pt)), y.forEach((j, D) => {
558
+ j.attr("x", s + i).attr("y", n + i + (D + 1) * p);
559
+ }), f.insert("rect", "text").attr("x", s).attr("y", n).attr("width", N).attr("height", W).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
560
+ }
561
+ }
562
+ }
563
+ if (g.notes.length > 0) {
564
+ const t = v.append("g").attr("class", "wardley-notes");
565
+ g.notes.forEach((s) => {
566
+ const n = T(s.x), i = z(s.y);
567
+ t.append("text").attr("x", n).attr("y", i).attr("text-anchor", "start").attr("font-size", 11).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.text);
568
+ });
569
+ }
570
+ if (g.accelerators.length > 0) {
571
+ const t = v.append("g").attr("class", "wardley-accelerators");
572
+ g.accelerators.forEach((s) => {
573
+ const n = T(s.x), i = z(s.y), p = 60, l = 30, f = 20, x = `
574
+ M ${n} ${i - l / 2}
575
+ L ${n + p - f} ${i - l / 2}
576
+ L ${n + p - f} ${i - l / 2 - 8}
577
+ L ${n + p} ${i}
578
+ L ${n + p - f} ${i + l / 2 + 8}
579
+ L ${n + p - f} ${i + l / 2}
580
+ L ${n} ${i + l / 2}
581
+ Z
582
+ `;
583
+ t.append("path").attr("d", x).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", n + p / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.name);
584
+ });
585
+ }
586
+ if (g.deaccelerators.length > 0) {
587
+ const t = v.append("g").attr("class", "wardley-deaccelerators");
588
+ g.deaccelerators.forEach((s) => {
589
+ const n = T(s.x), i = z(s.y), p = 60, l = 30, f = 20, x = `
590
+ M ${n + p} ${i - l / 2}
591
+ L ${n + f} ${i - l / 2}
592
+ L ${n + f} ${i - l / 2 - 8}
593
+ L ${n} ${i}
594
+ L ${n + f} ${i + l / 2 + 8}
595
+ L ${n + f} ${i + l / 2}
596
+ L ${n + p} ${i + l / 2}
597
+ Z
598
+ `;
599
+ t.append("path").attr("d", x).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", n + p / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.name);
600
+ });
601
+ }
602
+ }, "draw"), _t = {
603
+ draw: Vt
604
+ }, Zt = /* @__PURE__ */ u(({
605
+ wardley: o
606
+ } = {}) => {
607
+ const r = Et(), e = Yt(), h = U(r, e.themeVariables), a = U(h.wardley, o);
608
+ return `
609
+ .wardley-background {
610
+ fill: ${a.backgroundColor};
611
+ }
612
+ .wardley-axes line, .wardley-axes path {
613
+ stroke: ${a.axisColor};
614
+ }
615
+ .wardley-axis-label {
616
+ fill: ${a.axisTextColor};
617
+ }
618
+ .wardley-stage-label {
619
+ fill: ${a.axisTextColor};
620
+ }
621
+ .wardley-grid line {
622
+ stroke: ${a.gridColor};
623
+ }
624
+ .wardley-node circle {
625
+ fill: ${a.componentFill};
626
+ stroke: ${a.componentStroke};
627
+ }
628
+ .wardley-node-label {
629
+ fill: ${a.componentLabelColor};
630
+ }
631
+ .wardley-link {
632
+ stroke: ${a.linkStroke};
633
+ }
634
+ .wardley-link--dashed {
635
+ stroke-dasharray: 4 4;
636
+ }
637
+ .wardley-link-label {
638
+ fill: ${a.axisTextColor};
639
+ }
640
+ .wardley-trend line {
641
+ stroke: ${a.evolutionStroke};
642
+ }
643
+ .wardley-annotation-line {
644
+ stroke: ${a.annotationStroke};
645
+ }
646
+ .wardley-annotation circle {
647
+ fill: ${a.annotationFill};
648
+ stroke: ${a.annotationStroke};
649
+ }
650
+ .wardley-annotation text {
651
+ fill: ${a.annotationTextColor};
652
+ }
653
+ .wardley-annotations-box rect {
654
+ fill: ${a.annotationFill};
655
+ stroke: ${a.annotationStroke};
656
+ }
657
+ .wardley-annotations-box text {
658
+ fill: ${a.annotationTextColor};
659
+ }
660
+ .wardley-pipeline-box {
661
+ stroke: ${a.componentStroke};
662
+ }
663
+ .wardley-notes text {
664
+ fill: ${a.axisTextColor};
665
+ }
666
+ `;
667
+ }, "styles"), te = {
668
+ parser: tt,
669
+ db: Gt,
670
+ renderer: _t,
671
+ styles: Zt
672
+ };
673
+ export {
674
+ te as diagram
675
+ };