dimcode 0.0.9 → 0.0.10-beta.2

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 (206) hide show
  1. package/assets/gui/200.html +1 -1
  2. package/assets/gui/404.html +1 -1
  3. package/assets/gui/_nuxt/B4BeXTM8.js +1 -0
  4. package/assets/gui/_nuxt/BTTJEMKv.js +42 -0
  5. package/assets/gui/_nuxt/CBflTB_3.js +1 -0
  6. package/assets/gui/_nuxt/Cd_MtzEZ.js +957 -0
  7. package/assets/gui/_nuxt/DLcXGJ1M.js +261 -0
  8. package/assets/gui/_nuxt/DTsXV384.js +2 -0
  9. package/assets/gui/_nuxt/DzShUmTH.js +1 -0
  10. package/assets/gui/_nuxt/KaTeX_AMS-Regular.BQhdFMY1.woff2 +0 -0
  11. package/assets/gui/_nuxt/KaTeX_AMS-Regular.DMm9YOAa.woff +0 -0
  12. package/assets/gui/_nuxt/KaTeX_AMS-Regular.DRggAlZN.ttf +0 -0
  13. package/assets/gui/_nuxt/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf +0 -0
  14. package/assets/gui/_nuxt/KaTeX_Caligraphic-Bold.BEiXGLvX.woff +0 -0
  15. package/assets/gui/_nuxt/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2 +0 -0
  16. package/assets/gui/_nuxt/KaTeX_Caligraphic-Regular.CTRA-rTL.woff +0 -0
  17. package/assets/gui/_nuxt/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2 +0 -0
  18. package/assets/gui/_nuxt/KaTeX_Caligraphic-Regular.wX97UBjC.ttf +0 -0
  19. package/assets/gui/_nuxt/KaTeX_Fraktur-Bold.BdnERNNW.ttf +0 -0
  20. package/assets/gui/_nuxt/KaTeX_Fraktur-Bold.BsDP51OF.woff +0 -0
  21. package/assets/gui/_nuxt/KaTeX_Fraktur-Bold.CL6g_b3V.woff2 +0 -0
  22. package/assets/gui/_nuxt/KaTeX_Fraktur-Regular.CB_wures.ttf +0 -0
  23. package/assets/gui/_nuxt/KaTeX_Fraktur-Regular.CTYiF6lA.woff2 +0 -0
  24. package/assets/gui/_nuxt/KaTeX_Fraktur-Regular.Dxdc4cR9.woff +0 -0
  25. package/assets/gui/_nuxt/KaTeX_Main-Bold.Cx986IdX.woff2 +0 -0
  26. package/assets/gui/_nuxt/KaTeX_Main-Bold.Jm3AIy58.woff +0 -0
  27. package/assets/gui/_nuxt/KaTeX_Main-Bold.waoOVXN0.ttf +0 -0
  28. package/assets/gui/_nuxt/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2 +0 -0
  29. package/assets/gui/_nuxt/KaTeX_Main-BoldItalic.DzxPMmG6.ttf +0 -0
  30. package/assets/gui/_nuxt/KaTeX_Main-BoldItalic.SpSLRI95.woff +0 -0
  31. package/assets/gui/_nuxt/KaTeX_Main-Italic.3WenGoN9.ttf +0 -0
  32. package/assets/gui/_nuxt/KaTeX_Main-Italic.BMLOBm91.woff +0 -0
  33. package/assets/gui/_nuxt/KaTeX_Main-Italic.NWA7e6Wa.woff2 +0 -0
  34. package/assets/gui/_nuxt/KaTeX_Main-Regular.B22Nviop.woff2 +0 -0
  35. package/assets/gui/_nuxt/KaTeX_Main-Regular.Dr94JaBh.woff +0 -0
  36. package/assets/gui/_nuxt/KaTeX_Main-Regular.ypZvNtVU.ttf +0 -0
  37. package/assets/gui/_nuxt/KaTeX_Math-BoldItalic.B3XSjfu4.ttf +0 -0
  38. package/assets/gui/_nuxt/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2 +0 -0
  39. package/assets/gui/_nuxt/KaTeX_Math-BoldItalic.iY-2wyZ7.woff +0 -0
  40. package/assets/gui/_nuxt/KaTeX_Math-Italic.DA0__PXp.woff +0 -0
  41. package/assets/gui/_nuxt/KaTeX_Math-Italic.flOr_0UB.ttf +0 -0
  42. package/assets/gui/_nuxt/KaTeX_Math-Italic.t53AETM-.woff2 +0 -0
  43. package/assets/gui/_nuxt/KaTeX_SansSerif-Bold.CFMepnvq.ttf +0 -0
  44. package/assets/gui/_nuxt/KaTeX_SansSerif-Bold.D1sUS0GD.woff2 +0 -0
  45. package/assets/gui/_nuxt/KaTeX_SansSerif-Bold.DbIhKOiC.woff +0 -0
  46. package/assets/gui/_nuxt/KaTeX_SansSerif-Italic.C3H0VqGB.woff2 +0 -0
  47. package/assets/gui/_nuxt/KaTeX_SansSerif-Italic.DN2j7dab.woff +0 -0
  48. package/assets/gui/_nuxt/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf +0 -0
  49. package/assets/gui/_nuxt/KaTeX_SansSerif-Regular.BNo7hRIc.ttf +0 -0
  50. package/assets/gui/_nuxt/KaTeX_SansSerif-Regular.CS6fqUqJ.woff +0 -0
  51. package/assets/gui/_nuxt/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2 +0 -0
  52. package/assets/gui/_nuxt/KaTeX_Script-Regular.C5JkGWo-.ttf +0 -0
  53. package/assets/gui/_nuxt/KaTeX_Script-Regular.D3wIWfF6.woff2 +0 -0
  54. package/assets/gui/_nuxt/KaTeX_Script-Regular.D5yQViql.woff +0 -0
  55. package/assets/gui/_nuxt/KaTeX_Size1-Regular.C195tn64.woff +0 -0
  56. package/assets/gui/_nuxt/KaTeX_Size1-Regular.Dbsnue_I.ttf +0 -0
  57. package/assets/gui/_nuxt/KaTeX_Size1-Regular.mCD8mA8B.woff2 +0 -0
  58. package/assets/gui/_nuxt/KaTeX_Size2-Regular.B7gKUWhC.ttf +0 -0
  59. package/assets/gui/_nuxt/KaTeX_Size2-Regular.Dy4dx90m.woff2 +0 -0
  60. package/assets/gui/_nuxt/KaTeX_Size2-Regular.oD1tc_U0.woff +0 -0
  61. package/assets/gui/_nuxt/KaTeX_Size3-Regular.CTq5MqoE.woff +0 -0
  62. package/assets/gui/_nuxt/KaTeX_Size3-Regular.DgpXs0kz.ttf +0 -0
  63. package/assets/gui/_nuxt/KaTeX_Size4-Regular.BF-4gkZK.woff +0 -0
  64. package/assets/gui/_nuxt/KaTeX_Size4-Regular.DWFBv043.ttf +0 -0
  65. package/assets/gui/_nuxt/KaTeX_Size4-Regular.Dl5lxZxV.woff2 +0 -0
  66. package/assets/gui/_nuxt/KaTeX_Typewriter-Regular.C0xS9mPB.woff +0 -0
  67. package/assets/gui/_nuxt/KaTeX_Typewriter-Regular.CO6r4hn1.woff2 +0 -0
  68. package/assets/gui/_nuxt/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf +0 -0
  69. package/assets/gui/_nuxt/ULB_ug-y.js +2511 -0
  70. package/assets/gui/_nuxt/_baseUniq-BP57Elhf.js +1 -0
  71. package/assets/gui/_nuxt/arc-Y1WZXZUo.js +1 -0
  72. package/assets/gui/_nuxt/architectureDiagram-VXUJARFQ-aO7Rb24c.js +36 -0
  73. package/assets/gui/_nuxt/{C5cXMF-A.js → blockDiagram-VD42YOAC-B3uFbaWi.js} +2 -2
  74. package/assets/gui/_nuxt/builds/latest.json +1 -1
  75. package/assets/gui/_nuxt/builds/meta/630937f4-6174-4e34-838d-eca8dea0bc0f.json +1 -0
  76. package/assets/gui/_nuxt/{Cgg1My-l.js → c4Diagram-YG6GDRKO-DHJl7yiB.js} +2 -2
  77. package/assets/gui/_nuxt/channel-DpNic2cF.js +1 -0
  78. package/assets/gui/_nuxt/chunk-4BX2VUAB-CWm83ERH.js +1 -0
  79. package/assets/gui/_nuxt/chunk-55IACEB6-Du_n8jC4.js +1 -0
  80. package/assets/gui/_nuxt/{Bu7UbN50.js → chunk-B4BG7PRW-BTzCu0pf.js} +1 -1
  81. package/assets/gui/_nuxt/{DpTvXhMN.js → chunk-DI55MBZ5-DBddr-cr.js} +1 -1
  82. package/assets/gui/_nuxt/{gpkmuIcl.js → chunk-FMBD7UC4-8fDVfHv2.js} +1 -1
  83. package/assets/gui/_nuxt/chunk-QN33PNHL-CR7hsK0L.js +1 -0
  84. package/assets/gui/_nuxt/chunk-QZHKN3VN-DaFYAnGP.js +1 -0
  85. package/assets/gui/_nuxt/chunk-TZMSLE5B-BjCFOyRb.js +1 -0
  86. package/assets/gui/_nuxt/classDiagram-2ON5EDUG-CqyEtcjO.js +1 -0
  87. package/assets/gui/_nuxt/classDiagram-v2-WZHVMYZB-CqyEtcjO.js +1 -0
  88. package/assets/gui/_nuxt/clone-DCFnqWq9.js +1 -0
  89. package/assets/gui/_nuxt/cose-bilkent-S5V4N54A-CA9LZ8Zj.js +1 -0
  90. package/assets/gui/_nuxt/css.worker-BL6kSyU1.js +93 -0
  91. package/assets/gui/_nuxt/dagre-6UL2VRFP-CBQSftkS.js +4 -0
  92. package/assets/gui/_nuxt/defaultLocale-CCNgq9ws.js +1 -0
  93. package/assets/gui/_nuxt/diagram-PSM6KHXK-DsTyKY6m.js +24 -0
  94. package/assets/gui/_nuxt/diagram-QEK2KX5R-D9APFlGs.js +43 -0
  95. package/assets/gui/_nuxt/diagram-S2PKOQOG-IKVKLS18.js +24 -0
  96. package/assets/gui/_nuxt/editor.worker-BDzEcYpU.js +26 -0
  97. package/assets/gui/_nuxt/entry.CEtVlF9V.css +1 -0
  98. package/assets/gui/_nuxt/{GsNec5dh.js → erDiagram-Q2GNP2WA-CH15dTWb.js} +4 -4
  99. package/assets/gui/_nuxt/{B8sXOwue.js → flowDiagram-NV44I4VS-zt5vccS4.js} +2 -2
  100. package/assets/gui/_nuxt/ganttDiagram-JELNMOA3-DvD26RKf.js +267 -0
  101. package/assets/gui/_nuxt/gitGraphDiagram-NY62KEGX-BEF64eCN.js +65 -0
  102. package/assets/gui/_nuxt/graph-CvZayWR8.js +1 -0
  103. package/assets/gui/_nuxt/html.worker-BJUDQ4P_.js +470 -0
  104. package/assets/gui/_nuxt/index.BGLZpmxK.css +1 -0
  105. package/assets/gui/_nuxt/infoDiagram-WHAUD3N6-BqqPKCej.js +2 -0
  106. package/assets/gui/_nuxt/{B2yiF0dP.js → journeyDiagram-XKPGCS4Q-D37U2RLk.js} +2 -2
  107. package/assets/gui/_nuxt/json.worker-CbPvaBPT.js +58 -0
  108. package/assets/gui/_nuxt/{DCyR-K5m.js → kanban-definition-3W4ZIXB7-o0rG_onk.js} +7 -7
  109. package/assets/gui/_nuxt/layout-BVt2QQzT.js +1 -0
  110. package/assets/gui/_nuxt/linear-CjtgffNP.js +1 -0
  111. package/assets/gui/_nuxt/min-CuqY3rK3.js +1 -0
  112. package/assets/gui/_nuxt/{CfQJsi7e.js → mindmap-definition-VGOIOE7T-4BDFzlaj.js} +3 -3
  113. package/assets/gui/_nuxt/ordinal-Cboi1Yqb.js +1 -0
  114. package/assets/gui/_nuxt/pieDiagram-ADFJNKIX-DOY587kc.js +30 -0
  115. package/assets/gui/_nuxt/{D5KI-6FL.js → quadrantDiagram-AYHSOK5B-C0uhckN3.js} +2 -2
  116. package/assets/gui/_nuxt/{_RKv1NgS.js → requirementDiagram-UZGBJVZJ-D0pHyv4t.js} +2 -2
  117. package/assets/gui/_nuxt/sankeyDiagram-TZEHDZUN-B9uFH2wG.js +10 -0
  118. package/assets/gui/_nuxt/{CILJ3eP4.js → sequenceDiagram-WL72ISMW-CmLKcFaQ.js} +2 -2
  119. package/assets/gui/_nuxt/stateDiagram-FKZM4ZOC-DXLM32ee.js +1 -0
  120. package/assets/gui/_nuxt/stateDiagram-v2-4FDKWEC3-Bwg-9iwU.js +1 -0
  121. package/assets/gui/_nuxt/{BKMTnum7.js → timeline-definition-IT6M3QCI-Bz55IcKP.js} +4 -4
  122. package/assets/gui/_nuxt/{DXsty2qm.js → treemap-KMMF4GRG-D3QBlffy.js} +57 -57
  123. package/assets/gui/_nuxt/ts.worker-BkEcNiLV.js +67718 -0
  124. package/assets/gui/_nuxt/vendor-katex.ltkKqWhd.css +1 -0
  125. package/assets/gui/_nuxt/vendor-markstream.D6yyxftE.css +1 -0
  126. package/assets/gui/_nuxt/{CJeKOH-v.js → xychartDiagram-PRI3JC2R-CPU3Crx9.js} +2 -2
  127. package/assets/gui/index.html +1 -1
  128. package/dist/aihubmix.json +1 -1
  129. package/dist/anthropic.json +1 -1
  130. package/dist/cli.mjs +858 -836
  131. package/dist/deepseek.json +1 -1
  132. package/dist/google.json +1 -1
  133. package/dist/minimax-cn-coding-plan.json +1 -1
  134. package/dist/minimax-cn.json +1 -1
  135. package/dist/minimax-coding-plan.json +1 -1
  136. package/dist/minimax.json +1 -1
  137. package/dist/models/aihubmix.json +1 -1
  138. package/dist/models/openrouter.json +1 -1
  139. package/dist/models/siliconflow-com.json +1 -1
  140. package/dist/models/siliconflow.json +1 -1
  141. package/dist/models/zenmux.json +1 -1
  142. package/dist/moonshot-ai.json +1 -1
  143. package/dist/moonshot.json +1 -1
  144. package/dist/openai.json +1 -1
  145. package/dist/ppinfra.json +1 -1
  146. package/dist/siliconflow-com.json +1 -1
  147. package/dist/siliconflow.json +1 -1
  148. package/dist/xai.json +1 -1
  149. package/dist/zai-coding-plan.json +1 -1
  150. package/dist/zai.json +1 -1
  151. package/dist/zhipuai-coding-plan.json +1 -1
  152. package/dist/zhipuai.json +1 -1
  153. package/package.json +1 -1
  154. package/assets/gui/_nuxt/0b551Iup.js +0 -1
  155. package/assets/gui/_nuxt/4plqNI3E.js +0 -1
  156. package/assets/gui/_nuxt/BAAwCcKi.js +0 -1
  157. package/assets/gui/_nuxt/BB51-bYG.js +0 -1
  158. package/assets/gui/_nuxt/BE4JB3YQ.js +0 -24
  159. package/assets/gui/_nuxt/BGp_FwD9.js +0 -1
  160. package/assets/gui/_nuxt/BIM4RUHw.js +0 -10
  161. package/assets/gui/_nuxt/BJmxWypQ.js +0 -2
  162. package/assets/gui/_nuxt/BPM3vi7L.js +0 -1
  163. package/assets/gui/_nuxt/BloQGtiP.js +0 -1
  164. package/assets/gui/_nuxt/BnC2hR_I.js +0 -1
  165. package/assets/gui/_nuxt/BojRNRsE.js +0 -1
  166. package/assets/gui/_nuxt/BtMqZKeb.js +0 -1
  167. package/assets/gui/_nuxt/BtYWoTeV.js +0 -1
  168. package/assets/gui/_nuxt/C11b51Ac.js +0 -1
  169. package/assets/gui/_nuxt/C1yhW14G.js +0 -65
  170. package/assets/gui/_nuxt/C6Po8woU.js +0 -1
  171. package/assets/gui/_nuxt/C6lP39IU.js +0 -4
  172. package/assets/gui/_nuxt/C8BqVsjE.js +0 -24
  173. package/assets/gui/_nuxt/C8FO969Z.js +0 -350
  174. package/assets/gui/_nuxt/C8tOkigv.js +0 -1
  175. package/assets/gui/_nuxt/CKgPEzpl.js +0 -1
  176. package/assets/gui/_nuxt/CNpnPA49.js +0 -17
  177. package/assets/gui/_nuxt/CSea6CJ5.js +0 -1
  178. package/assets/gui/_nuxt/CU5WgS48.js +0 -1
  179. package/assets/gui/_nuxt/CZ1LJRt8.js +0 -1
  180. package/assets/gui/_nuxt/ChaLjQbU.js +0 -1
  181. package/assets/gui/_nuxt/CmKTTxBW.js +0 -1
  182. package/assets/gui/_nuxt/Conicgba.js +0 -36
  183. package/assets/gui/_nuxt/CupMKq6u.js +0 -4
  184. package/assets/gui/_nuxt/D0ya9d-G.js +0 -1
  185. package/assets/gui/_nuxt/D2lZokPL.js +0 -1
  186. package/assets/gui/_nuxt/DCxOw3GV.js +0 -22
  187. package/assets/gui/_nuxt/DLnSW1IF.js +0 -1
  188. package/assets/gui/_nuxt/DUsPre0P.js +0 -1
  189. package/assets/gui/_nuxt/DX6XiGOO.js +0 -1
  190. package/assets/gui/_nuxt/DZ0NWvbi.js +0 -43
  191. package/assets/gui/_nuxt/DaWfUpsD.js +0 -250
  192. package/assets/gui/_nuxt/DlL1-BJh.js +0 -1
  193. package/assets/gui/_nuxt/Dn4y6C2r.js +0 -1
  194. package/assets/gui/_nuxt/DoSvhc5U.js +0 -1
  195. package/assets/gui/_nuxt/DvJDa2y1.js +0 -1
  196. package/assets/gui/_nuxt/DzzoB_Be.js +0 -267
  197. package/assets/gui/_nuxt/_mPeMGlT.js +0 -1
  198. package/assets/gui/_nuxt/builds/meta/899e1dcf-7a7e-4c41-8525-c1d394dec180.json +0 -1
  199. package/assets/gui/_nuxt/entry.PbPm020F.css +0 -1
  200. package/assets/gui/_nuxt/index.CeD9Flb2.css +0 -1
  201. package/assets/gui/_nuxt/kTUG9xEK.js +0 -1
  202. package/assets/gui/_nuxt/nJjJxbsW.js +0 -30
  203. package/assets/gui/_nuxt/yG4UzpsV.js +0 -1
  204. /package/assets/gui/_nuxt/{5J0xJHOV.js → cytoscape.esm-5J0xJHOV.js} +0 -0
  205. /package/assets/gui/_nuxt/{Gi6I4Gst.js → init-Gi6I4Gst.js} +0 -0
  206. /package/assets/gui/_nuxt/{XbL3y5x-.js → katex-XbL3y5x-.js} +0 -0
@@ -1,65 +0,0 @@
1
- import{p as Y}from"./_mPeMGlT.js";import{I as K}from"./BtMqZKeb.js";import{_ as l,q as U,p as V,s as X,g as J,a as Q,b as Z,l as m,c as rr,d as er,u as tr,C as ar,y as sr,k as C,D as nr,E as or,F as cr,G as ir}from"./DaWfUpsD.js";import{p as dr}from"./DXsty2qm.js";import"./C8FO969Z.js";import"./DlL1-BJh.js";import"./D0ya9d-G.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},hr=cr.gitGraph,I=l(()=>nr({...hr,...or().gitGraph}),"getConfig"),c=new K(()=>{const t=I(),r=t.mainBranchName,s=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:s}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function A(){return ir({length:7})}l(A,"getID");function F(t,r){const s=Object.create(null);return t.reduce((n,e)=>{const a=r(e);return s[a]||(s[a]=!0,n.push(e)),n},[])}l(F,"uniqBy");var lr=l(function(t){c.records.direction=t},"setDirection"),$r=l(function(t){m.debug("options str",t),t=t?.trim(),t=t||"{}";try{c.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),fr=l(function(){return c.records.options},"getOptions"),gr=l(function(t){let r=t.msg,s=t.id;const n=t.type;let e=t.tags;m.info("commit",r,s,n,e),m.debug("Entering commit:",r,s,n,e);const a=I();s=C.sanitizeText(s,a),r=C.sanitizeText(r,a),e=e?.map(o=>C.sanitizeText(o,a));const d={id:s||c.records.seq+"-"+A(),message:r,seq:c.records.seq++,type:n??x.NORMAL,tags:e??[],parents:c.records.head==null?[]:[c.records.head.id],branch:c.records.currBranch};c.records.head=d,m.info("main branch",a.mainBranchName),c.records.commits.has(d.id)&&m.warn(`Commit ID ${d.id} already exists`),c.records.commits.set(d.id,d),c.records.branches.set(c.records.currBranch,d.id),m.debug("in pushCommit "+d.id)},"commit"),yr=l(function(t){let r=t.name;const s=t.order;if(r=C.sanitizeText(r,I()),c.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);c.records.branches.set(r,c.records.head!=null?c.records.head.id:null),c.records.branchConfig.set(r,{name:r,order:s}),z(r),m.debug("in createBranch")},"branch"),ur=l(t=>{let r=t.branch,s=t.id;const n=t.type,e=t.tags,a=I();r=C.sanitizeText(r,a),s&&(s=C.sanitizeText(s,a));const d=c.records.branches.get(c.records.currBranch),o=c.records.branches.get(r),f=d?c.records.commits.get(d):void 0,h=o?c.records.commits.get(o):void 0;if(f&&h&&f.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(c.records.currBranch===r){const i=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},i}if(f===void 0||!f){const i=new Error(`Incorrect usage of "merge". Current branch (${c.records.currBranch})has no commits`);throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},i}if(!c.records.branches.has(r)){const i=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},i}if(h===void 0||!h){const i=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},i}if(f===h){const i=new Error('Incorrect usage of "merge". Both branches have same head');throw i.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},i}if(s&&c.records.commits.has(s)){const i=new Error('Incorrect usage of "merge". Commit with id:'+s+" already exists, use different custom id");throw i.hash={text:`merge ${r} ${s} ${n} ${e?.join(" ")}`,token:`merge ${r} ${s} ${n} ${e?.join(" ")}`,expected:[`merge ${r} ${s}_UNIQUE ${n} ${e?.join(" ")}`]},i}const $=o||"",g={id:s||`${c.records.seq}-${A()}`,message:`merged branch ${r} into ${c.records.currBranch}`,seq:c.records.seq++,parents:c.records.head==null?[]:[c.records.head.id,$],branch:c.records.currBranch,type:x.MERGE,customType:n,customId:!!s,tags:e??[]};c.records.head=g,c.records.commits.set(g.id,g),c.records.branches.set(c.records.currBranch,g.id),m.debug(c.records.branches),m.debug("in mergeBranch")},"merge"),pr=l(function(t){let r=t.id,s=t.targetId,n=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,s,n);const a=I();if(r=C.sanitizeText(r,a),s=C.sanitizeText(s,a),n=n?.map(f=>C.sanitizeText(f,a)),e=C.sanitizeText(e,a),!r||!c.records.commits.has(r)){const f=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw f.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},f}const d=c.records.commits.get(r);if(d===void 0||!d)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(d.parents)&&d.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=d.branch;if(d.type===x.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!s||!c.records.commits.has(s)){if(o===c.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const f=c.records.branches.get(c.records.currBranch);if(f===void 0||!f){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const h=c.records.commits.get(f);if(h===void 0||!h){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${s}`,token:`cherryPick ${r} ${s}`,expected:["cherry-pick abc"]},g}const $={id:c.records.seq+"-"+A(),message:`cherry-picked ${d?.message} into ${c.records.currBranch}`,seq:c.records.seq++,parents:c.records.head==null?[]:[c.records.head.id,d.id],branch:c.records.currBranch,type:x.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${d.id}${d.type===x.MERGE?`|parent:${e}`:""}`]};c.records.head=$,c.records.commits.set($.id,$),c.records.branches.set(c.records.currBranch,$.id),m.debug(c.records.branches),m.debug("in cherryPick")}},"cherryPick"),z=l(function(t){if(t=C.sanitizeText(t,I()),c.records.branches.has(t)){c.records.currBranch=t;const r=c.records.branches.get(c.records.currBranch);r===void 0||!r?c.records.head=null:c.records.head=c.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function H(t,r,s){const n=t.indexOf(r);n===-1?t.push(s):t.splice(n,1,s)}l(H,"upsert");function P(t){const r=t.reduce((e,a)=>e.seq>a.seq?e:a,t[0]);let s="";t.forEach(function(e){e===r?s+=" *":s+=" |"});const n=[s,r.id,r.seq];for(const e in c.records.branches)c.records.branches.get(e)===r.id&&n.push(e);if(m.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=c.records.commits.get(r.parents[0]);H(t,r,e),r.parents[1]&&t.push(c.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=c.records.commits.get(r.parents[0]);H(t,r,e)}}t=F(t,e=>e.id),P(t)}l(P,"prettyPrintCommitHistory");var xr=l(function(){m.debug(c.records.commits);const t=N()[0];P([t])},"prettyPrint"),mr=l(function(){c.reset(),sr()},"clear"),br=l(function(){return[...c.records.branchConfig.values()].map((r,s)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${s}`)}).sort((r,s)=>(r.order??0)-(s.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),wr=l(function(){return c.records.branches},"getBranches"),vr=l(function(){return c.records.commits},"getCommits"),N=l(function(){const t=[...c.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,s)=>r.seq-s.seq),t},"getCommitsArray"),Cr=l(function(){return c.records.currBranch},"getCurrentBranch"),Er=l(function(){return c.records.direction},"getDirection"),Tr=l(function(){return c.records.head},"getHead"),S={commitType:x,getConfig:I,setDirection:lr,setOptions:$r,getOptions:fr,commit:gr,branch:yr,merge:ur,cherryPick:pr,checkout:z,prettyPrint:xr,clear:mr,getBranchesAsObjArray:br,getBranches:wr,getCommits:vr,getCommitsArray:N,getCurrentBranch:Cr,getDirection:Er,getHead:Tr,setAccTitle:Z,getAccTitle:Q,getAccDescription:J,setAccDescription:X,setDiagramTitle:V,getDiagramTitle:U},Br=l((t,r)=>{Y(t,r),t.dir&&r.setDirection(t.dir);for(const s of t.statements)Lr(s,r)},"populate"),Lr=l((t,r)=>{const n={Commit:l(e=>r.commit(kr(e)),"Commit"),Branch:l(e=>r.branch(Mr(e)),"Branch"),Merge:l(e=>r.merge(Ir(e)),"Merge"),Checkout:l(e=>r.checkout(Rr(e)),"Checkout"),CherryPicking:l(e=>r.cherryPick(Gr(e)),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),kr=l(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),Mr=l(t=>({name:t.name,order:t.order??0}),"parseBranch"),Ir=l(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Rr=l(t=>t.branch,"parseCheckout"),Gr=l(t=>({id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),Or={parse:l(async t=>{const r=await dr("gitGraph",t);m.debug(r),Br(r,S)},"parse")},qr=rr(),v=qr?.gitGraph,L=10,k=40,E=4,T=2,M=8,b=new Map,w=new Map,O=30,R=new Map,q=[],B=0,u="LR",Ar=l(()=>{b.clear(),w.clear(),R.clear(),B=0,q=[],u="LR"},"clear"),W=l(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");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=n.trim(),r.appendChild(e)}),r},"drawText"),j=l(t=>{let r,s,n;return u==="BT"?(s=l((e,a)=>e<=a,"comparisonFunc"),n=1/0):(s=l((e,a)=>e>=a,"comparisonFunc"),n=0),t.forEach(e=>{const a=u==="TB"||u=="BT"?w.get(e)?.y:w.get(e)?.x;a!==void 0&&s(a,n)&&(r=e,n=a)}),r},"findClosestParent"),_r=l(t=>{let r="",s=1/0;return t.forEach(n=>{const e=w.get(n).y;e<=s&&(r=n,s=e)}),r||void 0},"findClosestParentBT"),Hr=l((t,r,s)=>{let n=s,e=s;const a=[];t.forEach(d=>{const o=r.get(d);if(!o)throw new Error(`Commit not found for key ${d}`);o.parents.length?(n=Dr(o),e=Math.max(n,e)):a.push(o),Fr(o,n)}),n=e,a.forEach(d=>{zr(d,n,s)}),t.forEach(d=>{const o=r.get(d);if(o?.parents.length){const f=_r(o.parents);n=w.get(f).y-k,n<=e&&(e=n);const h=b.get(o.branch).pos,$=n-L;w.set(o.id,{x:h,y:$})}})},"setParallelBTPos"),Pr=l(t=>{const r=j(t.parents.filter(n=>n!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const s=w.get(r)?.y;if(s===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return s},"findClosestParentPos"),Dr=l(t=>Pr(t)+k,"calculateCommitPosition"),Fr=l((t,r)=>{const s=b.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const n=s.pos,e=r+L;return w.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),zr=l((t,r,s)=>{const n=b.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+s,a=n.pos;w.set(t.id,{x:a,y:e})},"setRootPosition"),Nr=l((t,r,s,n,e,a)=>{if(a===x.HIGHLIGHT)t.append("rect").attr("x",s.x-10).attr("y",s.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%M} ${n}-outer`),t.append("rect").attr("x",s.x-6).attr("y",s.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%M} ${n}-inner`);else if(a===x.CHERRY_PICK)t.append("circle").attr("cx",s.x).attr("cy",s.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",s.x-3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",s.x+3).attr("cy",s.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",s.x+3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",s.x-3).attr("y1",s.y+1).attr("x2",s.x).attr("y2",s.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const d=t.append("circle");if(d.attr("cx",s.x),d.attr("cy",s.y),d.attr("r",r.type===x.MERGE?9:10),d.attr("class",`commit ${r.id} commit${e%M}`),a===x.MERGE){const o=t.append("circle");o.attr("cx",s.x),o.attr("cy",s.y),o.attr("r",6),o.attr("class",`commit ${n} ${r.id} commit${e%M}`)}a===x.REVERSE&&t.append("path").attr("d",`M ${s.x-5},${s.y-5}L${s.x+5},${s.y+5}M${s.x-5},${s.y+5}L${s.x+5},${s.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%M}`)}},"drawCommitBullet"),Sr=l((t,r,s,n)=>{if(r.type!==x.CHERRY_PICK&&(r.customId&&r.type===x.MERGE||r.type!==x.MERGE)&&v?.showCommitLabel){const e=t.append("g"),a=e.insert("rect").attr("class","commit-label-bkg"),d=e.append("text").attr("x",n).attr("y",s.y+25).attr("class","commit-label").text(r.id),o=d.node()?.getBBox();if(o&&(a.attr("x",s.posWithOffset-o.width/2-T).attr("y",s.y+13.5).attr("width",o.width+2*T).attr("height",o.height+2*T),u==="TB"||u==="BT"?(a.attr("x",s.x-(o.width+4*E+5)).attr("y",s.y-12),d.attr("x",s.x-(o.width+4*E)).attr("y",s.y+o.height-12)):d.attr("x",s.posWithOffset-o.width/2),v.rotateCommitLabel))if(u==="TB"||u==="BT")d.attr("transform","rotate(-45, "+s.x+", "+s.y+")"),a.attr("transform","rotate(-45, "+s.x+", "+s.y+")");else{const f=-7.5-(o.width+10)/25*9.5,h=10+o.width/25*8.5;e.attr("transform","translate("+f+", "+h+") rotate(-45, "+n+", "+s.y+")")}}},"drawCommitLabel"),Wr=l((t,r,s,n)=>{if(r.tags.length>0){let e=0,a=0,d=0;const o=[];for(const f of r.tags.reverse()){const h=t.insert("polygon"),$=t.append("circle"),g=t.append("text").attr("y",s.y-16-e).attr("class","tag-label").text(f),i=g.node()?.getBBox();if(!i)throw new Error("Tag bbox not found");a=Math.max(a,i.width),d=Math.max(d,i.height),g.attr("x",s.posWithOffset-i.width/2),o.push({tag:g,hole:$,rect:h,yOffset:e}),e+=20}for(const{tag:f,hole:h,rect:$,yOffset:g}of o){const i=d/2,y=s.y-19.2-g;if($.attr("class","tag-label-bkg").attr("points",`
2
- ${n-a/2-E/2},${y+T}
3
- ${n-a/2-E/2},${y-T}
4
- ${s.posWithOffset-a/2-E},${y-i-T}
5
- ${s.posWithOffset+a/2+E},${y-i-T}
6
- ${s.posWithOffset+a/2+E},${y+i+T}
7
- ${s.posWithOffset-a/2-E},${y+i+T}`),h.attr("cy",y).attr("cx",n-a/2+E/2).attr("r",1.5).attr("class","tag-hole"),u==="TB"||u==="BT"){const p=n+g;$.attr("class","tag-label-bkg").attr("points",`
8
- ${s.x},${p+2}
9
- ${s.x},${p-2}
10
- ${s.x+L},${p-i-2}
11
- ${s.x+L+a+4},${p-i-2}
12
- ${s.x+L+a+4},${p+i+2}
13
- ${s.x+L},${p+i+2}`).attr("transform","translate(12,12) rotate(45, "+s.x+","+n+")"),h.attr("cx",s.x+E/2).attr("cy",p).attr("transform","translate(12,12) rotate(45, "+s.x+","+n+")"),f.attr("x",s.x+5).attr("y",p+3).attr("transform","translate(14,14) rotate(45, "+s.x+","+n+")")}}}},"drawCommitTags"),jr=l(t=>{switch(t.customType??t.type){case x.NORMAL:return"commit-normal";case x.REVERSE:return"commit-reverse";case x.HIGHLIGHT:return"commit-highlight";case x.MERGE:return"commit-merge";case x.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Yr=l((t,r,s,n)=>{const e={x:0,y:0};if(t.parents.length>0){const a=j(t.parents);if(a){const d=n.get(a)??e;return r==="TB"?d.y+k:r==="BT"?(n.get(t.id)??e).y-k:d.x+k}}else return r==="TB"?O:r==="BT"?(n.get(t.id)??e).y-k:0;return 0},"calculatePosition"),Kr=l((t,r,s)=>{const n=u==="BT"&&s?r:r+L,e=u==="TB"||u==="BT"?n:b.get(t.branch)?.pos,a=u==="TB"||u==="BT"?b.get(t.branch)?.pos:n;if(a===void 0||e===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:e,posWithOffset:n}},"getCommitPosition"),D=l((t,r,s)=>{if(!v)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),e=t.append("g").attr("class","commit-labels");let a=u==="TB"||u==="BT"?O:0;const d=[...r.keys()],o=v?.parallelCommits??!1,f=l(($,g)=>{const i=r.get($)?.seq,y=r.get(g)?.seq;return i!==void 0&&y!==void 0?i-y:0},"sortKeys");let h=d.sort(f);u==="BT"&&(o&&Hr(h,r,a),h=h.reverse()),h.forEach($=>{const g=r.get($);if(!g)throw new Error(`Commit not found for key ${$}`);o&&(a=Yr(g,u,a,w));const i=Kr(g,a,o);if(s){const y=jr(g),p=g.customType??g.type,_=b.get(g.branch)?.index??0;Nr(n,g,i,y,_,p),Sr(e,g,i,a),Wr(e,g,i,a)}u==="TB"||u==="BT"?w.set(g.id,{x:i.x,y:i.posWithOffset}):w.set(g.id,{x:i.posWithOffset,y:i.y}),a=u==="BT"&&o?a+k:a+k+L,a>B&&(B=a)})},"drawCommits"),Ur=l((t,r,s,n,e)=>{const d=(u==="TB"||u==="BT"?s.x<n.x:s.y<n.y)?r.branch:t.branch,o=l(h=>h.branch===d,"isOnBranchToGetCurve"),f=l(h=>h.seq>t.seq&&h.seq<r.seq,"isBetweenCommits");return[...e.values()].some(h=>f(h)&&o(h))},"shouldRerouteArrow"),G=l((t,r,s=0)=>{const n=t+Math.abs(t-r)/2;if(s>5)return n;if(q.every(d=>Math.abs(d-n)>=10))return q.push(n),n;const a=Math.abs(t-r);return G(t,r-a/5,s+1)},"findLane"),Vr=l((t,r,s,n)=>{const e=w.get(r.id),a=w.get(s.id);if(e===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${s.id}`);const d=Ur(r,s,e,a,n);let o="",f="",h=0,$=0,g=b.get(s.branch)?.index;s.type===x.MERGE&&r.id!==s.parents[0]&&(g=b.get(r.branch)?.index);let i;if(d){o="A 10 10, 0, 0, 0,",f="A 10 10, 0, 0, 1,",h=10,$=10;const y=e.y<a.y?G(e.y,a.y):G(a.y,e.y),p=e.x<a.x?G(e.x,a.x):G(a.x,e.x);u==="TB"?e.x<a.x?i=`M ${e.x} ${e.y} L ${p-h} ${e.y} ${f} ${p} ${e.y+$} L ${p} ${a.y-h} ${o} ${p+$} ${a.y} L ${a.x} ${a.y}`:(g=b.get(r.branch)?.index,i=`M ${e.x} ${e.y} L ${p+h} ${e.y} ${o} ${p} ${e.y+$} L ${p} ${a.y-h} ${f} ${p-$} ${a.y} L ${a.x} ${a.y}`):u==="BT"?e.x<a.x?i=`M ${e.x} ${e.y} L ${p-h} ${e.y} ${o} ${p} ${e.y-$} L ${p} ${a.y+h} ${f} ${p+$} ${a.y} L ${a.x} ${a.y}`:(g=b.get(r.branch)?.index,i=`M ${e.x} ${e.y} L ${p+h} ${e.y} ${f} ${p} ${e.y-$} L ${p} ${a.y+h} ${o} ${p-$} ${a.y} L ${a.x} ${a.y}`):e.y<a.y?i=`M ${e.x} ${e.y} L ${e.x} ${y-h} ${o} ${e.x+$} ${y} L ${a.x-h} ${y} ${f} ${a.x} ${y+$} L ${a.x} ${a.y}`:(g=b.get(r.branch)?.index,i=`M ${e.x} ${e.y} L ${e.x} ${y+h} ${f} ${e.x+$} ${y} L ${a.x-h} ${y} ${o} ${a.x} ${y-$} L ${a.x} ${a.y}`)}else o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,u==="TB"?(e.x<a.x&&(s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y-h} ${o} ${e.x+$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${f} ${a.x} ${e.y+$} L ${a.x} ${a.y}`),e.x>a.x&&(o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y-h} ${f} ${e.x-$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x+h} ${e.y} ${o} ${a.x} ${e.y+$} L ${a.x} ${a.y}`),e.x===a.x&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`)):u==="BT"?(e.x<a.x&&(s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${f} ${e.x+$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`),e.x>a.x&&(o="A 20 20, 0, 0, 0,",f="A 20 20, 0, 0, 1,",h=20,$=20,s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${o} ${e.x-$} ${a.y} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`),e.x===a.x&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`)):(e.y<a.y&&(s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${f} ${a.x} ${e.y+$} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${e.x} ${a.y-h} ${o} ${e.x+$} ${a.y} L ${a.x} ${a.y}`),e.y>a.y&&(s.type===x.MERGE&&r.id!==s.parents[0]?i=`M ${e.x} ${e.y} L ${a.x-h} ${e.y} ${o} ${a.x} ${e.y-$} L ${a.x} ${a.y}`:i=`M ${e.x} ${e.y} L ${e.x} ${a.y+h} ${f} ${e.x+$} ${a.y} L ${a.x} ${a.y}`),e.y===a.y&&(i=`M ${e.x} ${e.y} L ${a.x} ${a.y}`));if(i===void 0)throw new Error("Line definition not found");t.append("path").attr("d",i).attr("class","arrow arrow"+g%M)},"drawArrow"),Xr=l((t,r)=>{const s=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(n=>{const e=r.get(n);e.parents&&e.parents.length>0&&e.parents.forEach(a=>{Vr(s,r.get(a),e,r)})})},"drawArrows"),Jr=l((t,r)=>{const s=t.append("g");r.forEach((n,e)=>{const a=e%M,d=b.get(n.name)?.pos;if(d===void 0)throw new Error(`Position not found for branch ${n.name}`);const o=s.append("line");o.attr("x1",0),o.attr("y1",d),o.attr("x2",B),o.attr("y2",d),o.attr("class","branch branch"+a),u==="TB"?(o.attr("y1",O),o.attr("x1",d),o.attr("y2",B),o.attr("x2",d)):u==="BT"&&(o.attr("y1",B),o.attr("x1",d),o.attr("y2",O),o.attr("x2",d)),q.push(d);const f=n.name,h=W(f),$=s.insert("rect"),i=s.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);i.node().appendChild(h);const y=h.getBBox();$.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-y.width-4-(v?.rotateCommitLabel===!0?30:0)).attr("y",-y.height/2+8).attr("width",y.width+18).attr("height",y.height+4),i.attr("transform","translate("+(-y.width-14-(v?.rotateCommitLabel===!0?30:0))+", "+(d-y.height/2-1)+")"),u==="TB"?($.attr("x",d-y.width/2-10).attr("y",0),i.attr("transform","translate("+(d-y.width/2-5)+", 0)")):u==="BT"?($.attr("x",d-y.width/2-10).attr("y",B),i.attr("transform","translate("+(d-y.width/2-5)+", "+B+")")):$.attr("transform","translate(-19, "+(d-y.height/2)+")")})},"drawBranches"),Qr=l(function(t,r,s,n,e){return b.set(t,{pos:r,index:s}),r+=50+(e?40:0)+(u==="TB"||u==="BT"?n.width/2:0),r},"setBranchPosition"),Zr=l(function(t,r,s,n){if(Ar(),m.debug("in gitgraph renderer",t+`
14
- `,"id:",r,s),!v)throw new Error("GitGraph config not found");const e=v.rotateCommitLabel??!1,a=n.db;R=a.getCommits();const d=a.getBranchesAsObjArray();u=a.getDirection();const o=er(`[id="${r}"]`);let f=0;d.forEach((h,$)=>{const g=W(h.name),i=o.append("g"),y=i.insert("g").attr("class","branchLabel"),p=y.insert("g").attr("class","label branch-label");p.node()?.appendChild(g);const _=g.getBBox();f=Qr(h.name,f,$,_,e),p.remove(),y.remove(),i.remove()}),D(o,R,!1),v.showBranches&&Jr(o,d),Xr(o,R),D(o,R,!0),tr.insertTitle(o,"gitTitleText",v.titleTopMargin??0,a.getDiagramTitle()),ar(void 0,o,v.diagramPadding,v.useMaxWidth)},"draw"),re={draw:Zr},ee=l(t=>`
15
- .commit-id,
16
- .commit-msg,
17
- .branch-label {
18
- fill: lightgrey;
19
- color: lightgrey;
20
- font-family: 'trebuchet ms', verdana, arial, sans-serif;
21
- font-family: var(--mermaid-font-family);
22
- }
23
- ${[0,1,2,3,4,5,6,7].map(r=>`
24
- .branch-label${r} { fill: ${t["gitBranchLabel"+r]}; }
25
- .commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; }
26
- .commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; }
27
- .label${r} { fill: ${t["git"+r]}; }
28
- .arrow${r} { stroke: ${t["git"+r]}; }
29
- `).join(`
30
- `)}
31
-
32
- .branch {
33
- stroke-width: 1;
34
- stroke: ${t.lineColor};
35
- stroke-dasharray: 2;
36
- }
37
- .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
38
- .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
39
- .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
40
- .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
41
- .tag-hole { fill: ${t.textColor}; }
42
-
43
- .commit-merge {
44
- stroke: ${t.primaryColor};
45
- fill: ${t.primaryColor};
46
- }
47
- .commit-reverse {
48
- stroke: ${t.primaryColor};
49
- fill: ${t.primaryColor};
50
- stroke-width: 3;
51
- }
52
- .commit-highlight-outer {
53
- }
54
- .commit-highlight-inner {
55
- stroke: ${t.primaryColor};
56
- fill: ${t.primaryColor};
57
- }
58
-
59
- .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
60
- .gitTitleText {
61
- text-anchor: middle;
62
- font-size: 18px;
63
- fill: ${t.textColor};
64
- }
65
- `,"getStyles"),te=ee,he={parser:Or,db:S,renderer:re,styles:te};export{he as diagram};
@@ -1 +0,0 @@
1
- import{X as ln,Y as an,$ as C,a0 as q,a1 as $,a2 as un,a3 as y,a4 as tn,a5 as H,a6 as _,a7 as rn,a8 as o,a9 as sn,aa as on,ab as fn}from"./DaWfUpsD.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,j,a){var O=I-l,i=D-h,n=j-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function Q(l,h,I,D,v,A,j){var a=l-I,O=h-D,i=(j?A:-A)/H(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,z=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*H(on(0,T*T*R-P*P)),X=(P*g-m*S)/R,Y=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=X-z,e=Y-t,r=w-z,B=p-t;return x*x+e*e>r*r+B*B&&(X=w,Y=p),{cx:X,cy:Y,x01:-n,y01:-d,x11:X*(v/T-1),y11:Y*(v/T-1)}}function hn(){var l=cn,h=yn,I=$(0),D=null,v=gn,A=dn,j=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,z=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(z>tn-y)a.moveTo(s*C(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*C(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=z,S=z,X=j.apply(this,arguments)/2,Y=X>y&&(D?+D.apply(this,arguments):H(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(Y>y){var B=sn(Y/u*q(X)),J=sn(Y/s*q(X));(P-=B*2)>y?(B*=t?1:-1,R+=B,T-=B):(P=0,R=T=(f+c)/2),(S-=J*2)>y?(J*=t?1:-1,m+=J,g-=J):(S=0,m=g=(f+c)/2)}var F=s*C(m),G=s*q(m),K=u*C(T),L=u*q(T);if(w>y){var M=s*C(g),N=s*q(g),U=u*C(R),V=u*q(R),E;if(z<an)if(E=pn(F,G,U,V,M,N,K,L)){var W=F-E[0],Z=G-E[1],b=M-E[0],k=N-E[1],nn=1/q(fn((W*b+Z*k)/(H(W*W+Z*Z)*H(b*b+k*k)))/2),en=H(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=Q(U,V,F,G,s,x,t),r=Q(M,N,K,L,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(F,G),a.arc(0,0,s,m,g,!t)):a.moveTo(F,G),!(u>y)||!(P>y)?a.lineTo(K,L):p>y?(e=Q(K,L,M,N,u,-p,t),r=Q(F,G,U,V,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[C(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:$(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:$(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:$(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:$(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:$(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:$(+n),i):A},i.padAngle=function(n){return arguments.length?(j=typeof n=="function"?n:$(+n),i):j},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
@@ -1,4 +0,0 @@
1
- import{e as $t,d as At,A as Ft,c as Ht,w as V,r as d,g as Rt,C as Q,o as Nt,D as Xt,f as w,j as g,m as ee,k as _t,z as y,q as Je,n as r,E as h,H as xe,I as xt,v as Yt,l as Vt,S as kt,U as bt,y as Zt,p as qt,O as It,T as Ut,P as Wt,M as Mt,N as Gt,R as A,V as Kt,W as Jt,X as Qt}from"./C8FO969Z.js";import{e as el}from"./DvJDa2y1.js";var tl=Object.defineProperty,ll=Object.defineProperties,nl=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,rl=Object.prototype.hasOwnProperty,ol=Object.prototype.propertyIsEnumerable,Ct=($,P,M)=>P in $?tl($,P,{enumerable:!0,configurable:!0,writable:!0,value:M}):$[P]=M,Qe=($,P)=>{for(var M in P||(P={}))rl.call(P,M)&&Ct($,M,P[M]);if(Tt)for(var M of Tt(P))ol.call(P,M)&&Ct($,M,P[M]);return $},D=($,P,M)=>new Promise((ke,o)=>{var ne=F=>{try{j(M.next(F))}catch(re){o(re)}},be=F=>{try{j(M.throw(F))}catch(re){o(re)}},j=F=>F.done?ke(F.value):Promise.resolve(F.value).then(ne,be);j((M=M.apply($,P)).next())});const al={key:0},il={key:1,class:"flex items-center gap-x-2 overflow-hidden"},ul=["src"],sl={key:2},cl={class:"flex items-center gap-x-1"},dl={class:"flex items-center gap-x-1"},vl={key:4},ml={key:5,class:"flex items-center gap-x-1"},fl=["aria-pressed"],hl={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},gl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},pl=["disabled"],wl=["disabled"],yl={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},xl={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},kl={key:1,class:"relative"},bl={key:0,class:"absolute top-2 right-2 z-10 rounded-lg"},Ml={class:"flex items-center gap-2 backdrop-blur rounded-lg"},Tl={class:"markstream-vue"},Cl={class:"absolute top-6 right-6 z-50 flex items-center gap-2"},et=$t(At({__name:"MermaidBlockNode",props:{node:{},maxHeight:{default:"500px"},loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showZoomControls:{type:Boolean,default:!0},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!1}},emits:["copy","export","openModal","toggleMode"],setup($,{emit:P}){var M,ke;const o=$,ne=P,be={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},j=d(!1),F=Q(()=>o.isStrict?"strict":"loose"),re=Q(()=>({startOnLoad:!1,securityLevel:F.value,dompurifyConfig:F.value==="strict"?be:void 0,flowchart:F.value==="strict"?{htmlLabels:!1}:void 0})),Dt=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],Bt=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function St(t){if(!t)return"";const e=t.trim();return Bt.test(e)?e:""}function Me(t){if(t)try{t.replaceChildren()}catch{t.innerHTML=""}}function oe(t,e){if(!t)return"";if(F.value==="strict")return(function(l,n){if(!l)return"";try{l.replaceChildren()}catch{l.innerHTML=""}const c=(function(a){if(typeof window>"u"||typeof DOMParser>"u"||!a)return null;const s=a.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#"),i=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;if(!i||i.nodeName.toLowerCase()!=="svg")return null;const m=i;return(function(v){const p=new Set(["script"]),L=[v,...Array.from(v.querySelectorAll("*"))];for(const C of L){if(p.has(C.tagName.toLowerCase())){C.remove();continue}const Y=Array.from(C.attributes);for(const N of Y){const b=N.name;if(/^on/i.test(b))C.removeAttribute(b);else{if(b==="style"&&N.value){const k=N.value;if(Dt.some(Ye=>Ye.test(k))){C.removeAttribute(b);continue}}if((b==="href"||b==="xlink:href")&&N.value){const k=St(N.value);if(!k){C.removeAttribute(b);continue}k!==N.value&&C.setAttribute(b,k)}}}}})(m),m})(n);return c?(l.appendChild(c),l.innerHTML):""})(t,e);try{t.replaceChildren()}catch{t.innerHTML=""}if(e)try{t.insertAdjacentHTML("afterbegin",e)}catch{t.innerHTML=e}return t.innerHTML}const{t:f}=Ft();function Te(){return D(this,null,function*(){try{const t=yield Qt();return j.value=!!t,t}catch(t){throw j.value=!1,t}})}typeof window<"u"&&D(null,null,function*(){var t;try{const e=yield Te();if(!e)return;(t=e?.initialize)==null||t.call(e,Qe({},re.value))}catch(e){j.value=!1,console.warn("[markstream-vue] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",e)}});const Ce=d(!1),Z=d(!1),q=d(),u=d(),ae=d(),De=d(null),Et=Ht(),me=d(null),ie=d(typeof window>"u"),tt=d(),R=Q(()=>o.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),x=d(1),O=d(0),z=d(0),Be=d(!1),Se=d({x:0,y:0}),S=d(!1),Ee=d(!1),W=d(!1),Pe=d(null),je=d(0),Ve=d(!1);let fe=null,he=null,ge=0;const lt=(M=globalThis.requestIdleCallback)!=null?M:(t,e)=>setTimeout(()=>t({didTimeout:!0}),16),ue=(function(){let t=null;return(...e)=>{t&&clearTimeout(t),t=setTimeout(()=>(()=>{lt(()=>{wt()},{timeout:500})})(...e),300)}})();function pe(){he!=null&&(globalThis.clearTimeout(he),he=null)}function nt(t=600){if(typeof globalThis>"u")return;const e=Math.max(0,t);pe(),he=globalThis.setTimeout(()=>{he=null,o.loading||W.value||!ie.value?nt(Math.min(1200,Math.max(300,1.2*e))):ue()},e)}const G=d("360px");let se=null;const B=d(!1),te=d(!1),K=d({}),rt=d(null),we=d(""),Ze=d(0);let H=null;const I=d(!1),le=d({zoom:1,translateX:0,translateY:0,containerHeight:"360px"}),ot=Q(()=>o.enableWheelZoom?{wheel:jt}:{}),U=Q(()=>{var t,e,l,n;return{worker:(t=o.workerTimeoutMs)!=null?t:1400,parse:(e=o.parseTimeoutMs)!=null?e:1800,render:(l=o.renderTimeoutMs)!=null?l:2500,fullRender:(n=o.fullRenderTimeoutMs)!=null?n:4e3}}),Pt=(ke=globalThis.cancelIdleCallback)!=null?ke:t=>clearTimeout(t);let ce=null,Oe=null,de=!1,ye=800,X=null,ze=0,qe=!0,Le=0;function $e(t,e){const l=e?.timeoutMs,n=e?.signal;if(n?.aborted)return Promise.reject(new DOMException("Aborted","AbortError"));let c=null,a=!1,s=null;return new Promise((i,m)=>{const v=()=>{c!=null&&clearTimeout(c),s&&n&&n.removeEventListener("abort",s)};l&&l>0&&(c=globalThis.setTimeout(()=>{a||(a=!0,v(),m(new Error("Operation timed out")))},l)),n&&(s=()=>{a||(a=!0,v(),m(new DOMException("Aborted","AbortError")))},n.addEventListener("abort",s)),t().then(p=>{a||(a=!0,v(),i(p))}).catch(p=>{a||(a=!0,v(),m(p))})})}function at(t){if(typeof document>"u"||!u.value)return;const e=document.createElement("div");e.className="text-red-500 p-4",e.textContent="Failed to render diagram: ";const l=document.createElement("span");l.textContent=t instanceof Error?t.message:"Unknown error",e.appendChild(l),Me(u.value),u.value.appendChild(e),G.value="360px",I.value=!0,_()}function it(t){return!t||t.disabled}function E(t,e,l="top"){if(it(t.currentTarget))return;const n=t,c=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0;Mt(t.currentTarget,e,l,!1,c,o.isDark)}function T(){Gt()}function ut(t){if(it(t.currentTarget))return;const e=Ce.value?f("common.copied")||"Copied":f("common.copy")||"Copy",l=t,n=l?.clientX!=null&&l?.clientY!=null?{x:l.clientX,y:l.clientY}:void 0;Mt(t.currentTarget,e,"top",!1,n,o.isDark)}function st(t,e){const l=`%%{init: {"theme": "${e==="dark"?"dark":"default"}"}}%%
2
- `;return t.trimStart().startsWith("%%{")?t:l+t}function ct(){return qe&&!S.value&&!B.value&&!I.value}function dt(t){const e=t.split(/\r?\n/);for(;e.length>0;){const l=e[e.length-1].trimEnd();if(l!==""){if(!(/^[-=~>|<\s]+$/.test(l.trim())||/(?:--|==|~~|->|<-|-\||-\)|-x|o-|\|-|\.-)\s*$/.test(l)||/[-|><]$/.test(l)||/(?:graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt)\s*$/i.test(l)))break;e.pop()}else e.pop()}return e.join(`
3
- `)}function Ae(t,e,l){return D(this,null,function*(){var n;try{return yield Jt(t,e,(n=l?.timeoutMs)!=null?n:U.value.worker)}catch{return yield(function(a,s,i){return D(this,null,function*(){var m,v;const p=yield Te();if(!p)return;const L=p,C=st(a,s);if(typeof L.parse=="function")return yield $e(()=>L.parse(C),{timeoutMs:(m=i?.timeoutMs)!=null?m:U.value.parse,signal:i?.signal}),!0;const Y=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield $e(()=>p.render(Y,C),{timeoutMs:(v=i?.timeoutMs)!=null?v:U.value.render,signal:i?.signal}),!0})})(t,e,l)}})}typeof window<"u"&&V(()=>q.value,t=>{var e;if((e=me.value)==null||e.destroy(),me.value=null,!t)return void(ie.value=!1);const l=Et(t,{rootMargin:"400px"});me.value=l,ie.value=l.isVisible.value,l.whenVisible.then(()=>{ie.value=!0})},{immediate:!0}),Rt(()=>{var t;(t=me.value)==null||t.destroy(),me.value=null});const Fe=Q(()=>S.value||W.value||Z.value);function Ie(t){if(!q.value||!u.value)return;const e=u.value.querySelector("svg");if(!e)return;let l=0,n=0;const c=e.getAttribute("viewBox"),a=e.getAttribute("width"),s=e.getAttribute("height");if(c){const i=c.split(" ");i.length===4&&(l=Number.parseFloat(i[2]),n=Number.parseFloat(i[3]))}if(l&&n||a&&s&&(l=Number.parseFloat(a),n=Number.parseFloat(s)),Number.isNaN(l)||Number.isNaN(n)||l<=0||n<=0)try{const i=e.getBBox();i&&i.width>0&&i.height>0&&(l=i.width,n=i.height)}catch(i){return void console.error("Failed to get SVG BBox:",i)}if(l>0&&n>0){const i=n/l;let m=(t??q.value.clientWidth)*i;m>n&&(m=n),G.value=`${m}px`}}const J=d(!1),Ue=Q(()=>({transform:`translate(${O.value}px, ${z.value}px) scale(${x.value})`}));function vt(t){t.key==="Escape"&&J.value&&We()}function We(){if(J.value=!1,ae.value&&Me(ae.value),De.value=null,typeof document<"u")try{document.body.style.overflow=""}catch{}if(typeof window<"u")try{window.removeEventListener("keydown",vt)}catch{}}function mt(){x.value<3&&(x.value+=.1)}function ft(){x.value>.5&&(x.value-=.1)}function ht(){x.value=1,O.value=0,z.value=0}function He(t){Be.value=!0,t instanceof MouseEvent?Se.value={x:t.clientX-O.value,y:t.clientY-z.value}:Se.value={x:t.touches[0].clientX-O.value,y:t.touches[0].clientY-z.value}}function Re(t){if(!Be.value)return;let e,l;t instanceof MouseEvent?(e=t.clientX,l=t.clientY):(e=t.touches[0].clientX,l=t.touches[0].clientY),O.value=e-Se.value.x,z.value=l-Se.value.y}function ve(){Be.value=!1}function jt(t){if(o.enableWheelZoom&&(t.ctrlKey||t.metaKey)){if(t.preventDefault(),!q.value)return;const e=q.value.getBoundingClientRect(),l=t.clientX-e.left,n=t.clientY-e.top,c=l-e.width/2,a=n-e.height/2,s=(c-O.value)/x.value,i=(a-z.value)/x.value,m=.01,v=-t.deltaY*m,p=Math.min(Math.max(x.value+v,.5),3);p!==x.value&&(O.value=c-s*p,z.value=a-i*p,x.value=p)}}function Ot(){return D(this,null,function*(){try{const t=R.value,e={payload:{type:"copy",text:t},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};if(ne("copy",e),e.defaultPrevented)return;typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(t)),Ce.value=!0,setTimeout(()=>{Ce.value=!1},1e3)}catch(t){console.error("Failed to copy:",t)}})}function zt(){var t;const e=(t=u.value)==null?void 0:t.querySelector("svg");if(!e)return void console.error("SVG element not found");const l=new XMLSerializer().serializeToString(e),n={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:e,svgString:l};ne("export",n),n.defaultPrevented||(function(c,a=null){D(this,null,function*(){try{const s=a??new XMLSerializer().serializeToString(c),i=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),m=URL.createObjectURL(i);if(typeof document<"u"){const v=document.createElement("a");v.href=m,v.download=`mermaid-diagram-${Date.now()}.svg`;try{document.body.appendChild(v),v.click(),document.body.removeChild(v)}catch{}URL.revokeObjectURL(m)}}catch(s){console.error("Failed to export SVG:",s)}})})(e,l)}function Lt(){var t,e;const l=(e=(t=u.value)==null?void 0:t.querySelector("svg"))!=null?e:null,n=l?new XMLSerializer().serializeToString(l):null,c={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:l,svgString:n};ne("openModal",c),c.defaultPrevented||(function(){if(J.value=!0,typeof document<"u")try{document.body.style.overflow="hidden"}catch{}if(typeof window<"u")try{window.addEventListener("keydown",vt)}catch{}A(()=>{if(q.value&&ae.value){const a=q.value.cloneNode(!0);a.classList.add("fullscreen");const s=a.querySelector("[data-mermaid-wrapper]");s&&(De.value=s,s.style.transform=Ue.value.transform),Me(ae.value),ae.value.appendChild(a)}})})()}function gt(t){const e={payload:{type:"toggle-mode",target:t},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};ne("toggleMode",t,e),e.defaultPrevented||pt(t)}function pt(t){return D(this,null,function*(){const e=tt.value;if(!e)return Ee.value=!0,void(S.value=t==="source");const l=e.getBoundingClientRect().height;e.style.height=`${l}px`,e.style.overflow="hidden",Ee.value=!0,S.value=t==="source",yield A();const n=e.scrollHeight;e.style.transition="height 180ms ease",e.offsetHeight,e.style.height=`${n}px`;const c=()=>{e.style.transition="",e.style.height="",e.style.overflow="",e.removeEventListener("transitionend",a)};function a(){c()}e.addEventListener("transitionend",a),setTimeout(()=>c(),220)})}function Ne(){return D(this,null,function*(){return W.value?Pe.value:u.value||(yield A(),u.value)?(W.value=!0,Pe.value=D(null,null,function*(){var t,e,l;u.value&&(u.value.style.opacity="0");try{const n=yield Te();if(!n)return;const c=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;B.value||te.value||(t=n.initialize)==null||t.call(n,(e=Qe({},re.value),l={dompurifyConfig:Qe({},be)},ll(e,nl(l))));const a=(function(m,v=R.value){const p=v,L=`%%{init: {"theme": "${m==="dark"?"dark":"default"}"}}%%
4
- `;return p.trim().startsWith("%%{")?p:L+p})(o.isDark?"dark":"light"),s=yield $e(()=>n.render(c,a),{timeoutMs:U.value.fullRender}),i=s?.svg;if(u.value){const m=oe(u.value,i);B.value||te.value||(Ie(),B.value=!0,le.value={zoom:x.value,translateX:O.value,translateY:z.value,containerHeight:G.value});const v=o.isDark?"dark":"light";m&&(K.value[v]=m),te.value&&(te.value=!1),I.value=!1,ge=0,pe()}}catch(n){const c=(function(s){const i=typeof s=="string"?s:typeof s?.message=="string"?s.message:"";return typeof i=="string"&&/timed out/i.test(i)})(n),a=ge+1;c&&a<=3?(ge=a,nt(Math.min(1200,600*a))):(ge=0,pe(),console.error("Failed to render mermaid diagram:",n),o.loading===!1&&at(n))}finally{yield A(),u.value&&(u.value.style.opacity="1"),W.value=!1,Pe.value=null}}),Pe.value):void console.warn("Mermaid container not ready")})}function wt(){return D(this,null,function*(){var t,e;const l=Date.now(),n=++Ze.value;H&&H.abort(),H=new AbortController;const c=H.signal,a=o.isDark?"dark":"light",s=R.value,i=s.replace(/\s+/g,"");if(!s.trim())return u.value&&Me(u.value),rt.value=null,we.value="",void(I.value=!1);if(i===we.value)return;try{const v=yield(function(L,C,Y){return D(this,null,function*(){var N;try{if(yield Ae(L,C,Y))return{fullOk:!0,prefixOk:!1}}catch(k){if(k?.name==="AbortError")throw k}let b=dt(L);if(b&&b.trim()&&b!==L)try{try{const k=yield Kt(L,C,(N=Y?.timeoutMs)!=null?N:U.value.worker);k&&k.trim()&&(b=k)}catch{}if(yield Ae(b,C,Y))return{fullOk:!1,prefixOk:!0,prefix:b}}catch(k){if(k?.name==="AbortError")throw k}return{fullOk:!1,prefixOk:!1}})})(s,a,{signal:c,timeoutMs:U.value.worker});if(v.fullOk)return yield Ne(),void(Ze.value===n&&(rt.value=(e=(t=u.value)==null?void 0:t.innerHTML)!=null?e:null,we.value=i,I.value=!1));const p=ze&&l<=ze;if(v.prefixOk&&v.prefix&&ct()&&!p)return void(yield(function(L){return D(this,null,function*(){if(ct()&&(u.value||(yield A(),u.value))&&!W.value){W.value=!0;try{const C=yield Te();if(!C)return;const Y=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,N=o.isDark?"dark":"light",b=dt(L),k=st(b&&b.trim()?b:L,N);u.value&&(u.value.style.opacity="0");const Ye=yield $e(()=>C.render(Y,k),{timeoutMs:U.value.render}),yt=Ye?.svg;u.value&&yt&&(oe(u.value,yt),Ie())}catch{}finally{yield A(),u.value&&(u.value.style.opacity="1"),W.value=!1}}})})(v.prefix))}catch(v){if(v?.name==="AbortError")return}if(Ze.value!==n||I.value)return;const m=K.value[a];m&&u.value&&oe(u.value,m)})}function _(){de&&(de=!1,ye=800,qe=!1,X&&(X.abort(),X=null),ce&&(globalThis.clearTimeout(ce),ce=null),Oe&&(Pt(Oe),Oe=null),ze=Date.now())}function Xe(){if(_(),H){try{H.abort()}catch{}H=null}if(X){try{X.abort()}catch{}X=null}pe(),ge=0}function Ge(t=800){de&&(Le>=12?_():(ce&&globalThis.clearTimeout(ce),ce=globalThis.setTimeout(()=>{Oe=lt(()=>D(null,null,function*(){if(!de)return;if(S.value||B.value)return void _();const e=o.isDark?"dark":"light",l=R.value;if(!l.trim())return o.loading===!1?void _():void Ge(ye);if(Le++,Le>12)_();else{X&&X.abort(),X=new AbortController;try{if((yield Ae(l,e,{signal:X.signal,timeoutMs:U.value.worker}))&&(yield Ne(),B.value))return void _()}catch{}ye=Math.min(Math.floor(1.5*ye),4e3),Ge(ye)}}),{timeout:500})},t)))}function Ke(){de||S.value||B.value||(de=!0,ze=0,qe=!0,Le=0,Ge(500))}V(Ue,t=>{J.value&&De.value&&(De.value.style.transform=t.transform)},{immediate:!0}),V(()=>R.value,()=>{B.value=!1,K.value={},ue(),!S.value&&j.value&&Ke(),(function(){if(!S.value||!j.value)return;const t=R.value.length;t!==je.value&&(Ve.value=!0,je.value=t,fe&&clearTimeout(fe),fe=setTimeout(()=>{Ve.value&&S.value&&R.value.trim()&&(Ve.value=!1,pt("preview"))},500))})()}),V(()=>o.isDark,()=>D(null,null,function*(){if(!B.value||I.value)return;const t=o.isDark?"dark":"light",e=K.value[t];if(e)return void(u.value&&oe(u.value,e));const l={zoom:x.value,translateX:O.value,translateY:z.value,containerHeight:G.value},n=x.value!==1||O.value!==0||z.value!==0;te.value=!0,n&&(x.value=1,O.value=0,z.value=0,yield A()),yield Ne(),n&&(yield A(),x.value=l.zoom,O.value=l.translateX,z.value=l.translateY,G.value=l.containerHeight,le.value=l)})),V(()=>S.value,t=>D(null,null,function*(){if(t)_(),B.value&&(le.value={zoom:x.value,translateX:O.value,translateY:z.value,containerHeight:G.value});else{if(I.value)return;const e=o.isDark?"dark":"light";if(B.value&&K.value[e])return yield A(),u.value&&oe(u.value,K.value[e]),x.value=le.value.zoom,O.value=le.value.translateX,z.value=le.value.translateY,void(G.value=le.value.containerHeight);if(yield A(),!j.value)return;yield wt(),Ke()}})),V(()=>o.loading,(t,e)=>D(null,null,function*(){if(e===!0&&t===!1){const l=R.value.trim();if(!l)return Xe();const n=o.isDark?"dark":"light",c=l.replace(/\s+/g,"");if(B.value&&c===we.value)return yield A(),u.value&&!u.value.querySelector("svg")&&K.value[n]&&oe(u.value,K.value[n]),void Xe();try{yield Ae(l,n,{timeoutMs:U.value.worker}),yield Ne(),we.value=c,I.value=!1,Xe()}catch(a){Xe(),at(a)}}})),V(q,t=>{se&&se.disconnect(),!t||B.value||te.value||(se=new ResizeObserver(e=>{e&&e.length>0&&!B.value&&!te.value&&el(()=>{Ie(e[0].contentRect.width)})}),se.observe(t))},{immediate:!0}),Nt(()=>D(null,null,function*(){yield A(),Ee.value||(S.value=!j.value),ie.value&&(ue(),je.value=R.value.length)})),V(()=>j.value,t=>{Ee.value||(S.value=!t)}),V(()=>ie.value,t=>{t&&(B.value||(ue(),je.value=R.value.length),o.loading||B.value||ue())},{immediate:!1}),Xt(()=>{fe&&clearTimeout(fe),se&&se.disconnect(),H&&(H.abort(),H=null),_(),pe()}),V(()=>Z.value,t=>D(null,null,function*(){t?(_(),H&&H.abort()):B.value||(yield A(),ue(),S.value||Ke())}),{immediate:!1});const _e=Q(()=>o.isDark?"mermaid-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"mermaid-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700");return(t,e)=>(g(),w("div",{class:y(["my-4 rounded-lg border overflow-hidden shadow-sm",[o.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":o.loading}]])},[o.showHeader?(g(),w("div",{key:0,class:y(["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",o.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"])},[t.$slots["header-left"]?(g(),w("div",al,[Je(t.$slots,"header-left",{},void 0,!0)])):(g(),w("div",il,[r("img",{src:h("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cpath%20fill='none'%20stroke='%23ca9ee6'%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M1.5%202.5c0%206%202.25%205.75%204%207%20.83.67%201.17%202%201%204h3c-.17-2%20.17-3.33%201-4%201.75-1.25%204-1%204-7C12%202.5%2010%203%208%207%206%203%204%202.5%201.5%202.5'%20/%3e%3c/svg%3e"),class:"w-4 h-4 my-0",alt:"Mermaid"},null,8,ul),r("span",{class:y(["text-sm font-medium font-mono truncate",o.isDark?"text-gray-400":"text-gray-600"])},"Mermaid",2)])),t.$slots["header-center"]?(g(),w("div",sl,[Je(t.$slots,"header-center",{},void 0,!0)])):o.showModeToggle&&j.value?(g(),w("div",{key:3,class:y(["flex items-center gap-x-1 rounded-md p-0.5",o.isDark?"bg-gray-700":"bg-gray-100"])},[r("button",{class:y(["px-2.5 py-1 text-xs rounded transition-colors",[S.value?o.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":o.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"]]),onClick:e[0]||(e[0]=()=>gt("preview")),onMouseenter:e[1]||(e[1]=l=>E(l,h(f)("common.preview")||"Preview")),onFocus:e[2]||(e[2]=l=>E(l,h(f)("common.preview")||"Preview")),onMouseleave:T,onBlur:T},[r("div",cl,[e[21]||(e[21]=r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),r("circle",{cx:"12",cy:"12",r:"3"})])],-1)),r("span",null,xe(h(f)("common.preview")||"Preview"),1)])],34),r("button",{class:y(["px-2.5 py-1 text-xs rounded transition-colors",[S.value?o.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":o.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"]]),onClick:e[3]||(e[3]=()=>gt("source")),onMouseenter:e[4]||(e[4]=l=>E(l,h(f)("common.source")||"Source")),onFocus:e[5]||(e[5]=l=>E(l,h(f)("common.source")||"Source")),onMouseleave:T,onBlur:T},[r("div",dl,[e[22]||(e[22]=r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"})],-1)),r("span",null,xe(h(f)("common.source")||"Source"),1)])],34)],2)):ee("",!0),t.$slots["header-right"]?(g(),w("div",vl,[Je(t.$slots,"header-right",{},void 0,!0)])):(g(),w("div",ml,[o.showCollapseButton?(g(),w("button",{key:0,class:y(_e.value),"aria-pressed":Z.value,onClick:e[6]||(e[6]=l=>Z.value=!Z.value),onMouseenter:e[7]||(e[7]=l=>E(l,Z.value?h(f)("common.expand")||"Expand":h(f)("common.collapse")||"Collapse")),onFocus:e[8]||(e[8]=l=>E(l,Z.value?h(f)("common.expand")||"Expand":h(f)("common.collapse")||"Collapse")),onMouseleave:T,onBlur:T},[(g(),w("svg",{style:xt({rotate:Z.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...e[23]||(e[23]=[r("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],42,fl)):ee("",!0),o.showCopyButton?(g(),w("button",{key:1,class:y(_e.value),onClick:Ot,onMouseenter:e[9]||(e[9]=l=>ut(l)),onFocus:e[10]||(e[10]=l=>ut(l)),onMouseleave:T,onBlur:T},[Ce.value?(g(),w("svg",gl,[...e[25]||(e[25]=[r("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(g(),w("svg",hl,[...e[24]||(e[24]=[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),r("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],34)):ee("",!0),o.showExportButton&&j.value?(g(),w("button",{key:2,class:y(`${_e.value} ${Fe.value?"opacity-50 cursor-not-allowed":""}`),disabled:Fe.value,onClick:zt,onMouseenter:e[11]||(e[11]=l=>E(l,h(f)("common.export")||"Export")),onFocus:e[12]||(e[12]=l=>E(l,h(f)("common.export")||"Export")),onMouseleave:T,onBlur:T},[...e[26]||(e[26]=[r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),r("path",{d:"m7 10l5 5l5-5"})])],-1)])],42,pl)):ee("",!0),o.showFullscreenButton&&j.value?(g(),w("button",{key:3,class:y(`${_e.value} ${Fe.value?"opacity-50 cursor-not-allowed":""}`),disabled:Fe.value,onClick:Lt,onMouseenter:e[13]||(e[13]=l=>E(l,J.value?h(f)("common.minimize")||"Minimize":h(f)("common.open")||"Open")),onFocus:e[14]||(e[14]=l=>E(l,J.value?h(f)("common.minimize")||"Minimize":h(f)("common.open")||"Open")),onMouseleave:T,onBlur:T},[J.value?(g(),w("svg",xl,[...e[28]||(e[28]=[r("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(g(),w("svg",yl,[...e[27]||(e[27]=[r("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])]))],42,wl)):ee("",!0)]))],2)):ee("",!0),_t(r("div",{ref_key:"modeContainerRef",ref:tt},[S.value?(g(),w("div",{key:0,class:y(["p-4",o.isDark?"bg-gray-900":"bg-gray-50"])},[r("pre",{class:y(["text-sm font-mono whitespace-pre-wrap",o.isDark?"text-gray-300":"text-gray-700"])},xe(R.value),3)],2)):(g(),w("div",kl,[o.showZoomControls?(g(),w("div",bl,[r("div",Ml,[r("button",{class:y(["p-2 text-xs rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:mt,onMouseenter:e[15]||(e[15]=l=>E(l,h(f)("common.zoomIn")||"Zoom in")),onFocus:e[16]||(e[16]=l=>E(l,h(f)("common.zoomIn")||"Zoom in")),onMouseleave:T,onBlur:T},[...e[29]||(e[29]=[r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("circle",{cx:"11",cy:"11",r:"8"}),r("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],34),r("button",{class:y(["p-2 text-xs rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ft,onMouseenter:e[17]||(e[17]=l=>E(l,h(f)("common.zoomOut")||"Zoom out")),onFocus:e[18]||(e[18]=l=>E(l,h(f)("common.zoomOut")||"Zoom out")),onMouseleave:T,onBlur:T},[...e[30]||(e[30]=[r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("circle",{cx:"11",cy:"11",r:"8"}),r("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],34),r("button",{class:y(["p-2 text-xs rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ht,onMouseenter:e[19]||(e[19]=l=>E(l,h(f)("common.resetZoom")||"Reset zoom")),onFocus:e[20]||(e[20]=l=>E(l,h(f)("common.resetZoom")||"Reset zoom")),onMouseleave:T,onBlur:T},xe(Math.round(100*x.value))+"% ",35)])])):ee("",!0),r("div",kt({ref_key:"mermaidContainer",ref:q,class:["min-h-[360px] relative transition-all duration-100 overflow-hidden block",o.isDark?"bg-gray-900":"bg-gray-50"],style:{height:G.value}},bt(ot.value),{onMousedown:He,onMousemove:Re,onMouseup:ve,onMouseleave:ve,onTouchstartPassive:He,onTouchmovePassive:Re,onTouchendPassive:ve}),[r("div",{"data-mermaid-wrapper":"",class:y(["absolute inset-0 cursor-grab",{"cursor-grabbing":Be.value}]),style:xt(Ue.value)},[r("div",{ref_key:"mermaidContent",ref:u,class:"_mermaid w-full text-center flex items-center justify-center min-h-full"},null,512)],6)],16),(g(),Vt(Wt,{to:"body"},[r("div",Tl,[Zt(Ut,{name:"mermaid-dialog",appear:""},{default:qt(()=>[J.value?(g(),w("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:It(We,["self"])},[r("div",{class:y(["dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",o.isDark?"bg-gray-900":"bg-white"])},[r("div",Cl,[r("button",{class:y(["p-2 text-xs rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:mt},[...e[31]||(e[31]=[r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("circle",{cx:"11",cy:"11",r:"8"}),r("path",{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"})])],-1)])],2),r("button",{class:y(["p-2 text-xs rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ft},[...e[32]||(e[32]=[r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[r("circle",{cx:"11",cy:"11",r:"8"}),r("path",{d:"m21 21l-4.35-4.35M8 11h6"})])],-1)])],2),r("button",{class:y(["p-2 text-xs rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:ht},xe(Math.round(100*x.value))+"% ",3),r("button",{class:y(["inline-flex items-center justify-center p-2 rounded transition-colors",[o.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"]]),onClick:We},[...e[33]||(e[33]=[r("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[r("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"})],-1)])],2)]),r("div",kt({ref_key:"modalContent",ref:ae,class:"w-full h-full flex items-center justify-center p-4 overflow-hidden"},bt(ot.value,!0),{onMousedown:He,onMousemove:Re,onMouseup:ve,onMouseleave:ve,onTouchstartPassive:He,onTouchmovePassive:Re,onTouchendPassive:ve}),null,16)],2)])):ee("",!0)]),_:1})])]))]))],512),[[Yt,!Z.value]])],2))}}),[["__scopeId","data-v-2ff46cc8"]]);et.install=$=>{$.component(et.__name,et)};export{et as default};
@@ -1,24 +0,0 @@
1
- import{_ as b,D as m,H as B,e as C,l as w,b as S,a as D,p as T,q as E,g as F,s as P,E as z,F as A,y as W}from"./DaWfUpsD.js";import{p as _}from"./_mPeMGlT.js";import{p as N}from"./DXsty2qm.js";import"./C8FO969Z.js";import"./DlL1-BJh.js";import"./D0ya9d-G.js";var L=A.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=E,this.getAccDescription=F,this.setAccDescription=P}getConfig(){const t=m({...L,...z().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{_(e,t);let r=-1,o=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);o.length<=l+1&&t.getPacket().length<M;){const[p,s]=H({start:a,end:i,bits:d,label:c},n,l);if(o.push(p),p.end+1===n*l&&(t.pushWord(o),o=[],n++),!s)break;({start:a,end:i,bits:d,label:c}=s)}}t.pushWord(o)},"populate"),H=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const o=t*r-1,n=t*r;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},I=b((e,t,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=B(t);f.attr("viewbox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())O(f,$,y,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((e,t,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(o+l)+l;for(const s of t){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},q={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:e}={})=>{const t=m(q,e);return`
2
- .packetByte {
3
- font-size: ${t.byteFontSize};
4
- }
5
- .packetByte.start {
6
- fill: ${t.startByteColor};
7
- }
8
- .packetByte.end {
9
- fill: ${t.endByteColor};
10
- }
11
- .packetLabel {
12
- fill: ${t.labelColor};
13
- font-size: ${t.labelFontSize};
14
- }
15
- .packetTitle {
16
- fill: ${t.titleColor};
17
- font-size: ${t.titleFontSize};
18
- }
19
- .packetBlock {
20
- stroke: ${t.blockStrokeColor};
21
- stroke-width: ${t.blockStrokeWidth};
22
- fill: ${t.blockFillColor};
23
- }
24
- `},"styles"),V={parser:x,get db(){return new v},renderer:j,styles:G};export{V as diagram};