@altimateai/ui-components 0.0.77-combobox-beta1 → 0.0.78-beta.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 (405) hide show
  1. package/dist/CoachForm.css +1 -1
  2. package/dist/CoachForm.js +68190 -24455
  3. package/dist/DbtDocsRenderer.js +1 -1
  4. package/dist/Stack.js +2868 -2222
  5. package/dist/Switch.js +128 -87
  6. package/dist/ToggleGroup.js +6185 -4997
  7. package/dist/_basePickBy.js +60 -60
  8. package/dist/_baseUniq.js +152 -152
  9. package/dist/abap.js +6 -0
  10. package/dist/actionscript-3.js +6 -0
  11. package/dist/ada.js +6 -0
  12. package/dist/andromeeda.js +4 -0
  13. package/dist/angular-html.js +32 -0
  14. package/dist/angular-ts.js +21 -0
  15. package/dist/apache.js +6 -0
  16. package/dist/apex.js +6 -0
  17. package/dist/apl.js +16 -0
  18. package/dist/applescript.js +6 -0
  19. package/dist/ara.js +6 -0
  20. package/dist/arc.js +53 -53
  21. package/dist/architectureDiagram-VXUJARFQ.js +480 -4315
  22. package/dist/architectureDiagram-VXUJARFQ2.js +831 -0
  23. package/dist/asciidoc.js +6 -0
  24. package/dist/asm.js +6 -0
  25. package/dist/assets/icons/index.js +1 -1
  26. package/dist/astro.js +18 -0
  27. package/dist/aurora-x.js +4 -0
  28. package/dist/awk.js +6 -0
  29. package/dist/ayu-dark.js +4 -0
  30. package/dist/ballerina.js +6 -0
  31. package/dist/band.js +46 -0
  32. package/dist/bat.js +6 -0
  33. package/dist/beancount.js +6 -0
  34. package/dist/berry.js +6 -0
  35. package/dist/bibtex.js +6 -0
  36. package/dist/bicep.js +6 -0
  37. package/dist/blade.js +20 -0
  38. package/dist/blockDiagram-VD42YOAC.js +1 -1
  39. package/dist/blockDiagram-VD42YOAC2.js +2266 -0
  40. package/dist/bsl.js +8 -0
  41. package/dist/c.js +6 -0
  42. package/dist/c3.js +6 -0
  43. package/dist/c4Diagram-YG6GDRKO.js +22 -22
  44. package/dist/c4Diagram-YG6GDRKO2.js +1582 -0
  45. package/dist/cadence.js +6 -0
  46. package/dist/cairo.js +8 -0
  47. package/dist/catppuccin-frappe.js +4 -0
  48. package/dist/catppuccin-latte.js +4 -0
  49. package/dist/catppuccin-macchiato.js +4 -0
  50. package/dist/catppuccin-mocha.js +4 -0
  51. package/dist/channel.js +2 -2
  52. package/dist/chatbotV2/index.d.ts +57 -19
  53. package/dist/chatbotV2/index.js +91 -56
  54. package/dist/chunk-4BX2VUAB.js +1 -1
  55. package/dist/chunk-4BX2VUAB2.js +9 -0
  56. package/dist/chunk-55IACEB6.js +2 -2
  57. package/dist/chunk-55IACEB62.js +9 -0
  58. package/dist/chunk-B4BG7PRW.js +1 -1
  59. package/dist/chunk-B4BG7PRW2.js +1377 -0
  60. package/dist/chunk-DI55MBZ5.js +14 -14
  61. package/dist/chunk-DI55MBZ52.js +1382 -0
  62. package/dist/chunk-FMBD7UC4.js +1 -1
  63. package/dist/chunk-FMBD7UC42.js +19 -0
  64. package/dist/chunk-QN33PNHL.js +5 -5
  65. package/dist/chunk-QN33PNHL2.js +20 -0
  66. package/dist/chunk-QZHKN3VN.js +1 -1
  67. package/dist/chunk-QZHKN3VN2.js +15 -0
  68. package/dist/chunk-TZMSLE5B.js +1 -1
  69. package/dist/chunk-TZMSLE5B2.js +64 -0
  70. package/dist/clarity.js +6 -0
  71. package/dist/classDiagram-2ON5EDUG.js +1 -1
  72. package/dist/classDiagram-2ON5EDUG2.js +17 -0
  73. package/dist/classDiagram-v2-WZHVMYZB.js +1 -1
  74. package/dist/classDiagram-v2-WZHVMYZB2.js +17 -0
  75. package/dist/clojure.js +6 -0
  76. package/dist/cmake.js +6 -0
  77. package/dist/cobol.js +10 -0
  78. package/dist/code-block-37QAKDTI.js +27 -0
  79. package/dist/codeowners.js +6 -0
  80. package/dist/codeql.js +6 -0
  81. package/dist/coffee.js +8 -0
  82. package/dist/common-lisp.js +6 -0
  83. package/dist/coq.js +6 -0
  84. package/dist/cose-bilkent-S5V4N54A.js +160 -2535
  85. package/dist/cose-bilkent-S5V4N54A2.js +231 -0
  86. package/dist/cpp.js +18 -0
  87. package/dist/crystal.js +18 -0
  88. package/dist/csharp.js +6 -0
  89. package/dist/css.js +6 -0
  90. package/dist/csv.js +6 -0
  91. package/dist/cue.js +6 -0
  92. package/dist/cypher.js +6 -0
  93. package/dist/cytoscape-cose-bilkent.js +2380 -0
  94. package/dist/cytoscape-fcose.js +3840 -0
  95. package/dist/d.js +6 -0
  96. package/dist/dagre-6UL2VRFP.js +101 -101
  97. package/dist/dagre-6UL2VRFP2.js +447 -0
  98. package/dist/dark-plus.js +4 -0
  99. package/dist/dart.js +6 -0
  100. package/dist/dax.js +6 -0
  101. package/dist/dayjs.min.js +2 -2
  102. package/dist/defaultLocale.js +3 -3
  103. package/dist/desktop.js +6 -0
  104. package/dist/diagram-PSM6KHXK.js +198 -414
  105. package/dist/diagram-PSM6KHXK2.js +319 -0
  106. package/dist/diagram-QEK2KX5R.js +26 -26
  107. package/dist/diagram-QEK2KX5R2.js +221 -0
  108. package/dist/diagram-S2PKOQOG.js +12 -12
  109. package/dist/diagram-S2PKOQOG2.js +143 -0
  110. package/dist/diff.js +6 -0
  111. package/dist/docker.js +6 -0
  112. package/dist/dotenv.js +6 -0
  113. package/dist/dracula-soft.js +4 -0
  114. package/dist/dracula.js +4 -0
  115. package/dist/dream-maker.js +6 -0
  116. package/dist/edge.js +12 -0
  117. package/dist/elixir.js +8 -0
  118. package/dist/elm.js +8 -0
  119. package/dist/emacs-lisp.js +6 -0
  120. package/dist/erDiagram-Q2GNP2WA.js +1 -1
  121. package/dist/erDiagram-Q2GNP2WA2.js +843 -0
  122. package/dist/erb.js +10 -0
  123. package/dist/erlang.js +8 -0
  124. package/dist/everforest-dark.js +4 -0
  125. package/dist/everforest-light.js +4 -0
  126. package/dist/fennel.js +6 -0
  127. package/dist/fish.js +6 -0
  128. package/dist/flowDiagram-NV44I4VS.js +6 -6
  129. package/dist/flowDiagram-NV44I4VS2.js +1628 -0
  130. package/dist/fluent.js +6 -0
  131. package/dist/fortran-fixed-form.js +8 -0
  132. package/dist/fortran-free-form.js +6 -0
  133. package/dist/fsharp.js +8 -0
  134. package/dist/ganttDiagram-JELNMOA3.js +1788 -0
  135. package/dist/ganttDiagram-LVOFAZNH.js +843 -1718
  136. package/dist/gdresource.js +10 -0
  137. package/dist/gdscript.js +6 -0
  138. package/dist/gdshader.js +6 -0
  139. package/dist/genie.js +6 -0
  140. package/dist/gherkin.js +6 -0
  141. package/dist/git-commit.js +8 -0
  142. package/dist/git-rebase.js +8 -0
  143. package/dist/gitGraphDiagram-NY62KEGX.js +13 -13
  144. package/dist/gitGraphDiagram-NY62KEGX2.js +713 -0
  145. package/dist/github-dark-default.js +4 -0
  146. package/dist/github-dark-dimmed.js +4 -0
  147. package/dist/github-dark-high-contrast.js +4 -0
  148. package/dist/github-dark.js +4 -0
  149. package/dist/github-light-default.js +4 -0
  150. package/dist/github-light-high-contrast.js +4 -0
  151. package/dist/github-light.js +4 -0
  152. package/dist/gleam.js +6 -0
  153. package/dist/glimmer-js.js +14 -0
  154. package/dist/glimmer-ts.js +14 -0
  155. package/dist/glsl.js +8 -0
  156. package/dist/gn.js +6 -0
  157. package/dist/gnuplot.js +6 -0
  158. package/dist/go.js +6 -0
  159. package/dist/graph.js +17 -18
  160. package/dist/graph2.js +246 -0
  161. package/dist/graphql.js +14 -0
  162. package/dist/groovy.js +6 -0
  163. package/dist/gruvbox-dark-hard.js +4 -0
  164. package/dist/gruvbox-dark-medium.js +4 -0
  165. package/dist/gruvbox-dark-soft.js +4 -0
  166. package/dist/gruvbox-light-hard.js +4 -0
  167. package/dist/gruvbox-light-medium.js +4 -0
  168. package/dist/gruvbox-light-soft.js +4 -0
  169. package/dist/hack.js +10 -0
  170. package/dist/haml.js +10 -0
  171. package/dist/handlebars.js +14 -0
  172. package/dist/haskell.js +6 -0
  173. package/dist/haxe.js +6 -0
  174. package/dist/hcl.js +6 -0
  175. package/dist/hjson.js +6 -0
  176. package/dist/hlsl.js +6 -0
  177. package/dist/houston.js +4 -0
  178. package/dist/html-derivative.js +8 -0
  179. package/dist/html.js +10 -0
  180. package/dist/http.js +14 -0
  181. package/dist/hurl.js +12 -0
  182. package/dist/hxml.js +8 -0
  183. package/dist/hy.js +6 -0
  184. package/dist/imba.js +6 -0
  185. package/dist/index.d.ts +101 -6
  186. package/dist/index.js +37 -37
  187. package/dist/index2.js +216 -684
  188. package/dist/index3.js +689 -0
  189. package/dist/infoDiagram-F6ZHWCRC.js +14 -14
  190. package/dist/infoDiagram-WHAUD3N6.js +24 -0
  191. package/dist/ini.js +6 -0
  192. package/dist/java.js +6 -0
  193. package/dist/javascript.js +6 -0
  194. package/dist/jinja.js +11 -0
  195. package/dist/jison.js +8 -0
  196. package/dist/journeyDiagram-XKPGCS4Q.js +1 -1
  197. package/dist/journeyDiagram-XKPGCS4Q2.js +837 -0
  198. package/dist/json.js +6 -0
  199. package/dist/json5.js +6 -0
  200. package/dist/jsonc.js +6 -0
  201. package/dist/jsonl.js +6 -0
  202. package/dist/jsonnet.js +6 -0
  203. package/dist/jssm.js +6 -0
  204. package/dist/jsx.js +6 -0
  205. package/dist/julia.js +16 -0
  206. package/dist/kanagawa-dragon.js +4 -0
  207. package/dist/kanagawa-lotus.js +4 -0
  208. package/dist/kanagawa-wave.js +4 -0
  209. package/dist/kanban-definition-3W4ZIXB7.js +42 -42
  210. package/dist/kanban-definition-3W4ZIXB72.js +720 -0
  211. package/dist/katex2.js +11691 -0
  212. package/dist/kdl.js +6 -0
  213. package/dist/kotlin.js +6 -0
  214. package/dist/kusto.js +6 -0
  215. package/dist/laserwave.js +4 -0
  216. package/dist/latex.js +8 -0
  217. package/dist/layout.js +567 -678
  218. package/dist/layout2.js +1224 -0
  219. package/dist/lean.js +6 -0
  220. package/dist/less.js +6 -0
  221. package/dist/light-plus.js +4 -0
  222. package/dist/lineage/index.js +1082 -1089
  223. package/dist/linear.js +1 -1
  224. package/dist/liquid.js +14 -0
  225. package/dist/llvm.js +6 -0
  226. package/dist/log.js +6 -0
  227. package/dist/logo.js +6 -0
  228. package/dist/lua.js +8 -0
  229. package/dist/luau.js +6 -0
  230. package/dist/main.css +1 -1
  231. package/dist/main.js +151 -151
  232. package/dist/make.js +6 -0
  233. package/dist/markdown.js +6 -0
  234. package/dist/marko.js +14 -0
  235. package/dist/material-theme-darker.js +4 -0
  236. package/dist/material-theme-lighter.js +4 -0
  237. package/dist/material-theme-ocean.js +4 -0
  238. package/dist/material-theme-palenight.js +4 -0
  239. package/dist/material-theme.js +4 -0
  240. package/dist/matlab.js +6 -0
  241. package/dist/mdc.js +12 -0
  242. package/dist/mdx.js +6 -0
  243. package/dist/mermaid-4DMBBIKO.js +4 -0
  244. package/dist/mermaid-parser.core.js +155 -155
  245. package/dist/mermaid.js +6 -0
  246. package/dist/min-dark.js +4 -0
  247. package/dist/min-light.js +4 -0
  248. package/dist/mindmap-definition-VGOIOE7T.js +28 -28
  249. package/dist/mindmap-definition-VGOIOE7T2.js +786 -0
  250. package/dist/mipsasm.js +6 -0
  251. package/dist/mojo.js +6 -0
  252. package/dist/monokai.js +4 -0
  253. package/dist/moonbit.js +6 -0
  254. package/dist/move.js +6 -0
  255. package/dist/narrat.js +6 -0
  256. package/dist/nextflow.js +6 -0
  257. package/dist/nginx.js +8 -0
  258. package/dist/night-owl.js +4 -0
  259. package/dist/nim.js +20 -0
  260. package/dist/nix.js +9 -0
  261. package/dist/nord.js +4 -0
  262. package/dist/nushell.js +6 -0
  263. package/dist/objective-c.js +6 -0
  264. package/dist/objective-cpp.js +6 -0
  265. package/dist/ocaml.js +6 -0
  266. package/dist/one-dark-pro.js +4 -0
  267. package/dist/one-light.js +4 -0
  268. package/dist/openscad.js +6 -0
  269. package/dist/pascal.js +6 -0
  270. package/dist/perl.js +16 -0
  271. package/dist/php.js +18 -0
  272. package/dist/pie.js +45 -0
  273. package/dist/pieDiagram-ADFJNKIX.js +68 -108
  274. package/dist/pieDiagram-ADFJNKIX2.js +123 -0
  275. package/dist/pkl.js +6 -0
  276. package/dist/plastic.js +4 -0
  277. package/dist/plsql.js +6 -0
  278. package/dist/po.js +6 -0
  279. package/dist/poimandres.js +4 -0
  280. package/dist/polar.js +6 -0
  281. package/dist/postcss.js +6 -0
  282. package/dist/powerquery.js +6 -0
  283. package/dist/powershell.js +6 -0
  284. package/dist/prisma.js +6 -0
  285. package/dist/prolog.js +6 -0
  286. package/dist/proto.js +6 -0
  287. package/dist/pug.js +12 -0
  288. package/dist/puppet.js +6 -0
  289. package/dist/purescript.js +6 -0
  290. package/dist/python.js +6 -0
  291. package/dist/qml.js +8 -0
  292. package/dist/qmldir.js +6 -0
  293. package/dist/qss.js +6 -0
  294. package/dist/quadrantDiagram-AYHSOK5B.js +1 -1
  295. package/dist/quadrantDiagram-AYHSOK5B2.js +1025 -0
  296. package/dist/r.js +6 -0
  297. package/dist/racket.js +6 -0
  298. package/dist/raku.js +6 -0
  299. package/dist/razor.js +10 -0
  300. package/dist/red.js +4 -0
  301. package/dist/redux-toolkit.modern.js +563 -555
  302. package/dist/reg.js +6 -0
  303. package/dist/regexp.js +6 -0
  304. package/dist/rel.js +6 -0
  305. package/dist/requirementDiagram-UZGBJVZJ.js +14 -14
  306. package/dist/requirementDiagram-UZGBJVZJ2.js +852 -0
  307. package/dist/riscv.js +6 -0
  308. package/dist/rose-pine-dawn.js +4 -0
  309. package/dist/rose-pine-moon.js +4 -0
  310. package/dist/rose-pine.js +4 -0
  311. package/dist/rosmsg.js +6 -0
  312. package/dist/rst.js +22 -0
  313. package/dist/ruby.js +30 -0
  314. package/dist/rust.js +6 -0
  315. package/dist/sankeyDiagram-TZEHDZUN.js +229 -622
  316. package/dist/sankeyDiagram-TZEHDZUN2.js +418 -0
  317. package/dist/sankeyLinkHorizontal.js +403 -0
  318. package/dist/sas.js +8 -0
  319. package/dist/sass.js +6 -0
  320. package/dist/scala.js +6 -0
  321. package/dist/scheme.js +6 -0
  322. package/dist/scss.js +8 -0
  323. package/dist/sdbl.js +6 -0
  324. package/dist/sequenceDiagram-WL72ISMW.js +1 -1
  325. package/dist/sequenceDiagram-WL72ISMW2.js +2523 -0
  326. package/dist/shadcn/index.d.ts +43 -21
  327. package/dist/shadcn/index.js +7330 -5516
  328. package/dist/shaderlab.js +8 -0
  329. package/dist/shellscript.js +6 -0
  330. package/dist/shellsession.js +8 -0
  331. package/dist/slack-dark.js +4 -0
  332. package/dist/slack-ochin.js +4 -0
  333. package/dist/smalltalk.js +6 -0
  334. package/dist/snazzy-light.js +4 -0
  335. package/dist/solarized-dark.js +4 -0
  336. package/dist/solarized-light.js +4 -0
  337. package/dist/solidity.js +6 -0
  338. package/dist/soy.js +8 -0
  339. package/dist/sparql.js +8 -0
  340. package/dist/splunk.js +6 -0
  341. package/dist/sql.js +6 -0
  342. package/dist/ssh-config.js +6 -0
  343. package/dist/stata.js +8 -0
  344. package/dist/stateDiagram-FKZM4ZOC.js +33 -33
  345. package/dist/stateDiagram-FKZM4ZOC2.js +264 -0
  346. package/dist/stateDiagram-v2-4FDKWEC3.js +6 -6
  347. package/dist/stateDiagram-v2-4FDKWEC32.js +17 -0
  348. package/dist/storybook/Typography.stories.tsx +120 -93
  349. package/dist/stylus.js +6 -0
  350. package/dist/svelte.js +14 -0
  351. package/dist/swift.js +6 -0
  352. package/dist/synthwave-84.js +4 -0
  353. package/dist/system-verilog.js +6 -0
  354. package/dist/systemd.js +6 -0
  355. package/dist/talonscript.js +6 -0
  356. package/dist/tasl.js +6 -0
  357. package/dist/tcl.js +6 -0
  358. package/dist/templ.js +12 -0
  359. package/dist/terraform.js +6 -0
  360. package/dist/tex.js +8 -0
  361. package/dist/time.js +900 -0
  362. package/dist/timeline-definition-IT6M3QCI.js +63 -63
  363. package/dist/timeline-definition-IT6M3QCI2.js +802 -0
  364. package/dist/tokyo-night.js +4 -0
  365. package/dist/toml.js +6 -0
  366. package/dist/ts-tags.js +41 -0
  367. package/dist/tsv.js +6 -0
  368. package/dist/tsx.js +6 -0
  369. package/dist/turtle.js +6 -0
  370. package/dist/twig.js +18 -0
  371. package/dist/{types-ByRPUpXR.d.ts → types-UHJCpYj0.d.ts} +25 -116
  372. package/dist/typescript.js +6 -0
  373. package/dist/typespec.js +6 -0
  374. package/dist/typst.js +6 -0
  375. package/dist/union.js +8 -0
  376. package/dist/v.js +6 -0
  377. package/dist/vala.js +6 -0
  378. package/dist/vb.js +6 -0
  379. package/dist/verilog.js +6 -0
  380. package/dist/vesper.js +4 -0
  381. package/dist/vhdl.js +6 -0
  382. package/dist/viml.js +6 -0
  383. package/dist/vitesse-black.js +4 -0
  384. package/dist/vitesse-dark.js +4 -0
  385. package/dist/vitesse-light.js +4 -0
  386. package/dist/vue-html.js +8 -0
  387. package/dist/vue-vine.js +18 -0
  388. package/dist/vue.js +31 -0
  389. package/dist/vyper.js +6 -0
  390. package/dist/wasm.js +7 -0
  391. package/dist/wasm2.js +6 -0
  392. package/dist/wenyan.js +6 -0
  393. package/dist/wgsl.js +6 -0
  394. package/dist/wikitext.js +6 -0
  395. package/dist/wit.js +6 -0
  396. package/dist/wolfram.js +6 -0
  397. package/dist/xml.js +8 -0
  398. package/dist/xsl.js +8 -0
  399. package/dist/xychartDiagram-PRI3JC2R.js +449 -491
  400. package/dist/xychartDiagram-PRI3JC2R2.js +1299 -0
  401. package/dist/yaml.js +6 -0
  402. package/dist/zenscript.js +6 -0
  403. package/dist/zig.js +6 -0
  404. package/dist/zipObject.js +128 -0
  405. package/package.json +1 -1
@@ -0,0 +1,713 @@
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
+ };