@antdv-next/x 0.3.0 → 1.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 (117) hide show
  1. package/dist/index.esm.js +2 -1
  2. package/dist/index.umd.js +2 -1
  3. package/dist/mermaid/Mermaid.d.ts +1 -1
  4. package/dist/mermaid/Mermaid.js +1 -0
  5. package/dist/package.js +1 -1
  6. package/dist-browser/Serializer-y_SfSPKv.js +262 -0
  7. package/dist-browser/_basePickBy-Cy7KVmkk.js +166 -0
  8. package/dist-browser/_baseUniq-Ch3HuHeT.js +682 -0
  9. package/dist-browser/arc-caEkbRYF.js +80 -0
  10. package/dist-browser/architecture-PBZL5I3N-DHfBr78A.js +3 -0
  11. package/dist-browser/architectureDiagram-2XIMDMQ5-D3IYLROv.js +4045 -0
  12. package/dist-browser/array-CWNufkl9.js +6 -0
  13. package/dist-browser/bash-CXEwhtGQ.js +3 -0
  14. package/dist-browser/blockDiagram-WCTKOSBZ-nXanZ0sc.js +3025 -0
  15. package/dist-browser/c4Diagram-IC4MRINW-C-gVp6th.js +2964 -0
  16. package/dist-browser/channel-DoEe9DF9.js +5 -0
  17. package/dist-browser/chunk-4BX2VUAB-fLFD6XW0.js +8 -0
  18. package/dist-browser/chunk-55IACEB6-OtyKJzCH.js +8 -0
  19. package/dist-browser/chunk-7E7YKBS2-C1dd36rm.js +23 -0
  20. package/dist-browser/chunk-7R4GIKGN-DuTRhdsf.js +2596 -0
  21. package/dist-browser/chunk-C72U2L5F-ClmZGhFC.js +23 -0
  22. package/dist-browser/chunk-EGIJ26TM-Bar_u1MN.js +23 -0
  23. package/dist-browser/chunk-FMBD7UC4-C_uJ_JJA.js +5 -0
  24. package/dist-browser/chunk-GEFDOKGD-P7WhyrTU.js +1121 -0
  25. package/dist-browser/chunk-GLR3WWYH-BvazRgdo.js +41 -0
  26. package/dist-browser/chunk-HHEYEP7N-rv5s5WD4.js +9 -0
  27. package/dist-browser/chunk-JSJVCQXG-89HUGe9V.js +60 -0
  28. package/dist-browser/chunk-KX2RTZJC-pMHnNRQg.js +25 -0
  29. package/dist-browser/chunk-KYZI473N-DJmSs1gK.js +3434 -0
  30. package/dist-browser/chunk-L3YUKLVL-Ck54qytQ.js +23 -0
  31. package/dist-browser/chunk-MX3YWQON-MkpK3uBD.js +80 -0
  32. package/dist-browser/chunk-NQ4KR5QH-DGshodQv.js +2002 -0
  33. package/dist-browser/chunk-O4XLMI2P-e-ZzDQwg.js +511 -0
  34. package/dist-browser/chunk-OZEHJAEY-DULNd43V.js +64 -0
  35. package/dist-browser/chunk-PQ6SQG4A-CQ9Csv7s.js +67 -0
  36. package/dist-browser/chunk-PU5JKC2W-DkEFvrjH.js +1885 -0
  37. package/dist-browser/chunk-QZHKN3VN-qww1plfw.js +15 -0
  38. package/dist-browser/chunk-R5LLSJPH-BERXSDGJ.js +35 -0
  39. package/dist-browser/chunk-WL4C6EOR-C-d8WPS7.js +3194 -0
  40. package/dist-browser/chunk-WQLz0Won.js +20 -0
  41. package/dist-browser/chunk-XIRO2GV7-CFHofxVB.js +30 -0
  42. package/dist-browser/chunk-XPW4576I-DgvoNZkW.js +1146 -0
  43. package/dist-browser/chunk-XZSTWKYB-k8_EXrSa.js +15797 -0
  44. package/dist-browser/chunk-YBOYWFTD-BUW4AzEX.js +32 -0
  45. package/dist-browser/classDiagram-VBA2DB6C-DWTAs0Zm.js +29 -0
  46. package/dist-browser/classDiagram-v2-RAHNMMFH-CoxCdmrt.js +29 -0
  47. package/dist-browser/clone-BXDbKCDu.js +8 -0
  48. package/dist-browser/cose-bilkent-S5V4N54A-CnrS2OC1.js +2250 -0
  49. package/dist-browser/css-D9vrnIUE.js +2 -0
  50. package/dist-browser/css-Dh17kjFY.js +3 -0
  51. package/dist-browser/cytoscape.esm-BY3wHcbp.js +18100 -0
  52. package/dist-browser/dagre-BJOzGlhW.js +1483 -0
  53. package/dist-browser/dagre-KLK3FWXG-CFC0naVr.js +294 -0
  54. package/dist-browser/defaultLocale-BaPFSbai.js +201 -0
  55. package/dist-browser/diagram-E7M64L7V-DxuJj8ZG.js +527 -0
  56. package/dist-browser/diagram-IFDJBPK2-BOpPZ6pu.js +213 -0
  57. package/dist-browser/diagram-P4PSJMXO--ChDmcya.js +133 -0
  58. package/dist-browser/diff-BSu5dsa2.js +3 -0
  59. package/dist-browser/dist-DltyvPj3.js +50 -0
  60. package/dist-browser/erDiagram-INFDFZHY-BA3m-v87.js +1666 -0
  61. package/dist-browser/flowDiagram-PKNHOUZH-BCq6k3kr.js +4161 -0
  62. package/dist-browser/ganttDiagram-A5KZAMGK-DdMePS21.js +3075 -0
  63. package/dist-browser/gitGraph-HDMCJU4V-DbzpICZW.js +3 -0
  64. package/dist-browser/gitGraphDiagram-K3NZZRJ6-CLbRwChG.js +625 -0
  65. package/dist-browser/graphlib-C7ysKz4u.js +225 -0
  66. package/dist-browser/html-BmZO1Eoo.js +10 -0
  67. package/dist-browser/html-DnTYsv5k.js +2 -0
  68. package/dist-browser/index.es.js +56149 -0
  69. package/dist-browser/index.umd.js +3281 -0
  70. package/dist-browser/info-3K5VOQVL-CpUiQuel.js +3 -0
  71. package/dist-browser/infoDiagram-LFFYTUFH-DQAZ-vFk.js +19 -0
  72. package/dist-browser/init-PAs0hR-b.js +15 -0
  73. package/dist-browser/isArrayLikeObject-y3HlYDaX.js +578 -0
  74. package/dist-browser/isEmpty-2JxdWtc-.js +35 -0
  75. package/dist-browser/ishikawaDiagram-PHBUUO56-B0r2IgGz.js +717 -0
  76. package/dist-browser/javascript-BXHK_bZ2.js +3 -0
  77. package/dist-browser/javascript-NV_FQBab.js +2 -0
  78. package/dist-browser/journeyDiagram-4ABVD52K-DnMUhOvg.js +883 -0
  79. package/dist-browser/json-C8Y9C4Ne.js +2 -0
  80. package/dist-browser/json-DZ_9-j3Q.js +3 -0
  81. package/dist-browser/jsx-CxlNNvOI.js +3 -0
  82. package/dist-browser/kanban-definition-K7BYSVSG-Da5Y-nJy.js +971 -0
  83. package/dist-browser/katex-b-xdokOf.js +22000 -0
  84. package/dist-browser/line-h2iCTGsE.js +34 -0
  85. package/dist-browser/linear-Bv7XrZCH.js +289 -0
  86. package/dist-browser/markdown-BKwT7HWz.js +3 -0
  87. package/dist-browser/math-DPzKeDKn.js +10 -0
  88. package/dist-browser/mermaid-C1RUu_Iw.js +3 -0
  89. package/dist-browser/mermaid-parser.core-kTgpNO7M.js +59 -0
  90. package/dist-browser/mermaid.core-DRuUNxpC.js +680 -0
  91. package/dist-browser/mindmap-definition-YRQLILUH-CYeqnCde.js +964 -0
  92. package/dist-browser/ordinal-D8PKtxfM.js +65 -0
  93. package/dist-browser/packet-RMMSAZCW-UTFQ0FQx.js +3 -0
  94. package/dist-browser/path-DZ-6AyWK.js +85 -0
  95. package/dist-browser/pie-UPGHQEXC-CarAcBSi.js +3 -0
  96. package/dist-browser/pieDiagram-SKSYHLDU-DAsfTGvY.js +165 -0
  97. package/dist-browser/python-BQM8giqx.js +3 -0
  98. package/dist-browser/quadrantDiagram-337W2JSQ-CZLbmQS4.js +1974 -0
  99. package/dist-browser/radar-KQ55EAFF-NXK5PC9R.js +3 -0
  100. package/dist-browser/requirementDiagram-Z7DCOOCP-Cb_Ygnfe.js +2201 -0
  101. package/dist-browser/rough.esm-C_hJ3ICT.js +1352 -0
  102. package/dist-browser/sankeyDiagram-WA2Y5GQK-DBe5YfW4.js +920 -0
  103. package/dist-browser/sequenceDiagram-2WXFIKYE-C_KUoojT.js +4109 -0
  104. package/dist-browser/src-BukXhifV.js +2146 -0
  105. package/dist-browser/stateDiagram-RAJIS63D-boG6DyfW.js +217 -0
  106. package/dist-browser/stateDiagram-v2-FVOUBMTO-DHCajhrN.js +27 -0
  107. package/dist-browser/timeline-definition-YZTLITO2-pFt6rZ6S.js +830 -0
  108. package/dist-browser/treemap-KZPCXAKY-Cj9QakFB.js +3 -0
  109. package/dist-browser/tsx-DIYEV_g7.js +3 -0
  110. package/dist-browser/typescript-B6MWEsBH.js +3 -0
  111. package/dist-browser/typescript-CR48gG1F.js +2 -0
  112. package/dist-browser/vennDiagram-LZ73GAT5-VaCO6k4H.js +1858 -0
  113. package/dist-browser/vue-BJ0ov2CZ.js +21 -0
  114. package/dist-browser/vue-html-D0gyDbfn.js +5 -0
  115. package/dist-browser/xychartDiagram-JWTSCODW-xS5ybemA.js +2041 -0
  116. package/dist-browser/yaml-Y0CqUPTQ.js +3 -0
  117. package/package.json +15 -3
@@ -0,0 +1,3 @@
1
+ import "./chunk-XZSTWKYB-k8_EXrSa.js";
2
+ import { n as e } from "./chunk-7E7YKBS2-C1dd36rm.js";
3
+ export { e as createGitGraphServices };
@@ -0,0 +1,625 @@
1
+ import { g as e, h as t, p as n } from "./src-BukXhifV.js";
2
+ import { h as r, p as i, r as a } from "./chunk-GEFDOKGD-P7WhyrTU.js";
3
+ import { B as o, C as s, V as c, W as l, _ as u, a as d, d as f, q as ee, s as p, v as te, y as m } from "./chunk-7R4GIKGN-DuTRhdsf.js";
4
+ import { t as h } from "./chunk-4BX2VUAB-fLFD6XW0.js";
5
+ import { t as g } from "./mermaid-parser.core-kTgpNO7M.js";
6
+ import { t as ne } from "./chunk-QZHKN3VN-qww1plfw.js";
7
+ //#region ../../node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-K3NZZRJ6.mjs
8
+ var _ = {
9
+ NORMAL: 0,
10
+ REVERSE: 1,
11
+ HIGHLIGHT: 2,
12
+ MERGE: 3,
13
+ CHERRY_PICK: 4
14
+ }, re = f.gitGraph, v = /* @__PURE__ */ t(() => a({
15
+ ...re,
16
+ ...m().gitGraph
17
+ }), "getConfig"), y = new ne(() => {
18
+ let e = v(), t = e.mainBranchName, n = e.mainBranchOrder;
19
+ return {
20
+ mainBranchName: t,
21
+ commits: /* @__PURE__ */ new Map(),
22
+ head: null,
23
+ branchConfig: /* @__PURE__ */ new Map([[t, {
24
+ name: t,
25
+ order: n
26
+ }]]),
27
+ branches: /* @__PURE__ */ new Map([[t, null]]),
28
+ currBranch: t,
29
+ direction: "LR",
30
+ seq: 0,
31
+ options: {}
32
+ };
33
+ });
34
+ function b() {
35
+ return i({ length: 7 });
36
+ }
37
+ t(b, "getID");
38
+ function x(e, t) {
39
+ let n = /* @__PURE__ */ Object.create(null);
40
+ return e.reduce((e, r) => {
41
+ let i = t(r);
42
+ return n[i] || (n[i] = !0, e.push(r)), e;
43
+ }, []);
44
+ }
45
+ t(x, "uniqBy");
46
+ var S = /* @__PURE__ */ t(function(e) {
47
+ y.records.direction = e;
48
+ }, "setDirection"), C = /* @__PURE__ */ t(function(t) {
49
+ e.debug("options str", t), t = t?.trim(), t ||= "{}";
50
+ try {
51
+ y.records.options = JSON.parse(t);
52
+ } catch (t) {
53
+ e.error("error while parsing gitGraph options", t.message);
54
+ }
55
+ }, "setOptions"), ie = /* @__PURE__ */ t(function() {
56
+ return y.records.options;
57
+ }, "getOptions"), ae = /* @__PURE__ */ t(function(t) {
58
+ let n = t.msg, r = t.id, i = t.type, a = t.tags;
59
+ e.info("commit", n, r, i, a), e.debug("Entering commit:", n, r, i, a);
60
+ let o = v();
61
+ r = p.sanitizeText(r, o), n = p.sanitizeText(n, o), a = a?.map((e) => p.sanitizeText(e, o));
62
+ let s = {
63
+ id: r || y.records.seq + "-" + b(),
64
+ message: n,
65
+ seq: y.records.seq++,
66
+ type: i ?? _.NORMAL,
67
+ tags: a ?? [],
68
+ parents: y.records.head == null ? [] : [y.records.head.id],
69
+ branch: y.records.currBranch
70
+ };
71
+ y.records.head = s, e.info("main branch", o.mainBranchName), y.records.commits.has(s.id) && e.warn(`Commit ID ${s.id} already exists`), y.records.commits.set(s.id, s), y.records.branches.set(y.records.currBranch, s.id), e.debug("in pushCommit " + s.id);
72
+ }, "commit"), oe = /* @__PURE__ */ t(function(t) {
73
+ let n = t.name, r = t.order;
74
+ if (n = p.sanitizeText(n, v()), y.records.branches.has(n)) throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${n}")`);
75
+ y.records.branches.set(n, y.records.head == null ? null : y.records.head.id), y.records.branchConfig.set(n, {
76
+ name: n,
77
+ order: r
78
+ }), w(n), e.debug("in createBranch");
79
+ }, "branch"), se = /* @__PURE__ */ t((t) => {
80
+ let n = t.branch, r = t.id, i = t.type, a = t.tags, o = v();
81
+ n = p.sanitizeText(n, o), r &&= p.sanitizeText(r, o);
82
+ let s = y.records.branches.get(y.records.currBranch), c = y.records.branches.get(n), l = s ? y.records.commits.get(s) : void 0, u = c ? y.records.commits.get(c) : void 0;
83
+ if (l && u && l.branch === n) throw Error(`Cannot merge branch '${n}' into itself.`);
84
+ if (y.records.currBranch === n) {
85
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Cannot merge a branch to itself");
86
+ throw e.hash = {
87
+ text: `merge ${n}`,
88
+ token: `merge ${n}`,
89
+ expected: ["branch abc"]
90
+ }, e;
91
+ }
92
+ if (l === void 0 || !l) {
93
+ let e = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${y.records.currBranch})has no commits`);
94
+ throw e.hash = {
95
+ text: `merge ${n}`,
96
+ token: `merge ${n}`,
97
+ expected: ["commit"]
98
+ }, e;
99
+ }
100
+ if (!y.records.branches.has(n)) {
101
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") does not exist");
102
+ throw e.hash = {
103
+ text: `merge ${n}`,
104
+ token: `merge ${n}`,
105
+ expected: [`branch ${n}`]
106
+ }, e;
107
+ }
108
+ if (u === void 0 || !u) {
109
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") has no commits");
110
+ throw e.hash = {
111
+ text: `merge ${n}`,
112
+ token: `merge ${n}`,
113
+ expected: ["\"commit\""]
114
+ }, e;
115
+ }
116
+ if (l === u) {
117
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Both branches have same head");
118
+ throw e.hash = {
119
+ text: `merge ${n}`,
120
+ token: `merge ${n}`,
121
+ expected: ["branch abc"]
122
+ }, e;
123
+ }
124
+ if (r && y.records.commits.has(r)) {
125
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" + r + " already exists, use different custom id");
126
+ throw e.hash = {
127
+ text: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
128
+ token: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
129
+ expected: [`merge ${n} ${r}_UNIQUE ${i} ${a?.join(" ")}`]
130
+ }, e;
131
+ }
132
+ let d = c || "", f = {
133
+ id: r || `${y.records.seq}-${b()}`,
134
+ message: `merged branch ${n} into ${y.records.currBranch}`,
135
+ seq: y.records.seq++,
136
+ parents: y.records.head == null ? [] : [y.records.head.id, d],
137
+ branch: y.records.currBranch,
138
+ type: _.MERGE,
139
+ customType: i,
140
+ customId: !!r,
141
+ tags: a ?? []
142
+ };
143
+ y.records.head = f, y.records.commits.set(f.id, f), y.records.branches.set(y.records.currBranch, f.id), e.debug(y.records.branches), e.debug("in mergeBranch");
144
+ }, "merge"), ce = /* @__PURE__ */ t(function(t) {
145
+ let n = t.id, r = t.targetId, i = t.tags, a = t.parent;
146
+ e.debug("Entering cherryPick:", n, r, i);
147
+ let o = v();
148
+ if (n = p.sanitizeText(n, o), r = p.sanitizeText(r, o), i = i?.map((e) => p.sanitizeText(e, o)), a = p.sanitizeText(a, o), !n || !y.records.commits.has(n)) {
149
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
150
+ throw e.hash = {
151
+ text: `cherryPick ${n} ${r}`,
152
+ token: `cherryPick ${n} ${r}`,
153
+ expected: ["cherry-pick abc"]
154
+ }, e;
155
+ }
156
+ let s = y.records.commits.get(n);
157
+ if (s === void 0 || !s) throw Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
158
+ if (a && !(Array.isArray(s.parents) && s.parents.includes(a))) throw /* @__PURE__ */ Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");
159
+ let c = s.branch;
160
+ if (s.type === _.MERGE && !a) throw /* @__PURE__ */ Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");
161
+ if (!r || !y.records.commits.has(r)) {
162
+ if (c === y.records.currBranch) {
163
+ let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit is already on current branch");
164
+ throw e.hash = {
165
+ text: `cherryPick ${n} ${r}`,
166
+ token: `cherryPick ${n} ${r}`,
167
+ expected: ["cherry-pick abc"]
168
+ }, e;
169
+ }
170
+ let t = y.records.branches.get(y.records.currBranch);
171
+ if (t === void 0 || !t) {
172
+ let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${y.records.currBranch})has no commits`);
173
+ throw e.hash = {
174
+ text: `cherryPick ${n} ${r}`,
175
+ token: `cherryPick ${n} ${r}`,
176
+ expected: ["cherry-pick abc"]
177
+ }, e;
178
+ }
179
+ let o = y.records.commits.get(t);
180
+ if (o === void 0 || !o) {
181
+ let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${y.records.currBranch})has no commits`);
182
+ throw e.hash = {
183
+ text: `cherryPick ${n} ${r}`,
184
+ token: `cherryPick ${n} ${r}`,
185
+ expected: ["cherry-pick abc"]
186
+ }, e;
187
+ }
188
+ let l = {
189
+ id: y.records.seq + "-" + b(),
190
+ message: `cherry-picked ${s?.message} into ${y.records.currBranch}`,
191
+ seq: y.records.seq++,
192
+ parents: y.records.head == null ? [] : [y.records.head.id, s.id],
193
+ branch: y.records.currBranch,
194
+ type: _.CHERRY_PICK,
195
+ tags: i ? i.filter(Boolean) : [`cherry-pick:${s.id}${s.type === _.MERGE ? `|parent:${a}` : ""}`]
196
+ };
197
+ y.records.head = l, y.records.commits.set(l.id, l), y.records.branches.set(y.records.currBranch, l.id), e.debug(y.records.branches), e.debug("in cherryPick");
198
+ }
199
+ }, "cherryPick"), w = /* @__PURE__ */ t(function(e) {
200
+ if (e = p.sanitizeText(e, v()), y.records.branches.has(e)) {
201
+ y.records.currBranch = e;
202
+ let t = y.records.branches.get(y.records.currBranch);
203
+ t === void 0 || !t ? y.records.head = null : y.records.head = y.records.commits.get(t) ?? null;
204
+ } else {
205
+ let t = /* @__PURE__ */ Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);
206
+ throw t.hash = {
207
+ text: `checkout ${e}`,
208
+ token: `checkout ${e}`,
209
+ expected: [`branch ${e}`]
210
+ }, t;
211
+ }
212
+ }, "checkout");
213
+ function T(e, t, n) {
214
+ let r = e.indexOf(t);
215
+ r === -1 ? e.push(n) : e.splice(r, 1, n);
216
+ }
217
+ t(T, "upsert");
218
+ function E(t) {
219
+ let n = t.reduce((e, t) => e.seq > t.seq ? e : t, t[0]), r = "";
220
+ t.forEach(function(e) {
221
+ e === n ? r += " *" : r += " |";
222
+ });
223
+ let i = [
224
+ r,
225
+ n.id,
226
+ n.seq
227
+ ];
228
+ for (let e in y.records.branches) y.records.branches.get(e) === n.id && i.push(e);
229
+ if (e.debug(i.join(" ")), n.parents && n.parents.length == 2 && n.parents[0] && n.parents[1]) {
230
+ let e = y.records.commits.get(n.parents[0]);
231
+ T(t, n, e), n.parents[1] && t.push(y.records.commits.get(n.parents[1]));
232
+ } else if (n.parents.length == 0) return;
233
+ else if (n.parents[0]) {
234
+ let e = y.records.commits.get(n.parents[0]);
235
+ T(t, n, e);
236
+ }
237
+ t = x(t, (e) => e.id), E(t);
238
+ }
239
+ t(E, "prettyPrintCommitHistory");
240
+ var le = /* @__PURE__ */ t(function() {
241
+ e.debug(y.records.commits);
242
+ let t = D()[0];
243
+ E([t]);
244
+ }, "prettyPrint"), ue = /* @__PURE__ */ t(function() {
245
+ y.reset(), d();
246
+ }, "clear"), de = /* @__PURE__ */ t(function() {
247
+ return [...y.records.branchConfig.values()].map((e, t) => e.order !== null && e.order !== void 0 ? e : {
248
+ ...e,
249
+ order: parseFloat(`0.${t}`)
250
+ }).sort((e, t) => (e.order ?? 0) - (t.order ?? 0)).map(({ name: e }) => ({ name: e }));
251
+ }, "getBranchesAsObjArray"), fe = /* @__PURE__ */ t(function() {
252
+ return y.records.branches;
253
+ }, "getBranches"), pe = /* @__PURE__ */ t(function() {
254
+ return y.records.commits;
255
+ }, "getCommits"), D = /* @__PURE__ */ t(function() {
256
+ let t = [...y.records.commits.values()];
257
+ return t.forEach(function(t) {
258
+ e.debug(t.id);
259
+ }), t.sort((e, t) => e.seq - t.seq), t;
260
+ }, "getCommitsArray"), O = {
261
+ commitType: _,
262
+ getConfig: v,
263
+ setDirection: S,
264
+ setOptions: C,
265
+ getOptions: ie,
266
+ commit: ae,
267
+ branch: oe,
268
+ merge: se,
269
+ cherryPick: ce,
270
+ checkout: w,
271
+ prettyPrint: le,
272
+ clear: ue,
273
+ getBranchesAsObjArray: de,
274
+ getBranches: fe,
275
+ getCommits: pe,
276
+ getCommitsArray: D,
277
+ getCurrentBranch: /* @__PURE__ */ t(function() {
278
+ return y.records.currBranch;
279
+ }, "getCurrentBranch"),
280
+ getDirection: /* @__PURE__ */ t(function() {
281
+ return y.records.direction;
282
+ }, "getDirection"),
283
+ getHead: /* @__PURE__ */ t(function() {
284
+ return y.records.head;
285
+ }, "getHead"),
286
+ setAccTitle: c,
287
+ getAccTitle: te,
288
+ getAccDescription: u,
289
+ setAccDescription: o,
290
+ setDiagramTitle: l,
291
+ getDiagramTitle: s
292
+ }, k = /* @__PURE__ */ t((e, t) => {
293
+ h(e, t), e.dir && t.setDirection(e.dir);
294
+ for (let n of e.statements) A(n, t);
295
+ }, "populate"), A = /* @__PURE__ */ t((n, r) => {
296
+ let i = {
297
+ Commit: /* @__PURE__ */ t((e) => r.commit(j(e)), "Commit"),
298
+ Branch: /* @__PURE__ */ t((e) => r.branch(M(e)), "Branch"),
299
+ Merge: /* @__PURE__ */ t((e) => r.merge(N(e)), "Merge"),
300
+ Checkout: /* @__PURE__ */ t((e) => r.checkout(P(e)), "Checkout"),
301
+ CherryPicking: /* @__PURE__ */ t((e) => r.cherryPick(F(e)), "CherryPicking")
302
+ }[n.$type];
303
+ i ? i(n) : e.error(`Unknown statement type: ${n.$type}`);
304
+ }, "parseStatement"), j = /* @__PURE__ */ t((e) => ({
305
+ id: e.id,
306
+ msg: e.message ?? "",
307
+ type: e.type === void 0 ? _.NORMAL : _[e.type],
308
+ tags: e.tags ?? void 0
309
+ }), "parseCommit"), M = /* @__PURE__ */ t((e) => ({
310
+ name: e.name,
311
+ order: e.order ?? 0
312
+ }), "parseBranch"), N = /* @__PURE__ */ t((e) => ({
313
+ branch: e.branch,
314
+ id: e.id ?? "",
315
+ type: e.type === void 0 ? void 0 : _[e.type],
316
+ tags: e.tags ?? void 0
317
+ }), "parseMerge"), P = /* @__PURE__ */ t((e) => e.branch, "parseCheckout"), F = /* @__PURE__ */ t((e) => ({
318
+ id: e.id,
319
+ targetId: "",
320
+ tags: e.tags?.length === 0 ? void 0 : e.tags,
321
+ parent: e.parent
322
+ }), "parseCherryPicking"), I = { parse: /* @__PURE__ */ t(async (t) => {
323
+ let n = await g("gitGraph", t);
324
+ e.debug(n), k(n, O);
325
+ }, "parse") }, L = 10, R = 40, z = 4, B = 2, V = 8, H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), W = 30, G = /* @__PURE__ */ new Map(), K = [], q = 0, J = "LR", me = /* @__PURE__ */ t(() => {
326
+ H.clear(), U.clear(), G.clear(), q = 0, K = [], J = "LR";
327
+ }, "clear"), Y = /* @__PURE__ */ t((e) => {
328
+ let t = document.createElementNS("http://www.w3.org/2000/svg", "text");
329
+ return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((e) => {
330
+ let n = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
331
+ n.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), n.setAttribute("dy", "1em"), n.setAttribute("x", "0"), n.setAttribute("class", "row"), n.textContent = e.trim(), t.appendChild(n);
332
+ }), t;
333
+ }, "drawText"), X = /* @__PURE__ */ t((e) => {
334
+ let n, r, i;
335
+ return J === "BT" ? (r = /* @__PURE__ */ t((e, t) => e <= t, "comparisonFunc"), i = Infinity) : (r = /* @__PURE__ */ t((e, t) => e >= t, "comparisonFunc"), i = 0), e.forEach((e) => {
336
+ let t = J === "TB" || J == "BT" ? U.get(e)?.y : U.get(e)?.x;
337
+ t !== void 0 && r(t, i) && (n = e, i = t);
338
+ }), n;
339
+ }, "findClosestParent"), he = /* @__PURE__ */ t((e) => {
340
+ let t = "", n = Infinity;
341
+ return e.forEach((e) => {
342
+ let r = U.get(e).y;
343
+ r <= n && (t = e, n = r);
344
+ }), t || void 0;
345
+ }, "findClosestParentBT"), ge = /* @__PURE__ */ t((e, t, n) => {
346
+ let r = n, i = n, a = [];
347
+ e.forEach((e) => {
348
+ let n = t.get(e);
349
+ if (!n) throw Error(`Commit not found for key ${e}`);
350
+ n.parents.length ? (r = ve(n), i = Math.max(r, i)) : a.push(n), ye(n, r);
351
+ }), r = i, a.forEach((e) => {
352
+ be(e, r, n);
353
+ }), e.forEach((e) => {
354
+ let n = t.get(e);
355
+ if (n?.parents.length) {
356
+ let e = he(n.parents);
357
+ r = U.get(e).y - R, r <= i && (i = r);
358
+ let t = H.get(n.branch).pos, a = r - L;
359
+ U.set(n.id, {
360
+ x: t,
361
+ y: a
362
+ });
363
+ }
364
+ });
365
+ }, "setParallelBTPos"), _e = /* @__PURE__ */ t((e) => {
366
+ let t = X(e.parents.filter((e) => e !== null));
367
+ if (!t) throw Error(`Closest parent not found for commit ${e.id}`);
368
+ let n = U.get(t)?.y;
369
+ if (n === void 0) throw Error(`Closest parent position not found for commit ${e.id}`);
370
+ return n;
371
+ }, "findClosestParentPos"), ve = /* @__PURE__ */ t((e) => _e(e) + R, "calculateCommitPosition"), ye = /* @__PURE__ */ t((e, t) => {
372
+ let n = H.get(e.branch);
373
+ if (!n) throw Error(`Branch not found for commit ${e.id}`);
374
+ let r = n.pos, i = t + L;
375
+ return U.set(e.id, {
376
+ x: r,
377
+ y: i
378
+ }), {
379
+ x: r,
380
+ y: i
381
+ };
382
+ }, "setCommitPosition"), be = /* @__PURE__ */ t((e, t, n) => {
383
+ let r = H.get(e.branch);
384
+ if (!r) throw Error(`Branch not found for commit ${e.id}`);
385
+ let i = t + n, a = r.pos;
386
+ U.set(e.id, {
387
+ x: a,
388
+ y: i
389
+ });
390
+ }, "setRootPosition"), xe = /* @__PURE__ */ t((e, t, n, r, i, a) => {
391
+ if (a === _.HIGHLIGHT) e.append("rect").attr("x", n.x - 10).attr("y", n.y - 10).attr("width", 20).attr("height", 20).attr("class", `commit ${t.id} commit-highlight${i % V} ${r}-outer`), e.append("rect").attr("x", n.x - 6).attr("y", n.y - 6).attr("width", 12).attr("height", 12).attr("class", `commit ${t.id} commit${i % V} ${r}-inner`);
392
+ else if (a === _.CHERRY_PICK) e.append("circle").attr("cx", n.x).attr("cy", n.y).attr("r", 10).attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x - 3).attr("cy", n.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x + 3).attr("cy", n.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${r}`), e.append("line").attr("x1", n.x + 3).attr("y1", n.y + 1).attr("x2", n.x).attr("y2", n.y - 5).attr("stroke", "#fff").attr("class", `commit ${t.id} ${r}`), e.append("line").attr("x1", n.x - 3).attr("y1", n.y + 1).attr("x2", n.x).attr("y2", n.y - 5).attr("stroke", "#fff").attr("class", `commit ${t.id} ${r}`);
393
+ else {
394
+ let o = e.append("circle");
395
+ if (o.attr("cx", n.x), o.attr("cy", n.y), o.attr("r", t.type === _.MERGE ? 9 : 10), o.attr("class", `commit ${t.id} commit${i % V}`), a === _.MERGE) {
396
+ let a = e.append("circle");
397
+ a.attr("cx", n.x), a.attr("cy", n.y), a.attr("r", 6), a.attr("class", `commit ${r} ${t.id} commit${i % V}`);
398
+ }
399
+ a === _.REVERSE && e.append("path").attr("d", `M ${n.x - 5},${n.y - 5}L${n.x + 5},${n.y + 5}M${n.x - 5},${n.y + 5}L${n.x + 5},${n.y - 5}`).attr("class", `commit ${r} ${t.id} commit${i % V}`);
400
+ }
401
+ }, "drawCommitBullet"), Se = /* @__PURE__ */ t((e, t, n, r, i) => {
402
+ if (t.type !== _.CHERRY_PICK && (t.customId && t.type === _.MERGE || t.type !== _.MERGE) && i.showCommitLabel) {
403
+ let a = e.append("g"), o = a.insert("rect").attr("class", "commit-label-bkg"), s = a.append("text").attr("x", r).attr("y", n.y + 25).attr("class", "commit-label").text(t.id), c = s.node()?.getBBox();
404
+ if (c && (o.attr("x", n.posWithOffset - c.width / 2 - B).attr("y", n.y + 13.5).attr("width", c.width + 2 * B).attr("height", c.height + 2 * B), J === "TB" || J === "BT" ? (o.attr("x", n.x - (c.width + 4 * z + 5)).attr("y", n.y - 12), s.attr("x", n.x - (c.width + 4 * z)).attr("y", n.y + c.height - 12)) : s.attr("x", n.posWithOffset - c.width / 2), i.rotateCommitLabel)) if (J === "TB" || J === "BT") s.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")"), o.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")");
405
+ else {
406
+ let e = -7.5 - (c.width + 10) / 25 * 9.5, t = 10 + c.width / 25 * 8.5;
407
+ a.attr("transform", "translate(" + e + ", " + t + ") rotate(-45, " + r + ", " + n.y + ")");
408
+ }
409
+ }
410
+ }, "drawCommitLabel"), Z = /* @__PURE__ */ t((e, t, n, r) => {
411
+ if (t.tags.length > 0) {
412
+ let i = 0, a = 0, o = 0, s = [];
413
+ for (let r of t.tags.reverse()) {
414
+ let t = e.insert("polygon"), c = e.append("circle"), l = e.append("text").attr("y", n.y - 16 - i).attr("class", "tag-label").text(r), u = l.node()?.getBBox();
415
+ if (!u) throw Error("Tag bbox not found");
416
+ a = Math.max(a, u.width), o = Math.max(o, u.height), l.attr("x", n.posWithOffset - u.width / 2), s.push({
417
+ tag: l,
418
+ hole: c,
419
+ rect: t,
420
+ yOffset: i
421
+ }), i += 20;
422
+ }
423
+ for (let { tag: e, hole: t, rect: i, yOffset: c } of s) {
424
+ let s = o / 2, l = n.y - 19.2 - c;
425
+ if (i.attr("class", "tag-label-bkg").attr("points", `
426
+ ${r - a / 2 - z / 2},${l + B}
427
+ ${r - a / 2 - z / 2},${l - B}
428
+ ${n.posWithOffset - a / 2 - z},${l - s - B}
429
+ ${n.posWithOffset + a / 2 + z},${l - s - B}
430
+ ${n.posWithOffset + a / 2 + z},${l + s + B}
431
+ ${n.posWithOffset - a / 2 - z},${l + s + B}`), t.attr("cy", l).attr("cx", r - a / 2 + z / 2).attr("r", 1.5).attr("class", "tag-hole"), J === "TB" || J === "BT") {
432
+ let o = r + c;
433
+ i.attr("class", "tag-label-bkg").attr("points", `
434
+ ${n.x},${o + 2}
435
+ ${n.x},${o - 2}
436
+ ${n.x + L},${o - s - 2}
437
+ ${n.x + L + a + 4},${o - s - 2}
438
+ ${n.x + L + a + 4},${o + s + 2}
439
+ ${n.x + L},${o + s + 2}`).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), t.attr("cx", n.x + z / 2).attr("cy", o).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), e.attr("x", n.x + 5).attr("y", o + 3).attr("transform", "translate(14,14) rotate(45, " + n.x + "," + r + ")");
440
+ }
441
+ }
442
+ }
443
+ }, "drawCommitTags"), Ce = /* @__PURE__ */ t((e) => {
444
+ switch (e.customType ?? e.type) {
445
+ case _.NORMAL: return "commit-normal";
446
+ case _.REVERSE: return "commit-reverse";
447
+ case _.HIGHLIGHT: return "commit-highlight";
448
+ case _.MERGE: return "commit-merge";
449
+ case _.CHERRY_PICK: return "commit-cherry-pick";
450
+ default: return "commit-normal";
451
+ }
452
+ }, "getCommitClassType"), we = /* @__PURE__ */ t((e, t, n, r) => {
453
+ let i = {
454
+ x: 0,
455
+ y: 0
456
+ };
457
+ if (e.parents.length > 0) {
458
+ let n = X(e.parents);
459
+ if (n) {
460
+ let a = r.get(n) ?? i;
461
+ return t === "TB" ? a.y + R : t === "BT" ? (r.get(e.id) ?? i).y - R : a.x + R;
462
+ }
463
+ } else if (t === "TB") return W;
464
+ else if (t === "BT") return (r.get(e.id) ?? i).y - R;
465
+ else return 0;
466
+ return 0;
467
+ }, "calculatePosition"), Te = /* @__PURE__ */ t((e, t, n) => {
468
+ let r = J === "BT" && n ? t : t + L, i = J === "TB" || J === "BT" ? r : H.get(e.branch)?.pos, a = J === "TB" || J === "BT" ? H.get(e.branch)?.pos : r;
469
+ if (a === void 0 || i === void 0) throw Error(`Position were undefined for commit ${e.id}`);
470
+ return {
471
+ x: a,
472
+ y: i,
473
+ posWithOffset: r
474
+ };
475
+ }, "getCommitPosition"), Q = /* @__PURE__ */ t((e, n, r, i) => {
476
+ let a = e.append("g").attr("class", "commit-bullets"), o = e.append("g").attr("class", "commit-labels"), s = J === "TB" || J === "BT" ? W : 0, c = [...n.keys()], l = i.parallelCommits ?? !1, u = /* @__PURE__ */ t((e, t) => {
477
+ let r = n.get(e)?.seq, i = n.get(t)?.seq;
478
+ return r !== void 0 && i !== void 0 ? r - i : 0;
479
+ }, "sortKeys"), d = c.sort(u);
480
+ J === "BT" && (l && ge(d, n, s), d = d.reverse()), d.forEach((e) => {
481
+ let t = n.get(e);
482
+ if (!t) throw Error(`Commit not found for key ${e}`);
483
+ l && (s = we(t, J, s, U));
484
+ let c = Te(t, s, l);
485
+ if (r) {
486
+ let e = Ce(t), n = t.customType ?? t.type;
487
+ xe(a, t, c, e, H.get(t.branch)?.index ?? 0, n), Se(o, t, c, s, i), Z(o, t, c, s);
488
+ }
489
+ J === "TB" || J === "BT" ? U.set(t.id, {
490
+ x: c.x,
491
+ y: c.posWithOffset
492
+ }) : U.set(t.id, {
493
+ x: c.posWithOffset,
494
+ y: c.y
495
+ }), s = J === "BT" && l ? s + R : s + R + L, s > q && (q = s);
496
+ });
497
+ }, "drawCommits"), Ee = /* @__PURE__ */ t((e, n, r, i, a) => {
498
+ let o = (J === "TB" || J === "BT" ? r.x < i.x : r.y < i.y) ? n.branch : e.branch, s = /* @__PURE__ */ t((e) => e.branch === o, "isOnBranchToGetCurve"), c = /* @__PURE__ */ t((t) => t.seq > e.seq && t.seq < n.seq, "isBetweenCommits");
499
+ return [...a.values()].some((e) => c(e) && s(e));
500
+ }, "shouldRerouteArrow"), $ = /* @__PURE__ */ t((e, t, n = 0) => {
501
+ let r = e + Math.abs(e - t) / 2;
502
+ return n > 5 ? r : K.every((e) => Math.abs(e - r) >= 10) ? (K.push(r), r) : $(e, t - Math.abs(e - t) / 5, n + 1);
503
+ }, "findLane"), De = /* @__PURE__ */ t((e, t, n, r) => {
504
+ let i = U.get(t.id), a = U.get(n.id);
505
+ if (i === void 0 || a === void 0) throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);
506
+ let o = Ee(t, n, i, a, r), s = "", c = "", l = 0, u = 0, d = H.get(n.branch)?.index;
507
+ n.type === _.MERGE && t.id !== n.parents[0] && (d = H.get(t.branch)?.index);
508
+ let f;
509
+ if (o) {
510
+ s = "A 10 10, 0, 0, 0,", c = "A 10 10, 0, 0, 1,", l = 10, u = 10;
511
+ let e = i.y < a.y ? $(i.y, a.y) : $(a.y, i.y), n = i.x < a.x ? $(i.x, a.x) : $(a.x, i.x);
512
+ J === "TB" ? i.x < a.x ? f = `M ${i.x} ${i.y} L ${n - l} ${i.y} ${c} ${n} ${i.y + u} L ${n} ${a.y - l} ${s} ${n + u} ${a.y} L ${a.x} ${a.y}` : (d = H.get(t.branch)?.index, f = `M ${i.x} ${i.y} L ${n + l} ${i.y} ${s} ${n} ${i.y + u} L ${n} ${a.y - l} ${c} ${n - u} ${a.y} L ${a.x} ${a.y}`) : J === "BT" ? i.x < a.x ? f = `M ${i.x} ${i.y} L ${n - l} ${i.y} ${s} ${n} ${i.y - u} L ${n} ${a.y + l} ${c} ${n + u} ${a.y} L ${a.x} ${a.y}` : (d = H.get(t.branch)?.index, f = `M ${i.x} ${i.y} L ${n + l} ${i.y} ${c} ${n} ${i.y - u} L ${n} ${a.y + l} ${s} ${n - u} ${a.y} L ${a.x} ${a.y}`) : i.y < a.y ? f = `M ${i.x} ${i.y} L ${i.x} ${e - l} ${s} ${i.x + u} ${e} L ${a.x - l} ${e} ${c} ${a.x} ${e + u} L ${a.x} ${a.y}` : (d = H.get(t.branch)?.index, f = `M ${i.x} ${i.y} L ${i.x} ${e + l} ${c} ${i.x + u} ${e} L ${a.x - l} ${e} ${s} ${a.x} ${e - u} L ${a.x} ${a.y}`);
513
+ } else s = "A 20 20, 0, 0, 0,", c = "A 20 20, 0, 0, 1,", l = 20, u = 20, J === "TB" ? (i.x < a.x && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y - l} ${s} ${i.x + u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${c} ${a.x} ${i.y + u} L ${a.x} ${a.y}`), i.x > a.x && (s = "A 20 20, 0, 0, 0,", c = "A 20 20, 0, 0, 1,", l = 20, u = 20, f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y - l} ${c} ${i.x - u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x + l} ${i.y} ${s} ${a.x} ${i.y + u} L ${a.x} ${a.y}`), i.x === a.x && (f = `M ${i.x} ${i.y} L ${a.x} ${a.y}`)) : J === "BT" ? (i.x < a.x && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y + l} ${c} ${i.x + u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${s} ${a.x} ${i.y - u} L ${a.x} ${a.y}`), i.x > a.x && (s = "A 20 20, 0, 0, 0,", c = "A 20 20, 0, 0, 1,", l = 20, u = 20, f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${i.x} ${a.y + l} ${s} ${i.x - u} ${a.y} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${a.x + l} ${i.y} ${c} ${a.x} ${i.y - u} L ${a.x} ${a.y}`), i.x === a.x && (f = `M ${i.x} ${i.y} L ${a.x} ${a.y}`)) : (i.y < a.y && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${c} ${a.x} ${i.y + u} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${i.x} ${a.y - l} ${s} ${i.x + u} ${a.y} L ${a.x} ${a.y}`), i.y > a.y && (f = n.type === _.MERGE && t.id !== n.parents[0] ? `M ${i.x} ${i.y} L ${a.x - l} ${i.y} ${s} ${a.x} ${i.y - u} L ${a.x} ${a.y}` : `M ${i.x} ${i.y} L ${i.x} ${a.y + l} ${c} ${i.x + u} ${a.y} L ${a.x} ${a.y}`), i.y === a.y && (f = `M ${i.x} ${i.y} L ${a.x} ${a.y}`));
514
+ if (f === void 0) throw Error("Line definition not found");
515
+ e.append("path").attr("d", f).attr("class", "arrow arrow" + d % V);
516
+ }, "drawArrow"), Oe = /* @__PURE__ */ t((e, t) => {
517
+ let n = e.append("g").attr("class", "commit-arrows");
518
+ [...t.keys()].forEach((e) => {
519
+ let r = t.get(e);
520
+ r.parents && r.parents.length > 0 && r.parents.forEach((e) => {
521
+ De(n, t.get(e), r, t);
522
+ });
523
+ });
524
+ }, "drawArrows"), ke = /* @__PURE__ */ t((e, t, n) => {
525
+ let r = e.append("g");
526
+ t.forEach((e, t) => {
527
+ let i = t % V, a = H.get(e.name)?.pos;
528
+ if (a === void 0) throw Error(`Position not found for branch ${e.name}`);
529
+ let o = r.append("line");
530
+ o.attr("x1", 0), o.attr("y1", a), o.attr("x2", q), o.attr("y2", a), o.attr("class", "branch branch" + i), J === "TB" ? (o.attr("y1", W), o.attr("x1", a), o.attr("y2", q), o.attr("x2", a)) : J === "BT" && (o.attr("y1", q), o.attr("x1", a), o.attr("y2", W), o.attr("x2", a)), K.push(a);
531
+ let s = e.name, c = Y(s), l = r.insert("rect"), u = r.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + i);
532
+ u.node().appendChild(c);
533
+ let d = c.getBBox();
534
+ l.attr("class", "branchLabelBkg label" + i).attr("rx", 4).attr("ry", 4).attr("x", -d.width - 4 - (n.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -d.height / 2 + 8).attr("width", d.width + 18).attr("height", d.height + 4), u.attr("transform", "translate(" + (-d.width - 14 - (n.rotateCommitLabel === !0 ? 30 : 0)) + ", " + (a - d.height / 2 - 1) + ")"), J === "TB" ? (l.attr("x", a - d.width / 2 - 10).attr("y", 0), u.attr("transform", "translate(" + (a - d.width / 2 - 5) + ", 0)")) : J === "BT" ? (l.attr("x", a - d.width / 2 - 10).attr("y", q), u.attr("transform", "translate(" + (a - d.width / 2 - 5) + ", " + q + ")")) : l.attr("transform", "translate(-19, " + (a - d.height / 2) + ")");
535
+ });
536
+ }, "drawBranches"), Ae = /* @__PURE__ */ t(function(e, t, n, r, i) {
537
+ return H.set(e, {
538
+ pos: t,
539
+ index: n
540
+ }), t += 50 + (i ? 40 : 0) + (J === "TB" || J === "BT" ? r.width / 2 : 0), t;
541
+ }, "setBranchPosition"), je = {
542
+ parser: I,
543
+ db: O,
544
+ renderer: { draw: /* @__PURE__ */ t(function(t, i, a, o) {
545
+ me(), e.debug("in gitgraph renderer", t + "\n", "id:", i, a);
546
+ let s = o.db;
547
+ if (!s.getConfig) {
548
+ e.error("getConfig method is not available on db");
549
+ return;
550
+ }
551
+ let c = s.getConfig(), l = c.rotateCommitLabel ?? !1;
552
+ G = s.getCommits();
553
+ let u = s.getBranchesAsObjArray();
554
+ J = s.getDirection();
555
+ let d = n(`[id="${i}"]`), f = 0;
556
+ u.forEach((e, t) => {
557
+ let n = Y(e.name), r = d.append("g"), i = r.insert("g").attr("class", "branchLabel"), a = i.insert("g").attr("class", "label branch-label");
558
+ a.node()?.appendChild(n);
559
+ let o = n.getBBox();
560
+ f = Ae(e.name, f, t, o, l), a.remove(), i.remove(), r.remove();
561
+ }), Q(d, G, !1, c), c.showBranches && ke(d, u, c), Oe(d, G), Q(d, G, !0, c), r.insertTitle(d, "gitTitleText", c.titleTopMargin ?? 0, s.getDiagramTitle()), ee(void 0, d, c.diagramPadding, c.useMaxWidth);
562
+ }, "draw") },
563
+ styles: /* @__PURE__ */ t((e) => `
564
+ .commit-id,
565
+ .commit-msg,
566
+ .branch-label {
567
+ fill: lightgrey;
568
+ color: lightgrey;
569
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
570
+ font-family: var(--mermaid-font-family);
571
+ }
572
+ ${[
573
+ 0,
574
+ 1,
575
+ 2,
576
+ 3,
577
+ 4,
578
+ 5,
579
+ 6,
580
+ 7
581
+ ].map((t) => `
582
+ .branch-label${t} { fill: ${e["gitBranchLabel" + t]}; }
583
+ .commit${t} { stroke: ${e["git" + t]}; fill: ${e["git" + t]}; }
584
+ .commit-highlight${t} { stroke: ${e["gitInv" + t]}; fill: ${e["gitInv" + t]}; }
585
+ .label${t} { fill: ${e["git" + t]}; }
586
+ .arrow${t} { stroke: ${e["git" + t]}; }
587
+ `).join("\n")}
588
+
589
+ .branch {
590
+ stroke-width: 1;
591
+ stroke: ${e.lineColor};
592
+ stroke-dasharray: 2;
593
+ }
594
+ .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelColor};}
595
+ .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${e.commitLabelBackground}; opacity: 0.5; }
596
+ .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
597
+ .tag-label-bkg { fill: ${e.tagLabelBackground}; stroke: ${e.tagLabelBorder}; }
598
+ .tag-hole { fill: ${e.textColor}; }
599
+
600
+ .commit-merge {
601
+ stroke: ${e.primaryColor};
602
+ fill: ${e.primaryColor};
603
+ }
604
+ .commit-reverse {
605
+ stroke: ${e.primaryColor};
606
+ fill: ${e.primaryColor};
607
+ stroke-width: 3;
608
+ }
609
+ .commit-highlight-outer {
610
+ }
611
+ .commit-highlight-inner {
612
+ stroke: ${e.primaryColor};
613
+ fill: ${e.primaryColor};
614
+ }
615
+
616
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
617
+ .gitTitleText {
618
+ text-anchor: middle;
619
+ font-size: 18px;
620
+ fill: ${e.textColor};
621
+ }
622
+ `, "getStyles")
623
+ };
624
+ //#endregion
625
+ export { je as diagram };