@omg-dev/app 0.5.1 → 0.6.1

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 (113) hide show
  1. package/dist-lib/{ChangelogPage-BzsTWlhq.js → ChangelogPage-Cjj_DiYL.js} +33 -1
  2. package/dist-lib/{File-B-qYa2zY.js → File-DQRr5F_e.js} +1761 -1826
  3. package/dist-lib/FileEditor-BrI3dfcp.js +6895 -0
  4. package/dist-lib/FileTreePane-J8P-OiHb.js +8413 -0
  5. package/dist-lib/{FileViewer-Clmf04v1.js → FileViewer-DRrfus7c.js} +1 -1
  6. package/dist-lib/{SessionFilesPanel-K4lGGdJ4.js → SessionFilesPanel-DxVJ43fE.js} +69 -69
  7. package/dist-lib/{TermView-CWr-zJmM.js → TermView-B4V-DyD-.js} +521 -530
  8. package/dist-lib/{abnfDiagram-VRR7QNED-Chn1Z_p9.js → abnfDiagram-VRR7QNED-CiXfOnAu.js} +4 -4
  9. package/dist-lib/{arc-B652oHQ-.js → arc-QOMNKQA5.js} +1 -1
  10. package/dist-lib/{architectureDiagram-ZJ3FMSHR-CMatArpz.js → architectureDiagram-ZJ3FMSHR-BcFBTmfD.js} +2059 -2064
  11. package/dist-lib/{blockDiagram-677ZJIJ3-CEOPfI9A.js → blockDiagram-677ZJIJ3-Qj8-RIV3.js} +920 -925
  12. package/dist-lib/{c4Diagram-LMCZKHZV-DcUHrESL.js → c4Diagram-LMCZKHZV-BpinEmj4.js} +598 -593
  13. package/dist-lib/{channel-B5lJFbed.js → channel-D6YHMmF7.js} +1 -1
  14. package/dist-lib/{chat-engine-P0yDhFOX.js → chat-engine-CUiDTHFP.js} +1173 -1218
  15. package/dist-lib/chunk-2Q5K7J3B-CFSi414U.js +18 -0
  16. package/dist-lib/{chunk-32BRIVSS-IYmNSvH8.js → chunk-32BRIVSS-DvywQiCk.js} +1 -1
  17. package/dist-lib/{chunk-5VM5RSS4-DO2g-xIj.js → chunk-5VM5RSS4-xd6XuI9Q.js} +1 -1
  18. package/dist-lib/{chunk-BO2N2NFS-kYiI5SD9.js → chunk-BO2N2NFS-BbJdm-59.js} +4892 -4903
  19. package/dist-lib/{chunk-EX3LRPZG-N96wfks9.js → chunk-EX3LRPZG-BLDKx-Yg.js} +507 -514
  20. package/dist-lib/chunk-JWPE2WC7-DnwG7Xzp.js +8 -0
  21. package/dist-lib/chunk-MOJQB5TN-BrENeFT5.js +670 -0
  22. package/dist-lib/chunk-RYQCIY6F-I-J4fVFd.js +313 -0
  23. package/dist-lib/{chunk-V7JOEXUC-DQwf2vkP.js → chunk-V7JOEXUC-Bkakcs1-.js} +458 -453
  24. package/dist-lib/chunk-VR4S4FIN-BDq3jZ0m.js +19 -0
  25. package/dist-lib/{chunk-XXDRQBXY-Ccv4aRcn.js → chunk-XXDRQBXY-DRKeYnrF.js} +1 -1
  26. package/dist-lib/{classDiagram-v2-EOCWNBFH-DOn-rhuL.js → classDiagram-OUVF2IWQ-DISUfvR5.js} +2 -2
  27. package/dist-lib/{classDiagram-OUVF2IWQ-DOn-rhuL.js → classDiagram-v2-EOCWNBFH-DISUfvR5.js} +2 -2
  28. package/dist-lib/{coding-agents-page-DCafIpWL.js → coding-agents-page-DtxZ0nbQ.js} +152 -131
  29. package/dist-lib/computer-page-DIJeFOZz.js +8860 -0
  30. package/dist-lib/{cose-bilkent-JH36ORCC-C-tACTrT.js → cose-bilkent-JH36ORCC-DCfmoChv.js} +281 -281
  31. package/dist-lib/{create-BrnHvSDE.js → create-CBk9uwJH.js} +2 -2
  32. package/dist-lib/cynefin-VYW2F7L2-XAY3mHv8.js +24430 -0
  33. package/dist-lib/{cynefinDiagram-TSTJHNR4-Be7CamD2.js → cynefinDiagram-TSTJHNR4-CrgvPEr1.js} +3 -3
  34. package/dist-lib/{cytoscape.esm-B0ledd6M.js → cytoscape.esm-BB6Ga9He.js} +3 -3
  35. package/dist-lib/dagre-VKFMJZFB-CE5k06mJ.js +343 -0
  36. package/dist-lib/{diagram-FQU43EPY-Jg12ow4Z.js → diagram-FQU43EPY-gOcCiJEN.js} +136 -139
  37. package/dist-lib/diagram-G47NLZAW-BVJLfRsd.js +531 -0
  38. package/dist-lib/diagram-NH7WQ7WH-u6QnHasL.js +145 -0
  39. package/dist-lib/diagram-OA4YK3LP-D4Kcl3uM.js +350 -0
  40. package/dist-lib/{diagram-WEI45ONY-D1kKPOc_.js → diagram-WEI45ONY-6a__oIb0.js} +38 -42
  41. package/dist-lib/{ebnfDiagram-CCIWWBDH-BhQWrGMc.js → ebnfDiagram-CCIWWBDH-PXSrB6lG.js} +4 -4
  42. package/dist-lib/{embedded-CLYU5z7h.js → embedded-PUsgcSTE.js} +10592 -10725
  43. package/dist-lib/{engine-compile-BeDRSL6Y.js → engine-compile-D_stzVMa.js} +2939 -2991
  44. package/dist-lib/{erDiagram-Q63AITRT-D2q6Nmwa.js → erDiagram-Q63AITRT-BbsttUCs.js} +286 -284
  45. package/dist-lib/flowDiagram-23GEKE2U-CX5x3zVA.js +1641 -0
  46. package/dist-lib/{ganttDiagram-NO4QXBWP-C_Lj-cJB.js → ganttDiagram-NO4QXBWP-Bq0aSPs8.js} +2 -2
  47. package/dist-lib/gitGraphDiagram-IHSO6WYX-BjAezjIv.js +815 -0
  48. package/dist-lib/{graph-B68L3K2T.js → graph-DAHC4kPm.js} +2 -2
  49. package/dist-lib/{highlighted-body-OFNGDK62-C2DGVKV8.js → highlighted-body-OFNGDK62-DWhG_ijx.js} +1 -1
  50. package/dist-lib/index-B0neMIbR.js +16520 -0
  51. package/dist-lib/index-BBC0E3Qg.js +4994 -0
  52. package/dist-lib/{index-Dtkd4mEk.js → index-CE7H8LiZ.js} +2 -2
  53. package/dist-lib/{index-DWkBvb-9.js → index-FgVvPpIY.js} +2 -2
  54. package/dist-lib/index.js +1 -1
  55. package/dist-lib/{infoDiagram-FWYZ7A6U-BbUkT0KS.js → infoDiagram-FWYZ7A6U-Bo_FNR91.js} +2 -2
  56. package/dist-lib/ishikawaDiagram-FXEZZL3T-C5bGD-Eb.js +624 -0
  57. package/dist-lib/{journeyDiagram-5HDEW3XC-CgykmVSC.js → journeyDiagram-5HDEW3XC-C8qM7SxF.js} +4 -4
  58. package/dist-lib/kanban-definition-HUTT4EX6-C-EK5Puz.js +724 -0
  59. package/dist-lib/{katex-jHfnQmlp.js → katex-DoRnZ_sp.js} +1 -1
  60. package/dist-lib/{layout-BGrtsiRL.js → layout-DBbo_M5I.js} +2 -2
  61. package/dist-lib/{linear-B5ZSwawJ.js → linear-zGzX0-I0.js} +1 -1
  62. package/dist-lib/{map-hbfFlSln.js → map-DRdzG8Ho.js} +1 -1
  63. package/dist-lib/mermaid-GHXKKRXX-hOE9C3qW.js +4 -0
  64. package/dist-lib/{mindmap-definition-LN4V7U3C-CfhfeEht.js → mindmap-definition-LN4V7U3C-DlVCRx6k.js} +310 -311
  65. package/dist-lib/{pegDiagram-2B236MQR-CYDAJHPF.js → pegDiagram-2B236MQR-DrKNikeG.js} +4 -4
  66. package/dist-lib/{pieDiagram-ENE6RG2P-udKxQm4p.js → pieDiagram-ENE6RG2P-Fm_jc0HL.js} +83 -84
  67. package/dist-lib/quadrantDiagram-ABIIQ3AL-zDRY0VtB.js +1029 -0
  68. package/dist-lib/{railroadDiagram-RFXS5EU6-q0Svkmuy.js → railroadDiagram-RFXS5EU6-BQuFX39y.js} +4 -4
  69. package/dist-lib/{requirementDiagram-TGXJPOKE-tNxRI1gc.js → requirementDiagram-TGXJPOKE-BWwBQZXn.js} +269 -268
  70. package/dist-lib/{resume-session-sheet-CHwpwguS.js → resume-session-sheet-DTe_2QtJ.js} +2 -3
  71. package/dist-lib/sankeyDiagram-HTMAVEWB-BjRyuB6L.js +859 -0
  72. package/dist-lib/{sequenceDiagram-DBY2YBRQ-Dvl2_CXL.js → sequenceDiagram-DBY2YBRQ-69pcw_2M.js} +892 -899
  73. package/dist-lib/{session-token-usage-BUz6b-IB.js → session-token-usage-DY4vFlfs.js} +82 -83
  74. package/dist-lib/{shadow-text-size-CBCTdbYU.js → shadow-text-size-smWA4wIU.js} +1 -2
  75. package/dist-lib/{shipped-page-CXy85bsL.js → shipped-page-B-ruG8li.js} +233 -236
  76. package/dist-lib/sizeCapture-X5ZJPWSS-DqkV8s1N.js +46 -0
  77. package/dist-lib/{stateDiagram-2N3HPSRC-CnWB7HvU.js → stateDiagram-2N3HPSRC-0vE3REl_.js} +4 -4
  78. package/dist-lib/{stateDiagram-v2-6OUMAXLB-DnZ0UI2p.js → stateDiagram-v2-6OUMAXLB-u_56Obsh.js} +2 -2
  79. package/dist-lib/{streamdown-response-CUB9sK6V.js → streamdown-response-BQy3geXs.js} +290 -297
  80. package/dist-lib/styles.css +1 -1
  81. package/dist-lib/swimlanes-5IMT3BWC-H0raIBd1.js +5332 -0
  82. package/dist-lib/{swimlanesDiagram-G3AALYLV-CKyOeqF_.js → swimlanesDiagram-G3AALYLV-By52HaDu.js} +2 -2
  83. package/dist-lib/timeline-definition-FHXFAJF6-h1LLYUQk.js +1055 -0
  84. package/dist-lib/vennDiagram-L72KCM5P-B4wDw_Kh.js +1578 -0
  85. package/dist-lib/wardleyDiagram-EHGQE667-DLMBGiwD.js +678 -0
  86. package/dist-lib/{xychartDiagram-FW5EYKEG-m3s7caPv.js → xychartDiagram-FW5EYKEG-BHvf5Noj.js} +526 -496
  87. package/package.json +4 -3
  88. package/dist-lib/FileEditor-BIz0qCyW.js +0 -6892
  89. package/dist-lib/FileTreePane-BG2k7gTc.js +0 -8422
  90. package/dist-lib/chunk-2Q5K7J3B-Ex8Ly28R.js +0 -15
  91. package/dist-lib/chunk-JWPE2WC7-DFPBClX_.js +0 -9
  92. package/dist-lib/chunk-MOJQB5TN-dusfI9ob.js +0 -664
  93. package/dist-lib/chunk-RYQCIY6F-fkeERzIG.js +0 -315
  94. package/dist-lib/chunk-VR4S4FIN-hOZG7eF3.js +0 -20
  95. package/dist-lib/cynefin-VYW2F7L2-DQXPWaog.js +0 -23853
  96. package/dist-lib/dagre-VKFMJZFB-BhCjK7XQ.js +0 -346
  97. package/dist-lib/diagram-G47NLZAW-C3_z2t6T.js +0 -530
  98. package/dist-lib/diagram-NH7WQ7WH-DUdK08IT.js +0 -143
  99. package/dist-lib/diagram-OA4YK3LP-TUUyRYY3.js +0 -353
  100. package/dist-lib/flowDiagram-23GEKE2U-DU3S3biU.js +0 -1645
  101. package/dist-lib/gitGraphDiagram-IHSO6WYX-CvGu0XAR.js +0 -828
  102. package/dist-lib/index-DcwavxA1.js +0 -5062
  103. package/dist-lib/index-JkCQXUYs.js +0 -16566
  104. package/dist-lib/ishikawaDiagram-FXEZZL3T-D_Y6Tuyb.js +0 -622
  105. package/dist-lib/kanban-definition-HUTT4EX6-CPFLTskY.js +0 -726
  106. package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +0 -4
  107. package/dist-lib/quadrantDiagram-ABIIQ3AL-BmDmLczk.js +0 -1025
  108. package/dist-lib/sankeyDiagram-HTMAVEWB-B9Bl7f2P.js +0 -847
  109. package/dist-lib/sizeCapture-X5ZJPWSS-B1EeO3N9.js +0 -47
  110. package/dist-lib/swimlanes-5IMT3BWC-CvqDJcS9.js +0 -5353
  111. package/dist-lib/timeline-definition-FHXFAJF6-b15X0Oru.js +0 -1066
  112. package/dist-lib/vennDiagram-L72KCM5P-C4lh5m77.js +0 -1585
  113. package/dist-lib/wardleyDiagram-EHGQE667-Cev6fT_D.js +0 -684
@@ -1,828 +0,0 @@
1
- import { I as he } from "./chunk-2Q5K7J3B-Ex8Ly28R.js";
2
- import { p as $e } from "./chunk-JWPE2WC7-DFPBClX_.js";
3
- import { p as fe, o as ge, s as ue, g as ye, a as xe, b as me, _ as $, z as Q, l as k, d as pe, c as z, y as be, A as we, q as ke, k as L, B as ve, D as Ee, E as Be } from "./index-JkCQXUYs.js";
4
- import { p as Ce } from "./cynefin-VYW2F7L2-DQXPWaog.js";
5
- var p = {
6
- NORMAL: 0,
7
- REVERSE: 1,
8
- HIGHLIGHT: 2,
9
- MERGE: 3,
10
- CHERRY_PICK: 4
11
- }, Te = Ee.gitGraph, D = /* @__PURE__ */ $(() => ve({
12
- ...Te,
13
- ...Q().gitGraph
14
- }), "getConfig"), i = new he(() => {
15
- const e = D(), r = e.mainBranchName, t = e.mainBranchOrder;
16
- return {
17
- mainBranchName: r,
18
- commits: /* @__PURE__ */ new Map(),
19
- head: null,
20
- branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: t }]]),
21
- branches: /* @__PURE__ */ new Map([[r, null]]),
22
- currBranch: r,
23
- direction: "LR",
24
- seq: 0,
25
- options: {}
26
- };
27
- });
28
- function K() {
29
- return Be({ length: 7 });
30
- }
31
- $(K, "getID");
32
- function ae(e, r) {
33
- const t = /* @__PURE__ */ Object.create(null);
34
- return e.reduce((o, s) => {
35
- const d = r(s);
36
- return t[d] || (t[d] = !0, o.push(s)), o;
37
- }, []);
38
- }
39
- $(ae, "uniqBy");
40
- var Le = /* @__PURE__ */ $(function(e) {
41
- i.records.direction = e;
42
- }, "setDirection"), Me = /* @__PURE__ */ $(function(e) {
43
- k.debug("options str", e), e = e == null ? void 0 : e.trim(), e = e || "{}";
44
- try {
45
- i.records.options = JSON.parse(e);
46
- } catch (r) {
47
- k.error("error while parsing gitGraph options", r.message);
48
- }
49
- }, "setOptions"), Re = /* @__PURE__ */ $(function() {
50
- return i.records.options;
51
- }, "getOptions"), Ie = /* @__PURE__ */ $(function(e) {
52
- let r = e.msg, t = e.id;
53
- const o = e.type;
54
- let s = e.tags;
55
- k.info("commit", r, t, o, s), k.debug("Entering commit:", r, t, o, s);
56
- const d = D();
57
- t = L.sanitizeText(t, d), r = L.sanitizeText(r, d), s = s == null ? void 0 : s.map((a) => L.sanitizeText(a, d));
58
- const n = {
59
- id: t || i.records.seq + "-" + K(),
60
- message: r,
61
- seq: i.records.seq++,
62
- type: o ?? p.NORMAL,
63
- tags: s ?? [],
64
- parents: i.records.head == null ? [] : [i.records.head.id],
65
- branch: i.records.currBranch
66
- };
67
- i.records.head = n, k.info("main branch", d.mainBranchName), i.records.commits.has(n.id) && k.warn(`Commit ID ${n.id} already exists`), i.records.commits.set(n.id, n), i.records.branches.set(i.records.currBranch, n.id), k.debug("in pushCommit " + n.id);
68
- }, "commit"), Oe = /* @__PURE__ */ $(function(e) {
69
- let r = e.name;
70
- const t = e.order;
71
- if (r = L.sanitizeText(r, D()), 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: t }), ne(r), k.debug("in createBranch");
76
- }, "branch"), _e = /* @__PURE__ */ $((e) => {
77
- let r = e.branch, t = e.id;
78
- const o = e.type, s = e.tags, d = D();
79
- r = L.sanitizeText(r, d), t && (t = L.sanitizeText(t, d));
80
- const n = i.records.branches.get(i.records.currBranch), a = i.records.branches.get(r), l = n ? i.records.commits.get(n) : void 0, h = a ? i.records.commits.get(a) : void 0;
81
- if (l && h && l.branch === r)
82
- throw new Error(`Cannot merge branch '${r}' into itself.`);
83
- if (i.records.currBranch === r) {
84
- const c = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
85
- throw c.hash = {
86
- text: `merge ${r}`,
87
- token: `merge ${r}`,
88
- expected: ["branch abc"]
89
- }, c;
90
- }
91
- if (l === void 0 || !l) {
92
- const c = new Error(
93
- `Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`
94
- );
95
- throw c.hash = {
96
- text: `merge ${r}`,
97
- token: `merge ${r}`,
98
- expected: ["commit"]
99
- }, c;
100
- }
101
- if (!i.records.branches.has(r)) {
102
- const c = new Error(
103
- 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
104
- );
105
- throw c.hash = {
106
- text: `merge ${r}`,
107
- token: `merge ${r}`,
108
- expected: [`branch ${r}`]
109
- }, c;
110
- }
111
- if (h === void 0 || !h) {
112
- const c = new Error(
113
- 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
114
- );
115
- throw c.hash = {
116
- text: `merge ${r}`,
117
- token: `merge ${r}`,
118
- expected: ['"commit"']
119
- }, c;
120
- }
121
- if (l === h) {
122
- const c = new Error('Incorrect usage of "merge". Both branches have same head');
123
- throw c.hash = {
124
- text: `merge ${r}`,
125
- token: `merge ${r}`,
126
- expected: ["branch abc"]
127
- }, c;
128
- }
129
- if (t && i.records.commits.has(t)) {
130
- const c = new Error(
131
- 'Incorrect usage of "merge". Commit with id:' + t + " already exists, use different custom id"
132
- );
133
- throw c.hash = {
134
- text: `merge ${r} ${t} ${o} ${s == null ? void 0 : s.join(" ")}`,
135
- token: `merge ${r} ${t} ${o} ${s == null ? void 0 : s.join(" ")}`,
136
- expected: [
137
- `merge ${r} ${t}_UNIQUE ${o} ${s == null ? void 0 : s.join(" ")}`
138
- ]
139
- }, c;
140
- }
141
- const g = a || "", f = {
142
- id: t || `${i.records.seq}-${K()}`,
143
- message: `merged branch ${r} into ${i.records.currBranch}`,
144
- seq: i.records.seq++,
145
- parents: i.records.head == null ? [] : [i.records.head.id, g],
146
- branch: i.records.currBranch,
147
- type: p.MERGE,
148
- customType: o,
149
- customId: !!t,
150
- tags: s ?? []
151
- };
152
- i.records.head = f, i.records.commits.set(f.id, f), i.records.branches.set(i.records.currBranch, f.id), k.debug(i.records.branches), k.debug("in mergeBranch");
153
- }, "merge"), Ge = /* @__PURE__ */ $(function(e) {
154
- let r = e.id, t = e.targetId, o = e.tags, s = e.parent;
155
- k.debug("Entering cherryPick:", r, t, o);
156
- const d = D();
157
- if (r = L.sanitizeText(r, d), t = L.sanitizeText(t, d), o = o == null ? void 0 : o.map((l) => L.sanitizeText(l, d)), s = L.sanitizeText(s, d), !r || !i.records.commits.has(r)) {
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 ${r} ${t}`,
163
- token: `cherryPick ${r} ${t}`,
164
- expected: ["cherry-pick abc"]
165
- }, l;
166
- }
167
- const n = i.records.commits.get(r);
168
- if (n === void 0 || !n)
169
- throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
170
- if (s && !(Array.isArray(n.parents) && n.parents.includes(s)))
171
- throw new Error(
172
- "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
173
- );
174
- const a = n.branch;
175
- if (n.type === p.MERGE && !s)
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 (!t || !i.records.commits.has(t)) {
180
- if (a === i.records.currBranch) {
181
- const f = new Error(
182
- 'Incorrect usage of "cherryPick". Source commit is already on current branch'
183
- );
184
- throw f.hash = {
185
- text: `cherryPick ${r} ${t}`,
186
- token: `cherryPick ${r} ${t}`,
187
- expected: ["cherry-pick abc"]
188
- }, f;
189
- }
190
- const l = i.records.branches.get(i.records.currBranch);
191
- if (l === void 0 || !l) {
192
- const f = new Error(
193
- `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
194
- );
195
- throw f.hash = {
196
- text: `cherryPick ${r} ${t}`,
197
- token: `cherryPick ${r} ${t}`,
198
- expected: ["cherry-pick abc"]
199
- }, f;
200
- }
201
- const h = i.records.commits.get(l);
202
- if (h === void 0 || !h) {
203
- const f = new Error(
204
- `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
205
- );
206
- throw f.hash = {
207
- text: `cherryPick ${r} ${t}`,
208
- token: `cherryPick ${r} ${t}`,
209
- expected: ["cherry-pick abc"]
210
- }, f;
211
- }
212
- const g = {
213
- id: i.records.seq + "-" + K(),
214
- message: `cherry-picked ${n == null ? void 0 : n.message} into ${i.records.currBranch}`,
215
- seq: i.records.seq++,
216
- parents: i.records.head == null ? [] : [i.records.head.id, n.id],
217
- branch: i.records.currBranch,
218
- type: p.CHERRY_PICK,
219
- tags: o ? o.filter(Boolean) : [
220
- `cherry-pick:${n.id}${n.type === p.MERGE ? `|parent:${s}` : ""}`
221
- ]
222
- };
223
- i.records.head = g, i.records.commits.set(g.id, g), i.records.branches.set(i.records.currBranch, g.id), k.debug(i.records.branches), k.debug("in cherryPick");
224
- }
225
- }, "cherryPick"), ne = /* @__PURE__ */ $(function(e) {
226
- if (e = L.sanitizeText(e, D()), i.records.branches.has(e)) {
227
- i.records.currBranch = e;
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 ${e}")`
233
- );
234
- throw r.hash = {
235
- text: `checkout ${e}`,
236
- token: `checkout ${e}`,
237
- expected: [`branch ${e}`]
238
- }, r;
239
- }
240
- }, "checkout");
241
- function X(e, r, t) {
242
- const o = e.indexOf(r);
243
- o === -1 ? e.push(t) : e.splice(o, 1, t);
244
- }
245
- $(X, "upsert");
246
- function Z(e) {
247
- const r = e.reduce((s, d) => s.seq > d.seq ? s : d, e[0]);
248
- let t = "";
249
- e.forEach(function(s) {
250
- s === r ? t += " *" : t += " |";
251
- });
252
- const o = [t, r.id, r.seq];
253
- for (const s in i.records.branches)
254
- i.records.branches.get(s) === r.id && o.push(s);
255
- if (k.debug(o.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
256
- const s = i.records.commits.get(r.parents[0]);
257
- X(e, r, s), r.parents[1] && e.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 s = i.records.commits.get(r.parents[0]);
263
- X(e, r, s);
264
- }
265
- }
266
- e = ae(e, (s) => s.id), Z(e);
267
- }
268
- $(Z, "prettyPrintCommitHistory");
269
- var He = /* @__PURE__ */ $(function() {
270
- k.debug(i.records.commits);
271
- const e = se()[0];
272
- Z([e]);
273
- }, "prettyPrint"), Ae = /* @__PURE__ */ $(function() {
274
- i.reset(), ke();
275
- }, "clear"), Se = /* @__PURE__ */ $(function() {
276
- return [...i.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"), De = /* @__PURE__ */ $(function() {
281
- return i.records.branches;
282
- }, "getBranches"), qe = /* @__PURE__ */ $(function() {
283
- return i.records.commits;
284
- }, "getCommits"), se = /* @__PURE__ */ $(function() {
285
- const e = [...i.records.commits.values()];
286
- return e.forEach(function(r) {
287
- k.debug(r.id);
288
- }), e.sort((r, t) => r.seq - t.seq), e;
289
- }, "getCommitsArray"), Pe = /* @__PURE__ */ $(function() {
290
- return i.records.currBranch;
291
- }, "getCurrentBranch"), We = /* @__PURE__ */ $(function() {
292
- return i.records.direction;
293
- }, "getDirection"), Ne = /* @__PURE__ */ $(function() {
294
- return i.records.head;
295
- }, "getHead"), oe = {
296
- commitType: p,
297
- getConfig: D,
298
- setDirection: Le,
299
- setOptions: Me,
300
- getOptions: Re,
301
- commit: Ie,
302
- branch: Oe,
303
- merge: _e,
304
- cherryPick: Ge,
305
- checkout: ne,
306
- //reset,
307
- prettyPrint: He,
308
- clear: Ae,
309
- getBranchesAsObjArray: Se,
310
- getBranches: De,
311
- getCommits: qe,
312
- getCommitsArray: se,
313
- getCurrentBranch: Pe,
314
- getDirection: We,
315
- getHead: Ne,
316
- setAccTitle: me,
317
- getAccTitle: xe,
318
- getAccDescription: ye,
319
- setAccDescription: ue,
320
- setDiagramTitle: ge,
321
- getDiagramTitle: fe
322
- }, Fe = /* @__PURE__ */ $((e, r) => {
323
- $e(e, r), e.dir && r.setDirection(e.dir);
324
- for (const t of e.statements)
325
- ze(t, r);
326
- }, "populate"), ze = /* @__PURE__ */ $((e, r) => {
327
- const o = {
328
- Commit: /* @__PURE__ */ $((s) => r.commit(Ye(s)), "Commit"),
329
- Branch: /* @__PURE__ */ $((s) => r.branch(je(s)), "Branch"),
330
- Merge: /* @__PURE__ */ $((s) => r.merge(Ue(s)), "Merge"),
331
- Checkout: /* @__PURE__ */ $((s) => r.checkout(Ke(s)), "Checkout"),
332
- CherryPicking: /* @__PURE__ */ $((s) => r.cherryPick(Ve(s)), "CherryPicking")
333
- }[e.$type];
334
- o ? o(e) : k.error(`Unknown statement type: ${e.$type}`);
335
- }, "parseStatement"), Ye = /* @__PURE__ */ $((e) => ({
336
- id: e.id,
337
- msg: e.message ?? "",
338
- type: e.type !== void 0 ? p[e.type] : p.NORMAL,
339
- tags: e.tags ?? void 0
340
- }), "parseCommit"), je = /* @__PURE__ */ $((e) => ({
341
- name: e.name,
342
- order: e.order ?? 0
343
- }), "parseBranch"), Ue = /* @__PURE__ */ $((e) => ({
344
- branch: e.branch,
345
- id: e.id ?? "",
346
- type: e.type !== void 0 ? p[e.type] : void 0,
347
- tags: e.tags ?? void 0
348
- }), "parseMerge"), Ke = /* @__PURE__ */ $((e) => e.branch, "parseCheckout"), Ve = /* @__PURE__ */ $((e) => {
349
- var t;
350
- return {
351
- id: e.id,
352
- targetId: "",
353
- tags: ((t = e.tags) == null ? void 0 : t.length) === 0 ? void 0 : e.tags,
354
- parent: e.parent
355
- };
356
- }, "parseCherryPicking"), Xe = {
357
- parse: /* @__PURE__ */ $(async (e) => {
358
- const r = await Ce("gitGraph", e);
359
- k.debug(r), Fe(r, oe);
360
- }, "parse")
361
- }, G = 10, H = 40, M = 4, I = 2, A = 8, V = /* @__PURE__ */ new Set(["redux", "redux-dark", "redux-color", "redux-dark-color"]), J = 12, ee = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Je = /* @__PURE__ */ new Set(["dark", "redux-dark", "redux-dark-color", "neo-dark"]), S = /* @__PURE__ */ $((e, r, t = !1) => t && e > 0 ? (e - 1) % (r - 1) + 1 : e % r, "calcColorIndex"), C = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), j = 30, N = /* @__PURE__ */ new Map(), U = [], O = 0, y = "LR", Qe = /* @__PURE__ */ $(() => {
362
- C.clear(), T.clear(), N.clear(), O = 0, U = [], y = "LR";
363
- }, "clear"), ce = /* @__PURE__ */ $((e) => {
364
- const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
365
- return (typeof e == "string" ? e.split(/\\n|\n|<br\s*\/?>/gi) : e).forEach((o) => {
366
- const s = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
367
- s.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), s.setAttribute("dy", "1em"), s.setAttribute("x", "0"), s.setAttribute("class", "row"), s.textContent = o.trim(), r.appendChild(s);
368
- }), r;
369
- }, "drawText"), ie = /* @__PURE__ */ $((e) => {
370
- let r, t, o;
371
- return y === "BT" ? (t = /* @__PURE__ */ $((s, d) => s <= d, "comparisonFunc"), o = 1 / 0) : (t = /* @__PURE__ */ $((s, d) => s >= d, "comparisonFunc"), o = 0), e.forEach((s) => {
372
- var n, a;
373
- const d = y === "TB" || y == "BT" ? (n = T.get(s)) == null ? void 0 : n.y : (a = T.get(s)) == null ? void 0 : a.x;
374
- d !== void 0 && t(d, o) && (r = s, o = d);
375
- }), r;
376
- }, "findClosestParent"), Ze = /* @__PURE__ */ $((e) => {
377
- let r = "", t = 1 / 0;
378
- return e.forEach((o) => {
379
- const s = T.get(o).y;
380
- s <= t && (r = o, t = s);
381
- }), r || void 0;
382
- }, "findClosestParentBT"), er = /* @__PURE__ */ $((e, r, t) => {
383
- let o = t, s = t;
384
- const d = [];
385
- e.forEach((n) => {
386
- const a = r.get(n);
387
- if (!a)
388
- throw new Error(`Commit not found for key ${n}`);
389
- a.parents.length ? (o = tr(a), s = Math.max(o, s)) : d.push(a), ar(a, o);
390
- }), o = s, d.forEach((n) => {
391
- nr(n, o, t);
392
- }), e.forEach((n) => {
393
- const a = r.get(n);
394
- if (a != null && a.parents.length) {
395
- const l = Ze(a.parents);
396
- o = T.get(l).y - H, o <= s && (s = o);
397
- const h = C.get(a.branch).pos, g = o - G;
398
- T.set(a.id, { x: h, y: g });
399
- }
400
- });
401
- }, "setParallelBTPos"), rr = /* @__PURE__ */ $((e) => {
402
- var o;
403
- const r = ie(e.parents.filter((s) => s !== null));
404
- if (!r)
405
- throw new Error(`Closest parent not found for commit ${e.id}`);
406
- const t = (o = T.get(r)) == null ? void 0 : o.y;
407
- if (t === void 0)
408
- throw new Error(`Closest parent position not found for commit ${e.id}`);
409
- return t;
410
- }, "findClosestParentPos"), tr = /* @__PURE__ */ $((e) => rr(e) + H, "calculateCommitPosition"), ar = /* @__PURE__ */ $((e, r) => {
411
- const t = C.get(e.branch);
412
- if (!t)
413
- throw new Error(`Branch not found for commit ${e.id}`);
414
- const o = t.pos, s = r + G;
415
- return T.set(e.id, { x: o, y: s }), { x: o, y: s };
416
- }, "setCommitPosition"), nr = /* @__PURE__ */ $((e, r, t) => {
417
- const o = C.get(e.branch);
418
- if (!o)
419
- throw new Error(`Branch not found for commit ${e.id}`);
420
- const s = r + t, d = o.pos;
421
- T.set(e.id, { x: d, y: s });
422
- }, "setRootPosition"), sr = /* @__PURE__ */ $((e, r, t, o, s, d) => {
423
- const { theme: n } = z(), a = V.has(n ?? ""), l = ee.has(n ?? ""), h = Je.has(n ?? "");
424
- if (d === p.HIGHLIGHT)
425
- e.append("rect").attr("x", t.x - 10 + (a ? 3 : 0)).attr("y", t.y - 10 + (a ? 3 : 0)).attr("width", a ? 14 : 20).attr("height", a ? 14 : 20).attr(
426
- "class",
427
- `commit ${r.id} commit-highlight${S(s, A, l)} ${o}-outer`
428
- ), e.append("rect").attr("x", t.x - 6 + (a ? 2 : 0)).attr("y", t.y - 6 + (a ? 2 : 0)).attr("width", a ? 8 : 12).attr("height", a ? 8 : 12).attr(
429
- "class",
430
- `commit ${r.id} commit${S(s, A, l)} ${o}-inner`
431
- );
432
- else if (d === p.CHERRY_PICK)
433
- e.append("circle").attr("cx", t.x).attr("cy", t.y).attr("r", a ? 7 : 10).attr("class", `commit ${r.id} ${o}`), e.append("circle").attr("cx", t.x - 3).attr("cy", t.y + 2).attr("r", a ? 2.5 : 2.75).attr("fill", h ? "#000000" : "#fff").attr("class", `commit ${r.id} ${o}`), e.append("circle").attr("cx", t.x + 3).attr("cy", t.y + 2).attr("r", a ? 2.5 : 2.75).attr("fill", h ? "#000000" : "#fff").attr("class", `commit ${r.id} ${o}`), e.append("line").attr("x1", t.x + 3).attr("y1", t.y + 1).attr("x2", t.x).attr("y2", t.y - 5).attr("stroke", h ? "#000000" : "#fff").attr("class", `commit ${r.id} ${o}`), e.append("line").attr("x1", t.x - 3).attr("y1", t.y + 1).attr("x2", t.x).attr("y2", t.y - 5).attr("stroke", h ? "#000000" : "#fff").attr("class", `commit ${r.id} ${o}`);
434
- else {
435
- const g = e.append("circle");
436
- if (g.attr("cx", t.x), g.attr("cy", t.y), g.attr("r", a ? 7 : 10), g.attr(
437
- "class",
438
- `commit ${r.id} commit${S(s, A, l)}`
439
- ), d === p.MERGE) {
440
- const f = e.append("circle");
441
- f.attr("cx", t.x), f.attr("cy", t.y), f.attr("r", a ? 5 : 6), f.attr(
442
- "class",
443
- `commit ${o} ${r.id} commit${S(s, A, l)}`
444
- );
445
- }
446
- if (d === p.REVERSE) {
447
- const f = e.append("path"), c = a ? 4 : 5;
448
- f.attr(
449
- "d",
450
- `M ${t.x - c},${t.y - c}L${t.x + c},${t.y + c}M${t.x - c},${t.y + c}L${t.x + c},${t.y - c}`
451
- ).attr(
452
- "class",
453
- `commit ${o} ${r.id} commit${S(s, A, l)}`
454
- );
455
- }
456
- }
457
- }, "drawCommitBullet"), or = /* @__PURE__ */ $((e, r, t, o, s) => {
458
- var d;
459
- if (r.type !== p.CHERRY_PICK && (r.customId && r.type === p.MERGE || r.type !== p.MERGE) && s.showCommitLabel) {
460
- const n = e.append("g"), a = n.insert("rect").attr("class", "commit-label-bkg"), l = n.append("text").attr("x", o).attr("y", t.y + 25).attr("class", "commit-label").text(r.id), h = (d = l.node()) == null ? void 0 : d.getBBox();
461
- if (h && (a.attr("x", t.posWithOffset - h.width / 2 - I).attr("y", t.y + 13.5).attr("width", h.width + 2 * I).attr("height", h.height + 2 * I), y === "TB" || y === "BT" ? (a.attr("x", t.x - (h.width + 4 * M + 5)).attr("y", t.y - 12), l.attr("x", t.x - (h.width + 4 * M)).attr("y", t.y + h.height - 12)) : l.attr("x", t.posWithOffset - h.width / 2), s.rotateCommitLabel))
462
- if (y === "TB" || y === "BT")
463
- l.attr(
464
- "transform",
465
- "rotate(-45, " + t.x + ", " + t.y + ")"
466
- ), a.attr(
467
- "transform",
468
- "rotate(-45, " + t.x + ", " + t.y + ")"
469
- );
470
- else {
471
- const g = -7.5 - (h.width + 10) / 25 * 9.5, f = 10 + h.width / 25 * 8.5;
472
- n.attr(
473
- "transform",
474
- "translate(" + g + ", " + f + ") rotate(-45, " + o + ", " + t.y + ")"
475
- );
476
- }
477
- }
478
- }, "drawCommitLabel"), cr = /* @__PURE__ */ $((e, r, t, o) => {
479
- var s;
480
- if (r.tags.length > 0) {
481
- let d = 0, n = 0, a = 0;
482
- const l = [];
483
- for (const h of r.tags.reverse()) {
484
- const g = e.insert("polygon"), f = e.append("circle"), c = e.append("text").attr("y", t.y - 16 - d).attr("class", "tag-label").text(h), x = (s = c.node()) == null ? void 0 : s.getBBox();
485
- if (!x)
486
- throw new Error("Tag bbox not found");
487
- n = Math.max(n, x.width), a = Math.max(a, x.height), c.attr("x", t.posWithOffset - x.width / 2), l.push({
488
- tag: c,
489
- hole: f,
490
- rect: g,
491
- yOffset: d
492
- }), d += 20;
493
- }
494
- for (const { tag: h, hole: g, rect: f, yOffset: c } of l) {
495
- const x = a / 2, u = t.y - 19.2 - c;
496
- if (f.attr("class", "tag-label-bkg").attr(
497
- "points",
498
- `
499
- ${o - n / 2 - M / 2},${u + I}
500
- ${o - n / 2 - M / 2},${u - I}
501
- ${t.posWithOffset - n / 2 - M},${u - x - I}
502
- ${t.posWithOffset + n / 2 + M},${u - x - I}
503
- ${t.posWithOffset + n / 2 + M},${u + x + I}
504
- ${t.posWithOffset - n / 2 - M},${u + x + I}`
505
- ), g.attr("cy", u).attr("cx", o - n / 2 + M / 2).attr("r", 1.5).attr("class", "tag-hole"), y === "TB" || y === "BT") {
506
- const m = o + c;
507
- f.attr("class", "tag-label-bkg").attr(
508
- "points",
509
- `
510
- ${t.x},${m + 2}
511
- ${t.x},${m - 2}
512
- ${t.x + G},${m - x - 2}
513
- ${t.x + G + n + 4},${m - x - 2}
514
- ${t.x + G + n + 4},${m + x + 2}
515
- ${t.x + G},${m + x + 2}`
516
- ).attr("transform", "translate(12,12) rotate(45, " + t.x + "," + o + ")"), g.attr("cx", t.x + M / 2).attr("cy", m).attr("transform", "translate(12,12) rotate(45, " + t.x + "," + o + ")"), h.attr("x", t.x + 5).attr("y", m + 3).attr("transform", "translate(14,14) rotate(45, " + t.x + "," + o + ")");
517
- }
518
- }
519
- }
520
- }, "drawCommitTags"), ir = /* @__PURE__ */ $((e) => {
521
- switch (e.customType ?? e.type) {
522
- case p.NORMAL:
523
- return "commit-normal";
524
- case p.REVERSE:
525
- return "commit-reverse";
526
- case p.HIGHLIGHT:
527
- return "commit-highlight";
528
- case p.MERGE:
529
- return "commit-merge";
530
- case p.CHERRY_PICK:
531
- return "commit-cherry-pick";
532
- default:
533
- return "commit-normal";
534
- }
535
- }, "getCommitClassType"), dr = /* @__PURE__ */ $((e, r, t, o) => {
536
- const s = { x: 0, y: 0 };
537
- if (e.parents.length > 0) {
538
- const d = ie(e.parents);
539
- if (d) {
540
- const n = o.get(d) ?? s;
541
- return r === "TB" ? n.y + H : r === "BT" ? (o.get(e.id) ?? s).y - H : n.x + H;
542
- }
543
- } else
544
- return r === "TB" ? j : r === "BT" ? (o.get(e.id) ?? s).y - H : 0;
545
- return 0;
546
- }, "calculatePosition"), lr = /* @__PURE__ */ $((e, r, t) => {
547
- var l, h;
548
- const o = y === "BT" && t ? r : r + G, s = (l = C.get(e.branch)) == null ? void 0 : l.pos, d = y === "TB" || y === "BT" ? (h = C.get(e.branch)) == null ? void 0 : h.pos : o;
549
- if (d === void 0 || s === void 0)
550
- throw new Error(`Position were undefined for commit ${e.id}`);
551
- const n = V.has(z().theme ?? ""), a = y === "TB" || y === "BT" ? o : s + (n ? J / 2 + 1 : -2);
552
- return { x: d, y: a, posWithOffset: o };
553
- }, "getCommitPosition"), te = /* @__PURE__ */ $((e, r, t, o) => {
554
- const s = e.append("g").attr("class", "commit-bullets"), d = e.append("g").attr("class", "commit-labels");
555
- let n = y === "TB" || y === "BT" ? j : 0;
556
- const a = [...r.keys()], l = o.parallelCommits ?? !1, h = /* @__PURE__ */ $((f, c) => {
557
- var m, E;
558
- const x = (m = r.get(f)) == null ? void 0 : m.seq, u = (E = r.get(c)) == null ? void 0 : E.seq;
559
- return x !== void 0 && u !== void 0 ? x - u : 0;
560
- }, "sortKeys");
561
- let g = a.sort(h);
562
- y === "BT" && (l && er(g, r, n), g = g.reverse()), g.forEach((f) => {
563
- var u;
564
- const c = r.get(f);
565
- if (!c)
566
- throw new Error(`Commit not found for key ${f}`);
567
- l && (n = dr(c, y, n, T));
568
- const x = lr(c, n, l);
569
- if (t) {
570
- const m = ir(c), E = c.customType ?? c.type, b = ((u = C.get(c.branch)) == null ? void 0 : u.index) ?? 0;
571
- sr(s, c, x, m, b, E), or(d, c, x, n, o), cr(d, c, x, n);
572
- }
573
- y === "TB" || y === "BT" ? T.set(c.id, { x: x.x, y: x.posWithOffset }) : T.set(c.id, { x: x.posWithOffset, y: x.y }), n = y === "BT" && l ? n + H : n + H + G, n > O && (O = n);
574
- });
575
- }, "drawCommits"), hr = /* @__PURE__ */ $((e, r, t, o, s) => {
576
- const n = (y === "TB" || y === "BT" ? t.x < o.x : t.y < o.y) ? r.branch : e.branch, a = /* @__PURE__ */ $((h) => h.branch === n, "isOnBranchToGetCurve"), l = /* @__PURE__ */ $((h) => h.seq > e.seq && h.seq < r.seq, "isBetweenCommits");
577
- return [...s.values()].some((h) => l(h) && a(h));
578
- }, "shouldRerouteArrow"), F = /* @__PURE__ */ $((e, r, t = 0) => {
579
- const o = e + Math.abs(e - r) / 2;
580
- if (t > 5)
581
- return o;
582
- if (U.every((n) => Math.abs(n - o) >= 10))
583
- return U.push(o), o;
584
- const d = Math.abs(e - r);
585
- return F(e, r - d / 5, t + 1);
586
- }, "findLane"), $r = /* @__PURE__ */ $((e, r, t, o) => {
587
- var m, E, b, q, _;
588
- const { theme: s } = z(), d = ee.has(s ?? ""), n = T.get(r.id), a = T.get(t.id);
589
- if (n === void 0 || a === void 0)
590
- throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);
591
- const l = hr(r, t, n, a, o);
592
- let h = "", g = "", f = 0, c = 0, x = (m = C.get(t.branch)) == null ? void 0 : m.index;
593
- t.type === p.MERGE && r.id !== t.parents[0] && (x = (E = C.get(r.branch)) == null ? void 0 : E.index);
594
- let u;
595
- if (l) {
596
- h = "A 10 10, 0, 0, 0,", g = "A 10 10, 0, 0, 1,", f = 10, c = 10;
597
- const v = n.y < a.y ? F(n.y, a.y) : F(a.y, n.y), w = n.x < a.x ? F(n.x, a.x) : F(a.x, n.x);
598
- y === "TB" ? n.x < a.x ? u = `M ${n.x} ${n.y} L ${w - f} ${n.y} ${g} ${w} ${n.y + c} L ${w} ${a.y - f} ${h} ${w + c} ${a.y} L ${a.x} ${a.y}` : (x = (b = C.get(r.branch)) == null ? void 0 : b.index, u = `M ${n.x} ${n.y} L ${w + f} ${n.y} ${h} ${w} ${n.y + c} L ${w} ${a.y - f} ${g} ${w - c} ${a.y} L ${a.x} ${a.y}`) : y === "BT" ? n.x < a.x ? u = `M ${n.x} ${n.y} L ${w - f} ${n.y} ${h} ${w} ${n.y - c} L ${w} ${a.y + f} ${g} ${w + c} ${a.y} L ${a.x} ${a.y}` : (x = (q = C.get(r.branch)) == null ? void 0 : q.index, u = `M ${n.x} ${n.y} L ${w + f} ${n.y} ${g} ${w} ${n.y - c} L ${w} ${a.y + f} ${h} ${w - c} ${a.y} L ${a.x} ${a.y}`) : n.y < a.y ? u = `M ${n.x} ${n.y} L ${n.x} ${v - f} ${h} ${n.x + c} ${v} L ${a.x - f} ${v} ${g} ${a.x} ${v + c} L ${a.x} ${a.y}` : (x = (_ = C.get(r.branch)) == null ? void 0 : _.index, u = `M ${n.x} ${n.y} L ${n.x} ${v + f} ${g} ${n.x + c} ${v} L ${a.x - f} ${v} ${h} ${a.x} ${v - c} L ${a.x} ${a.y}`);
599
- } else
600
- h = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", f = 20, c = 20, y === "TB" ? (n.x < a.x && (t.type === p.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y - f} ${h} ${n.x + c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x - f} ${n.y} ${g} ${a.x} ${n.y + c} L ${a.x} ${a.y}`), n.x > a.x && (h = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", f = 20, c = 20, t.type === p.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y - f} ${g} ${n.x - c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x + f} ${n.y} ${h} ${a.x} ${n.y + c} L ${a.x} ${a.y}`), n.x === a.x && (u = `M ${n.x} ${n.y} L ${a.x} ${a.y}`)) : y === "BT" ? (n.x < a.x && (t.type === p.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y + f} ${g} ${n.x + c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x - f} ${n.y} ${h} ${a.x} ${n.y - c} L ${a.x} ${a.y}`), n.x > a.x && (h = "A 20 20, 0, 0, 0,", g = "A 20 20, 0, 0, 1,", f = 20, c = 20, t.type === p.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${n.x} ${a.y + f} ${h} ${n.x - c} ${a.y} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${a.x + f} ${n.y} ${g} ${a.x} ${n.y - c} L ${a.x} ${a.y}`), n.x === a.x && (u = `M ${n.x} ${n.y} L ${a.x} ${a.y}`)) : (n.y < a.y && (t.type === p.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${a.x - f} ${n.y} ${g} ${a.x} ${n.y + c} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${n.x} ${a.y - f} ${h} ${n.x + c} ${a.y} L ${a.x} ${a.y}`), n.y > a.y && (t.type === p.MERGE && r.id !== t.parents[0] ? u = `M ${n.x} ${n.y} L ${a.x - f} ${n.y} ${h} ${a.x} ${n.y - c} L ${a.x} ${a.y}` : u = `M ${n.x} ${n.y} L ${n.x} ${a.y + f} ${g} ${n.x + c} ${a.y} L ${a.x} ${a.y}`), n.y === a.y && (u = `M ${n.x} ${n.y} L ${a.x} ${a.y}`));
601
- if (u === void 0)
602
- throw new Error("Line definition not found");
603
- e.append("path").attr("d", u).attr(
604
- "class",
605
- "arrow arrow" + S(x, A, d)
606
- );
607
- }, "drawArrow"), fr = /* @__PURE__ */ $((e, r) => {
608
- const t = e.append("g").attr("class", "commit-arrows");
609
- [...r.keys()].forEach((o) => {
610
- const s = r.get(o);
611
- s.parents && s.parents.length > 0 && s.parents.forEach((d) => {
612
- $r(t, r.get(d), s, r);
613
- });
614
- });
615
- }, "drawArrows"), gr = /* @__PURE__ */ $((e, r, t, o) => {
616
- const { look: s, theme: d, themeVariables: n } = z(), { dropShadow: a, THEME_COLOR_LIMIT: l } = n, h = V.has(d ?? ""), g = ee.has(d ?? ""), f = e.append("g");
617
- r.forEach((c, x) => {
618
- var re;
619
- const u = S(
620
- x,
621
- h ? l : A,
622
- g
623
- ), m = (re = C.get(c.name)) == null ? void 0 : re.pos;
624
- if (m === void 0)
625
- throw new Error(`Position not found for branch ${c.name}`);
626
- const E = y === "TB" || y === "BT" ? m : h ? m + J / 2 + 1 : m - 2, b = f.append("line");
627
- b.attr("x1", 0), b.attr("y1", E), b.attr("x2", O), b.attr("y2", E), b.attr("class", "branch branch" + u), y === "TB" ? (b.attr("y1", j), b.attr("x1", m), b.attr("y2", O), b.attr("x2", m)) : y === "BT" && (b.attr("y1", O), b.attr("x1", m), b.attr("y2", j), b.attr("x2", m)), U.push(E);
628
- const q = c.name, _ = ce(q), v = f.insert("rect"), R = f.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + u);
629
- R.node().appendChild(_);
630
- const B = _.getBBox(), W = h ? 0 : 4, Y = h ? 16 : 0, P = h ? J : 0;
631
- s === "neo" && v.attr("data-look", "neo"), v.attr("class", "branchLabelBkg label" + u).attr(
632
- "style",
633
- s === "neo" ? `filter:${h ? `url(#${o}-drop-shadow)` : a}` : ""
634
- ).attr("rx", W).attr("ry", W).attr("x", -B.width - 4 - (t.rotateCommitLabel === !0 ? 30 : 0)).attr("y", -B.height / 2 + 10).attr("width", B.width + 18 + Y).attr("height", B.height + 4 + P), R.attr(
635
- "transform",
636
- "translate(" + (-B.width - 14 - (t.rotateCommitLabel === !0 ? 30 : 0) + Y / 2) + ", " + (E - B.height / 2 - 2) + ")"
637
- ), y === "TB" ? (v.attr("x", m - B.width / 2 - 10).attr("y", 0), R.attr("transform", "translate(" + (m - B.width / 2 - 5) + ", 0)"), h && (v.attr("transform", `translate(${-Y / 2 - 3}, ${-P - 10})`), R.attr(
638
- "transform",
639
- "translate(" + (m - B.width / 2 - 5) + ", " + (-P * 2 + 7) + ")"
640
- ))) : y === "BT" ? (v.attr("x", m - B.width / 2 - 10).attr("y", O), R.attr("transform", "translate(" + (m - B.width / 2 - 5) + ", " + O + ")"), h && (v.attr("transform", `translate(${-Y / 2 - 3}, ${P + 10})`), R.attr(
641
- "transform",
642
- "translate(" + (m - B.width / 2 - 5) + ", " + (O + P * 2 + 4) + ")"
643
- ))) : v.attr("transform", "translate(-19, " + (E - 12 - P / 2) + ")");
644
- });
645
- }, "drawBranches"), ur = /* @__PURE__ */ $(function(e, r, t, o, s) {
646
- return C.set(e, { pos: r, index: t }), r += 50 + (s ? 40 : 0) + (y === "TB" || y === "BT" ? o.width / 2 : 0), r;
647
- }, "setBranchPosition"), yr = /* @__PURE__ */ $(function(e, r, t, o) {
648
- Qe(), k.debug("in gitgraph renderer", e + `
649
- `, "id:", r, t);
650
- const s = o.db;
651
- if (!s.getConfig) {
652
- k.error("getConfig method is not available on db");
653
- return;
654
- }
655
- const d = s.getConfig(), n = d.rotateCommitLabel ?? !1;
656
- N = s.getCommits();
657
- const a = s.getBranchesAsObjArray();
658
- y = s.getDirection();
659
- const l = pe(`[id="${r}"]`), { look: h, theme: g, themeVariables: f } = z(), { useGradient: c, gradientStart: x, gradientStop: u, filterColor: m } = f;
660
- if (c) {
661
- const b = l.append("defs").append("linearGradient").attr("id", r + "-gradient").attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
662
- b.append("stop").attr("offset", "0%").attr("stop-color", x).attr("stop-opacity", 1), b.append("stop").attr("offset", "100%").attr("stop-color", u).attr("stop-opacity", 1);
663
- }
664
- h === "neo" && V.has(g ?? "") && l.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", m);
665
- let E = 0;
666
- a.forEach((b, q) => {
667
- var W;
668
- const _ = ce(b.name), v = l.append("g"), w = v.insert("g").attr("class", "branchLabel"), R = w.insert("g").attr("class", "label branch-label");
669
- (W = R.node()) == null || W.appendChild(_);
670
- const B = _.getBBox();
671
- E = ur(b.name, E, q, B, n), R.remove(), w.remove(), v.remove();
672
- }), te(l, N, !1, d), d.showBranches && gr(l, a, d, r), fr(l, N), te(l, N, !0, d), be.insertTitle(
673
- l,
674
- "gitTitleText",
675
- d.titleTopMargin ?? 0,
676
- s.getDiagramTitle()
677
- ), we(void 0, l, d.diagramPadding, d.useMaxWidth);
678
- }, "draw"), xr = {
679
- draw: yr
680
- }, de = 8, le = /* @__PURE__ */ new Set(["redux", "redux-dark", "redux-color", "redux-dark-color"]), mr = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), pr = /* @__PURE__ */ new Set(["neo", "neo-dark"]), br = /* @__PURE__ */ new Set(["dark", "redux-dark", "redux-dark-color", "neo-dark"]), wr = /* @__PURE__ */ new Set([
681
- "redux",
682
- "redux-dark",
683
- "redux-color",
684
- "redux-dark-color",
685
- "neo",
686
- "neo-dark"
687
- ]), kr = /* @__PURE__ */ $((e) => {
688
- const { svgId: r } = e;
689
- let t = "";
690
- if (e.useGradient && r)
691
- for (let o = 0; o < e.THEME_COLOR_LIMIT; o++)
692
- t += `
693
- .label${o} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
694
- `;
695
- return t;
696
- }, "genGitGraphGradient"), vr = /* @__PURE__ */ $((e) => {
697
- const r = Q(), { theme: t, themeVariables: o } = r, { borderColorArray: s } = o, d = le.has(t);
698
- if (pr.has(t)) {
699
- let n = "";
700
- for (let a = 0; a < e.THEME_COLOR_LIMIT; a++)
701
- if (a === 0)
702
- n += `
703
- .branch-label${a} { fill: ${e.nodeBorder};}
704
- .commit${a} { stroke: ${e.nodeBorder}; }
705
- .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
706
- .arrow${a} { stroke: ${e.nodeBorder}; }
707
- .commit-bullets { fill: ${e.nodeBorder}; }
708
- .commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
709
- ${kr(e)}`;
710
- else {
711
- const l = a % de;
712
- n += `
713
- .branch-label${a} { fill: ${e["gitBranchLabel" + l]}; }
714
- .commit${a} { stroke: ${e["git" + l]}; fill: ${e["git" + l]}; }
715
- .commit-highlight${a} { stroke: ${e["gitInv" + l]}; fill: ${e["gitInv" + l]}; }
716
- .arrow${a} { stroke: ${e["git" + l]}; }
717
- `;
718
- }
719
- return n;
720
- } else if (mr.has(t)) {
721
- let n = "";
722
- for (let a = 0; a < e.THEME_COLOR_LIMIT; a++)
723
- if (a === 0)
724
- n += `
725
- .branch-label${a} { fill: ${e.nodeBorder}; ${d ? `font-weight:${e.noteFontWeight}` : ""} }
726
- .commit${a} { stroke: ${e.nodeBorder}; }
727
- .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
728
- .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${d ? `font-weight:${e.noteFontWeight}` : ""} }
729
- .arrow${a} { stroke: ${e.nodeBorder}; }
730
- .commit-bullets { fill: ${e.nodeBorder}; }
731
- `;
732
- else {
733
- const l = a % s.length;
734
- n += `
735
- .branch-label${a} { fill: ${e.nodeBorder}; ${d ? `font-weight:${e.noteFontWeight}` : ""} }
736
- .commit${a} { stroke: ${s[l]}; fill: ${s[l]}; }
737
- .commit-highlight${a} { stroke: ${s[l]}; fill: ${s[l]}; }
738
- .label${a} { fill: ${br.has(t) ? e.mainBkg : s[l]}; stroke: ${s[l]}; stroke-width: ${e.strokeWidth}; }
739
- .arrow${a} { stroke: ${s[l]}; }
740
- `;
741
- }
742
- return n;
743
- } else {
744
- let n = "";
745
- for (let a = 0; a < e.THEME_COLOR_LIMIT; a++)
746
- n += `
747
- .branch-label${a} { fill: ${e.nodeBorder}; ${d ? `font-weight:${e.noteFontWeight}` : ""} }
748
- .commit${a} { stroke: ${e.nodeBorder}; }
749
- .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
750
- .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${d ? `font-weight:${e.noteFontWeight}` : ""}}
751
- .arrow${a} { stroke: ${e.nodeBorder}; }
752
- .commit-bullets { fill: ${e.nodeBorder}; }
753
- .commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
754
- `;
755
- return n;
756
- }
757
- }, "genColor"), Er = /* @__PURE__ */ $((e) => `${Array.from({ length: e.THEME_COLOR_LIMIT }, (r, t) => t).map((r) => {
758
- const t = r % de;
759
- return `
760
- .branch-label${r} { fill: ${e["gitBranchLabel" + t]}; }
761
- .commit${r} { stroke: ${e["git" + t]}; fill: ${e["git" + t]}; }
762
- .commit-highlight${r} { stroke: ${e["gitInv" + t]}; fill: ${e["gitInv" + t]}; }
763
- .label${r} { fill: ${e["git" + t]}; }
764
- .arrow${r} { stroke: ${e["git" + t]}; }
765
- `;
766
- }).join(`
767
- `)}`, "normalTheme"), Br = /* @__PURE__ */ $((e) => {
768
- const r = Q(), { theme: t } = r, o = wr.has(t);
769
- return `
770
- .commit-id,
771
- .commit-msg,
772
- .branch-label {
773
- fill: lightgrey;
774
- color: lightgrey;
775
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
776
- font-family: var(--mermaid-font-family);
777
- }
778
-
779
- ${o ? vr(e) : Er(e)}
780
-
781
- .branch {
782
- stroke-width: ${e.strokeWidth};
783
- stroke: ${e.commitLineColor ?? e.lineColor};
784
- stroke-dasharray: ${o ? "4 2" : "2"};
785
- }
786
- .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${o ? e.nodeBorder : e.commitLabelColor}; ${o ? `font-weight:${e.noteFontWeight};` : ""}}
787
- .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${o ? "transparent" : e.commitLabelBackground}; opacity: ${o ? "" : 0.5}; }
788
- .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
789
- .tag-label-bkg { fill: ${o ? e.mainBkg : e.tagLabelBackground}; stroke: ${o ? e.nodeBorder : e.tagLabelBorder}; ${o ? `filter:${e.dropShadow}` : ""} }
790
- .tag-hole { fill: ${e.textColor}; }
791
-
792
- .commit-merge {
793
- stroke: ${o ? e.mainBkg : e.primaryColor};
794
- fill: ${o ? e.mainBkg : e.primaryColor};
795
- }
796
- .commit-reverse {
797
- stroke: ${o ? e.mainBkg : e.primaryColor};
798
- fill: ${o ? e.mainBkg : e.primaryColor};
799
- stroke-width: ${o ? e.strokeWidth : 3};
800
- }
801
- .commit-highlight-outer {
802
- }
803
- .commit-highlight-inner {
804
- stroke: ${o ? e.mainBkg : e.primaryColor};
805
- fill: ${o ? e.mainBkg : e.primaryColor};
806
- }
807
-
808
- .arrow {
809
- /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
810
- stroke-width: ${le.has(t) ? e.strokeWidth : 8};
811
- stroke-linecap: round;
812
- fill: none
813
- }
814
- .gitTitleText {
815
- text-anchor: middle;
816
- font-size: 18px;
817
- fill: ${e.textColor};
818
- }
819
- `;
820
- }, "getStyles"), Cr = Br, Ir = {
821
- parser: Xe,
822
- db: oe,
823
- renderer: xr,
824
- styles: Cr
825
- };
826
- export {
827
- Ir as diagram
828
- };