@foris/ai-agent 0.9.1-beta.2 → 0.9.1-beta.3

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 (325) hide show
  1. package/dist/abap-Y8Dl9g_6.js +6 -0
  2. package/dist/actionscript-3-DZzbMeqX.js +6 -0
  3. package/dist/ada-vP6ak0IW.js +6 -0
  4. package/dist/ai-agent.es.js +14 -2779
  5. package/dist/ai-agent.umd.js +3213 -4
  6. package/dist/andromeeda-BIpZ7gaU.js +4 -0
  7. package/dist/angular-html-CHuhdNYa.js +32 -0
  8. package/dist/angular-ts-CkwnAxZa.js +32 -0
  9. package/dist/apache-BUjz-sD2.js +6 -0
  10. package/dist/apex-oLhhs58q.js +6 -0
  11. package/dist/apl-C8FRyJIY.js +24 -0
  12. package/dist/applescript-BPx7YFFu.js +6 -0
  13. package/dist/ara-Z2fSOxSw.js +6 -0
  14. package/dist/arc-BzRDGNYi.js +85 -0
  15. package/dist/architectureDiagram-VXUJARFQ-jlW87y1j.js +4682 -0
  16. package/dist/asciidoc-B-pCoB3G.js +6 -0
  17. package/dist/asm-BTWLY5ym.js +6 -0
  18. package/dist/astro-CAC4-sRr.js +25 -0
  19. package/dist/aurora-x-BwoVEUWZ.js +4 -0
  20. package/dist/awk-Fb0P9dkn.js +6 -0
  21. package/dist/ayu-dark-CxPZkpb2.js +4 -0
  22. package/dist/ballerina-oZK-YekG.js +6 -0
  23. package/dist/bat-0FvbqU9S.js +6 -0
  24. package/dist/beancount-DqJEb89h.js +6 -0
  25. package/dist/berry-DODBq_Ff.js +6 -0
  26. package/dist/bibtex-EULQRLY5.js +6 -0
  27. package/dist/bicep-BorU73w0.js +6 -0
  28. package/dist/blade-Bwl5-ENK.js +27 -0
  29. package/dist/blockDiagram-VD42YOAC-P4woNHAr.js +2415 -0
  30. package/dist/bsl-NkNNwerW.js +8 -0
  31. package/dist/c-eeMepfLm.js +6 -0
  32. package/dist/c4Diagram-YG6GDRKO-CB9WFLmJ.js +1593 -0
  33. package/dist/cadence-02UX7mW8.js +6 -0
  34. package/dist/cairo-Cp116741.js +18 -0
  35. package/dist/catppuccin-frappe-D3cH2rXe.js +4 -0
  36. package/dist/catppuccin-latte-C0LRGUW4.js +4 -0
  37. package/dist/catppuccin-macchiato-c5wQ11TT.js +4 -0
  38. package/dist/catppuccin-mocha-WMD6Qvya.js +4 -0
  39. package/dist/channel-B-TkD8Bv.js +5 -0
  40. package/dist/chunk-4BX2VUAB-DCjARiNr.js +9 -0
  41. package/dist/chunk-55IACEB6-DvmPHLo5.js +8 -0
  42. package/dist/chunk-B4BG7PRW-L08cVxNP.js +1377 -0
  43. package/dist/chunk-DI55MBZ5-zkyTO7pn.js +1383 -0
  44. package/dist/chunk-FMBD7UC4-BkpbM-uP.js +19 -0
  45. package/dist/chunk-QN33PNHL-DSFN3Uoh.js +20 -0
  46. package/dist/chunk-QZHKN3VN-CAgMv7Xo.js +15 -0
  47. package/dist/chunk-TZMSLE5B-B6GY_sBW.js +64 -0
  48. package/dist/clarity-PKm5CwqM.js +6 -0
  49. package/dist/classDiagram-2ON5EDUG-KqDAjO33.js +30 -0
  50. package/dist/classDiagram-v2-WZHVMYZB-KqDAjO33.js +30 -0
  51. package/dist/clojure-CXJfHrL3.js +6 -0
  52. package/dist/cmake-BJz8BOTU.js +6 -0
  53. package/dist/cobol-DNTp9HAy.js +20 -0
  54. package/dist/code-block-QI2IAROF-Culy9AKV.js +2042 -0
  55. package/dist/codeowners-Bt9yU6NX.js +6 -0
  56. package/dist/codeql-DHkodjjI.js +6 -0
  57. package/dist/coffee-BrprHIxF.js +18 -0
  58. package/dist/common-lisp-EVqT9Zhp.js +6 -0
  59. package/dist/coq-B0L9upzn.js +6 -0
  60. package/dist/cose-bilkent-S5V4N54A-DtppvcNV.js +2620 -0
  61. package/dist/cpp-CwJ5QP3s.js +29 -0
  62. package/dist/crystal-DWRgWI1Z.js +24 -0
  63. package/dist/csv-CmYOceLb.js +6 -0
  64. package/dist/cue-ZzumE7IT.js +6 -0
  65. package/dist/cypher-jpdmjtA6.js +6 -0
  66. package/dist/cytoscape.esm-ClN43hhW.js +18846 -0
  67. package/dist/d-CBagWSwH.js +6 -0
  68. package/dist/dagre-6UL2VRFP-BfvQz4N-.js +459 -0
  69. package/dist/dark-plus-pUHDTVV0.js +4 -0
  70. package/dist/dart-6ObCrKr9.js +6 -0
  71. package/dist/dax-CcDT-8dH.js +6 -0
  72. package/dist/defaultLocale-D1piDxzZ.js +177 -0
  73. package/dist/desktop-B93p9R9O.js +6 -0
  74. package/dist/diagram-PSM6KHXK-ka-cDwC2.js +552 -0
  75. package/dist/diagram-QEK2KX5R-BW-yTygZ.js +232 -0
  76. package/dist/diagram-S2PKOQOG-j24g_p7y.js +154 -0
  77. package/dist/diff-BxzP2J8R.js +6 -0
  78. package/dist/docker-CsHqm9tx.js +6 -0
  79. package/dist/dotenv-BMjVjUL1.js +6 -0
  80. package/dist/dracula-BtZx2Kac.js +4 -0
  81. package/dist/dracula-soft-BKa-aqBv.js +4 -0
  82. package/dist/dream-maker-PAx17jaB.js +6 -0
  83. package/dist/edge-B5_tHZZy.js +21 -0
  84. package/dist/elixir-Dj_1qPNg.js +18 -0
  85. package/dist/elm-DZPAA5Qn.js +9 -0
  86. package/dist/emacs-lisp-Cfxdx5D-.js +6 -0
  87. package/dist/erDiagram-Q2GNP2WA-BoiJgXhe.js +854 -0
  88. package/dist/erb-DiYOU0he.js +31 -0
  89. package/dist/erlang-CNRRyeIc.js +18 -0
  90. package/dist/everforest-dark-DMCBqXCK.js +4 -0
  91. package/dist/everforest-light-BbXl82Em.js +4 -0
  92. package/dist/fennel-N4WcXuKx.js +6 -0
  93. package/dist/fish-BTDEUgqH.js +6 -0
  94. package/dist/flowDiagram-NV44I4VS-BHGntIlE.js +1639 -0
  95. package/dist/fluent-BMXUxfv1.js +6 -0
  96. package/dist/fortran-fixed-form-DUsA-VGo.js +8 -0
  97. package/dist/fortran-free-form-DPIT_jbP.js +6 -0
  98. package/dist/fsharp-yevJ8DSS.js +18 -0
  99. package/dist/ganttDiagram-JELNMOA3-Ce8NwhCP.js +2710 -0
  100. package/dist/gdresource-BwtMIoBm.js +10 -0
  101. package/dist/gdscript-BifyeYhI.js +6 -0
  102. package/dist/gdshader-Bk8fF6yr.js +6 -0
  103. package/dist/genie-DzUvd7U9.js +6 -0
  104. package/dist/gherkin-DHRaV0YP.js +6 -0
  105. package/dist/git-commit-Bd32YZ0K.js +8 -0
  106. package/dist/git-rebase-BWMiWxYf.js +18 -0
  107. package/dist/gitGraphDiagram-NY62KEGX-DxoN7y5T.js +723 -0
  108. package/dist/github-dark-DenFmJkN.js +4 -0
  109. package/dist/github-dark-default-BJPUVz4H.js +4 -0
  110. package/dist/github-dark-dimmed-DUshB20C.js +4 -0
  111. package/dist/github-dark-high-contrast-D3aGCnF8.js +4 -0
  112. package/dist/github-light-JYsPkUQd.js +4 -0
  113. package/dist/github-light-default-D99KPAby.js +4 -0
  114. package/dist/github-light-high-contrast-BbmZE-Mp.js +4 -0
  115. package/dist/gleam-Bv284lvN.js +6 -0
  116. package/dist/glimmer-js-Nc7Kk_CN.js +21 -0
  117. package/dist/glimmer-ts-DLoneyA9.js +21 -0
  118. package/dist/glsl-CkUcVZNK.js +8 -0
  119. package/dist/gnuplot-yPG9-sE_.js +6 -0
  120. package/dist/graph-C-gpLwEq.js +1189 -0
  121. package/dist/graphql-CB9Yiq18.js +23 -0
  122. package/dist/groovy-CJQTphOW.js +6 -0
  123. package/dist/gruvbox-dark-hard-C5HOtKIh.js +4 -0
  124. package/dist/gruvbox-dark-medium-FVgwJHuz.js +4 -0
  125. package/dist/gruvbox-dark-soft-B46F314v.js +4 -0
  126. package/dist/gruvbox-light-hard-CJD38wDZ.js +4 -0
  127. package/dist/gruvbox-light-medium-BlIhMYTA.js +4 -0
  128. package/dist/gruvbox-light-soft-DoPHyLVZ.js +4 -0
  129. package/dist/hack-dNZDE7CK.js +19 -0
  130. package/dist/haml-CIHYN_l8.js +19 -0
  131. package/dist/handlebars-5wdAGqTJ.js +21 -0
  132. package/dist/haskell-WeIwNIP6.js +6 -0
  133. package/dist/haxe-TztHsm5T.js +6 -0
  134. package/dist/hcl-D438OF-I.js +6 -0
  135. package/dist/hjson-DYBUbqOl.js +6 -0
  136. package/dist/hlsl-Bk8TCZNL.js +6 -0
  137. package/dist/houston-BDYrDoDW.js +4 -0
  138. package/dist/html-derivative-89LwIO26.js +18 -0
  139. package/dist/http-Dsh8rSJR.js +26 -0
  140. package/dist/hurl-NdmqbL7E.js +26 -0
  141. package/dist/hxml-GbqSQCLa.js +8 -0
  142. package/dist/hy-Brt5EZ7-.js +6 -0
  143. package/dist/imba-CimUv-Uh.js +6 -0
  144. package/dist/index-C3mwt8G1.js +67982 -0
  145. package/dist/infoDiagram-WHAUD3N6-DdxAG2VL.js +35 -0
  146. package/dist/ini-BZIuRIvJ.js +6 -0
  147. package/dist/init-DjUOC4st.js +16 -0
  148. package/dist/java-DY6VlHhP.js +6 -0
  149. package/dist/jinja-BuwNoMI4.js +21 -0
  150. package/dist/jison-_q6rTsMi.js +18 -0
  151. package/dist/journeyDiagram-XKPGCS4Q-CT5Fbg6c.js +848 -0
  152. package/dist/json5-BT4Fjg39.js +6 -0
  153. package/dist/jsonc-CHjZD8gR.js +6 -0
  154. package/dist/jsonl-BGuvDmy9.js +6 -0
  155. package/dist/jsonnet-Bx2cfsXg.js +6 -0
  156. package/dist/jssm-BcADi6EI.js +6 -0
  157. package/dist/jsx-BtKADgXT.js +6 -0
  158. package/dist/julia-BCBeSq7V.js +27 -0
  159. package/dist/kanagawa-dragon-CiKur4Hl.js +4 -0
  160. package/dist/kanagawa-lotus-BKu-smKu.js +4 -0
  161. package/dist/kanagawa-wave-CQwozSzG.js +4 -0
  162. package/dist/kanban-definition-3W4ZIXB7-CxtMdkvq.js +732 -0
  163. package/dist/katex.min-l0sNRNKZ.js +1 -0
  164. package/dist/kdl-BNOv9TC3.js +6 -0
  165. package/dist/kotlin-ByBMgTeR.js +6 -0
  166. package/dist/kusto-VWFLl2T0.js +6 -0
  167. package/dist/laserwave-6a00oqik.js +4 -0
  168. package/dist/latex-DF20280u.js +9 -0
  169. package/dist/layout-D2NtTgFh.js +1730 -0
  170. package/dist/lean-D5yRrexI.js +6 -0
  171. package/dist/less-B1GLI2Di.js +6 -0
  172. package/dist/light-plus-CZuVqSLX.js +4 -0
  173. package/dist/linear-sERCAB61.js +277 -0
  174. package/dist/liquid-CFYzC-s7.js +21 -0
  175. package/dist/llvm-co1rIKs3.js +6 -0
  176. package/dist/log-Al8wyEFV.js +6 -0
  177. package/dist/logo-DBa4JDzV.js +6 -0
  178. package/dist/lua-kX5WP_P5.js +8 -0
  179. package/dist/luau-DtBSxLyz.js +6 -0
  180. package/dist/make-CsMclxtr.js +6 -0
  181. package/dist/marko-OTJE9YCh.js +23 -0
  182. package/dist/material-theme-D6KBX41T.js +4 -0
  183. package/dist/material-theme-darker-CkRroheE.js +4 -0
  184. package/dist/material-theme-lighter-BUBw43Yz.js +4 -0
  185. package/dist/material-theme-ocean-ClGX14Ja.js +4 -0
  186. package/dist/material-theme-palenight-C1RVm8K1.js +4 -0
  187. package/dist/matlab-BOAaUVP0.js +6 -0
  188. package/dist/mdc-tFNBAW39.js +21 -0
  189. package/dist/mdx-BOhZZUJ8.js +6 -0
  190. package/dist/mermaid-B0ixDHKN.js +6 -0
  191. package/dist/mermaid-NA5CF7SZ-620UJKEg.js +14 -0
  192. package/dist/mermaid.core-08D5Vldk.js +14401 -0
  193. package/dist/min-dark-C7ak0t6c.js +4 -0
  194. package/dist/min-light-CKFxVcPp.js +4 -0
  195. package/dist/mindmap-definition-VGOIOE7T-CTZ_Wx0b.js +798 -0
  196. package/dist/mipsasm-CTx18fBl.js +6 -0
  197. package/dist/mojo-BD611d7o.js +6 -0
  198. package/dist/monokai-C1KBYcO0.js +4 -0
  199. package/dist/move-F-dICmj2.js +6 -0
  200. package/dist/narrat-DmhDCBs-.js +6 -0
  201. package/dist/nextflow-DmSVRGjG.js +6 -0
  202. package/dist/nginx-COxS3qoU.js +9 -0
  203. package/dist/night-owl-Bm2rzalh.js +4 -0
  204. package/dist/nim-CZHmlxcO.js +28 -0
  205. package/dist/nix-BZK5F767.js +9 -0
  206. package/dist/nord-CC5OiUXg.js +4 -0
  207. package/dist/nushell-D8j3dhT-.js +6 -0
  208. package/dist/objective-c-Itk8tzmv.js +6 -0
  209. package/dist/objective-cpp-DGt5UKRO.js +6 -0
  210. package/dist/ocaml-eSVK32Eg.js +6 -0
  211. package/dist/openscad-Sp5uZ6f2.js +6 -0
  212. package/dist/ordinal-MUacOSdK.js +65 -0
  213. package/dist/pascal-xy8pJNns.js +6 -0
  214. package/dist/perl-CvmtpKyV.js +24 -0
  215. package/dist/php-B1tFq0rn.js +25 -0
  216. package/dist/pieDiagram-ADFJNKIX-DtleX3ES.js +173 -0
  217. package/dist/pkl-C-zSNmaA.js +6 -0
  218. package/dist/plastic-CSTz3KZp.js +4 -0
  219. package/dist/plsql-pVbGZfOv.js +6 -0
  220. package/dist/po-BNfHvqmm.js +6 -0
  221. package/dist/poimandres-C-VADXHD.js +4 -0
  222. package/dist/polar-CAZahv3u.js +6 -0
  223. package/dist/postcss-05aHdL-n.js +6 -0
  224. package/dist/powerquery-DI9HkTvs.js +6 -0
  225. package/dist/powershell-Clc4ydu-.js +6 -0
  226. package/dist/prisma-FZjmVtSl.js +6 -0
  227. package/dist/prolog-C5-yg4TO.js +6 -0
  228. package/dist/proto-MmCPeFAD.js +6 -0
  229. package/dist/pug-xpTstXA9.js +20 -0
  230. package/dist/puppet-CUJHmnxV.js +6 -0
  231. package/dist/purescript-rUfGld-4.js +6 -0
  232. package/dist/qml-G4_KKZym.js +18 -0
  233. package/dist/qmldir-BInDYbpo.js +6 -0
  234. package/dist/qss-AeJTysr_.js +6 -0
  235. package/dist/quadrantDiagram-AYHSOK5B-D193y_DL.js +1038 -0
  236. package/dist/r-Bm0uF0U2.js +6 -0
  237. package/dist/racket-B83wSAja.js +6 -0
  238. package/dist/raku-nEQ4ZJJ7.js +6 -0
  239. package/dist/razor-BS4LwTsw.js +19 -0
  240. package/dist/red-7y8PH7HH.js +4 -0
  241. package/dist/reg-m_s_Kiip.js +6 -0
  242. package/dist/regexp-BazyLpPg.js +6 -0
  243. package/dist/rel-BcRfyd6Q.js +6 -0
  244. package/dist/requirementDiagram-UZGBJVZJ-DcSe-m6d.js +864 -0
  245. package/dist/riscv-Ce8MAQLP.js +6 -0
  246. package/dist/rose-pine-BKc3yVeu.js +4 -0
  247. package/dist/rose-pine-dawn-BulJcPZT.js +4 -0
  248. package/dist/rose-pine-moon-j6jiXKV8.js +4 -0
  249. package/dist/rosmsg-Cz0w1km8.js +6 -0
  250. package/dist/rst-BvkiqG_4.js +39 -0
  251. package/dist/ruby-CSrNBwZK.js +40 -0
  252. package/dist/sankeyDiagram-TZEHDZUN-HpXuokMl.js +838 -0
  253. package/dist/sas-DciBl6hq.js +18 -0
  254. package/dist/sass-DxHp5rTx.js +6 -0
  255. package/dist/scala-D4grkFkl.js +6 -0
  256. package/dist/scheme-BCRWuEm4.js +6 -0
  257. package/dist/scss-Sr5SHsiH.js +18 -0
  258. package/dist/sdbl-B7T8abf4.js +6 -0
  259. package/dist/sequenceDiagram-WL72ISMW-D_5I_YtC.js +2530 -0
  260. package/dist/shaderlab-Cr62-Wb4.js +8 -0
  261. package/dist/shellsession-B0YIY3D-.js +18 -0
  262. package/dist/slack-dark-i7wN4OET.js +4 -0
  263. package/dist/slack-ochin-ndHf0LoP.js +4 -0
  264. package/dist/smalltalk-BlI1_OkM.js +6 -0
  265. package/dist/snazzy-light-BlSJXAu4.js +4 -0
  266. package/dist/solarized-dark-UTmkh7lw.js +4 -0
  267. package/dist/solarized-light-BheCkDPT.js +4 -0
  268. package/dist/solidity-DUWnFhS6.js +6 -0
  269. package/dist/soy-I6L3jl3W.js +18 -0
  270. package/dist/sparql-B0KWFEri.js +8 -0
  271. package/dist/splunk-CRXR8A9s.js +6 -0
  272. package/dist/ssh-config-DP-hNVbF.js +6 -0
  273. package/dist/stata-BNwq7-ev.js +18 -0
  274. package/dist/stateDiagram-FKZM4ZOC-CRSpvNED.js +276 -0
  275. package/dist/stateDiagram-v2-4FDKWEC3-DfUK-Zbc.js +29 -0
  276. package/dist/style.css +1 -1
  277. package/dist/stylus-CyKEU1Ej.js +6 -0
  278. package/dist/svelte-Din0yw3u.js +22 -0
  279. package/dist/swift-9UzSvamq.js +6 -0
  280. package/dist/synthwave-84-NU3C_KFZ.js +4 -0
  281. package/dist/system-verilog-BCm7smPJ.js +6 -0
  282. package/dist/systemd-C-4qm6XH.js +6 -0
  283. package/dist/talonscript-CFF3LF_O.js +6 -0
  284. package/dist/tasl-Cg_WBUAe.js +6 -0
  285. package/dist/tcl-DN7buRTF.js +6 -0
  286. package/dist/templ-CBu7yCES.js +20 -0
  287. package/dist/terraform-DGvcn9zM.js +6 -0
  288. package/dist/tex-DpOayVob.js +8 -0
  289. package/dist/timeline-definition-IT6M3QCI-DaJ4iEOK.js +813 -0
  290. package/dist/tokyo-night-DP4TmcQl.js +4 -0
  291. package/dist/treemap-KMMF4GRG-C3Ab2yjL.js +16045 -0
  292. package/dist/ts-tags-3Kvfz4et.js +49 -0
  293. package/dist/tsv-BtvSkaG0.js +6 -0
  294. package/dist/tsx-B8rCNbgL.js +6 -0
  295. package/dist/turtle-_H59FV7D.js +6 -0
  296. package/dist/twig-3l_q-6xZ.js +37 -0
  297. package/dist/typespec-DWqp-kUU.js +6 -0
  298. package/dist/typst-D_1QKWns.js +6 -0
  299. package/dist/v-BPCNiyYe.js +6 -0
  300. package/dist/vala-uxaPR7d1.js +6 -0
  301. package/dist/vb-D8_c5-KN.js +6 -0
  302. package/dist/verilog-B-bybjPF.js +6 -0
  303. package/dist/vesper-BckBta1U.js +4 -0
  304. package/dist/vhdl-CUlNa8ac.js +6 -0
  305. package/dist/viml-DsfA-sWm.js +6 -0
  306. package/dist/vitesse-black-BoGvW84i.js +4 -0
  307. package/dist/vitesse-dark-Cym-eLtO.js +4 -0
  308. package/dist/vitesse-light-CcmG315c.js +4 -0
  309. package/dist/vue-BuFQ04-G.js +37 -0
  310. package/dist/vue-html-CyxHqgfT.js +21 -0
  311. package/dist/vue-vine-B_YNGutq.js +30 -0
  312. package/dist/vyper-CPQuu50u.js +6 -0
  313. package/dist/wasm-BBXxrAl7.js +6 -0
  314. package/dist/wasm-DQxwEHae.js +7 -0
  315. package/dist/wenyan-pbVjoM9_.js +6 -0
  316. package/dist/wgsl-DY4iK1q1.js +6 -0
  317. package/dist/wikitext-Z-MoUasO.js +6 -0
  318. package/dist/wit-CQMQOlTg.js +6 -0
  319. package/dist/wolfram-Dz4KXISs.js +6 -0
  320. package/dist/xml-C2J0sS9M.js +8 -0
  321. package/dist/xsl-CbTBIiv3.js +9 -0
  322. package/dist/xychartDiagram-PRI3JC2R-Cf2smXg5.js +1353 -0
  323. package/dist/zenscript-CxBjpf9c.js +6 -0
  324. package/dist/zig-Vm0PO9wB.js +6 -0
  325. package/package.json +25 -25
@@ -0,0 +1,723 @@
1
+ import { p as Z } from "./chunk-4BX2VUAB-DCjARiNr.js";
2
+ import { I as F } from "./chunk-QZHKN3VN-CAgMv7Xo.js";
3
+ import { q as U, p as rr, s as er, g as tr, a as ar, b as nr, _ as h, l as m, d as sr, u as or, C as cr, y as ir, k as B, D as dr, E as hr, F as lr, c as $r, G as fr } from "./mermaid.core-08D5Vldk.js";
4
+ import { p as gr } from "./treemap-KMMF4GRG-C3Ab2yjL.js";
5
+ import "./index-C3mwt8G1.js";
6
+ import "react/jsx-runtime";
7
+ import "react";
8
+ import "class-variance-authority";
9
+ import "clsx";
10
+ import "tailwind-merge";
11
+ import "react-dom";
12
+ import "cmdk";
13
+ import "nanoid";
14
+ import "@foris/avocado-icons";
15
+ import "react-markdown";
16
+ var x = {
17
+ NORMAL: 0,
18
+ REVERSE: 1,
19
+ HIGHLIGHT: 2,
20
+ MERGE: 3,
21
+ CHERRY_PICK: 4
22
+ }, yr = hr.gitGraph, z = /* @__PURE__ */ h(() => dr({
23
+ ...yr,
24
+ ...lr().gitGraph
25
+ }), "getConfig"), i = new F(() => {
26
+ const t = z(), r = t.mainBranchName, a = t.mainBranchOrder;
27
+ return {
28
+ mainBranchName: r,
29
+ commits: /* @__PURE__ */ new Map(),
30
+ head: null,
31
+ branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: a }]]),
32
+ branches: /* @__PURE__ */ new Map([[r, null]]),
33
+ currBranch: r,
34
+ direction: "LR",
35
+ seq: 0,
36
+ options: {}
37
+ };
38
+ });
39
+ function S() {
40
+ return fr({ length: 7 });
41
+ }
42
+ h(S, "getID");
43
+ function N(t, r) {
44
+ const a = /* @__PURE__ */ Object.create(null);
45
+ return t.reduce((s, e) => {
46
+ const n = r(e);
47
+ return a[n] || (a[n] = !0, s.push(e)), s;
48
+ }, []);
49
+ }
50
+ h(N, "uniqBy");
51
+ var pr = /* @__PURE__ */ h(function(t) {
52
+ i.records.direction = t;
53
+ }, "setDirection"), xr = /* @__PURE__ */ h(function(t) {
54
+ m.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
55
+ try {
56
+ i.records.options = JSON.parse(t);
57
+ } catch (r) {
58
+ m.error("error while parsing gitGraph options", r.message);
59
+ }
60
+ }, "setOptions"), ur = /* @__PURE__ */ h(function() {
61
+ return i.records.options;
62
+ }, "getOptions"), br = /* @__PURE__ */ h(function(t) {
63
+ let r = t.msg, a = t.id;
64
+ const s = t.type;
65
+ let e = t.tags;
66
+ m.info("commit", r, a, s, e), m.debug("Entering commit:", r, a, s, e);
67
+ const n = z();
68
+ a = B.sanitizeText(a, n), r = B.sanitizeText(r, n), e = e == null ? void 0 : e.map((o) => B.sanitizeText(o, n));
69
+ const c = {
70
+ id: a || i.records.seq + "-" + S(),
71
+ message: r,
72
+ seq: i.records.seq++,
73
+ type: s ?? x.NORMAL,
74
+ tags: e ?? [],
75
+ parents: i.records.head == null ? [] : [i.records.head.id],
76
+ branch: i.records.currBranch
77
+ };
78
+ 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);
79
+ }, "commit"), mr = /* @__PURE__ */ h(function(t) {
80
+ let r = t.name;
81
+ const a = t.order;
82
+ if (r = B.sanitizeText(r, z()), i.records.branches.has(r))
83
+ throw new Error(
84
+ `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
85
+ );
86
+ 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");
87
+ }, "branch"), wr = /* @__PURE__ */ h((t) => {
88
+ let r = t.branch, a = t.id;
89
+ const s = t.type, e = t.tags, n = z();
90
+ r = B.sanitizeText(r, n), a && (a = B.sanitizeText(a, n));
91
+ 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;
92
+ if ($ && l && $.branch === r)
93
+ throw new Error(`Cannot merge branch '${r}' into itself.`);
94
+ if (i.records.currBranch === r) {
95
+ const d = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
96
+ throw d.hash = {
97
+ text: `merge ${r}`,
98
+ token: `merge ${r}`,
99
+ expected: ["branch abc"]
100
+ }, d;
101
+ }
102
+ if ($ === void 0 || !$) {
103
+ const d = new Error(
104
+ `Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`
105
+ );
106
+ throw d.hash = {
107
+ text: `merge ${r}`,
108
+ token: `merge ${r}`,
109
+ expected: ["commit"]
110
+ }, d;
111
+ }
112
+ if (!i.records.branches.has(r)) {
113
+ const d = new Error(
114
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
115
+ );
116
+ throw d.hash = {
117
+ text: `merge ${r}`,
118
+ token: `merge ${r}`,
119
+ expected: [`branch ${r}`]
120
+ }, d;
121
+ }
122
+ if (l === void 0 || !l) {
123
+ const d = new Error(
124
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
125
+ );
126
+ throw d.hash = {
127
+ text: `merge ${r}`,
128
+ token: `merge ${r}`,
129
+ expected: ['"commit"']
130
+ }, d;
131
+ }
132
+ if ($ === l) {
133
+ const d = new Error('Incorrect usage of "merge". Both branches have same head');
134
+ throw d.hash = {
135
+ text: `merge ${r}`,
136
+ token: `merge ${r}`,
137
+ expected: ["branch abc"]
138
+ }, d;
139
+ }
140
+ if (a && i.records.commits.has(a)) {
141
+ const d = new Error(
142
+ 'Incorrect usage of "merge". Commit with id:' + a + " already exists, use different custom id"
143
+ );
144
+ throw d.hash = {
145
+ text: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
146
+ token: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
147
+ expected: [
148
+ `merge ${r} ${a}_UNIQUE ${s} ${e == null ? void 0 : e.join(" ")}`
149
+ ]
150
+ }, d;
151
+ }
152
+ const f = o || "", g = {
153
+ id: a || `${i.records.seq}-${S()}`,
154
+ message: `merged branch ${r} into ${i.records.currBranch}`,
155
+ seq: i.records.seq++,
156
+ parents: i.records.head == null ? [] : [i.records.head.id, f],
157
+ branch: i.records.currBranch,
158
+ type: x.MERGE,
159
+ customType: s,
160
+ customId: !!a,
161
+ tags: e ?? []
162
+ };
163
+ 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");
164
+ }, "merge"), vr = /* @__PURE__ */ h(function(t) {
165
+ let r = t.id, a = t.targetId, s = t.tags, e = t.parent;
166
+ m.debug("Entering cherryPick:", r, a, s);
167
+ const n = z();
168
+ 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)) {
169
+ const $ = new Error(
170
+ 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
171
+ );
172
+ throw $.hash = {
173
+ text: `cherryPick ${r} ${a}`,
174
+ token: `cherryPick ${r} ${a}`,
175
+ expected: ["cherry-pick abc"]
176
+ }, $;
177
+ }
178
+ const c = i.records.commits.get(r);
179
+ if (c === void 0 || !c)
180
+ throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
181
+ if (e && !(Array.isArray(c.parents) && c.parents.includes(e)))
182
+ throw new Error(
183
+ "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
184
+ );
185
+ const o = c.branch;
186
+ if (c.type === x.MERGE && !e)
187
+ throw new Error(
188
+ "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
189
+ );
190
+ if (!a || !i.records.commits.has(a)) {
191
+ if (o === i.records.currBranch) {
192
+ const g = new Error(
193
+ 'Incorrect usage of "cherryPick". Source commit is already on current branch'
194
+ );
195
+ throw g.hash = {
196
+ text: `cherryPick ${r} ${a}`,
197
+ token: `cherryPick ${r} ${a}`,
198
+ expected: ["cherry-pick abc"]
199
+ }, g;
200
+ }
201
+ const $ = i.records.branches.get(i.records.currBranch);
202
+ if ($ === void 0 || !$) {
203
+ const g = new Error(
204
+ `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
205
+ );
206
+ throw g.hash = {
207
+ text: `cherryPick ${r} ${a}`,
208
+ token: `cherryPick ${r} ${a}`,
209
+ expected: ["cherry-pick abc"]
210
+ }, g;
211
+ }
212
+ const l = i.records.commits.get($);
213
+ if (l === void 0 || !l) {
214
+ const g = new Error(
215
+ `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
216
+ );
217
+ throw g.hash = {
218
+ text: `cherryPick ${r} ${a}`,
219
+ token: `cherryPick ${r} ${a}`,
220
+ expected: ["cherry-pick abc"]
221
+ }, g;
222
+ }
223
+ const f = {
224
+ id: i.records.seq + "-" + S(),
225
+ message: `cherry-picked ${c == null ? void 0 : c.message} into ${i.records.currBranch}`,
226
+ seq: i.records.seq++,
227
+ parents: i.records.head == null ? [] : [i.records.head.id, c.id],
228
+ branch: i.records.currBranch,
229
+ type: x.CHERRY_PICK,
230
+ tags: s ? s.filter(Boolean) : [
231
+ `cherry-pick:${c.id}${c.type === x.MERGE ? `|parent:${e}` : ""}`
232
+ ]
233
+ };
234
+ 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");
235
+ }
236
+ }, "cherryPick"), _ = /* @__PURE__ */ h(function(t) {
237
+ if (t = B.sanitizeText(t, z()), i.records.branches.has(t)) {
238
+ i.records.currBranch = t;
239
+ const r = i.records.branches.get(i.records.currBranch);
240
+ r === void 0 || !r ? i.records.head = null : i.records.head = i.records.commits.get(r) ?? null;
241
+ } else {
242
+ const r = new Error(
243
+ `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
244
+ );
245
+ throw r.hash = {
246
+ text: `checkout ${t}`,
247
+ token: `checkout ${t}`,
248
+ expected: [`branch ${t}`]
249
+ }, r;
250
+ }
251
+ }, "checkout");
252
+ function D(t, r, a) {
253
+ const s = t.indexOf(r);
254
+ s === -1 ? t.push(a) : t.splice(s, 1, a);
255
+ }
256
+ h(D, "upsert");
257
+ function A(t) {
258
+ const r = t.reduce((e, n) => e.seq > n.seq ? e : n, t[0]);
259
+ let a = "";
260
+ t.forEach(function(e) {
261
+ e === r ? a += " *" : a += " |";
262
+ });
263
+ const s = [a, r.id, r.seq];
264
+ for (const e in i.records.branches)
265
+ i.records.branches.get(e) === r.id && s.push(e);
266
+ if (m.debug(s.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
267
+ const e = i.records.commits.get(r.parents[0]);
268
+ D(t, r, e), r.parents[1] && t.push(i.records.commits.get(r.parents[1]));
269
+ } else {
270
+ if (r.parents.length == 0)
271
+ return;
272
+ if (r.parents[0]) {
273
+ const e = i.records.commits.get(r.parents[0]);
274
+ D(t, r, e);
275
+ }
276
+ }
277
+ t = N(t, (e) => e.id), A(t);
278
+ }
279
+ h(A, "prettyPrintCommitHistory");
280
+ var Cr = /* @__PURE__ */ h(function() {
281
+ m.debug(i.records.commits);
282
+ const t = V()[0];
283
+ A([t]);
284
+ }, "prettyPrint"), Er = /* @__PURE__ */ h(function() {
285
+ i.reset(), ir();
286
+ }, "clear"), Br = /* @__PURE__ */ h(function() {
287
+ return [...i.records.branchConfig.values()].map((r, a) => r.order !== null && r.order !== void 0 ? r : {
288
+ ...r,
289
+ order: parseFloat(`0.${a}`)
290
+ }).sort((r, a) => (r.order ?? 0) - (a.order ?? 0)).map(({ name: r }) => ({ name: r }));
291
+ }, "getBranchesAsObjArray"), kr = /* @__PURE__ */ h(function() {
292
+ return i.records.branches;
293
+ }, "getBranches"), Lr = /* @__PURE__ */ h(function() {
294
+ return i.records.commits;
295
+ }, "getCommits"), V = /* @__PURE__ */ h(function() {
296
+ const t = [...i.records.commits.values()];
297
+ return t.forEach(function(r) {
298
+ m.debug(r.id);
299
+ }), t.sort((r, a) => r.seq - a.seq), t;
300
+ }, "getCommitsArray"), Tr = /* @__PURE__ */ h(function() {
301
+ return i.records.currBranch;
302
+ }, "getCurrentBranch"), Mr = /* @__PURE__ */ h(function() {
303
+ return i.records.direction;
304
+ }, "getDirection"), Rr = /* @__PURE__ */ h(function() {
305
+ return i.records.head;
306
+ }, "getHead"), X = {
307
+ commitType: x,
308
+ getConfig: z,
309
+ setDirection: pr,
310
+ setOptions: xr,
311
+ getOptions: ur,
312
+ commit: br,
313
+ branch: mr,
314
+ merge: wr,
315
+ cherryPick: vr,
316
+ checkout: _,
317
+ //reset,
318
+ prettyPrint: Cr,
319
+ clear: Er,
320
+ getBranchesAsObjArray: Br,
321
+ getBranches: kr,
322
+ getCommits: Lr,
323
+ getCommitsArray: V,
324
+ getCurrentBranch: Tr,
325
+ getDirection: Mr,
326
+ getHead: Rr,
327
+ setAccTitle: nr,
328
+ getAccTitle: ar,
329
+ getAccDescription: tr,
330
+ setAccDescription: er,
331
+ setDiagramTitle: rr,
332
+ getDiagramTitle: U
333
+ }, Ir = /* @__PURE__ */ h((t, r) => {
334
+ Z(t, r), t.dir && r.setDirection(t.dir);
335
+ for (const a of t.statements)
336
+ qr(a, r);
337
+ }, "populate"), qr = /* @__PURE__ */ h((t, r) => {
338
+ const s = {
339
+ Commit: /* @__PURE__ */ h((e) => r.commit(Or(e)), "Commit"),
340
+ Branch: /* @__PURE__ */ h((e) => r.branch(zr(e)), "Branch"),
341
+ Merge: /* @__PURE__ */ h((e) => r.merge(Gr(e)), "Merge"),
342
+ Checkout: /* @__PURE__ */ h((e) => r.checkout(Hr(e)), "Checkout"),
343
+ CherryPicking: /* @__PURE__ */ h((e) => r.cherryPick(Pr(e)), "CherryPicking")
344
+ }[t.$type];
345
+ s ? s(t) : m.error(`Unknown statement type: ${t.$type}`);
346
+ }, "parseStatement"), Or = /* @__PURE__ */ h((t) => ({
347
+ id: t.id,
348
+ msg: t.message ?? "",
349
+ type: t.type !== void 0 ? x[t.type] : x.NORMAL,
350
+ tags: t.tags ?? void 0
351
+ }), "parseCommit"), zr = /* @__PURE__ */ h((t) => ({
352
+ name: t.name,
353
+ order: t.order ?? 0
354
+ }), "parseBranch"), Gr = /* @__PURE__ */ h((t) => ({
355
+ branch: t.branch,
356
+ id: t.id ?? "",
357
+ type: t.type !== void 0 ? x[t.type] : void 0,
358
+ tags: t.tags ?? void 0
359
+ }), "parseMerge"), Hr = /* @__PURE__ */ h((t) => t.branch, "parseCheckout"), Pr = /* @__PURE__ */ h((t) => {
360
+ var a;
361
+ return {
362
+ id: t.id,
363
+ targetId: "",
364
+ tags: ((a = t.tags) == null ? void 0 : a.length) === 0 ? void 0 : t.tags,
365
+ parent: t.parent
366
+ };
367
+ }, "parseCherryPicking"), Wr = {
368
+ parse: /* @__PURE__ */ h(async (t) => {
369
+ const r = await gr("gitGraph", t);
370
+ m.debug(r), Ir(r, X);
371
+ }, "parse")
372
+ }, j = $r(), 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, p = "LR", Sr = /* @__PURE__ */ h(() => {
373
+ C.clear(), E.clear(), G.clear(), M = 0, W = [], p = "LR";
374
+ }, "clear"), J = /* @__PURE__ */ h((t) => {
375
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
376
+ return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((s) => {
377
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
378
+ 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);
379
+ }), r;
380
+ }, "drawText"), Q = /* @__PURE__ */ h((t) => {
381
+ let r, a, s;
382
+ return p === "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) => {
383
+ var c, o;
384
+ const n = p === "TB" || p == "BT" ? (c = E.get(e)) == null ? void 0 : c.y : (o = E.get(e)) == null ? void 0 : o.x;
385
+ n !== void 0 && a(n, s) && (r = e, s = n);
386
+ }), r;
387
+ }, "findClosestParent"), jr = /* @__PURE__ */ h((t) => {
388
+ let r = "", a = 1 / 0;
389
+ return t.forEach((s) => {
390
+ const e = E.get(s).y;
391
+ e <= a && (r = s, a = e);
392
+ }), r || void 0;
393
+ }, "findClosestParentBT"), Dr = /* @__PURE__ */ h((t, r, a) => {
394
+ let s = a, e = a;
395
+ const n = [];
396
+ t.forEach((c) => {
397
+ const o = r.get(c);
398
+ if (!o)
399
+ throw new Error(`Commit not found for key ${c}`);
400
+ o.parents.length ? (s = Yr(o), e = Math.max(s, e)) : n.push(o), Kr(o, s);
401
+ }), s = e, n.forEach((c) => {
402
+ Nr(c, s, a);
403
+ }), t.forEach((c) => {
404
+ const o = r.get(c);
405
+ if (o != null && o.parents.length) {
406
+ const $ = jr(o.parents);
407
+ s = E.get($).y - I, s <= e && (e = s);
408
+ const l = C.get(o.branch).pos, f = s - R;
409
+ E.set(o.id, { x: l, y: f });
410
+ }
411
+ });
412
+ }, "setParallelBTPos"), Ar = /* @__PURE__ */ h((t) => {
413
+ var s;
414
+ const r = Q(t.parents.filter((e) => e !== null));
415
+ if (!r)
416
+ throw new Error(`Closest parent not found for commit ${t.id}`);
417
+ const a = (s = E.get(r)) == null ? void 0 : s.y;
418
+ if (a === void 0)
419
+ throw new Error(`Closest parent position not found for commit ${t.id}`);
420
+ return a;
421
+ }, "findClosestParentPos"), Yr = /* @__PURE__ */ h((t) => Ar(t) + I, "calculateCommitPosition"), Kr = /* @__PURE__ */ h((t, r) => {
422
+ const a = C.get(t.branch);
423
+ if (!a)
424
+ throw new Error(`Branch not found for commit ${t.id}`);
425
+ const s = a.pos, e = r + R;
426
+ return E.set(t.id, { x: s, y: e }), { x: s, y: e };
427
+ }, "setCommitPosition"), Nr = /* @__PURE__ */ h((t, r, a) => {
428
+ const s = C.get(t.branch);
429
+ if (!s)
430
+ throw new Error(`Branch not found for commit ${t.id}`);
431
+ const e = r + a, n = s.pos;
432
+ E.set(t.id, { x: n, y: e });
433
+ }, "setRootPosition"), _r = /* @__PURE__ */ h((t, r, a, s, e, n) => {
434
+ if (n === x.HIGHLIGHT)
435
+ t.append("rect").attr("x", a.x - 10).attr("y", a.y - 10).attr("width", 20).attr("height", 20).attr(
436
+ "class",
437
+ `commit ${r.id} commit-highlight${e % O} ${s}-outer`
438
+ ), t.append("rect").attr("x", a.x - 6).attr("y", a.y - 6).attr("width", 12).attr("height", 12).attr(
439
+ "class",
440
+ `commit ${r.id} commit${e % O} ${s}-inner`
441
+ );
442
+ else if (n === x.CHERRY_PICK)
443
+ 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}`);
444
+ else {
445
+ const c = t.append("circle");
446
+ if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type === x.MERGE ? 9 : 10), c.attr("class", `commit ${r.id} commit${e % O}`), n === x.MERGE) {
447
+ const o = t.append("circle");
448
+ o.attr("cx", a.x), o.attr("cy", a.y), o.attr("r", 6), o.attr(
449
+ "class",
450
+ `commit ${s} ${r.id} commit${e % O}`
451
+ );
452
+ }
453
+ n === x.REVERSE && t.append("path").attr(
454
+ "d",
455
+ `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}`
456
+ ).attr("class", `commit ${s} ${r.id} commit${e % O}`);
457
+ }
458
+ }, "drawCommitBullet"), Vr = /* @__PURE__ */ h((t, r, a, s) => {
459
+ var e;
460
+ if (r.type !== x.CHERRY_PICK && (r.customId && r.type === x.MERGE || r.type !== x.MERGE) && (b != null && b.showCommitLabel)) {
461
+ 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();
462
+ 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), p === "TB" || p === "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))
463
+ if (p === "TB" || p === "BT")
464
+ o.attr(
465
+ "transform",
466
+ "rotate(-45, " + a.x + ", " + a.y + ")"
467
+ ), c.attr(
468
+ "transform",
469
+ "rotate(-45, " + a.x + ", " + a.y + ")"
470
+ );
471
+ else {
472
+ const l = -7.5 - ($.width + 10) / 25 * 9.5, f = 10 + $.width / 25 * 8.5;
473
+ n.attr(
474
+ "transform",
475
+ "translate(" + l + ", " + f + ") rotate(-45, " + s + ", " + a.y + ")"
476
+ );
477
+ }
478
+ }
479
+ }, "drawCommitLabel"), Xr = /* @__PURE__ */ h((t, r, a, s) => {
480
+ var e;
481
+ if (r.tags.length > 0) {
482
+ let n = 0, c = 0, o = 0;
483
+ const $ = [];
484
+ for (const l of r.tags.reverse()) {
485
+ 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();
486
+ if (!y)
487
+ throw new Error("Tag bbox not found");
488
+ c = Math.max(c, y.width), o = Math.max(o, y.height), d.attr("x", a.posWithOffset - y.width / 2), $.push({
489
+ tag: d,
490
+ hole: g,
491
+ rect: f,
492
+ yOffset: n
493
+ }), n += 20;
494
+ }
495
+ for (const { tag: l, hole: f, rect: g, yOffset: d } of $) {
496
+ const y = o / 2, u = a.y - 19.2 - d;
497
+ if (g.attr("class", "tag-label-bkg").attr(
498
+ "points",
499
+ `
500
+ ${s - c / 2 - k / 2},${u + L}
501
+ ${s - c / 2 - k / 2},${u - L}
502
+ ${a.posWithOffset - c / 2 - k},${u - y - L}
503
+ ${a.posWithOffset + c / 2 + k},${u - y - L}
504
+ ${a.posWithOffset + c / 2 + k},${u + y + L}
505
+ ${a.posWithOffset - c / 2 - k},${u + y + L}`
506
+ ), f.attr("cy", u).attr("cx", s - c / 2 + k / 2).attr("r", 1.5).attr("class", "tag-hole"), p === "TB" || p === "BT") {
507
+ const w = s + d;
508
+ g.attr("class", "tag-label-bkg").attr(
509
+ "points",
510
+ `
511
+ ${a.x},${w + 2}
512
+ ${a.x},${w - 2}
513
+ ${a.x + R},${w - y - 2}
514
+ ${a.x + R + c + 4},${w - y - 2}
515
+ ${a.x + R + c + 4},${w + y + 2}
516
+ ${a.x + R},${w + y + 2}`
517
+ ).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 + ")");
518
+ }
519
+ }
520
+ }
521
+ }, "drawCommitTags"), Jr = /* @__PURE__ */ h((t) => {
522
+ switch (t.customType ?? t.type) {
523
+ case x.NORMAL:
524
+ return "commit-normal";
525
+ case x.REVERSE:
526
+ return "commit-reverse";
527
+ case x.HIGHLIGHT:
528
+ return "commit-highlight";
529
+ case x.MERGE:
530
+ return "commit-merge";
531
+ case x.CHERRY_PICK:
532
+ return "commit-cherry-pick";
533
+ default:
534
+ return "commit-normal";
535
+ }
536
+ }, "getCommitClassType"), Qr = /* @__PURE__ */ h((t, r, a, s) => {
537
+ const e = { x: 0, y: 0 };
538
+ if (t.parents.length > 0) {
539
+ const n = Q(t.parents);
540
+ if (n) {
541
+ const c = s.get(n) ?? e;
542
+ return r === "TB" ? c.y + I : r === "BT" ? (s.get(t.id) ?? e).y - I : c.x + I;
543
+ }
544
+ } else
545
+ return r === "TB" ? P : r === "BT" ? (s.get(t.id) ?? e).y - I : 0;
546
+ return 0;
547
+ }, "calculatePosition"), Zr = /* @__PURE__ */ h((t, r, a) => {
548
+ var c, o;
549
+ const s = p === "BT" && a ? r : r + R, e = p === "TB" || p === "BT" ? s : (c = C.get(t.branch)) == null ? void 0 : c.pos, n = p === "TB" || p === "BT" ? (o = C.get(t.branch)) == null ? void 0 : o.pos : s;
550
+ if (n === void 0 || e === void 0)
551
+ throw new Error(`Position were undefined for commit ${t.id}`);
552
+ return { x: n, y: e, posWithOffset: s };
553
+ }, "getCommitPosition"), K = /* @__PURE__ */ h((t, r, a) => {
554
+ if (!b)
555
+ throw new Error("GitGraph config not found");
556
+ const s = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
557
+ let n = p === "TB" || p === "BT" ? P : 0;
558
+ const c = [...r.keys()], o = (b == null ? void 0 : b.parallelCommits) ?? !1, $ = /* @__PURE__ */ h((f, g) => {
559
+ var u, w;
560
+ const d = (u = r.get(f)) == null ? void 0 : u.seq, y = (w = r.get(g)) == null ? void 0 : w.seq;
561
+ return d !== void 0 && y !== void 0 ? d - y : 0;
562
+ }, "sortKeys");
563
+ let l = c.sort($);
564
+ p === "BT" && (o && Dr(l, r, n), l = l.reverse()), l.forEach((f) => {
565
+ var y;
566
+ const g = r.get(f);
567
+ if (!g)
568
+ throw new Error(`Commit not found for key ${f}`);
569
+ o && (n = Qr(g, p, n, E));
570
+ const d = Zr(g, n, o);
571
+ if (a) {
572
+ const u = Jr(g), w = g.customType ?? g.type, q = ((y = C.get(g.branch)) == null ? void 0 : y.index) ?? 0;
573
+ _r(s, g, d, u, q, w), Vr(e, g, d, n), Xr(e, g, d, n);
574
+ }
575
+ p === "TB" || p === "BT" ? E.set(g.id, { x: d.x, y: d.posWithOffset }) : E.set(g.id, { x: d.posWithOffset, y: d.y }), n = p === "BT" && o ? n + I : n + I + R, n > M && (M = n);
576
+ });
577
+ }, "drawCommits"), Fr = /* @__PURE__ */ h((t, r, a, s, e) => {
578
+ const c = (p === "TB" || p === "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");
579
+ return [...e.values()].some((l) => $(l) && o(l));
580
+ }, "shouldRerouteArrow"), H = /* @__PURE__ */ h((t, r, a = 0) => {
581
+ const s = t + Math.abs(t - r) / 2;
582
+ if (a > 5)
583
+ return s;
584
+ if (W.every((c) => Math.abs(c - s) >= 10))
585
+ return W.push(s), s;
586
+ const n = Math.abs(t - r);
587
+ return H(t, r - n / 5, a + 1);
588
+ }, "findLane"), Ur = /* @__PURE__ */ h((t, r, a, s) => {
589
+ var y, u, w, q, Y;
590
+ const e = E.get(r.id), n = E.get(a.id);
591
+ if (e === void 0 || n === void 0)
592
+ throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);
593
+ const c = Fr(r, a, e, n, s);
594
+ let o = "", $ = "", l = 0, f = 0, g = (y = C.get(a.branch)) == null ? void 0 : y.index;
595
+ a.type === x.MERGE && r.id !== a.parents[0] && (g = (u = C.get(r.branch)) == null ? void 0 : u.index);
596
+ let d;
597
+ if (c) {
598
+ o = "A 10 10, 0, 0, 0,", $ = "A 10 10, 0, 0, 1,", l = 10, f = 10;
599
+ 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);
600
+ p === "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}`) : p === "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 = (Y = C.get(r.branch)) == null ? void 0 : Y.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}`);
601
+ } else
602
+ o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, p === "TB" ? (e.x < n.x && (a.type === x.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 === x.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}`)) : p === "BT" ? (e.x < n.x && (a.type === x.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 === x.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 === x.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 === x.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}`));
603
+ if (d === void 0)
604
+ throw new Error("Line definition not found");
605
+ t.append("path").attr("d", d).attr("class", "arrow arrow" + g % O);
606
+ }, "drawArrow"), re = /* @__PURE__ */ h((t, r) => {
607
+ const a = t.append("g").attr("class", "commit-arrows");
608
+ [...r.keys()].forEach((s) => {
609
+ const e = r.get(s);
610
+ e.parents && e.parents.length > 0 && e.parents.forEach((n) => {
611
+ Ur(a, r.get(n), e, r);
612
+ });
613
+ });
614
+ }, "drawArrows"), ee = /* @__PURE__ */ h((t, r) => {
615
+ const a = t.append("g");
616
+ r.forEach((s, e) => {
617
+ var u;
618
+ const n = e % O, c = (u = C.get(s.name)) == null ? void 0 : u.pos;
619
+ if (c === void 0)
620
+ throw new Error(`Position not found for branch ${s.name}`);
621
+ const o = a.append("line");
622
+ o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n), p === "TB" ? (o.attr("y1", P), o.attr("x1", c), o.attr("y2", M), o.attr("x2", c)) : p === "BT" && (o.attr("y1", M), o.attr("x1", c), o.attr("y2", P), o.attr("x2", c)), W.push(c);
623
+ const $ = s.name, l = J($), f = a.insert("rect"), d = a.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + n);
624
+ d.node().appendChild(l);
625
+ const y = l.getBBox();
626
+ 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(
627
+ "transform",
628
+ "translate(" + (-y.width - 14 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (c - y.height / 2 - 1) + ")"
629
+ ), p === "TB" ? (f.attr("x", c - y.width / 2 - 10).attr("y", 0), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", 0)")) : p === "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) + ")");
630
+ });
631
+ }, "drawBranches"), te = /* @__PURE__ */ h(function(t, r, a, s, e) {
632
+ return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (p === "TB" || p === "BT" ? s.width / 2 : 0), r;
633
+ }, "setBranchPosition"), ae = /* @__PURE__ */ h(function(t, r, a, s) {
634
+ if (Sr(), m.debug("in gitgraph renderer", t + `
635
+ `, "id:", r, a), !b)
636
+ throw new Error("GitGraph config not found");
637
+ const e = b.rotateCommitLabel ?? !1, n = s.db;
638
+ G = n.getCommits();
639
+ const c = n.getBranchesAsObjArray();
640
+ p = n.getDirection();
641
+ const o = sr(`[id="${r}"]`);
642
+ let $ = 0;
643
+ c.forEach((l, f) => {
644
+ var q;
645
+ const g = J(l.name), d = o.append("g"), y = d.insert("g").attr("class", "branchLabel"), u = y.insert("g").attr("class", "label branch-label");
646
+ (q = u.node()) == null || q.appendChild(g);
647
+ const w = g.getBBox();
648
+ $ = te(l.name, $, f, w, e), u.remove(), y.remove(), d.remove();
649
+ }), K(o, G, !1), b.showBranches && ee(o, c), re(o, G), K(o, G, !0), or.insertTitle(
650
+ o,
651
+ "gitTitleText",
652
+ b.titleTopMargin ?? 0,
653
+ n.getDiagramTitle()
654
+ ), cr(
655
+ void 0,
656
+ o,
657
+ b.diagramPadding,
658
+ b.useMaxWidth
659
+ );
660
+ }, "draw"), ne = {
661
+ draw: ae
662
+ }, se = /* @__PURE__ */ h((t) => `
663
+ .commit-id,
664
+ .commit-msg,
665
+ .branch-label {
666
+ fill: lightgrey;
667
+ color: lightgrey;
668
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
669
+ font-family: var(--mermaid-font-family);
670
+ }
671
+ ${[0, 1, 2, 3, 4, 5, 6, 7].map(
672
+ (r) => `
673
+ .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; }
674
+ .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; }
675
+ .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; }
676
+ .label${r} { fill: ${t["git" + r]}; }
677
+ .arrow${r} { stroke: ${t["git" + r]}; }
678
+ `
679
+ ).join(`
680
+ `)}
681
+
682
+ .branch {
683
+ stroke-width: 1;
684
+ stroke: ${t.lineColor};
685
+ stroke-dasharray: 2;
686
+ }
687
+ .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
688
+ .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
689
+ .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
690
+ .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
691
+ .tag-hole { fill: ${t.textColor}; }
692
+
693
+ .commit-merge {
694
+ stroke: ${t.primaryColor};
695
+ fill: ${t.primaryColor};
696
+ }
697
+ .commit-reverse {
698
+ stroke: ${t.primaryColor};
699
+ fill: ${t.primaryColor};
700
+ stroke-width: 3;
701
+ }
702
+ .commit-highlight-outer {
703
+ }
704
+ .commit-highlight-inner {
705
+ stroke: ${t.primaryColor};
706
+ fill: ${t.primaryColor};
707
+ }
708
+
709
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
710
+ .gitTitleText {
711
+ text-anchor: middle;
712
+ font-size: 18px;
713
+ fill: ${t.textColor};
714
+ }
715
+ `, "getStyles"), oe = se, ve = {
716
+ parser: Wr,
717
+ db: X,
718
+ renderer: ne,
719
+ styles: oe
720
+ };
721
+ export {
722
+ ve as diagram
723
+ };