@altimateai/ui-components 0.0.77-beta.7 → 0.0.77

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 (405) hide show
  1. package/dist/CoachForm.css +1 -1
  2. package/dist/CoachForm.js +24114 -67797
  3. package/dist/DbtDocsRenderer.js +1 -1
  4. package/dist/Stack.js +2274 -2824
  5. package/dist/Switch.js +87 -128
  6. package/dist/ToggleGroup.js +4788 -5963
  7. package/dist/_basePickBy.js +60 -60
  8. package/dist/_baseUniq.js +152 -152
  9. package/dist/arc.js +53 -53
  10. package/dist/architectureDiagram-VXUJARFQ.js +4315 -480
  11. package/dist/assets/icons/index.js +1 -1
  12. package/dist/blockDiagram-VD42YOAC.js +1 -1
  13. package/dist/c4Diagram-YG6GDRKO.js +22 -22
  14. package/dist/channel.js +2 -2
  15. package/dist/chatbotV2/index.d.ts +19 -57
  16. package/dist/chatbotV2/index.js +56 -91
  17. package/dist/chunk-4BX2VUAB.js +1 -1
  18. package/dist/chunk-55IACEB6.js +2 -2
  19. package/dist/chunk-B4BG7PRW.js +1 -1
  20. package/dist/chunk-DI55MBZ5.js +14 -14
  21. package/dist/chunk-FMBD7UC4.js +1 -1
  22. package/dist/chunk-QN33PNHL.js +5 -5
  23. package/dist/chunk-QZHKN3VN.js +1 -1
  24. package/dist/chunk-TZMSLE5B.js +1 -1
  25. package/dist/classDiagram-2ON5EDUG.js +1 -1
  26. package/dist/classDiagram-v2-WZHVMYZB.js +1 -1
  27. package/dist/cose-bilkent-S5V4N54A.js +2535 -160
  28. package/dist/dagre-6UL2VRFP.js +101 -101
  29. package/dist/dayjs.min.js +2 -2
  30. package/dist/defaultLocale.js +3 -3
  31. package/dist/diagram-PSM6KHXK.js +414 -198
  32. package/dist/diagram-QEK2KX5R.js +26 -26
  33. package/dist/diagram-S2PKOQOG.js +12 -12
  34. package/dist/erDiagram-Q2GNP2WA.js +1 -1
  35. package/dist/flowDiagram-NV44I4VS.js +6 -6
  36. package/dist/ganttDiagram-LVOFAZNH.js +1718 -843
  37. package/dist/gitGraphDiagram-NY62KEGX.js +13 -13
  38. package/dist/graph.js +18 -17
  39. package/dist/index.d.ts +6 -101
  40. package/dist/index.js +37 -37
  41. package/dist/index2.js +684 -216
  42. package/dist/infoDiagram-F6ZHWCRC.js +14 -14
  43. package/dist/journeyDiagram-XKPGCS4Q.js +1 -1
  44. package/dist/kanban-definition-3W4ZIXB7.js +42 -42
  45. package/dist/layout.js +678 -567
  46. package/dist/lineage/index.js +1315 -1308
  47. package/dist/linear.js +1 -1
  48. package/dist/main.css +1 -1
  49. package/dist/main.js +151 -151
  50. package/dist/mermaid-parser.core.js +155 -155
  51. package/dist/mindmap-definition-VGOIOE7T.js +28 -28
  52. package/dist/pieDiagram-ADFJNKIX.js +108 -68
  53. package/dist/quadrantDiagram-AYHSOK5B.js +1 -1
  54. package/dist/redux-toolkit.modern.js +555 -563
  55. package/dist/requirementDiagram-UZGBJVZJ.js +14 -14
  56. package/dist/sankeyDiagram-TZEHDZUN.js +622 -229
  57. package/dist/sequenceDiagram-WL72ISMW.js +1 -1
  58. package/dist/shadcn/index.d.ts +40 -24
  59. package/dist/shadcn/index.js +4733 -6547
  60. package/dist/stateDiagram-FKZM4ZOC.js +33 -33
  61. package/dist/stateDiagram-v2-4FDKWEC3.js +6 -6
  62. package/dist/storybook/Typography.stories.tsx +120 -93
  63. package/dist/timeline-definition-IT6M3QCI.js +63 -63
  64. package/dist/{types-UHJCpYj0.d.ts → types-ByRPUpXR.d.ts} +116 -25
  65. package/dist/xychartDiagram-PRI3JC2R.js +491 -449
  66. package/package.json +1 -1
  67. package/dist/abap.js +0 -6
  68. package/dist/actionscript-3.js +0 -6
  69. package/dist/ada.js +0 -6
  70. package/dist/andromeeda.js +0 -4
  71. package/dist/angular-html.js +0 -32
  72. package/dist/angular-ts.js +0 -21
  73. package/dist/apache.js +0 -6
  74. package/dist/apex.js +0 -6
  75. package/dist/apl.js +0 -16
  76. package/dist/applescript.js +0 -6
  77. package/dist/ara.js +0 -6
  78. package/dist/architectureDiagram-VXUJARFQ2.js +0 -831
  79. package/dist/asciidoc.js +0 -6
  80. package/dist/asm.js +0 -6
  81. package/dist/astro.js +0 -18
  82. package/dist/aurora-x.js +0 -4
  83. package/dist/awk.js +0 -6
  84. package/dist/ayu-dark.js +0 -4
  85. package/dist/ballerina.js +0 -6
  86. package/dist/band.js +0 -46
  87. package/dist/bat.js +0 -6
  88. package/dist/beancount.js +0 -6
  89. package/dist/berry.js +0 -6
  90. package/dist/bibtex.js +0 -6
  91. package/dist/bicep.js +0 -6
  92. package/dist/blade.js +0 -20
  93. package/dist/blockDiagram-VD42YOAC2.js +0 -2266
  94. package/dist/bsl.js +0 -8
  95. package/dist/c.js +0 -6
  96. package/dist/c3.js +0 -6
  97. package/dist/c4Diagram-YG6GDRKO2.js +0 -1582
  98. package/dist/cadence.js +0 -6
  99. package/dist/cairo.js +0 -8
  100. package/dist/catppuccin-frappe.js +0 -4
  101. package/dist/catppuccin-latte.js +0 -4
  102. package/dist/catppuccin-macchiato.js +0 -4
  103. package/dist/catppuccin-mocha.js +0 -4
  104. package/dist/chunk-4BX2VUAB2.js +0 -9
  105. package/dist/chunk-55IACEB62.js +0 -9
  106. package/dist/chunk-B4BG7PRW2.js +0 -1377
  107. package/dist/chunk-DI55MBZ52.js +0 -1382
  108. package/dist/chunk-FMBD7UC42.js +0 -19
  109. package/dist/chunk-QN33PNHL2.js +0 -20
  110. package/dist/chunk-QZHKN3VN2.js +0 -15
  111. package/dist/chunk-TZMSLE5B2.js +0 -64
  112. package/dist/clarity.js +0 -6
  113. package/dist/classDiagram-2ON5EDUG2.js +0 -17
  114. package/dist/classDiagram-v2-WZHVMYZB2.js +0 -17
  115. package/dist/clojure.js +0 -6
  116. package/dist/cmake.js +0 -6
  117. package/dist/cobol.js +0 -10
  118. package/dist/code-block-37QAKDTI.js +0 -27
  119. package/dist/codeowners.js +0 -6
  120. package/dist/codeql.js +0 -6
  121. package/dist/coffee.js +0 -8
  122. package/dist/common-lisp.js +0 -6
  123. package/dist/coq.js +0 -6
  124. package/dist/cose-bilkent-S5V4N54A2.js +0 -231
  125. package/dist/cpp.js +0 -18
  126. package/dist/crystal.js +0 -18
  127. package/dist/csharp.js +0 -6
  128. package/dist/css.js +0 -6
  129. package/dist/csv.js +0 -6
  130. package/dist/cue.js +0 -6
  131. package/dist/cypher.js +0 -6
  132. package/dist/cytoscape-cose-bilkent.js +0 -2380
  133. package/dist/cytoscape-fcose.js +0 -3840
  134. package/dist/d.js +0 -6
  135. package/dist/dagre-6UL2VRFP2.js +0 -447
  136. package/dist/dark-plus.js +0 -4
  137. package/dist/dart.js +0 -6
  138. package/dist/dax.js +0 -6
  139. package/dist/desktop.js +0 -6
  140. package/dist/diagram-PSM6KHXK2.js +0 -319
  141. package/dist/diagram-QEK2KX5R2.js +0 -221
  142. package/dist/diagram-S2PKOQOG2.js +0 -143
  143. package/dist/diff.js +0 -6
  144. package/dist/docker.js +0 -6
  145. package/dist/dotenv.js +0 -6
  146. package/dist/dracula-soft.js +0 -4
  147. package/dist/dracula.js +0 -4
  148. package/dist/dream-maker.js +0 -6
  149. package/dist/edge.js +0 -12
  150. package/dist/elixir.js +0 -8
  151. package/dist/elm.js +0 -8
  152. package/dist/emacs-lisp.js +0 -6
  153. package/dist/erDiagram-Q2GNP2WA2.js +0 -843
  154. package/dist/erb.js +0 -10
  155. package/dist/erlang.js +0 -8
  156. package/dist/everforest-dark.js +0 -4
  157. package/dist/everforest-light.js +0 -4
  158. package/dist/fennel.js +0 -6
  159. package/dist/fish.js +0 -6
  160. package/dist/flowDiagram-NV44I4VS2.js +0 -1628
  161. package/dist/fluent.js +0 -6
  162. package/dist/fortran-fixed-form.js +0 -8
  163. package/dist/fortran-free-form.js +0 -6
  164. package/dist/fsharp.js +0 -8
  165. package/dist/ganttDiagram-JELNMOA3.js +0 -1788
  166. package/dist/gdresource.js +0 -10
  167. package/dist/gdscript.js +0 -6
  168. package/dist/gdshader.js +0 -6
  169. package/dist/genie.js +0 -6
  170. package/dist/gherkin.js +0 -6
  171. package/dist/git-commit.js +0 -8
  172. package/dist/git-rebase.js +0 -8
  173. package/dist/gitGraphDiagram-NY62KEGX2.js +0 -713
  174. package/dist/github-dark-default.js +0 -4
  175. package/dist/github-dark-dimmed.js +0 -4
  176. package/dist/github-dark-high-contrast.js +0 -4
  177. package/dist/github-dark.js +0 -4
  178. package/dist/github-light-default.js +0 -4
  179. package/dist/github-light-high-contrast.js +0 -4
  180. package/dist/github-light.js +0 -4
  181. package/dist/gleam.js +0 -6
  182. package/dist/glimmer-js.js +0 -14
  183. package/dist/glimmer-ts.js +0 -14
  184. package/dist/glsl.js +0 -8
  185. package/dist/gn.js +0 -6
  186. package/dist/gnuplot.js +0 -6
  187. package/dist/go.js +0 -6
  188. package/dist/graph2.js +0 -246
  189. package/dist/graphql.js +0 -14
  190. package/dist/groovy.js +0 -6
  191. package/dist/gruvbox-dark-hard.js +0 -4
  192. package/dist/gruvbox-dark-medium.js +0 -4
  193. package/dist/gruvbox-dark-soft.js +0 -4
  194. package/dist/gruvbox-light-hard.js +0 -4
  195. package/dist/gruvbox-light-medium.js +0 -4
  196. package/dist/gruvbox-light-soft.js +0 -4
  197. package/dist/hack.js +0 -10
  198. package/dist/haml.js +0 -10
  199. package/dist/handlebars.js +0 -14
  200. package/dist/haskell.js +0 -6
  201. package/dist/haxe.js +0 -6
  202. package/dist/hcl.js +0 -6
  203. package/dist/hjson.js +0 -6
  204. package/dist/hlsl.js +0 -6
  205. package/dist/houston.js +0 -4
  206. package/dist/html-derivative.js +0 -8
  207. package/dist/html.js +0 -10
  208. package/dist/http.js +0 -14
  209. package/dist/hurl.js +0 -12
  210. package/dist/hxml.js +0 -8
  211. package/dist/hy.js +0 -6
  212. package/dist/imba.js +0 -6
  213. package/dist/index3.js +0 -689
  214. package/dist/infoDiagram-WHAUD3N6.js +0 -24
  215. package/dist/ini.js +0 -6
  216. package/dist/java.js +0 -6
  217. package/dist/javascript.js +0 -6
  218. package/dist/jinja.js +0 -11
  219. package/dist/jison.js +0 -8
  220. package/dist/journeyDiagram-XKPGCS4Q2.js +0 -837
  221. package/dist/json.js +0 -6
  222. package/dist/json5.js +0 -6
  223. package/dist/jsonc.js +0 -6
  224. package/dist/jsonl.js +0 -6
  225. package/dist/jsonnet.js +0 -6
  226. package/dist/jssm.js +0 -6
  227. package/dist/jsx.js +0 -6
  228. package/dist/julia.js +0 -16
  229. package/dist/kanagawa-dragon.js +0 -4
  230. package/dist/kanagawa-lotus.js +0 -4
  231. package/dist/kanagawa-wave.js +0 -4
  232. package/dist/kanban-definition-3W4ZIXB72.js +0 -720
  233. package/dist/katex2.js +0 -11691
  234. package/dist/kdl.js +0 -6
  235. package/dist/kotlin.js +0 -6
  236. package/dist/kusto.js +0 -6
  237. package/dist/laserwave.js +0 -4
  238. package/dist/latex.js +0 -8
  239. package/dist/layout2.js +0 -1224
  240. package/dist/lean.js +0 -6
  241. package/dist/less.js +0 -6
  242. package/dist/light-plus.js +0 -4
  243. package/dist/liquid.js +0 -14
  244. package/dist/llvm.js +0 -6
  245. package/dist/log.js +0 -6
  246. package/dist/logo.js +0 -6
  247. package/dist/lua.js +0 -8
  248. package/dist/luau.js +0 -6
  249. package/dist/make.js +0 -6
  250. package/dist/markdown.js +0 -6
  251. package/dist/marko.js +0 -14
  252. package/dist/material-theme-darker.js +0 -4
  253. package/dist/material-theme-lighter.js +0 -4
  254. package/dist/material-theme-ocean.js +0 -4
  255. package/dist/material-theme-palenight.js +0 -4
  256. package/dist/material-theme.js +0 -4
  257. package/dist/matlab.js +0 -6
  258. package/dist/mdc.js +0 -12
  259. package/dist/mdx.js +0 -6
  260. package/dist/mermaid-4DMBBIKO.js +0 -4
  261. package/dist/mermaid.js +0 -6
  262. package/dist/min-dark.js +0 -4
  263. package/dist/min-light.js +0 -4
  264. package/dist/mindmap-definition-VGOIOE7T2.js +0 -786
  265. package/dist/mipsasm.js +0 -6
  266. package/dist/mojo.js +0 -6
  267. package/dist/monokai.js +0 -4
  268. package/dist/moonbit.js +0 -6
  269. package/dist/move.js +0 -6
  270. package/dist/narrat.js +0 -6
  271. package/dist/nextflow.js +0 -6
  272. package/dist/nginx.js +0 -8
  273. package/dist/night-owl.js +0 -4
  274. package/dist/nim.js +0 -20
  275. package/dist/nix.js +0 -9
  276. package/dist/nord.js +0 -4
  277. package/dist/nushell.js +0 -6
  278. package/dist/objective-c.js +0 -6
  279. package/dist/objective-cpp.js +0 -6
  280. package/dist/ocaml.js +0 -6
  281. package/dist/one-dark-pro.js +0 -4
  282. package/dist/one-light.js +0 -4
  283. package/dist/openscad.js +0 -6
  284. package/dist/pascal.js +0 -6
  285. package/dist/perl.js +0 -16
  286. package/dist/php.js +0 -18
  287. package/dist/pie.js +0 -45
  288. package/dist/pieDiagram-ADFJNKIX2.js +0 -123
  289. package/dist/pkl.js +0 -6
  290. package/dist/plastic.js +0 -4
  291. package/dist/plsql.js +0 -6
  292. package/dist/po.js +0 -6
  293. package/dist/poimandres.js +0 -4
  294. package/dist/polar.js +0 -6
  295. package/dist/postcss.js +0 -6
  296. package/dist/powerquery.js +0 -6
  297. package/dist/powershell.js +0 -6
  298. package/dist/prisma.js +0 -6
  299. package/dist/prolog.js +0 -6
  300. package/dist/proto.js +0 -6
  301. package/dist/pug.js +0 -12
  302. package/dist/puppet.js +0 -6
  303. package/dist/purescript.js +0 -6
  304. package/dist/python.js +0 -6
  305. package/dist/qml.js +0 -8
  306. package/dist/qmldir.js +0 -6
  307. package/dist/qss.js +0 -6
  308. package/dist/quadrantDiagram-AYHSOK5B2.js +0 -1025
  309. package/dist/r.js +0 -6
  310. package/dist/racket.js +0 -6
  311. package/dist/raku.js +0 -6
  312. package/dist/razor.js +0 -10
  313. package/dist/red.js +0 -4
  314. package/dist/reg.js +0 -6
  315. package/dist/regexp.js +0 -6
  316. package/dist/rel.js +0 -6
  317. package/dist/requirementDiagram-UZGBJVZJ2.js +0 -852
  318. package/dist/riscv.js +0 -6
  319. package/dist/rose-pine-dawn.js +0 -4
  320. package/dist/rose-pine-moon.js +0 -4
  321. package/dist/rose-pine.js +0 -4
  322. package/dist/rosmsg.js +0 -6
  323. package/dist/rst.js +0 -22
  324. package/dist/ruby.js +0 -30
  325. package/dist/rust.js +0 -6
  326. package/dist/sankeyDiagram-TZEHDZUN2.js +0 -418
  327. package/dist/sankeyLinkHorizontal.js +0 -403
  328. package/dist/sas.js +0 -8
  329. package/dist/sass.js +0 -6
  330. package/dist/scala.js +0 -6
  331. package/dist/scheme.js +0 -6
  332. package/dist/scss.js +0 -8
  333. package/dist/sdbl.js +0 -6
  334. package/dist/sequenceDiagram-WL72ISMW2.js +0 -2523
  335. package/dist/shaderlab.js +0 -8
  336. package/dist/shellscript.js +0 -6
  337. package/dist/shellsession.js +0 -8
  338. package/dist/slack-dark.js +0 -4
  339. package/dist/slack-ochin.js +0 -4
  340. package/dist/smalltalk.js +0 -6
  341. package/dist/snazzy-light.js +0 -4
  342. package/dist/solarized-dark.js +0 -4
  343. package/dist/solarized-light.js +0 -4
  344. package/dist/solidity.js +0 -6
  345. package/dist/soy.js +0 -8
  346. package/dist/sparql.js +0 -8
  347. package/dist/splunk.js +0 -6
  348. package/dist/sql.js +0 -6
  349. package/dist/ssh-config.js +0 -6
  350. package/dist/stata.js +0 -8
  351. package/dist/stateDiagram-FKZM4ZOC2.js +0 -264
  352. package/dist/stateDiagram-v2-4FDKWEC32.js +0 -17
  353. package/dist/stylus.js +0 -6
  354. package/dist/svelte.js +0 -14
  355. package/dist/swift.js +0 -6
  356. package/dist/synthwave-84.js +0 -4
  357. package/dist/system-verilog.js +0 -6
  358. package/dist/systemd.js +0 -6
  359. package/dist/talonscript.js +0 -6
  360. package/dist/tasl.js +0 -6
  361. package/dist/tcl.js +0 -6
  362. package/dist/templ.js +0 -12
  363. package/dist/terraform.js +0 -6
  364. package/dist/tex.js +0 -8
  365. package/dist/time.js +0 -900
  366. package/dist/timeline-definition-IT6M3QCI2.js +0 -802
  367. package/dist/tokyo-night.js +0 -4
  368. package/dist/toml.js +0 -6
  369. package/dist/ts-tags.js +0 -41
  370. package/dist/tsv.js +0 -6
  371. package/dist/tsx.js +0 -6
  372. package/dist/turtle.js +0 -6
  373. package/dist/twig.js +0 -18
  374. package/dist/typescript.js +0 -6
  375. package/dist/typespec.js +0 -6
  376. package/dist/typst.js +0 -6
  377. package/dist/union.js +0 -8
  378. package/dist/v.js +0 -6
  379. package/dist/vala.js +0 -6
  380. package/dist/vb.js +0 -6
  381. package/dist/verilog.js +0 -6
  382. package/dist/vesper.js +0 -4
  383. package/dist/vhdl.js +0 -6
  384. package/dist/viml.js +0 -6
  385. package/dist/vitesse-black.js +0 -4
  386. package/dist/vitesse-dark.js +0 -4
  387. package/dist/vitesse-light.js +0 -4
  388. package/dist/vue-html.js +0 -8
  389. package/dist/vue-vine.js +0 -18
  390. package/dist/vue.js +0 -31
  391. package/dist/vyper.js +0 -6
  392. package/dist/wasm.js +0 -7
  393. package/dist/wasm2.js +0 -6
  394. package/dist/wenyan.js +0 -6
  395. package/dist/wgsl.js +0 -6
  396. package/dist/wikitext.js +0 -6
  397. package/dist/wit.js +0 -6
  398. package/dist/wolfram.js +0 -6
  399. package/dist/xml.js +0 -8
  400. package/dist/xsl.js +0 -8
  401. package/dist/xychartDiagram-PRI3JC2R2.js +0 -1299
  402. package/dist/yaml.js +0 -6
  403. package/dist/zenscript.js +0 -6
  404. package/dist/zig.js +0 -6
  405. package/dist/zipObject.js +0 -128
@@ -1,713 +0,0 @@
1
- import { p as Z } from "./chunk-4BX2VUAB2.js";
2
- import { I as F } from "./chunk-QZHKN3VN2.js";
3
- import { b6 as U, aG as h, aM as rr, b7 as er, b8 as tr, b9 as ar, aS as m, aI as nr, aJ as sr, aK as or, aL as cr, aV as ir, aW as dr, aO as B, b0 as hr, a$ as lr, ba as $r } from "./CoachForm.js";
4
- import { p as fr } from "./mermaid-parser.core.js";
5
- import { s as gr } from "./redux-toolkit.modern.js";
6
- var u = {
7
- NORMAL: 0,
8
- REVERSE: 1,
9
- HIGHLIGHT: 2,
10
- MERGE: 3,
11
- CHERRY_PICK: 4
12
- }, yr = U.gitGraph, z = /* @__PURE__ */ h(() => er({
13
- ...yr,
14
- ...tr().gitGraph
15
- }), "getConfig"), i = new F(() => {
16
- const t = z(), r = t.mainBranchName, a = t.mainBranchOrder;
17
- return {
18
- mainBranchName: r,
19
- commits: /* @__PURE__ */ new Map(),
20
- head: null,
21
- branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: a }]]),
22
- branches: /* @__PURE__ */ new Map([[r, null]]),
23
- currBranch: r,
24
- direction: "LR",
25
- seq: 0,
26
- options: {}
27
- };
28
- });
29
- function S() {
30
- return ar({ length: 7 });
31
- }
32
- h(S, "getID");
33
- function N(t, r) {
34
- const a = /* @__PURE__ */ Object.create(null);
35
- return t.reduce((s, e) => {
36
- const n = r(e);
37
- return a[n] || (a[n] = !0, s.push(e)), s;
38
- }, []);
39
- }
40
- h(N, "uniqBy");
41
- var xr = /* @__PURE__ */ h(function(t) {
42
- i.records.direction = t;
43
- }, "setDirection"), ur = /* @__PURE__ */ h(function(t) {
44
- m.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
45
- try {
46
- i.records.options = JSON.parse(t);
47
- } catch (r) {
48
- m.error("error while parsing gitGraph options", r.message);
49
- }
50
- }, "setOptions"), pr = /* @__PURE__ */ h(function() {
51
- return i.records.options;
52
- }, "getOptions"), br = /* @__PURE__ */ h(function(t) {
53
- let r = t.msg, a = t.id;
54
- const s = t.type;
55
- let e = t.tags;
56
- m.info("commit", r, a, s, e), m.debug("Entering commit:", r, a, s, e);
57
- const n = z();
58
- a = B.sanitizeText(a, n), r = B.sanitizeText(r, n), e = e == null ? void 0 : e.map((o) => B.sanitizeText(o, n));
59
- const c = {
60
- id: a || i.records.seq + "-" + S(),
61
- message: r,
62
- seq: i.records.seq++,
63
- type: s ?? u.NORMAL,
64
- tags: e ?? [],
65
- parents: i.records.head == null ? [] : [i.records.head.id],
66
- branch: i.records.currBranch
67
- };
68
- i.records.head = c, m.info("main branch", n.mainBranchName), i.records.commits.has(c.id) && m.warn(`Commit ID ${c.id} already exists`), i.records.commits.set(c.id, c), i.records.branches.set(i.records.currBranch, c.id), m.debug("in pushCommit " + c.id);
69
- }, "commit"), mr = /* @__PURE__ */ h(function(t) {
70
- let r = t.name;
71
- const a = t.order;
72
- if (r = B.sanitizeText(r, z()), i.records.branches.has(r))
73
- throw new Error(
74
- `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
75
- );
76
- i.records.branches.set(r, i.records.head != null ? i.records.head.id : null), i.records.branchConfig.set(r, { name: r, order: a }), _(r), m.debug("in createBranch");
77
- }, "branch"), wr = /* @__PURE__ */ h((t) => {
78
- let r = t.branch, a = t.id;
79
- const s = t.type, e = t.tags, n = z();
80
- r = B.sanitizeText(r, n), a && (a = B.sanitizeText(a, n));
81
- const c = i.records.branches.get(i.records.currBranch), o = i.records.branches.get(r), $ = c ? i.records.commits.get(c) : void 0, l = o ? i.records.commits.get(o) : void 0;
82
- if ($ && l && $.branch === r)
83
- throw new Error(`Cannot merge branch '${r}' into itself.`);
84
- if (i.records.currBranch === r) {
85
- const d = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
86
- throw d.hash = {
87
- text: `merge ${r}`,
88
- token: `merge ${r}`,
89
- expected: ["branch abc"]
90
- }, d;
91
- }
92
- if ($ === void 0 || !$) {
93
- const d = new Error(
94
- `Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`
95
- );
96
- throw d.hash = {
97
- text: `merge ${r}`,
98
- token: `merge ${r}`,
99
- expected: ["commit"]
100
- }, d;
101
- }
102
- if (!i.records.branches.has(r)) {
103
- const d = new Error(
104
- 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
105
- );
106
- throw d.hash = {
107
- text: `merge ${r}`,
108
- token: `merge ${r}`,
109
- expected: [`branch ${r}`]
110
- }, d;
111
- }
112
- if (l === void 0 || !l) {
113
- const d = new Error(
114
- 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
115
- );
116
- throw d.hash = {
117
- text: `merge ${r}`,
118
- token: `merge ${r}`,
119
- expected: ['"commit"']
120
- }, d;
121
- }
122
- if ($ === l) {
123
- const d = new Error('Incorrect usage of "merge". Both branches have same head');
124
- throw d.hash = {
125
- text: `merge ${r}`,
126
- token: `merge ${r}`,
127
- expected: ["branch abc"]
128
- }, d;
129
- }
130
- if (a && i.records.commits.has(a)) {
131
- const d = new Error(
132
- 'Incorrect usage of "merge". Commit with id:' + a + " already exists, use different custom id"
133
- );
134
- throw d.hash = {
135
- text: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
136
- token: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
137
- expected: [
138
- `merge ${r} ${a}_UNIQUE ${s} ${e == null ? void 0 : e.join(" ")}`
139
- ]
140
- }, d;
141
- }
142
- const f = o || "", g = {
143
- id: a || `${i.records.seq}-${S()}`,
144
- message: `merged branch ${r} into ${i.records.currBranch}`,
145
- seq: i.records.seq++,
146
- parents: i.records.head == null ? [] : [i.records.head.id, f],
147
- branch: i.records.currBranch,
148
- type: u.MERGE,
149
- customType: s,
150
- customId: !!a,
151
- tags: e ?? []
152
- };
153
- i.records.head = g, i.records.commits.set(g.id, g), i.records.branches.set(i.records.currBranch, g.id), m.debug(i.records.branches), m.debug("in mergeBranch");
154
- }, "merge"), vr = /* @__PURE__ */ h(function(t) {
155
- let r = t.id, a = t.targetId, s = t.tags, e = t.parent;
156
- m.debug("Entering cherryPick:", r, a, s);
157
- const n = z();
158
- if (r = B.sanitizeText(r, n), a = B.sanitizeText(a, n), s = s == null ? void 0 : s.map(($) => B.sanitizeText($, n)), e = B.sanitizeText(e, n), !r || !i.records.commits.has(r)) {
159
- const $ = new Error(
160
- 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
161
- );
162
- throw $.hash = {
163
- text: `cherryPick ${r} ${a}`,
164
- token: `cherryPick ${r} ${a}`,
165
- expected: ["cherry-pick abc"]
166
- }, $;
167
- }
168
- const c = i.records.commits.get(r);
169
- if (c === void 0 || !c)
170
- throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
171
- if (e && !(Array.isArray(c.parents) && c.parents.includes(e)))
172
- throw new Error(
173
- "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
174
- );
175
- const o = c.branch;
176
- if (c.type === u.MERGE && !e)
177
- throw new Error(
178
- "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
179
- );
180
- if (!a || !i.records.commits.has(a)) {
181
- if (o === i.records.currBranch) {
182
- const g = new Error(
183
- 'Incorrect usage of "cherryPick". Source commit is already on current branch'
184
- );
185
- throw g.hash = {
186
- text: `cherryPick ${r} ${a}`,
187
- token: `cherryPick ${r} ${a}`,
188
- expected: ["cherry-pick abc"]
189
- }, g;
190
- }
191
- const $ = i.records.branches.get(i.records.currBranch);
192
- if ($ === void 0 || !$) {
193
- const g = new Error(
194
- `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
195
- );
196
- throw g.hash = {
197
- text: `cherryPick ${r} ${a}`,
198
- token: `cherryPick ${r} ${a}`,
199
- expected: ["cherry-pick abc"]
200
- }, g;
201
- }
202
- const l = i.records.commits.get($);
203
- if (l === void 0 || !l) {
204
- const g = new Error(
205
- `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
206
- );
207
- throw g.hash = {
208
- text: `cherryPick ${r} ${a}`,
209
- token: `cherryPick ${r} ${a}`,
210
- expected: ["cherry-pick abc"]
211
- }, g;
212
- }
213
- const f = {
214
- id: i.records.seq + "-" + S(),
215
- message: `cherry-picked ${c == null ? void 0 : c.message} into ${i.records.currBranch}`,
216
- seq: i.records.seq++,
217
- parents: i.records.head == null ? [] : [i.records.head.id, c.id],
218
- branch: i.records.currBranch,
219
- type: u.CHERRY_PICK,
220
- tags: s ? s.filter(Boolean) : [
221
- `cherry-pick:${c.id}${c.type === u.MERGE ? `|parent:${e}` : ""}`
222
- ]
223
- };
224
- i.records.head = f, i.records.commits.set(f.id, f), i.records.branches.set(i.records.currBranch, f.id), m.debug(i.records.branches), m.debug("in cherryPick");
225
- }
226
- }, "cherryPick"), _ = /* @__PURE__ */ h(function(t) {
227
- if (t = B.sanitizeText(t, z()), i.records.branches.has(t)) {
228
- i.records.currBranch = t;
229
- const r = i.records.branches.get(i.records.currBranch);
230
- r === void 0 || !r ? i.records.head = null : i.records.head = i.records.commits.get(r) ?? null;
231
- } else {
232
- const r = new Error(
233
- `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
234
- );
235
- throw r.hash = {
236
- text: `checkout ${t}`,
237
- token: `checkout ${t}`,
238
- expected: [`branch ${t}`]
239
- }, r;
240
- }
241
- }, "checkout");
242
- function A(t, r, a) {
243
- const s = t.indexOf(r);
244
- s === -1 ? t.push(a) : t.splice(s, 1, a);
245
- }
246
- h(A, "upsert");
247
- function D(t) {
248
- const r = t.reduce((e, n) => e.seq > n.seq ? e : n, t[0]);
249
- let a = "";
250
- t.forEach(function(e) {
251
- e === r ? a += " *" : a += " |";
252
- });
253
- const s = [a, r.id, r.seq];
254
- for (const e in i.records.branches)
255
- i.records.branches.get(e) === r.id && s.push(e);
256
- if (m.debug(s.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
257
- const e = i.records.commits.get(r.parents[0]);
258
- A(t, r, e), r.parents[1] && t.push(i.records.commits.get(r.parents[1]));
259
- } else {
260
- if (r.parents.length == 0)
261
- return;
262
- if (r.parents[0]) {
263
- const e = i.records.commits.get(r.parents[0]);
264
- A(t, r, e);
265
- }
266
- }
267
- t = N(t, (e) => e.id), D(t);
268
- }
269
- h(D, "prettyPrintCommitHistory");
270
- var Cr = /* @__PURE__ */ h(function() {
271
- m.debug(i.records.commits);
272
- const t = V()[0];
273
- D([t]);
274
- }, "prettyPrint"), Er = /* @__PURE__ */ h(function() {
275
- i.reset(), hr();
276
- }, "clear"), Br = /* @__PURE__ */ h(function() {
277
- return [...i.records.branchConfig.values()].map((r, a) => r.order !== null && r.order !== void 0 ? r : {
278
- ...r,
279
- order: parseFloat(`0.${a}`)
280
- }).sort((r, a) => (r.order ?? 0) - (a.order ?? 0)).map(({ name: r }) => ({ name: r }));
281
- }, "getBranchesAsObjArray"), kr = /* @__PURE__ */ h(function() {
282
- return i.records.branches;
283
- }, "getBranches"), Lr = /* @__PURE__ */ h(function() {
284
- return i.records.commits;
285
- }, "getCommits"), V = /* @__PURE__ */ h(function() {
286
- const t = [...i.records.commits.values()];
287
- return t.forEach(function(r) {
288
- m.debug(r.id);
289
- }), t.sort((r, a) => r.seq - a.seq), t;
290
- }, "getCommitsArray"), Tr = /* @__PURE__ */ h(function() {
291
- return i.records.currBranch;
292
- }, "getCurrentBranch"), Mr = /* @__PURE__ */ h(function() {
293
- return i.records.direction;
294
- }, "getDirection"), Rr = /* @__PURE__ */ h(function() {
295
- return i.records.head;
296
- }, "getHead"), J = {
297
- commitType: u,
298
- getConfig: z,
299
- setDirection: xr,
300
- setOptions: ur,
301
- getOptions: pr,
302
- commit: br,
303
- branch: mr,
304
- merge: wr,
305
- cherryPick: vr,
306
- checkout: _,
307
- //reset,
308
- prettyPrint: Cr,
309
- clear: Er,
310
- getBranchesAsObjArray: Br,
311
- getBranches: kr,
312
- getCommits: Lr,
313
- getCommitsArray: V,
314
- getCurrentBranch: Tr,
315
- getDirection: Mr,
316
- getHead: Rr,
317
- setAccTitle: nr,
318
- getAccTitle: sr,
319
- getAccDescription: or,
320
- setAccDescription: cr,
321
- setDiagramTitle: ir,
322
- getDiagramTitle: dr
323
- }, Ir = /* @__PURE__ */ h((t, r) => {
324
- Z(t, r), t.dir && r.setDirection(t.dir);
325
- for (const a of t.statements)
326
- qr(a, r);
327
- }, "populate"), qr = /* @__PURE__ */ h((t, r) => {
328
- const s = {
329
- Commit: /* @__PURE__ */ h((e) => r.commit(Or(e)), "Commit"),
330
- Branch: /* @__PURE__ */ h((e) => r.branch(zr(e)), "Branch"),
331
- Merge: /* @__PURE__ */ h((e) => r.merge(Gr(e)), "Merge"),
332
- Checkout: /* @__PURE__ */ h((e) => r.checkout(Hr(e)), "Checkout"),
333
- CherryPicking: /* @__PURE__ */ h((e) => r.cherryPick(Pr(e)), "CherryPicking")
334
- }[t.$type];
335
- s ? s(t) : m.error(`Unknown statement type: ${t.$type}`);
336
- }, "parseStatement"), Or = /* @__PURE__ */ h((t) => ({
337
- id: t.id,
338
- msg: t.message ?? "",
339
- type: t.type !== void 0 ? u[t.type] : u.NORMAL,
340
- tags: t.tags ?? void 0
341
- }), "parseCommit"), zr = /* @__PURE__ */ h((t) => ({
342
- name: t.name,
343
- order: t.order ?? 0
344
- }), "parseBranch"), Gr = /* @__PURE__ */ h((t) => ({
345
- branch: t.branch,
346
- id: t.id ?? "",
347
- type: t.type !== void 0 ? u[t.type] : void 0,
348
- tags: t.tags ?? void 0
349
- }), "parseMerge"), Hr = /* @__PURE__ */ h((t) => t.branch, "parseCheckout"), Pr = /* @__PURE__ */ h((t) => {
350
- var a;
351
- return {
352
- id: t.id,
353
- targetId: "",
354
- tags: ((a = t.tags) == null ? void 0 : a.length) === 0 ? void 0 : t.tags,
355
- parent: t.parent
356
- };
357
- }, "parseCherryPicking"), Wr = {
358
- parse: /* @__PURE__ */ h(async (t) => {
359
- const r = await fr("gitGraph", t);
360
- m.debug(r), Ir(r, J);
361
- }, "parse")
362
- }, j = rr(), b = j == null ? void 0 : j.gitGraph, R = 10, I = 40, k = 4, L = 2, O = 8, C = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), P = 30, G = /* @__PURE__ */ new Map(), W = [], M = 0, x = "LR", Sr = /* @__PURE__ */ h(() => {
363
- C.clear(), E.clear(), G.clear(), M = 0, W = [], x = "LR";
364
- }, "clear"), X = /* @__PURE__ */ h((t) => {
365
- const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
366
- return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((s) => {
367
- const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
368
- e.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), e.setAttribute("dy", "1em"), e.setAttribute("x", "0"), e.setAttribute("class", "row"), e.textContent = s.trim(), r.appendChild(e);
369
- }), r;
370
- }, "drawText"), Q = /* @__PURE__ */ h((t) => {
371
- let r, a, s;
372
- return x === "BT" ? (a = /* @__PURE__ */ h((e, n) => e <= n, "comparisonFunc"), s = 1 / 0) : (a = /* @__PURE__ */ h((e, n) => e >= n, "comparisonFunc"), s = 0), t.forEach((e) => {
373
- var c, o;
374
- const n = x === "TB" || x == "BT" ? (c = E.get(e)) == null ? void 0 : c.y : (o = E.get(e)) == null ? void 0 : o.x;
375
- n !== void 0 && a(n, s) && (r = e, s = n);
376
- }), r;
377
- }, "findClosestParent"), jr = /* @__PURE__ */ h((t) => {
378
- let r = "", a = 1 / 0;
379
- return t.forEach((s) => {
380
- const e = E.get(s).y;
381
- e <= a && (r = s, a = e);
382
- }), r || void 0;
383
- }, "findClosestParentBT"), Ar = /* @__PURE__ */ h((t, r, a) => {
384
- let s = a, e = a;
385
- const n = [];
386
- t.forEach((c) => {
387
- const o = r.get(c);
388
- if (!o)
389
- throw new Error(`Commit not found for key ${c}`);
390
- o.parents.length ? (s = Kr(o), e = Math.max(s, e)) : n.push(o), Yr(o, s);
391
- }), s = e, n.forEach((c) => {
392
- Nr(c, s, a);
393
- }), t.forEach((c) => {
394
- const o = r.get(c);
395
- if (o != null && o.parents.length) {
396
- const $ = jr(o.parents);
397
- s = E.get($).y - I, s <= e && (e = s);
398
- const l = C.get(o.branch).pos, f = s - R;
399
- E.set(o.id, { x: l, y: f });
400
- }
401
- });
402
- }, "setParallelBTPos"), Dr = /* @__PURE__ */ h((t) => {
403
- var s;
404
- const r = Q(t.parents.filter((e) => e !== null));
405
- if (!r)
406
- throw new Error(`Closest parent not found for commit ${t.id}`);
407
- const a = (s = E.get(r)) == null ? void 0 : s.y;
408
- if (a === void 0)
409
- throw new Error(`Closest parent position not found for commit ${t.id}`);
410
- return a;
411
- }, "findClosestParentPos"), Kr = /* @__PURE__ */ h((t) => Dr(t) + I, "calculateCommitPosition"), Yr = /* @__PURE__ */ h((t, r) => {
412
- const a = C.get(t.branch);
413
- if (!a)
414
- throw new Error(`Branch not found for commit ${t.id}`);
415
- const s = a.pos, e = r + R;
416
- return E.set(t.id, { x: s, y: e }), { x: s, y: e };
417
- }, "setCommitPosition"), Nr = /* @__PURE__ */ h((t, r, a) => {
418
- const s = C.get(t.branch);
419
- if (!s)
420
- throw new Error(`Branch not found for commit ${t.id}`);
421
- const e = r + a, n = s.pos;
422
- E.set(t.id, { x: n, y: e });
423
- }, "setRootPosition"), _r = /* @__PURE__ */ h((t, r, a, s, e, n) => {
424
- if (n === u.HIGHLIGHT)
425
- t.append("rect").attr("x", a.x - 10).attr("y", a.y - 10).attr("width", 20).attr("height", 20).attr(
426
- "class",
427
- `commit ${r.id} commit-highlight${e % O} ${s}-outer`
428
- ), t.append("rect").attr("x", a.x - 6).attr("y", a.y - 6).attr("width", 12).attr("height", 12).attr(
429
- "class",
430
- `commit ${r.id} commit${e % O} ${s}-inner`
431
- );
432
- else if (n === u.CHERRY_PICK)
433
- t.append("circle").attr("cx", a.x).attr("cy", a.y).attr("r", 10).attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x - 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x + 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x + 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x - 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`);
434
- else {
435
- const c = t.append("circle");
436
- if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type === u.MERGE ? 9 : 10), c.attr("class", `commit ${r.id} commit${e % O}`), n === u.MERGE) {
437
- const o = t.append("circle");
438
- o.attr("cx", a.x), o.attr("cy", a.y), o.attr("r", 6), o.attr(
439
- "class",
440
- `commit ${s} ${r.id} commit${e % O}`
441
- );
442
- }
443
- n === u.REVERSE && t.append("path").attr(
444
- "d",
445
- `M ${a.x - 5},${a.y - 5}L${a.x + 5},${a.y + 5}M${a.x - 5},${a.y + 5}L${a.x + 5},${a.y - 5}`
446
- ).attr("class", `commit ${s} ${r.id} commit${e % O}`);
447
- }
448
- }, "drawCommitBullet"), Vr = /* @__PURE__ */ h((t, r, a, s) => {
449
- var e;
450
- if (r.type !== u.CHERRY_PICK && (r.customId && r.type === u.MERGE || r.type !== u.MERGE) && (b != null && b.showCommitLabel)) {
451
- const n = t.append("g"), c = n.insert("rect").attr("class", "commit-label-bkg"), o = n.append("text").attr("x", s).attr("y", a.y + 25).attr("class", "commit-label").text(r.id), $ = (e = o.node()) == null ? void 0 : e.getBBox();
452
- if ($ && (c.attr("x", a.posWithOffset - $.width / 2 - L).attr("y", a.y + 13.5).attr("width", $.width + 2 * L).attr("height", $.height + 2 * L), x === "TB" || x === "BT" ? (c.attr("x", a.x - ($.width + 4 * k + 5)).attr("y", a.y - 12), o.attr("x", a.x - ($.width + 4 * k)).attr("y", a.y + $.height - 12)) : o.attr("x", a.posWithOffset - $.width / 2), b.rotateCommitLabel))
453
- if (x === "TB" || x === "BT")
454
- o.attr(
455
- "transform",
456
- "rotate(-45, " + a.x + ", " + a.y + ")"
457
- ), c.attr(
458
- "transform",
459
- "rotate(-45, " + a.x + ", " + a.y + ")"
460
- );
461
- else {
462
- const l = -7.5 - ($.width + 10) / 25 * 9.5, f = 10 + $.width / 25 * 8.5;
463
- n.attr(
464
- "transform",
465
- "translate(" + l + ", " + f + ") rotate(-45, " + s + ", " + a.y + ")"
466
- );
467
- }
468
- }
469
- }, "drawCommitLabel"), Jr = /* @__PURE__ */ h((t, r, a, s) => {
470
- var e;
471
- if (r.tags.length > 0) {
472
- let n = 0, c = 0, o = 0;
473
- const $ = [];
474
- for (const l of r.tags.reverse()) {
475
- const f = t.insert("polygon"), g = t.append("circle"), d = t.append("text").attr("y", a.y - 16 - n).attr("class", "tag-label").text(l), y = (e = d.node()) == null ? void 0 : e.getBBox();
476
- if (!y)
477
- throw new Error("Tag bbox not found");
478
- c = Math.max(c, y.width), o = Math.max(o, y.height), d.attr("x", a.posWithOffset - y.width / 2), $.push({
479
- tag: d,
480
- hole: g,
481
- rect: f,
482
- yOffset: n
483
- }), n += 20;
484
- }
485
- for (const { tag: l, hole: f, rect: g, yOffset: d } of $) {
486
- const y = o / 2, p = a.y - 19.2 - d;
487
- if (g.attr("class", "tag-label-bkg").attr(
488
- "points",
489
- `
490
- ${s - c / 2 - k / 2},${p + L}
491
- ${s - c / 2 - k / 2},${p - L}
492
- ${a.posWithOffset - c / 2 - k},${p - y - L}
493
- ${a.posWithOffset + c / 2 + k},${p - y - L}
494
- ${a.posWithOffset + c / 2 + k},${p + y + L}
495
- ${a.posWithOffset - c / 2 - k},${p + y + L}`
496
- ), f.attr("cy", p).attr("cx", s - c / 2 + k / 2).attr("r", 1.5).attr("class", "tag-hole"), x === "TB" || x === "BT") {
497
- const w = s + d;
498
- g.attr("class", "tag-label-bkg").attr(
499
- "points",
500
- `
501
- ${a.x},${w + 2}
502
- ${a.x},${w - 2}
503
- ${a.x + R},${w - y - 2}
504
- ${a.x + R + c + 4},${w - y - 2}
505
- ${a.x + R + c + 4},${w + y + 2}
506
- ${a.x + R},${w + y + 2}`
507
- ).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), f.attr("cx", a.x + k / 2).attr("cy", w).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), l.attr("x", a.x + 5).attr("y", w + 3).attr("transform", "translate(14,14) rotate(45, " + a.x + "," + s + ")");
508
- }
509
- }
510
- }
511
- }, "drawCommitTags"), Xr = /* @__PURE__ */ h((t) => {
512
- switch (t.customType ?? t.type) {
513
- case u.NORMAL:
514
- return "commit-normal";
515
- case u.REVERSE:
516
- return "commit-reverse";
517
- case u.HIGHLIGHT:
518
- return "commit-highlight";
519
- case u.MERGE:
520
- return "commit-merge";
521
- case u.CHERRY_PICK:
522
- return "commit-cherry-pick";
523
- default:
524
- return "commit-normal";
525
- }
526
- }, "getCommitClassType"), Qr = /* @__PURE__ */ h((t, r, a, s) => {
527
- const e = { x: 0, y: 0 };
528
- if (t.parents.length > 0) {
529
- const n = Q(t.parents);
530
- if (n) {
531
- const c = s.get(n) ?? e;
532
- return r === "TB" ? c.y + I : r === "BT" ? (s.get(t.id) ?? e).y - I : c.x + I;
533
- }
534
- } else
535
- return r === "TB" ? P : r === "BT" ? (s.get(t.id) ?? e).y - I : 0;
536
- return 0;
537
- }, "calculatePosition"), Zr = /* @__PURE__ */ h((t, r, a) => {
538
- var c, o;
539
- const s = x === "BT" && a ? r : r + R, e = x === "TB" || x === "BT" ? s : (c = C.get(t.branch)) == null ? void 0 : c.pos, n = x === "TB" || x === "BT" ? (o = C.get(t.branch)) == null ? void 0 : o.pos : s;
540
- if (n === void 0 || e === void 0)
541
- throw new Error(`Position were undefined for commit ${t.id}`);
542
- return { x: n, y: e, posWithOffset: s };
543
- }, "getCommitPosition"), Y = /* @__PURE__ */ h((t, r, a) => {
544
- if (!b)
545
- throw new Error("GitGraph config not found");
546
- const s = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
547
- let n = x === "TB" || x === "BT" ? P : 0;
548
- const c = [...r.keys()], o = (b == null ? void 0 : b.parallelCommits) ?? !1, $ = /* @__PURE__ */ h((f, g) => {
549
- var p, w;
550
- const d = (p = r.get(f)) == null ? void 0 : p.seq, y = (w = r.get(g)) == null ? void 0 : w.seq;
551
- return d !== void 0 && y !== void 0 ? d - y : 0;
552
- }, "sortKeys");
553
- let l = c.sort($);
554
- x === "BT" && (o && Ar(l, r, n), l = l.reverse()), l.forEach((f) => {
555
- var y;
556
- const g = r.get(f);
557
- if (!g)
558
- throw new Error(`Commit not found for key ${f}`);
559
- o && (n = Qr(g, x, n, E));
560
- const d = Zr(g, n, o);
561
- if (a) {
562
- const p = Xr(g), w = g.customType ?? g.type, q = ((y = C.get(g.branch)) == null ? void 0 : y.index) ?? 0;
563
- _r(s, g, d, p, q, w), Vr(e, g, d, n), Jr(e, g, d, n);
564
- }
565
- x === "TB" || x === "BT" ? E.set(g.id, { x: d.x, y: d.posWithOffset }) : E.set(g.id, { x: d.posWithOffset, y: d.y }), n = x === "BT" && o ? n + I : n + I + R, n > M && (M = n);
566
- });
567
- }, "drawCommits"), Fr = /* @__PURE__ */ h((t, r, a, s, e) => {
568
- const c = (x === "TB" || x === "BT" ? a.x < s.x : a.y < s.y) ? r.branch : t.branch, o = /* @__PURE__ */ h((l) => l.branch === c, "isOnBranchToGetCurve"), $ = /* @__PURE__ */ h((l) => l.seq > t.seq && l.seq < r.seq, "isBetweenCommits");
569
- return [...e.values()].some((l) => $(l) && o(l));
570
- }, "shouldRerouteArrow"), H = /* @__PURE__ */ h((t, r, a = 0) => {
571
- const s = t + Math.abs(t - r) / 2;
572
- if (a > 5)
573
- return s;
574
- if (W.every((c) => Math.abs(c - s) >= 10))
575
- return W.push(s), s;
576
- const n = Math.abs(t - r);
577
- return H(t, r - n / 5, a + 1);
578
- }, "findLane"), Ur = /* @__PURE__ */ h((t, r, a, s) => {
579
- var y, p, w, q, K;
580
- const e = E.get(r.id), n = E.get(a.id);
581
- if (e === void 0 || n === void 0)
582
- throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);
583
- const c = Fr(r, a, e, n, s);
584
- let o = "", $ = "", l = 0, f = 0, g = (y = C.get(a.branch)) == null ? void 0 : y.index;
585
- a.type === u.MERGE && r.id !== a.parents[0] && (g = (p = C.get(r.branch)) == null ? void 0 : p.index);
586
- let d;
587
- if (c) {
588
- o = "A 10 10, 0, 0, 0,", $ = "A 10 10, 0, 0, 1,", l = 10, f = 10;
589
- const T = e.y < n.y ? H(e.y, n.y) : H(n.y, e.y), v = e.x < n.x ? H(e.x, n.x) : H(n.x, e.x);
590
- x === "TB" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${$} ${v} ${e.y + f} L ${v} ${n.y - l} ${o} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (w = C.get(r.branch)) == null ? void 0 : w.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${o} ${v} ${e.y + f} L ${v} ${n.y - l} ${$} ${v - f} ${n.y} L ${n.x} ${n.y}`) : x === "BT" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${o} ${v} ${e.y - f} L ${v} ${n.y + l} ${$} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (q = C.get(r.branch)) == null ? void 0 : q.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${$} ${v} ${e.y - f} L ${v} ${n.y + l} ${o} ${v - f} ${n.y} L ${n.x} ${n.y}`) : e.y < n.y ? d = `M ${e.x} ${e.y} L ${e.x} ${T - l} ${o} ${e.x + f} ${T} L ${n.x - l} ${T} ${$} ${n.x} ${T + f} L ${n.x} ${n.y}` : (g = (K = C.get(r.branch)) == null ? void 0 : K.index, d = `M ${e.x} ${e.y} L ${e.x} ${T + l} ${$} ${e.x + f} ${T} L ${n.x - l} ${T} ${o} ${n.x} ${T - f} L ${n.x} ${n.y}`);
591
- } else
592
- o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, x === "TB" ? (e.x < n.x && (a.type === u.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === u.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${$} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x + l} ${e.y} ${o} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : x === "BT" ? (e.x < n.x && (a.type === u.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === u.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${o} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : (e.y < n.y && (a.type === u.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y > n.y && (a.type === u.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y === n.y && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`));
593
- if (d === void 0)
594
- throw new Error("Line definition not found");
595
- t.append("path").attr("d", d).attr("class", "arrow arrow" + g % O);
596
- }, "drawArrow"), re = /* @__PURE__ */ h((t, r) => {
597
- const a = t.append("g").attr("class", "commit-arrows");
598
- [...r.keys()].forEach((s) => {
599
- const e = r.get(s);
600
- e.parents && e.parents.length > 0 && e.parents.forEach((n) => {
601
- Ur(a, r.get(n), e, r);
602
- });
603
- });
604
- }, "drawArrows"), ee = /* @__PURE__ */ h((t, r) => {
605
- const a = t.append("g");
606
- r.forEach((s, e) => {
607
- var p;
608
- const n = e % O, c = (p = C.get(s.name)) == null ? void 0 : p.pos;
609
- if (c === void 0)
610
- throw new Error(`Position not found for branch ${s.name}`);
611
- const o = a.append("line");
612
- o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n), x === "TB" ? (o.attr("y1", P), o.attr("x1", c), o.attr("y2", M), o.attr("x2", c)) : x === "BT" && (o.attr("y1", M), o.attr("x1", c), o.attr("y2", P), o.attr("x2", c)), W.push(c);
613
- const $ = s.name, l = X($), f = a.insert("rect"), d = a.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + n);
614
- d.node().appendChild(l);
615
- const y = l.getBBox();
616
- f.attr("class", "branchLabelBkg label" + n).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), d.attr(
617
- "transform",
618
- "translate(" + (-y.width - 14 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (c - y.height / 2 - 1) + ")"
619
- ), x === "TB" ? (f.attr("x", c - y.width / 2 - 10).attr("y", 0), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", 0)")) : x === "BT" ? (f.attr("x", c - y.width / 2 - 10).attr("y", M), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", " + M + ")")) : f.attr("transform", "translate(-19, " + (c - y.height / 2) + ")");
620
- });
621
- }, "drawBranches"), te = /* @__PURE__ */ h(function(t, r, a, s, e) {
622
- return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (x === "TB" || x === "BT" ? s.width / 2 : 0), r;
623
- }, "setBranchPosition"), ae = /* @__PURE__ */ h(function(t, r, a, s) {
624
- if (Sr(), m.debug("in gitgraph renderer", t + `
625
- `, "id:", r, a), !b)
626
- throw new Error("GitGraph config not found");
627
- const e = b.rotateCommitLabel ?? !1, n = s.db;
628
- G = n.getCommits();
629
- const c = n.getBranchesAsObjArray();
630
- x = n.getDirection();
631
- const o = gr(`[id="${r}"]`);
632
- let $ = 0;
633
- c.forEach((l, f) => {
634
- var q;
635
- const g = X(l.name), d = o.append("g"), y = d.insert("g").attr("class", "branchLabel"), p = y.insert("g").attr("class", "label branch-label");
636
- (q = p.node()) == null || q.appendChild(g);
637
- const w = g.getBBox();
638
- $ = te(l.name, $, f, w, e), p.remove(), y.remove(), d.remove();
639
- }), Y(o, G, !1), b.showBranches && ee(o, c), re(o, G), Y(o, G, !0), lr.insertTitle(
640
- o,
641
- "gitTitleText",
642
- b.titleTopMargin ?? 0,
643
- n.getDiagramTitle()
644
- ), $r(
645
- void 0,
646
- o,
647
- b.diagramPadding,
648
- b.useMaxWidth
649
- );
650
- }, "draw"), ne = {
651
- draw: ae
652
- }, se = /* @__PURE__ */ h((t) => `
653
- .commit-id,
654
- .commit-msg,
655
- .branch-label {
656
- fill: lightgrey;
657
- color: lightgrey;
658
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
659
- font-family: var(--mermaid-font-family);
660
- }
661
- ${[0, 1, 2, 3, 4, 5, 6, 7].map(
662
- (r) => `
663
- .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; }
664
- .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; }
665
- .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; }
666
- .label${r} { fill: ${t["git" + r]}; }
667
- .arrow${r} { stroke: ${t["git" + r]}; }
668
- `
669
- ).join(`
670
- `)}
671
-
672
- .branch {
673
- stroke-width: 1;
674
- stroke: ${t.lineColor};
675
- stroke-dasharray: 2;
676
- }
677
- .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
678
- .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
679
- .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
680
- .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
681
- .tag-hole { fill: ${t.textColor}; }
682
-
683
- .commit-merge {
684
- stroke: ${t.primaryColor};
685
- fill: ${t.primaryColor};
686
- }
687
- .commit-reverse {
688
- stroke: ${t.primaryColor};
689
- fill: ${t.primaryColor};
690
- stroke-width: 3;
691
- }
692
- .commit-highlight-outer {
693
- }
694
- .commit-highlight-inner {
695
- stroke: ${t.primaryColor};
696
- fill: ${t.primaryColor};
697
- }
698
-
699
- .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
700
- .gitTitleText {
701
- text-anchor: middle;
702
- font-size: 18px;
703
- fill: ${t.textColor};
704
- }
705
- `, "getStyles"), oe = se, $e = {
706
- parser: Wr,
707
- db: J,
708
- renderer: ne,
709
- styles: oe
710
- };
711
- export {
712
- $e as diagram
713
- };