@marimo-team/islands 0.13.16-dev2 → 0.13.16-dev21

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 (86) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BizAnuDQ.js → ConnectedDataExplorerComponent-CbgMGTNw.js} +1495 -1496
  2. package/dist/ImageComparisonComponent-BEvxQRYY.js +248 -0
  3. package/dist/{VegaLite-BvtjUHLS.js → VegaLite-CtlLD_UH.js} +12483 -12485
  4. package/dist/{_baseUniq-C1K8a5jF.js → _baseUniq-BPYian-Y.js} +13 -13
  5. package/dist/{any-language-editor-D3C2KiQW.js → any-language-editor-B9yuOY2a.js} +2 -2
  6. package/dist/{architectureDiagram-IEHRJDOE-DhrFWr1a.js → architectureDiagram-IEHRJDOE-yPyQlJjy.js} +1800 -1800
  7. package/dist/asn1-jKiBa2Ya.js +10 -10
  8. package/dist/assets/{save-worker-9HEtFDM0.js → save-worker-DwN_qfSx.js} +695 -702
  9. package/dist/assets/{worker-BGGm0KYZ.js → worker-BzMPE1Lq.js} +732 -739
  10. package/dist/assets/{worker-BNsqBj5w.js → worker-ISYYr8IB.js} +726 -732
  11. package/dist/blockDiagram-JOT3LUYC-548hLzGM.js +2249 -0
  12. package/dist/{c4Diagram-VJAJSXHY-DKSU0_Zg.js → c4Diagram-VJAJSXHY-CkEjf0GP.js} +401 -400
  13. package/dist/{channel-DMiLp-mI.js → channel-B4Bg4vOE.js} +1 -1
  14. package/dist/chunk-4BMEZGHF-De9P61oF.js +9 -0
  15. package/dist/chunk-A2AXSNBT-geH9ZZvt.js +1373 -0
  16. package/dist/chunk-AEK57VVT-B2sQ0hQa.js +1416 -0
  17. package/dist/{chunk-D6G4REZN-BZV3ukOi.js → chunk-D6G4REZN-C2nlv3Zm.js} +2 -2
  18. package/dist/{chunk-RZ5BOZE2-B4rOVQD8.js → chunk-RZ5BOZE2-CmOabQbu.js} +8 -8
  19. package/dist/chunk-XZIHB7SX-C-O1Dk7e.js +16 -0
  20. package/dist/{classDiagram-GIVACNV2-DLRT4_A4.js → classDiagram-GIVACNV2-Du2vgWFA.js} +2 -2
  21. package/dist/{classDiagram-v2-COTLJTTW-DLRT4_A4.js → classDiagram-v2-COTLJTTW-Du2vgWFA.js} +2 -2
  22. package/dist/clojure-CCKyeQKf.js +2 -2
  23. package/dist/{clone-CPwu6xRn.js → clone-DnSM2M6p.js} +1 -1
  24. package/dist/css-bIlmDBTK.js +19 -19
  25. package/dist/{cytoscape.esm-DAyNQ0qu.js → cytoscape.esm-CCQ3SVU1.js} +2301 -2301
  26. package/dist/dagre-OKDRZEBW-CnGJy_Hk.js +447 -0
  27. package/dist/{data-editor-CYvUeKhw.js → data-editor--qYs3N6K.js} +5785 -5795
  28. package/dist/{diagram-SSKATNLV-D8WhiY2q.js → diagram-SSKATNLV-Ba25ch_t.js} +13 -13
  29. package/dist/{diagram-VNBRO52H-Bil9sOsr.js → diagram-VNBRO52H-ky1Bklgc.js} +3 -3
  30. package/dist/{erDiagram-Q7BY3M3F-J-Jm-DD7.js → erDiagram-Q7BY3M3F-DKx4pdnF.js} +263 -262
  31. package/dist/flowDiagram-4HSFHLVR-D2g6V5ro.js +1623 -0
  32. package/dist/{ganttDiagram-APWFNJXF-C2G0-fOq.js → ganttDiagram-APWFNJXF-CM2375VL.js} +45 -45
  33. package/dist/gitGraphDiagram-7IBYFJ6S-CYBXIIJu.js +712 -0
  34. package/dist/{graph-BFerxzEi.js → graph-BXO6Y4fK.js} +9 -9
  35. package/dist/{index-DfpR00QG.js → index-BXQhgr_p.js} +99 -98
  36. package/dist/{index-BhtvwOag.js → index-CLVuMf-N.js} +28 -28
  37. package/dist/{index-j8M50mVa.js → index-DsjbPR0S.js} +4 -4
  38. package/dist/{index-DkuVwdVm.js → index-kCGDeFbz.js} +9 -9
  39. package/dist/{infoDiagram-PH2N3AL5-AYtb1_Lz.js → infoDiagram-PH2N3AL5-Bysuy2jX.js} +3 -3
  40. package/dist/javascript-WMWNx-Vj.js +47 -47
  41. package/dist/{journeyDiagram-U35MCT3I-Bdz9gIBI.js → journeyDiagram-U35MCT3I-TBaQruI8.js} +18 -18
  42. package/dist/kanban-definition-NDS4AKOZ-D4jw_Hry.js +719 -0
  43. package/dist/{katex-9tX9hjoM.js → katex-CUSbq6rG.js} +2180 -2180
  44. package/dist/{layout-Qs-BVu8V.js → layout-BUA-DPJm.js} +27 -27
  45. package/dist/{linear-SIbCb7yI.js → linear-BnTRnU3J.js} +2 -2
  46. package/dist/main-D-37AaR4.js +169855 -0
  47. package/dist/main.js +1 -1
  48. package/dist/mermaid-BzFQ2d9i.js +14517 -0
  49. package/dist/{mhchem-L5-rce7L.js → mhchem-Db_f2n8C.js} +30 -30
  50. package/dist/{min-BTA1UVkn.js → min-D_xIH6wU.js} +2 -2
  51. package/dist/{mindmap-definition-ALO5MXBD-CdrD5BzZ.js → mindmap-definition-ALO5MXBD-J6RsqNRW.js} +359 -359
  52. package/dist/mllike-BSnXJBGA.js +7 -7
  53. package/dist/{pieDiagram-IB7DONF6-BbbxWeqU.js → pieDiagram-IB7DONF6-CyMim2nt.js} +34 -34
  54. package/dist/pug-BqUR2bBq.js +35 -35
  55. package/dist/python-B5QdSKoL.js +18 -18
  56. package/dist/quadrantDiagram-7GDLP6J5-wbyf83kA.js +1025 -0
  57. package/dist/{radar-MK3ICKWK-Z5R0bt0z.js → radar-MK3ICKWK-BDGRcSnx.js} +2555 -2554
  58. package/dist/{react-plotly-DqDxe4Uh.js → react-plotly-DrgClWur.js} +6595 -6597
  59. package/dist/{requirementDiagram-KVF5MWMF-DMnvzAxX.js → requirementDiagram-KVF5MWMF-Cm8xuD8x.js} +251 -250
  60. package/dist/rpm-IznJm2Xc.js +9 -9
  61. package/dist/{sankeyDiagram-QLVOVGJD-DbUWg3a4.js → sankeyDiagram-QLVOVGJD-iRFZmvn2.js} +339 -338
  62. package/dist/{sequenceDiagram-X6HHIX6F-JltcBwLF.js → sequenceDiagram-X6HHIX6F-Dr8oo1TZ.js} +822 -821
  63. package/dist/{slides-component-DVr5mf9p.js → slides-component-D8N71t3Y.js} +280 -280
  64. package/dist/sql-mMre1Bo3.js +9 -9
  65. package/dist/{stateDiagram-DGXRK772-qbXtyoS6.js → stateDiagram-DGXRK772-BNQYJSkB.js} +17 -17
  66. package/dist/{stateDiagram-v2-YXO3MK2T-Ba7q5pMK.js → stateDiagram-v2-YXO3MK2T-Dl249u1C.js} +2 -2
  67. package/dist/style.css +1 -1
  68. package/dist/{time-DHD8Fix8.js → time-hpTGXdsY.js} +2 -2
  69. package/dist/{timeline-definition-BDJGKUSR-q4gOCBRq.js → timeline-definition-BDJGKUSR-kYwIJd20.js} +261 -261
  70. package/dist/timer-BYwnU4DF.js +378 -378
  71. package/dist/ttcn-cfg-Bac_acMi.js +9 -9
  72. package/dist/{vega-component-D2NZFVvw.js → vega-component-CIAcZw-F.js} +82 -82
  73. package/dist/{xychartDiagram-VJFVF3MP-BZs9xPvU.js → xychartDiagram-VJFVF3MP-Cj3j6vWQ.js} +472 -471
  74. package/package.json +7 -6
  75. package/dist/blockDiagram-JOT3LUYC-COVagShg.js +0 -2248
  76. package/dist/chunk-4BMEZGHF-CeMSohVe.js +0 -9
  77. package/dist/chunk-A2AXSNBT-mQ3fXQfx.js +0 -1372
  78. package/dist/chunk-AEK57VVT-B7kw2yt6.js +0 -1415
  79. package/dist/chunk-XZIHB7SX-C3-5SkZh.js +0 -15
  80. package/dist/dagre-OKDRZEBW-yEQf6TwX.js +0 -447
  81. package/dist/flowDiagram-4HSFHLVR-Dhymtq1g.js +0 -1622
  82. package/dist/gitGraphDiagram-7IBYFJ6S-DCZAwPro.js +0 -712
  83. package/dist/kanban-definition-NDS4AKOZ-ByLpDX9Y.js +0 -719
  84. package/dist/main-Cx3zrED9.js +0 -156521
  85. package/dist/mermaid-DAi_EtLa.js +0 -11991
  86. package/dist/quadrantDiagram-7GDLP6J5-1UQgbW9Z.js +0 -1024
@@ -1,712 +0,0 @@
1
- import { p as Z } from "./chunk-4BMEZGHF-CeMSohVe.js";
2
- import { I as F } from "./chunk-XZIHB7SX-C3-5SkZh.js";
3
- import { _ as h, t as U, q as rr, s as er, g as tr, a as ar, b as nr, l as w, c as sr, d as or, u as cr, E as ir, z as dr, k as B, F as hr, G as lr, H as $r, I as fr } from "./mermaid-DAi_EtLa.js";
4
- import { p as gr } from "./radar-MK3ICKWK-Z5R0bt0z.js";
5
- var x = {
6
- NORMAL: 0,
7
- REVERSE: 1,
8
- HIGHLIGHT: 2,
9
- MERGE: 3,
10
- CHERRY_PICK: 4
11
- }, yr = $r.gitGraph, z = /* @__PURE__ */ h(() => hr({
12
- ...yr,
13
- ...lr().gitGraph
14
- }), "getConfig"), i = new F(() => {
15
- const t = z(), r = t.mainBranchName, a = t.mainBranchOrder;
16
- return {
17
- mainBranchName: r,
18
- commits: /* @__PURE__ */ new Map(),
19
- head: null,
20
- branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: a }]]),
21
- branches: /* @__PURE__ */ new Map([[r, null]]),
22
- currBranch: r,
23
- direction: "LR",
24
- seq: 0,
25
- options: {}
26
- };
27
- });
28
- function S() {
29
- return fr({ length: 7 });
30
- }
31
- h(S, "getID");
32
- function N(t, r) {
33
- const a = /* @__PURE__ */ Object.create(null);
34
- return t.reduce((s, e) => {
35
- const n = r(e);
36
- return a[n] || (a[n] = !0, s.push(e)), s;
37
- }, []);
38
- }
39
- h(N, "uniqBy");
40
- var ur = /* @__PURE__ */ h(function(t) {
41
- i.records.direction = t;
42
- }, "setDirection"), xr = /* @__PURE__ */ h(function(t) {
43
- w.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
44
- try {
45
- i.records.options = JSON.parse(t);
46
- } catch (r) {
47
- w.error("error while parsing gitGraph options", r.message);
48
- }
49
- }, "setOptions"), pr = /* @__PURE__ */ h(function() {
50
- return i.records.options;
51
- }, "getOptions"), br = /* @__PURE__ */ h(function(t) {
52
- let r = t.msg, a = t.id;
53
- const s = t.type;
54
- let e = t.tags;
55
- w.info("commit", r, a, s, e), w.debug("Entering commit:", r, a, s, e);
56
- const n = z();
57
- a = B.sanitizeText(a, n), r = B.sanitizeText(r, n), e = e == null ? void 0 : e.map((o) => B.sanitizeText(o, n));
58
- const c = {
59
- id: a || i.records.seq + "-" + S(),
60
- message: r,
61
- seq: i.records.seq++,
62
- type: s ?? x.NORMAL,
63
- tags: e ?? [],
64
- parents: i.records.head == null ? [] : [i.records.head.id],
65
- branch: i.records.currBranch
66
- };
67
- i.records.head = c, w.info("main branch", n.mainBranchName), i.records.commits.set(c.id, c), i.records.branches.set(i.records.currBranch, c.id), w.debug("in pushCommit " + c.id);
68
- }, "commit"), mr = /* @__PURE__ */ h(function(t) {
69
- let r = t.name;
70
- const a = t.order;
71
- if (r = B.sanitizeText(r, z()), i.records.branches.has(r))
72
- throw new Error(
73
- `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
74
- );
75
- i.records.branches.set(r, i.records.head != null ? i.records.head.id : null), i.records.branchConfig.set(r, { name: r, order: a }), _(r), w.debug("in createBranch");
76
- }, "branch"), wr = /* @__PURE__ */ h((t) => {
77
- let r = t.branch, a = t.id;
78
- const s = t.type, e = t.tags, n = z();
79
- r = B.sanitizeText(r, n), a && (a = B.sanitizeText(a, n));
80
- const c = i.records.branches.get(i.records.currBranch), o = i.records.branches.get(r), $ = c ? i.records.commits.get(c) : void 0, l = o ? i.records.commits.get(o) : void 0;
81
- if ($ && l && $.branch === r)
82
- throw new Error(`Cannot merge branch '${r}' into itself.`);
83
- if (i.records.currBranch === r) {
84
- const d = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
85
- throw d.hash = {
86
- text: `merge ${r}`,
87
- token: `merge ${r}`,
88
- expected: ["branch abc"]
89
- }, d;
90
- }
91
- if ($ === void 0 || !$) {
92
- const d = new Error(
93
- `Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`
94
- );
95
- throw d.hash = {
96
- text: `merge ${r}`,
97
- token: `merge ${r}`,
98
- expected: ["commit"]
99
- }, d;
100
- }
101
- if (!i.records.branches.has(r)) {
102
- const d = new Error(
103
- 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
104
- );
105
- throw d.hash = {
106
- text: `merge ${r}`,
107
- token: `merge ${r}`,
108
- expected: [`branch ${r}`]
109
- }, d;
110
- }
111
- if (l === void 0 || !l) {
112
- const d = new Error(
113
- 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
114
- );
115
- throw d.hash = {
116
- text: `merge ${r}`,
117
- token: `merge ${r}`,
118
- expected: ['"commit"']
119
- }, d;
120
- }
121
- if ($ === l) {
122
- const d = new Error('Incorrect usage of "merge". Both branches have same head');
123
- throw d.hash = {
124
- text: `merge ${r}`,
125
- token: `merge ${r}`,
126
- expected: ["branch abc"]
127
- }, d;
128
- }
129
- if (a && i.records.commits.has(a)) {
130
- const d = new Error(
131
- 'Incorrect usage of "merge". Commit with id:' + a + " already exists, use different custom Id"
132
- );
133
- throw d.hash = {
134
- text: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
135
- token: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
136
- expected: [
137
- `merge ${r} ${a}_UNIQUE ${s} ${e == null ? void 0 : e.join(" ")}`
138
- ]
139
- }, d;
140
- }
141
- const f = o || "", g = {
142
- id: a || `${i.records.seq}-${S()}`,
143
- message: `merged branch ${r} into ${i.records.currBranch}`,
144
- seq: i.records.seq++,
145
- parents: i.records.head == null ? [] : [i.records.head.id, f],
146
- branch: i.records.currBranch,
147
- type: x.MERGE,
148
- customType: s,
149
- customId: !!a,
150
- tags: e ?? []
151
- };
152
- i.records.head = g, i.records.commits.set(g.id, g), i.records.branches.set(i.records.currBranch, g.id), w.debug(i.records.branches), w.debug("in mergeBranch");
153
- }, "merge"), vr = /* @__PURE__ */ h(function(t) {
154
- let r = t.id, a = t.targetId, s = t.tags, e = t.parent;
155
- w.debug("Entering cherryPick:", r, a, s);
156
- const n = z();
157
- if (r = B.sanitizeText(r, n), a = B.sanitizeText(a, n), s = s == null ? void 0 : s.map(($) => B.sanitizeText($, n)), e = B.sanitizeText(e, n), !r || !i.records.commits.has(r)) {
158
- const $ = new Error(
159
- 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
160
- );
161
- throw $.hash = {
162
- text: `cherryPick ${r} ${a}`,
163
- token: `cherryPick ${r} ${a}`,
164
- expected: ["cherry-pick abc"]
165
- }, $;
166
- }
167
- const c = i.records.commits.get(r);
168
- if (c === void 0 || !c)
169
- throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
170
- if (e && !(Array.isArray(c.parents) && c.parents.includes(e)))
171
- throw new Error(
172
- "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
173
- );
174
- const o = c.branch;
175
- if (c.type === x.MERGE && !e)
176
- throw new Error(
177
- "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
178
- );
179
- if (!a || !i.records.commits.has(a)) {
180
- if (o === i.records.currBranch) {
181
- const g = new Error(
182
- 'Incorrect usage of "cherryPick". Source commit is already on current branch'
183
- );
184
- throw g.hash = {
185
- text: `cherryPick ${r} ${a}`,
186
- token: `cherryPick ${r} ${a}`,
187
- expected: ["cherry-pick abc"]
188
- }, g;
189
- }
190
- const $ = i.records.branches.get(i.records.currBranch);
191
- if ($ === void 0 || !$) {
192
- const g = new Error(
193
- `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
194
- );
195
- throw g.hash = {
196
- text: `cherryPick ${r} ${a}`,
197
- token: `cherryPick ${r} ${a}`,
198
- expected: ["cherry-pick abc"]
199
- }, g;
200
- }
201
- const l = i.records.commits.get($);
202
- if (l === void 0 || !l) {
203
- const g = new Error(
204
- `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
205
- );
206
- throw g.hash = {
207
- text: `cherryPick ${r} ${a}`,
208
- token: `cherryPick ${r} ${a}`,
209
- expected: ["cherry-pick abc"]
210
- }, g;
211
- }
212
- const f = {
213
- id: i.records.seq + "-" + S(),
214
- message: `cherry-picked ${c == null ? void 0 : c.message} into ${i.records.currBranch}`,
215
- seq: i.records.seq++,
216
- parents: i.records.head == null ? [] : [i.records.head.id, c.id],
217
- branch: i.records.currBranch,
218
- type: x.CHERRY_PICK,
219
- tags: s ? s.filter(Boolean) : [
220
- `cherry-pick:${c.id}${c.type === x.MERGE ? `|parent:${e}` : ""}`
221
- ]
222
- };
223
- i.records.head = f, i.records.commits.set(f.id, f), i.records.branches.set(i.records.currBranch, f.id), w.debug(i.records.branches), w.debug("in cherryPick");
224
- }
225
- }, "cherryPick"), _ = /* @__PURE__ */ h(function(t) {
226
- if (t = B.sanitizeText(t, z()), i.records.branches.has(t)) {
227
- i.records.currBranch = t;
228
- const r = i.records.branches.get(i.records.currBranch);
229
- r === void 0 || !r ? i.records.head = null : i.records.head = i.records.commits.get(r) ?? null;
230
- } else {
231
- const r = new Error(
232
- `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
233
- );
234
- throw r.hash = {
235
- text: `checkout ${t}`,
236
- token: `checkout ${t}`,
237
- expected: [`branch ${t}`]
238
- }, r;
239
- }
240
- }, "checkout");
241
- function A(t, r, a) {
242
- const s = t.indexOf(r);
243
- s === -1 ? t.push(a) : t.splice(s, 1, a);
244
- }
245
- h(A, "upsert");
246
- function Y(t) {
247
- const r = t.reduce((e, n) => e.seq > n.seq ? e : n, t[0]);
248
- let a = "";
249
- t.forEach(function(e) {
250
- e === r ? a += " *" : a += " |";
251
- });
252
- const s = [a, r.id, r.seq];
253
- for (const e in i.records.branches)
254
- i.records.branches.get(e) === r.id && s.push(e);
255
- if (w.debug(s.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
256
- const e = i.records.commits.get(r.parents[0]);
257
- A(t, r, e), r.parents[1] && t.push(i.records.commits.get(r.parents[1]));
258
- } else {
259
- if (r.parents.length == 0)
260
- return;
261
- if (r.parents[0]) {
262
- const e = i.records.commits.get(r.parents[0]);
263
- A(t, r, e);
264
- }
265
- }
266
- t = N(t, (e) => e.id), Y(t);
267
- }
268
- h(Y, "prettyPrintCommitHistory");
269
- var Cr = /* @__PURE__ */ h(function() {
270
- w.debug(i.records.commits);
271
- const t = V()[0];
272
- Y([t]);
273
- }, "prettyPrint"), Er = /* @__PURE__ */ h(function() {
274
- i.reset(), dr();
275
- }, "clear"), Br = /* @__PURE__ */ h(function() {
276
- return [...i.records.branchConfig.values()].map((r, a) => r.order !== null && r.order !== void 0 ? r : {
277
- ...r,
278
- order: parseFloat(`0.${a}`)
279
- }).sort((r, a) => (r.order ?? 0) - (a.order ?? 0)).map(({ name: r }) => ({ name: r }));
280
- }, "getBranchesAsObjArray"), kr = /* @__PURE__ */ h(function() {
281
- return i.records.branches;
282
- }, "getBranches"), Lr = /* @__PURE__ */ h(function() {
283
- return i.records.commits;
284
- }, "getCommits"), V = /* @__PURE__ */ h(function() {
285
- const t = [...i.records.commits.values()];
286
- return t.forEach(function(r) {
287
- w.debug(r.id);
288
- }), t.sort((r, a) => r.seq - a.seq), t;
289
- }, "getCommitsArray"), Tr = /* @__PURE__ */ h(function() {
290
- return i.records.currBranch;
291
- }, "getCurrentBranch"), Mr = /* @__PURE__ */ h(function() {
292
- return i.records.direction;
293
- }, "getDirection"), Rr = /* @__PURE__ */ h(function() {
294
- return i.records.head;
295
- }, "getHead"), X = {
296
- commitType: x,
297
- getConfig: z,
298
- setDirection: ur,
299
- setOptions: xr,
300
- getOptions: pr,
301
- commit: br,
302
- branch: mr,
303
- merge: wr,
304
- cherryPick: vr,
305
- checkout: _,
306
- //reset,
307
- prettyPrint: Cr,
308
- clear: Er,
309
- getBranchesAsObjArray: Br,
310
- getBranches: kr,
311
- getCommits: Lr,
312
- getCommitsArray: V,
313
- getCurrentBranch: Tr,
314
- getDirection: Mr,
315
- getHead: Rr,
316
- setAccTitle: nr,
317
- getAccTitle: ar,
318
- getAccDescription: tr,
319
- setAccDescription: er,
320
- setDiagramTitle: rr,
321
- getDiagramTitle: U
322
- }, Ir = /* @__PURE__ */ h((t, r) => {
323
- Z(t, r), t.dir && r.setDirection(t.dir);
324
- for (const a of t.statements)
325
- qr(a, r);
326
- }, "populate"), qr = /* @__PURE__ */ h((t, r) => {
327
- const s = {
328
- Commit: /* @__PURE__ */ h((e) => r.commit(Or(e)), "Commit"),
329
- Branch: /* @__PURE__ */ h((e) => r.branch(zr(e)), "Branch"),
330
- Merge: /* @__PURE__ */ h((e) => r.merge(Gr(e)), "Merge"),
331
- Checkout: /* @__PURE__ */ h((e) => r.checkout(Hr(e)), "Checkout"),
332
- CherryPicking: /* @__PURE__ */ h((e) => r.cherryPick(Pr(e)), "CherryPicking")
333
- }[t.$type];
334
- s ? s(t) : w.error(`Unknown statement type: ${t.$type}`);
335
- }, "parseStatement"), Or = /* @__PURE__ */ h((t) => ({
336
- id: t.id,
337
- msg: t.message ?? "",
338
- type: t.type !== void 0 ? x[t.type] : x.NORMAL,
339
- tags: t.tags ?? void 0
340
- }), "parseCommit"), zr = /* @__PURE__ */ h((t) => ({
341
- name: t.name,
342
- order: t.order ?? 0
343
- }), "parseBranch"), Gr = /* @__PURE__ */ h((t) => ({
344
- branch: t.branch,
345
- id: t.id ?? "",
346
- type: t.type !== void 0 ? x[t.type] : void 0,
347
- tags: t.tags ?? void 0
348
- }), "parseMerge"), Hr = /* @__PURE__ */ h((t) => t.branch, "parseCheckout"), Pr = /* @__PURE__ */ h((t) => {
349
- var a;
350
- return {
351
- id: t.id,
352
- targetId: "",
353
- tags: ((a = t.tags) == null ? void 0 : a.length) === 0 ? void 0 : t.tags,
354
- parent: t.parent
355
- };
356
- }, "parseCherryPicking"), Wr = {
357
- parse: /* @__PURE__ */ h(async (t) => {
358
- const r = await gr("gitGraph", t);
359
- w.debug(r), Ir(r, X);
360
- }, "parse")
361
- }, j = sr(), b = j == null ? void 0 : j.gitGraph, R = 10, I = 40, k = 4, L = 2, O = 8, C = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), P = 30, G = /* @__PURE__ */ new Map(), W = [], M = 0, u = "LR", Sr = /* @__PURE__ */ h(() => {
362
- C.clear(), E.clear(), G.clear(), M = 0, W = [], u = "LR";
363
- }, "clear"), J = /* @__PURE__ */ h((t) => {
364
- const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
365
- return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((s) => {
366
- const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
367
- e.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), e.setAttribute("dy", "1em"), e.setAttribute("x", "0"), e.setAttribute("class", "row"), e.textContent = s.trim(), r.appendChild(e);
368
- }), r;
369
- }, "drawText"), Q = /* @__PURE__ */ h((t) => {
370
- let r, a, s;
371
- return u === "BT" ? (a = /* @__PURE__ */ h((e, n) => e <= n, "comparisonFunc"), s = 1 / 0) : (a = /* @__PURE__ */ h((e, n) => e >= n, "comparisonFunc"), s = 0), t.forEach((e) => {
372
- var c, o;
373
- const n = u === "TB" || u == "BT" ? (c = E.get(e)) == null ? void 0 : c.y : (o = E.get(e)) == null ? void 0 : o.x;
374
- n !== void 0 && a(n, s) && (r = e, s = n);
375
- }), r;
376
- }, "findClosestParent"), jr = /* @__PURE__ */ h((t) => {
377
- let r = "", a = 1 / 0;
378
- return t.forEach((s) => {
379
- const e = E.get(s).y;
380
- e <= a && (r = s, a = e);
381
- }), r || void 0;
382
- }, "findClosestParentBT"), Ar = /* @__PURE__ */ h((t, r, a) => {
383
- let s = a, e = a;
384
- const n = [];
385
- t.forEach((c) => {
386
- const o = r.get(c);
387
- if (!o)
388
- throw new Error(`Commit not found for key ${c}`);
389
- o.parents.length ? (s = Dr(o), e = Math.max(s, e)) : n.push(o), Kr(o, s);
390
- }), s = e, n.forEach((c) => {
391
- Nr(c, s, a);
392
- }), t.forEach((c) => {
393
- const o = r.get(c);
394
- if (o != null && o.parents.length) {
395
- const $ = jr(o.parents);
396
- s = E.get($).y - I, s <= e && (e = s);
397
- const l = C.get(o.branch).pos, f = s - R;
398
- E.set(o.id, { x: l, y: f });
399
- }
400
- });
401
- }, "setParallelBTPos"), Yr = /* @__PURE__ */ h((t) => {
402
- var s;
403
- const r = Q(t.parents.filter((e) => e !== null));
404
- if (!r)
405
- throw new Error(`Closest parent not found for commit ${t.id}`);
406
- const a = (s = E.get(r)) == null ? void 0 : s.y;
407
- if (a === void 0)
408
- throw new Error(`Closest parent position not found for commit ${t.id}`);
409
- return a;
410
- }, "findClosestParentPos"), Dr = /* @__PURE__ */ h((t) => Yr(t) + I, "calculateCommitPosition"), Kr = /* @__PURE__ */ h((t, r) => {
411
- const a = C.get(t.branch);
412
- if (!a)
413
- throw new Error(`Branch not found for commit ${t.id}`);
414
- const s = a.pos, e = r + R;
415
- return E.set(t.id, { x: s, y: e }), { x: s, y: e };
416
- }, "setCommitPosition"), Nr = /* @__PURE__ */ h((t, r, a) => {
417
- const s = C.get(t.branch);
418
- if (!s)
419
- throw new Error(`Branch not found for commit ${t.id}`);
420
- const e = r + a, n = s.pos;
421
- E.set(t.id, { x: n, y: e });
422
- }, "setRootPosition"), _r = /* @__PURE__ */ h((t, r, a, s, e, n) => {
423
- if (n === x.HIGHLIGHT)
424
- t.append("rect").attr("x", a.x - 10).attr("y", a.y - 10).attr("width", 20).attr("height", 20).attr(
425
- "class",
426
- `commit ${r.id} commit-highlight${e % O} ${s}-outer`
427
- ), t.append("rect").attr("x", a.x - 6).attr("y", a.y - 6).attr("width", 12).attr("height", 12).attr(
428
- "class",
429
- `commit ${r.id} commit${e % O} ${s}-inner`
430
- );
431
- else if (n === x.CHERRY_PICK)
432
- t.append("circle").attr("cx", a.x).attr("cy", a.y).attr("r", 10).attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x - 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x + 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x + 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x - 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`);
433
- else {
434
- const c = t.append("circle");
435
- if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type === x.MERGE ? 9 : 10), c.attr("class", `commit ${r.id} commit${e % O}`), n === x.MERGE) {
436
- const o = t.append("circle");
437
- o.attr("cx", a.x), o.attr("cy", a.y), o.attr("r", 6), o.attr(
438
- "class",
439
- `commit ${s} ${r.id} commit${e % O}`
440
- );
441
- }
442
- n === x.REVERSE && t.append("path").attr(
443
- "d",
444
- `M ${a.x - 5},${a.y - 5}L${a.x + 5},${a.y + 5}M${a.x - 5},${a.y + 5}L${a.x + 5},${a.y - 5}`
445
- ).attr("class", `commit ${s} ${r.id} commit${e % O}`);
446
- }
447
- }, "drawCommitBullet"), Vr = /* @__PURE__ */ h((t, r, a, s) => {
448
- var e;
449
- if (r.type !== x.CHERRY_PICK && (r.customId && r.type === x.MERGE || r.type !== x.MERGE) && (b != null && b.showCommitLabel)) {
450
- const n = t.append("g"), c = n.insert("rect").attr("class", "commit-label-bkg"), o = n.append("text").attr("x", s).attr("y", a.y + 25).attr("class", "commit-label").text(r.id), $ = (e = o.node()) == null ? void 0 : e.getBBox();
451
- if ($ && (c.attr("x", a.posWithOffset - $.width / 2 - L).attr("y", a.y + 13.5).attr("width", $.width + 2 * L).attr("height", $.height + 2 * L), u === "TB" || u === "BT" ? (c.attr("x", a.x - ($.width + 4 * k + 5)).attr("y", a.y - 12), o.attr("x", a.x - ($.width + 4 * k)).attr("y", a.y + $.height - 12)) : o.attr("x", a.posWithOffset - $.width / 2), b.rotateCommitLabel))
452
- if (u === "TB" || u === "BT")
453
- o.attr(
454
- "transform",
455
- "rotate(-45, " + a.x + ", " + a.y + ")"
456
- ), c.attr(
457
- "transform",
458
- "rotate(-45, " + a.x + ", " + a.y + ")"
459
- );
460
- else {
461
- const l = -7.5 - ($.width + 10) / 25 * 9.5, f = 10 + $.width / 25 * 8.5;
462
- n.attr(
463
- "transform",
464
- "translate(" + l + ", " + f + ") rotate(-45, " + s + ", " + a.y + ")"
465
- );
466
- }
467
- }
468
- }, "drawCommitLabel"), Xr = /* @__PURE__ */ h((t, r, a, s) => {
469
- var e;
470
- if (r.tags.length > 0) {
471
- let n = 0, c = 0, o = 0;
472
- const $ = [];
473
- for (const l of r.tags.reverse()) {
474
- const f = t.insert("polygon"), g = t.append("circle"), d = t.append("text").attr("y", a.y - 16 - n).attr("class", "tag-label").text(l), y = (e = d.node()) == null ? void 0 : e.getBBox();
475
- if (!y)
476
- throw new Error("Tag bbox not found");
477
- c = Math.max(c, y.width), o = Math.max(o, y.height), d.attr("x", a.posWithOffset - y.width / 2), $.push({
478
- tag: d,
479
- hole: g,
480
- rect: f,
481
- yOffset: n
482
- }), n += 20;
483
- }
484
- for (const { tag: l, hole: f, rect: g, yOffset: d } of $) {
485
- const y = o / 2, p = a.y - 19.2 - d;
486
- if (g.attr("class", "tag-label-bkg").attr(
487
- "points",
488
- `
489
- ${s - c / 2 - k / 2},${p + L}
490
- ${s - c / 2 - k / 2},${p - L}
491
- ${a.posWithOffset - c / 2 - k},${p - y - L}
492
- ${a.posWithOffset + c / 2 + k},${p - y - L}
493
- ${a.posWithOffset + c / 2 + k},${p + y + L}
494
- ${a.posWithOffset - c / 2 - k},${p + y + L}`
495
- ), f.attr("cy", p).attr("cx", s - c / 2 + k / 2).attr("r", 1.5).attr("class", "tag-hole"), u === "TB" || u === "BT") {
496
- const m = s + d;
497
- g.attr("class", "tag-label-bkg").attr(
498
- "points",
499
- `
500
- ${a.x},${m + 2}
501
- ${a.x},${m - 2}
502
- ${a.x + R},${m - y - 2}
503
- ${a.x + R + c + 4},${m - y - 2}
504
- ${a.x + R + c + 4},${m + y + 2}
505
- ${a.x + R},${m + y + 2}`
506
- ).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), f.attr("cx", a.x + k / 2).attr("cy", m).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), l.attr("x", a.x + 5).attr("y", m + 3).attr("transform", "translate(14,14) rotate(45, " + a.x + "," + s + ")");
507
- }
508
- }
509
- }
510
- }, "drawCommitTags"), Jr = /* @__PURE__ */ h((t) => {
511
- switch (t.customType ?? t.type) {
512
- case x.NORMAL:
513
- return "commit-normal";
514
- case x.REVERSE:
515
- return "commit-reverse";
516
- case x.HIGHLIGHT:
517
- return "commit-highlight";
518
- case x.MERGE:
519
- return "commit-merge";
520
- case x.CHERRY_PICK:
521
- return "commit-cherry-pick";
522
- default:
523
- return "commit-normal";
524
- }
525
- }, "getCommitClassType"), Qr = /* @__PURE__ */ h((t, r, a, s) => {
526
- const e = { x: 0, y: 0 };
527
- if (t.parents.length > 0) {
528
- const n = Q(t.parents);
529
- if (n) {
530
- const c = s.get(n) ?? e;
531
- return r === "TB" ? c.y + I : r === "BT" ? (s.get(t.id) ?? e).y - I : c.x + I;
532
- }
533
- } else
534
- return r === "TB" ? P : r === "BT" ? (s.get(t.id) ?? e).y - I : 0;
535
- return 0;
536
- }, "calculatePosition"), Zr = /* @__PURE__ */ h((t, r, a) => {
537
- var c, o;
538
- const s = u === "BT" && a ? r : r + R, e = u === "TB" || u === "BT" ? s : (c = C.get(t.branch)) == null ? void 0 : c.pos, n = u === "TB" || u === "BT" ? (o = C.get(t.branch)) == null ? void 0 : o.pos : s;
539
- if (n === void 0 || e === void 0)
540
- throw new Error(`Position were undefined for commit ${t.id}`);
541
- return { x: n, y: e, posWithOffset: s };
542
- }, "getCommitPosition"), K = /* @__PURE__ */ h((t, r, a) => {
543
- if (!b)
544
- throw new Error("GitGraph config not found");
545
- const s = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
546
- let n = u === "TB" || u === "BT" ? P : 0;
547
- const c = [...r.keys()], o = (b == null ? void 0 : b.parallelCommits) ?? !1, $ = /* @__PURE__ */ h((f, g) => {
548
- var p, m;
549
- const d = (p = r.get(f)) == null ? void 0 : p.seq, y = (m = r.get(g)) == null ? void 0 : m.seq;
550
- return d !== void 0 && y !== void 0 ? d - y : 0;
551
- }, "sortKeys");
552
- let l = c.sort($);
553
- u === "BT" && (o && Ar(l, r, n), l = l.reverse()), l.forEach((f) => {
554
- var y;
555
- const g = r.get(f);
556
- if (!g)
557
- throw new Error(`Commit not found for key ${f}`);
558
- o && (n = Qr(g, u, n, E));
559
- const d = Zr(g, n, o);
560
- if (a) {
561
- const p = Jr(g), m = g.customType ?? g.type, q = ((y = C.get(g.branch)) == null ? void 0 : y.index) ?? 0;
562
- _r(s, g, d, p, q, m), Vr(e, g, d, n), Xr(e, g, d, n);
563
- }
564
- u === "TB" || u === "BT" ? E.set(g.id, { x: d.x, y: d.posWithOffset }) : E.set(g.id, { x: d.posWithOffset, y: d.y }), n = u === "BT" && o ? n + I : n + I + R, n > M && (M = n);
565
- });
566
- }, "drawCommits"), Fr = /* @__PURE__ */ h((t, r, a, s, e) => {
567
- const c = (u === "TB" || u === "BT" ? a.x < s.x : a.y < s.y) ? r.branch : t.branch, o = /* @__PURE__ */ h((l) => l.branch === c, "isOnBranchToGetCurve"), $ = /* @__PURE__ */ h((l) => l.seq > t.seq && l.seq < r.seq, "isBetweenCommits");
568
- return [...e.values()].some((l) => $(l) && o(l));
569
- }, "shouldRerouteArrow"), H = /* @__PURE__ */ h((t, r, a = 0) => {
570
- const s = t + Math.abs(t - r) / 2;
571
- if (a > 5)
572
- return s;
573
- if (W.every((c) => Math.abs(c - s) >= 10))
574
- return W.push(s), s;
575
- const n = Math.abs(t - r);
576
- return H(t, r - n / 5, a + 1);
577
- }, "findLane"), Ur = /* @__PURE__ */ h((t, r, a, s) => {
578
- var y, p, m, q, D;
579
- const e = E.get(r.id), n = E.get(a.id);
580
- if (e === void 0 || n === void 0)
581
- throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);
582
- const c = Fr(r, a, e, n, s);
583
- let o = "", $ = "", l = 0, f = 0, g = (y = C.get(a.branch)) == null ? void 0 : y.index;
584
- a.type === x.MERGE && r.id !== a.parents[0] && (g = (p = C.get(r.branch)) == null ? void 0 : p.index);
585
- let d;
586
- if (c) {
587
- o = "A 10 10, 0, 0, 0,", $ = "A 10 10, 0, 0, 1,", l = 10, f = 10;
588
- const T = e.y < n.y ? H(e.y, n.y) : H(n.y, e.y), v = e.x < n.x ? H(e.x, n.x) : H(n.x, e.x);
589
- u === "TB" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${$} ${v} ${e.y + f} L ${v} ${n.y - l} ${o} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (m = C.get(r.branch)) == null ? void 0 : m.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${o} ${v} ${e.y + f} L ${v} ${n.y - l} ${$} ${v - f} ${n.y} L ${n.x} ${n.y}`) : u === "BT" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${o} ${v} ${e.y - f} L ${v} ${n.y + l} ${$} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (q = C.get(r.branch)) == null ? void 0 : q.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${$} ${v} ${e.y - f} L ${v} ${n.y + l} ${o} ${v - f} ${n.y} L ${n.x} ${n.y}`) : e.y < n.y ? d = `M ${e.x} ${e.y} L ${e.x} ${T - l} ${o} ${e.x + f} ${T} L ${n.x - l} ${T} ${$} ${n.x} ${T + f} L ${n.x} ${n.y}` : (g = (D = C.get(r.branch)) == null ? void 0 : D.index, d = `M ${e.x} ${e.y} L ${e.x} ${T + l} ${$} ${e.x + f} ${T} L ${n.x - l} ${T} ${o} ${n.x} ${T - f} L ${n.x} ${n.y}`);
590
- } else
591
- o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, u === "TB" ? (e.x < n.x && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${$} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x + l} ${e.y} ${o} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : u === "BT" ? (e.x < n.x && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${o} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : (e.y < n.y && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y > n.y && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y === n.y && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`));
592
- if (d === void 0)
593
- throw new Error("Line definition not found");
594
- t.append("path").attr("d", d).attr("class", "arrow arrow" + g % O);
595
- }, "drawArrow"), re = /* @__PURE__ */ h((t, r) => {
596
- const a = t.append("g").attr("class", "commit-arrows");
597
- [...r.keys()].forEach((s) => {
598
- const e = r.get(s);
599
- e.parents && e.parents.length > 0 && e.parents.forEach((n) => {
600
- Ur(a, r.get(n), e, r);
601
- });
602
- });
603
- }, "drawArrows"), ee = /* @__PURE__ */ h((t, r) => {
604
- const a = t.append("g");
605
- r.forEach((s, e) => {
606
- var p;
607
- const n = e % O, c = (p = C.get(s.name)) == null ? void 0 : p.pos;
608
- if (c === void 0)
609
- throw new Error(`Position not found for branch ${s.name}`);
610
- const o = a.append("line");
611
- o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n), u === "TB" ? (o.attr("y1", P), o.attr("x1", c), o.attr("y2", M), o.attr("x2", c)) : u === "BT" && (o.attr("y1", M), o.attr("x1", c), o.attr("y2", P), o.attr("x2", c)), W.push(c);
612
- const $ = s.name, l = J($), f = a.insert("rect"), d = a.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + n);
613
- d.node().appendChild(l);
614
- const y = l.getBBox();
615
- f.attr("class", "branchLabelBkg label" + n).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), d.attr(
616
- "transform",
617
- "translate(" + (-y.width - 14 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (c - y.height / 2 - 1) + ")"
618
- ), u === "TB" ? (f.attr("x", c - y.width / 2 - 10).attr("y", 0), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", 0)")) : u === "BT" ? (f.attr("x", c - y.width / 2 - 10).attr("y", M), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", " + M + ")")) : f.attr("transform", "translate(-19, " + (c - y.height / 2) + ")");
619
- });
620
- }, "drawBranches"), te = /* @__PURE__ */ h(function(t, r, a, s, e) {
621
- return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (u === "TB" || u === "BT" ? s.width / 2 : 0), r;
622
- }, "setBranchPosition"), ae = /* @__PURE__ */ h(function(t, r, a, s) {
623
- if (Sr(), w.debug("in gitgraph renderer", t + `
624
- `, "id:", r, a), !b)
625
- throw new Error("GitGraph config not found");
626
- const e = b.rotateCommitLabel ?? !1, n = s.db;
627
- G = n.getCommits();
628
- const c = n.getBranchesAsObjArray();
629
- u = n.getDirection();
630
- const o = or(`[id="${r}"]`);
631
- let $ = 0;
632
- c.forEach((l, f) => {
633
- var q;
634
- const g = J(l.name), d = o.append("g"), y = d.insert("g").attr("class", "branchLabel"), p = y.insert("g").attr("class", "label branch-label");
635
- (q = p.node()) == null || q.appendChild(g);
636
- const m = g.getBBox();
637
- $ = te(l.name, $, f, m, e), p.remove(), y.remove(), d.remove();
638
- }), K(o, G, !1), b.showBranches && ee(o, c), re(o, G), K(o, G, !0), cr.insertTitle(
639
- o,
640
- "gitTitleText",
641
- b.titleTopMargin ?? 0,
642
- n.getDiagramTitle()
643
- ), ir(
644
- void 0,
645
- o,
646
- b.diagramPadding,
647
- b.useMaxWidth
648
- );
649
- }, "draw"), ne = {
650
- draw: ae
651
- }, se = /* @__PURE__ */ h((t) => `
652
- .commit-id,
653
- .commit-msg,
654
- .branch-label {
655
- fill: lightgrey;
656
- color: lightgrey;
657
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
658
- font-family: var(--mermaid-font-family);
659
- }
660
- ${[0, 1, 2, 3, 4, 5, 6, 7].map(
661
- (r) => `
662
- .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; }
663
- .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; }
664
- .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; }
665
- .label${r} { fill: ${t["git" + r]}; }
666
- .arrow${r} { stroke: ${t["git" + r]}; }
667
- `
668
- ).join(`
669
- `)}
670
-
671
- .branch {
672
- stroke-width: 1;
673
- stroke: ${t.lineColor};
674
- stroke-dasharray: 2;
675
- }
676
- .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
677
- .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
678
- .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
679
- .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
680
- .tag-hole { fill: ${t.textColor}; }
681
-
682
- .commit-merge {
683
- stroke: ${t.primaryColor};
684
- fill: ${t.primaryColor};
685
- }
686
- .commit-reverse {
687
- stroke: ${t.primaryColor};
688
- fill: ${t.primaryColor};
689
- stroke-width: 3;
690
- }
691
- .commit-highlight-outer {
692
- }
693
- .commit-highlight-inner {
694
- stroke: ${t.primaryColor};
695
- fill: ${t.primaryColor};
696
- }
697
-
698
- .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
699
- .gitTitleText {
700
- text-anchor: middle;
701
- font-size: 18px;
702
- fill: ${t.textColor};
703
- }
704
- `, "getStyles"), oe = se, le = {
705
- parser: Wr,
706
- db: X,
707
- renderer: ne,
708
- styles: oe
709
- };
710
- export {
711
- le as diagram
712
- };