@qwen-code/web-shell 0.27.1 → 0.27.2-preview.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 (158) hide show
  1. package/NOTICES.txt +10721 -958
  2. package/dist/{PierreFilePreview-BT_JRIvF.js → PierreFilePreview-B4n5WCtp.js} +1 -1
  3. package/dist/SpreadsheetPreview-Bbxqbb8z.js +379 -0
  4. package/dist/{WorkspaceFileBrowser-G1yA2eBf.js → WorkspaceFileBrowser-Bj4bedRP.js} +2 -2
  5. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  6. package/dist/abnfDiagram-VCTEODGH-CQWhk3bg.js +87 -0
  7. package/dist/abnfDiagram-VCTEODGH-DXK3iWaN.js +87 -0
  8. package/dist/{agents-route-bkxyBAkN.js → agents-route-CT-Zjn4s.js} +2 -2
  9. package/dist/arc-BcP3aO-G.js +83 -0
  10. package/dist/arc-DkZAOzaU.js +83 -0
  11. package/dist/architectureDiagram-5GKGNRK7-DhcVEkLQ.js +4775 -0
  12. package/dist/architectureDiagram-5GKGNRK7-DusU8ybk.js +4776 -0
  13. package/dist/blockDiagram-NRAW4CY4-BMOuo5wl.js +1414 -0
  14. package/dist/blockDiagram-NRAW4CY4-YciA8-8I.js +1414 -0
  15. package/dist/c4Diagram-UCG6FXSJ-BJxpHO4v.js +1508 -0
  16. package/dist/c4Diagram-UCG6FXSJ-DNpq-cdF.js +1508 -0
  17. package/dist/channel-CfhQTpjX.js +5 -0
  18. package/dist/channel-QZAYPfF8.js +5 -0
  19. package/dist/chunk-2Q5K7J3B-EGbMOnEe.js +15 -0
  20. package/dist/chunk-2Q5K7J3B-mtpkChaF.js +15 -0
  21. package/dist/chunk-5VM5RSS4-CP4Q2W8n.js +19 -0
  22. package/dist/chunk-5VM5RSS4-CucJ3wyB.js +19 -0
  23. package/dist/chunk-F27PBJKO-CS9kzvAx.js +68 -0
  24. package/dist/chunk-F27PBJKO-Cfw_29T-.js +68 -0
  25. package/dist/chunk-G27WJ6UU-BZzmQ8FW.js +1408 -0
  26. package/dist/chunk-G27WJ6UU-DdeEiwmL.js +1408 -0
  27. package/dist/chunk-JWPE2WC7-BL_hjRLf.js +8 -0
  28. package/dist/chunk-JWPE2WC7-C03UDQBx.js +8 -0
  29. package/dist/chunk-LCL6LL3I-CNn3XyuL.js +1533 -0
  30. package/dist/chunk-LCL6LL3I-CR-IGGIM.js +1533 -0
  31. package/dist/chunk-POPQ4Y6H-BVQbxVHz.js +19 -0
  32. package/dist/chunk-POPQ4Y6H-UJK1fYGP.js +19 -0
  33. package/dist/chunk-SVP7TREG-B-E-xFG8.js +664 -0
  34. package/dist/chunk-SVP7TREG-BUmyTmov.js +664 -0
  35. package/dist/chunk-XXDRQBXY-BDcf4DQz.js +8 -0
  36. package/dist/chunk-XXDRQBXY-BHAq0mtL.js +8 -0
  37. package/dist/classDiagram-DTDB5LWJ-CVA3J-EH.js +16 -0
  38. package/dist/classDiagram-DTDB5LWJ-Dh121Rlt.js +16 -0
  39. package/dist/classDiagram-v2-JRS7N3AN-CVA3J-EH.js +16 -0
  40. package/dist/classDiagram-v2-JRS7N3AN-Dh121Rlt.js +16 -0
  41. package/dist/cose-bilkent-JH36ORCC-CLe0kcHa.js +2605 -0
  42. package/dist/cose-bilkent-JH36ORCC-DpMM48hA.js +2606 -0
  43. package/dist/cynefin-OW5HDTMX-CyO3b088.js +23750 -0
  44. package/dist/cynefinDiagram-5FMLGOSQ-C5xaWeuA.js +299 -0
  45. package/dist/cynefinDiagram-5FMLGOSQ-mLaK-3R3.js +299 -0
  46. package/dist/cytoscape.esm-DCrf4dL8.js +18782 -0
  47. package/dist/daemon-react-sdk.js +1 -1
  48. package/dist/dagre-3AP2YEHR-CmNFrtW9.js +456 -0
  49. package/dist/dagre-3AP2YEHR-zDm3fBQq.js +456 -0
  50. package/dist/defaultLocale-BgPVtth8.js +171 -0
  51. package/dist/diagram-S7CK7UJ4-BQtgRcGU.js +346 -0
  52. package/dist/diagram-S7CK7UJ4-Clojnf04.js +346 -0
  53. package/dist/diagram-UQ7AKVKN-B3Ll3rB4.js +219 -0
  54. package/dist/diagram-UQ7AKVKN-CTn4O0fd.js +219 -0
  55. package/dist/diagram-VSXAHHWV-BeYXDVEh.js +463 -0
  56. package/dist/diagram-VSXAHHWV-mdxkNEZP.js +463 -0
  57. package/dist/diagram-VX7I27RA-C3bzQYLd.js +529 -0
  58. package/dist/diagram-VX7I27RA-DaPLIQOr.js +529 -0
  59. package/dist/diagram-Z3DM3KII-BImvaL3c.js +142 -0
  60. package/dist/diagram-Z3DM3KII-CkkdGhWO.js +142 -0
  61. package/dist/{docx-preview-BucJeYCm.js → docx-preview-BfV4m8Qp.js} +503 -506
  62. package/dist/ebnfDiagram-PWID7BFC-C8RUggbp.js +109 -0
  63. package/dist/ebnfDiagram-PWID7BFC-gJHJx-lt.js +109 -0
  64. package/dist/erDiagram-SSCWMZ5O-CKFzjLCd.js +1059 -0
  65. package/dist/erDiagram-SSCWMZ5O-DLJjXFG9.js +1059 -0
  66. package/dist/flowDiagram-A5DVABFB-BHAeEzG1.js +1689 -0
  67. package/dist/flowDiagram-A5DVABFB-BOdsfJ-4.js +1689 -0
  68. package/dist/ganttDiagram-EL5Y4UJY-CtL6LAbW.js +2703 -0
  69. package/dist/ganttDiagram-EL5Y4UJY-D0hNphpF.js +2704 -0
  70. package/dist/gitGraphDiagram-WWUBYQGX-8XcPnT4w.js +815 -0
  71. package/dist/gitGraphDiagram-WWUBYQGX-DxHtQ0ba.js +815 -0
  72. package/dist/{index-B6wNHUaX.js → index-CULFv0Jj.js} +69284 -64504
  73. package/dist/index.js +3 -3
  74. package/dist/infoDiagram-RXCK75RN-B-Ds06LN.js +24 -0
  75. package/dist/infoDiagram-RXCK75RN-Dhirg4if.js +24 -0
  76. package/dist/init-DjUOC4st.js +16 -0
  77. package/dist/ishikawaDiagram-5VMMS53U-BJPKneVd.js +621 -0
  78. package/dist/ishikawaDiagram-5VMMS53U-CsttzTkq.js +621 -0
  79. package/dist/journeyDiagram-EYS64GPL-BBAEhOQ9.js +836 -0
  80. package/dist/journeyDiagram-EYS64GPL-DfXS6tI_.js +836 -0
  81. package/dist/kanban-definition-3QL26DDD-Bh1Jz01C.js +723 -0
  82. package/dist/kanban-definition-3QL26DDD-C8yOTG02.js +723 -0
  83. package/dist/layout-Dxab-q-T.js +1704 -0
  84. package/dist/layout-sTbo9v3C.js +1704 -0
  85. package/dist/linear-BhTDfwHZ.js +259 -0
  86. package/dist/linear-CjDL9r_e.js +259 -0
  87. package/dist/mermaid.core-CFV16zMl.js +19742 -0
  88. package/dist/mermaid.core-DBp8atac.js +19747 -0
  89. package/dist/mindmap-definition-FBJOCRG2-KPo1Z4it.js +826 -0
  90. package/dist/mindmap-definition-FBJOCRG2-vau9OLMK.js +826 -0
  91. package/dist/ordinal-DfAQgscy.js +61 -0
  92. package/dist/pegDiagram-XKGWAZYB-CFjH6RoO.js +95 -0
  93. package/dist/pegDiagram-XKGWAZYB-EeXt14MX.js +95 -0
  94. package/dist/pieDiagram-E7YTZNPT-CJa9GbCV.js +208 -0
  95. package/dist/pieDiagram-E7YTZNPT-JyO_8fWF.js +208 -0
  96. package/dist/quadrantDiagram-AXDQQJYC-B7tyPD89.js +1023 -0
  97. package/dist/quadrantDiagram-AXDQQJYC-G9wAekw0.js +1023 -0
  98. package/dist/railroadDiagram-O6MQD6OU-3-cuTnqH.js +77 -0
  99. package/dist/railroadDiagram-O6MQD6OU-SyM4QCMp.js +77 -0
  100. package/dist/requirementDiagram-EFPCY7ZU-BJal3W63.js +882 -0
  101. package/dist/requirementDiagram-EFPCY7ZU-bMW72Av_.js +882 -0
  102. package/dist/sankeyDiagram-P5KCCOFB-BKP8fccK.js +847 -0
  103. package/dist/sankeyDiagram-P5KCCOFB-C4KDi8Ty.js +847 -0
  104. package/dist/sequenceDiagram-WJ2MYXX4-DFvbPjPG.js +2888 -0
  105. package/dist/sequenceDiagram-WJ2MYXX4-DvgRoXFL.js +2888 -0
  106. package/dist/sizeCapture-X5ZJPWSS-DPkvpCxM.js +46 -0
  107. package/dist/sizeCapture-X5ZJPWSS-DU4nf5aV.js +46 -0
  108. package/dist/stateDiagram-HBIQ2CUA-CWp0mOcF.js +262 -0
  109. package/dist/stateDiagram-HBIQ2CUA-DkN3hNFV.js +262 -0
  110. package/dist/stateDiagram-v2-4QOOHH4V-Bh7H2ZBJ.js +16 -0
  111. package/dist/stateDiagram-v2-4QOOHH4V-DX-OvV9U.js +16 -0
  112. package/dist/sw.js +1 -1
  113. package/dist/swimlanes-XN3QIQJK-2s4fbN8J.js +5219 -0
  114. package/dist/swimlanes-XN3QIQJK-CI3ENZQA.js +5219 -0
  115. package/dist/swimlanesDiagram-VK2B7HYN-BEjeqDmx.js +13 -0
  116. package/dist/swimlanesDiagram-VK2B7HYN-DWJY6BGD.js +13 -0
  117. package/dist/timeline-definition-24CTP7MA-C_tZHri9.js +1057 -0
  118. package/dist/timeline-definition-24CTP7MA-DYXEracn.js +1057 -0
  119. package/dist/transcript.js +14564 -11549
  120. package/dist/types/App.d.ts +10 -1
  121. package/dist/types/components/ComposerUsageStats.d.ts +34 -0
  122. package/dist/types/components/WelcomeHeader.d.ts +8 -0
  123. package/dist/types/components/artifacts/tokenUsageTotals.d.ts +36 -0
  124. package/dist/types/components/channels/ChannelEditorDialog.d.ts +10 -1
  125. package/dist/types/components/channels/ChannelQrLogin.d.ts +13 -0
  126. package/dist/types/components/channels/WeixinLoginPanel.d.ts +17 -0
  127. package/dist/types/components/channels/channel-editor-state.d.ts +8 -1
  128. package/dist/types/components/channels/channel-platform.d.ts +2 -1
  129. package/dist/types/components/channels/weixin-auth-api.d.ts +32 -0
  130. package/dist/types/components/managed/ManagedRuntimeSkillsImporter.d.ts +10 -0
  131. package/dist/types/components/managed/ManagedSideQueryPanel.d.ts +5 -0
  132. package/dist/types/components/managed/WorkspaceBindingCreator.d.ts +26 -1
  133. package/dist/types/components/managed/generated/managed-agent-api.d.ts +605 -0
  134. package/dist/types/components/managed/java-managed-agent-client.d.ts +122 -1
  135. package/dist/types/components/managed/managed-agent-provider.d.ts +14 -1
  136. package/dist/types/components/managed/managed-diagnostics-messages.d.ts +14 -1
  137. package/dist/types/components/managed/managed-extension-install.d.ts +5 -2
  138. package/dist/types/components/managed/managed-extension-messages.d.ts +7 -0
  139. package/dist/types/components/managed/managed-extension-types.d.ts +4 -0
  140. package/dist/types/components/managed/managed-session-storage.d.ts +35 -0
  141. package/dist/types/components/managed/managed-side-query-command.d.ts +5 -0
  142. package/dist/types/components/managed/managed-side-query-types.d.ts +21 -0
  143. package/dist/types/components/managed/managed-side-query.test-fixtures.d.ts +3 -0
  144. package/dist/types/components/managed/use-managed-side-queries.d.ts +26 -0
  145. package/dist/types/customization.d.ts +31 -0
  146. package/dist/types/daemon/workspace/hooks/useDaemonChannels.d.ts +2 -1
  147. package/dist/types/daemon/workspace/types.d.ts +8 -1
  148. package/dist/types/index.d.ts +1 -0
  149. package/dist/{useDaemonMidTurnInjected-tBzI77Ar.js → useDaemonMidTurnInjected-B7dPEdqk.js} +2040 -1825
  150. package/dist/vennDiagram-4TSXK5OY-Bi3e_aHN.js +1578 -0
  151. package/dist/vennDiagram-4TSXK5OY-DZCe1Ffi.js +1578 -0
  152. package/dist/wardleyDiagram-VM6X3IG4-BNV5jzew.js +675 -0
  153. package/dist/wardleyDiagram-VM6X3IG4-DqFJHRmt.js +675 -0
  154. package/dist/xychartDiagram-S5SC5T6Z-BVIJ86ch.js +1492 -0
  155. package/dist/xychartDiagram-S5SC5T6Z-J8xP-hcH.js +1492 -0
  156. package/package.json +19 -9
  157. package/dist/SpreadsheetPreview-d5XL70Ho.js +0 -379
  158. package/dist/types/components/artifacts/excel-preview-parser.d.ts +0 -5
@@ -1,4 +1,4 @@
1
- import { A as a, D as n, a as o, b as t, c as u, g as i, d as r, i as S, e as c, s as p, f as g, u as P, h as m, j as d, k as A, l, m as T, n as E, o as v, p as D, q as O, r as M, t as N, v as k, w as _, x as b, y as L, z as W, B as h, C, E as F, F as G, G as R, H as V, I as f, J as w, K as x, L as y, M as B, N as H, O as I, P as U, Q as j, R as K, S as q, T as z, U as J, V as Q, W as X } from "./useDaemonMidTurnInjected-tBzI77Ar.js";
1
+ import { A as a, D as n, a as o, b as t, c as u, g as i, d as r, i as S, e as c, s as p, f as g, u as P, h as m, j as d, k as A, l, m as T, n as E, o as v, p as D, q as O, r as M, t as N, v as k, w as _, x as b, y as L, z as W, B as h, C, E as F, F as G, G as R, H as V, I as f, J as w, K as x, L as y, M as B, N as H, O as I, P as U, Q as j, R as K, S as q, T as z, U as J, V as Q, W as X } from "./useDaemonMidTurnInjected-B7dPEdqk.js";
2
2
  import { DAEMON_APPROVAL_MODES as Z } from "@qwen-code/sdk/daemon";
3
3
  export {
4
4
  a as AGENT_TOOL_NAME,
@@ -0,0 +1,456 @@
1
+ import { _ as m, ao as x, c as k, Q as O, l as p, ap as A, aq as Y, ar as b, as as _, at as z, au as H, av as D, aw as J, ax as T, ay as X, ah as R, af as F, az as q, aA as W } from "./mermaid.core-DBp8atac.js";
2
+ import { l as j } from "./layout-sTbo9v3C.js";
3
+ var C = /* @__PURE__ */ m((t, e, r) => Math.max(e, Math.min(r, t)), "clamp"), P = /* @__PURE__ */ m((t = "TB") => {
4
+ switch (t) {
5
+ case "BT":
6
+ return "bottom";
7
+ case "LR":
8
+ return "right";
9
+ case "RL":
10
+ return "left";
11
+ case "TB":
12
+ default:
13
+ return "top";
14
+ }
15
+ }, "getDefaultSelfLoopSide"), Q = /* @__PURE__ */ m((t) => t === "flowchart" || t === "flowchart-v2" || t === "stateDiagram" || t === "er" || t === "classDiagram", "shouldMergeSelfLoopSegments"), U = [
16
+ "x",
17
+ "y",
18
+ "width",
19
+ "height",
20
+ "labelBBox",
21
+ "intersect",
22
+ "calcIntersect",
23
+ "diff",
24
+ "clusterNode"
25
+ ], K = /* @__PURE__ */ m((t, e, r, d, a) => {
26
+ const f = [], h = /* @__PURE__ */ new Set();
27
+ if (r.forEach(({ start: i, end: o }) => {
28
+ i !== d && h.add(i), o !== d && h.add(o);
29
+ }), h.forEach((i) => {
30
+ const o = t.node(i);
31
+ typeof o?.x == "number" && typeof o?.y == "number" && f.push(o);
32
+ }), f.length === 0 && r.forEach(({ edge: i }) => {
33
+ (i.points ?? []).forEach((o) => {
34
+ typeof o?.x == "number" && typeof o?.y == "number" && f.push(o);
35
+ });
36
+ }), f.length === 0)
37
+ return P(a);
38
+ const c = f.reduce(
39
+ (i, o) => ({
40
+ x: i.x + o.x / f.length,
41
+ y: i.y + o.y / f.length
42
+ }),
43
+ { x: 0, y: 0 }
44
+ ), l = c.x - e.x, s = c.y - e.y;
45
+ return Math.abs(l) > Math.abs(s) ? l > 0 ? "right" : "left" : Math.abs(s) > 0 ? s > 0 ? "bottom" : "top" : P(a);
46
+ }, "getSelfLoopSide"), V = /* @__PURE__ */ m((t, e = "top", r = 0, d = 0) => {
47
+ const a = t.x, f = t.y - r, h = t.width / 2, c = t.height / 2, l = Math.max(36, Math.min(100, t.width * 0.8)), s = C(Math.max(d, t.width * 0.35), 36, l), i = C(Math.min(t.width, t.height) * 0.45, 24, 48);
48
+ switch (e) {
49
+ case "bottom": {
50
+ const o = f + c;
51
+ return [
52
+ { x: a - s / 2, y: o },
53
+ { x: a - s / 2, y: o + i },
54
+ { x: a + s / 2, y: o + i },
55
+ { x: a + s / 2, y: o }
56
+ ];
57
+ }
58
+ case "right": {
59
+ const o = a + h;
60
+ return [
61
+ { x: o, y: f - s / 2 },
62
+ { x: o + i, y: f - s / 2 },
63
+ { x: o + i, y: f + s / 2 },
64
+ { x: o, y: f + s / 2 }
65
+ ];
66
+ }
67
+ case "left": {
68
+ const o = a - h;
69
+ return [
70
+ { x: o, y: f - s / 2 },
71
+ { x: o - i, y: f - s / 2 },
72
+ { x: o - i, y: f + s / 2 },
73
+ { x: o, y: f + s / 2 }
74
+ ];
75
+ }
76
+ case "top":
77
+ default: {
78
+ const o = f - c;
79
+ return [
80
+ { x: a - s / 2, y: o },
81
+ { x: a - s / 2, y: o - i },
82
+ { x: a + s / 2, y: o - i },
83
+ { x: a + s / 2, y: o }
84
+ ];
85
+ }
86
+ }
87
+ }, "getSelfLoopPoints"), Z = /* @__PURE__ */ m((t, e, r = "top", d = 0, a = {}) => {
88
+ const h = t.x, c = t.y - d, l = a.width ?? 0, s = a.height ?? 0;
89
+ switch (r) {
90
+ case "bottom":
91
+ return { x: h, y: Math.max(...e.map((i) => i.y)) + s / 2 + 4 };
92
+ case "right":
93
+ return { x: Math.max(...e.map((i) => i.x)) + l / 2 + 4, y: c };
94
+ case "left":
95
+ return { x: Math.min(...e.map((i) => i.x)) - l / 2 - 4, y: c };
96
+ case "top":
97
+ default:
98
+ return { x: h, y: Math.min(...e.map((i) => i.y)) - s / 2 - 4 };
99
+ }
100
+ }, "getSelfLoopLabelPosition"), B = /* @__PURE__ */ m((t, e = 0, { mergeSelfLoops: r = !0 } = {}) => {
101
+ const d = /* @__PURE__ */ new Map(), a = [], f = t.graph()?.rankdir;
102
+ return t.edges().forEach((h) => {
103
+ const c = t.edge(h);
104
+ if (r && c.selfLoop) {
105
+ const l = c.selfLoop.id;
106
+ d.has(l) || d.set(l, []), d.get(l).push({ edge: c, start: h.v, end: h.w });
107
+ } else
108
+ a.push({ edge: c, start: h.v, end: h.w });
109
+ }), d.forEach((h) => {
110
+ if (h.length !== 3) {
111
+ h.forEach((u) => a.push(u));
112
+ return;
113
+ }
114
+ h.sort((u, E) => u.edge.selfLoop.order - E.edge.selfLoop.order);
115
+ const [c, l, s] = h, i = c.edge.originalEdge ?? l.edge.originalEdge ?? s.edge.originalEdge ?? l.edge, o = t.node(i.start);
116
+ if (!o) {
117
+ h.forEach((u) => a.push(u));
118
+ return;
119
+ }
120
+ const n = {
121
+ width: l.edge.width,
122
+ height: l.edge.height
123
+ }, L = K(t, o, h, i.start, f), w = V(o, L, e, n.width ?? 0), y = Z(o, w, L, e, n), g = {
124
+ ...l.edge,
125
+ ...i,
126
+ id: i.id,
127
+ points: w,
128
+ start: i.start,
129
+ end: i.end,
130
+ x: y.x,
131
+ y: y.y,
132
+ width: n.width,
133
+ height: n.height,
134
+ labelStyle: l.edge.labelStyle,
135
+ fromCluster: c.edge.fromCluster ?? l.edge.fromCluster ?? s.edge.fromCluster,
136
+ toCluster: c.edge.toCluster ?? l.edge.toCluster ?? s.edge.toCluster
137
+ };
138
+ delete g.selfLoop, delete g.originalEdge, a.push({ edge: g, start: g.start, end: g.end });
139
+ }), a;
140
+ }, "getEdgesToRender"), I = /* @__PURE__ */ m(async ({
141
+ element: t,
142
+ graph: e,
143
+ diagramType: r,
144
+ id: d,
145
+ parentCluster: a,
146
+ siteConfig: f
147
+ }) => {
148
+ const h = e.graph().rankdir;
149
+ p.trace("Dir in recursive render - dir:", h);
150
+ const {
151
+ clusters: c,
152
+ edgePaths: l,
153
+ edgeLabels: s,
154
+ nodes: i,
155
+ rootGroups: o
156
+ } = _(t, {
157
+ edgePathsClass: "edgePaths"
158
+ });
159
+ e.nodes() ? p.info("Recursive render XXX", e.nodes()) : p.info("No nodes found for", e), e.edges().length > 0 && p.info("Recursive edges", e.edge(e.edges()[0]));
160
+ const n = Q(r);
161
+ await Promise.all(
162
+ e.nodes().map(async function(y) {
163
+ const g = e.node(y);
164
+ if (a !== void 0) {
165
+ const u = JSON.parse(JSON.stringify(a.clusterData));
166
+ p.trace(
167
+ `Setting data for parent cluster XXX
168
+ Node.id = `,
169
+ y,
170
+ `
171
+ data=`,
172
+ u.height,
173
+ `
174
+ Parent cluster`,
175
+ a.height
176
+ ), e.setNode(a.id, u), e.parent(y) || (p.trace("Setting parent", y, a.id), e.setParent(y, a.id, u));
177
+ }
178
+ if (p.info("(Insert) Node XXX" + y + ": " + JSON.stringify(e.node(y))), g?.clusterNode) {
179
+ p.info("Cluster identified XBX", y, g.width, e.node(y));
180
+ const { ranksep: u, nodesep: E } = e.graph();
181
+ g.graph.setGraph({
182
+ ...g.graph.graph(),
183
+ ranksep: u + 25,
184
+ nodesep: E
185
+ });
186
+ const S = await oe({
187
+ element: i,
188
+ graph: g.graph,
189
+ diagramType: r,
190
+ id: d,
191
+ parentCluster: e.node(y),
192
+ siteConfig: f
193
+ }), N = S.elem;
194
+ z(g, N), g.diff = S.diff || 0, p.info(
195
+ "New compound node after recursive render XAX",
196
+ y,
197
+ "width",
198
+ // node,
199
+ g.width,
200
+ "height",
201
+ g.height
202
+ // node.x,
203
+ // node.y
204
+ ), H(N, g);
205
+ } else
206
+ e.children(y).length > 0 ? (p.trace(
207
+ "Cluster - the non recursive path XBX",
208
+ y,
209
+ g.id,
210
+ g,
211
+ g.width,
212
+ "Graph:",
213
+ e
214
+ ), p.trace(D(g.id, e)), b.set(g.id, { id: D(g.id, e), node: g })) : (p.trace("Node - the non recursive path XAX", y, i, e.node(y), h), await J(i, e.node(y), { config: f, dir: h }));
215
+ })
216
+ ), await (/* @__PURE__ */ m(async () => {
217
+ const y = e.edges().map(async function(g) {
218
+ const u = e.edge(g.v, g.w, g.name);
219
+ if (p.info("Edge " + g.v + " -> " + g.w + ": " + JSON.stringify(g)), p.info("Edge " + g.v + " -> " + g.w + ": ", g, " ", JSON.stringify(e.edge(g))), p.info(
220
+ "Fix",
221
+ b,
222
+ "ids:",
223
+ g.v,
224
+ g.w,
225
+ "Translating: ",
226
+ b.get(g.v),
227
+ b.get(g.w)
228
+ ), n && u.selfLoop) {
229
+ if (u.selfLoop.order !== 1)
230
+ return;
231
+ const E = {
232
+ ...u.originalEdge,
233
+ ...u,
234
+ id: u.selfLoop.id,
235
+ startLabelLeft: u.originalEdge?.startLabelLeft ?? u.startLabelLeft,
236
+ startLabelRight: u.originalEdge?.startLabelRight ?? u.startLabelRight,
237
+ endLabelLeft: u.originalEdge?.endLabelLeft ?? u.endLabelLeft,
238
+ endLabelRight: u.originalEdge?.endLabelRight ?? u.endLabelRight
239
+ };
240
+ await X(s, E), u.width = E.width, u.height = E.height, u.labelStyle = E.labelStyle;
241
+ return;
242
+ }
243
+ await X(s, u);
244
+ });
245
+ await Promise.all(y);
246
+ }, "processEdges"))();
247
+ const { subGraphTitleTotalMargin: w } = T(f);
248
+ return {
249
+ elem: o,
250
+ graph: e,
251
+ groups: { clusters: c, edgePaths: l, edgeLabels: s, nodes: i, rootGroups: o },
252
+ diagramType: r,
253
+ id: d,
254
+ mergeSelfLoops: n,
255
+ subGraphTitleTotalMargin: w
256
+ };
257
+ }, "measureDagreGraph"), M = /* @__PURE__ */ m((t) => {
258
+ p.info("############################################# XXX"), p.info("### Layout ### XXX"), p.info("############################################# XXX"), j(t);
259
+ }, "runDagreGraphLayout"), $ = /* @__PURE__ */ m((t, e, r) => {
260
+ const d = t.node(e);
261
+ if (!d)
262
+ return;
263
+ const a = { ...d };
264
+ return d?.clusterNode ? a.y = (d.y ?? 0) + r : t.children(e).length > 0 ? a.height = (d.height ?? 0) + r : a.y = (d.y ?? 0) + r / 2, a;
265
+ }, "normalizeDagreNode"), v = /* @__PURE__ */ m((t, e) => {
266
+ U.forEach((r) => {
267
+ e[r] !== void 0 && (t[r] = e[r]);
268
+ });
269
+ }, "applyDagreNodeLayout"), ee = /* @__PURE__ */ m((t, e, r, d) => ({
270
+ ...t,
271
+ start: t.start ?? e,
272
+ end: t.end ?? r,
273
+ points: (t.points ?? []).map((a) => ({
274
+ ...a,
275
+ y: typeof a.y == "number" ? a.y + d : a.y
276
+ }))
277
+ }), "normalizeDagreEdge"), te = /* @__PURE__ */ m((t, e) => {
278
+ const { graph: r, mergeSelfLoops: d, subGraphTitleTotalMargin: a = 0 } = e, f = new Map(t.nodes.map((c) => [c.id, c]));
279
+ x(r).forEach((c) => {
280
+ const l = $(r, c, a);
281
+ if (!l)
282
+ return;
283
+ v(r.node(c), l);
284
+ const s = f.get(c);
285
+ s && v(s, l);
286
+ });
287
+ const h = a / 2;
288
+ return t.edges = B(r, h, { mergeSelfLoops: d }).map(
289
+ ({ edge: c, start: l, end: s }) => ee(c, l, s, h)
290
+ ), t;
291
+ }, "applyDagreLayoutResult"), re = /* @__PURE__ */ m(async ({
292
+ elem: t,
293
+ graph: e,
294
+ groups: { clusters: r, edgePaths: d },
295
+ diagramType: a,
296
+ id: f,
297
+ mergeSelfLoops: h,
298
+ subGraphTitleTotalMargin: c
299
+ }) => {
300
+ let l = 0;
301
+ await Promise.all(
302
+ x(e).map(async function(o) {
303
+ const n = e.node(o);
304
+ if (p.info(
305
+ "Position XBX => " + o + ": (" + n.x,
306
+ "," + n.y,
307
+ ") width: ",
308
+ n.width,
309
+ " height: ",
310
+ n.height
311
+ ), n?.clusterNode)
312
+ n.y += c, p.info(
313
+ "A tainted cluster node XBX1",
314
+ o,
315
+ n.id,
316
+ n.width,
317
+ n.height,
318
+ n.x,
319
+ n.y,
320
+ e.parent(o)
321
+ ), b.get(n.id).node = n, R(n);
322
+ else if (e.children(o).length > 0) {
323
+ p.info(
324
+ "A pure cluster node XBX1",
325
+ o,
326
+ n.id,
327
+ n.x,
328
+ n.y,
329
+ n.width,
330
+ n.height,
331
+ e.parent(o)
332
+ ), n.height += c, e.node(n.parentId);
333
+ const L = n?.padding / 2 || 0, w = n?.labelBBox?.height || 0, y = w - L || 0;
334
+ p.debug("OffsetY", y, "labelHeight", w, "halfPadding", L), await F(r, n), b.get(n.id).node = n;
335
+ } else {
336
+ const L = e.node(n.parentId);
337
+ n.y += c / 2, p.info(
338
+ "A regular node XBX1 - using the padding",
339
+ n.id,
340
+ "parent",
341
+ n.parentId,
342
+ n.width,
343
+ n.height,
344
+ n.x,
345
+ n.y,
346
+ "offsetY",
347
+ n.offsetY,
348
+ "parent",
349
+ L,
350
+ L?.offsetY,
351
+ n
352
+ ), R(n);
353
+ }
354
+ })
355
+ );
356
+ const s = c / 2;
357
+ return B(e, s, { mergeSelfLoops: h }).forEach(function({ edge: o, start: n, end: L }) {
358
+ p.info("Edge " + n + " -> " + L + ": " + JSON.stringify(o), o), o.points.forEach((u) => u.y += s);
359
+ const w = e.node(n), y = e.node(L), g = q(d, o, b, a, w, y, f);
360
+ W(o, g);
361
+ }), e.nodes().forEach(function(o) {
362
+ const n = e.node(o);
363
+ p.info(o, n.type, n.diff), n.isGroup && (l = n.diff);
364
+ }), p.warn("Returning from recursive render XAX", t, l), { elem: t, diff: l };
365
+ }, "paintDagreLayoutCore"), oe = /* @__PURE__ */ m(async (t) => {
366
+ const e = await I(t);
367
+ return M(e.graph), await re(e);
368
+ }, "renderDagreSubgraph"), G = /* @__PURE__ */ m((t) => {
369
+ const e = new O({
370
+ multigraph: !0,
371
+ compound: !0
372
+ }).setGraph({
373
+ rankdir: t.direction,
374
+ // Precedence: an explicit top-level config override (only present when a
375
+ // user sets it - it has no schema default) > the value the diagram's own
376
+ // renderer put on data4Layout (usually derived from that diagram's config)
377
+ // > the flowchart config as a generic fallback. The flowchart keys have
378
+ // schema defaults and therefore always exist, so they must come last or
379
+ // they silently shadow every diagram's own spacing (see #7932).
380
+ nodesep: t.config?.nodeSpacing || t.nodeSpacing || t.config?.flowchart?.nodeSpacing,
381
+ ranksep: t.config?.rankSpacing || t.rankSpacing || t.config?.flowchart?.rankSpacing,
382
+ marginx: 8,
383
+ marginy: 8
384
+ }).setDefaultEdgeLabel(function() {
385
+ return {};
386
+ });
387
+ return t.nodes.forEach((r) => {
388
+ e.setNode(r.id, { ...r }), r.parentId && e.setParent(r.id, r.parentId);
389
+ }), p.debug("Edges:", t.edges), t.edges.forEach((r) => {
390
+ if (r.start === r.end) {
391
+ const d = r.start, a = d + "---" + d + "---1", f = d + "---" + d + "---2", h = e.node(d);
392
+ e.setNode(a, {
393
+ domId: a,
394
+ id: a,
395
+ parentId: h.parentId,
396
+ labelStyle: "",
397
+ label: "",
398
+ padding: 0,
399
+ shape: "labelRect",
400
+ // shape: 'rect',
401
+ style: "",
402
+ width: 10,
403
+ height: 10
404
+ }), e.setParent(a, h.parentId), e.setNode(f, {
405
+ domId: f,
406
+ id: f,
407
+ parentId: h.parentId,
408
+ labelStyle: "",
409
+ padding: 0,
410
+ // shape: 'rect',
411
+ shape: "labelRect",
412
+ label: "",
413
+ style: "",
414
+ width: 10,
415
+ height: 10
416
+ }), e.setParent(f, h.parentId);
417
+ const c = structuredClone(r), l = structuredClone(r), s = structuredClone(r), i = structuredClone(r);
418
+ l.originalEdge = c, l.selfLoop = { id: c.id, order: 0 }, s.originalEdge = c, s.selfLoop = { id: c.id, order: 1 }, i.originalEdge = c, i.selfLoop = { id: c.id, order: 2 }, l.label = "", l.arrowTypeEnd = "none", l.endLabelLeft = "", l.endLabelRight = "", l.startLabelLeft = "", l.id = d + "-cyclic-special-1", s.startLabelRight = "", s.startLabelLeft = "", s.endLabelLeft = "", s.endLabelRight = "", s.arrowTypeStart = "none", s.arrowTypeEnd = "none", s.id = d + "-cyclic-special-mid", i.label = "", i.startLabelRight = "", i.startLabelLeft = "", i.arrowTypeStart = "none", h.isGroup && (l.fromCluster = d, i.toCluster = d), i.id = d + "-cyclic-special-2", i.arrowTypeStart = "none", e.setEdge(d, a, l, d + "-cyclic-special-0"), e.setEdge(a, f, s, d + "-cyclic-special-1"), e.setEdge(f, d, i, d + "-cyclic-special-2");
419
+ } else
420
+ e.setEdge(r.start, r.end, { ...r }, r.id);
421
+ }), A(e), { graph: e };
422
+ }, "prepareLayoutForDagre"), ae = /* @__PURE__ */ m(async (t, { element: e, preparedLayout: r }) => {
423
+ const d = r ?? G(t), a = k(), f = await I({
424
+ element: e,
425
+ graph: d.graph,
426
+ diagramType: t.type,
427
+ id: t.diagramId,
428
+ parentCluster: void 0,
429
+ siteConfig: a
430
+ });
431
+ return d.measuredLayout = f, f;
432
+ }, "measureDagreLayout"), ne = /* @__PURE__ */ m((t, e) => {
433
+ const r = e.preparedLayout?.measuredLayout;
434
+ if (!r)
435
+ throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");
436
+ return M(r.graph), te(t, r), r;
437
+ }, "runDagreLayoutCore"), se = /* @__PURE__ */ m((t, { measure: e }) => x(e.graph).map((r) => e.graph.node(r)).filter(Boolean), "getDagrePaintNodes"), ie = /* @__PURE__ */ m((t, e, { measure: r }) => t ? r.graph.node(t) : void 0, "getDagreEdgeNode"), ce = Y({
438
+ prepareLayout: G,
439
+ measureLayout: ae,
440
+ runLayoutCore: ne,
441
+ paintOptions: {
442
+ clusterDb: b,
443
+ getNodes: se,
444
+ getEdgeNode: ie,
445
+ skipNode: /* @__PURE__ */ m((t, { measure: e }) => !e.graph.hasNode(t.id), "skipNode"),
446
+ isCluster: /* @__PURE__ */ m((t, { measure: e }) => e.graph.hasNode(t.id) && (e.graph.children(t.id) ?? []).length > 0, "isCluster")
447
+ }
448
+ });
449
+ export {
450
+ te as applyDagreLayoutResult,
451
+ B as getEdgesToRender,
452
+ ae as measureDagreLayout,
453
+ G as prepareLayoutForDagre,
454
+ ce as render,
455
+ ne as runDagreLayoutCore
456
+ };