@kong-ui-public/documentation 1.4.20 → 1.4.21-pr.2722.b1aa23ae4.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 (163) hide show
  1. package/package.json +2 -2
  2. package/dist/_basePickBy-BCsiP0lE-DJBdvZNn.js +0 -151
  3. package/dist/_baseUniq-CsvgMmt0-CCBG5z_B.js +0 -614
  4. package/dist/arc-DYb5Ak6k-js8YHzj6.js +0 -83
  5. package/dist/architecture-U656AL7Q-LZu-yAfZ-CQD6AyxA.js +0 -5
  6. package/dist/architectureDiagram-KFL7JDKH-BK_an8l5-D20M_MXF.js +0 -4665
  7. package/dist/astro-Uf8_VxKJ-CZxoSljj.js +0 -16
  8. package/dist/blockDiagram-ZYB65J3Q-C0KtqCEe-pwEm3-ie.js +0 -2265
  9. package/dist/c-DASdrs7p-DASdrs7p.js +0 -6
  10. package/dist/c4Diagram-AAMF2YG6-DYHWlrmc-C6NWDsTV.js +0 -1581
  11. package/dist/channel-3QVQMCTA-BwyrTaJi.js +0 -5
  12. package/dist/chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js +0 -9
  13. package/dist/chunk-FHKO5MBM-z_nuC8Da-Dge2Nbr5.js +0 -15
  14. package/dist/chunk-GLLZNHP4-DgwBbAOT-BUrsAxH8.js +0 -19
  15. package/dist/chunk-JBRWN2VN-CHua2TSC-BYWS19Oz.js +0 -1374
  16. package/dist/chunk-LXBSTHXV-CoED0jHL-Cc8w4JL1.js +0 -1382
  17. package/dist/chunk-NRVI72HA-DxsqT4Dt-Bo_vu9qn.js +0 -20
  18. package/dist/chunk-OMD6QJNC-_VI6zVGr-Bb4P7zNG.js +0 -64
  19. package/dist/chunk-WVR4S24B-C4HIWky3-CkJ0DHSJ.js +0 -8
  20. package/dist/classDiagram-3BZAVTQC-DrmNjTt_-CS9fxl_R.js +0 -16
  21. package/dist/classDiagram-v2-QTMF73CY-DrmNjTt_-CS9fxl_R.js +0 -16
  22. package/dist/clone-C0dvnYv6-BozdSvey.js +0 -8
  23. package/dist/csharp-CYWRhZ2R-CYWRhZ2R.js +0 -6
  24. package/dist/css-D1aVdRIU-D1aVdRIU.js +0 -6
  25. package/dist/csv-DvCncUGQ-Tno401i9.js +0 -6
  26. package/dist/cytoscape.esm-CjI2IsL8-DYIumutE.js +0 -18721
  27. package/dist/dagre-2BBEFEWP-Bh_bYuL8-Cej31YXN.js +0 -447
  28. package/dist/defaultLocale-D7EN2tov-CK6dgF7Y.js +0 -171
  29. package/dist/diagram-4IRLE6MV-34TaesxP-XfF-gcP2.js +0 -533
  30. package/dist/diagram-GUPCWM2R-Cr4-5_uX-B8mxM1Uc.js +0 -143
  31. package/dist/diagram-RP2FKANI-COpvHjzI-C-_mZxuk.js +0 -221
  32. package/dist/diff-XmNrvgM1-XmNrvgM1.js +0 -6
  33. package/dist/docker-DWH2onkn-DWH2onkn.js +0 -6
  34. package/dist/documentation.es.js +0 -7
  35. package/dist/documentation.umd.js +0 -2865
  36. package/dist/erDiagram-HZWUO2LU-Cu2MerRS-KziSgDQg.js +0 -840
  37. package/dist/flowDiagram-THRYKUMA-CfrQTB8C-BYn8LF24.js +0 -1627
  38. package/dist/ganttDiagram-WV7ZQ7D5-gkieebY_-C7YOriZ4.js +0 -2504
  39. package/dist/git-commit-BspYIY3P-VkbIfR3L.js +0 -8
  40. package/dist/git-rebase--zLBTjUa-DEW2tfKx.js +0 -8
  41. package/dist/gitGraph-F6HP7TQM-suE5ufvy-CQDQV2yP.js +0 -5
  42. package/dist/gitGraphDiagram-OJR772UL-CYA7EIoU-Bqc1qZk4.js +0 -712
  43. package/dist/go-BErP6iv1-BErP6iv1.js +0 -6
  44. package/dist/graph-B_1gOUDz-Dm6REFzZ.js +0 -247
  45. package/dist/graphql-DWpQF4JI-C-3VJmtp.js +0 -14
  46. package/dist/haml-CMN0hQaL-BV5BsZTy.js +0 -10
  47. package/dist/handlebars-Cc-7fXX5-B9YgDKzT.js +0 -14
  48. package/dist/haskell-CtlGos0K-CtlGos0K.js +0 -6
  49. package/dist/html-B0P_v3yU-BojM9zZg.js +0 -10
  50. package/dist/html-derivative-BJFFAxYV-iD6NAoKm.js +0 -8
  51. package/dist/http-Dcjm_K1m-1LFSbOE1.js +0 -14
  52. package/dist/index-BDD0CD9m.js +0 -37385
  53. package/dist/info-NVLQJR56-CdsHk-Jf-tf8zb8tD.js +0 -5
  54. package/dist/infoDiagram-6WOFNB3A-ajp3t5Lm-D80dGo5F.js +0 -24
  55. package/dist/ini-BUcvsX-U-BUcvsX-U.js +0 -6
  56. package/dist/init-DjUOC4st-C8Nwz6AJ.js +0 -16
  57. package/dist/java-B7odJ7Ap-B7odJ7Ap.js +0 -6
  58. package/dist/javascript-fa8UlHZE-fa8UlHZE.js +0 -6
  59. package/dist/journeyDiagram-FFXJYRFH-kgCEEPLo-CakI8CyJ.js +0 -834
  60. package/dist/json-71t8ZF9g-71t8ZF9g.js +0 -6
  61. package/dist/json5-Z7F6rA6a-Z7F6rA6a.js +0 -6
  62. package/dist/jsonc-Dphhs4m2-Dphhs4m2.js +0 -6
  63. package/dist/jsonl-D9jj92Gg-D9jj92Gg.js +0 -6
  64. package/dist/jsx-Bkesy5tT-Bkesy5tT.js +0 -6
  65. package/dist/kanban-definition-KOZQBZVT-CmM4CHe6-rjuufCiO.js +0 -720
  66. package/dist/katex-C0Lgw_Sx-CbX2I1cQ.js +0 -11687
  67. package/dist/kotlin-DCgZY7Ii-DCgZY7Ii.js +0 -6
  68. package/dist/latex-CZXk8SiZ-DbjDPp_f.js +0 -11
  69. package/dist/layout-9vIfpCf3-FfABA43y.js +0 -1321
  70. package/dist/less-DQA4v-Nm-DQA4v-Nm.js +0 -6
  71. package/dist/linear-C-k9vokG-Md9dfBfB.js +0 -259
  72. package/dist/liquid-CvufO3kO-D90bBAdm.js +0 -14
  73. package/dist/lua-BVfhNLDr-DAa90qLN.js +0 -8
  74. package/dist/make-BjuHP00g-BjuHP00g.js +0 -6
  75. package/dist/markdown-B6guhLWd-B6guhLWd.js +0 -6
  76. package/dist/material-theme-lighter-BUBw43Yz-BUBw43Yz.js +0 -4
  77. package/dist/material-theme-palenight-C1RVm8K1-C1RVm8K1.js +0 -4
  78. package/dist/mdc-Bq810vct-Dr8CpN8f.js +0 -12
  79. package/dist/mdx-DIoECIFU-DIoECIFU.js +0 -6
  80. package/dist/mermaid-BZ7WHNIe-BZ7WHNIe.js +0 -6
  81. package/dist/mermaid-parser.core-DHL9WXVx-DeKF3RZx.js +0 -12890
  82. package/dist/mindmap-definition-LNHGMQRG-BsypuFYj-DSVrvuog.js +0 -3231
  83. package/dist/nginx-Can2eAjw-DKMoypYC.js +0 -8
  84. package/dist/objective-c-BGg9R27G-BGg9R27G.js +0 -6
  85. package/dist/ordinal-DfAQgscy-BEJTu10r.js +0 -61
  86. package/dist/packet-BFZMPI3H-BcK9kJ-B-BxxCPBGn.js +0 -5
  87. package/dist/pascal-l2bqd7Dz-l2bqd7Dz.js +0 -6
  88. package/dist/perl-DaMQyPwp-Cxx4wmV7.js +0 -16
  89. package/dist/php-BL3EfPBi-BZu5YwDX.js +0 -18
  90. package/dist/pie-7BOR55EZ-Vt5px0F3-BM7egbMh.js +0 -5
  91. package/dist/pieDiagram-DBDJKBY4-Bam6gKTi-BOqYeC6c.js +0 -161
  92. package/dist/plsql-oVq_K_wH-oVq_K_wH.js +0 -6
  93. package/dist/postcss-BZ3MNRIJ-BZ3MNRIJ.js +0 -6
  94. package/dist/powershell-Diwyv8Eh-Diwyv8Eh.js +0 -6
  95. package/dist/proto-o9HLmF90-o9HLmF90.js +0 -6
  96. package/dist/pug-HKe4Luo3-BYb0El_4.js +0 -12
  97. package/dist/python-xYxLFJY--xYxLFJY-.js +0 -6
  98. package/dist/quadrantDiagram-YPSRARAO-CJwMw09m-CN2OO-Le.js +0 -1024
  99. package/dist/r-F-9I-ITZ-F-9I-ITZ.js +0 -6
  100. package/dist/radar-NHE76QYJ-Br11XWE4-4RP4MPFA.js +0 -5
  101. package/dist/reg-CMUdAgIP-CMUdAgIP.js +0 -6
  102. package/dist/requirementDiagram-EGVEC5DT-DkRytT0X-C2zigskn.js +0 -850
  103. package/dist/rst-B8JEEtLI-Dyxh6LOj.js +0 -22
  104. package/dist/ruby-FDlfLkNa-nf7VLvCK.js +0 -50
  105. package/dist/rust-Pc7DCsZD-Pc7DCsZD.js +0 -6
  106. package/dist/sankeyDiagram-HRAUVNP4-08s1UHMk-2j8idkNs.js +0 -810
  107. package/dist/sass-iCyS6eP9-iCyS6eP9.js +0 -6
  108. package/dist/scss-DhHc4lxB-D1lMETuy.js +0 -8
  109. package/dist/sequenceDiagram-WFGC7UMF-6_s7-CN7-D-oTpLFJ.js +0 -2283
  110. package/dist/shellscript-Dn0-btNd-Dn0-btNd.js +0 -6
  111. package/dist/shellsession-8OLo3sB6-DD6AdPYk.js +0 -8
  112. package/dist/splunk-CTqDjQdo-CTqDjQdo.js +0 -6
  113. package/dist/sql-DCkt643--DCkt643-.js +0 -6
  114. package/dist/ssh-config-DHHGll-v-DHHGll-v.js +0 -6
  115. package/dist/stateDiagram-UUKSUZ4H-eWajY90l-BlM614AN.js +0 -263
  116. package/dist/stateDiagram-v2-EYPG3UTE-Dh7Ngu1O-YVMiocHE.js +0 -16
  117. package/dist/style.css +0 -1
  118. package/dist/stylus-n_9f0QQ5-n_9f0QQ5.js +0 -6
  119. package/dist/svelte-01qw6Rxm-Cjp5Srko.js +0 -14
  120. package/dist/swift-BAWqNR8A-BAWqNR8A.js +0 -6
  121. package/dist/timeline-definition-3HZDQTIS-4TPEOhE8-fDDLVlO8.js +0 -799
  122. package/dist/toml-CQSfOn0e-CQSfOn0e.js +0 -6
  123. package/dist/treemap-KMMF4GRG-nu7WEuPi-C1YG24W8.js +0 -5
  124. package/dist/tsx-DiGsgWT8-DiGsgWT8.js +0 -6
  125. package/dist/twig-DxrNSc26-BIWbKTFO.js +0 -18
  126. package/dist/types/components/DiscardChangesPrompt.vue.d.ts +0 -34
  127. package/dist/types/components/DiscardChangesPrompt.vue.d.ts.map +0 -1
  128. package/dist/types/components/DocumentationContent.vue.d.ts +0 -174
  129. package/dist/types/components/DocumentationContent.vue.d.ts.map +0 -1
  130. package/dist/types/components/DocumentationDisplay.vue.d.ts +0 -93
  131. package/dist/types/components/DocumentationDisplay.vue.d.ts.map +0 -1
  132. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts +0 -30
  133. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts.map +0 -1
  134. package/dist/types/components/ProductDocumentModal.vue.d.ts +0 -71
  135. package/dist/types/components/ProductDocumentModal.vue.d.ts.map +0 -1
  136. package/dist/types/composables/index.d.ts +0 -6
  137. package/dist/types/composables/index.d.ts.map +0 -1
  138. package/dist/types/composables/useI18n.d.ts +0 -9
  139. package/dist/types/composables/useI18n.d.ts.map +0 -1
  140. package/dist/types/external-links.d.ts +0 -5
  141. package/dist/types/external-links.d.ts.map +0 -1
  142. package/dist/types/helpers.d.ts +0 -8
  143. package/dist/types/helpers.d.ts.map +0 -1
  144. package/dist/types/index.d.ts +0 -7
  145. package/dist/types/index.d.ts.map +0 -1
  146. package/dist/types/types/document-list.d.ts +0 -28
  147. package/dist/types/types/document-list.d.ts.map +0 -1
  148. package/dist/types/types/document-modal.d.ts +0 -8
  149. package/dist/types/types/document-modal.d.ts.map +0 -1
  150. package/dist/types/types/index.d.ts +0 -3
  151. package/dist/types/types/index.d.ts.map +0 -1
  152. package/dist/typescript-buWNZFwO-buWNZFwO.js +0 -6
  153. package/dist/v-wa8Orrdd-wa8Orrdd.js +0 -6
  154. package/dist/vb-E2_-jk4M-E2_-jk4M.js +0 -6
  155. package/dist/viml-B-zWOd7Z-B-zWOd7Z.js +0 -6
  156. package/dist/vue-DdqTpW8B-BrYVXV7A.js +0 -31
  157. package/dist/vue-html-B9t4RWro-D1UeMTSX.js +0 -10
  158. package/dist/wasm-Bv5f0gKv-Bv5f0gKv.js +0 -6
  159. package/dist/wgsl-DnPoPGDU-DnPoPGDU.js +0 -6
  160. package/dist/xml-ChBsf5uy-0Ovnixsj.js +0 -8
  161. package/dist/xsl-BefjlXrd-CZ7IlB9K.js +0 -8
  162. package/dist/xychartDiagram-FDP5SA34-BbtKlU7T-D1BI5nWs.js +0 -1340
  163. package/dist/yaml-Bbg74JKr-Bbg74JKr.js +0 -6
@@ -1,712 +0,0 @@
1
- import { m as Q } from "./chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js";
2
- import { e as X } from "./chunk-FHKO5MBM-z_nuC8Da-Dge2Nbr5.js";
3
- import { _ as $, ao as Z, an as tt, a5 as rt, a6 as et, a7 as ot, a8 as nt, l as w, g as at, a9 as ct, am as it, az as st, at as dt, ag as k, aA as ht, aB as mt, aC as $t, aD as lt } from "./index-BDD0CD9m.js";
4
- import { N as gt } from "./mermaid-parser.core-DHL9WXVx-DeKF3RZx.js";
5
- var x = {
6
- NORMAL: 0,
7
- REVERSE: 1,
8
- HIGHLIGHT: 2,
9
- MERGE: 3,
10
- CHERRY_PICK: 4
11
- }, yt = $t.gitGraph, O = /* @__PURE__ */ $(() => ht({
12
- ...yt,
13
- ...mt().gitGraph
14
- }), "getConfig"), s = new X(() => {
15
- const r = O(), t = r.mainBranchName, e = r.mainBranchOrder;
16
- return {
17
- mainBranchName: t,
18
- commits: /* @__PURE__ */ new Map(),
19
- head: null,
20
- branchConfig: /* @__PURE__ */ new Map([[t, { name: t, order: e }]]),
21
- branches: /* @__PURE__ */ new Map([[t, null]]),
22
- currBranch: t,
23
- direction: "LR",
24
- seq: 0,
25
- options: {}
26
- };
27
- });
28
- function S() {
29
- return lt({ length: 7 });
30
- }
31
- $(S, "getID");
32
- function K(r, t) {
33
- const e = /* @__PURE__ */ Object.create(null);
34
- return r.reduce((a, c) => {
35
- const i = t(c);
36
- return e[i] || (e[i] = !0, a.push(c)), a;
37
- }, []);
38
- }
39
- $(K, "uniqBy");
40
- var pt = /* @__PURE__ */ $(function(r) {
41
- s.records.direction = r;
42
- }, "setDirection"), ft = /* @__PURE__ */ $(function(r) {
43
- w.debug("options str", r), r = r == null ? void 0 : r.trim(), r = r || "{}";
44
- try {
45
- s.records.options = JSON.parse(r);
46
- } catch (t) {
47
- w.error("error while parsing gitGraph options", t.message);
48
- }
49
- }, "setOptions"), ut = /* @__PURE__ */ $(function() {
50
- return s.records.options;
51
- }, "getOptions"), xt = /* @__PURE__ */ $(function(r) {
52
- let t = r.msg, e = r.id;
53
- const a = r.type;
54
- let c = r.tags;
55
- w.info("commit", t, e, a, c), w.debug("Entering commit:", t, e, a, c);
56
- const i = O();
57
- e = k.sanitizeText(e, i), t = k.sanitizeText(t, i), c = c == null ? void 0 : c.map((h) => k.sanitizeText(h, i));
58
- const d = {
59
- id: e || s.records.seq + "-" + S(),
60
- message: t,
61
- seq: s.records.seq++,
62
- type: a ?? x.NORMAL,
63
- tags: c ?? [],
64
- parents: s.records.head == null ? [] : [s.records.head.id],
65
- branch: s.records.currBranch
66
- };
67
- s.records.head = d, w.info("main branch", i.mainBranchName), s.records.commits.has(d.id) && w.warn(`Commit ID ${d.id} already exists`), s.records.commits.set(d.id, d), s.records.branches.set(s.records.currBranch, d.id), w.debug("in pushCommit " + d.id);
68
- }, "commit"), bt = /* @__PURE__ */ $(function(r) {
69
- let t = r.name;
70
- const e = r.order;
71
- if (t = k.sanitizeText(t, O()), s.records.branches.has(t))
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 ${t}")`
74
- );
75
- s.records.branches.set(t, s.records.head != null ? s.records.head.id : null), s.records.branchConfig.set(t, { name: t, order: e }), F(t), w.debug("in createBranch");
76
- }, "branch"), wt = /* @__PURE__ */ $((r) => {
77
- let t = r.branch, e = r.id;
78
- const a = r.type, c = r.tags, i = O();
79
- t = k.sanitizeText(t, i), e && (e = k.sanitizeText(e, i));
80
- const d = s.records.branches.get(s.records.currBranch), h = s.records.branches.get(t), l = d ? s.records.commits.get(d) : void 0, o = h ? s.records.commits.get(h) : void 0;
81
- if (l && o && l.branch === t)
82
- throw new Error(`Cannot merge branch '${t}' into itself.`);
83
- if (s.records.currBranch === t) {
84
- const m = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
85
- throw m.hash = {
86
- text: `merge ${t}`,
87
- token: `merge ${t}`,
88
- expected: ["branch abc"]
89
- }, m;
90
- }
91
- if (l === void 0 || !l) {
92
- const m = new Error(
93
- `Incorrect usage of "merge". Current branch (${s.records.currBranch})has no commits`
94
- );
95
- throw m.hash = {
96
- text: `merge ${t}`,
97
- token: `merge ${t}`,
98
- expected: ["commit"]
99
- }, m;
100
- }
101
- if (!s.records.branches.has(t)) {
102
- const m = new Error(
103
- 'Incorrect usage of "merge". Branch to be merged (' + t + ") does not exist"
104
- );
105
- throw m.hash = {
106
- text: `merge ${t}`,
107
- token: `merge ${t}`,
108
- expected: [`branch ${t}`]
109
- }, m;
110
- }
111
- if (o === void 0 || !o) {
112
- const m = new Error(
113
- 'Incorrect usage of "merge". Branch to be merged (' + t + ") has no commits"
114
- );
115
- throw m.hash = {
116
- text: `merge ${t}`,
117
- token: `merge ${t}`,
118
- expected: ['"commit"']
119
- }, m;
120
- }
121
- if (l === o) {
122
- const m = new Error('Incorrect usage of "merge". Both branches have same head');
123
- throw m.hash = {
124
- text: `merge ${t}`,
125
- token: `merge ${t}`,
126
- expected: ["branch abc"]
127
- }, m;
128
- }
129
- if (e && s.records.commits.has(e)) {
130
- const m = new Error(
131
- 'Incorrect usage of "merge". Commit with id:' + e + " already exists, use different custom id"
132
- );
133
- throw m.hash = {
134
- text: `merge ${t} ${e} ${a} ${c == null ? void 0 : c.join(" ")}`,
135
- token: `merge ${t} ${e} ${a} ${c == null ? void 0 : c.join(" ")}`,
136
- expected: [
137
- `merge ${t} ${e}_UNIQUE ${a} ${c == null ? void 0 : c.join(" ")}`
138
- ]
139
- }, m;
140
- }
141
- const n = h || "", u = {
142
- id: e || `${s.records.seq}-${S()}`,
143
- message: `merged branch ${t} into ${s.records.currBranch}`,
144
- seq: s.records.seq++,
145
- parents: s.records.head == null ? [] : [s.records.head.id, n],
146
- branch: s.records.currBranch,
147
- type: x.MERGE,
148
- customType: a,
149
- customId: !!e,
150
- tags: c ?? []
151
- };
152
- s.records.head = u, s.records.commits.set(u.id, u), s.records.branches.set(s.records.currBranch, u.id), w.debug(s.records.branches), w.debug("in mergeBranch");
153
- }, "merge"), Bt = /* @__PURE__ */ $(function(r) {
154
- let t = r.id, e = r.targetId, a = r.tags, c = r.parent;
155
- w.debug("Entering cherryPick:", t, e, a);
156
- const i = O();
157
- if (t = k.sanitizeText(t, i), e = k.sanitizeText(e, i), a = a == null ? void 0 : a.map((l) => k.sanitizeText(l, i)), c = k.sanitizeText(c, i), !t || !s.records.commits.has(t)) {
158
- const l = new Error(
159
- 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
160
- );
161
- throw l.hash = {
162
- text: `cherryPick ${t} ${e}`,
163
- token: `cherryPick ${t} ${e}`,
164
- expected: ["cherry-pick abc"]
165
- }, l;
166
- }
167
- const d = s.records.commits.get(t);
168
- if (d === void 0 || !d)
169
- throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
170
- if (c && !(Array.isArray(d.parents) && d.parents.includes(c)))
171
- throw new Error(
172
- "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
173
- );
174
- const h = d.branch;
175
- if (d.type === x.MERGE && !c)
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 (!e || !s.records.commits.has(e)) {
180
- if (h === s.records.currBranch) {
181
- const u = new Error(
182
- 'Incorrect usage of "cherryPick". Source commit is already on current branch'
183
- );
184
- throw u.hash = {
185
- text: `cherryPick ${t} ${e}`,
186
- token: `cherryPick ${t} ${e}`,
187
- expected: ["cherry-pick abc"]
188
- }, u;
189
- }
190
- const l = s.records.branches.get(s.records.currBranch);
191
- if (l === void 0 || !l) {
192
- const u = new Error(
193
- `Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`
194
- );
195
- throw u.hash = {
196
- text: `cherryPick ${t} ${e}`,
197
- token: `cherryPick ${t} ${e}`,
198
- expected: ["cherry-pick abc"]
199
- }, u;
200
- }
201
- const o = s.records.commits.get(l);
202
- if (o === void 0 || !o) {
203
- const u = new Error(
204
- `Incorrect usage of "cherry-pick". Current branch (${s.records.currBranch})has no commits`
205
- );
206
- throw u.hash = {
207
- text: `cherryPick ${t} ${e}`,
208
- token: `cherryPick ${t} ${e}`,
209
- expected: ["cherry-pick abc"]
210
- }, u;
211
- }
212
- const n = {
213
- id: s.records.seq + "-" + S(),
214
- message: `cherry-picked ${d == null ? void 0 : d.message} into ${s.records.currBranch}`,
215
- seq: s.records.seq++,
216
- parents: s.records.head == null ? [] : [s.records.head.id, d.id],
217
- branch: s.records.currBranch,
218
- type: x.CHERRY_PICK,
219
- tags: a ? a.filter(Boolean) : [
220
- `cherry-pick:${d.id}${d.type === x.MERGE ? `|parent:${c}` : ""}`
221
- ]
222
- };
223
- s.records.head = n, s.records.commits.set(n.id, n), s.records.branches.set(s.records.currBranch, n.id), w.debug(s.records.branches), w.debug("in cherryPick");
224
- }
225
- }, "cherryPick"), F = /* @__PURE__ */ $(function(r) {
226
- if (r = k.sanitizeText(r, O()), s.records.branches.has(r)) {
227
- s.records.currBranch = r;
228
- const t = s.records.branches.get(s.records.currBranch);
229
- t === void 0 || !t ? s.records.head = null : s.records.head = s.records.commits.get(t) ?? null;
230
- } else {
231
- const t = new Error(
232
- `Trying to checkout branch which is not yet created. (Help try using "branch ${r}")`
233
- );
234
- throw t.hash = {
235
- text: `checkout ${r}`,
236
- token: `checkout ${r}`,
237
- expected: [`branch ${r}`]
238
- }, t;
239
- }
240
- }, "checkout");
241
- function N(r, t, e) {
242
- const a = r.indexOf(t);
243
- a === -1 ? r.push(e) : r.splice(a, 1, e);
244
- }
245
- $(N, "upsert");
246
- function _(r) {
247
- const t = r.reduce((c, i) => c.seq > i.seq ? c : i, r[0]);
248
- let e = "";
249
- r.forEach(function(c) {
250
- c === t ? e += " *" : e += " |";
251
- });
252
- const a = [e, t.id, t.seq];
253
- for (const c in s.records.branches)
254
- s.records.branches.get(c) === t.id && a.push(c);
255
- if (w.debug(a.join(" ")), t.parents && t.parents.length == 2 && t.parents[0] && t.parents[1]) {
256
- const c = s.records.commits.get(t.parents[0]);
257
- N(r, t, c), t.parents[1] && r.push(s.records.commits.get(t.parents[1]));
258
- } else {
259
- if (t.parents.length == 0)
260
- return;
261
- if (t.parents[0]) {
262
- const c = s.records.commits.get(t.parents[0]);
263
- N(r, t, c);
264
- }
265
- }
266
- r = K(r, (c) => c.id), _(r);
267
- }
268
- $(_, "prettyPrintCommitHistory");
269
- var Et = /* @__PURE__ */ $(function() {
270
- w.debug(s.records.commits);
271
- const r = Y()[0];
272
- _([r]);
273
- }, "prettyPrint"), vt = /* @__PURE__ */ $(function() {
274
- s.reset(), dt();
275
- }, "clear"), Ct = /* @__PURE__ */ $(function() {
276
- return [...s.records.branchConfig.values()].map((r, t) => r.order !== null && r.order !== void 0 ? r : {
277
- ...r,
278
- order: parseFloat(`0.${t}`)
279
- }).sort((r, t) => (r.order ?? 0) - (t.order ?? 0)).map(({ name: r }) => ({ name: r }));
280
- }, "getBranchesAsObjArray"), kt = /* @__PURE__ */ $(function() {
281
- return s.records.branches;
282
- }, "getBranches"), Tt = /* @__PURE__ */ $(function() {
283
- return s.records.commits;
284
- }, "getCommits"), Y = /* @__PURE__ */ $(function() {
285
- const r = [...s.records.commits.values()];
286
- return r.forEach(function(t) {
287
- w.debug(t.id);
288
- }), r.sort((t, e) => t.seq - e.seq), r;
289
- }, "getCommitsArray"), Lt = /* @__PURE__ */ $(function() {
290
- return s.records.currBranch;
291
- }, "getCurrentBranch"), Mt = /* @__PURE__ */ $(function() {
292
- return s.records.direction;
293
- }, "getDirection"), Pt = /* @__PURE__ */ $(function() {
294
- return s.records.head;
295
- }, "getHead"), V = {
296
- commitType: x,
297
- getConfig: O,
298
- setDirection: pt,
299
- setOptions: ft,
300
- getOptions: ut,
301
- commit: xt,
302
- branch: bt,
303
- merge: wt,
304
- cherryPick: Bt,
305
- checkout: F,
306
- //reset,
307
- prettyPrint: Et,
308
- clear: vt,
309
- getBranchesAsObjArray: Ct,
310
- getBranches: kt,
311
- getCommits: Tt,
312
- getCommitsArray: Y,
313
- getCurrentBranch: Lt,
314
- getDirection: Mt,
315
- getHead: Pt,
316
- setAccTitle: nt,
317
- getAccTitle: ot,
318
- getAccDescription: et,
319
- setAccDescription: rt,
320
- setDiagramTitle: tt,
321
- getDiagramTitle: Z
322
- }, Rt = /* @__PURE__ */ $((r, t) => {
323
- Q(r, t), r.dir && t.setDirection(r.dir);
324
- for (const e of r.statements)
325
- At(e, t);
326
- }, "populate"), At = /* @__PURE__ */ $((r, t) => {
327
- const e = {
328
- Commit: /* @__PURE__ */ $((a) => t.commit(It(a)), "Commit"),
329
- Branch: /* @__PURE__ */ $((a) => t.branch(Gt(a)), "Branch"),
330
- Merge: /* @__PURE__ */ $((a) => t.merge(Ot(a)), "Merge"),
331
- Checkout: /* @__PURE__ */ $((a) => t.checkout(qt(a)), "Checkout"),
332
- CherryPicking: /* @__PURE__ */ $((a) => t.cherryPick(zt(a)), "CherryPicking")
333
- }[r.$type];
334
- e ? e(r) : w.error(`Unknown statement type: ${r.$type}`);
335
- }, "parseStatement"), It = /* @__PURE__ */ $((r) => ({
336
- id: r.id,
337
- msg: r.message ?? "",
338
- type: r.type !== void 0 ? x[r.type] : x.NORMAL,
339
- tags: r.tags ?? void 0
340
- }), "parseCommit"), Gt = /* @__PURE__ */ $((r) => ({
341
- name: r.name,
342
- order: r.order ?? 0
343
- }), "parseBranch"), Ot = /* @__PURE__ */ $((r) => ({
344
- branch: r.branch,
345
- id: r.id ?? "",
346
- type: r.type !== void 0 ? x[r.type] : void 0,
347
- tags: r.tags ?? void 0
348
- }), "parseMerge"), qt = /* @__PURE__ */ $((r) => r.branch, "parseCheckout"), zt = /* @__PURE__ */ $((r) => {
349
- var t;
350
- return {
351
- id: r.id,
352
- targetId: "",
353
- tags: ((t = r.tags) == null ? void 0 : t.length) === 0 ? void 0 : r.tags,
354
- parent: r.parent
355
- };
356
- }, "parseCherryPicking"), Ht = {
357
- parse: /* @__PURE__ */ $(async (r) => {
358
- const t = await gt("gitGraph", r);
359
- w.debug(t), Rt(t, V);
360
- }, "parse")
361
- }, W = at(), E = W == null ? void 0 : W.gitGraph, A = 10, I = 40, T = 4, M = 2, G = 8, v = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), H = 30, q = /* @__PURE__ */ new Map(), D = [], R = 0, f = "LR", Dt = /* @__PURE__ */ $(() => {
362
- v.clear(), C.clear(), q.clear(), R = 0, D = [], f = "LR";
363
- }, "clear"), U = /* @__PURE__ */ $((r) => {
364
- const t = document.createElementNS("http://www.w3.org/2000/svg", "text");
365
- return (typeof r == "string" ? r.split(/\\n|\n|<br\s*\/?>/gi) : r).forEach((e) => {
366
- const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
367
- a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), a.setAttribute("dy", "1em"), a.setAttribute("x", "0"), a.setAttribute("class", "row"), a.textContent = e.trim(), t.appendChild(a);
368
- }), t;
369
- }, "drawText"), J = /* @__PURE__ */ $((r) => {
370
- let t, e, a;
371
- return f === "BT" ? (e = /* @__PURE__ */ $((c, i) => c <= i, "comparisonFunc"), a = 1 / 0) : (e = /* @__PURE__ */ $((c, i) => c >= i, "comparisonFunc"), a = 0), r.forEach((c) => {
372
- var i, d;
373
- const h = f === "TB" || f == "BT" ? (i = C.get(c)) == null ? void 0 : i.y : (d = C.get(c)) == null ? void 0 : d.x;
374
- h !== void 0 && e(h, a) && (t = c, a = h);
375
- }), t;
376
- }, "findClosestParent"), St = /* @__PURE__ */ $((r) => {
377
- let t = "", e = 1 / 0;
378
- return r.forEach((a) => {
379
- const c = C.get(a).y;
380
- c <= e && (t = a, e = c);
381
- }), t || void 0;
382
- }, "findClosestParentBT"), Nt = /* @__PURE__ */ $((r, t, e) => {
383
- let a = e, c = e;
384
- const i = [];
385
- r.forEach((d) => {
386
- const h = t.get(d);
387
- if (!h)
388
- throw new Error(`Commit not found for key ${d}`);
389
- h.parents.length ? (a = Wt(h), c = Math.max(a, c)) : i.push(h), jt(h, a);
390
- }), a = c, i.forEach((d) => {
391
- Kt(d, a, e);
392
- }), r.forEach((d) => {
393
- const h = t.get(d);
394
- if (h != null && h.parents.length) {
395
- const l = St(h.parents);
396
- a = C.get(l).y - I, a <= c && (c = a);
397
- const o = v.get(h.branch).pos, n = a - A;
398
- C.set(h.id, { x: o, y: n });
399
- }
400
- });
401
- }, "setParallelBTPos"), _t = /* @__PURE__ */ $((r) => {
402
- var t;
403
- const e = J(r.parents.filter((c) => c !== null));
404
- if (!e)
405
- throw new Error(`Closest parent not found for commit ${r.id}`);
406
- const a = (t = C.get(e)) == null ? void 0 : t.y;
407
- if (a === void 0)
408
- throw new Error(`Closest parent position not found for commit ${r.id}`);
409
- return a;
410
- }, "findClosestParentPos"), Wt = /* @__PURE__ */ $((r) => _t(r) + I, "calculateCommitPosition"), jt = /* @__PURE__ */ $((r, t) => {
411
- const e = v.get(r.branch);
412
- if (!e)
413
- throw new Error(`Branch not found for commit ${r.id}`);
414
- const a = e.pos, c = t + A;
415
- return C.set(r.id, { x: a, y: c }), { x: a, y: c };
416
- }, "setCommitPosition"), Kt = /* @__PURE__ */ $((r, t, e) => {
417
- const a = v.get(r.branch);
418
- if (!a)
419
- throw new Error(`Branch not found for commit ${r.id}`);
420
- const c = t + e, i = a.pos;
421
- C.set(r.id, { x: i, y: c });
422
- }, "setRootPosition"), Ft = /* @__PURE__ */ $((r, t, e, a, c, i) => {
423
- if (i === x.HIGHLIGHT)
424
- r.append("rect").attr("x", e.x - 10).attr("y", e.y - 10).attr("width", 20).attr("height", 20).attr(
425
- "class",
426
- `commit ${t.id} commit-highlight${c % G} ${a}-outer`
427
- ), r.append("rect").attr("x", e.x - 6).attr("y", e.y - 6).attr("width", 12).attr("height", 12).attr(
428
- "class",
429
- `commit ${t.id} commit${c % G} ${a}-inner`
430
- );
431
- else if (i === x.CHERRY_PICK)
432
- r.append("circle").attr("cx", e.x).attr("cy", e.y).attr("r", 10).attr("class", `commit ${t.id} ${a}`), r.append("circle").attr("cx", e.x - 3).attr("cy", e.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${a}`), r.append("circle").attr("cx", e.x + 3).attr("cy", e.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${t.id} ${a}`), r.append("line").attr("x1", e.x + 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", "#fff").attr("class", `commit ${t.id} ${a}`), r.append("line").attr("x1", e.x - 3).attr("y1", e.y + 1).attr("x2", e.x).attr("y2", e.y - 5).attr("stroke", "#fff").attr("class", `commit ${t.id} ${a}`);
433
- else {
434
- const d = r.append("circle");
435
- if (d.attr("cx", e.x), d.attr("cy", e.y), d.attr("r", t.type === x.MERGE ? 9 : 10), d.attr("class", `commit ${t.id} commit${c % G}`), i === x.MERGE) {
436
- const h = r.append("circle");
437
- h.attr("cx", e.x), h.attr("cy", e.y), h.attr("r", 6), h.attr(
438
- "class",
439
- `commit ${a} ${t.id} commit${c % G}`
440
- );
441
- }
442
- i === x.REVERSE && r.append("path").attr(
443
- "d",
444
- `M ${e.x - 5},${e.y - 5}L${e.x + 5},${e.y + 5}M${e.x - 5},${e.y + 5}L${e.x + 5},${e.y - 5}`
445
- ).attr("class", `commit ${a} ${t.id} commit${c % G}`);
446
- }
447
- }, "drawCommitBullet"), Yt = /* @__PURE__ */ $((r, t, e, a) => {
448
- var c;
449
- if (t.type !== x.CHERRY_PICK && (t.customId && t.type === x.MERGE || t.type !== x.MERGE) && E != null && E.showCommitLabel) {
450
- const i = r.append("g"), d = i.insert("rect").attr("class", "commit-label-bkg"), h = i.append("text").attr("x", a).attr("y", e.y + 25).attr("class", "commit-label").text(t.id), l = (c = h.node()) == null ? void 0 : c.getBBox();
451
- if (l && (d.attr("x", e.posWithOffset - l.width / 2 - M).attr("y", e.y + 13.5).attr("width", l.width + 2 * M).attr("height", l.height + 2 * M), f === "TB" || f === "BT" ? (d.attr("x", e.x - (l.width + 4 * T + 5)).attr("y", e.y - 12), h.attr("x", e.x - (l.width + 4 * T)).attr("y", e.y + l.height - 12)) : h.attr("x", e.posWithOffset - l.width / 2), E.rotateCommitLabel))
452
- if (f === "TB" || f === "BT")
453
- h.attr(
454
- "transform",
455
- "rotate(-45, " + e.x + ", " + e.y + ")"
456
- ), d.attr(
457
- "transform",
458
- "rotate(-45, " + e.x + ", " + e.y + ")"
459
- );
460
- else {
461
- const o = -7.5 - (l.width + 10) / 25 * 9.5, n = 10 + l.width / 25 * 8.5;
462
- i.attr(
463
- "transform",
464
- "translate(" + o + ", " + n + ") rotate(-45, " + a + ", " + e.y + ")"
465
- );
466
- }
467
- }
468
- }, "drawCommitLabel"), Vt = /* @__PURE__ */ $((r, t, e, a) => {
469
- var c;
470
- if (t.tags.length > 0) {
471
- let i = 0, d = 0, h = 0;
472
- const l = [];
473
- for (const o of t.tags.reverse()) {
474
- const n = r.insert("polygon"), u = r.append("circle"), m = r.append("text").attr("y", e.y - 16 - i).attr("class", "tag-label").text(o), g = (c = m.node()) == null ? void 0 : c.getBBox();
475
- if (!g)
476
- throw new Error("Tag bbox not found");
477
- d = Math.max(d, g.width), h = Math.max(h, g.height), m.attr("x", e.posWithOffset - g.width / 2), l.push({
478
- tag: m,
479
- hole: u,
480
- rect: n,
481
- yOffset: i
482
- }), i += 20;
483
- }
484
- for (const { tag: o, hole: n, rect: u, yOffset: m } of l) {
485
- const g = h / 2, p = e.y - 19.2 - m;
486
- if (u.attr("class", "tag-label-bkg").attr(
487
- "points",
488
- `
489
- ${a - d / 2 - T / 2},${p + M}
490
- ${a - d / 2 - T / 2},${p - M}
491
- ${e.posWithOffset - d / 2 - T},${p - g - M}
492
- ${e.posWithOffset + d / 2 + T},${p - g - M}
493
- ${e.posWithOffset + d / 2 + T},${p + g + M}
494
- ${e.posWithOffset - d / 2 - T},${p + g + M}`
495
- ), n.attr("cy", p).attr("cx", a - d / 2 + T / 2).attr("r", 1.5).attr("class", "tag-hole"), f === "TB" || f === "BT") {
496
- const y = a + m;
497
- u.attr("class", "tag-label-bkg").attr(
498
- "points",
499
- `
500
- ${e.x},${y + 2}
501
- ${e.x},${y - 2}
502
- ${e.x + A},${y - g - 2}
503
- ${e.x + A + d + 4},${y - g - 2}
504
- ${e.x + A + d + 4},${y + g + 2}
505
- ${e.x + A},${y + g + 2}`
506
- ).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + a + ")"), n.attr("cx", e.x + T / 2).attr("cy", y).attr("transform", "translate(12,12) rotate(45, " + e.x + "," + a + ")"), o.attr("x", e.x + 5).attr("y", y + 3).attr("transform", "translate(14,14) rotate(45, " + e.x + "," + a + ")");
507
- }
508
- }
509
- }
510
- }, "drawCommitTags"), Ut = /* @__PURE__ */ $((r) => {
511
- switch (r.customType ?? r.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"), Jt = /* @__PURE__ */ $((r, t, e, a) => {
526
- const c = { x: 0, y: 0 };
527
- if (r.parents.length > 0) {
528
- const i = J(r.parents);
529
- if (i) {
530
- const d = a.get(i) ?? c;
531
- return t === "TB" ? d.y + I : t === "BT" ? (a.get(r.id) ?? c).y - I : d.x + I;
532
- }
533
- } else
534
- return t === "TB" ? H : t === "BT" ? (a.get(r.id) ?? c).y - I : 0;
535
- return 0;
536
- }, "calculatePosition"), Qt = /* @__PURE__ */ $((r, t, e) => {
537
- var a, c;
538
- const i = f === "BT" && e ? t : t + A, d = f === "TB" || f === "BT" ? i : (a = v.get(r.branch)) == null ? void 0 : a.pos, h = f === "TB" || f === "BT" ? (c = v.get(r.branch)) == null ? void 0 : c.pos : i;
539
- if (h === void 0 || d === void 0)
540
- throw new Error(`Position were undefined for commit ${r.id}`);
541
- return { x: h, y: d, posWithOffset: i };
542
- }, "getCommitPosition"), j = /* @__PURE__ */ $((r, t, e) => {
543
- if (!E)
544
- throw new Error("GitGraph config not found");
545
- const a = r.append("g").attr("class", "commit-bullets"), c = r.append("g").attr("class", "commit-labels");
546
- let i = f === "TB" || f === "BT" ? H : 0;
547
- const d = [...t.keys()], h = (E == null ? void 0 : E.parallelCommits) ?? !1, l = /* @__PURE__ */ $((n, u) => {
548
- var m, g;
549
- const p = (m = t.get(n)) == null ? void 0 : m.seq, y = (g = t.get(u)) == null ? void 0 : g.seq;
550
- return p !== void 0 && y !== void 0 ? p - y : 0;
551
- }, "sortKeys");
552
- let o = d.sort(l);
553
- f === "BT" && (h && Nt(o, t, i), o = o.reverse()), o.forEach((n) => {
554
- var u;
555
- const m = t.get(n);
556
- if (!m)
557
- throw new Error(`Commit not found for key ${n}`);
558
- h && (i = Jt(m, f, i, C));
559
- const g = Qt(m, i, h);
560
- if (e) {
561
- const p = Ut(m), y = m.customType ?? m.type, L = ((u = v.get(m.branch)) == null ? void 0 : u.index) ?? 0;
562
- Ft(a, m, g, p, L, y), Yt(c, m, g, i), Vt(c, m, g, i);
563
- }
564
- f === "TB" || f === "BT" ? C.set(m.id, { x: g.x, y: g.posWithOffset }) : C.set(m.id, { x: g.posWithOffset, y: g.y }), i = f === "BT" && h ? i + I : i + I + A, i > R && (R = i);
565
- });
566
- }, "drawCommits"), Xt = /* @__PURE__ */ $((r, t, e, a, c) => {
567
- const i = (f === "TB" || f === "BT" ? e.x < a.x : e.y < a.y) ? t.branch : r.branch, d = /* @__PURE__ */ $((l) => l.branch === i, "isOnBranchToGetCurve"), h = /* @__PURE__ */ $((l) => l.seq > r.seq && l.seq < t.seq, "isBetweenCommits");
568
- return [...c.values()].some((l) => h(l) && d(l));
569
- }, "shouldRerouteArrow"), z = /* @__PURE__ */ $((r, t, e = 0) => {
570
- const a = r + Math.abs(r - t) / 2;
571
- if (e > 5)
572
- return a;
573
- if (D.every((i) => Math.abs(i - a) >= 10))
574
- return D.push(a), a;
575
- const c = Math.abs(r - t);
576
- return z(r, t - c / 5, e + 1);
577
- }, "findLane"), Zt = /* @__PURE__ */ $((r, t, e, a) => {
578
- var c, i, d, h, l;
579
- const o = C.get(t.id), n = C.get(e.id);
580
- if (o === void 0 || n === void 0)
581
- throw new Error(`Commit positions not found for commits ${t.id} and ${e.id}`);
582
- const u = Xt(t, e, o, n, a);
583
- let m = "", g = "", p = 0, y = 0, L = (c = v.get(e.branch)) == null ? void 0 : c.index;
584
- e.type === x.MERGE && t.id !== e.parents[0] && (L = (i = v.get(t.branch)) == null ? void 0 : i.index);
585
- let b;
586
- if (u) {
587
- m = "A 10 10, 0, 0, 0,", g = "A 10 10, 0, 0, 1,", p = 10, y = 10;
588
- const P = o.y < n.y ? z(o.y, n.y) : z(n.y, o.y), B = o.x < n.x ? z(o.x, n.x) : z(n.x, o.x);
589
- f === "TB" ? o.x < n.x ? b = `M ${o.x} ${o.y} L ${B - p} ${o.y} ${g} ${B} ${o.y + y} L ${B} ${n.y - p} ${m} ${B + y} ${n.y} L ${n.x} ${n.y}` : (L = (d = v.get(t.branch)) == null ? void 0 : d.index, b = `M ${o.x} ${o.y} L ${B + p} ${o.y} ${m} ${B} ${o.y + y} L ${B} ${n.y - p} ${g} ${B - y} ${n.y} L ${n.x} ${n.y}`) : f === "BT" ? o.x < n.x ? b = `M ${o.x} ${o.y} L ${B - p} ${o.y} ${m} ${B} ${o.y - y} L ${B} ${n.y + p} ${g} ${B + y} ${n.y} L ${n.x} ${n.y}` : (L = (h = v.get(t.branch)) == null ? void 0 : h.index, b = `M ${o.x} ${o.y} L ${B + p} ${o.y} ${g} ${B} ${o.y - y} L ${B} ${n.y + p} ${m} ${B - y} ${n.y} L ${n.x} ${n.y}`) : o.y < n.y ? b = `M ${o.x} ${o.y} L ${o.x} ${P - p} ${m} ${o.x + y} ${P} L ${n.x - p} ${P} ${g} ${n.x} ${P + y} L ${n.x} ${n.y}` : (L = (l = v.get(t.branch)) == null ? void 0 : l.index, b = `M ${o.x} ${o.y} L ${o.x} ${P + p} ${g} ${o.x + y} ${P} L ${n.x - p} ${P} ${m} ${n.x} ${P - y} L ${n.x} ${n.y}`);
590
- } else
591
- m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", p = 20, y = 20, f === "TB" ? (o.x < n.x && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y - p} ${m} ${o.x + y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${g} ${n.x} ${o.y + y} L ${n.x} ${n.y}`), o.x > n.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", p = 20, y = 20, e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y - p} ${g} ${o.x - y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x + p} ${o.y} ${m} ${n.x} ${o.y + y} L ${n.x} ${n.y}`), o.x === n.x && (b = `M ${o.x} ${o.y} L ${n.x} ${n.y}`)) : f === "BT" ? (o.x < n.x && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y + p} ${g} ${o.x + y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${m} ${n.x} ${o.y - y} L ${n.x} ${n.y}`), o.x > n.x && (m = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", p = 20, y = 20, e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${o.x} ${n.y + p} ${m} ${o.x - y} ${n.y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${m} ${n.x} ${o.y - y} L ${n.x} ${n.y}`), o.x === n.x && (b = `M ${o.x} ${o.y} L ${n.x} ${n.y}`)) : (o.y < n.y && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${g} ${n.x} ${o.y + y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${o.x} ${n.y - p} ${m} ${o.x + y} ${n.y} L ${n.x} ${n.y}`), o.y > n.y && (e.type === x.MERGE && t.id !== e.parents[0] ? b = `M ${o.x} ${o.y} L ${n.x - p} ${o.y} ${m} ${n.x} ${o.y - y} L ${n.x} ${n.y}` : b = `M ${o.x} ${o.y} L ${o.x} ${n.y + p} ${g} ${o.x + y} ${n.y} L ${n.x} ${n.y}`), o.y === n.y && (b = `M ${o.x} ${o.y} L ${n.x} ${n.y}`));
592
- if (b === void 0)
593
- throw new Error("Line definition not found");
594
- r.append("path").attr("d", b).attr("class", "arrow arrow" + L % G);
595
- }, "drawArrow"), tr = /* @__PURE__ */ $((r, t) => {
596
- const e = r.append("g").attr("class", "commit-arrows");
597
- [...t.keys()].forEach((a) => {
598
- const c = t.get(a);
599
- c.parents && c.parents.length > 0 && c.parents.forEach((i) => {
600
- Zt(e, t.get(i), c, t);
601
- });
602
- });
603
- }, "drawArrows"), rr = /* @__PURE__ */ $((r, t) => {
604
- const e = r.append("g");
605
- t.forEach((a, c) => {
606
- var i;
607
- const d = c % G, h = (i = v.get(a.name)) == null ? void 0 : i.pos;
608
- if (h === void 0)
609
- throw new Error(`Position not found for branch ${a.name}`);
610
- const l = e.append("line");
611
- l.attr("x1", 0), l.attr("y1", h), l.attr("x2", R), l.attr("y2", h), l.attr("class", "branch branch" + d), f === "TB" ? (l.attr("y1", H), l.attr("x1", h), l.attr("y2", R), l.attr("x2", h)) : f === "BT" && (l.attr("y1", R), l.attr("x1", h), l.attr("y2", H), l.attr("x2", h)), D.push(h);
612
- const o = a.name, n = U(o), u = e.insert("rect"), m = e.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + d);
613
- m.node().appendChild(n);
614
- const g = n.getBBox();
615
- u.attr("class", "branchLabelBkg label" + d).attr("rx", 4).attr("ry", 4).attr("x", -g.width - 4 - ((E == null ? void 0 : E.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -g.height / 2 + 8).attr("width", g.width + 18).attr("height", g.height + 4), m.attr(
616
- "transform",
617
- "translate(" + (-g.width - 14 - ((E == null ? void 0 : E.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (h - g.height / 2 - 1) + ")"
618
- ), f === "TB" ? (u.attr("x", h - g.width / 2 - 10).attr("y", 0), m.attr("transform", "translate(" + (h - g.width / 2 - 5) + ", 0)")) : f === "BT" ? (u.attr("x", h - g.width / 2 - 10).attr("y", R), m.attr("transform", "translate(" + (h - g.width / 2 - 5) + ", " + R + ")")) : u.attr("transform", "translate(-19, " + (h - g.height / 2) + ")");
619
- });
620
- }, "drawBranches"), er = /* @__PURE__ */ $(function(r, t, e, a, c) {
621
- return v.set(r, { pos: t, index: e }), t += 50 + (c ? 40 : 0) + (f === "TB" || f === "BT" ? a.width / 2 : 0), t;
622
- }, "setBranchPosition"), or = /* @__PURE__ */ $(function(r, t, e, a) {
623
- if (Dt(), w.debug("in gitgraph renderer", r + `
624
- `, "id:", t, e), !E)
625
- throw new Error("GitGraph config not found");
626
- const c = E.rotateCommitLabel ?? !1, i = a.db;
627
- q = i.getCommits();
628
- const d = i.getBranchesAsObjArray();
629
- f = i.getDirection();
630
- const h = ct(`[id="${t}"]`);
631
- let l = 0;
632
- d.forEach((o, n) => {
633
- var u;
634
- const m = U(o.name), g = h.append("g"), p = g.insert("g").attr("class", "branchLabel"), y = p.insert("g").attr("class", "label branch-label");
635
- (u = y.node()) == null || u.appendChild(m);
636
- const L = m.getBBox();
637
- l = er(o.name, l, n, L, c), y.remove(), p.remove(), g.remove();
638
- }), j(h, q, !1), E.showBranches && rr(h, d), tr(h, q), j(h, q, !0), it.insertTitle(
639
- h,
640
- "gitTitleText",
641
- E.titleTopMargin ?? 0,
642
- i.getDiagramTitle()
643
- ), st(
644
- void 0,
645
- h,
646
- E.diagramPadding,
647
- E.useMaxWidth
648
- );
649
- }, "draw"), nr = {
650
- draw: or
651
- }, ar = /* @__PURE__ */ $((r) => `
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
- (t) => `
662
- .branch-label${t} { fill: ${r["gitBranchLabel" + t]}; }
663
- .commit${t} { stroke: ${r["git" + t]}; fill: ${r["git" + t]}; }
664
- .commit-highlight${t} { stroke: ${r["gitInv" + t]}; fill: ${r["gitInv" + t]}; }
665
- .label${t} { fill: ${r["git" + t]}; }
666
- .arrow${t} { stroke: ${r["git" + t]}; }
667
- `
668
- ).join(`
669
- `)}
670
-
671
- .branch {
672
- stroke-width: 1;
673
- stroke: ${r.lineColor};
674
- stroke-dasharray: 2;
675
- }
676
- .commit-label { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelColor};}
677
- .commit-label-bkg { font-size: ${r.commitLabelFontSize}; fill: ${r.commitLabelBackground}; opacity: 0.5; }
678
- .tag-label { font-size: ${r.tagLabelFontSize}; fill: ${r.tagLabelColor};}
679
- .tag-label-bkg { fill: ${r.tagLabelBackground}; stroke: ${r.tagLabelBorder}; }
680
- .tag-hole { fill: ${r.textColor}; }
681
-
682
- .commit-merge {
683
- stroke: ${r.primaryColor};
684
- fill: ${r.primaryColor};
685
- }
686
- .commit-reverse {
687
- stroke: ${r.primaryColor};
688
- fill: ${r.primaryColor};
689
- stroke-width: 3;
690
- }
691
- .commit-highlight-outer {
692
- }
693
- .commit-highlight-inner {
694
- stroke: ${r.primaryColor};
695
- fill: ${r.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: ${r.textColor};
703
- }
704
- `, "getStyles"), cr = ar, mr = {
705
- parser: Ht,
706
- db: V,
707
- renderer: nr,
708
- styles: cr
709
- };
710
- export {
711
- mr as diagram
712
- };