@peasant-labs/fairtrade 0.0.51 → 0.0.53

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 (118) hide show
  1. package/dist/lib/base.css +1 -1
  2. package/dist/lib/commons.js +544 -522
  3. package/dist/lib/components.css +1 -1
  4. package/dist/lib/share.js +2 -2
  5. package/dist/lib/tokens.css +2 -2
  6. package/dist/lib/tokens.json +2 -2
  7. package/dist/lib/types/AppSidebar.d.ts +9 -11
  8. package/dist/lib/types/Avatar.d.ts +2 -2
  9. package/dist/lib/types/Breadcrumb.d.ts +12 -5
  10. package/dist/lib/types/Dialog.d.ts +1 -1
  11. package/dist/lib/types/Input.d.ts +3 -3
  12. package/dist/lib/types/OverflowList.d.ts +1 -1
  13. package/dist/lib/types/RepoPicker.d.ts +3 -1
  14. package/dist/lib/types/Switch.d.ts +3 -3
  15. package/dist/lib/types/commons/Explore.d.ts +1 -1
  16. package/dist/lib/types/commons/types.d.ts +12 -0
  17. package/dist/lib/{ui-Do7A_I-0.js → ui-suNzomre.js} +1682 -1623
  18. package/dist/lib/ui.js +1 -1
  19. package/package.json +1 -1
  20. package/dist/lib/abnfDiagram-WEYOIA3C-D4LMNFIJ.js +0 -89
  21. package/dist/lib/arc-1xTxsoRi.js +0 -80
  22. package/dist/lib/architecture-WOLXFQ4H-c6RsZuzu.js +0 -3
  23. package/dist/lib/architectureDiagram-ZHVYKT53-DTINqD5R.js +0 -4145
  24. package/dist/lib/array-CApNbSU9.js +0 -6
  25. package/dist/lib/blockDiagram-RJAE7QA3-CUYHoR3g.js +0 -1946
  26. package/dist/lib/c4Diagram-XDPPPE54-Cdx6_DsI.js +0 -2990
  27. package/dist/lib/channel-DagAO2vE.js +0 -5
  28. package/dist/lib/chunk-2E7WHVMD-BzhgXW3b.js +0 -490
  29. package/dist/lib/chunk-2Q5K7J3B-DWNwIK5Y.js +0 -15
  30. package/dist/lib/chunk-4EMNKR2T-DhFrQz9k.js +0 -236
  31. package/dist/lib/chunk-55XCU76K-CI0GXDkJ.js +0 -61
  32. package/dist/lib/chunk-5VM5RSS4-BAQ-46g4.js +0 -5
  33. package/dist/lib/chunk-7S6XSTFO-CMt_p-O6.js +0 -1373
  34. package/dist/lib/chunk-AQDTSKZB-DrZccIQa.js +0 -1847
  35. package/dist/lib/chunk-DSNLSHJZ-CpA9d2CJ.js +0 -4044
  36. package/dist/lib/chunk-DUW6YSOI-C-tN4Kiv.js +0 -10
  37. package/dist/lib/chunk-EJLWFMJV-B30MNYvY.js +0 -75
  38. package/dist/lib/chunk-HAGFOTED-DMU2JNZM.js +0 -4487
  39. package/dist/lib/chunk-HNE4Q36P-BIA0n2gA.js +0 -363
  40. package/dist/lib/chunk-J5ZVWO5B-CA_-jk8G.js +0 -12
  41. package/dist/lib/chunk-JWPE2WC7-KRpHbrIX.js +0 -8
  42. package/dist/lib/chunk-LNGE3PJU-CMGaAEAh.js +0 -1513
  43. package/dist/lib/chunk-NGNAAXSQ-D7Dvct7J.js +0 -19774
  44. package/dist/lib/chunk-NQOKRVIF-MK9F46y3.js +0 -4258
  45. package/dist/lib/chunk-OYAV6JZA-B1yICcbU.js +0 -10
  46. package/dist/lib/chunk-UHW7PFBP-CLrOaA0y.js +0 -67
  47. package/dist/lib/chunk-VQ5W62QI-_ZR3gKe4.js +0 -26
  48. package/dist/lib/chunk-WQQL4CDK-DFtyhYZq.js +0 -693
  49. package/dist/lib/chunk-XXDRQBXY-uzyNBbgx.js +0 -9
  50. package/dist/lib/chunk-Y2CYZVJY-BYzrzvCI.js +0 -12
  51. package/dist/lib/chunk-YZO67HFG-D1jKt78p.js +0 -275
  52. package/dist/lib/chunk-ZAUX2LTX-7XO0Yj1z.js +0 -37
  53. package/dist/lib/chunk-ZCHMQSOR-CxoKltfF.js +0 -349
  54. package/dist/lib/classDiagram-v2-4MYWR3UA-BPvwhZqw.js +0 -3397
  55. package/dist/lib/cose-bilkent-JH36ORCC-Oj79uOIQ.js +0 -2250
  56. package/dist/lib/cynefin-EF2NZ3EQ-COX3NRum.js +0 -3
  57. package/dist/lib/cynefinDiagram-WF24UDRP-UzTptNAX.js +0 -349
  58. package/dist/lib/cytoscape.esm-0ojxgO9x.js +0 -18161
  59. package/dist/lib/dagre-NK4GIZVX-DWZr-NGm.js +0 -2356
  60. package/dist/lib/defaultLocale-BbgDuMnp.js +0 -201
  61. package/dist/lib/diagram-CBK3MWTC-CsyKuv-w.js +0 -525
  62. package/dist/lib/diagram-I5XIIV2D-DWY2JSPC.js +0 -134
  63. package/dist/lib/diagram-ODIL2UCW-DUptj0JZ.js +0 -301
  64. package/dist/lib/diagram-PFBEJUXE-N5XnIBqM.js +0 -447
  65. package/dist/lib/diagram-RJA3I4VV-B9XgohYo.js +0 -214
  66. package/dist/lib/diagram-TYUNFSNR-XnsJIeAd.js +0 -5084
  67. package/dist/lib/dist-AMlsjiDX.js +0 -59
  68. package/dist/lib/ebnfDiagram-V4P3TTPT-BssHqFox.js +0 -100
  69. package/dist/lib/elk-QONTBCTQ-DwmwqYgP.js +0 -47944
  70. package/dist/lib/erDiagram-KYQIGQAA-BQiXw1Tw.js +0 -1970
  71. package/dist/lib/eventmodeling-K75KTNOO-DDb--yMc.js +0 -3
  72. package/dist/lib/flowDiagram-IUGLLWBU-BEqqF1y2.js +0 -17
  73. package/dist/lib/ganttDiagram-R7GPNTJY-BWtGXxEF.js +0 -3094
  74. package/dist/lib/gitGraph-VSP46ZUC-BSwOaak_.js +0 -3
  75. package/dist/lib/gitGraphDiagram-PDYL7XHY-CHGNuGbk.js +0 -729
  76. package/dist/lib/graphlib-Dndp26xU.js +0 -1267
  77. package/dist/lib/info-OHQRW6UA-Dk06sZRe.js +0 -3
  78. package/dist/lib/infoDiagram-MVDRKAX5-Cdhxnjmi.js +0 -20
  79. package/dist/lib/init-Bwwdo3M6.js +0 -15
  80. package/dist/lib/ishikawaDiagram-HPEHV2GE-Dzhti-GJ.js +0 -719
  81. package/dist/lib/journeyDiagram-BOSHW7O7-C3_vsSjw.js +0 -884
  82. package/dist/lib/kanban-definition-FNSA4HC5-XsfCEsjn.js +0 -976
  83. package/dist/lib/katex-Dw0PnoPU.js +0 -21850
  84. package/dist/lib/line-C9krU3Sv.js +0 -34
  85. package/dist/lib/linear-Cvilv3OA.js +0 -289
  86. package/dist/lib/mermaid-parser.core-I7qQ_fxz.js +0 -638
  87. package/dist/lib/mermaid.core-UNHMAbBP.js +0 -1126
  88. package/dist/lib/mindmap-definition-6OY57UG3-CAua-JvB.js +0 -1011
  89. package/dist/lib/ordinal-C55HfHHp.js +0 -65
  90. package/dist/lib/packet-JDAUHWVQ-DZ-MKx4I.js +0 -3
  91. package/dist/lib/path-DNvJyUE8.js +0 -85
  92. package/dist/lib/pegDiagram-ECIUJNBX-BCxa_IO0.js +0 -94
  93. package/dist/lib/pie-XZMESJXO-DpCa-Nnq.js +0 -3
  94. package/dist/lib/pieDiagram-GNMPY74T-CE_C3dCB.js +0 -205
  95. package/dist/lib/quadrantDiagram-D57K4MC3-CDgzdMoL.js +0 -2001
  96. package/dist/lib/radar-ABXABTNO-BOVK7L9p.js +0 -3
  97. package/dist/lib/railroad-I3PHUGI6-B6spKM0Z.js +0 -3
  98. package/dist/lib/railroad-abnf-LNEFI6M7-DEWqfByZ.js +0 -3
  99. package/dist/lib/railroad-ebnf-DWYD2UWJ-CWRLtxHB.js +0 -3
  100. package/dist/lib/railroad-peg-JR7BVNR7-C-3NHSsk.js +0 -3
  101. package/dist/lib/railroadDiagram-Y72NRBL7-a8YVk8LT.js +0 -76
  102. package/dist/lib/requirementDiagram-EQYSW5RA-B9HolqxU.js +0 -2228
  103. package/dist/lib/rough.esm-a8mysczE.js +0 -1352
  104. package/dist/lib/sankeyDiagram-SY24JHO5-CLFMtMJG.js +0 -970
  105. package/dist/lib/sequenceDiagram-BLEHNHQU-B5wfSV85.js +0 -4253
  106. package/dist/lib/sizeCapture-INFHLROL-BWGCc9aa.js +0 -46
  107. package/dist/lib/src-Dcy0zUZH.js +0 -2153
  108. package/dist/lib/stateDiagram-v2-A6IESKWZ-C92vye4N.js +0 -2143
  109. package/dist/lib/swimlanes-B3ENRKFQ-B6-i-tPc.js +0 -4764
  110. package/dist/lib/swimlanesDiagram-AYQRV4AK-CbkBeql-.js +0 -28
  111. package/dist/lib/timeline-definition-JXYKGLGB-D2Ip4r72.js +0 -1073
  112. package/dist/lib/treeView-D4JQ5SDB-CFaKQ_2T.js +0 -3
  113. package/dist/lib/treemap-SAJKECNS-BQ6z7Z3g.js +0 -3
  114. package/dist/lib/usecaseDiagram-WPOLBNNX-BK1Anch1.js +0 -7190
  115. package/dist/lib/vennDiagram-Q3Y3IDCW-B6YTBqTS.js +0 -1880
  116. package/dist/lib/wardley-7MLQ67FV-DChYwu4i.js +0 -3
  117. package/dist/lib/wardleyDiagram-IVAIDKWA-D5I1qLUK.js +0 -645
  118. package/dist/lib/xychartDiagram-4URNHDU4-B6RXyhTO.js +0 -2218
@@ -1,729 +0,0 @@
1
- import { m as e, p as t } from "./src-Dcy0zUZH.js";
2
- import { n } from "./mermaid-parser.core-I7qQ_fxz.js";
3
- import { n as r } from "./chunk-Y2CYZVJY-BYzrzvCI.js";
4
- import { C as i, H as a, U as o, X as s, _ as c, a as l, b as u, f as d, q as f, s as p, v as m, y as h } from "./chunk-DSNLSHJZ-CpA9d2CJ.js";
5
- import { _ as g, h as _, i as v } from "./chunk-7S6XSTFO-CMt_p-O6.js";
6
- import { t as y } from "./chunk-JWPE2WC7-KRpHbrIX.js";
7
- import { t as b } from "./chunk-2Q5K7J3B-DWNwIK5Y.js";
8
- //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PDYL7XHY.mjs
9
- var x = {
10
- NORMAL: 0,
11
- REVERSE: 1,
12
- HIGHLIGHT: 2,
13
- MERGE: 3,
14
- CHERRY_PICK: 4
15
- }, ee = d.gitGraph, S = /* @__PURE__ */ r(() => v({
16
- ...ee,
17
- ...h().gitGraph
18
- }), "getConfig"), C = new b(() => {
19
- let e = S(), t = e.mainBranchName, n = e.mainBranchOrder;
20
- return {
21
- mainBranchName: t,
22
- commits: /* @__PURE__ */ new Map(),
23
- head: null,
24
- branchConfig: /* @__PURE__ */ new Map([[t, {
25
- name: t,
26
- order: n
27
- }]]),
28
- branches: /* @__PURE__ */ new Map([[t, null]]),
29
- currBranch: t,
30
- direction: "LR",
31
- seq: 0,
32
- options: {}
33
- };
34
- });
35
- function w() {
36
- return _({ length: 7 });
37
- }
38
- r(w, "getID");
39
- function T(e, t) {
40
- let n = /* @__PURE__ */ Object.create(null);
41
- return e.reduce((e, r) => {
42
- let i = t(r);
43
- return n[i] || (n[i] = !0, e.push(r)), e;
44
- }, []);
45
- }
46
- r(T, "uniqBy");
47
- var te = /* @__PURE__ */ r(function(e) {
48
- C.records.direction = e;
49
- }, "setDirection"), ne = /* @__PURE__ */ r(function(t) {
50
- e.debug("options str", t), t = t?.trim(), t ||= "{}";
51
- try {
52
- C.records.options = JSON.parse(t);
53
- } catch (t) {
54
- e.error("error while parsing gitGraph options", t.message);
55
- }
56
- }, "setOptions"), re = /* @__PURE__ */ r(function() {
57
- return C.records.options;
58
- }, "getOptions"), ie = /* @__PURE__ */ r(function(t) {
59
- let n = t.msg, r = t.id, i = t.type, a = t.tags;
60
- e.info("commit", n, r, i, a), e.debug("Entering commit:", n, r, i, a);
61
- let o = S();
62
- r = p.sanitizeText(r, o), n = p.sanitizeText(n, o), a = a?.map((e) => p.sanitizeText(e, o));
63
- let s = {
64
- id: r || C.records.seq + "-" + w(),
65
- message: n,
66
- seq: C.records.seq++,
67
- type: i ?? x.NORMAL,
68
- tags: a ?? [],
69
- parents: C.records.head == null ? [] : [C.records.head.id],
70
- branch: C.records.currBranch
71
- };
72
- C.records.head = s, e.info("main branch", o.mainBranchName), C.records.commits.has(s.id) && e.warn(`Commit ID ${s.id} already exists`), C.records.commits.set(s.id, s), C.records.branches.set(C.records.currBranch, s.id), e.debug("in pushCommit " + s.id);
73
- }, "commit"), ae = /* @__PURE__ */ r(function(t) {
74
- let n = t.name, r = t.order;
75
- if (n = p.sanitizeText(n, S()), C.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}")`);
76
- C.records.branches.set(n, C.records.head == null ? null : C.records.head.id), C.records.branchConfig.set(n, {
77
- name: n,
78
- order: r
79
- }), E(n), e.debug("in createBranch");
80
- }, "branch"), oe = /* @__PURE__ */ r((t) => {
81
- let n = t.branch, r = t.id, i = t.type, a = t.tags, o = S();
82
- n = p.sanitizeText(n, o), r &&= p.sanitizeText(r, o);
83
- let s = C.records.branches.get(C.records.currBranch), c = C.records.branches.get(n), l = s ? C.records.commits.get(s) : void 0, u = c ? C.records.commits.get(c) : void 0;
84
- if (l && u && l.branch === n) throw Error(`Cannot merge branch '${n}' into itself.`);
85
- if (C.records.currBranch === n) {
86
- let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Cannot merge a branch to itself");
87
- throw e.hash = {
88
- text: `merge ${n}`,
89
- token: `merge ${n}`,
90
- expected: ["branch abc"]
91
- }, e;
92
- }
93
- if (l === void 0 || !l) {
94
- let e = /* @__PURE__ */ Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);
95
- throw e.hash = {
96
- text: `merge ${n}`,
97
- token: `merge ${n}`,
98
- expected: ["commit"]
99
- }, e;
100
- }
101
- if (!C.records.branches.has(n)) {
102
- let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") does not exist");
103
- throw e.hash = {
104
- text: `merge ${n}`,
105
- token: `merge ${n}`,
106
- expected: [`branch ${n}`]
107
- }, e;
108
- }
109
- if (u === void 0 || !u) {
110
- let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Branch to be merged (" + n + ") has no commits");
111
- throw e.hash = {
112
- text: `merge ${n}`,
113
- token: `merge ${n}`,
114
- expected: ["\"commit\""]
115
- }, e;
116
- }
117
- if (l === u) {
118
- let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Both branches have same head");
119
- throw e.hash = {
120
- text: `merge ${n}`,
121
- token: `merge ${n}`,
122
- expected: ["branch abc"]
123
- }, e;
124
- }
125
- if (r && C.records.commits.has(r)) {
126
- let e = /* @__PURE__ */ Error("Incorrect usage of \"merge\". Commit with id:" + r + " already exists, use different custom id");
127
- throw e.hash = {
128
- text: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
129
- token: `merge ${n} ${r} ${i} ${a?.join(" ")}`,
130
- expected: [`merge ${n} ${r}_UNIQUE ${i} ${a?.join(" ")}`]
131
- }, e;
132
- }
133
- let d = c || "", f = {
134
- id: r || `${C.records.seq}-${w()}`,
135
- message: `merged branch ${n} into ${C.records.currBranch}`,
136
- seq: C.records.seq++,
137
- parents: C.records.head == null ? [] : [C.records.head.id, d],
138
- branch: C.records.currBranch,
139
- type: x.MERGE,
140
- customType: i,
141
- customId: !!r,
142
- tags: a ?? []
143
- };
144
- C.records.head = f, C.records.commits.set(f.id, f), C.records.branches.set(C.records.currBranch, f.id), e.debug(C.records.branches), e.debug("in mergeBranch");
145
- }, "merge"), se = /* @__PURE__ */ r(function(t) {
146
- let n = t.id, r = t.targetId, i = t.tags, a = t.parent;
147
- e.debug("Entering cherryPick:", n, r, i);
148
- let o = S();
149
- 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 || !C.records.commits.has(n)) {
150
- let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
151
- throw e.hash = {
152
- text: `cherryPick ${n} ${r}`,
153
- token: `cherryPick ${n} ${r}`,
154
- expected: ["cherry-pick abc"]
155
- }, e;
156
- }
157
- let s = C.records.commits.get(n);
158
- if (s === void 0 || !s) throw Error("Incorrect usage of \"cherryPick\". Source commit id should exist and provided");
159
- 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.");
160
- let c = s.branch;
161
- if (s.type === x.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.");
162
- if (!r || !C.records.commits.has(r)) {
163
- if (c === C.records.currBranch) {
164
- let e = /* @__PURE__ */ Error("Incorrect usage of \"cherryPick\". Source commit is already on current branch");
165
- throw e.hash = {
166
- text: `cherryPick ${n} ${r}`,
167
- token: `cherryPick ${n} ${r}`,
168
- expected: ["cherry-pick abc"]
169
- }, e;
170
- }
171
- let t = C.records.branches.get(C.records.currBranch);
172
- if (t === void 0 || !t) {
173
- let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);
174
- throw e.hash = {
175
- text: `cherryPick ${n} ${r}`,
176
- token: `cherryPick ${n} ${r}`,
177
- expected: ["cherry-pick abc"]
178
- }, e;
179
- }
180
- let o = C.records.commits.get(t);
181
- if (o === void 0 || !o) {
182
- let e = /* @__PURE__ */ Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);
183
- throw e.hash = {
184
- text: `cherryPick ${n} ${r}`,
185
- token: `cherryPick ${n} ${r}`,
186
- expected: ["cherry-pick abc"]
187
- }, e;
188
- }
189
- let l = {
190
- id: C.records.seq + "-" + w(),
191
- message: `cherry-picked ${s?.message} into ${C.records.currBranch}`,
192
- seq: C.records.seq++,
193
- parents: C.records.head == null ? [] : [C.records.head.id, s.id],
194
- branch: C.records.currBranch,
195
- type: x.CHERRY_PICK,
196
- tags: i ? i.filter(Boolean) : [`cherry-pick:${s.id}${s.type === x.MERGE ? `|parent:${a}` : ""}`]
197
- };
198
- C.records.head = l, C.records.commits.set(l.id, l), C.records.branches.set(C.records.currBranch, l.id), e.debug(C.records.branches), e.debug("in cherryPick");
199
- }
200
- }, "cherryPick"), E = /* @__PURE__ */ r(function(e) {
201
- if (e = p.sanitizeText(e, S()), C.records.branches.has(e)) {
202
- C.records.currBranch = e;
203
- let t = C.records.branches.get(C.records.currBranch);
204
- t === void 0 || !t ? C.records.head = null : C.records.head = C.records.commits.get(t) ?? null;
205
- } else {
206
- let t = /* @__PURE__ */ Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);
207
- throw t.hash = {
208
- text: `checkout ${e}`,
209
- token: `checkout ${e}`,
210
- expected: [`branch ${e}`]
211
- }, t;
212
- }
213
- }, "checkout");
214
- function D(e, t, n) {
215
- let r = e.indexOf(t);
216
- r === -1 ? e.push(n) : e.splice(r, 1, n);
217
- }
218
- r(D, "upsert");
219
- function O(t) {
220
- let n = t.reduce((e, t) => e.seq > t.seq ? e : t, t[0]), r = "";
221
- t.forEach(function(e) {
222
- e === n ? r += " *" : r += " |";
223
- });
224
- let i = [
225
- r,
226
- n.id,
227
- n.seq
228
- ];
229
- for (let e in C.records.branches) C.records.branches.get(e) === n.id && i.push(e);
230
- if (e.debug(i.join(" ")), n.parents && n.parents.length == 2 && n.parents[0] && n.parents[1]) {
231
- let e = C.records.commits.get(n.parents[0]);
232
- D(t, n, e), n.parents[1] && t.push(C.records.commits.get(n.parents[1]));
233
- } else if (n.parents.length == 0) return;
234
- else if (n.parents[0]) {
235
- let e = C.records.commits.get(n.parents[0]);
236
- D(t, n, e);
237
- }
238
- t = T(t, (e) => e.id), O(t);
239
- }
240
- r(O, "prettyPrintCommitHistory");
241
- var ce = /* @__PURE__ */ r(function() {
242
- e.debug(C.records.commits);
243
- let t = k()[0];
244
- O([t]);
245
- }, "prettyPrint"), le = /* @__PURE__ */ r(function() {
246
- C.reset(), l();
247
- }, "clear"), ue = /* @__PURE__ */ r(function() {
248
- return [...C.records.branchConfig.values()].map((e, t) => e.order !== null && e.order !== void 0 ? e : {
249
- ...e,
250
- order: parseFloat(`0.${t}`)
251
- }).sort((e, t) => (e.order ?? 0) - (t.order ?? 0)).map(({ name: e }) => ({ name: e }));
252
- }, "getBranchesAsObjArray"), de = /* @__PURE__ */ r(function() {
253
- return C.records.branches;
254
- }, "getBranches"), fe = /* @__PURE__ */ r(function() {
255
- return C.records.commits;
256
- }, "getCommits"), k = /* @__PURE__ */ r(function() {
257
- let t = [...C.records.commits.values()];
258
- return t.forEach(function(t) {
259
- e.debug(t.id);
260
- }), t.sort((e, t) => e.seq - t.seq), t;
261
- }, "getCommitsArray"), A = {
262
- commitType: x,
263
- getConfig: S,
264
- setDirection: te,
265
- setOptions: ne,
266
- getOptions: re,
267
- commit: ie,
268
- branch: ae,
269
- merge: oe,
270
- cherryPick: se,
271
- checkout: E,
272
- prettyPrint: ce,
273
- clear: le,
274
- getBranchesAsObjArray: ue,
275
- getBranches: de,
276
- getCommits: fe,
277
- getCommitsArray: k,
278
- getCurrentBranch: /* @__PURE__ */ r(function() {
279
- return C.records.currBranch;
280
- }, "getCurrentBranch"),
281
- getDirection: /* @__PURE__ */ r(function() {
282
- return C.records.direction;
283
- }, "getDirection"),
284
- getHead: /* @__PURE__ */ r(function() {
285
- return C.records.head;
286
- }, "getHead"),
287
- setAccTitle: o,
288
- getAccTitle: m,
289
- getAccDescription: c,
290
- setAccDescription: a,
291
- setDiagramTitle: f,
292
- getDiagramTitle: i
293
- }, pe = /* @__PURE__ */ r((e, t) => {
294
- y(e, t), e.dir && t.setDirection(e.dir);
295
- for (let n of e.statements) me(n, t);
296
- }, "populate"), me = /* @__PURE__ */ r((t, n) => {
297
- let i = {
298
- Commit: /* @__PURE__ */ r((e) => n.commit(he(e)), "Commit"),
299
- Branch: /* @__PURE__ */ r((e) => n.branch(ge(e)), "Branch"),
300
- Merge: /* @__PURE__ */ r((e) => n.merge(_e(e)), "Merge"),
301
- Checkout: /* @__PURE__ */ r((e) => n.checkout(ve(e)), "Checkout"),
302
- CherryPicking: /* @__PURE__ */ r((e) => n.cherryPick(ye(e)), "CherryPicking")
303
- }[t.$type];
304
- i ? i(t) : e.error(`Unknown statement type: ${t.$type}`);
305
- }, "parseStatement"), he = /* @__PURE__ */ r((e) => ({
306
- id: e.id,
307
- msg: e.message ?? "",
308
- type: e.type === void 0 ? x.NORMAL : x[e.type],
309
- tags: e.tags ?? void 0
310
- }), "parseCommit"), ge = /* @__PURE__ */ r((e) => ({
311
- name: e.name,
312
- order: e.order ?? 0
313
- }), "parseBranch"), _e = /* @__PURE__ */ r((e) => ({
314
- branch: e.branch,
315
- id: e.id ?? "",
316
- type: e.type === void 0 ? void 0 : x[e.type],
317
- tags: e.tags ?? void 0
318
- }), "parseMerge"), ve = /* @__PURE__ */ r((e) => e.branch, "parseCheckout"), ye = /* @__PURE__ */ r((e) => ({
319
- id: e.id,
320
- targetId: "",
321
- tags: e.tags?.length === 0 ? void 0 : e.tags,
322
- parent: e.parent
323
- }), "parseCherryPicking"), be = { parse: /* @__PURE__ */ r(async (t) => {
324
- let r = await n("gitGraph", t);
325
- e.debug(r), pe(r, A);
326
- }, "parse") }, j = 10, M = 40, N = 4, P = 2, F = 8, I = /* @__PURE__ */ new Set([
327
- "redux",
328
- "redux-dark",
329
- "redux-color",
330
- "redux-dark-color"
331
- ]), L = 12, R = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), xe = /* @__PURE__ */ new Set([
332
- "dark",
333
- "redux-dark",
334
- "redux-dark-color",
335
- "neo-dark"
336
- ]), z = /* @__PURE__ */ r((e, t, n = !1) => n && e > 0 ? (e - 1) % (t - 1) + 1 : e % t, "calcColorIndex"), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), H = 30, U = /* @__PURE__ */ new Map(), W = [], G = 0, K = "LR", Se = /* @__PURE__ */ r(() => {
337
- B.clear(), V.clear(), U.clear(), G = 0, W = [], K = "LR";
338
- }, "clear"), q = /* @__PURE__ */ r((e) => {
339
- let t = document.createElementNS("http://www.w3.org/2000/svg", "text");
340
- return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((e) => {
341
- let n = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
342
- 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);
343
- }), t;
344
- }, "drawText"), J = /* @__PURE__ */ r((e) => {
345
- let t, n, i;
346
- return K === "BT" ? (n = /* @__PURE__ */ r((e, t) => e <= t, "comparisonFunc"), i = Infinity) : (n = /* @__PURE__ */ r((e, t) => e >= t, "comparisonFunc"), i = 0), e.forEach((e) => {
347
- let r = K === "TB" || K == "BT" ? V.get(e)?.y : V.get(e)?.x;
348
- r !== void 0 && n(r, i) && (t = e, i = r);
349
- }), t;
350
- }, "findClosestParent"), Ce = /* @__PURE__ */ r((e) => {
351
- let t = "", n = Infinity;
352
- return e.forEach((e) => {
353
- let r = V.get(e).y;
354
- r <= n && (t = e, n = r);
355
- }), t || void 0;
356
- }, "findClosestParentBT"), we = /* @__PURE__ */ r((e, t, n) => {
357
- let r = n, i = n, a = [];
358
- e.forEach((e) => {
359
- let n = t.get(e);
360
- if (!n) throw Error(`Commit not found for key ${e}`);
361
- n.parents.length ? (r = Ee(n), i = Math.max(r, i)) : a.push(n), De(n, r);
362
- }), r = i, a.forEach((e) => {
363
- Oe(e, r, n);
364
- }), e.forEach((e) => {
365
- let n = t.get(e);
366
- if (n?.parents.length) {
367
- let e = Ce(n.parents);
368
- r = V.get(e).y - M, r <= i && (i = r);
369
- let t = B.get(n.branch).pos, a = r - j;
370
- V.set(n.id, {
371
- x: t,
372
- y: a
373
- });
374
- }
375
- });
376
- }, "setParallelBTPos"), Te = /* @__PURE__ */ r((e) => {
377
- let t = J(e.parents.filter((e) => e !== null));
378
- if (!t) throw Error(`Closest parent not found for commit ${e.id}`);
379
- let n = V.get(t)?.y;
380
- if (n === void 0) throw Error(`Closest parent position not found for commit ${e.id}`);
381
- return n;
382
- }, "findClosestParentPos"), Ee = /* @__PURE__ */ r((e) => Te(e) + M, "calculateCommitPosition"), De = /* @__PURE__ */ r((e, t) => {
383
- let n = B.get(e.branch);
384
- if (!n) throw Error(`Branch not found for commit ${e.id}`);
385
- let r = n.pos, i = t + j;
386
- return V.set(e.id, {
387
- x: r,
388
- y: i
389
- }), {
390
- x: r,
391
- y: i
392
- };
393
- }, "setCommitPosition"), Oe = /* @__PURE__ */ r((e, t, n) => {
394
- let r = B.get(e.branch);
395
- if (!r) throw Error(`Branch not found for commit ${e.id}`);
396
- let i = t + n, a = r.pos;
397
- V.set(e.id, {
398
- x: a,
399
- y: i
400
- });
401
- }, "setRootPosition"), ke = /* @__PURE__ */ r((e, t, n, r, i, a) => {
402
- let { theme: o } = u(), s = I.has(o ?? ""), c = R.has(o ?? ""), l = xe.has(o ?? "");
403
- if (a === x.HIGHLIGHT) e.append("rect").attr("x", n.x - 10 + (s ? 3 : 0)).attr("y", n.y - 10 + (s ? 3 : 0)).attr("width", s ? 14 : 20).attr("height", s ? 14 : 20).attr("class", `commit ${t.id} commit-highlight${z(i, F, c)} ${r}-outer`), e.append("rect").attr("x", n.x - 6 + (s ? 2 : 0)).attr("y", n.y - 6 + (s ? 2 : 0)).attr("width", s ? 8 : 12).attr("height", s ? 8 : 12).attr("class", `commit ${t.id} commit${z(i, F, c)} ${r}-inner`);
404
- else if (a === x.CHERRY_PICK) e.append("circle").attr("cx", n.x).attr("cy", n.y).attr("r", s ? 7 : 10).attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x - 3).attr("cy", n.y + 2).attr("r", s ? 2.5 : 2.75).attr("fill", l ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`), e.append("circle").attr("cx", n.x + 3).attr("cy", n.y + 2).attr("r", s ? 2.5 : 2.75).attr("fill", l ? "#000000" : "#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", l ? "#000000" : "#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", l ? "#000000" : "#fff").attr("class", `commit ${t.id} ${r}`);
405
- else {
406
- let o = e.append("circle");
407
- if (o.attr("cx", n.x), o.attr("cy", n.y), o.attr("r", s ? 7 : 10), o.attr("class", `commit ${t.id} commit${z(i, F, c)}`), a === x.MERGE) {
408
- let a = e.append("circle");
409
- a.attr("cx", n.x), a.attr("cy", n.y), a.attr("r", s ? 5 : 6), a.attr("class", `commit ${r} ${t.id} commit${z(i, F, c)}`);
410
- }
411
- if (a === x.REVERSE) {
412
- let a = e.append("path"), o = s ? 4 : 5;
413
- a.attr("d", `M ${n.x - o},${n.y - o}L${n.x + o},${n.y + o}M${n.x - o},${n.y + o}L${n.x + o},${n.y - o}`).attr("class", `commit ${r} ${t.id} commit${z(i, F, c)}`);
414
- }
415
- }
416
- }, "drawCommitBullet"), Ae = /* @__PURE__ */ r((e, t, n, r, i) => {
417
- if (t.type !== x.CHERRY_PICK && (t.customId && t.type === x.MERGE || t.type !== x.MERGE) && i.showCommitLabel) {
418
- 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();
419
- if (c && (o.attr("x", n.posWithOffset - c.width / 2 - P).attr("y", n.y + 13.5).attr("width", c.width + 2 * P).attr("height", c.height + 2 * P), K === "TB" || K === "BT" ? (o.attr("x", n.x - (c.width + 4 * N + 5)).attr("y", n.y - 12), s.attr("x", n.x - (c.width + 4 * N)).attr("y", n.y + c.height - 12)) : s.attr("x", n.posWithOffset - c.width / 2), i.rotateCommitLabel)) if (K === "TB" || K === "BT") s.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")"), o.attr("transform", "rotate(-45, " + n.x + ", " + n.y + ")");
420
- else {
421
- let e = -7.5 - (c.width + 10) / 25 * 9.5, t = 10 + c.width / 25 * 8.5;
422
- a.attr("transform", "translate(" + e + ", " + t + ") rotate(-45, " + r + ", " + n.y + ")");
423
- }
424
- }
425
- }, "drawCommitLabel"), je = /* @__PURE__ */ r((e, t, n, r) => {
426
- if (t.tags.length > 0) {
427
- let i = 0, a = 0, o = 0, s = [];
428
- for (let r of t.tags.reverse()) {
429
- 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();
430
- if (!u) throw Error("Tag bbox not found");
431
- a = Math.max(a, u.width), o = Math.max(o, u.height), l.attr("x", n.posWithOffset - u.width / 2), s.push({
432
- tag: l,
433
- hole: c,
434
- rect: t,
435
- yOffset: i
436
- }), i += 20;
437
- }
438
- for (let { tag: e, hole: t, rect: i, yOffset: c } of s) {
439
- let s = o / 2, l = n.y - 19.2 - c;
440
- if (i.attr("class", "tag-label-bkg").attr("points", `
441
- ${r - a / 2 - N / 2},${l + P}
442
- ${r - a / 2 - N / 2},${l - P}
443
- ${n.posWithOffset - a / 2 - N},${l - s - P}
444
- ${n.posWithOffset + a / 2 + N},${l - s - P}
445
- ${n.posWithOffset + a / 2 + N},${l + s + P}
446
- ${n.posWithOffset - a / 2 - N},${l + s + P}`), t.attr("cy", l).attr("cx", r - a / 2 + N / 2).attr("r", 1.5).attr("class", "tag-hole"), K === "TB" || K === "BT") {
447
- let o = r + c;
448
- i.attr("class", "tag-label-bkg").attr("points", `
449
- ${n.x},${o + 2}
450
- ${n.x},${o - 2}
451
- ${n.x + j},${o - s - 2}
452
- ${n.x + j + a + 4},${o - s - 2}
453
- ${n.x + j + a + 4},${o + s + 2}
454
- ${n.x + j},${o + s + 2}`).attr("transform", "translate(12,12) rotate(45, " + n.x + "," + r + ")"), t.attr("cx", n.x + N / 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 + ")");
455
- }
456
- }
457
- }
458
- }, "drawCommitTags"), Me = /* @__PURE__ */ r((e) => {
459
- switch (e.customType ?? e.type) {
460
- case x.NORMAL: return "commit-normal";
461
- case x.REVERSE: return "commit-reverse";
462
- case x.HIGHLIGHT: return "commit-highlight";
463
- case x.MERGE: return "commit-merge";
464
- case x.CHERRY_PICK: return "commit-cherry-pick";
465
- default: return "commit-normal";
466
- }
467
- }, "getCommitClassType"), Ne = /* @__PURE__ */ r((e, t, n, r) => {
468
- let i = {
469
- x: 0,
470
- y: 0
471
- };
472
- if (e.parents.length > 0) {
473
- let n = J(e.parents);
474
- if (n) {
475
- let a = r.get(n) ?? i;
476
- return t === "TB" ? a.y + M : t === "BT" ? (r.get(e.id) ?? i).y - M : a.x + M;
477
- }
478
- } else if (t === "TB") return H;
479
- else if (t === "BT") return (r.get(e.id) ?? i).y - M;
480
- else return 0;
481
- return 0;
482
- }, "calculatePosition"), Pe = /* @__PURE__ */ r((e, t, n) => {
483
- let r = K === "BT" && n ? t : t + j, i = B.get(e.branch)?.pos, a = K === "TB" || K === "BT" ? B.get(e.branch)?.pos : r;
484
- if (a === void 0 || i === void 0) throw Error(`Position were undefined for commit ${e.id}`);
485
- let o = I.has(u().theme ?? "");
486
- return {
487
- x: a,
488
- y: K === "TB" || K === "BT" ? r : i + (o ? L / 2 + 1 : -2),
489
- posWithOffset: r
490
- };
491
- }, "getCommitPosition"), Y = /* @__PURE__ */ r((e, t, n, i) => {
492
- let a = e.append("g").attr("class", "commit-bullets"), o = e.append("g").attr("class", "commit-labels"), s = K === "TB" || K === "BT" ? H : 0, c = [...t.keys()], l = i.parallelCommits ?? !1, u = /* @__PURE__ */ r((e, n) => {
493
- let r = t.get(e)?.seq, i = t.get(n)?.seq;
494
- return r !== void 0 && i !== void 0 ? r - i : 0;
495
- }, "sortKeys"), d = c.sort(u);
496
- K === "BT" && (l && we(d, t, s), d = d.reverse()), d.forEach((e) => {
497
- let r = t.get(e);
498
- if (!r) throw Error(`Commit not found for key ${e}`);
499
- l && (s = Ne(r, K, s, V));
500
- let c = Pe(r, s, l);
501
- if (n) {
502
- let e = Me(r), t = r.customType ?? r.type;
503
- ke(a, r, c, e, B.get(r.branch)?.index ?? 0, t), Ae(o, r, c, s, i), je(o, r, c, s);
504
- }
505
- K === "TB" || K === "BT" ? V.set(r.id, {
506
- x: c.x,
507
- y: c.posWithOffset
508
- }) : V.set(r.id, {
509
- x: c.posWithOffset,
510
- y: c.y
511
- }), s = K === "BT" && l ? s + M : s + M + j, s > G && (G = s);
512
- });
513
- }, "drawCommits"), Fe = /* @__PURE__ */ r((e, t, n, i, a) => {
514
- let o = (K === "TB" || K === "BT" ? n.x < i.x : n.y < i.y) ? t.branch : e.branch, s = /* @__PURE__ */ r((e) => e.branch === o, "isOnBranchToGetCurve"), c = /* @__PURE__ */ r((n) => n.seq > e.seq && n.seq < t.seq, "isBetweenCommits");
515
- return [...a.values()].some((e) => c(e) && s(e));
516
- }, "shouldRerouteArrow"), X = /* @__PURE__ */ r((e, t, n = 0) => {
517
- let r = e + Math.abs(e - t) / 2;
518
- return n > 5 ? r : W.every((e) => Math.abs(e - r) >= 10) ? (W.push(r), r) : X(e, t - Math.abs(e - t) / 5, n + 1);
519
- }, "findLane"), Ie = /* @__PURE__ */ r((e, t, n, r) => {
520
- let { theme: i } = u(), a = R.has(i ?? ""), o = V.get(t.id), s = V.get(n.id);
521
- if (o === void 0 || s === void 0) throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);
522
- let c = Fe(t, n, o, s, r), l = "", d = "", f = 0, p = 0, m = B.get(n.branch)?.index;
523
- n.type === x.MERGE && t.id !== n.parents[0] && (m = B.get(t.branch)?.index);
524
- let h;
525
- if (c) {
526
- l = "A 10 10, 0, 0, 0,", d = "A 10 10, 0, 0, 1,", f = 10, p = 10;
527
- let e = o.y < s.y ? X(o.y, s.y) : X(s.y, o.y), n = o.x < s.x ? X(o.x, s.x) : X(s.x, o.x);
528
- K === "TB" ? o.x < s.x ? h = `M ${o.x} ${o.y} L ${n - f} ${o.y} ${d} ${n} ${o.y + p} L ${n} ${s.y - f} ${l} ${n + p} ${s.y} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${n + f} ${o.y} ${l} ${n} ${o.y + p} L ${n} ${s.y - f} ${d} ${n - p} ${s.y} L ${s.x} ${s.y}`) : K === "BT" ? o.x < s.x ? h = `M ${o.x} ${o.y} L ${n - f} ${o.y} ${l} ${n} ${o.y - p} L ${n} ${s.y + f} ${d} ${n + p} ${s.y} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${n + f} ${o.y} ${d} ${n} ${o.y - p} L ${n} ${s.y + f} ${l} ${n - p} ${s.y} L ${s.x} ${s.y}`) : o.y < s.y ? h = `M ${o.x} ${o.y} L ${o.x} ${e - f} ${l} ${o.x + p} ${e} L ${s.x - f} ${e} ${d} ${s.x} ${e + p} L ${s.x} ${s.y}` : (m = B.get(t.branch)?.index, h = `M ${o.x} ${o.y} L ${o.x} ${e + f} ${d} ${o.x + p} ${e} L ${s.x - f} ${e} ${l} ${s.x} ${e - p} L ${s.x} ${s.y}`);
529
- } else l = "A 20 20, 0, 0, 0,", d = "A 20 20, 0, 0, 1,", f = 20, p = 20, K === "TB" ? (o.x < s.x && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y - f} ${l} ${o.x + p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${d} ${s.x} ${o.y + p} L ${s.x} ${s.y}`), o.x > s.x && (l = "A 20 20, 0, 0, 0,", d = "A 20 20, 0, 0, 1,", f = 20, p = 20, h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y - f} ${d} ${o.x - p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x + f} ${o.y} ${l} ${s.x} ${o.y + p} L ${s.x} ${s.y}`), o.x === s.x && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`)) : K === "BT" ? (o.x < s.x && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y + f} ${d} ${o.x + p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${l} ${s.x} ${o.y - p} L ${s.x} ${s.y}`), o.x > s.x && (l = "A 20 20, 0, 0, 0,", d = "A 20 20, 0, 0, 1,", f = 20, p = 20, h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${o.x} ${s.y + f} ${l} ${o.x - p} ${s.y} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${s.x + f} ${o.y} ${d} ${s.x} ${o.y - p} L ${s.x} ${s.y}`), o.x === s.x && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`)) : (o.y < s.y && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${d} ${s.x} ${o.y + p} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${o.x} ${s.y - f} ${l} ${o.x + p} ${s.y} L ${s.x} ${s.y}`), o.y > s.y && (h = n.type === x.MERGE && t.id !== n.parents[0] ? `M ${o.x} ${o.y} L ${s.x - f} ${o.y} ${l} ${s.x} ${o.y - p} L ${s.x} ${s.y}` : `M ${o.x} ${o.y} L ${o.x} ${s.y + f} ${d} ${o.x + p} ${s.y} L ${s.x} ${s.y}`), o.y === s.y && (h = `M ${o.x} ${o.y} L ${s.x} ${s.y}`));
530
- if (h === void 0) throw Error("Line definition not found");
531
- e.append("path").attr("d", h).attr("class", "arrow arrow" + z(m, F, a));
532
- }, "drawArrow"), Le = /* @__PURE__ */ r((e, t) => {
533
- let n = e.append("g").attr("class", "commit-arrows");
534
- [...t.keys()].forEach((e) => {
535
- let r = t.get(e);
536
- r.parents && r.parents.length > 0 && r.parents.forEach((e) => {
537
- Ie(n, t.get(e), r, t);
538
- });
539
- });
540
- }, "drawArrows"), Re = /* @__PURE__ */ r((e, t, n, r) => {
541
- let { look: i, theme: a, themeVariables: o } = u(), { dropShadow: s, THEME_COLOR_LIMIT: c } = o, l = I.has(a ?? ""), d = R.has(a ?? ""), f = e.append("g");
542
- t.forEach((e, t) => {
543
- let a = z(t, l ? c : F, d), o = B.get(e.name)?.pos;
544
- if (o === void 0) throw Error(`Position not found for branch ${e.name}`);
545
- let u = K === "TB" || K === "BT" ? o : l ? o + L / 2 + 1 : o - 2, p = f.append("line");
546
- p.attr("x1", 0), p.attr("y1", u), p.attr("x2", G), p.attr("y2", u), p.attr("class", "branch branch" + a), K === "TB" ? (p.attr("y1", H), p.attr("x1", o), p.attr("y2", G), p.attr("x2", o)) : K === "BT" && (p.attr("y1", G), p.attr("x1", o), p.attr("y2", H), p.attr("x2", o)), W.push(u);
547
- let m = e.name, h = q(m), g = f.insert("rect"), _ = f.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + a);
548
- _.node().appendChild(h);
549
- let v = h.getBBox(), y = l ? 0 : 4, b = l ? 16 : 0, x = l ? L : 0;
550
- i === "neo" && g.attr("data-look", "neo"), g.attr("class", "branchLabelBkg label" + a).attr("style", i === "neo" ? `filter:${l ? `url(#${r}-drop-shadow)` : s}` : "").attr("rx", y).attr("ry", y).attr("x", -v.width - 4 - (n.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -v.height / 2 + 10).attr("width", v.width + 18 + b).attr("height", v.height + 4 + x), _.attr("transform", "translate(" + (-v.width - 14 - (n.rotateCommitLabel === !0 ? 30 : 0) + b / 2) + ", " + (u - v.height / 2 - 2) + ")"), K === "TB" ? (g.attr("x", o - v.width / 2 - 10).attr("y", 0), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", 0)"), l && (g.attr("transform", `translate(${-b / 2 - 3}, ${-x - 10})`), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + (-x * 2 + 7) + ")"))) : K === "BT" ? (g.attr("x", o - v.width / 2 - 10).attr("y", G), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + G + ")"), l && (g.attr("transform", `translate(${-b / 2 - 3}, ${x + 10})`), _.attr("transform", "translate(" + (o - v.width / 2 - 5) + ", " + (G + x * 2 + 4) + ")"))) : g.attr("transform", "translate(-19, " + (u - 12 - x / 2) + ")");
551
- });
552
- }, "drawBranches"), ze = /* @__PURE__ */ r(function(e, t, n, r, i) {
553
- return B.set(e, {
554
- pos: t,
555
- index: n
556
- }), t += 50 + (i ? 40 : 0) + (K === "TB" || K === "BT" ? r.width / 2 : 0), t;
557
- }, "setBranchPosition"), Be = { draw: /* @__PURE__ */ r(function(n, r, i, a) {
558
- Se(), e.debug("in gitgraph renderer", n + "\n", "id:", r, i);
559
- let o = a.db;
560
- if (!o.getConfig) {
561
- e.error("getConfig method is not available on db");
562
- return;
563
- }
564
- let c = o.getConfig(), l = c.rotateCommitLabel ?? !1;
565
- U = o.getCommits();
566
- let d = o.getBranchesAsObjArray();
567
- K = o.getDirection();
568
- let f = t(`[id="${r}"]`), { look: p, theme: m, themeVariables: h } = u(), { useGradient: _, gradientStart: v, gradientStop: y, filterColor: b } = h;
569
- if (_) {
570
- let e = f.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
571
- e.append("stop").attr("offset", "0%").attr("stop-color", v).attr("stop-opacity", 1), e.append("stop").attr("offset", "100%").attr("stop-color", y).attr("stop-opacity", 1);
572
- }
573
- p === "neo" && I.has(m ?? "") && f.append("defs").append("filter").attr("id", r + "-drop-shadow").attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", b);
574
- let x = 0;
575
- d.forEach((e, t) => {
576
- let n = q(e.name), r = f.append("g"), i = r.insert("g").attr("class", "branchLabel"), a = i.insert("g").attr("class", "label branch-label");
577
- a.node()?.appendChild(n);
578
- let o = n.getBBox();
579
- x = ze(e.name, x, t, o, l), a.remove(), i.remove(), r.remove();
580
- }), Y(f, U, !1, c), c.showBranches && Re(f, d, c, r), Le(f, U), Y(f, U, !0, c), g.insertTitle(f, "gitTitleText", c.titleTopMargin ?? 0, o.getDiagramTitle()), s(void 0, f, c.diagramPadding, c.useMaxWidth);
581
- }, "draw") }, Z = 8, Q = /* @__PURE__ */ new Set([
582
- "redux",
583
- "redux-dark",
584
- "redux-color",
585
- "redux-dark-color"
586
- ]), Ve = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), $ = /* @__PURE__ */ new Set(["neo", "neo-dark"]), He = /* @__PURE__ */ new Set([
587
- "dark",
588
- "redux-dark",
589
- "redux-dark-color",
590
- "neo-dark"
591
- ]), Ue = /* @__PURE__ */ new Set([
592
- "redux",
593
- "redux-dark",
594
- "redux-color",
595
- "redux-dark-color",
596
- "neo",
597
- "neo-dark"
598
- ]), We = /* @__PURE__ */ r((e) => {
599
- let { svgId: t } = e, n = "";
600
- if (e.useGradient && t) for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) n += `
601
- .label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}
602
- `;
603
- return n;
604
- }, "genGitGraphGradient"), Ge = /* @__PURE__ */ r((e) => {
605
- let { theme: t, themeVariables: n } = h(), { borderColorArray: r } = n, i = Q.has(t);
606
- if ($.has(t)) {
607
- let t = "";
608
- for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) if (n === 0) t += `
609
- .branch-label${n} { fill: ${e.nodeBorder};}
610
- .commit${n} { stroke: ${e.nodeBorder}; }
611
- .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
612
- .arrow${n} { stroke: ${e.nodeBorder}; }
613
- .commit-bullets { fill: ${e.nodeBorder}; }
614
- .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
615
- ${We(e)}`;
616
- else {
617
- let r = n % Z;
618
- t += `
619
- .branch-label${n} { fill: ${e["gitBranchLabel" + r]}; }
620
- .commit${n} { stroke: ${e["git" + r]}; fill: ${e["git" + r]}; }
621
- .commit-highlight${n} { stroke: ${e["gitInv" + r]}; fill: ${e["gitInv" + r]}; }
622
- .arrow${n} { stroke: ${e["git" + r]}; }
623
- `;
624
- }
625
- return t;
626
- } else if (Ve.has(t)) {
627
- let n = "";
628
- for (let a = 0; a < e.THEME_COLOR_LIMIT; a++) if (a === 0) n += `
629
- .branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
630
- .commit${a} { stroke: ${e.nodeBorder}; }
631
- .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
632
- .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
633
- .arrow${a} { stroke: ${e.nodeBorder}; }
634
- .commit-bullets { fill: ${e.nodeBorder}; }
635
- `;
636
- else {
637
- let o = a % r.length;
638
- n += `
639
- .branch-label${a} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
640
- .commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }
641
- .commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }
642
- .label${a} { fill: ${He.has(t) ? e.mainBkg : r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }
643
- .arrow${a} { stroke: ${r[o]}; }
644
- `;
645
- }
646
- return n;
647
- } else {
648
- let t = "";
649
- for (let n = 0; n < e.THEME_COLOR_LIMIT; n++) t += `
650
- .branch-label${n} { fill: ${e.nodeBorder}; ${i ? `font-weight:${e.noteFontWeight}` : ""} }
651
- .commit${n} { stroke: ${e.nodeBorder}; }
652
- .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
653
- .label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i ? `font-weight:${e.noteFontWeight}` : ""}}
654
- .arrow${n} { stroke: ${e.nodeBorder}; }
655
- .commit-bullets { fill: ${e.nodeBorder}; }
656
- .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
657
- `;
658
- return t;
659
- }
660
- }, "genColor"), Ke = /* @__PURE__ */ r((e) => `${Array.from({ length: e.THEME_COLOR_LIMIT }, (e, t) => t).map((t) => {
661
- let n = t % Z;
662
- return `
663
- .branch-label${t} { fill: ${e["gitBranchLabel" + n]}; }
664
- .commit${t} { stroke: ${e["git" + n]}; fill: ${e["git" + n]}; }
665
- .commit-highlight${t} { stroke: ${e["gitInv" + n]}; fill: ${e["gitInv" + n]}; }
666
- .label${t} { fill: ${e["git" + n]}; }
667
- .arrow${t} { stroke: ${e["git" + n]}; }
668
- `;
669
- }).join("\n")}`, "normalTheme"), qe = {
670
- parser: be,
671
- db: A,
672
- renderer: Be,
673
- styles: /* @__PURE__ */ r((e) => {
674
- let { theme: t } = h(), n = Ue.has(t);
675
- return `
676
- .commit-id,
677
- .commit-msg,
678
- .branch-label {
679
- fill: lightgrey;
680
- color: lightgrey;
681
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
682
- font-family: var(--mermaid-font-family);
683
- }
684
-
685
- ${n ? Ge(e) : Ke(e)}
686
-
687
- .branch {
688
- stroke-width: ${e.strokeWidth};
689
- stroke: ${e.commitLineColor ?? e.lineColor};
690
- stroke-dasharray: ${n ? "4 2" : "2"};
691
- }
692
- .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n ? e.nodeBorder : e.commitLabelColor}; ${n ? `font-weight:${e.noteFontWeight};` : ""}}
693
- .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n ? "transparent" : e.commitLabelBackground}; opacity: ${n ? "" : .5}; }
694
- .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
695
- .tag-label-bkg { fill: ${n ? e.mainBkg : e.tagLabelBackground}; stroke: ${n ? e.nodeBorder : e.tagLabelBorder}; ${n ? `filter:${e.dropShadow}` : ""} }
696
- .tag-hole { fill: ${e.textColor}; }
697
-
698
- .commit-merge {
699
- stroke: ${n ? e.mainBkg : e.primaryColor};
700
- fill: ${n ? e.mainBkg : e.primaryColor};
701
- }
702
- .commit-reverse {
703
- stroke: ${n ? e.mainBkg : e.primaryColor};
704
- fill: ${n ? e.mainBkg : e.primaryColor};
705
- stroke-width: ${n ? e.strokeWidth : 3};
706
- }
707
- .commit-highlight-outer {
708
- }
709
- .commit-highlight-inner {
710
- stroke: ${n ? e.mainBkg : e.primaryColor};
711
- fill: ${n ? e.mainBkg : e.primaryColor};
712
- }
713
-
714
- .arrow {
715
- /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
716
- stroke-width: ${Q.has(t) ? e.strokeWidth : 8};
717
- stroke-linecap: round;
718
- fill: none
719
- }
720
- .gitTitleText {
721
- text-anchor: middle;
722
- font-size: 18px;
723
- fill: ${e.textColor};
724
- }
725
- `;
726
- }, "getStyles")
727
- };
728
- //#endregion
729
- export { qe as diagram };