@aidapt/caity-chat 3.0.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 (62) hide show
  1. package/README.md +73 -0
  2. package/dist/lib/_baseUniq-BVCT-t6P.js +477 -0
  3. package/dist/lib/arc-Kj6ZmwPS.js +83 -0
  4. package/dist/lib/architectureDiagram-Q4EWVU46-DA4kYaz_.js +4690 -0
  5. package/dist/lib/blockDiagram-DXYQGD6D-BWT5yya1.js +2295 -0
  6. package/dist/lib/c4Diagram-AHTNJAMY-BjY6DW3U.js +1577 -0
  7. package/dist/lib/caity-chat.tgz +0 -0
  8. package/dist/lib/channel-BjraetTo.js +5 -0
  9. package/dist/lib/chunk-4BX2VUAB-iSPZGgxQ.js +8 -0
  10. package/dist/lib/chunk-4TB4RGXK-DvnUcLoe.js +1465 -0
  11. package/dist/lib/chunk-55IACEB6-Mw25YX9j.js +8 -0
  12. package/dist/lib/chunk-EDXVE4YY-Dtbxz7df.js +19 -0
  13. package/dist/lib/chunk-FMBD7UC4-OCIy3top.js +19 -0
  14. package/dist/lib/chunk-OYMX7WX6-DFW9El2C.js +1383 -0
  15. package/dist/lib/chunk-QZHKN3VN-BYFTfk7k.js +15 -0
  16. package/dist/lib/chunk-YZCP3GAM-Cs-HTcyJ.js +68 -0
  17. package/dist/lib/classDiagram-6PBFFD2Q-CrDUlIYr.js +16 -0
  18. package/dist/lib/classDiagram-v2-HSJHXN6E-CrDUlIYr.js +16 -0
  19. package/dist/lib/clone-C0qEGPCz.js +8 -0
  20. package/dist/lib/cose-bilkent-S5V4N54A-H1-YbKvI.js +2609 -0
  21. package/dist/lib/cytoscape.esm-D_3MZVO6.js +18707 -0
  22. package/dist/lib/dagre-KV5264BT-DhEnTJ4D.js +443 -0
  23. package/dist/lib/defaultLocale-BgPVtth8.js +171 -0
  24. package/dist/lib/diagram-5BDNPKRD-CK6wgKxI.js +123 -0
  25. package/dist/lib/diagram-G4DWMVQ6-IhA_MJ0t.js +528 -0
  26. package/dist/lib/diagram-MMDJMWI5-DDuA1rYY.js +217 -0
  27. package/dist/lib/diagram-TYMM5635-_VI1en0S.js +142 -0
  28. package/dist/lib/erDiagram-SMLLAGMA-B1REwW7y.js +899 -0
  29. package/dist/lib/flowDiagram-DWJPFMVM-rWzOGDlg.js +1628 -0
  30. package/dist/lib/ganttDiagram-T4ZO3ILL-UhSvbAmM.js +2701 -0
  31. package/dist/lib/gitGraphDiagram-UUTBAWPF-DrsSMMoJ.js +815 -0
  32. package/dist/lib/graph-DMr8NrNW.js +738 -0
  33. package/dist/lib/index.d.ts +665 -0
  34. package/dist/lib/index.js +52 -0
  35. package/dist/lib/infoDiagram-42DDH7IO-CPF3XCNj.js +24 -0
  36. package/dist/lib/init-DjUOC4st.js +16 -0
  37. package/dist/lib/ishikawaDiagram-UXIWVN3A-B4Nt1TdW.js +621 -0
  38. package/dist/lib/journeyDiagram-VCZTEJTY-DW5yRsOM.js +834 -0
  39. package/dist/lib/kanban-definition-6JOO6SKY-5DmJRubo.js +724 -0
  40. package/dist/lib/layout-B00IQLgh.js +1441 -0
  41. package/dist/lib/linear-LLab47WO.js +259 -0
  42. package/dist/lib/main-C9dvh9CT.js +88771 -0
  43. package/dist/lib/mermaid.core-BrBkhL9h.js +15967 -0
  44. package/dist/lib/min-CJFyJhXg.js +38 -0
  45. package/dist/lib/mindmap-definition-QFDTVHPH-doqZCFNi.js +833 -0
  46. package/dist/lib/ordinal-B6-f3MAq.js +61 -0
  47. package/dist/lib/pieDiagram-DEJITSTG-DKi5GKup.js +163 -0
  48. package/dist/lib/quadrantDiagram-34T5L4WZ-COYWmEhy.js +1022 -0
  49. package/dist/lib/requirementDiagram-MS252O5E-D3odK6YH.js +882 -0
  50. package/dist/lib/sankeyDiagram-XADWPNL6-D36eaMCx.js +810 -0
  51. package/dist/lib/sequenceDiagram-FGHM5R23-NpESTwMk.js +2883 -0
  52. package/dist/lib/standalone.js +4 -0
  53. package/dist/lib/stateDiagram-FHFEXIEX-kXZ_Bn-a.js +263 -0
  54. package/dist/lib/stateDiagram-v2-QKLJ7IA2-B5xMdEuE.js +16 -0
  55. package/dist/lib/timeline-definition-GMOUNBTQ-DZDdcJwy.js +1055 -0
  56. package/dist/lib/vennDiagram-DHZGUBPP-Clhb6EGF.js +1557 -0
  57. package/dist/lib/wardley-RL74JXVD-CwSnyVu7.js +18396 -0
  58. package/dist/lib/wardleyDiagram-NUSXRM2D-DnXL4F04.js +594 -0
  59. package/dist/lib/xychartDiagram-5P7HB3ND-CweIkrg3.js +1342 -0
  60. package/package.json +95 -0
  61. package/src/types/caity-chat.d.ts +213 -0
  62. package/src/types/template-slots.d.ts +167 -0
@@ -0,0 +1,443 @@
1
+ import { _ as w, at as F, au as Y, av as _, aw as H, l as i, c as V, ax as z, ay as U, ag as $, am as q, ah as P, af as K, az as Q, aA as W, aB as Z } from "./mermaid.core-BrBkhL9h.js";
2
+ import { i as b, G as B } from "./graph-DMr8NrNW.js";
3
+ import { l as I } from "./layout-B00IQLgh.js";
4
+ import { c as L } from "./clone-C0qEGPCz.js";
5
+ import { m as A } from "./min-CJFyJhXg.js";
6
+ function h(e) {
7
+ var t = {
8
+ options: {
9
+ directed: e.isDirected(),
10
+ multigraph: e.isMultigraph(),
11
+ compound: e.isCompound()
12
+ },
13
+ nodes: ee(e),
14
+ edges: ne(e)
15
+ };
16
+ return b(e.graph()) || (t.value = L(e.graph())), t;
17
+ }
18
+ function ee(e) {
19
+ return A(e.nodes(), function(t) {
20
+ var n = e.node(t), a = e.parent(t), r = { v: t };
21
+ return b(n) || (r.value = n), b(a) || (r.parent = a), r;
22
+ });
23
+ }
24
+ function ne(e) {
25
+ return A(e.edges(), function(t) {
26
+ var n = e.edge(t), a = { v: t.v, w: t.w };
27
+ return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
28
+ });
29
+ }
30
+ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
31
+ y.clear(), J.clear(), d.clear();
32
+ }, "clear"), D = /* @__PURE__ */ w((e, t) => {
33
+ const n = y.get(t) || [];
34
+ return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
35
+ }, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
36
+ const n = y.get(t) || [];
37
+ return i.info("Descendants of ", t, " is ", n), i.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (i.debug("Tilt, ", t, ",not in descendants"), !1);
38
+ }, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
39
+ i.warn(
40
+ "Copying children of ",
41
+ e,
42
+ "root",
43
+ a,
44
+ "data",
45
+ t.node(e),
46
+ a
47
+ );
48
+ const r = t.children(e) || [];
49
+ e !== a && r.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", r), r.forEach((o) => {
50
+ if (t.children(o).length > 0)
51
+ G(o, t, n, a);
52
+ else {
53
+ const l = t.node(o);
54
+ i.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (i.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (i.debug("Setting parent", o, e), n.setParent(o, e)) : (i.info("In copy ", e, "root", a, "data", t.node(e), a), i.debug(
55
+ "Not Setting parent for node=",
56
+ o,
57
+ "cluster!==rootId",
58
+ e !== a,
59
+ "node!==clusterId",
60
+ o !== e
61
+ ));
62
+ const u = t.edges(o);
63
+ i.debug("Copying Edges", u), u.forEach((c) => {
64
+ i.info("Edge", c);
65
+ const m = t.edge(c.v, c.w, c.name);
66
+ i.info("Edge data", m, a);
67
+ try {
68
+ se(c, a) ? (i.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info(
69
+ "Skipping copy of edge ",
70
+ c.v,
71
+ "-->",
72
+ c.w,
73
+ " rootId: ",
74
+ a,
75
+ " clusterId:",
76
+ e
77
+ );
78
+ } catch (v) {
79
+ i.error(v);
80
+ }
81
+ });
82
+ }
83
+ i.debug("Removing node", o), t.removeNode(o);
84
+ });
85
+ }, "copy"), R = /* @__PURE__ */ w((e, t) => {
86
+ const n = t.children(e);
87
+ let a = [...n];
88
+ for (const r of n)
89
+ J.set(r, e), a = [...a, ...R(r, t)];
90
+ return a;
91
+ }, "extractDescendants"), ie = /* @__PURE__ */ w((e, t, n) => {
92
+ const a = e.edges().filter((c) => c.v === t || c.w === t), r = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = r.map((c) => ({ v: c.v, w: c.w }));
93
+ return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
94
+ }, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
95
+ const a = t.children(e);
96
+ if (i.trace("Searching children of id ", e, a), a.length < 1)
97
+ return e;
98
+ let r;
99
+ for (const o of a) {
100
+ const l = C(o, t, n), u = ie(t, n, l);
101
+ if (l)
102
+ if (u.length > 0)
103
+ r = l;
104
+ else
105
+ return l;
106
+ }
107
+ return r;
108
+ }, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ w((e, t) => {
109
+ if (!e || t > 10) {
110
+ i.debug("Opting out, no graph ");
111
+ return;
112
+ } else
113
+ i.debug("Opting in, graph ");
114
+ e.nodes().forEach(function(n) {
115
+ e.children(n).length > 0 && (i.warn(
116
+ "Cluster identified",
117
+ n,
118
+ " Replacement id in edges: ",
119
+ C(n, e, n)
120
+ ), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
121
+ }), e.nodes().forEach(function(n) {
122
+ const a = e.children(n), r = e.edges();
123
+ a.length > 0 ? (i.debug("Cluster identified", n, y), r.forEach((o) => {
124
+ const l = D(o.v, n), u = D(o.w, n);
125
+ l ^ u && (i.warn("Edge: ", o, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
126
+ })) : i.debug("Not a cluster ", n, y);
127
+ });
128
+ for (let n of d.keys()) {
129
+ const a = d.get(n).id, r = e.parent(a);
130
+ r !== n && d.has(r) && !d.get(r).externalConnections && (d.get(n).id = r);
131
+ }
132
+ e.edges().forEach(function(n) {
133
+ const a = e.edge(n);
134
+ i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
135
+ let r = n.v, o = n.w;
136
+ if (i.warn(
137
+ "Fix XXX",
138
+ d,
139
+ "ids:",
140
+ n.v,
141
+ n.w,
142
+ "Translating: ",
143
+ d.get(n.v),
144
+ " --- ",
145
+ d.get(n.w)
146
+ ), d.get(n.v) || d.get(n.w)) {
147
+ if (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), r = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), r !== n.v) {
148
+ const l = e.parent(r);
149
+ d.get(l).externalConnections = !0, a.fromCluster = n.v;
150
+ }
151
+ if (o !== n.w) {
152
+ const l = e.parent(o);
153
+ d.get(l).externalConnections = !0, a.toCluster = n.w;
154
+ }
155
+ i.warn("Fix Replacing with XXX", r, o, n.name), e.setEdge(r, o, a, n.name);
156
+ }
157
+ }), i.warn("Adjusted Graph", h(e)), T(e, 0), i.trace(d);
158
+ }, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
159
+ if (i.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
160
+ i.error("Bailing out");
161
+ return;
162
+ }
163
+ let n = e.nodes(), a = !1;
164
+ for (const r of n) {
165
+ const o = e.children(r);
166
+ a = a || o.length > 0;
167
+ }
168
+ if (!a) {
169
+ i.debug("Done, no node has children", e.nodes());
170
+ return;
171
+ }
172
+ i.debug("Nodes = ", n, t);
173
+ for (const r of n)
174
+ if (i.debug(
175
+ "Extracting node",
176
+ r,
177
+ d,
178
+ d.has(r) && !d.get(r).externalConnections,
179
+ !e.parent(r),
180
+ e.node(r),
181
+ e.children("D"),
182
+ " Depth ",
183
+ t
184
+ ), !d.has(r))
185
+ i.debug("Not a cluster", r, t);
186
+ else if (!d.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
187
+ i.warn(
188
+ "Cluster without external connections, without a parent and with children",
189
+ r,
190
+ t
191
+ );
192
+ let l = e.graph().rankdir === "TB" ? "LR" : "TB";
193
+ d.get(r)?.clusterData?.dir && (l = d.get(r).clusterData.dir, i.warn("Fixing dir", d.get(r).clusterData.dir, l));
194
+ const u = new B({
195
+ multigraph: !0,
196
+ compound: !0
197
+ }).setGraph({
198
+ rankdir: l,
199
+ nodesep: 50,
200
+ ranksep: 50,
201
+ marginx: 8,
202
+ marginy: 8
203
+ }).setDefaultEdgeLabel(function() {
204
+ return {};
205
+ });
206
+ i.warn("Old graph before copy", h(e)), G(r, e, u, r), e.setNode(r, {
207
+ clusterNode: !0,
208
+ id: r,
209
+ clusterData: d.get(r).clusterData,
210
+ label: d.get(r).label,
211
+ graph: u
212
+ }), i.warn("New graph after copy node: (", r, ")", h(u)), i.debug("Old graph after copy", h(e));
213
+ } else
214
+ i.warn(
215
+ "Cluster ** ",
216
+ r,
217
+ " **not meeting the criteria !externalConnections:",
218
+ !d.get(r).externalConnections,
219
+ " no parent: ",
220
+ !e.parent(r),
221
+ " children ",
222
+ e.children(r) && e.children(r).length > 0,
223
+ e.children("D"),
224
+ t
225
+ ), i.debug(d);
226
+ n = e.nodes(), i.warn("New list of nodes", n);
227
+ for (const r of n) {
228
+ const o = e.node(r);
229
+ i.warn(" Now next level", r, o), o?.clusterNode && T(o.graph, t + 1);
230
+ }
231
+ }, "extractor"), M = /* @__PURE__ */ w((e, t) => {
232
+ if (t.length === 0)
233
+ return [];
234
+ let n = Object.assign([], t);
235
+ return t.forEach((a) => {
236
+ const r = e.children(a), o = M(e, r);
237
+ n = [...n, ...o];
238
+ }), n;
239
+ }, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, r, o) => {
240
+ i.warn("Graph in recursive render:XAX", h(t), r);
241
+ const l = t.graph().rankdir;
242
+ i.trace("Dir in recursive render - dir:", l);
243
+ const u = e.insert("g").attr("class", "root");
244
+ t.nodes() ? i.info("Recursive render XXX", t.nodes()) : i.info("No nodes found for", t), t.edges().length > 0 && i.info("Recursive edges", t.edge(t.edges()[0]));
245
+ const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
246
+ await Promise.all(
247
+ t.nodes().map(async function(f) {
248
+ const s = t.node(f);
249
+ if (r !== void 0) {
250
+ const g = JSON.parse(JSON.stringify(r.clusterData));
251
+ i.trace(
252
+ `Setting data for parent cluster XXX
253
+ Node.id = `,
254
+ f,
255
+ `
256
+ data=`,
257
+ g.height,
258
+ `
259
+ Parent cluster`,
260
+ r.height
261
+ ), t.setNode(r.id, g), t.parent(f) || (i.trace("Setting parent", f, r.id), t.setParent(f, r.id, g));
262
+ }
263
+ if (i.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
264
+ i.info("Cluster identified XBX", f, s.width, t.node(f));
265
+ const { ranksep: g, nodesep: E } = t.graph();
266
+ s.graph.setGraph({
267
+ ...s.graph.graph(),
268
+ ranksep: g + 25,
269
+ nodesep: E
270
+ });
271
+ const N = await j(
272
+ X,
273
+ s.graph,
274
+ n,
275
+ a,
276
+ t.node(f),
277
+ o
278
+ ), x = N.elem;
279
+ z(s, x), s.diff = N.diff || 0, i.info(
280
+ "New compound node after recursive render XAX",
281
+ f,
282
+ "width",
283
+ // node,
284
+ s.width,
285
+ "height",
286
+ s.height
287
+ // node.x,
288
+ // node.y
289
+ ), U(x, s);
290
+ } else
291
+ t.children(f).length > 0 ? (i.trace(
292
+ "Cluster - the non recursive path XBX",
293
+ f,
294
+ s.id,
295
+ s,
296
+ s.width,
297
+ "Graph:",
298
+ t
299
+ ), i.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (i.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
300
+ })
301
+ ), await (/* @__PURE__ */ w(async () => {
302
+ const f = t.edges().map(async function(s) {
303
+ const g = t.edge(s.v, s.w, s.name);
304
+ i.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), i.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), i.info(
305
+ "Fix",
306
+ d,
307
+ "ids:",
308
+ s.v,
309
+ s.w,
310
+ "Translating: ",
311
+ d.get(s.v),
312
+ d.get(s.w)
313
+ ), await Z(v, g);
314
+ });
315
+ await Promise.all(f);
316
+ }, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(h(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.info("Graph after layout:", JSON.stringify(h(t)));
317
+ let O = 0, { subGraphTitleTotalMargin: S } = q(o);
318
+ return await Promise.all(
319
+ oe(t).map(async function(f) {
320
+ const s = t.node(f);
321
+ if (i.info(
322
+ "Position XBX => " + f + ": (" + s.x,
323
+ "," + s.y,
324
+ ") width: ",
325
+ s.width,
326
+ " height: ",
327
+ s.height
328
+ ), s?.clusterNode)
329
+ s.y += S, i.info(
330
+ "A tainted cluster node XBX1",
331
+ f,
332
+ s.id,
333
+ s.width,
334
+ s.height,
335
+ s.x,
336
+ s.y,
337
+ t.parent(f)
338
+ ), d.get(s.id).node = s, P(s);
339
+ else if (t.children(f).length > 0) {
340
+ i.info(
341
+ "A pure cluster node XBX1",
342
+ f,
343
+ s.id,
344
+ s.x,
345
+ s.y,
346
+ s.width,
347
+ s.height,
348
+ t.parent(f)
349
+ ), s.height += S, t.node(s.parentId);
350
+ const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
351
+ i.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
352
+ } else {
353
+ const g = t.node(s.parentId);
354
+ s.y += S / 2, i.info(
355
+ "A regular node XBX1 - using the padding",
356
+ s.id,
357
+ "parent",
358
+ s.parentId,
359
+ s.width,
360
+ s.height,
361
+ s.x,
362
+ s.y,
363
+ "offsetY",
364
+ s.offsetY,
365
+ "parent",
366
+ g,
367
+ g?.offsetY,
368
+ s
369
+ ), P(s);
370
+ }
371
+ })
372
+ ), t.edges().forEach(function(f) {
373
+ const s = t.edge(f);
374
+ i.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
375
+ const g = t.node(f.v);
376
+ var E = t.node(f.w);
377
+ const N = Q(m, s, d, n, g, E, a);
378
+ W(s, N);
379
+ }), t.nodes().forEach(function(f) {
380
+ const s = t.node(f);
381
+ i.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
382
+ }), i.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
383
+ }, "recursiveRender"), ue = /* @__PURE__ */ w(async (e, t) => {
384
+ const n = new B({
385
+ multigraph: !0,
386
+ compound: !0
387
+ }).setGraph({
388
+ rankdir: e.direction,
389
+ nodesep: e.config?.nodeSpacing || e.config?.flowchart?.nodeSpacing || e.nodeSpacing,
390
+ ranksep: e.config?.rankSpacing || e.config?.flowchart?.rankSpacing || e.rankSpacing,
391
+ marginx: 8,
392
+ marginy: 8
393
+ }).setDefaultEdgeLabel(function() {
394
+ return {};
395
+ }), a = t.select("g");
396
+ F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
397
+ n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
398
+ }), i.debug("Edges:", e.edges), e.edges.forEach((o) => {
399
+ if (o.start === o.end) {
400
+ const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
401
+ n.setNode(u, {
402
+ domId: u,
403
+ id: u,
404
+ parentId: m.parentId,
405
+ labelStyle: "",
406
+ label: "",
407
+ padding: 0,
408
+ shape: "labelRect",
409
+ // shape: 'rect',
410
+ style: "",
411
+ width: 10,
412
+ height: 10
413
+ }), n.setParent(u, m.parentId), n.setNode(c, {
414
+ domId: c,
415
+ id: c,
416
+ parentId: m.parentId,
417
+ labelStyle: "",
418
+ padding: 0,
419
+ // shape: 'rect',
420
+ shape: "labelRect",
421
+ label: "",
422
+ style: "",
423
+ width: 10,
424
+ height: 10
425
+ }), n.setParent(c, m.parentId);
426
+ const v = structuredClone(o), X = structuredClone(o), p = structuredClone(o);
427
+ v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", p.label = "", m.isGroup && (v.fromCluster = l, p.toCluster = l), p.id = l + "-cyclic-special-2", p.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, p, l + "-cyc<lic-special-2");
428
+ } else
429
+ n.setEdge(o.start, o.end, { ...o }, o.id);
430
+ }), i.warn("Graph at first:", JSON.stringify(h(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(h(n)));
431
+ const r = V();
432
+ await j(
433
+ a,
434
+ n,
435
+ e.type,
436
+ e.diagramId,
437
+ void 0,
438
+ r
439
+ );
440
+ }, "render");
441
+ export {
442
+ ue as render
443
+ };
@@ -0,0 +1,171 @@
1
+ function J(n) {
2
+ return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
3
+ }
4
+ function j(n, t) {
5
+ if (!isFinite(n) || n === 0) return null;
6
+ var e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e"), i = n.slice(0, e);
7
+ return [
8
+ i.length > 1 ? i[0] + i.slice(2) : i,
9
+ +n.slice(e + 1)
10
+ ];
11
+ }
12
+ function K(n) {
13
+ return n = j(Math.abs(n)), n ? n[1] : NaN;
14
+ }
15
+ function Q(n, t) {
16
+ return function(e, i) {
17
+ for (var o = e.length, a = [], c = 0, h = n[0], M = 0; o > 0 && h > 0 && (M + h + 1 > i && (h = Math.max(1, i - M)), a.push(e.substring(o -= h, o + h)), !((M += h + 1) > i)); )
18
+ h = n[c = (c + 1) % n.length];
19
+ return a.reverse().join(t);
20
+ };
21
+ }
22
+ function V(n) {
23
+ return function(t) {
24
+ return t.replace(/[0-9]/g, function(e) {
25
+ return n[+e];
26
+ });
27
+ };
28
+ }
29
+ var W = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
30
+ function $(n) {
31
+ if (!(t = W.exec(n))) throw new Error("invalid format: " + n);
32
+ var t;
33
+ return new L({
34
+ fill: t[1],
35
+ align: t[2],
36
+ sign: t[3],
37
+ symbol: t[4],
38
+ zero: t[5],
39
+ width: t[6],
40
+ comma: t[7],
41
+ precision: t[8] && t[8].slice(1),
42
+ trim: t[9],
43
+ type: t[10]
44
+ });
45
+ }
46
+ $.prototype = L.prototype;
47
+ function L(n) {
48
+ this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";
49
+ }
50
+ L.prototype.toString = function() {
51
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
52
+ };
53
+ function _(n) {
54
+ n: for (var t = n.length, e = 1, i = -1, o; e < t; ++e)
55
+ switch (n[e]) {
56
+ case ".":
57
+ i = o = e;
58
+ break;
59
+ case "0":
60
+ i === 0 && (i = e), o = e;
61
+ break;
62
+ default:
63
+ if (!+n[e]) break n;
64
+ i > 0 && (i = 0);
65
+ break;
66
+ }
67
+ return i > 0 ? n.slice(0, i) + n.slice(o + 1) : n;
68
+ }
69
+ var N;
70
+ function v(n, t) {
71
+ var e = j(n, t);
72
+ if (!e) return N = void 0, n.toPrecision(t);
73
+ var i = e[0], o = e[1], a = o - (N = Math.max(-8, Math.min(8, Math.floor(o / 3))) * 3) + 1, c = i.length;
74
+ return a === c ? i : a > c ? i + new Array(a - c + 1).join("0") : a > 0 ? i.slice(0, a) + "." + i.slice(a) : "0." + new Array(1 - a).join("0") + j(n, Math.max(0, t + a - 1))[0];
75
+ }
76
+ function X(n, t) {
77
+ var e = j(n, t);
78
+ if (!e) return n + "";
79
+ var i = e[0], o = e[1];
80
+ return o < 0 ? "0." + new Array(-o).join("0") + i : i.length > o + 1 ? i.slice(0, o + 1) + "." + i.slice(o + 1) : i + new Array(o - i.length + 2).join("0");
81
+ }
82
+ const O = {
83
+ "%": (n, t) => (n * 100).toFixed(t),
84
+ b: (n) => Math.round(n).toString(2),
85
+ c: (n) => n + "",
86
+ d: J,
87
+ e: (n, t) => n.toExponential(t),
88
+ f: (n, t) => n.toFixed(t),
89
+ g: (n, t) => n.toPrecision(t),
90
+ o: (n) => Math.round(n).toString(8),
91
+ p: (n, t) => X(n * 100, t),
92
+ r: X,
93
+ s: v,
94
+ X: (n) => Math.round(n).toString(16).toUpperCase(),
95
+ x: (n) => Math.round(n).toString(16)
96
+ };
97
+ function R(n) {
98
+ return n;
99
+ }
100
+ var U = Array.prototype.map, Y = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
101
+ function nn(n) {
102
+ var t = n.grouping === void 0 || n.thousands === void 0 ? R : Q(U.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", i = n.currency === void 0 ? "" : n.currency[1] + "", o = n.decimal === void 0 ? "." : n.decimal + "", a = n.numerals === void 0 ? R : V(U.call(n.numerals, String)), c = n.percent === void 0 ? "%" : n.percent + "", h = n.minus === void 0 ? "−" : n.minus + "", M = n.nan === void 0 ? "NaN" : n.nan + "";
103
+ function T(f, g) {
104
+ f = $(f);
105
+ var b = f.fill, p = f.align, m = f.sign, w = f.symbol, S = f.zero, E = f.width, F = f.comma, y = f.precision, C = f.trim, d = f.type;
106
+ d === "n" ? (F = !0, d = "g") : O[d] || (y === void 0 && (y = 12), C = !0, d = "g"), (S || b === "0" && p === "=") && (S = !0, b = "0", p = "=");
107
+ var q = (g && g.prefix !== void 0 ? g.prefix : "") + (w === "$" ? e : w === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : ""), B = (w === "$" ? i : /[%p]/.test(d) ? c : "") + (g && g.suffix !== void 0 ? g.suffix : ""), D = O[d], H = /[defgprs%]/.test(d);
108
+ y = y === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, y)) : Math.max(0, Math.min(20, y));
109
+ function G(r) {
110
+ var l = q, u = B, x, I, k;
111
+ if (d === "c")
112
+ u = D(r) + u, r = "";
113
+ else {
114
+ r = +r;
115
+ var P = r < 0 || 1 / r < 0;
116
+ if (r = isNaN(r) ? M : D(Math.abs(r), y), C && (r = _(r)), P && +r == 0 && m !== "+" && (P = !1), l = (P ? m === "(" ? m : h : m === "-" || m === "(" ? "" : m) + l, u = (d === "s" && !isNaN(r) && N !== void 0 ? Y[8 + N / 3] : "") + u + (P && m === "(" ? ")" : ""), H) {
117
+ for (x = -1, I = r.length; ++x < I; )
118
+ if (k = r.charCodeAt(x), 48 > k || k > 57) {
119
+ u = (k === 46 ? o + r.slice(x + 1) : r.slice(x)) + u, r = r.slice(0, x);
120
+ break;
121
+ }
122
+ }
123
+ }
124
+ F && !S && (r = t(r, 1 / 0));
125
+ var z = l.length + r.length + u.length, s = z < E ? new Array(E - z + 1).join(b) : "";
126
+ switch (F && S && (r = t(s + r, s.length ? E - u.length : 1 / 0), s = ""), p) {
127
+ case "<":
128
+ r = l + r + u + s;
129
+ break;
130
+ case "=":
131
+ r = l + s + r + u;
132
+ break;
133
+ case "^":
134
+ r = s.slice(0, z = s.length >> 1) + l + r + u + s.slice(z);
135
+ break;
136
+ default:
137
+ r = s + l + r + u;
138
+ break;
139
+ }
140
+ return a(r);
141
+ }
142
+ return G.toString = function() {
143
+ return f + "";
144
+ }, G;
145
+ }
146
+ function Z(f, g) {
147
+ var b = Math.max(-8, Math.min(8, Math.floor(K(g) / 3))) * 3, p = Math.pow(10, -b), m = T((f = $(f), f.type = "f", f), { suffix: Y[8 + b / 3] });
148
+ return function(w) {
149
+ return m(p * w);
150
+ };
151
+ }
152
+ return {
153
+ format: T,
154
+ formatPrefix: Z
155
+ };
156
+ }
157
+ var A, tn, rn;
158
+ en({
159
+ thousands: ",",
160
+ grouping: [3],
161
+ currency: ["$", ""]
162
+ });
163
+ function en(n) {
164
+ return A = nn(n), tn = A.format, rn = A.formatPrefix, A;
165
+ }
166
+ export {
167
+ rn as a,
168
+ tn as b,
169
+ K as e,
170
+ $ as f
171
+ };