@intent-hq/web 2.343.1 → 2.344.0

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 (242) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/assets/0.BtTQsuHZ.css +1 -0
  3. package/web/app/immutable/assets/DiagramPresentation.C2GLYoBN.css +1 -0
  4. package/web/app/immutable/chunks/{9kqz7dDm.js → -IITeht6.js} +1 -1
  5. package/web/app/immutable/chunks/{Ae-1QeEg.js → 2XZtwznc.js} +4 -4
  6. package/web/app/immutable/chunks/{iGTwwZkZ.js → 4GiF-64P.js} +1 -1
  7. package/web/app/immutable/chunks/7V9sfwkG.js +1 -0
  8. package/web/app/immutable/chunks/{DnouH0RQ.js → 9cPLPH_O.js} +1 -1
  9. package/web/app/immutable/chunks/{uXJ_E75I.js → B1Hn0_Hu.js} +1 -1
  10. package/web/app/immutable/chunks/{D_n6c_yZ.js → B461Cu-8.js} +1 -1
  11. package/web/app/immutable/chunks/{DyhEd_D5.js → B4yyNCE8.js} +1 -1
  12. package/web/app/immutable/chunks/{DFkJzID4.js → B5lHtLmV.js} +3 -3
  13. package/web/app/immutable/chunks/{BWar5Ve4.js → B7_gjxTl.js} +1 -1
  14. package/web/app/immutable/chunks/{BIGnKucK.js → B9dU3-fa.js} +1 -1
  15. package/web/app/immutable/chunks/{CJ557C-o.js → BAR7XkP3.js} +3 -3
  16. package/web/app/immutable/chunks/{BSJHYrig.js → BBC8ZwBc.js} +1 -1
  17. package/web/app/immutable/chunks/{CsjdKc-0.js → BIG4edn9.js} +1 -1
  18. package/web/app/immutable/chunks/{kIGC16c9.js → BIY2S7K4.js} +1 -1
  19. package/web/app/immutable/chunks/{CgdsufvB.js → BLHhhsG2.js} +1 -1
  20. package/web/app/immutable/chunks/{BOTuR8YM.js → BM1KP-FJ.js} +1 -1
  21. package/web/app/immutable/chunks/{D58P1mNO.js → BMs7t3_m.js} +1 -1
  22. package/web/app/immutable/chunks/{D0TlsaAe.js → BOa-AN22.js} +1 -1
  23. package/web/app/immutable/chunks/{BXNFvqQr.js → BPk8wgKn.js} +3 -3
  24. package/web/app/immutable/chunks/{Dogvf-Iu.js → BQAjCr1w.js} +1 -1
  25. package/web/app/immutable/chunks/{C4omy0Us.js → BRhVB6Sv.js} +1 -1
  26. package/web/app/immutable/chunks/{BytoSt_Z.js → BSo5IXuX.js} +1 -1
  27. package/web/app/immutable/chunks/{BAyUfXYZ.js → BUUYjiKy.js} +1 -1
  28. package/web/app/immutable/chunks/{wiuyjoXz.js → BUY1W-f0.js} +1 -1
  29. package/web/app/immutable/chunks/{DbnF6Yok.js → BXbF11Gp.js} +1 -1
  30. package/web/app/immutable/chunks/{DWcJHqWX.js → BYRfWsRg.js} +1 -1
  31. package/web/app/immutable/chunks/{COjSVIHG.js → BYg2F-3D.js} +1 -1
  32. package/web/app/immutable/chunks/{BXXxFrPj.js → BZm5iyKH.js} +1 -1
  33. package/web/app/immutable/chunks/{CQLYGyEz.js → B_frQYKx.js} +1 -1
  34. package/web/app/immutable/chunks/{Bdd_Up9A.js → BdHmsKvO.js} +1 -1
  35. package/web/app/immutable/chunks/BdNiI0PS.js +344 -0
  36. package/web/app/immutable/chunks/{G8V-Z8rX.js → BdUSoBxL.js} +2 -2
  37. package/web/app/immutable/chunks/{juKvR8YJ.js → Bev5K0J8.js} +4 -4
  38. package/web/app/immutable/chunks/{CrUW7uHI.js → BgN4cuBh.js} +1 -1
  39. package/web/app/immutable/chunks/{BfIFD0ql.js → BgzyvwGo.js} +1 -1
  40. package/web/app/immutable/chunks/{atiG7mlf.js → BhzRZYY1.js} +2 -2
  41. package/web/app/immutable/chunks/{BgEFdEVh.js → BjcX_fOv.js} +1 -1
  42. package/web/app/immutable/chunks/{B70m4__L.js → BjnZ1Xf3.js} +2 -2
  43. package/web/app/immutable/chunks/{C1fHwcnr.js → Bk2hJ8Ly.js} +1 -1
  44. package/web/app/immutable/chunks/{Dp7jUSi9.js → BkUAKnVY.js} +1 -1
  45. package/web/app/immutable/chunks/{BGvipfx2.js → BmB6-2Ft.js} +1 -1
  46. package/web/app/immutable/chunks/{BSDp34Kf.js → BmT6wRR1.js} +1 -1
  47. package/web/app/immutable/chunks/{BaEEaJBP.js → BnZrTj7m.js} +1 -1
  48. package/web/app/immutable/chunks/{DohG5a1a.js → BnjfAdW_.js} +1 -1
  49. package/web/app/immutable/chunks/{I0uVE7V8.js → BnrnoFjd.js} +1 -1
  50. package/web/app/immutable/chunks/{_wUGU0fc.js → Bo4mc4_O.js} +1 -1
  51. package/web/app/immutable/chunks/{Ptn6pOdb.js → BpIeTy9w.js} +1 -1
  52. package/web/app/immutable/chunks/{DoNhrjWd.js → Br0dSiCW.js} +1 -1
  53. package/web/app/immutable/chunks/{DYLHdssA.js → BrysY2Ec.js} +1 -1
  54. package/web/app/immutable/chunks/{BayXe-e8.js → BtBKKn81.js} +1 -1
  55. package/web/app/immutable/chunks/{DMte7IXf.js → BuFMu57Q.js} +1 -1
  56. package/web/app/immutable/chunks/{BsjKNm-k.js → Bv5I7YDM.js} +1 -1
  57. package/web/app/immutable/chunks/{DM_Dhcp5.js → BvSNOyzW.js} +2 -2
  58. package/web/app/immutable/chunks/{OrocR3hK.js → BvrMTALy.js} +1 -1
  59. package/web/app/immutable/chunks/{BznnhLs6.js → BwScowY6.js} +1 -1
  60. package/web/app/immutable/chunks/{Dlo7xxGg.js → By0eqGj-.js} +1 -1
  61. package/web/app/immutable/chunks/{DuHksFog.js → C-s9_soQ.js} +1 -1
  62. package/web/app/immutable/chunks/{AzBoScJz.js → C46XexX0.js} +1 -1
  63. package/web/app/immutable/chunks/{CHylN0y-.js → C4Jo6GXP.js} +1 -1
  64. package/web/app/immutable/chunks/{Dv_vjHi2.js → C59ujSMF.js} +1 -1
  65. package/web/app/immutable/chunks/{C-3x67fn.js → C62A1TLT.js} +2 -2
  66. package/web/app/immutable/chunks/{BIjcjB3s.js → C8b2UIVX.js} +1 -1
  67. package/web/app/immutable/chunks/{BoX75a7M.js → C91dOInA.js} +1 -1
  68. package/web/app/immutable/chunks/{BIqsMOOo.js → C9gix5Ke.js} +1 -1
  69. package/web/app/immutable/chunks/{N8Bwwvnf.js → CClqWu60.js} +1 -1
  70. package/web/app/immutable/chunks/{CfJdaoIE.js → CDFRnJ8k.js} +1 -1
  71. package/web/app/immutable/chunks/{CXHfGIt6.js → CDRWYo_y.js} +1 -1
  72. package/web/app/immutable/chunks/{BmmYJ5hU.js → CGXahRhf.js} +1 -1
  73. package/web/app/immutable/chunks/{C2Rkb1O5.js → CHFUz5Rr.js} +1 -1
  74. package/web/app/immutable/chunks/{CC401ReW.js → CHukbU1Q.js} +1 -1
  75. package/web/app/immutable/chunks/{BUUgD57b.js → CI-nVEa_.js} +1 -1
  76. package/web/app/immutable/chunks/{JIxwOKX_.js → CJSrEfR4.js} +1 -1
  77. package/web/app/immutable/chunks/{DIL0XcL6.js → CMO4ot9F.js} +1 -1
  78. package/web/app/immutable/chunks/{DJ0uFT5X.js → COMJNvT3.js} +1 -1
  79. package/web/app/immutable/chunks/{BqkRycEV.js → CPYWKVyq.js} +9 -9
  80. package/web/app/immutable/chunks/{iAu7Aj29.js → CPi3hzpu.js} +1 -1
  81. package/web/app/immutable/chunks/{DJL0zbbT.js → CTXbgIPd.js} +1 -1
  82. package/web/app/immutable/chunks/{C_AhBHEv.js → CThb3iAk.js} +1 -1
  83. package/web/app/immutable/chunks/{TvbL6LZd.js → CVikHxT_.js} +3 -3
  84. package/web/app/immutable/chunks/{DtxfuyBv.js → CWIcIgSm.js} +1 -1
  85. package/web/app/immutable/chunks/{ClQaWwZN.js → Ca3YR8yw.js} +1 -1
  86. package/web/app/immutable/chunks/{CVEBue1Q.js → CadpuSEK.js} +1 -1
  87. package/web/app/immutable/chunks/{Bgfnbjb4.js → CdN2Ihv_.js} +1 -1
  88. package/web/app/immutable/chunks/{DXw-WTZY.js → CdjPYGHf.js} +1 -1
  89. package/web/app/immutable/chunks/{D-2cdK33.js → CdqlgErf.js} +1 -1
  90. package/web/app/immutable/chunks/{CB2VdHhb.js → CerTrxRJ.js} +1 -1
  91. package/web/app/immutable/chunks/{Dyc_CyAW.js → Cfd0oFGI.js} +1 -1
  92. package/web/app/immutable/chunks/{BrU4OT9R.js → CgWXj0YG.js} +2 -2
  93. package/web/app/immutable/chunks/{BjGmqNpS.js → CiTK-_b6.js} +1 -1
  94. package/web/app/immutable/chunks/{CnZcDXmL.js → CicdOSYm.js} +2 -2
  95. package/web/app/immutable/chunks/{1JAPG9y2.js → Cj2EKBCH.js} +1 -1
  96. package/web/app/immutable/chunks/{CAHBBl9S.js → CjXLe_MO.js} +1 -1
  97. package/web/app/immutable/chunks/{C-DRfJcG.js → CjZIABEV.js} +1 -1
  98. package/web/app/immutable/chunks/{Cx2Zr_EY.js → Ck9j_FHl.js} +1 -1
  99. package/web/app/immutable/chunks/{w-1KkHyd.js → ClTZNeVO.js} +1 -1
  100. package/web/app/immutable/chunks/{BHekbKzn.js → CmSDhJgU.js} +1 -1
  101. package/web/app/immutable/chunks/{DwXYzqBQ.js → Cn19T3na.js} +1 -1
  102. package/web/app/immutable/chunks/{DrI6m-rY.js → Cn3xolhp.js} +1 -1
  103. package/web/app/immutable/chunks/{BpQOBsoR.js → CnJe4S2a.js} +1 -1
  104. package/web/app/immutable/chunks/{BP2y3sRZ.js → CnhilOhJ.js} +1 -1
  105. package/web/app/immutable/chunks/{DtVlaWMd.js → CoTJDQuc.js} +1 -1
  106. package/web/app/immutable/chunks/{DwZUZouP.js → CqhKSPXA.js} +1 -1
  107. package/web/app/immutable/chunks/{35fhULrG.js → CrH1YN9o.js} +1 -1
  108. package/web/app/immutable/chunks/{WQOeAOAl.js → Cs-BSsj3.js} +1 -1
  109. package/web/app/immutable/chunks/{kae1oT68.js → CsF8OjbK.js} +1 -1
  110. package/web/app/immutable/chunks/{C76q11mm.js → CwRpBR2e.js} +1 -1
  111. package/web/app/immutable/chunks/{CIwcmzpw.js → CxLPEkg7.js} +1 -1
  112. package/web/app/immutable/chunks/{BvXEM_ru.js → Cxz3q_28.js} +1 -1
  113. package/web/app/immutable/chunks/{Ci-yONgL.js → Cyfw6OkG.js} +1 -1
  114. package/web/app/immutable/chunks/{QoUsFhvz.js → CzQCBVm9.js} +1 -1
  115. package/web/app/immutable/chunks/{51PCa81S.js → CztRrCMq.js} +1 -1
  116. package/web/app/immutable/chunks/{DFq9n5nW.js → D-J8Mlcm.js} +1 -1
  117. package/web/app/immutable/chunks/{C2NHyJHV.js → D1uFLIU4.js} +1 -1
  118. package/web/app/immutable/chunks/{m1QfmWoj.js → D37kdZVn.js} +1 -1
  119. package/web/app/immutable/chunks/{DarHRPPY.js → D4pwA7AS.js} +2 -2
  120. package/web/app/immutable/chunks/{Dnv7wJSL.js → D6-Slo8_.js} +1 -1
  121. package/web/app/immutable/chunks/{Ci9pTyYA.js → D61HjMue.js} +1 -1
  122. package/web/app/immutable/chunks/{p3CrvZe2.js → D6cqwcO2.js} +1 -1
  123. package/web/app/immutable/chunks/{BANxp4gx.js → D8DQsqlL.js} +1 -1
  124. package/web/app/immutable/chunks/{D__c4Yl1.js → D8FYgRYk.js} +1 -1
  125. package/web/app/immutable/chunks/{U7UFkZSE.js → D8YFvJ64.js} +1 -1
  126. package/web/app/immutable/chunks/{CIR7skK5.js → D9ajM8uP.js} +1 -1
  127. package/web/app/immutable/chunks/{DW4-9u0G.js → DA3kI_Ir.js} +1 -1
  128. package/web/app/immutable/chunks/{DjI8eVMr.js → DAPhb2nP.js} +45 -45
  129. package/web/app/immutable/chunks/{0sFbw5Xt.js → DAYo95RN.js} +1 -1
  130. package/web/app/immutable/chunks/{B0IMKrn3.js → DEnfRYcH.js} +1 -1
  131. package/web/app/immutable/chunks/{rPOaqvb6.js → DGySvVDu.js} +1 -1
  132. package/web/app/immutable/chunks/{DHTa3FGv.js → DHApIXYn.js} +1 -1
  133. package/web/app/immutable/chunks/{Bhmm0Csf.js → DHP1DFPI.js} +1 -1
  134. package/web/app/immutable/chunks/{Cvz-9_40.js → DIumxlqP.js} +1 -1
  135. package/web/app/immutable/chunks/{CeNWJyWT.js → DIyuJ_GU.js} +1 -1
  136. package/web/app/immutable/chunks/{BziNoOeQ.js → DLykoDqY.js} +1 -1
  137. package/web/app/immutable/chunks/{CGAWDKVf.js → DN71oh5l.js} +1 -1
  138. package/web/app/immutable/chunks/{BYONj21e.js → DNM32kqo.js} +1 -1
  139. package/web/app/immutable/chunks/{BsDPTTmM.js → DOrgOYHc.js} +2 -2
  140. package/web/app/immutable/chunks/{DEipLocY.js → DT4LiP7Y.js} +1 -1
  141. package/web/app/immutable/chunks/{CckzaWai.js → DTBnd4hM.js} +1 -1
  142. package/web/app/immutable/chunks/{BtXKsHf_.js → DTrgzOIA.js} +1 -1
  143. package/web/app/immutable/chunks/{CCv3Lx_U.js → DVH2puba.js} +1 -1
  144. package/web/app/immutable/chunks/{D2hN829h.js → DVYqzV0n.js} +1 -1
  145. package/web/app/immutable/chunks/{D7rZCWdO.js → DVsRM1tQ.js} +1 -1
  146. package/web/app/immutable/chunks/DWBLeVMU.js +1 -0
  147. package/web/app/immutable/chunks/{X4cuG_zB.js → DWiPdXwB.js} +1 -1
  148. package/web/app/immutable/chunks/D_aUnmwC.js +1 -0
  149. package/web/app/immutable/chunks/{DRp_Nj0f.js → DaaneYTG.js} +1 -1
  150. package/web/app/immutable/chunks/{DDaNHu84.js → DhDeMWX_.js} +1 -1
  151. package/web/app/immutable/chunks/{Bx3b0rPd.js → DhUtJEn_.js} +1 -1
  152. package/web/app/immutable/chunks/{CIQcnDuR.js → DhtvToBX.js} +1 -1
  153. package/web/app/immutable/chunks/{_0BFM6IU.js → DjCFWz1t.js} +2 -2
  154. package/web/app/immutable/chunks/{Bka1VG1N.js → Dl7ZwNmB.js} +1 -1
  155. package/web/app/immutable/chunks/DnzNFOP-.js +1 -0
  156. package/web/app/immutable/chunks/{HZ3QrylZ.js → Dp_2W12t.js} +1 -1
  157. package/web/app/immutable/chunks/{DZGCpHpr.js → Dq9eeDUE.js} +1 -1
  158. package/web/app/immutable/chunks/{C4Ninryq.js → DqWTOCbK.js} +1 -1
  159. package/web/app/immutable/chunks/{BpLC2eO9.js → DuIazAmY.js} +1 -1
  160. package/web/app/immutable/chunks/{DGznsmsL.js → DukOM-92.js} +1 -1
  161. package/web/app/immutable/chunks/{L-Y-TBRM.js → Dx9ju3Oy.js} +1 -1
  162. package/web/app/immutable/chunks/{DxMdBYgz.js → DxBvyCwr.js} +1 -1
  163. package/web/app/immutable/chunks/{v2YVbizz.js → DzX5UiFd.js} +1 -1
  164. package/web/app/immutable/chunks/{B5tMdivj.js → Gobu28zb.js} +2 -2
  165. package/web/app/immutable/chunks/{BIIYAsFZ.js → HIyZggkg.js} +4 -4
  166. package/web/app/immutable/chunks/{DTVdw8r4.js → HLKPZgVy.js} +1 -1
  167. package/web/app/immutable/chunks/{B422XfSt.js → KJX0Kw6L.js} +3 -3
  168. package/web/app/immutable/chunks/{D2waAEN7.js → L30ES58t.js} +1 -1
  169. package/web/app/immutable/chunks/{DbboHfqH.js → MioiZpXB.js} +1 -1
  170. package/web/app/immutable/chunks/{DA06uG-a.js → NTeezaZ2.js} +1 -1
  171. package/web/app/immutable/chunks/{DySlMfKo.js → PDh5csw9.js} +1 -1
  172. package/web/app/immutable/chunks/{wJj3WeBH.js → PXetJRrh.js} +2 -2
  173. package/web/app/immutable/chunks/{CAXcxCRW.js → RNDWAc1K.js} +6 -6
  174. package/web/app/immutable/chunks/{CDFewoTI.js → SEJ8ae0u.js} +1 -1
  175. package/web/app/immutable/chunks/{BPPRSM7X.js → SxNmK2GR.js} +3 -3
  176. package/web/app/immutable/chunks/{Bc5tOdcb.js → TKg6aZ2_.js} +1 -1
  177. package/web/app/immutable/chunks/{CBq9ao8v.js → UtZBgRek.js} +1 -1
  178. package/web/app/immutable/chunks/{CHVKhAgJ.js → Wsz69q6g.js} +1 -1
  179. package/web/app/immutable/chunks/{z5uPT3dt.js → WyTFZ_7I.js} +1 -1
  180. package/web/app/immutable/chunks/{r9qRR0z6.js → X4o7hGKf.js} +3 -3
  181. package/web/app/immutable/chunks/{CCaHJZV8.js → XvLHDIL-.js} +1 -1
  182. package/web/app/immutable/chunks/{DpjBemXH.js → _RGinDCt.js} +1 -1
  183. package/web/app/immutable/chunks/{DZiSQoCc.js → _VCQMG81.js} +1 -1
  184. package/web/app/immutable/chunks/{v2vpkl1z.js → bJswqAg7.js} +1 -1
  185. package/web/app/immutable/chunks/{ZN-mesLP.js → ei2mFcvT.js} +1 -1
  186. package/web/app/immutable/chunks/{DoWkfKYp.js → f5lTIPHi.js} +1 -1
  187. package/web/app/immutable/chunks/{CgFIU5ie.js → fCEIPyv5.js} +1 -1
  188. package/web/app/immutable/chunks/{CFK6lvfY.js → fI_J_To4.js} +1 -1
  189. package/web/app/immutable/chunks/{CVGmnzrp.js → g9G7tvrf.js} +1 -1
  190. package/web/app/immutable/chunks/{BrNDzmoP.js → gJDgmD_2.js} +1 -1
  191. package/web/app/immutable/chunks/{CJlP-cGG.js → gsD5Xe0D.js} +4 -4
  192. package/web/app/immutable/chunks/{C2uZ_VhE.js → gsElU_36.js} +1 -1
  193. package/web/app/immutable/chunks/{CZt5ZBg4.js → iwClg1fT.js} +3 -3
  194. package/web/app/immutable/chunks/{BdI_W2oB.js → ixz6jb_3.js} +1 -1
  195. package/web/app/immutable/chunks/{CepAUbyM.js → jbKFYOOg.js} +1 -1
  196. package/web/app/immutable/chunks/{DJh_DDe7.js → juQAMcx2.js} +1 -1
  197. package/web/app/immutable/chunks/kHCC2X2-.js +1 -0
  198. package/web/app/immutable/chunks/{C3Z0swGN.js → lI7T5mqw.js} +1 -1
  199. package/web/app/immutable/chunks/{BaA_OrGq.js → nLXSdbN2.js} +1 -1
  200. package/web/app/immutable/chunks/{DtbQslHZ.js → oYQw_s1S.js} +1 -1
  201. package/web/app/immutable/chunks/{nlN0b4Kg.js → ozzjQyCh.js} +1 -1
  202. package/web/app/immutable/chunks/{D8eBy-8s.js → pAYxBetQ.js} +1 -1
  203. package/web/app/immutable/chunks/{DMXJ8RT1.js → quYX3pdL.js} +1 -1
  204. package/web/app/immutable/chunks/{Cu8zpbs5.js → sEcTUaec.js} +1 -1
  205. package/web/app/immutable/chunks/{OmpkRRYb.js → tHDPdTwr.js} +1 -1
  206. package/web/app/immutable/chunks/{D7Ydchf3.js → uPiYeMwS.js} +1 -1
  207. package/web/app/immutable/chunks/{BHxqvJ6p.js → xBFqBq1j.js} +1 -1
  208. package/web/app/immutable/chunks/{BJ9asJd9.js → yl6pDKiQ.js} +1 -1
  209. package/web/app/immutable/chunks/{ClN0hrCD.js → zWI60sec.js} +1 -1
  210. package/web/app/immutable/entry/app.DfuiYuem.js +4 -0
  211. package/web/app/immutable/entry/start.DDUK339f.js +1 -0
  212. package/web/app/immutable/nodes/{0.maNxDgKk.js → 0.D56mBX7M.js} +1 -1
  213. package/web/app/immutable/nodes/{1.CrUOCJzJ.js → 1.az7hmVZE.js} +1 -1
  214. package/web/app/immutable/nodes/{10.DAHzIxDn.js → 10.ijh736ED.js} +1 -1
  215. package/web/app/immutable/nodes/{11.QGXqc7LC.js → 11.CPz1gfx7.js} +1 -1
  216. package/web/app/immutable/nodes/{12.Deg0J99J.js → 12.IWuvbIEt.js} +1 -1
  217. package/web/app/immutable/nodes/{13.DYahTbd4.js → 13.K9ySk2sQ.js} +1 -1
  218. package/web/app/immutable/nodes/{14.DqcYIHGs.js → 14.BvEshoLb.js} +1 -1
  219. package/web/app/immutable/nodes/{15.fBsD-rf2.js → 15.MdkxIvV5.js} +1 -1
  220. package/web/app/immutable/nodes/{16.BB4D0sXM.js → 16.CKCeF79S.js} +1 -1
  221. package/web/app/immutable/nodes/{17.C504DyaY.js → 17.DnoEG3fq.js} +2 -2
  222. package/web/app/immutable/nodes/2.B4faJzFv.js +13 -0
  223. package/web/app/immutable/nodes/{3.C7nQO7Qp.js → 3.CXkOfW97.js} +1 -1
  224. package/web/app/immutable/nodes/{4.DOK8Tw7p.js → 4.DAQzul95.js} +1 -1
  225. package/web/app/immutable/nodes/{5.ubLsJnyC.js → 5.DE5jTHSS.js} +1 -1
  226. package/web/app/immutable/nodes/{6.CyCRzMDW.js → 6.DhIYx_bX.js} +1 -1
  227. package/web/app/immutable/nodes/{7.Bg70Q16x.js → 7.CqVh2822.js} +1 -1
  228. package/web/app/immutable/nodes/{8.BvaAzEQm.js → 8.CtwSJYpI.js} +10 -10
  229. package/web/app/immutable/nodes/{9.DO468RMT.js → 9.RM7Dv9Cl.js} +5 -5
  230. package/web/app/version.json +1 -1
  231. package/web/index.html +16 -16
  232. package/web/app/immutable/assets/0.DZzKp2Fe.css +0 -1
  233. package/web/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css +0 -1
  234. package/web/app/immutable/chunks/BvpPy--g.js +0 -1
  235. package/web/app/immutable/chunks/CO2d8RwC.js +0 -1
  236. package/web/app/immutable/chunks/CQpQeUin.js +0 -1
  237. package/web/app/immutable/chunks/CTjSHpOw.js +0 -344
  238. package/web/app/immutable/chunks/DvnMaoHD.js +0 -1
  239. package/web/app/immutable/chunks/qiTOR0DK.js +0 -1
  240. package/web/app/immutable/entry/app.F35RZd_b.js +0 -4
  241. package/web/app/immutable/entry/start.Dg01C9a0.js +0 -1
  242. package/web/app/immutable/nodes/2.ByX1NsE4.js +0 -13
@@ -1,344 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Bx3b0rPd.js","/app/immutable/chunks/BytoSt_Z.js","/app/immutable/chunks/BsDPTTmM.js","/app/immutable/chunks/CGWRZzdk.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/-xK_vQQs.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/D58P1mNO.js","/app/immutable/chunks/1JAPG9y2.js","/app/immutable/chunks/CckzaWai.js","/app/immutable/chunks/lAmQKSWr.js","/app/immutable/chunks/DGznsmsL.js","/app/immutable/chunks/DnouH0RQ.js","/app/immutable/chunks/DxMdBYgz.js","/app/immutable/chunks/DyhEd_D5.js","/app/immutable/chunks/Ci9pTyYA.js","/app/immutable/chunks/DbnF6Yok.js","/app/immutable/chunks/DJL0zbbT.js","/app/immutable/chunks/BqkRycEV.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CnZcDXmL.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/hX9Crt6i.js","/app/immutable/chunks/BEyWfhqM.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bhmm0Csf.js","/app/immutable/chunks/Dlo7xxGg.js","/app/immutable/chunks/nmrokYzj.js","/app/immutable/chunks/B70m4__L.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/B422XfSt.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B10JrSzM.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DRp_Nj0f.js","/app/immutable/chunks/BOTuR8YM.js","/app/immutable/chunks/DYLHdssA.js","/app/immutable/chunks/CIwcmzpw.js","/app/immutable/chunks/D2hN829h.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/CfJdaoIE.js","/app/immutable/chunks/BoX75a7M.js","/app/immutable/chunks/CVGmnzrp.js","/app/immutable/chunks/BpQOBsoR.js","/app/immutable/chunks/C76q11mm.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/C-3x67fn.js","/app/immutable/chunks/CJ557C-o.js","/app/immutable/chunks/0sFbw5Xt.js","/app/immutable/chunks/DDaNHu84.js","/app/immutable/chunks/BayXe-e8.js","/app/immutable/chunks/Ci-yONgL.js","/app/immutable/chunks/BziNoOeQ.js","/app/immutable/chunks/U7UFkZSE.js","/app/immutable/chunks/DEipLocY.js","/app/immutable/chunks/DkvJR80T.js","/app/immutable/chunks/Dv_vjHi2.js","/app/immutable/chunks/BUUgD57b.js","/app/immutable/chunks/BmmYJ5hU.js","/app/immutable/chunks/v2vpkl1z.js","/app/immutable/chunks/DJ0uFT5X.js","/app/immutable/chunks/ClQaWwZN.js","/app/immutable/chunks/DZGCpHpr.js","/app/immutable/chunks/D7Ydchf3.js","/app/immutable/chunks/OrocR3hK.js","/app/immutable/chunks/ZN-mesLP.js","/app/immutable/chunks/Bc5tOdcb.js","/app/immutable/chunks/Cu8zpbs5.js","/app/immutable/chunks/BIGnKucK.js","/app/immutable/chunks/COjSVIHG.js","/app/immutable/chunks/DoWkfKYp.js","/app/immutable/chunks/35fhULrG.js","/app/immutable/chunks/BaA_OrGq.js","/app/immutable/chunks/BSDp34Kf.js","/app/immutable/chunks/D__c4Yl1.js","/app/immutable/chunks/BIjcjB3s.js","/app/immutable/chunks/Dyc_CyAW.js","/app/immutable/chunks/Bka1VG1N.js","/app/immutable/chunks/p3CrvZe2.js","/app/immutable/chunks/DbboHfqH.js","/app/immutable/chunks/Cx2Zr_EY.js","/app/immutable/chunks/CVEBue1Q.js","/app/immutable/chunks/CIQcnDuR.js","/app/immutable/chunks/BvXEM_ru.js","/app/immutable/chunks/BtXKsHf_.js"])))=>i.map(i=>d[i]);
2
- var W1=Object.defineProperty;var z1=(e,t,r)=>t in e?W1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gr=(e,t,r)=>z1(e,typeof t!="symbol"?t+"":t,r);import{_ as Ge,t as _a,br as ze,bp as Ye,bz as La,b as Aa,a_ as ur,bs as H1}from"./CGWRZzdk.js";import{g as Y1}from"./BdWqymET.js";import{aP as cs}from"./DJL0zbbT.js";import{b7 as X1,cc as j1,bs as Fa,a7 as za,ay as ri,aD as S,bS as qe,be as Hs,b$ as zn,b_ as or,bO as pr,W as ge,c9 as Et,bn as $a,aA as Te,aB as er,bk as Gh,bH as ft,ca as ba,c5 as el,a5 as Ne,bA as Fe,bV as ce,bl as kr,c0 as ch,aC as oi,aw as rl,a as vu,bj as Cp,br as fi,cb as G1,bf as U1}from"./DYhIMPy1.js";import{z as Mu}from"./G8V-Z8rX.js";import{v as ra,u as fe,s as Ys,o as V1,i as wp,e as Z1,f as K1,g as Q1,n as no,p as Tu,j as kp,w as Oo}from"./B70m4__L.js";import{b as ta}from"./BaIAhI85.js";import{c as J1}from"./ChTqQfQN.js";import{c$ as tC,cR as eC,F as Qs,aI as rC,b7 as Sp,l as iC,m as aC,f as oC,i as sC,v as Bu,s as _u,g as nC,G as lC,P as cC,q as hC,y as dC,p as uC,j as fC,D as Lu,H as gC,U as pC,at as mC,au as yC,aU as xC}from"./Dlo7xxGg.js";import{f as Ho,am as bC}from"./B422XfSt.js";import{r as CC,a6 as wC}from"./Ae-1QeEg.js";import{e as kC,H as SC}from"./BIIYAsFZ.js";import{G as vp}from"./Bhmm0Csf.js";import{I as xa,h as Au,H as Ms,d as Fu}from"./BOTuR8YM.js";import{c as io}from"./nmrokYzj.js";import{e as vC}from"./ClN0hrCD.js";import{t as MC}from"./C2uZ_VhE.js";import{s as Hn}from"./BEyWfhqM.js";import{s as $u,a as TC}from"./BsieX9dN.js";import{p as BC,K as _C,h as LC,i as sc,M as AC}from"./DTVdw8r4.js";import"./CgFIU5ie.js";import{t as ga}from"./CIwcmzpw.js";import"./D2hN829h.js";import"./CnZcDXmL.js";import{cq as FC}from"./DYLHdssA.js";function $C(e,t){X1(window,["resize"],()=>j1(()=>t(window[e])))}var Mp=Object.defineProperty,b=(e,t)=>Mp(e,"name",{value:t,configurable:!0}),EC=(e,t)=>{for(var r in t)Mp(e,r,{get:t[r],enumerable:!0})};function Tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}b(Tp,"getDefaultExportFromCjs");var jr={},kn={},Ra={},Eu;function ms(){if(Eu)return Ra;Eu=1;function e(s){return typeof s>"u"||s===null}b(e,"isNothing");function t(s){return typeof s=="object"&&s!==null}b(t,"isObject");function r(s){return Array.isArray(s)?s:e(s)?[]:[s]}b(r,"toArray");function i(s,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];s[d]=n[d]}}return s}b(i,"extend");function a(s,n){let l="";for(let c=0;c<n;c+=1)l+=s;return l}b(a,"repeat");function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return b(o,"isNegativeZero"),Ra.isNothing=e,Ra.isObject=t,Ra.toArray=r,Ra.repeat=a,Ra.isNegativeZero=o,Ra.extend=i,Ra}b(ms,"requireCommon");var nc,Pu;function ys(){if(Pu)return nc;Pu=1;function e(r,i){let a="";const o=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(a+='in "'+r.mark.name+'" '),a+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(a+=`
3
-
4
- `+r.mark.snippet),o+" "+a):o}b(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return b(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=b(function(i){return this.name+": "+e(this,i)},"toString"),nc=t,nc}b(ys,"requireException");var lc,Iu;function Bp(){if(Iu)return lc;Iu=1;const e=ms();function t(a,o,s,n,l){let c="",h="";const d=Math.floor(l/2)-1;return n-o>d&&(c=" ... ",o=n-d+c.length),s-n>d&&(h=" ...",s=n+d-h.length),{str:c+a.slice(o,s).replace(/\t/g,"→")+h,pos:n-o+c.length}}b(t,"getLine");function r(a,o){return e.repeat(" ",o-a.length)+a}b(r,"padStart");function i(a,o){if(o=Object.create(o||null),!a.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const s=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=s.exec(a.buffer);)l.push(c.index),n.push(c.index+c[0].length),a.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let d="";const u=Math.min(a.line+o.linesAfter,l.length).toString().length,f=o.maxLength-(o.indent+u+3);for(let g=1;g<=o.linesBefore&&!(h-g<0);g++){const m=t(a.buffer,n[h-g],l[h-g],a.position-(n[h]-n[h-g]),f);d=e.repeat(" ",o.indent)+r((a.line-g+1).toString(),u)+" | "+m.str+`
5
- `+d}const p=t(a.buffer,n[h],l[h],a.position,f);d+=e.repeat(" ",o.indent)+r((a.line+1).toString(),u)+" | "+p.str+`
6
- `,d+=e.repeat("-",o.indent+u+3+p.pos)+`^
7
- `;for(let g=1;g<=o.linesAfter&&!(h+g>=l.length);g++){const m=t(a.buffer,n[h+g],l[h+g],a.position-(n[h]-n[h+g]),f);d+=e.repeat(" ",o.indent)+r((a.line+g+1).toString(),u)+" | "+m.str+`
8
- `}return d.replace(/\n$/,"")}return b(i,"makeSnippet"),lc=i,lc}b(Bp,"requireSnippet");var cc,Ou;function Kr(){if(Ou)return cc;Ou=1;const e=ys(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(o){const s={};return o!==null&&Object.keys(o).forEach(function(n){o[n].forEach(function(l){s[String(l)]=n})}),s}b(i,"compileStyleAliases");function a(o,s){if(s=s||{},Object.keys(s).forEach(function(n){if(t.indexOf(n)===-1)throw new e('Unknown option "'+n+'" is met in definition of "'+o+'" YAML type.')}),this.options=s,this.tag=o,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(n){return n},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=i(s.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+o+'" YAML type.')}return b(a,"Type2"),cc=a,cc}b(Kr,"requireType");var hc,Ru;function Uh(){if(Ru)return hc;Ru=1;const e=ys(),t=Kr();function r(o,s){const n=[];return o[s].forEach(function(l){let c=n.length;n.forEach(function(h,d){h.tag===l.tag&&h.kind===l.kind&&h.multi===l.multi&&(c=d)}),n[c]=l}),n}b(r,"compileList");function i(){const o={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(n){n.multi?(o.multi[n.kind].push(n),o.multi.fallback.push(n)):o[n.kind][n.tag]=o.fallback[n.tag]=n}b(s,"collectType");for(let n=0,l=arguments.length;n<l;n+=1)arguments[n].forEach(s);return o}b(i,"compileMap");function a(o){return this.extend(o)}return b(a,"Schema2"),a.prototype.extend=b(function(s){let n=[],l=[];if(s instanceof t)l.push(s);else if(Array.isArray(s))l=l.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(n=n.concat(s.implicit)),s.explicit&&(l=l.concat(s.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(h.loadKind&&h.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(h.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(a.prototype);return c.implicit=(this.implicit||[]).concat(n),c.explicit=(this.explicit||[]).concat(l),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=i(c.compiledImplicit,c.compiledExplicit),c},"extend"),hc=a,hc}b(Uh,"requireSchema");var dc,Du;function Vh(){if(Du)return dc;Du=1;const e=Kr();return dc=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:b(function(t){return t!==null?t:""},"construct")}),dc}b(Vh,"requireStr");var uc,Nu;function Zh(){if(Nu)return uc;Nu=1;const e=Kr();return uc=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:b(function(t){return t!==null?t:[]},"construct")}),uc}b(Zh,"requireSeq");var fc,qu;function Kh(){if(qu)return fc;qu=1;const e=Kr();return fc=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:b(function(t){return t!==null?t:{}},"construct")}),fc}b(Kh,"requireMap");var gc,Wu;function Qh(){if(Wu)return gc;Wu=1;const e=Uh();return gc=new e({explicit:[Vh(),Zh(),Kh()]}),gc}b(Qh,"requireFailsafe");var pc,zu;function Jh(){if(zu)return pc;zu=1;const e=Kr();function t(a){if(a===null)return!0;const o=a.length;return o===1&&a==="~"||o===4&&(a==="null"||a==="Null"||a==="NULL")}b(t,"resolveYamlNull");function r(){return null}b(r,"constructYamlNull");function i(a){return a===null}return b(i,"isNull"),pc=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:b(function(){return"~"},"canonical"),lowercase:b(function(){return"null"},"lowercase"),uppercase:b(function(){return"NULL"},"uppercase"),camelcase:b(function(){return"Null"},"camelcase"),empty:b(function(){return""},"empty")},defaultStyle:"lowercase"}),pc}b(Jh,"require_null");var mc,Hu;function td(){if(Hu)return mc;Hu=1;const e=Kr();function t(a){if(a===null)return!1;const o=a.length;return o===4&&(a==="true"||a==="True"||a==="TRUE")||o===5&&(a==="false"||a==="False"||a==="FALSE")}b(t,"resolveYamlBoolean");function r(a){return a==="true"||a==="True"||a==="TRUE"}b(r,"constructYamlBoolean");function i(a){return Object.prototype.toString.call(a)==="[object Boolean]"}return b(i,"isBoolean"),mc=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:b(function(a){return a?"true":"false"},"lowercase"),uppercase:b(function(a){return a?"TRUE":"FALSE"},"uppercase"),camelcase:b(function(a){return a?"True":"False"},"camelcase")},defaultStyle:"lowercase"}),mc}b(td,"requireBool");var yc,Yu;function ed(){if(Yu)return yc;Yu=1;const e=ms(),t=Kr();function r(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}b(r,"isHexCode");function i(c){return c>=48&&c<=55}b(i,"isOctCode");function a(c){return c>=48&&c<=57}b(a,"isDecCode");function o(c){if(c===null)return!1;const h=c.length;let d=0,u=!1;if(!h)return!1;let f=c[d];if((f==="-"||f==="+")&&(f=c[++d]),f==="0"){if(d+1===h)return!0;if(f=c[++d],f==="b"){for(d++;d<h;d++){if(f=c[d],f!=="0"&&f!=="1")return!1;u=!0}return u&&isFinite(s(c))}if(f==="x"){for(d++;d<h;d++){if(!r(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(s(c))}if(f==="o"){for(d++;d<h;d++){if(!i(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(s(c))}}for(;d<h;d++){if(!a(c.charCodeAt(d)))return!1;u=!0}return u?isFinite(s(c)):!1}b(o,"resolveYamlInteger");function s(c){let h=c,d=1,u=h[0];if((u==="-"||u==="+")&&(u==="-"&&(d=-1),h=h.slice(1),u=h[0]),h==="0")return 0;if(u==="0"){if(h[1]==="b")return d*parseInt(h.slice(2),2);if(h[1]==="x")return d*parseInt(h.slice(2),16);if(h[1]==="o")return d*parseInt(h.slice(2),8)}return d*parseInt(h,10)}b(s,"parseYamlInteger");function n(c){return s(c)}b(n,"constructYamlInteger");function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!e.isNegativeZero(c)}return b(l,"isInteger"),yc=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:n,predicate:l,represent:{binary:b(function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},"binary"),octal:b(function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},"octal"),decimal:b(function(c){return c.toString(10)},"decimal"),hexadecimal:b(function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),yc}b(ed,"requireInt");var xc,Xu;function rd(){if(Xu)return xc;Xu=1;const e=ms(),t=Kr(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),i=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function a(c){return c===null||!r.test(c)?!1:isFinite(parseFloat(c,10))?!0:i.test(c)}b(a,"resolveYamlFloat");function o(c){let h=c.toLowerCase();const d=h[0]==="-"?-1:1;return"+-".indexOf(h[0])>=0&&(h=h.slice(1)),h===".inf"?d===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:h===".nan"?NaN:d*parseFloat(h,10)}b(o,"constructYamlFloat");const s=/^[-+]?[0-9]+e/;function n(c,h){if(isNaN(c))switch(h){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(h){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(h){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(c))return"-0.0";const d=c.toString(10);return s.test(d)?d.replace("e",".e"):d}b(n,"representYamlFloat");function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||e.isNegativeZero(c))}return b(l,"isFloat"),xc=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:a,construct:o,predicate:l,represent:n,defaultStyle:"lowercase"}),xc}b(rd,"requireFloat");var bc,ju;function id(){return ju||(ju=1,bc=Qh().extend({implicit:[Jh(),td(),ed(),rd()]})),bc}b(id,"requireJson");var Cc,Gu;function ad(){return Gu||(Gu=1,Cc=id()),Cc}b(ad,"requireCore");var wc,Uu;function od(){if(Uu)return wc;Uu=1;const e=Kr(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function i(s){return s===null?!1:t.exec(s)!==null||r.exec(s)!==null}b(i,"resolveYamlTimestamp");function a(s){let n=0,l=null,c=t.exec(s);if(c===null&&(c=r.exec(s)),c===null)throw new Error("Date resolve error");const h=+c[1],d=+c[2]-1,u=+c[3];if(!c[4])return new Date(Date.UTC(h,d,u));const f=+c[4],p=+c[5],g=+c[6];if(c[7]){for(n=c[7].slice(0,3);n.length<3;)n+="0";n=+n}if(c[9]){const y=+c[10],x=+(c[11]||0);l=(y*60+x)*6e4,c[9]==="-"&&(l=-l)}const m=new Date(Date.UTC(h,d,u,f,p,g,n));return l&&m.setTime(m.getTime()-l),m}b(a,"constructYamlTimestamp");function o(s){return s.toISOString()}return b(o,"representYamlTimestamp"),wc=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:a,instanceOf:Date,represent:o}),wc}b(od,"requireTimestamp");var kc,Vu;function sd(){if(Vu)return kc;Vu=1;const e=Kr();function t(r){return r==="<<"||r===null}return b(t,"resolveYamlMerge"),kc=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),kc}b(sd,"requireMerge");var Sc,Zu;function nd(){if(Zu)return Sc;Zu=1;const e=Kr(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
- \r`;function r(s){if(s===null)return!1;let n=0;const l=s.length,c=t;for(let h=0;h<l;h++){const d=c.indexOf(s.charAt(h));if(!(d>64)){if(d<0)return!1;n+=6}}return n%8===0}b(r,"resolveYamlBinary");function i(s){const n=s.replace(/[\r\n=]/g,""),l=n.length,c=t;let h=0;const d=[];for(let f=0;f<l;f++)f%4===0&&f&&(d.push(h>>16&255),d.push(h>>8&255),d.push(h&255)),h=h<<6|c.indexOf(n.charAt(f));const u=l%4*6;return u===0?(d.push(h>>16&255),d.push(h>>8&255),d.push(h&255)):u===18?(d.push(h>>10&255),d.push(h>>2&255)):u===12&&d.push(h>>4&255),new Uint8Array(d)}b(i,"constructYamlBinary");function a(s){let n="",l=0;const c=s.length,h=t;for(let u=0;u<c;u++)u%3===0&&u&&(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]),l=(l<<8)+s[u];const d=c%3;return d===0?(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]):d===2?(n+=h[l>>10&63],n+=h[l>>4&63],n+=h[l<<2&63],n+=h[64]):d===1&&(n+=h[l>>2&63],n+=h[l<<4&63],n+=h[64],n+=h[64]),n}b(a,"representYamlBinary");function o(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return b(o,"isBinary"),Sc=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:a}),Sc}b(nd,"requireBinary");var vc,Ku;function ld(){if(Ku)return vc;Ku=1;const e=Kr(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(o){if(o===null)return!0;const s={},n=o;for(let l=0,c=n.length;l<c;l+=1){const h=n[l];let d=!1;if(r.call(h)!=="[object Object]")return!1;let u;for(u in h)if(t.call(h,u))if(!d)d=!0;else return!1;if(!d||t.call(s,u))return!1;Object.defineProperty(s,u,{value:!0})}return!0}b(i,"resolveYamlOmap");function a(o){return o!==null?o:[]}return b(a,"constructYamlOmap"),vc=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:a}),vc}b(ld,"requireOmap");var Mc,Qu;function cd(){if(Qu)return Mc;Qu=1;const e=Kr(),t=Object.prototype.toString;function r(a){if(a===null)return!0;const o=a,s=new Array(o.length);for(let n=0,l=o.length;n<l;n+=1){const c=o[n];if(t.call(c)!=="[object Object]")return!1;const h=Object.keys(c);if(h.length!==1)return!1;s[n]=[h[0],c[h[0]]]}return!0}b(r,"resolveYamlPairs");function i(a){if(a===null)return[];const o=a,s=new Array(o.length);for(let n=0,l=o.length;n<l;n+=1){const c=o[n],h=Object.keys(c);s[n]=[h[0],c[h[0]]]}return s}return b(i,"constructYamlPairs"),Mc=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),Mc}b(cd,"requirePairs");var Tc,Ju;function hd(){if(Ju)return Tc;Ju=1;const e=Kr(),t=Object.prototype.hasOwnProperty;function r(a){if(a===null)return!0;const o=a;for(const s in o)if(t.call(o,s)&&o[s]!==null)return!1;return!0}b(r,"resolveYamlSet");function i(a){return a!==null?a:{}}return b(i,"constructYamlSet"),Tc=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),Tc}b(hd,"requireSet");var Bc,tf;function Pl(){return tf||(tf=1,Bc=ad().extend({implicit:[od(),sd()],explicit:[nd(),ld(),cd(),hd()]})),Bc}b(Pl,"require_default");var ef;function _p(){if(ef)return kn;ef=1;const e=ms(),t=ys(),r=Bp(),i=Pl(),a=Object.prototype.hasOwnProperty,o=1,s=2,n=3,l=4,c=1,h=2,d=3,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,p=/[,\[\]{}]/,g=/^(?:!|!!|![0-9A-Za-z-]+!)$/,m=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function y(w){return Object.prototype.toString.call(w)}b(y,"_class");function x(w){return w===10||w===13}b(x,"isEol");function C(w){return w===9||w===32}b(C,"isWhiteSpace");function k(w){return w===9||w===32||w===10||w===13}b(k,"isWsOrEol");function v(w){return w===44||w===91||w===93||w===123||w===125}b(v,"isFlowIndicator");function T(w){if(w>=48&&w<=57)return w-48;const U=w|32;return U>=97&&U<=102?U-97+10:-1}b(T,"fromHexCode");function F(w){return w===120?2:w===117?4:w===85?8:0}b(F,"escapedHexLen");function A(w){return w>=48&&w<=57?w-48:-1}b(A,"fromDecimalCode");function M(w){switch(w){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
10
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}b(M,"simpleEscapeSequence");function B(w){return w<=65535?String.fromCharCode(w):String.fromCharCode((w-65536>>10)+55296,(w-65536&1023)+56320)}b(B,"charFromCodepoint");function $(w,U,ht){U==="__proto__"?Object.defineProperty(w,U,{configurable:!0,enumerable:!0,writable:!0,value:ht}):w[U]=ht}b($,"setProperty");const P=new Array(256),I=new Array(256);for(let w=0;w<256;w++)P[w]=M(w)?1:0,I[w]=M(w);function _(w,U){this.input=w,this.filename=U.filename||null,this.schema=U.schema||i,this.onWarning=U.onWarning||null,this.legacy=U.legacy||!1,this.json=U.json||!1,this.listener=U.listener||null,this.maxDepth=typeof U.maxDepth=="number"?U.maxDepth:100,this.maxTotalMergeKeys=typeof U.maxTotalMergeKeys=="number"?U.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=w.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}b(_,"State");function E(w,U){const ht={name:w.filename,buffer:w.input.slice(0,-1),position:w.position,line:w.line,column:w.position-w.lineStart};return ht.snippet=r(ht),new t(U,ht)}b(E,"generateError");function L(w,U){throw E(w,U)}b(L,"throwError");function q(w,U){w.onWarning&&w.onWarning.call(null,E(w,U))}b(q,"throwWarning");function W(w,U,ht){const pt=w.anchorMapTransactions;if(pt.length!==0){const ut=pt[pt.length-1];a.call(ut,U)||(ut[U]={existed:a.call(w.anchorMap,U),value:w.anchorMap[U]})}w.anchorMap[U]=ht}b(W,"storeAnchor");function R(w){w.anchorMapTransactions.push(Object.create(null))}b(R,"beginAnchorTransaction");function D(w){const U=w.anchorMapTransactions.pop(),ht=w.anchorMapTransactions;if(ht.length===0)return;const pt=ht[ht.length-1],ut=Object.keys(U);for(let O=0,V=ut.length;O<V;O+=1){const K=ut[O];a.call(pt,K)||(pt[K]=U[K])}}b(D,"commitAnchorTransaction");function G(w){const U=w.anchorMapTransactions.pop(),ht=Object.keys(U);for(let pt=ht.length-1;pt>=0;pt-=1){const ut=U[ht[pt]];ut.existed?w.anchorMap[ht[pt]]=ut.value:delete w.anchorMap[ht[pt]]}}b(G,"rollbackAnchorTransaction");function j(w){return{position:w.position,line:w.line,lineStart:w.lineStart,lineIndent:w.lineIndent,firstTabInLine:w.firstTabInLine,tag:w.tag,anchor:w.anchor,kind:w.kind,result:w.result}}b(j,"snapshotState");function z(w,U){w.position=U.position,w.line=U.line,w.lineStart=U.lineStart,w.lineIndent=U.lineIndent,w.firstTabInLine=U.firstTabInLine,w.tag=U.tag,w.anchor=U.anchor,w.kind=U.kind,w.result=U.result}b(z,"restoreState");const Q={YAML:b(function(U,ht,pt){U.version!==null&&L(U,"duplication of %YAML directive"),pt.length!==1&&L(U,"YAML directive accepts exactly one argument");const ut=/^([0-9]+)\.([0-9]+)$/.exec(pt[0]);ut===null&&L(U,"ill-formed argument of the YAML directive");const O=parseInt(ut[1],10),V=parseInt(ut[2],10);O!==1&&L(U,"unacceptable YAML version of the document"),U.version=pt[0],U.checkLineBreaks=V<2,V!==1&&V!==2&&q(U,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:b(function(U,ht,pt){let ut;pt.length!==2&&L(U,"TAG directive accepts exactly two arguments");const O=pt[0];ut=pt[1],g.test(O)||L(U,"ill-formed tag handle (first argument) of the TAG directive"),a.call(U.tagMap,O)&&L(U,'there is a previously declared suffix for "'+O+'" tag handle'),m.test(ut)||L(U,"ill-formed tag prefix (second argument) of the TAG directive");try{ut=decodeURIComponent(ut)}catch{L(U,"tag prefix is malformed: "+ut)}U.tagMap[O]=ut},"handleTagDirective")};function et(w,U,ht,pt){if(U<ht){const ut=w.input.slice(U,ht);if(pt)for(let O=0,V=ut.length;O<V;O+=1){const K=ut.charCodeAt(O);K===9||K>=32&&K<=1114111||L(w,"expected valid JSON character")}else u.test(ut)&&L(w,"the stream contains non-printable characters");w.result+=ut}}b(et,"captureSegment");function rt(w){w.totalMergeKeys++,w.maxTotalMergeKeys!==-1&&w.totalMergeKeys>w.maxTotalMergeKeys&&L(w,"merge keys exceeded maxTotalMergeKeys ("+w.maxTotalMergeKeys+")")}b(rt,"chargeMergeWork");function J(w,U,ht,pt){e.isObject(ht)||L(w,"cannot merge mappings; the provided source object is unacceptable"),rt(w);const ut=Object.keys(ht);for(let O=0,V=ut.length;O<V;O+=1){const K=ut[O];rt(w),a.call(U,K)||($(U,K,ht[K]),pt[K]=!0)}}b(J,"mergeMappings");function at(w,U,ht,pt,ut,O,V,K,ct){if(Array.isArray(ut)){ut=Array.prototype.slice.call(ut);for(let yt=0,vt=ut.length;yt<vt;yt+=1)Array.isArray(ut[yt])&&L(w,"nested arrays are not supported inside keys"),typeof ut=="object"&&y(ut[yt])==="[object Object]"&&(ut[yt]="[object Object]")}if(typeof ut=="object"&&y(ut)==="[object Object]"&&(ut="[object Object]"),ut=String(ut),U===null&&(U={}),pt==="tag:yaml.org,2002:merge")if(Array.isArray(O)){O.length>100&&L(w,"abnormal merge sequence size");for(let yt=0,vt=O.length;yt<vt;yt+=1)J(w,U,O[yt],ht)}else J(w,U,O,ht);else!w.json&&!a.call(ht,ut)&&a.call(U,ut)&&(w.line=V||w.line,w.lineStart=K||w.lineStart,w.position=ct||w.position,L(w,"duplicated mapping key")),$(U,ut,O),delete ht[ut];return U}b(at,"storeMappingPair");function xt(w){const U=w.input.charCodeAt(w.position);U===10?w.position++:U===13?(w.position++,w.input.charCodeAt(w.position)===10&&w.position++):L(w,"a line break is expected"),w.line+=1,w.lineStart=w.position,w.firstTabInLine=-1}b(xt,"readLineBreak");function H(w,U,ht){let pt=0,ut=w.input.charCodeAt(w.position);for(;ut!==0;){for(;C(ut);)ut===9&&w.firstTabInLine===-1&&(w.firstTabInLine=w.position),ut=w.input.charCodeAt(++w.position);if(U&&ut===35)do ut=w.input.charCodeAt(++w.position);while(ut!==10&&ut!==13&&ut!==0);if(x(ut))for(xt(w),ut=w.input.charCodeAt(w.position),pt++,w.lineIndent=0;ut===32;)w.lineIndent++,ut=w.input.charCodeAt(++w.position);else break}return ht!==-1&&pt!==0&&w.lineIndent<ht&&q(w,"deficient indentation"),pt}b(H,"skipSeparationSpace");function Y(w){let U=w.position,ht=w.input.charCodeAt(U);return!!((ht===45||ht===46)&&ht===w.input.charCodeAt(U+1)&&ht===w.input.charCodeAt(U+2)&&(U+=3,ht=w.input.charCodeAt(U),ht===0||k(ht)))}b(Y,"testDocumentSeparator");function Z(w,U){U===1?w.result+=" ":U>1&&(w.result+=e.repeat(`
11
- `,U-1))}b(Z,"writeFoldedLines");function tt(w,U,ht){let pt,ut,O,V,K,ct;const yt=w.kind,vt=w.result;let ot=w.input.charCodeAt(w.position);if(k(ot)||v(ot)||ot===35||ot===38||ot===42||ot===33||ot===124||ot===62||ot===39||ot===34||ot===37||ot===64||ot===96)return!1;if(ot===63||ot===45){const kt=w.input.charCodeAt(w.position+1);if(k(kt)||ht&&v(kt))return!1}for(w.kind="scalar",w.result="",pt=ut=w.position,O=!1;ot!==0;){if(ot===58){const kt=w.input.charCodeAt(w.position+1);if(k(kt)||ht&&v(kt))break}else if(ot===35){const kt=w.input.charCodeAt(w.position-1);if(k(kt))break}else{if(w.position===w.lineStart&&Y(w)||ht&&v(ot))break;if(x(ot))if(V=w.line,K=w.lineStart,ct=w.lineIndent,H(w,!1,-1),w.lineIndent>=U){O=!0,ot=w.input.charCodeAt(w.position);continue}else{w.position=ut,w.line=V,w.lineStart=K,w.lineIndent=ct;break}}O&&(et(w,pt,ut,!1),Z(w,w.line-V),pt=ut=w.position,O=!1),C(ot)||(ut=w.position+1),ot=w.input.charCodeAt(++w.position)}return et(w,pt,ut,!1),w.result?!0:(w.kind=yt,w.result=vt,!1)}b(tt,"readPlainScalar");function st(w,U){let ht,pt,ut=w.input.charCodeAt(w.position);if(ut!==39)return!1;for(w.kind="scalar",w.result="",w.position++,ht=pt=w.position;(ut=w.input.charCodeAt(w.position))!==0;)if(ut===39)if(et(w,ht,w.position,!0),ut=w.input.charCodeAt(++w.position),ut===39)ht=w.position,w.position++,pt=w.position;else return!0;else x(ut)?(et(w,ht,pt,!0),Z(w,H(w,!1,U)),ht=pt=w.position):w.position===w.lineStart&&Y(w)?L(w,"unexpected end of the document within a single quoted scalar"):(w.position++,C(ut)||(pt=w.position));L(w,"unexpected end of the stream within a single quoted scalar")}b(st,"readSingleQuotedScalar");function It(w,U){let ht,pt,ut,O=w.input.charCodeAt(w.position);if(O!==34)return!1;for(w.kind="scalar",w.result="",w.position++,ht=pt=w.position;(O=w.input.charCodeAt(w.position))!==0;){if(O===34)return et(w,ht,w.position,!0),w.position++,!0;if(O===92){if(et(w,ht,w.position,!0),O=w.input.charCodeAt(++w.position),x(O))H(w,!1,U);else if(O<256&&P[O])w.result+=I[O],w.position++;else if((ut=F(O))>0){let V=ut,K=0;for(;V>0;V--)O=w.input.charCodeAt(++w.position),(ut=T(O))>=0?K=(K<<4)+ut:L(w,"expected hexadecimal character");w.result+=B(K),w.position++}else L(w,"unknown escape sequence");ht=pt=w.position}else x(O)?(et(w,ht,pt,!0),Z(w,H(w,!1,U)),ht=pt=w.position):w.position===w.lineStart&&Y(w)?L(w,"unexpected end of the document within a double quoted scalar"):(w.position++,C(O)||(pt=w.position))}L(w,"unexpected end of the stream within a double quoted scalar")}b(It,"readDoubleQuotedScalar");function zt(w,U){let ht=!0,pt,ut,O;const V=w.tag;let K;const ct=w.anchor;let yt,vt,ot,kt;const Xt=Object.create(null);let re,Kt,xe,Ee=w.input.charCodeAt(w.position);if(Ee===91)yt=93,kt=!1,K=[];else if(Ee===123)yt=125,kt=!0,K={};else return!1;for(w.anchor!==null&&W(w,w.anchor,K),Ee=w.input.charCodeAt(++w.position);Ee!==0;){if(H(w,!0,U),Ee=w.input.charCodeAt(w.position),Ee===yt)return w.position++,w.tag=V,w.anchor=ct,w.kind=kt?"mapping":"sequence",w.result=K,!0;if(ht?Ee===44&&L(w,"expected the node content, but found ','"):L(w,"missed comma between flow collection entries"),Kt=re=xe=null,vt=ot=!1,Ee===63){const si=w.input.charCodeAt(w.position+1);k(si)&&(vt=ot=!0,w.position++,H(w,!0,U))}pt=w.line,ut=w.lineStart,O=w.position,$e(w,U,o,!1,!0),Kt=w.tag,re=w.result,H(w,!0,U),Ee=w.input.charCodeAt(w.position),(ot||w.line===pt)&&Ee===58&&(vt=!0,Ee=w.input.charCodeAt(++w.position),H(w,!0,U),$e(w,U,o,!1,!0),xe=w.result),kt?at(w,K,Xt,Kt,re,xe,pt,ut,O):vt?K.push(at(w,null,Xt,Kt,re,xe,pt,ut,O)):K.push(re),H(w,!0,U),Ee=w.input.charCodeAt(w.position),Ee===44?(ht=!0,Ee=w.input.charCodeAt(++w.position)):ht=!1}L(w,"unexpected end of the stream within a flow collection")}b(zt,"readFlowCollection");function Wt(w,U){let ht,pt=c,ut=!1,O=!1,V=U,K=0,ct=!1,yt,vt=w.input.charCodeAt(w.position);if(vt===124)ht=!1;else if(vt===62)ht=!0;else return!1;for(w.kind="scalar",w.result="";vt!==0;)if(vt=w.input.charCodeAt(++w.position),vt===43||vt===45)c===pt?pt=vt===43?d:h:L(w,"repeat of a chomping mode identifier");else if((yt=A(vt))>=0)yt===0?L(w,"bad explicit indentation width of a block scalar; it cannot be less than one"):O?L(w,"repeat of an indentation width identifier"):(V=U+yt-1,O=!0);else break;if(C(vt)){do vt=w.input.charCodeAt(++w.position);while(C(vt));if(vt===35)do vt=w.input.charCodeAt(++w.position);while(!x(vt)&&vt!==0)}for(;vt!==0;){for(xt(w),w.lineIndent=0,vt=w.input.charCodeAt(w.position);(!O||w.lineIndent<V)&&vt===32;)w.lineIndent++,vt=w.input.charCodeAt(++w.position);if(!O&&w.lineIndent>V&&(V=w.lineIndent),x(vt)){K++;continue}if(!O&&V===0&&L(w,"missing indentation for block scalar"),w.lineIndent<V){pt===d?w.result+=e.repeat(`
12
- `,ut?1+K:K):pt===c&&ut&&(w.result+=`
13
- `);break}ht?C(vt)?(ct=!0,w.result+=e.repeat(`
14
- `,ut?1+K:K)):ct?(ct=!1,w.result+=e.repeat(`
15
- `,K+1)):K===0?ut&&(w.result+=" "):w.result+=e.repeat(`
16
- `,K):w.result+=e.repeat(`
17
- `,ut?1+K:K),ut=!0,O=!0,K=0;const ot=w.position;for(;!x(vt)&&vt!==0;)vt=w.input.charCodeAt(++w.position);et(w,ot,w.position,!1)}return!0}b(Wt,"readBlockScalar");function Zt(w,U){const ht=w.tag,pt=w.anchor,ut=[];let O=!1;if(w.firstTabInLine!==-1)return!1;w.anchor!==null&&W(w,w.anchor,ut);let V=w.input.charCodeAt(w.position);for(;V!==0&&(w.firstTabInLine!==-1&&(w.position=w.firstTabInLine,L(w,"tab characters must not be used in indentation")),V===45);){const K=w.input.charCodeAt(w.position+1);if(!k(K))break;if(O=!0,w.position++,H(w,!0,-1)&&w.lineIndent<=U){ut.push(null),V=w.input.charCodeAt(w.position);continue}const ct=w.line;if($e(w,U,n,!1,!0),ut.push(w.result),H(w,!0,-1),V=w.input.charCodeAt(w.position),(w.line===ct||w.lineIndent>U)&&V!==0)L(w,"bad indentation of a sequence entry");else if(w.lineIndent<U)break}return O?(w.tag=ht,w.anchor=pt,w.kind="sequence",w.result=ut,!0):!1}b(Zt,"readBlockSequence");function $t(w,U,ht){let pt,ut,O,V;const K=w.tag,ct=w.anchor,yt={},vt=Object.create(null);let ot=null,kt=null,Xt=null,re=!1,Kt=!1;if(w.firstTabInLine!==-1)return!1;w.anchor!==null&&W(w,w.anchor,yt);let xe=w.input.charCodeAt(w.position);for(;xe!==0;){!re&&w.firstTabInLine!==-1&&(w.position=w.firstTabInLine,L(w,"tab characters must not be used in indentation"));const Ee=w.input.charCodeAt(w.position+1),si=w.line;if((xe===63||xe===58)&&k(Ee))xe===63?(re&&(at(w,yt,vt,ot,kt,null,ut,O,V),ot=kt=Xt=null),Kt=!0,re=!0,pt=!0):re?(re=!1,pt=!0):L(w,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),w.position+=1,xe=Ee;else{if(ut=w.line,O=w.lineStart,V=w.position,!$e(w,ht,s,!1,!0))break;if(w.line===si){for(xe=w.input.charCodeAt(w.position);C(xe);)xe=w.input.charCodeAt(++w.position);if(xe===58)xe=w.input.charCodeAt(++w.position),k(xe)||L(w,"a whitespace character is expected after the key-value separator within a block mapping"),re&&(at(w,yt,vt,ot,kt,null,ut,O,V),ot=kt=Xt=null),Kt=!0,re=!1,pt=!1,ot=w.tag,kt=w.result;else if(Kt)L(w,"can not read an implicit mapping pair; a colon is missed");else return w.tag=K,w.anchor=ct,!0}else if(Kt)L(w,"can not read a block mapping entry; a multiline key may not be an implicit key");else return w.tag=K,w.anchor=ct,!0}if((w.line===si||w.lineIndent>U)&&(re&&(ut=w.line,O=w.lineStart,V=w.position),$e(w,U,l,!0,pt)&&(re?kt=w.result:Xt=w.result),re||(at(w,yt,vt,ot,kt,Xt,ut,O,V),ot=kt=Xt=null),H(w,!0,-1),xe=w.input.charCodeAt(w.position)),(w.line===si||w.lineIndent>U)&&xe!==0)L(w,"bad indentation of a mapping entry");else if(w.lineIndent<U)break}return re&&at(w,yt,vt,ot,kt,null,ut,O,V),Kt&&(w.tag=K,w.anchor=ct,w.kind="mapping",w.result=yt),Kt}b($t,"readBlockMapping");function Nt(w){let U=!1,ht=!1,pt,ut,O=w.input.charCodeAt(w.position);if(O!==33)return!1;w.tag!==null&&L(w,"duplication of a tag property"),O=w.input.charCodeAt(++w.position),O===60?(U=!0,O=w.input.charCodeAt(++w.position)):O===33?(ht=!0,pt="!!",O=w.input.charCodeAt(++w.position)):pt="!";let V=w.position;if(U){do O=w.input.charCodeAt(++w.position);while(O!==0&&O!==62);w.position<w.length?(ut=w.input.slice(V,w.position),O=w.input.charCodeAt(++w.position)):L(w,"unexpected end of the stream within a verbatim tag")}else{for(;O!==0&&!k(O);)O===33&&(ht?L(w,"tag suffix cannot contain exclamation marks"):(pt=w.input.slice(V-1,w.position+1),g.test(pt)||L(w,"named tag handle cannot contain such characters"),ht=!0,V=w.position+1)),O=w.input.charCodeAt(++w.position);ut=w.input.slice(V,w.position),p.test(ut)&&L(w,"tag suffix cannot contain flow indicator characters")}ut&&!m.test(ut)&&L(w,"tag name cannot contain such characters: "+ut);try{ut=decodeURIComponent(ut)}catch{L(w,"tag name is malformed: "+ut)}return U?w.tag=ut:a.call(w.tagMap,pt)?w.tag=w.tagMap[pt]+ut:pt==="!"?w.tag="!"+ut:pt==="!!"?w.tag="tag:yaml.org,2002:"+ut:L(w,'undeclared tag handle "'+pt+'"'),!0}b(Nt,"readTagProperty");function Be(w){let U=w.input.charCodeAt(w.position);if(U!==38)return!1;w.anchor!==null&&L(w,"duplication of an anchor property"),U=w.input.charCodeAt(++w.position);const ht=w.position;for(;U!==0&&!k(U)&&!v(U);)U=w.input.charCodeAt(++w.position);return w.position===ht&&L(w,"name of an anchor node must contain at least one character"),w.anchor=w.input.slice(ht,w.position),!0}b(Be,"readAnchorProperty");function Ot(w){let U=w.input.charCodeAt(w.position);if(U!==42)return!1;U=w.input.charCodeAt(++w.position);const ht=w.position;for(;U!==0&&!k(U)&&!v(U);)U=w.input.charCodeAt(++w.position);w.position===ht&&L(w,"name of an alias node must contain at least one character");const pt=w.input.slice(ht,w.position);return a.call(w.anchorMap,pt)||L(w,'unidentified alias "'+pt+'"'),w.result=w.anchorMap[pt],H(w,!0,-1),!0}b(Ot,"readAlias");function ue(w,U,ht,pt){const ut=j(w);return R(w),z(w,U),w.tag=null,w.anchor=null,w.kind=null,w.result=null,$t(w,ht,pt)&&w.kind==="mapping"?(D(w),!0):(G(w),z(w,ut),!1)}b(ue,"tryReadBlockMappingFromProperty");function $e(w,U,ht,pt,ut){let O,V,K=1,ct=!1,yt=!1,vt=null,ot,kt,Xt;w.depth>=w.maxDepth&&L(w,"nesting exceeded maxDepth ("+w.maxDepth+")"),w.depth+=1,w.listener!==null&&w.listener("open",w),w.tag=null,w.anchor=null,w.kind=null,w.result=null;const re=O=V=l===ht||n===ht;if(pt&&H(w,!0,-1)&&(ct=!0,w.lineIndent>U?K=1:w.lineIndent===U?K=0:w.lineIndent<U&&(K=-1)),K===1)for(;;){const Kt=w.input.charCodeAt(w.position),xe=j(w);if(ct&&(Kt===33&&w.tag!==null||Kt===38&&w.anchor!==null)||!Nt(w)&&!Be(w))break;vt===null&&(vt=xe),H(w,!0,-1)?(ct=!0,V=re,w.lineIndent>U?K=1:w.lineIndent===U?K=0:w.lineIndent<U&&(K=-1)):V=!1}if(V&&(V=ct||ut),K===1||l===ht)if(o===ht||s===ht?kt=U:kt=U+1,Xt=w.position-w.lineStart,K===1)if(V&&(Zt(w,Xt)||$t(w,Xt,kt))||zt(w,kt))yt=!0;else{const Kt=w.input.charCodeAt(w.position);vt!==null&&re&&!V&&Kt!==124&&Kt!==62&&ue(w,vt,vt.position-vt.lineStart,kt)||O&&Wt(w,kt)||st(w,kt)||It(w,kt)?yt=!0:Ot(w)?(yt=!0,(w.tag!==null||w.anchor!==null)&&L(w,"alias node should not have any properties")):tt(w,kt,o===ht)&&(yt=!0,w.tag===null&&(w.tag="?")),w.anchor!==null&&W(w,w.anchor,w.result)}else K===0&&(yt=V&&Zt(w,Xt));if(w.tag===null)w.anchor!==null&&W(w,w.anchor,w.result);else if(w.tag==="?"){w.result!==null&&w.kind!=="scalar"&&L(w,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+w.kind+'"');for(let Kt=0,xe=w.implicitTypes.length;Kt<xe;Kt+=1)if(ot=w.implicitTypes[Kt],ot.resolve(w.result)){w.result=ot.construct(w.result),w.tag=ot.tag,w.anchor!==null&&W(w,w.anchor,w.result);break}}else if(w.tag!=="!"){if(a.call(w.typeMap[w.kind||"fallback"],w.tag))ot=w.typeMap[w.kind||"fallback"][w.tag];else{ot=null;const Kt=w.typeMap.multi[w.kind||"fallback"];for(let xe=0,Ee=Kt.length;xe<Ee;xe+=1)if(w.tag.slice(0,Kt[xe].tag.length)===Kt[xe].tag){ot=Kt[xe];break}}ot||L(w,"unknown tag !<"+w.tag+">"),w.result!==null&&ot.kind!==w.kind&&L(w,"unacceptable node kind for !<"+w.tag+'> tag; it should be "'+ot.kind+'", not "'+w.kind+'"'),ot.resolve(w.result,w.tag)?(w.result=ot.construct(w.result,w.tag),w.anchor!==null&&W(w,w.anchor,w.result)):L(w,"cannot resolve a node with !<"+w.tag+"> explicit tag")}return w.listener!==null&&w.listener("close",w),w.depth-=1,w.tag!==null||w.anchor!==null||yt}b($e,"composeNode");function Ce(w){const U=w.position;let ht=!1,pt;for(w.version=null,w.checkLineBreaks=w.legacy,w.tagMap=Object.create(null),w.anchorMap=Object.create(null);(pt=w.input.charCodeAt(w.position))!==0&&(H(w,!0,-1),pt=w.input.charCodeAt(w.position),!(w.lineIndent>0||pt!==37));){ht=!0,pt=w.input.charCodeAt(++w.position);let ut=w.position;for(;pt!==0&&!k(pt);)pt=w.input.charCodeAt(++w.position);const O=w.input.slice(ut,w.position),V=[];for(O.length<1&&L(w,"directive name must not be less than one character in length");pt!==0;){for(;C(pt);)pt=w.input.charCodeAt(++w.position);if(pt===35){do pt=w.input.charCodeAt(++w.position);while(pt!==0&&!x(pt));break}if(x(pt))break;for(ut=w.position;pt!==0&&!k(pt);)pt=w.input.charCodeAt(++w.position);V.push(w.input.slice(ut,w.position))}pt!==0&&xt(w),a.call(Q,O)?Q[O](w,O,V):q(w,'unknown document directive "'+O+'"')}if(H(w,!0,-1),w.lineIndent===0&&w.input.charCodeAt(w.position)===45&&w.input.charCodeAt(w.position+1)===45&&w.input.charCodeAt(w.position+2)===45?(w.position+=3,H(w,!0,-1)):ht&&L(w,"directives end mark is expected"),$e(w,w.lineIndent-1,l,!1,!0),H(w,!0,-1),w.checkLineBreaks&&f.test(w.input.slice(U,w.position))&&q(w,"non-ASCII line breaks are interpreted as content"),w.documents.push(w.result),w.position===w.lineStart&&Y(w)){w.input.charCodeAt(w.position)===46&&(w.position+=3,H(w,!0,-1));return}w.position<w.length-1&&L(w,"end of the stream or a document separator is expected")}b(Ce,"readDocument");function we(w,U){w=String(w),U=U||{},w.length!==0&&(w.charCodeAt(w.length-1)!==10&&w.charCodeAt(w.length-1)!==13&&(w+=`
18
- `),w.charCodeAt(0)===65279&&(w=w.slice(1)));const ht=new _(w,U),pt=w.indexOf("\0");for(pt!==-1&&(ht.position=pt,L(ht,"null byte is not allowed in input")),ht.input+="\0";ht.input.charCodeAt(ht.position)===32;)ht.lineIndent+=1,ht.position+=1;for(;ht.position<ht.length-1;)Ce(ht);return ht.documents}b(we,"loadDocuments");function Mt(w,U,ht){U!==null&&typeof U=="object"&&typeof ht>"u"&&(ht=U,U=null);const pt=we(w,ht);if(typeof U!="function")return pt;for(let ut=0,O=pt.length;ut<O;ut+=1)U(pt[ut])}b(Mt,"loadAll2");function Yt(w,U){const ht=we(w,U);if(ht.length!==0){if(ht.length===1)return ht[0];throw new t("expected a single document in the stream, but found more")}}return b(Yt,"load2"),kn.loadAll=Mt,kn.load=Yt,kn}b(_p,"requireLoader");var _c={},rf;function Lp(){if(rf)return _c;rf=1;const e=ms(),t=ys(),r=Pl(),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=65279,s=9,n=10,l=13,c=32,h=33,d=34,u=35,f=37,p=38,g=39,m=42,y=44,x=45,C=58,k=61,v=62,T=63,F=64,A=91,M=93,B=96,$=123,P=124,I=125,_={};_[0]="\\0",_[7]="\\a",_[8]="\\b",_[9]="\\t",_[10]="\\n",_[11]="\\v",_[12]="\\f",_[13]="\\r",_[27]="\\e",_[34]='\\"',_[92]="\\\\",_[133]="\\N",_[160]="\\_",_[8232]="\\L",_[8233]="\\P";const E=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],L=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function q(O,V){if(V===null)return{};const K={},ct=Object.keys(V);for(let yt=0,vt=ct.length;yt<vt;yt+=1){let ot=ct[yt],kt=String(V[ot]);ot.slice(0,2)==="!!"&&(ot="tag:yaml.org,2002:"+ot.slice(2));const Xt=O.compiledTypeMap.fallback[ot];Xt&&a.call(Xt.styleAliases,kt)&&(kt=Xt.styleAliases[kt]),K[ot]=kt}return K}b(q,"compileStyleMap");function W(O){let V,K;const ct=O.toString(16).toUpperCase();if(O<=255)V="x",K=2;else if(O<=65535)V="u",K=4;else if(O<=4294967295)V="U",K=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+V+e.repeat("0",K-ct.length)+ct}b(W,"encodeHex");const R=1,D=2;function G(O){this.schema=O.schema||r,this.indent=Math.max(1,O.indent||2),this.noArrayIndent=O.noArrayIndent||!1,this.skipInvalid=O.skipInvalid||!1,this.flowLevel=e.isNothing(O.flowLevel)?-1:O.flowLevel,this.styleMap=q(this.schema,O.styles||null),this.sortKeys=O.sortKeys||!1,this.lineWidth=O.lineWidth||80,this.noRefs=O.noRefs||!1,this.noCompatMode=O.noCompatMode||!1,this.condenseFlow=O.condenseFlow||!1,this.quotingType=O.quotingType==='"'?D:R,this.forceQuotes=O.forceQuotes||!1,this.replacer=typeof O.replacer=="function"?O.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}b(G,"State");function j(O,V){const K=e.repeat(" ",V);let ct=0,yt="";const vt=O.length;for(;ct<vt;){let ot;const kt=O.indexOf(`
19
- `,ct);kt===-1?(ot=O.slice(ct),ct=vt):(ot=O.slice(ct,kt+1),ct=kt+1),ot.length&&ot!==`
20
- `&&(yt+=K),yt+=ot}return yt}b(j,"indentString");function z(O,V){return`
21
- `+e.repeat(" ",O.indent*V)}b(z,"generateNextLine");function Q(O,V){for(let K=0,ct=O.implicitTypes.length;K<ct;K+=1)if(O.implicitTypes[K].resolve(V))return!0;return!1}b(Q,"testImplicitResolving");function et(O){return O===c||O===s}b(et,"isWhitespace");function rt(O){return O>=32&&O<=126||O>=161&&O<=55295&&O!==8232&&O!==8233||O>=57344&&O<=65533&&O!==o||O>=65536&&O<=1114111}b(rt,"isPrintable");function J(O){return rt(O)&&O!==o&&O!==l&&O!==n}b(J,"isNsCharOrWhitespace");function at(O,V,K){const ct=J(O),yt=ct&&!et(O);return(K?ct:ct&&O!==y&&O!==A&&O!==M&&O!==$&&O!==I)&&O!==u&&!(V===C&&!yt)||J(V)&&!et(V)&&O===u||V===C&&yt}b(at,"isPlainSafe");function xt(O){return rt(O)&&O!==o&&!et(O)&&O!==x&&O!==T&&O!==C&&O!==y&&O!==A&&O!==M&&O!==$&&O!==I&&O!==u&&O!==p&&O!==m&&O!==h&&O!==P&&O!==k&&O!==v&&O!==g&&O!==d&&O!==f&&O!==F&&O!==B}b(xt,"isPlainSafeFirst");function H(O){return!et(O)&&O!==C}b(H,"isPlainSafeLast");function Y(O,V){const K=O.charCodeAt(V);let ct;return K>=55296&&K<=56319&&V+1<O.length&&(ct=O.charCodeAt(V+1),ct>=56320&&ct<=57343)?(K-55296)*1024+ct-56320+65536:K}b(Y,"codePointAt");function Z(O){return/^\n* /.test(O)}b(Z,"needIndentIndicator");const tt=1,st=2,It=3,zt=4,Wt=5;function Zt(O,V,K,ct,yt,vt,ot,kt){let Xt,re=0,Kt=null,xe=!1,Ee=!1;const si=ct!==-1;let da=-1,ua=xt(Y(O,0))&&H(Y(O,O.length-1));if(V||ot)for(Xt=0;Xt<O.length;re>=65536?Xt+=2:Xt++){if(re=Y(O,Xt),!rt(re))return Wt;ua=ua&&at(re,Kt,kt),Kt=re}else{for(Xt=0;Xt<O.length;re>=65536?Xt+=2:Xt++){if(re=Y(O,Xt),re===n)xe=!0,si&&(Ee=Ee||Xt-da-1>ct&&O[da+1]!==" ",da=Xt);else if(!rt(re))return Wt;ua=ua&&at(re,Kt,kt),Kt=re}Ee=Ee||si&&Xt-da-1>ct&&O[da+1]!==" "}return!xe&&!Ee?ua&&!ot&&!yt(O)?tt:vt===D?Wt:st:K>9&&Z(O)?Wt:ot?vt===D?Wt:st:Ee?zt:It}b(Zt,"chooseScalarStyle");function $t(O,V,K,ct,yt){O.dump=(function(){if(V.length===0)return O.quotingType===D?'""':"''";if(!O.noCompatMode&&(E.indexOf(V)!==-1||L.test(V)))return O.quotingType===D?'"'+V+'"':"'"+V+"'";const vt=O.indent*Math.max(1,K),ot=O.lineWidth===-1?-1:Math.max(Math.min(O.lineWidth,40),O.lineWidth-vt),kt=ct||O.flowLevel>-1&&K>=O.flowLevel;function Xt(re){return Q(O,re)}switch(b(Xt,"testAmbiguity"),Zt(V,kt,O.indent,ot,Xt,O.quotingType,O.forceQuotes&&!ct,yt)){case tt:return V;case st:return"'"+V.replace(/'/g,"''")+"'";case It:return"|"+Nt(V,O.indent)+Be(j(V,vt));case zt:return">"+Nt(V,O.indent)+Be(j(Ot(V,ot),vt));case Wt:return'"'+$e(V)+'"';default:throw new t("impossible error: invalid scalar style")}})()}b($t,"writeScalar");function Nt(O,V){const K=Z(O)?String(V):"",ct=O[O.length-1]===`
22
- `,vt=ct&&(O[O.length-2]===`
23
- `||O===`
24
- `)?"+":ct?"":"-";return K+vt+`
25
- `}b(Nt,"blockHeader");function Be(O){return O[O.length-1]===`
26
- `?O.slice(0,-1):O}b(Be,"dropEndingNewline");function Ot(O,V){const K=/(\n+)([^\n]*)/g;let ct=(function(){let kt=O.indexOf(`
27
- `);return kt=kt!==-1?kt:O.length,K.lastIndex=kt,ue(O.slice(0,kt),V)})(),yt=O[0]===`
28
- `||O[0]===" ",vt,ot;for(;ot=K.exec(O);){const kt=ot[1],Xt=ot[2];vt=Xt[0]===" ",ct+=kt+(!yt&&!vt&&Xt!==""?`
29
- `:"")+ue(Xt,V),yt=vt}return ct}b(Ot,"foldString");function ue(O,V){if(O===""||O[0]===" ")return O;const K=/ [^ ]/g;let ct,yt=0,vt,ot=0,kt=0,Xt="";for(;ct=K.exec(O);)kt=ct.index,kt-yt>V&&(vt=ot>yt?ot:kt,Xt+=`
30
- `+O.slice(yt,vt),yt=vt+1),ot=kt;return Xt+=`
31
- `,O.length-yt>V&&ot>yt?Xt+=O.slice(yt,ot)+`
32
- `+O.slice(ot+1):Xt+=O.slice(yt),Xt.slice(1)}b(ue,"foldLine");function $e(O){let V="",K=0;for(let ct=0;ct<O.length;K>=65536?ct+=2:ct++){K=Y(O,ct);const yt=_[K];!yt&&rt(K)?(V+=O[ct],K>=65536&&(V+=O[ct+1])):V+=yt||W(K)}return V}b($e,"escapeString");function Ce(O,V,K){let ct="";const yt=O.tag;for(let vt=0,ot=K.length;vt<ot;vt+=1){let kt=K[vt];O.replacer&&(kt=O.replacer.call(K,String(vt),kt)),(U(O,V,kt,!1,!1)||typeof kt>"u"&&U(O,V,null,!1,!1))&&(ct!==""&&(ct+=","+(O.condenseFlow?"":" ")),ct+=O.dump)}O.tag=yt,O.dump="["+ct+"]"}b(Ce,"writeFlowSequence");function we(O,V,K,ct){let yt="";const vt=O.tag;for(let ot=0,kt=K.length;ot<kt;ot+=1){let Xt=K[ot];O.replacer&&(Xt=O.replacer.call(K,String(ot),Xt)),(U(O,V+1,Xt,!0,!0,!1,!0)||typeof Xt>"u"&&U(O,V+1,null,!0,!0,!1,!0))&&((!ct||yt!=="")&&(yt+=z(O,V)),O.dump&&n===O.dump.charCodeAt(0)?yt+="-":yt+="- ",yt+=O.dump)}O.tag=vt,O.dump=yt||"[]"}b(we,"writeBlockSequence");function Mt(O,V,K){let ct="";const yt=O.tag,vt=Object.keys(K);for(let ot=0,kt=vt.length;ot<kt;ot+=1){let Xt="";ct!==""&&(Xt+=", "),O.condenseFlow&&(Xt+='"');const re=vt[ot];let Kt=K[re];O.replacer&&(Kt=O.replacer.call(K,re,Kt)),U(O,V,re,!1,!1)&&(O.dump.length>1024&&(Xt+="? "),Xt+=O.dump+(O.condenseFlow?'"':"")+":"+(O.condenseFlow?"":" "),U(O,V,Kt,!1,!1)&&(Xt+=O.dump,ct+=Xt))}O.tag=yt,O.dump="{"+ct+"}"}b(Mt,"writeFlowMapping");function Yt(O,V,K,ct){let yt="";const vt=O.tag,ot=Object.keys(K);if(O.sortKeys===!0)ot.sort();else if(typeof O.sortKeys=="function")ot.sort(O.sortKeys);else if(O.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let kt=0,Xt=ot.length;kt<Xt;kt+=1){let re="";(!ct||yt!=="")&&(re+=z(O,V));const Kt=ot[kt];let xe=K[Kt];if(O.replacer&&(xe=O.replacer.call(K,Kt,xe)),!U(O,V+1,Kt,!0,!0,!0))continue;const Ee=O.tag!==null&&O.tag!=="?"||O.dump&&O.dump.length>1024;Ee&&(O.dump&&n===O.dump.charCodeAt(0)?re+="?":re+="? "),re+=O.dump,Ee&&(re+=z(O,V)),U(O,V+1,xe,!0,Ee)&&(O.dump&&n===O.dump.charCodeAt(0)?re+=":":re+=": ",re+=O.dump,yt+=re)}O.tag=vt,O.dump=yt||"{}"}b(Yt,"writeBlockMapping");function w(O,V,K){const ct=K?O.explicitTypes:O.implicitTypes;for(let yt=0,vt=ct.length;yt<vt;yt+=1){const ot=ct[yt];if((ot.instanceOf||ot.predicate)&&(!ot.instanceOf||typeof V=="object"&&V instanceof ot.instanceOf)&&(!ot.predicate||ot.predicate(V))){if(K?ot.multi&&ot.representName?O.tag=ot.representName(V):O.tag=ot.tag:O.tag="?",ot.represent){const kt=O.styleMap[ot.tag]||ot.defaultStyle;let Xt;if(i.call(ot.represent)==="[object Function]")Xt=ot.represent(V,kt);else if(a.call(ot.represent,kt))Xt=ot.represent[kt](V,kt);else throw new t("!<"+ot.tag+'> tag resolver accepts not "'+kt+'" style');O.dump=Xt}return!0}}return!1}b(w,"detectType");function U(O,V,K,ct,yt,vt,ot){O.tag=null,O.dump=K,w(O,K,!1)||w(O,K,!0);const kt=i.call(O.dump),Xt=ct;ct&&(ct=O.flowLevel<0||O.flowLevel>V);const re=kt==="[object Object]"||kt==="[object Array]";let Kt,xe;if(re&&(Kt=O.duplicates.indexOf(K),xe=Kt!==-1),(O.tag!==null&&O.tag!=="?"||xe||O.indent!==2&&V>0)&&(yt=!1),xe&&O.usedDuplicates[Kt])O.dump="*ref_"+Kt;else{if(re&&xe&&!O.usedDuplicates[Kt]&&(O.usedDuplicates[Kt]=!0),kt==="[object Object]")ct&&Object.keys(O.dump).length!==0?(Yt(O,V,O.dump,yt),xe&&(O.dump="&ref_"+Kt+O.dump)):(Mt(O,V,O.dump),xe&&(O.dump="&ref_"+Kt+" "+O.dump));else if(kt==="[object Array]")ct&&O.dump.length!==0?(O.noArrayIndent&&!ot&&V>0?we(O,V-1,O.dump,yt):we(O,V,O.dump,yt),xe&&(O.dump="&ref_"+Kt+O.dump)):(Ce(O,V,O.dump),xe&&(O.dump="&ref_"+Kt+" "+O.dump));else if(kt==="[object String]")O.tag!=="?"&&$t(O,O.dump,V,vt,Xt);else{if(kt==="[object Undefined]")return!1;if(O.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+kt)}if(O.tag!==null&&O.tag!=="?"){let Ee=encodeURI(O.tag[0]==="!"?O.tag.slice(1):O.tag).replace(/!/g,"%21");O.tag[0]==="!"?Ee="!"+Ee:Ee.slice(0,18)==="tag:yaml.org,2002:"?Ee="!!"+Ee.slice(18):Ee="!<"+Ee+">",O.dump=Ee+" "+O.dump}}return!0}b(U,"writeNode");function ht(O,V){const K=[],ct=[];pt(O,K,ct);const yt=ct.length;for(let vt=0;vt<yt;vt+=1)V.duplicates.push(K[ct[vt]]);V.usedDuplicates=new Array(yt)}b(ht,"getDuplicateReferences");function pt(O,V,K){if(O!==null&&typeof O=="object"){const ct=V.indexOf(O);if(ct!==-1)K.indexOf(ct)===-1&&K.push(ct);else if(V.push(O),Array.isArray(O))for(let yt=0,vt=O.length;yt<vt;yt+=1)pt(O[yt],V,K);else{const yt=Object.keys(O);for(let vt=0,ot=yt.length;vt<ot;vt+=1)pt(O[yt[vt]],V,K)}}}b(pt,"inspectNode");function ut(O,V){V=V||{};const K=new G(V);K.noRefs||ht(O,K);let ct=O;return K.replacer&&(ct=K.replacer.call({"":ct},"",ct)),U(K,0,ct,!0,!0)?K.dump+`
33
- `:""}return b(ut,"dump2"),_c.dump=ut,_c}b(Lp,"requireDumper");var af;function Ap(){if(af)return jr;af=1;const e=_p(),t=Lp();function r(i,a){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+a+" instead, which is now safe by default.")}}return b(r,"renamed"),jr.Type=Kr(),jr.Schema=Uh(),jr.FAILSAFE_SCHEMA=Qh(),jr.JSON_SCHEMA=id(),jr.CORE_SCHEMA=ad(),jr.DEFAULT_SCHEMA=Pl(),jr.load=e.load,jr.loadAll=e.loadAll,jr.dump=t.dump,jr.YAMLException=ys(),jr.types={binary:nd(),float:rd(),map:Kh(),null:Jh(),pairs:cd(),set:hd(),timestamp:od(),bool:td(),int:ed(),merge:sd(),omap:ld(),seq:Zh(),str:Vh()},jr.safeLoad=r("safeLoad","load"),jr.safeLoadAll=r("safeLoadAll","loadAll"),jr.safeDump=r("safeDump","dump"),jr}b(Ap,"requireJsYaml");var PC=Ap(),IC=Tp(PC),{Type:x4,Schema:b4,FAILSAFE_SCHEMA:C4,JSON_SCHEMA:OC,CORE_SCHEMA:w4,DEFAULT_SCHEMA:k4,load:RC,loadAll:S4,dump:v4,YAMLException:M4,types:T4,safeLoad:B4,safeLoadAll:_4,safeDump:L4}=IC,DC=b((e,t)=>{const{theme:r,themeVariables:i}=t,{useGradient:a,gradientStart:o,gradientStop:s}=i??{},n=e.attr("id"),l=r?.includes("dark")?"#FFFFFF":"#000000",c=b((d,u,f)=>e.append("defs").append("filter").attr("id",d).attr("height",u).attr("width",u).append("feDropShadow").attr("dx",f).attr("dy",f).attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",l),"dropShadow");if(c(`${n}-drop-shadow`,"130%","4"),c(`${n}-drop-shadow-small`,"150%","2"),!a)return;const h=e.append("linearGradient").attr("id",`${n}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",s).attr("stop-opacity",1)},"insertLookDefs"),Yn={exports:{}},NC=Yn.exports,of;function qC(){return of||(of=1,(function(e,t){(function(r,i){e.exports=i()})(NC,(function(){var r=1e3,i=6e4,a=36e5,o="millisecond",s="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",p="date",g="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var E=["th","st","nd","rd"],L=_%100;return"["+_+(E[(L-20)%10]||E[L]||E[0])+"]"}},C=function(_,E,L){var q=String(_);return!q||q.length>=E?_:""+Array(E+1-q.length).join(L)+_},k={s:C,z:function(_){var E=-_.utcOffset(),L=Math.abs(E),q=Math.floor(L/60),W=L%60;return(E<=0?"+":"-")+C(q,2,"0")+":"+C(W,2,"0")},m:function _(E,L){if(E.date()<L.date())return-_(L,E);var q=12*(L.year()-E.year())+(L.month()-E.month()),W=E.clone().add(q,d),R=L-W<0,D=E.clone().add(q+(R?-1:1),d);return+(-(q+(L-W)/(R?W-D:D-W))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:d,y:f,w:h,d:c,D:p,h:l,m:n,s,ms:o,Q:u}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},v="en",T={};T[v]=x;var F="$isDayjsObject",A=function(_){return _ instanceof P||!(!_||!_[F])},M=function _(E,L,q){var W;if(!E)return v;if(typeof E=="string"){var R=E.toLowerCase();T[R]&&(W=R),L&&(T[R]=L,W=R);var D=E.split("-");if(!W&&D.length>1)return _(D[0])}else{var G=E.name;T[G]=E,W=G}return!q&&W&&(v=W),W||!q&&v},B=function(_,E){if(A(_))return _.clone();var L=typeof E=="object"?E:{};return L.date=_,L.args=arguments,new P(L)},$=k;$.l=M,$.i=A,$.w=function(_,E){return B(_,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var P=(function(){function _(L){this.$L=M(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[F]=!0}var E=_.prototype;return E.parse=function(L){this.$d=(function(q){var W=q.date,R=q.utc;if(W===null)return new Date(NaN);if($.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var D=W.match(m);if(D){var G=D[2]-1||0,j=(D[7]||"0").substring(0,3);return R?new Date(Date.UTC(D[1],G,D[3]||1,D[4]||0,D[5]||0,D[6]||0,j)):new Date(D[1],G,D[3]||1,D[4]||0,D[5]||0,D[6]||0,j)}}return new Date(W)})(L),this.init()},E.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},E.$utils=function(){return $},E.isValid=function(){return this.$d.toString()!==g},E.isSame=function(L,q){var W=B(L);return this.startOf(q)<=W&&W<=this.endOf(q)},E.isAfter=function(L,q){return B(L)<this.startOf(q)},E.isBefore=function(L,q){return this.endOf(q)<B(L)},E.$g=function(L,q,W){return $.u(L)?this[q]:this.set(W,L)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(L,q){var W=this,R=!!$.u(q)||q,D=$.p(L),G=function(xt,H){var Y=$.w(W.$u?Date.UTC(W.$y,H,xt):new Date(W.$y,H,xt),W);return R?Y:Y.endOf(c)},j=function(xt,H){return $.w(W.toDate()[xt].apply(W.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(H)),W)},z=this.$W,Q=this.$M,et=this.$D,rt="set"+(this.$u?"UTC":"");switch(D){case f:return R?G(1,0):G(31,11);case d:return R?G(1,Q):G(0,Q+1);case h:var J=this.$locale().weekStart||0,at=(z<J?z+7:z)-J;return G(R?et-at:et+(6-at),Q);case c:case p:return j(rt+"Hours",0);case l:return j(rt+"Minutes",1);case n:return j(rt+"Seconds",2);case s:return j(rt+"Milliseconds",3);default:return this.clone()}},E.endOf=function(L){return this.startOf(L,!1)},E.$set=function(L,q){var W,R=$.p(L),D="set"+(this.$u?"UTC":""),G=(W={},W[c]=D+"Date",W[p]=D+"Date",W[d]=D+"Month",W[f]=D+"FullYear",W[l]=D+"Hours",W[n]=D+"Minutes",W[s]=D+"Seconds",W[o]=D+"Milliseconds",W)[R],j=R===c?this.$D+(q-this.$W):q;if(R===d||R===f){var z=this.clone().set(p,1);z.$d[G](j),z.init(),this.$d=z.set(p,Math.min(this.$D,z.daysInMonth())).$d}else G&&this.$d[G](j);return this.init(),this},E.set=function(L,q){return this.clone().$set(L,q)},E.get=function(L){return this[$.p(L)]()},E.add=function(L,q){var W,R=this;L=Number(L);var D=$.p(q),G=function(Q){var et=B(R);return $.w(et.date(et.date()+Math.round(Q*L)),R)};if(D===d)return this.set(d,this.$M+L);if(D===f)return this.set(f,this.$y+L);if(D===c)return G(1);if(D===h)return G(7);var j=(W={},W[n]=i,W[l]=a,W[s]=r,W)[D]||1,z=this.$d.getTime()+L*j;return $.w(z,this)},E.subtract=function(L,q){return this.add(-1*L,q)},E.format=function(L){var q=this,W=this.$locale();if(!this.isValid())return W.invalidDate||g;var R=L||"YYYY-MM-DDTHH:mm:ssZ",D=$.z(this),G=this.$H,j=this.$m,z=this.$M,Q=W.weekdays,et=W.months,rt=W.meridiem,J=function(H,Y,Z,tt){return H&&(H[Y]||H(q,R))||Z[Y].slice(0,tt)},at=function(H){return $.s(G%12||12,H,"0")},xt=rt||function(H,Y,Z){var tt=H<12?"AM":"PM";return Z?tt.toLowerCase():tt};return R.replace(y,(function(H,Y){return Y||(function(Z){switch(Z){case"YY":return String(q.$y).slice(-2);case"YYYY":return $.s(q.$y,4,"0");case"M":return z+1;case"MM":return $.s(z+1,2,"0");case"MMM":return J(W.monthsShort,z,et,3);case"MMMM":return J(et,z);case"D":return q.$D;case"DD":return $.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return J(W.weekdaysMin,q.$W,Q,2);case"ddd":return J(W.weekdaysShort,q.$W,Q,3);case"dddd":return Q[q.$W];case"H":return String(G);case"HH":return $.s(G,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return xt(G,j,!0);case"A":return xt(G,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(q.$s);case"ss":return $.s(q.$s,2,"0");case"SSS":return $.s(q.$ms,3,"0");case"Z":return D}return null})(H)||D.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(L,q,W){var R,D=this,G=$.p(q),j=B(L),z=(j.utcOffset()-this.utcOffset())*i,Q=this-j,et=function(){return $.m(D,j)};switch(G){case f:R=et()/12;break;case d:R=et();break;case u:R=et()/3;break;case h:R=(Q-z)/6048e5;break;case c:R=(Q-z)/864e5;break;case l:R=Q/a;break;case n:R=Q/i;break;case s:R=Q/r;break;default:R=Q}return W?R:$.a(R)},E.daysInMonth=function(){return this.endOf(d).$D},E.$locale=function(){return T[this.$L]},E.locale=function(L,q){if(!L)return this.$L;var W=this.clone(),R=M(L,q,!0);return R&&(W.$L=R),W},E.clone=function(){return $.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},_})(),I=P.prototype;return B.prototype=I,[["$ms",o],["$s",s],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach((function(_){I[_[1]]=function(E){return this.$g(E,_[0],_[1])}})),B.extend=function(_,E){return _.$i||(_(E,P,B),_.$i=!0),B},B.locale=M,B.isDayjs=A,B.unix=function(_){return B(1e3*_)},B.en=T[v],B.Ls=T,B.p={},B}))})(Yn)),Yn.exports}var WC=qC();const zC=Y1(WC);var pa={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Tt={trace:b((...e)=>{},"trace"),debug:b((...e)=>{},"debug"),info:b((...e)=>{},"info"),warn:b((...e)=>{},"warn"),error:b((...e)=>{},"error"),fatal:b((...e)=>{},"fatal")},dd=b(function(e="fatal"){let t=pa.fatal;typeof e=="string"?e.toLowerCase()in pa&&(t=pa[e]):typeof e=="number"&&(t=e),Tt.trace=()=>{},Tt.debug=()=>{},Tt.info=()=>{},Tt.warn=()=>{},Tt.error=()=>{},Tt.fatal=()=>{},t<=pa.fatal&&(Tt.fatal=console.error?console.error.bind(console,ki("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ki("FATAL"))),t<=pa.error&&(Tt.error=console.error?console.error.bind(console,ki("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ki("ERROR"))),t<=pa.warn&&(Tt.warn=console.warn?console.warn.bind(console,ki("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ki("WARN"))),t<=pa.info&&(Tt.info=console.info?console.info.bind(console,ki("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ki("INFO"))),t<=pa.debug&&(Tt.debug=console.debug?console.debug.bind(console,ki("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ki("DEBUG"))),t<=pa.trace&&(Tt.trace=console.debug?console.debug.bind(console,ki("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ki("TRACE")))},"setLogLevel"),ki=b(e=>`%c${zC().format("ss.SSS")} : ${e} : `,"format");const Xn={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const a=r<.5?r*(1+t):r+t-r*t,o=2*r-a;switch(i){case"r":return Xn.hue2rgb(o,a,e+1/3)*255;case"g":return Xn.hue2rgb(o,a,e)*255;case"b":return Xn.hue2rgb(o,a,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const a=Math.max(e,t,r),o=Math.min(e,t,r),s=(a+o)/2;if(i==="l")return s*100;if(a===o)return 0;const n=a-o,l=s>.5?n/(2-a-o):n/(a+o);if(i==="s")return l*100;switch(a){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},HC={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},YC={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},We={channel:Xn,lang:HC,unit:YC},Da={};for(let e=0;e<=255;e++)Da[e]=We.unit.dec2hex(e);const Ur={ALL:0,RGB:1,HSL:2};class XC{constructor(){this.type=Ur.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Ur.ALL}is(t){return this.type===t}}class jC{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new XC}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ur.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:a}=t;r===void 0&&(t.h=We.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=We.channel.rgb2hsl(t,"s")),a===void 0&&(t.l=We.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:a}=t;r===void 0&&(t.r=We.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=We.channel.hsl2rgb(t,"g")),a===void 0&&(t.b=We.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ur.HSL)&&r!==void 0?r:(this._ensureHSL(),We.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ur.HSL)&&r!==void 0?r:(this._ensureHSL(),We.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ur.HSL)&&r!==void 0?r:(this._ensureHSL(),We.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ur.RGB)&&r!==void 0?r:(this._ensureRGB(),We.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ur.RGB)&&r!==void 0?r:(this._ensureRGB(),We.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ur.RGB)&&r!==void 0?r:(this._ensureRGB(),We.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ur.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ur.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ur.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ur.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ur.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ur.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Il=new jC({r:0,g:0,b:0,a:0},"transparent"),Yo={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Yo.re);if(!t)return;const r=t[1],i=parseInt(r,16),a=r.length,o=a%4===0,s=a>4,n=s?1:17,l=s?8:4,c=o?0:-1,h=s?255:15;return Il.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:o?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a}=e;return a<1?`#${Da[Math.round(t)]}${Da[Math.round(r)]}${Da[Math.round(i)]}${Da[Math.round(a*255)]}`:`#${Da[Math.round(t)]}${Da[Math.round(r)]}${Da[Math.round(i)]}`}},lo={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(lo.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return We.channel.clamp.h(parseFloat(r)*.9);case"rad":return We.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return We.channel.clamp.h(parseFloat(r)*360)}}return We.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(lo.re);if(!r)return;const[,i,a,o,s,n]=r;return Il.set({h:lo._hue2deg(i),s:We.channel.clamp.s(parseFloat(a)),l:We.channel.clamp.l(parseFloat(o)),a:s?We.channel.clamp.a(n?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a}=e;return a<1?`hsla(${We.lang.round(t)}, ${We.lang.round(r)}%, ${We.lang.round(i)}%, ${a})`:`hsl(${We.lang.round(t)}, ${We.lang.round(r)}%, ${We.lang.round(i)}%)`}},Xs={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Xs.colors[e];if(t)return Yo.parse(t)},stringify:e=>{const t=Yo.stringify(e);for(const r in Xs.colors)if(Xs.colors[r]===t)return r}},Is={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Is.re);if(!r)return;const[,i,a,o,s,n,l,c,h]=r;return Il.set({r:We.channel.clamp.r(a?parseFloat(i)*2.55:parseFloat(i)),g:We.channel.clamp.g(s?parseFloat(o)*2.55:parseFloat(o)),b:We.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?We.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a}=e;return a<1?`rgba(${We.lang.round(t)}, ${We.lang.round(r)}, ${We.lang.round(i)}, ${We.lang.round(a)})`:`rgb(${We.lang.round(t)}, ${We.lang.round(r)}, ${We.lang.round(i)})`}},qi={format:{keyword:Xs,hex:Yo,rgb:Is,rgba:Is,hsl:lo,hsla:lo},parse:e=>{if(typeof e!="string")return e;const t=Yo.parse(e)||Is.parse(e)||lo.parse(e)||Xs.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ur.HSL)||e.data.r===void 0?lo.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Is.stringify(e):Yo.stringify(e)},Fp=(e,t)=>{const r=qi.parse(e);for(const i in t)r[i]=We.channel.clamp[i](t[i]);return qi.stringify(r)},Ha=(e,t,r=0,i=1)=>{if(typeof e!="number")return Fp(e,{a:t});const a=Il.set({r:We.channel.clamp.r(e),g:We.channel.clamp.g(t),b:We.channel.clamp.b(r),a:We.channel.clamp.a(i)});return qi.stringify(a)},GC=(e,t)=>We.lang.round(qi.parse(e)[t]),UC=e=>{const{r:t,g:r,b:i}=qi.parse(e),a=.2126*We.channel.toLinear(t)+.7152*We.channel.toLinear(r)+.0722*We.channel.toLinear(i);return We.lang.round(a)},VC=e=>UC(e)>=.5,hi=e=>!VC(e),$p=(e,t,r)=>{const i=qi.parse(e),a=i[t],o=We.channel.clamp[t](a+r);return a!==o&&(i[t]=o),qi.stringify(i)},gt=(e,t)=>$p(e,"l",t),mt=(e,t)=>$p(e,"l",-t),N=(e,t)=>{const r=qi.parse(e),i={};for(const a in t)t[a]&&(i[a]=r[a]+t[a]);return Fp(e,i)},ZC=(e,t,r=50)=>{const{r:i,g:a,b:o,a:s}=qi.parse(e),{r:n,g:l,b:c,a:h}=qi.parse(t),d=r/100,u=d*2-1,f=s-h,g=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,m=1-g,y=i*g+n*m,x=a*g+l*m,C=o*g+c*m,k=s*d+h*(1-d);return Ha(y,x,C,k)},lt=(e,t=100)=>{const r=qi.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,ZC(r,e,t)};var js=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,il=/\s/,KC=b(e=>{let t="",r=0,i=0;for(;i<e.length;){const a=e.indexOf("%%",i);if(a===-1)break;const o=e.indexOf(`
34
- `,a);if(o===-1)break;let s=a;for(;s>r&&il.test(e[s-1]);)s--;t+=e.slice(r,s)+`
35
- `,r=o+1,i=r}return t+e.slice(r)},"stripAnyComments"),jn=b(e=>e===`
36
- `||e==="\r","isLineBreak"),QC=b((e,t)=>{let r=-1;for(let i=t;i<e.length&&il.test(e[i]);i++)jn(e[i])&&(r=i);return r},"lastLineBreakInWhitespaceRun"),Ep=b(e=>{let t=0;for(;t<e.length&&il.test(e[t])&&!jn(e[t]);)t++;const r=e.slice(0,t);if(!e.startsWith("---",t))return;const i=[];for(let h=t+3;h<e.length&&il.test(e[h]);h++)jn(e[h])&&i.push(h);if(i.length===0)return;const a=`${r}---`,o=b(h=>jn(e[h])&&e.startsWith(a,h+1)?QC(e,h+1+a.length):-1,"closingEnd"),s=i[0]+1;let n=-1;for(let h=s;h<e.length;h++)o(h)!==-1&&(n=h);if(n===-1)return;let l=i[0];for(const h of i)h<n&&(l=h);const c=l+1;for(let h=c;h<=n;h++){const d=o(h);if(d!==-1)return{indent:r,body:e.slice(c,h),length:d+1}}},"matchFrontMatter"),Uo,Pp=(Uo=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},b(Uo,"UnknownDiagramError"),Uo),yo={},Ol=b(function(e,t){const r=Ep(e);e=KC((r?e.slice(r.length):e).replace(js,""));for(const[i,{detector:a}]of Object.entries(yo))if(a(e,t))return i;throw new Pp(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),hh=b((...e)=>{for(const{id:t,detector:r,loader:i}of e)Ip(t,r,i)},"registerLazyLoadedDiagrams"),Ip=b((e,t,r)=>{yo[e]&&Tt.warn(`Detector with key ${e} already exists. Overwriting.`),yo[e]={detector:t,loader:r},Tt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),JC=b(e=>yo[e].loader,"getDiagramLoader"),dh=b((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(a=>dh(e,a,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(a=>{e.includes(a)||e.push(a)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const a=e;Object.entries(t).forEach(([o,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),a[o]===void 0&&(a[o]=Array.isArray(s)?[]:{}),typeof a[o]=="object"&&(a[o]=dh(a[o],s,{depth:r-1}))}else typeof a[o]!="object"&&(Object.hasOwn(e,o)?a[o]=s:Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ir=dh,na="#ffffff",la="#f2f2f2",De=b((e,t)=>t?N(e,{s:-40,l:10}):N(e,{s:-40,l:-10}),"mkBorder"),sf=b(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Wi=b((e,t)=>sf(e)&&sf(t)?{...e,...t}:t,"applyOverride"),Vo,t2=(Vo=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||mt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||mt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||gt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||gt(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||gt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||mt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||N(this.primaryColor,{h:64}),this.fillType3=this.fillType3||N(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||N(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||N(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||N(this.primaryColor,{h:128}),this.fillType7=this.fillType7||N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-10}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??N(this.primaryColor,{l:-30}),this.venn2=this.venn2??N(this.secondaryColor,{l:-30}),this.venn3=this.venn3??N(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??N(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??N(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??N(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??N(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??N(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])}),Object.hasOwn(t,"nodeBorder")&&!Object.hasOwn(t,"useGradient")&&(this.useGradient=!1)}},b(Vo,"Theme"),Vo),e2=b(e=>{const t=new t2;return t.calculate(e),t},"getThemeVariables"),Zo,r2=(Zo=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ha(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=mt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=mt(this.sectionBkgColor,10),this.taskBorderColor=Ha(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ha(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||gt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||mt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=gt(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=gt(this.labelBackground,25),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=gt(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=lt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||gt(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??gt(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=gt(this.secondaryColor,20),this.git1=gt(this.pie2||this.secondaryColor,20),this.git2=gt(this.pie3||this.tertiaryColor,20),this.git3=gt(this.pie4||N(this.primaryColor,{h:-30}),20),this.git4=gt(this.pie5||N(this.primaryColor,{h:-60}),20),this.git5=gt(this.pie6||N(this.primaryColor,{h:-90}),10),this.git6=gt(this.pie7||N(this.primaryColor,{h:60}),10),this.git7=gt(this.pie8||N(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||gt("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||gt("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||gt("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||gt("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||gt(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||gt(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||gt(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||gt(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(Zo,"Theme"),Zo),i2=b(e=>{const t=new r2;return t.calculate(e),t},"getThemeVariables"),Ko,a2=(Ko=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=N(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=De(this.primaryColor,this.darkMode),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=De(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ha(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||mt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||mt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=mt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||mt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||N(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||lt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||lt(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||gt(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||gt(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||N(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-30}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||N(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??N(this.primaryColor,{l:-30}),this.venn2=this.venn2??N(this.secondaryColor,{l:-30}),this.venn3=this.venn3??N(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??N(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??N(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??N(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??N(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??N(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||mt(lt(this.git0),25),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(Ko,"Theme"),Ko),o2=b(e=>{const t=new a2;return t.calculate(e),t},"getThemeVariables"),Qo,s2=(Qo=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=gt("#cde498",10),this.primaryBorderColor=De(this.primaryColor,this.darkMode),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.primaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=mt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||mt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||mt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=mt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||mt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||N(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||gt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||gt(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-30}),this.pie5=this.pie5||N(this.secondaryColor,{l:-30}),this.pie6=this.pie6||N(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??N(this.primaryColor,{l:-30}),this.venn2=this.venn2??N(this.secondaryColor,{l:-30}),this.venn3=this.venn3??N(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??N(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??N(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??N(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??N(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??N(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(Qo,"Theme"),Qo),n2=b(e=>{const t=new s2;return t.calculate(e),t},"getThemeVariables"),Jo,l2=(Jo=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=gt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=De(this.primaryColor,this.darkMode),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||gt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=gt(this.contrast,55),this.border2=this.contrast,this.actorBorder=gt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||gt(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||mt(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.sectionBkgColor=gt(this.contrast,30),this.sectionBkgColor2=gt(this.contrast,30),this.taskBorderColor=mt(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=gt(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=mt(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=mt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||N(this.primaryColor,{h:-30}),this.git4=this.pie5||N(this.primaryColor,{h:-60}),this.git5=this.pie6||N(this.primaryColor,{h:-90}),this.git6=this.pie7||N(this.primaryColor,{h:60}),this.git7=this.pie8||N(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(Jo,"Theme"),Jo),c2=b(e=>{const t=new l2;return t.calculate(e),t},"getThemeVariables"),ts,h2=(ts=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=De(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(hi(this.background)?gt(this.background,4):mt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=N(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||N(t,{h:30}),this.cScale4=this.cScale4||N(t,{h:60}),this.cScale5=this.cScale5||N(t,{h:90}),this.cScale6=this.cScale6||N(t,{h:120}),this.cScale7=this.cScale7||N(t,{h:150}),this.cScale8=this.cScale8||N(t,{h:210,l:150}),this.cScale9=this.cScale9||N(t,{h:270}),this.cScale10=this.cScale10||N(t,{h:300}),this.cScale11=this.cScale11||N(t,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=mt(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=mt(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||lt(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||gt(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||mt(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const a=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||N(this.mainBkg,{h:180,s:-15,l:a*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||N(this.mainBkg,{h:180,s:-15,l:a*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||N(t,{h:64}),this.fillType3=this.fillType3||N(r,{h:64}),this.fillType4=this.fillType4||N(t,{h:-64}),this.fillType5=this.fillType5||N(r,{h:-64}),this.fillType6=this.fillType6||N(t,{h:128}),this.fillType7=this.fillType7||N(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||N(t,{l:-10}),this.pie5=this.pie5||N(r,{l:-10}),this.pie6=this.pie6||N(i,{l:-10}),this.pie7=this.pie7||N(t,{h:60,l:-10}),this.pie8=this.pie8||N(t,{h:-60,l:-10}),this.pie9=this.pie9||N(t,{h:120,l:0}),this.pie10=this.pie10||N(t,{h:60,l:-20}),this.pie11=this.pie11||N(t,{h:-60,l:-20}),this.pie12=this.pie12||N(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||N(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||N(t,{h:-30}),this.git4=this.git4||N(t,{h:-60}),this.git5=this.git5||N(t,{h:-90}),this.git6=this.git6||N(t,{h:60}),this.git7=this.git7||N(t,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(ts,"Theme"),ts),d2=b(e=>{const t=new h2;return t.calculate(e),t},"getThemeVariables"),es,u2=(es=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.border1="#ccc",this.border2=Ha(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?gt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||gt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||mt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||N(this.primaryColor,{h:64}),this.fillType3=this.fillType3||N(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||N(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||N(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||N(this.primaryColor,{h:128}),this.fillType7=this.fillType7||N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-10}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(es,"Theme"),es),f2=b(e=>{const t=new u2;return t.calculate(e),t},"getThemeVariables"),rs,g2=(rs=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=De("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(hi(this.background)?gt(this.background,4):mt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=N(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=mt(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=mt(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||lt(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||gt(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||mt(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const a=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||N(this.mainBkg,{h:180,s:-15,l:a*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||N(this.mainBkg,{h:180,s:-15,l:a*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||N(t,{h:64}),this.fillType3=this.fillType3||N(r,{h:64}),this.fillType4=this.fillType4||N(t,{h:-64}),this.fillType5=this.fillType5||N(r,{h:-64}),this.fillType6=this.fillType6||N(t,{h:128}),this.fillType7=this.fillType7||N(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||N(t,{l:-10}),this.pie5=this.pie5||N(r,{l:-10}),this.pie6=this.pie6||N(i,{l:-10}),this.pie7=this.pie7||N(t,{h:60,l:-10}),this.pie8=this.pie8||N(t,{h:-60,l:-10}),this.pie9=this.pie9||N(t,{h:120,l:0}),this.pie10=this.pie10||N(t,{h:60,l:-20}),this.pie11=this.pie11||N(t,{h:-60,l:-20}),this.pie12=this.pie12||N(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||N(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||N(t,{h:-30}),this.git4=this.git4||N(t,{h:-60}),this.git5=this.git5||N(t,{h:-90}),this.git6=this.git6||N(t,{h:60}),this.git7=this.git7||N(t,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(rs,"Theme"),rs),p2=b(e=>{const t=new g2;return t.calculate(e),t},"getThemeVariables"),is,m2=(is=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.border1="#ccc",this.border2=Ha(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?gt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||gt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||mt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||N(this.primaryColor,{h:64}),this.fillType3=this.fillType3||N(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||N(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||N(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||N(this.primaryColor,{h:128}),this.fillType7=this.fillType7||N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-10}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(is,"Theme"),is),y2=b(e=>{const t=new m2;return t.calculate(e),t},"getThemeVariables"),as,x2=(as=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=De("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.usecaseActorBorder="#A78BFA",this.usecaseActorBkg="#F5F3FF",this.usecaseBorder="#2DD4BF",this.usecaseBkg="#F0FDFA",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseBoundaryBkg="#FAFAFC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(hi(this.background)?gt(this.background,4):mt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=N(t,{h:180,l:5});this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#FFFFFF",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#F9F9FB",this.compositeTitleBackground=this.compositeTitleBackground||"#F9F9FB",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||"white";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||lt(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||gt(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||mt(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const a=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||N(this.mainBkg,{h:180,s:-15,l:a*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||N(this.mainBkg,{h:180,s:-15,l:a*(8+o*3)});this.classText=this.classText||this.textColor;for(let o=0;o<8;o++)this["fillType"+o]=this["fillType"+o]||this.bkgColorArray[o];for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["pie"+(o+1)]=this["pie"+(o+1)]||this["cScale"+o];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let o=0;o<8;o++)this["venn"+(o+1)]=this["venn"+(o+1)]??this.borderColorArray[o%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||N(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||N(t,{h:-30}),this.git4=this.git4||N(t,{h:-60}),this.git5=this.git5||N(t,{h:-90}),this.git6=this.git6||N(t,{h:60}),this.git7=this.git7||N(t,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(as,"Theme"),as),b2=b(e=>{const t=new x2;return t.calculate(e),t},"getThemeVariables"),os,C2=(os=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=De(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.border1="#ccc",this.border2=Ha(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.usecaseActorBorder="#A78BFA",this.usecaseBorder="#2DD4BF",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||De(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||De(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||De(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||De(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?gt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#16141F",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||"#16141F",this.altBackground=this.altBackground||"#16141F",this.compositeTitleBackground=this.compositeTitleBackground||"#16141F",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||this.background;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||lt(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||gt(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||mt(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=mt(this["cScale"+i],75);const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||N(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||N(this.mainBkg,{h:180,s:-15,l:t*(8+i*3)});this.classText=this.classText||this.textColor,["#701a75","#134e4a","#7c2d12","#581c87","#14532d","#4c1d95","#7f1d1d","#713f12"].forEach((i,a)=>{this["fillType"+a]=this["fillType"+a]||i});for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["pie"+(i+1)]=this["pie"+(i+1)]||this["cScale"+i];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||"#28253D",this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let i=0;i<8;i++)this["venn"+(i+1)]=this["venn"+(i+1)]??this.borderColorArray[i%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||hi(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||na,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||la}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Wi(this[i],t[i])})}},b(os,"Theme"),os),w2=b(e=>{const t=new C2;return t.calculate(e),t},"getThemeVariables"),va={base:{getThemeVariables:e2},dark:{getThemeVariables:i2},default:{getThemeVariables:o2},forest:{getThemeVariables:n2},neutral:{getThemeVariables:c2},neo:{getThemeVariables:d2},"neo-dark":{getThemeVariables:f2},redux:{getThemeVariables:p2},"redux-dark":{getThemeVariables:y2},"redux-color":{getThemeVariables:b2},"redux-dark-color":{getThemeVariables:w2}},Ar={flowchart:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,wrappingWidth:120,minNodeWidth:120,stepDuration:1,stepNumbers:!1,inheritDir:!1},swimlane:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"swimlane",lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},agentflow:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:8,nodeSpacing:50,rankSpacing:50,wrappingWidth:120,minNodeWidth:120},sequence:{useMaxWidth:!0,theme:"redux-color",look:"neo",hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"elk",wrappingWidth:120,minNodeWidth:120,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5},er:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,theme:"redux-color",look:"neo",rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,colorBy:"branch",padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,bitOrder:"ascending",paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},usecase:{useMaxWidth:!0,theme:"redux-color",look:"neo",wrappingWidth:120,minNodeWidth:120,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:"normal",usecaseFontSize:12,usecaseFontFamily:'"Open Sans", sans-serif',usecaseFontWeight:"normal",nodeSpacing:50,rankSpacing:50,diagramPadding:20,colorScheme:"role"},venn:{useMaxWidth:!0,theme:"redux-color",look:"neo",width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"elk",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Op={...Ar,deterministicIDSeed:void 0,elk:{mergeEdges:!1,straightenEdges:!0,lineHops:!0,preset:"default",nodePlacementStrategy:void 0,layeringStrategy:void 0,cycleBreakingStrategy:void 0,layeringLayerBound:4,nodePlacementAlignment:void 0,forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1,orientFeedbackEdges:!0},themeCSS:void 0,themeVariables:va.default.getThemeVariables(),sequence:{...Ar.sequence,messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:b(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:b(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{theme:Ar.class?.theme,look:Ar.class?.look,layout:Ar.class?.layout,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Ar.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ar.c4,useWidth:void 0,personFont:b(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ar.flowchart,inheritDir:!1},external_personFont:b(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:b(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:b(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:b(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:b(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:b(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:b(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:b(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:b(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:b(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:b(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:b(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:b(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:b(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:b(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:b(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:b(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:b(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:b(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:b(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ar.pie,useWidth:984},xyChart:{...Ar.xyChart,useWidth:void 0},requirement:{...Ar.requirement,useWidth:void 0},packet:{...Ar.packet},eventmodeling:{...Ar.eventmodeling},treeView:{...Ar.treeView,useWidth:void 0},radar:{...Ar.radar},usecase:{...Ar.usecase},railroad:{...Ar.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Ar.ishikawa},sankey:{...Ar.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Ar.venn},cynefin:{...Ar.cynefin}},Rp=b((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Rp(e[i],"")]:[...r,t+i],[]),"keyify"),k2=new Set(Rp(Op,"")),ud=Op,S2={"flowchart-v2":"flowchart","flowchart-elk":"flowchart",classDiagram:"class",stateDiagram:"state",xychart:"xyChart",railroadAbnf:"railroad",railroadEbnf:"railroad",railroadPeg:"railroad"},v2=b(e=>S2[e]??e,"getDiagramConfigKey"),M2={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},T2=b((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(Tt.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),al=b(e=>{if(Tt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>al(t));return}for(const t of Object.keys(e)){if(Tt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!k2.has(t)||e[t]==null){Tt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=M2[t];i?T2(e[t],i):(Tt.debug("sanitizing object",t),al(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(Tt.debug("sanitizing css option",t),e[t]=Dp(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}Tt.debug("After sanitization",e)}},"sanitizeDirective"),Dp=b(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Ya=Object.freeze(ud),B2=["theme","look","layout"],_2=new Set(["classic","handDrawn","neo"]),L2=b((e,t)=>e==="theme"?t==="null"||Object.hasOwn(va,t):e!=="look"||_2.has(t),"isUsableAppearance"),A2=b((e,t,r)=>e?[e[t]?.[r],e[r]].find(a=>a!==void 0&&L2(r,a)):void 0,"readAppearance"),ca=b(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ti=Ir({},Ya),ol,sl={},Ma=[],Gs=Ir({},Ya),Us,F2=b((e,t)=>{if(!Us)return;const r=[t,...[...Ma].reverse(),sl,Ya],i=e[Us];for(const a of B2)for(const o of r){const s=A2(o,Us,a);if(s!==void 0){e[a]=s,i?.[a]!==void 0&&(i[a]=s);break}}},"resolveAppearance"),xs=b((e,t)=>{let r=Ir({},e),i={};for(const o of t)Wp(o),i=Ir(i,o);if(r=Ir(r,i),F2(r,i),(!!i.theme||r.theme!==e.theme)&&r.theme&&Object.hasOwn(va,r.theme)){const o=Ir({},ol),s=Ir(o.themeVariables||{},i.themeVariables);r.themeVariables=va[r.theme].getThemeVariables(s)}return Gs=r,R2(Gs),Gs},"updateCurrentConfig"),fd=b(e=>{Us=e===void 0?void 0:v2(e),xs(ti,Ma)},"setDiagramConfigScope"),$2=b(e=>(ti=Ir({},Ya),ti=Ir(ti,e),sl=Ir({},e),e.theme&&Object.hasOwn(va,e.theme)&&(ti.themeVariables=va[e.theme].getThemeVariables(e.themeVariables)),xs(ti,Ma),ti),"setSiteConfig"),E2=b(e=>{ol=Ir({},e)},"saveConfigFromInitialize"),P2=b(e=>(ti=Ir(ti,e),sl=Ir(sl,e),xs(ti,Ma),ti),"updateSiteConfig"),Np=b(()=>Ir({},ti),"getSiteConfig"),qp=b(e=>(xs(Gs,[e]),Tr()),"setConfig"),Tr=b(()=>Ir({},Gs),"getConfig"),Wp=b(e=>{e&&(["secure",...ti.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(Tt.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Wp(e[t])}))},"sanitize"),I2=b(e=>{al(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Ma.push(e),xs(ti,Ma)},"addDirective"),nl=b((e=ti)=>{Ma=[],Us=void 0,xs(e,Ma)},"reset"),O2={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},nf={},zp=b(e=>{nf[e]||(Tt.warn(O2[e]),nf[e]=!0)},"issueWarning"),R2=b(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&zp("LAZY_LOAD_DEPRECATED")},"checkConfig"),A4=b(()=>{let e={};ol&&(e=Ir(e,ol));for(const t of Ma)e=Ir(e,t);return e},"getUserDefinedConfig"),zr=b(e=>(e.flowchart?.htmlLabels!=null&&zp("FLOWCHART_HTML_LABELS_DEPRECATED"),ca(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),cn=/<\/?br\s*\/?>/gi,D2=new RegExp(cn.source,"i"),N2=b(e=>e?Xp(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),q2=(()=>{let e=!1;return()=>{e||(Hp(),e=!0)}})();function Hp(){const e="data-temp-href-target";cs.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),cs.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}b(Hp,"setupDompurifyHooks");var Yp=b(e=>(q2(),cs.sanitize(e)),"removeScript"),lf=b((e,t)=>{if(zr(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Yp(e):r!=="loose"&&(e=Xp(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=Y2(e))}return e},"sanitizeMore"),Ti=b((e,t)=>e&&(t.dompurifyConfig?e=cs.sanitize(lf(e,t),t.dompurifyConfig).toString():e=cs.sanitize(lf(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),W2=b((e,t)=>typeof e=="string"?Ti(e,t):e.flat().map(r=>Ti(r,t)),"sanitizeTextOrArray"),z2=b(e=>D2.test(e),"hasBreaks"),H2=b(e=>e.split(cn),"splitBreaks"),Y2=b(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Xp=b(e=>e.replace(cn,"#br#"),"breakToPlaceholder"),X2=b(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),j2=b(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),G2=b(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),cf=b(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let a=t[i];if(a===","&&i>0&&i+1<t.length){const o=t[i-1],s=t[i+1];U2(o,s)&&(a=o+","+s,i++,r.pop())}r.push(V2(a))}return r.join("")},"parseGenericTypes"),uh=b((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),U2=b((e,t)=>{const r=uh(e,"~"),i=uh(t,"~");return r===1&&i===1},"shouldCombineSets"),V2=b(e=>{const t=uh(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let a=i.indexOf("~"),o=i.lastIndexOf("~");for(;a!==-1&&o!==-1&&a!==o;)i[a]="<",i[o]=">",a=i.indexOf("~"),o=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),hf=b(()=>window.MathMLElement!==void 0,"isMathMLSupported"),fh=/\$\$(.*?)\$\$/g,Js=b(e=>(e.match(fh)?.length??0)>0,"hasKatex"),F4=b(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await jp(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const a={width:r.clientWidth,height:r.clientHeight};return r.remove(),a},"calculateMathMLDimensions"),Z2=b(async(e,t)=>{if(!Js(e))return e;if(!(hf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(fh,"MathML is unsupported in this environment.");{const{default:r}=await Ge(async()=>{const{default:a}=await import("./B9rO5sNH.js");return{default:a}},[],import.meta.url),i=t.forceLegacyMathML||!hf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(cn).map(a=>Js(a)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${a}</div>`:`<div>${a}</div>`).join("").replace(fh,(a,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),jp=b(async(e,t)=>Ti(await Z2(e,t),t),"renderKatexSanitized"),hn={getRows:N2,sanitizeText:Ti,sanitizeTextOrArray:W2,hasBreaks:z2,splitBreaks:H2,lineBreakRegex:cn,removeScript:Yp,getUrl:X2,evaluate:ca,getMax:j2,getMin:G2},K2=b(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Q2=b(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Gp=b(function(e,t,r,i){const a=Q2(t,r,i);K2(e,a)},"configureSvgSize"),J2=b(function(e,t,r,i){const a=t.node().getBBox(),o=a.width,s=a.height;Tt.info(`SVG bounds: ${o}x${s}`,a);let n=0,l=0;Tt.info(`Graph bounds: ${n}x${l}`,e),n=o+r*2,l=s+r*2,Tt.info(`Calculated bounds: ${n}x${l}`),Gp(t,l,n,i);const c=`${a.x-r} ${a.y-r} ${a.width+2*r} ${a.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Gn={};function gh(e){return[...e.cssRules].map(t=>t.cssText).join(`
37
- `)}b(gh,"cssStyleSheetToString");var tw=b((e,t,r,i)=>{let a="";return e in Gn&&Gn[e]?a=Gn[e]({...r,svgId:i}):Tt.warn(`No theme found for ${e}`),`& {
38
- font-family: ${r.fontFamily};
39
- font-size: ${r.fontSize};
40
- fill: ${r.textColor}
41
- }
42
- @keyframes edge-animation-frame {
43
- from {
44
- stroke-dashoffset: 0;
45
- }
46
- }
47
- @keyframes dash {
48
- to {
49
- stroke-dashoffset: 0;
50
- }
51
- }
52
- & .edge-animation-slow {
53
- stroke-dasharray: 9,5 !important;
54
- stroke-dashoffset: 900;
55
- animation: dash 50s linear infinite;
56
- stroke-linecap: round;
57
- }
58
- & .edge-animation-fast {
59
- stroke-dasharray: 9,5 !important;
60
- stroke-dashoffset: 900;
61
- animation: dash 20s linear infinite;
62
- stroke-linecap: round;
63
- }
64
- /* Classes common for multiple diagrams */
65
-
66
- & .error-icon {
67
- fill: ${r.errorBkgColor};
68
- }
69
- & .error-text {
70
- fill: ${r.errorTextColor};
71
- stroke: ${r.errorTextColor};
72
- }
73
-
74
- & .edge-thickness-normal {
75
- stroke-width: ${r.strokeWidth??1}px;
76
- }
77
- & .edge-thickness-thick {
78
- stroke-width: 3.5px
79
- }
80
- & .edge-pattern-solid {
81
- stroke-dasharray: 0;
82
- }
83
- & .edge-thickness-invisible {
84
- stroke-width: 0;
85
- fill: none;
86
- }
87
- & .edge-pattern-dashed{
88
- stroke-dasharray: 3;
89
- }
90
- .edge-pattern-dotted {
91
- stroke-dasharray: 2;
92
- }
93
-
94
- & .marker {
95
- fill: ${r.lineColor};
96
- stroke: ${r.lineColor};
97
- }
98
- & .marker.cross {
99
- stroke: ${r.lineColor};
100
- }
101
-
102
- & svg {
103
- font-family: ${r.fontFamily};
104
- font-size: ${r.fontSize};
105
- }
106
- & p {
107
- margin: 0
108
- }
109
-
110
- ${a}
111
- .node .neo-node {
112
- stroke: ${r.nodeBorder};
113
- }
114
-
115
- [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
116
- stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
117
- filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
118
- }
119
- [data-look="neo"].swimlane.cluster rect {
120
- filter: none;
121
- }
122
-
123
-
124
- [data-look="neo"].node path {
125
- stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
126
- stroke-width: ${r.strokeWidth??1}px;
127
- }
128
-
129
- [data-look="neo"].node .outer-path {
130
- filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
131
- }
132
-
133
- [data-look="neo"].node .neo-line path {
134
- stroke: ${r.nodeBorder};
135
- filter: none;
136
- }
137
-
138
- [data-look="neo"].node circle{
139
- stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
140
- filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
141
- }
142
-
143
- [data-look="neo"].node circle .state-start{
144
- fill: #000000;
145
- }
146
-
147
- [data-look="neo"].icon-shape .icon {
148
- fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
149
- filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
150
- }
151
-
152
- [data-look="neo"].icon-shape .icon-neo path {
153
- stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
154
- filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
155
- }
156
-
157
- ${t}
158
- `},"getStyles"),ew=b((e,t)=>{t!==void 0&&(Gn[e]=t)},"addStylesForDiagram"),rw=tw,Up={};EC(Up,{clear:()=>iw,getAccDescription:()=>nw,getAccTitle:()=>ow,getDiagramTitle:()=>cw,setAccDescription:()=>sw,setAccTitle:()=>aw,setDiagramTitle:()=>lw});var gd="",pd="",md="",yd=b(e=>Ti(e,Tr()),"sanitizeText"),iw=b(()=>{gd="",md="",pd=""},"clear"),aw=b(e=>{gd=yd(e).replace(/^\s+/g,"")},"setAccTitle"),ow=b(()=>gd,"getAccTitle"),sw=b(e=>{md=yd(e).replace(/\n\s+/g,`
159
- `)},"setAccDescription"),nw=b(()=>md,"getAccDescription"),lw=b(e=>{pd=yd(e)},"setDiagramTitle"),cw=b(()=>pd,"getDiagramTitle"),df=Tt,hw=dd,Xe=Tr,$4=qp,E4=Ya,xd=b(e=>Ti(e,Xe()),"sanitizeText"),dw=J2,uw=b(()=>Up,"getCommonDb"),ll={},cl=b((e,t,r)=>{ll[e]&&df.warn(`Diagram with id ${e} already registered. Overwriting.`),ll[e]=t,r&&Ip(e,r),ew(e,t.styles),t.injectUtils?.(df,hw,Xe,xd,dw,uw(),()=>{})},"registerDiagram"),ph=b(e=>{if(e in ll)return ll[e];throw new fw(e)},"getDiagram"),ss,fw=(ss=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},b(ss,"DiagramNotFoundError"),ss),gw=b(e=>{const{handDrawnSeed:t}=Xe();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},"solidStateFill"),pw=b(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),Za=b(e=>{const t=mw([...e.cssCompiledStyles||[],...e.cssStyles||[],...pw(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),mw=b(e=>{const t=new Map;return e.forEach(r=>{const[i,a]=r.split(":");t.set(i.trim(),a?.trim())}),t},"styles2Map"),Vp=b(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Gt=b(e=>{const{stylesArray:t}=Za(e),r=[],i=[],a=[],o=[];return t.forEach(s=>{const n=s[0];Vp(n)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),n.includes("stroke")&&a.push(s.join(":")+" !important"),n==="fill"&&o.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:a,backgroundStyles:o}},"styles2String"),jt=b((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Xe(),{nodeBorder:a,mainBkg:o}=r,{stylesMap:s}=Za(e);return Object.assign({roughness:.7,fill:s.get("fill")||o,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:s.get("stroke")||a,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:yw(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),yw=b(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const a=isNaN(t[0])?0:t[0];return[a,a]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const xw=Object.freeze({left:0,top:0,width:16,height:16}),hl=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Zp=Object.freeze({...xw,...hl}),bw=Object.freeze({...Zp,body:"",hidden:!1}),Cw=Object.freeze({width:null,height:null}),ww=Object.freeze({...Cw,...hl}),kw=(e,t,r,i="")=>{const a=e.split(":");if(e.slice(0,1)==="@"){if(a.length<2||a.length>3)return null;i=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const n=a.pop(),l=a.pop(),c={provider:a.length>0?a[0]:i,prefix:l,name:n};return Lc(c)?c:null}const o=a[0],s=o.split("-");if(s.length>1){const n={provider:i,prefix:s.shift(),name:s.join("-")};return Lc(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:o};return Lc(n,r)?n:null}return null},Lc=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Sw(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function uf(e,t){const r=Sw(e,t);for(const i in bw)i in hl?i in e&&!(i in r)&&(r[i]=hl[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function vw(e,t){const r=e.icons,i=e.aliases||Object.create(null),a=Object.create(null);function o(s){if(r[s])return a[s]=[];if(!(s in a)){a[s]=null;const n=i[s]&&i[s].parent,l=n&&o(n);l&&(a[s]=[n].concat(l))}return a[s]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(o),a}function ff(e,t,r){const i=e.icons,a=e.aliases||Object.create(null);let o={};function s(n){o=uf(i[n]||a[n],o)}return s(t),r.forEach(s),uf(e,o)}function Mw(e,t){if(e.icons[t])return ff(e,t,[]);const r=vw(e,[t])[t];return r?ff(e,t,r):null}const Tw=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Bw=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function gf(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Tw);if(i===null||!i.length)return e;const a=[];let o=i.shift(),s=Bw.test(o);for(;;){if(s){const n=parseFloat(o);isNaN(n)?a.push(o):a.push(Math.ceil(n*t*r)/r)}else a.push(o);if(o=i.shift(),o===void 0)return a.join("");s=!s}}function _w(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const a=e.indexOf(">",i),o=e.indexOf("</"+t);if(a===-1||o===-1)break;const s=e.indexOf(">",o);if(s===-1)break;r+=e.slice(a+1,o).trim(),e=e.slice(0,i).trim()+e.slice(s+1)}return{defs:r,content:e}}function Lw(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Aw(e,t,r){const i=_w(e);return Lw(i.defs,t+i.content+r)}const Fw=e=>e==="unset"||e==="undefined"||e==="none";function $w(e,t){const r={...Zp,...e},i={...ww,...t},a={left:r.left,top:r.top,width:r.width,height:r.height};let o=r.body;[r,i].forEach(g=>{const m=[],y=g.hFlip,x=g.vFlip;let C=g.rotate;y?x?C+=2:(m.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),m.push("scale(-1 1)"),a.top=a.left=0):x&&(m.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),m.push("scale(1 -1)"),a.top=a.left=0);let k;switch(C<0&&(C-=Math.floor(C/4)*4),C=C%4,C){case 1:k=a.height/2+a.top,m.unshift("rotate(90 "+k.toString()+" "+k.toString()+")");break;case 2:m.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:k=a.width/2+a.left,m.unshift("rotate(-90 "+k.toString()+" "+k.toString()+")");break}C%2===1&&(a.left!==a.top&&(k=a.left,a.left=a.top,a.top=k),a.width!==a.height&&(k=a.width,a.width=a.height,a.height=k)),m.length&&(o=Aw(o,'<g transform="'+m.join(" ")+'">',"</g>"))});const s=i.width,n=i.height,l=a.width,c=a.height;let h,d;s===null?(d=n===null?"1em":n==="auto"?c:n,h=gf(d,l/c)):(h=s==="auto"?l:s,d=n===null?gf(h,c/l):n==="auto"?c:n);const u={},f=(g,m)=>{Fw(m)||(u[g]=m.toString())};f("width",h),f("height",d);const p=[a.left,a.top,l,c];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:o}}const Ew=/\sid="(\S+)"/g,pf=new Map;function Pw(e){e=e.replace(/[0-9]+$/,"")||"a";const t=pf.get(e)||0;return pf.set(e,t+1),t?`${e}${t}`:e}function Iw(e){const t=[];let r;for(;r=Ew.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(a=>{const o=Pw(a),s=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function Ow(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var Rw={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},dl=new Map,bd=new Map,Kp=b(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(Tt.debug("Registering icon pack:",t.name),"loader"in t)bd.set(t.name,t.loader);else if("icons"in t)dl.set(t.name,t.icons);else throw Tt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Dw=b(e=>dl.has(e)||bd.has(e),"isIconPackRegistered"),Qp=b(async(e,t)=>{const r=kw(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let a=dl.get(i);if(!a){const s=bd.get(i);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{a={...await s(),prefix:i},dl.set(i,a)}catch(n){throw Tt.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const o=Mw(a,r.name);if(!o)throw new Error(`Icon not found: ${e}`);return o},"getRegisteredIconData"),Jp=b(async e=>{try{return await Qp(e),!0}catch{return!1}},"isIconAvailable"),So=b(async(e,t,r)=>{let i;try{i=await Qp(e,t?.fallbackPrefix)}catch(s){Tt.error(s),i=Rw}const a=$w(i,t),o=Ow(Iw(a.body),{...a.attributes,...r});return Ti(o,Tr())},"getIconSVG"),Sn={},Dr={},mf;function Nw(){return mf||(mf=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.BLANK_URL=Dr.relativeFirstCharacters=Dr.whitespaceEscapeCharsRegex=Dr.urlSchemeRegex=Dr.ctrlCharactersRegex=Dr.htmlCtrlEntityRegex=Dr.htmlEntitiesRegex=Dr.invalidProtocolRegex=void 0,Dr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Dr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Dr.htmlCtrlEntityRegex=/&(newline|tab);/gi,Dr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Dr.urlSchemeRegex=/^.+(:|&colon;)/gim,Dr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Dr.relativeFirstCharacters=[".","/"],Dr.BLANK_URL="about:blank"),Dr}var yf;function qw(){if(yf)return Sn;yf=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.sanitizeUrl=o;var e=Nw();function t(s){return e.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var n=s.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(s){return URL.canParse(s)}function a(s){try{return decodeURIComponent(s)}catch{return s}}function o(s){if(!s)return e.BLANK_URL;var n,l=a(s.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=a(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}return Sn}var Ww=qw(),mh="http://www.w3.org/1999/xhtml",xf={svg:"http://www.w3.org/2000/svg",xhtml:mh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tm(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),xf.hasOwnProperty(t)?{space:xf[t],local:e}:e}function zw(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===mh&&t.documentElement.namespaceURI===mh?t.createElement(e):t.createElementNS(r,e)}}function Hw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function em(e){var t=tm(e);return(t.local?Hw:zw)(t)}function Yw(){}function rm(e){return e==null?Yw:function(){return this.querySelector(e)}}function Xw(e){typeof e!="function"&&(e=rm(e));for(var t=this._groups,r=t.length,i=new Array(r),a=0;a<r;++a)for(var o=t[a],s=o.length,n=i[a]=new Array(s),l,c,h=0;h<s;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Bi(i,this._parents)}function jw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Gw(){return[]}function Uw(e){return e==null?Gw:function(){return this.querySelectorAll(e)}}function Vw(e){return function(){return jw(e.apply(this,arguments))}}function Zw(e){typeof e=="function"?e=Vw(e):e=Uw(e);for(var t=this._groups,r=t.length,i=[],a=[],o=0;o<r;++o)for(var s=t[o],n=s.length,l,c=0;c<n;++c)(l=s[c])&&(i.push(e.call(l,l.__data__,c,s)),a.push(l));return new Bi(i,a)}function Kw(e){return function(){return this.matches(e)}}function im(e){return function(t){return t.matches(e)}}var Qw=Array.prototype.find;function Jw(e){return function(){return Qw.call(this.children,e)}}function tk(){return this.firstElementChild}function ek(e){return this.select(e==null?tk:Jw(typeof e=="function"?e:im(e)))}var rk=Array.prototype.filter;function ik(){return Array.from(this.children)}function ak(e){return function(){return rk.call(this.children,e)}}function ok(e){return this.selectAll(e==null?ik:ak(typeof e=="function"?e:im(e)))}function sk(e){typeof e!="function"&&(e=Kw(e));for(var t=this._groups,r=t.length,i=new Array(r),a=0;a<r;++a)for(var o=t[a],s=o.length,n=i[a]=[],l,c=0;c<s;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Bi(i,this._parents)}function am(e){return new Array(e.length)}function nk(){return new Bi(this._enter||this._groups.map(am),this._parents)}function ul(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ul.prototype={constructor:ul,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function lk(e){return function(){return e}}function ck(e,t,r,i,a,o){for(var s=0,n,l=t.length,c=o.length;s<c;++s)(n=t[s])?(n.__data__=o[s],i[s]=n):r[s]=new ul(e,o[s]);for(;s<l;++s)(n=t[s])&&(a[s]=n)}function hk(e,t,r,i,a,o,s){var n,l,c=new Map,h=t.length,d=o.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=s.call(l,l.__data__,n,t)+"",c.has(f)?a[n]=l:c.set(f,l));for(n=0;n<d;++n)f=s.call(e,o[n],n,o)+"",(l=c.get(f))?(i[n]=l,l.__data__=o[n],c.delete(f)):r[n]=new ul(e,o[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(a[n]=l)}function dk(e){return e.__data__}function uk(e,t){if(!arguments.length)return Array.from(this,dk);var r=t?hk:ck,i=this._parents,a=this._groups;typeof e!="function"&&(e=lk(e));for(var o=a.length,s=new Array(o),n=new Array(o),l=new Array(o),c=0;c<o;++c){var h=i[c],d=a[c],u=d.length,f=fk(e.call(h,h&&h.__data__,c,i)),p=f.length,g=n[c]=new Array(p),m=s[c]=new Array(p),y=l[c]=new Array(u);r(h,d,g,m,y,f,t);for(var x=0,C=0,k,v;x<p;++x)if(k=g[x]){for(x>=C&&(C=x+1);!(v=m[C])&&++C<p;);k._next=v||null}}return s=new Bi(s,i),s._enter=n,s._exit=l,s}function fk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gk(){return new Bi(this._exit||this._groups.map(am),this._parents)}function pk(e,t,r){var i=this.enter(),a=this,o=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),r==null?o.remove():r(o),i&&a?i.merge(a).order():a}function mk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,a=r.length,o=i.length,s=Math.min(a,o),n=new Array(a),l=0;l<s;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||h[p])&&(u[p]=f);for(;l<a;++l)n[l]=r[l];return new Bi(n,this._parents)}function yk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],a=i.length-1,o=i[a],s;--a>=0;)(s=i[a])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function xk(e){e||(e=bk);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o){for(var s=r[o],n=s.length,l=a[o]=new Array(n),c,h=0;h<n;++h)(c=s[h])&&(l[h]=c);l.sort(t)}return new Bi(a,this._parents).order()}function bk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ck(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wk(){return Array.from(this)}function kk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],a=0,o=i.length;a<o;++a){var s=i[a];if(s)return s}return null}function Sk(){let e=0;for(const t of this)++e;return e}function vk(){return!this.node()}function Mk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],o=0,s=a.length,n;o<s;++o)(n=a[o])&&e.call(n,n.__data__,o,a);return this}function Tk(e){return function(){this.removeAttribute(e)}}function Bk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _k(e,t){return function(){this.setAttribute(e,t)}}function Lk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ak(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Fk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function $k(e,t){var r=tm(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?Bk:Tk:typeof t=="function"?r.local?Fk:Ak:r.local?Lk:_k)(r,t))}function om(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ek(e){return function(){this.style.removeProperty(e)}}function Pk(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Ik(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Ok(e,t,r){return arguments.length>1?this.each((t==null?Ek:typeof t=="function"?Ik:Pk)(e,t,r??"")):Rk(this.node(),e)}function Rk(e,t){return e.style.getPropertyValue(t)||om(e).getComputedStyle(e,null).getPropertyValue(t)}function Dk(e){return function(){delete this[e]}}function Nk(e,t){return function(){this[e]=t}}function qk(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Wk(e,t){return arguments.length>1?this.each((t==null?Dk:typeof t=="function"?qk:Nk)(e,t)):this.node()[e]}function sm(e){return e.trim().split(/^|\s+/)}function Cd(e){return e.classList||new nm(e)}function nm(e){this._node=e,this._names=sm(e.getAttribute("class")||"")}nm.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function lm(e,t){for(var r=Cd(e),i=-1,a=t.length;++i<a;)r.add(t[i])}function cm(e,t){for(var r=Cd(e),i=-1,a=t.length;++i<a;)r.remove(t[i])}function zk(e){return function(){lm(this,e)}}function Hk(e){return function(){cm(this,e)}}function Yk(e,t){return function(){(t.apply(this,arguments)?lm:cm)(this,e)}}function Xk(e,t){var r=sm(e+"");if(arguments.length<2){for(var i=Cd(this.node()),a=-1,o=r.length;++a<o;)if(!i.contains(r[a]))return!1;return!0}return this.each((typeof t=="function"?Yk:t?zk:Hk)(r,t))}function jk(){this.textContent=""}function Gk(e){return function(){this.textContent=e}}function Uk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Vk(e){return arguments.length?this.each(e==null?jk:(typeof e=="function"?Uk:Gk)(e)):this.node().textContent}function Zk(){this.innerHTML=""}function Kk(e){return function(){this.innerHTML=e}}function Qk(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Jk(e){return arguments.length?this.each(e==null?Zk:(typeof e=="function"?Qk:Kk)(e)):this.node().innerHTML}function tS(){this.nextSibling&&this.parentNode.appendChild(this)}function eS(){return this.each(tS)}function rS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function iS(){return this.each(rS)}function aS(e){var t=typeof e=="function"?e:em(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function oS(){return null}function sS(e,t){var r=typeof e=="function"?e:em(e),i=t==null?oS:typeof t=="function"?t:rm(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function nS(){var e=this.parentNode;e&&e.removeChild(this)}function lS(){return this.each(nS)}function cS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dS(e){return this.select(e?hS:cS)}function uS(e){return arguments.length?this.property("__data__",e):this.node().__data__}function fS(e){return function(t){e.call(this,t,this.__data__)}}function gS(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function pS(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,a=t.length,o;r<a;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++i]=o;++i?t.length=i:delete this.__on}}}function mS(e,t,r){return function(){var i=this.__on,a,o=fS(t);if(i){for(var s=0,n=i.length;s<n;++s)if((a=i[s]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=o,a.options=r),a.value=t;return}}this.addEventListener(e.type,o,r),a={type:e.type,name:e.name,value:t,listener:o,options:r},i?i.push(a):this.__on=[a]}}function yS(e,t,r){var i=gS(e+""),a,o=i.length,s;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(a=0,h=n[l];a<o;++a)if((s=i[a]).type===h.type&&s.name===h.name)return h.value}return}for(n=t?mS:pS,a=0;a<o;++a)this.each(n(i[a],t,r));return this}function hm(e,t,r){var i=om(e),a=i.CustomEvent;typeof a=="function"?a=new a(t,r):(a=i.document.createEvent("Event"),r?(a.initEvent(t,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function xS(e,t){return function(){return hm(this,e,t)}}function bS(e,t){return function(){return hm(this,e,t.apply(this,arguments))}}function CS(e,t){return this.each((typeof t=="function"?bS:xS)(e,t))}function*wS(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],a=0,o=i.length,s;a<o;++a)(s=i[a])&&(yield s)}var kS=[null];function Bi(e,t){this._groups=e,this._parents=t}function SS(){return this}Bi.prototype={constructor:Bi,select:Xw,selectAll:Zw,selectChild:ek,selectChildren:ok,filter:sk,data:uk,enter:nk,exit:gk,join:pk,merge:mk,selection:SS,order:yk,sort:xk,call:Ck,nodes:wk,node:kk,size:Sk,empty:vk,each:Mk,attr:$k,style:Ok,property:Wk,classed:Xk,text:Vk,html:Jk,raise:eS,lower:iS,append:aS,insert:sS,remove:lS,clone:dS,datum:uS,on:yS,dispatch:CS,[Symbol.iterator]:wS};function He(e){return typeof e=="string"?new Bi([[document.querySelector(e)]],[document.documentElement]):new Bi([[e]],kS)}var vS=0;function bf(){this._="@"+(++vS).toString(36)}bf.prototype={constructor:bf,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function bs(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function dn(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Ka(){}var xo=.7,hs=1/xo,Xo="\\s*([+-]?\\d+)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ia="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MS=/^#([0-9a-f]{3,8})$/,TS=new RegExp(`^rgb\\(${Xo},${Xo},${Xo}\\)$`),BS=new RegExp(`^rgb\\(${ia},${ia},${ia}\\)$`),_S=new RegExp(`^rgba\\(${Xo},${Xo},${Xo},${tn}\\)$`),LS=new RegExp(`^rgba\\(${ia},${ia},${ia},${tn}\\)$`),AS=new RegExp(`^hsl\\(${tn},${ia},${ia}\\)$`),FS=new RegExp(`^hsla\\(${tn},${ia},${ia},${tn}\\)$`),Cf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};bs(Ka,Rl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wf,formatHex:wf,formatHex8:$S,formatHsl:ES,formatRgb:kf,toString:kf});function wf(){return this.rgb().formatHex()}function $S(){return this.rgb().formatHex8()}function ES(){return dm(this).formatHsl()}function kf(){return this.rgb().formatRgb()}function Rl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=MS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Sf(t):r===3?new Wr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=TS.exec(e))?new Wr(t[1],t[2],t[3],1):(t=BS.exec(e))?new Wr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_S.exec(e))?vn(t[1],t[2],t[3],t[4]):(t=LS.exec(e))?vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=AS.exec(e))?Tf(t[1],t[2]/100,t[3]/100,1):(t=FS.exec(e))?Tf(t[1],t[2]/100,t[3]/100,t[4]):Cf.hasOwnProperty(e)?Sf(Cf[e]):e==="transparent"?new Wr(NaN,NaN,NaN,0):null}function Sf(e){return new Wr(e>>16&255,e>>8&255,e&255,1)}function vn(e,t,r,i){return i<=0&&(e=t=r=NaN),new Wr(e,t,r,i)}function wd(e){return e instanceof Ka||(e=Rl(e)),e?(e=e.rgb(),new Wr(e.r,e.g,e.b,e.opacity)):new Wr}function Qi(e,t,r,i){return arguments.length===1?wd(e):new Wr(e,t,r,i??1)}function Wr(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}bs(Wr,Qi,dn(Ka,{brighter(e){return e=e==null?hs:Math.pow(hs,e),new Wr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xo:Math.pow(xo,e),new Wr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wr(ho(this.r),ho(this.g),ho(this.b),fl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vf,formatHex:vf,formatHex8:PS,formatRgb:Mf,toString:Mf}));function vf(){return`#${co(this.r)}${co(this.g)}${co(this.b)}`}function PS(){return`#${co(this.r)}${co(this.g)}${co(this.b)}${co((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mf(){const e=fl(this.opacity);return`${e===1?"rgb(":"rgba("}${ho(this.r)}, ${ho(this.g)}, ${ho(this.b)}${e===1?")":`, ${e})`}`}function fl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ho(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function co(e){return e=ho(e),(e<16?"0":"")+e.toString(16)}function Tf(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ri(e,t,r,i)}function dm(e){if(e instanceof Ri)return new Ri(e.h,e.s,e.l,e.opacity);if(e instanceof Ka||(e=Rl(e)),!e)return new Ri;if(e instanceof Ri)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,a=Math.min(t,r,i),o=Math.max(t,r,i),s=NaN,n=o-a,l=(o+a)/2;return n?(t===o?s=(r-i)/n+(r<i)*6:r===o?s=(i-t)/n+2:s=(t-r)/n+4,n/=l<.5?o+a:2-o-a,s*=60):n=l>0&&l<1?0:s,new Ri(s,n,l,e.opacity)}function IS(e,t,r,i){return arguments.length===1?dm(e):new Ri(e,t,r,i??1)}function Ri(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}bs(Ri,IS,dn(Ka,{brighter(e){return e=e==null?hs:Math.pow(hs,e),new Ri(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xo:Math.pow(xo,e),new Ri(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,a=2*r-i;return new Wr(Ac(e>=240?e-240:e+120,a,i),Ac(e,a,i),Ac(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Ri(Bf(this.h),Mn(this.s),Mn(this.l),fl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=fl(this.opacity);return`${e===1?"hsl(":"hsla("}${Bf(this.h)}, ${Mn(this.s)*100}%, ${Mn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bf(e){return e=(e||0)%360,e<0?e+360:e}function Mn(e){return Math.max(0,Math.min(1,e||0))}function Ac(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const um=Math.PI/180,fm=180/Math.PI,gl=18,gm=.96422,pm=1,mm=.82521,ym=4/29,jo=6/29,xm=3*jo*jo,OS=jo*jo*jo;function bm(e){if(e instanceof aa)return new aa(e.l,e.a,e.b,e.opacity);if(e instanceof Ca)return Cm(e);e instanceof Wr||(e=wd(e));var t=Pc(e.r),r=Pc(e.g),i=Pc(e.b),a=Fc((.2225045*t+.7168786*r+.0606169*i)/pm),o,s;return t===r&&r===i?o=s=a:(o=Fc((.4360747*t+.3850649*r+.1430804*i)/gm),s=Fc((.0139322*t+.0971045*r+.7141733*i)/mm)),new aa(116*a-16,500*(o-a),200*(a-s),e.opacity)}function RS(e,t,r,i){return arguments.length===1?bm(e):new aa(e,t,r,i??1)}function aa(e,t,r,i){this.l=+e,this.a=+t,this.b=+r,this.opacity=+i}bs(aa,RS,dn(Ka,{brighter(e){return new aa(this.l+gl*(e??1),this.a,this.b,this.opacity)},darker(e){return new aa(this.l-gl*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=gm*$c(t),e=pm*$c(e),r=mm*$c(r),new Wr(Ec(3.1338561*t-1.6168667*e-.4906146*r),Ec(-.9787684*t+1.9161415*e+.033454*r),Ec(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Fc(e){return e>OS?Math.pow(e,1/3):e/xm+ym}function $c(e){return e>jo?e*e*e:xm*(e-ym)}function Ec(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function DS(e){if(e instanceof Ca)return new Ca(e.h,e.c,e.l,e.opacity);if(e instanceof aa||(e=bm(e)),e.a===0&&e.b===0)return new Ca(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*fm;return new Ca(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function NS(e,t,r,i){return arguments.length===1?DS(e):new Ca(e,t,r,i??1)}function Ca(e,t,r,i){this.h=+e,this.c=+t,this.l=+r,this.opacity=+i}function Cm(e){if(isNaN(e.h))return new aa(e.l,0,0,e.opacity);var t=e.h*um;return new aa(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}bs(Ca,NS,dn(Ka,{brighter(e){return new Ca(this.h,this.c,this.l+gl*(e??1),this.opacity)},darker(e){return new Ca(this.h,this.c,this.l-gl*(e??1),this.opacity)},rgb(){return Cm(this).rgb()}}));var wm=-.14861,kd=1.78277,Sd=-.29227,Dl=-.90649,en=1.97294,_f=en*Dl,Lf=en*kd,Af=kd*Sd-Dl*wm;function qS(e){if(e instanceof uo)return new uo(e.h,e.s,e.l,e.opacity);e instanceof Wr||(e=wd(e));var t=e.r/255,r=e.g/255,i=e.b/255,a=(Af*i+_f*t-Lf*r)/(Af+_f-Lf),o=i-a,s=(en*(r-a)-Sd*o)/Dl,n=Math.sqrt(s*s+o*o)/(en*a*(1-a)),l=n?Math.atan2(s,o)*fm-120:NaN;return new uo(l<0?l+360:l,n,a,e.opacity)}function WS(e,t,r,i){return arguments.length===1?qS(e):new uo(e,t,r,i??1)}function uo(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}bs(uo,WS,dn(Ka,{brighter(e){return e=e==null?hs:Math.pow(hs,e),new uo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xo:Math.pow(xo,e),new uo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*um,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),a=Math.sin(e);return new Wr(255*(t+r*(wm*i+kd*a)),255*(t+r*(Sd*i+Dl*a)),255*(t+r*(en*i)),this.opacity)}}));const Os=Math.PI,yh=2*Os,ao=1e-6,zS=yh-ao;function km(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function HS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return km;const r=10**t;return function(i){this._+=i[0];for(let a=1,o=i.length;a<o;++a)this._+=Math.round(arguments[a]*r)/r+i[a]}}function Sm(e,t,r,i){return e===r&&t===i}function YS(e){const t=Math.floor(e);if(!(t<=15))return Sm;const r=10**t,i=function(a){return Math.round(a*r)};return function(a,o,s,n){return i(a)===i(s)&&i(o)===i(n)}}class XS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?km:HS(t),this._equal=t==null?Sm:YS(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,a){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+a}`}bezierCurveTo(t,r,i,a,o,s){this._append`C${+t},${+r},${+i},${+a},${this._x1=+o},${this._y1=+s}`}arcTo(t,r,i,a,o){if(t=+t,r=+r,i=+i,a=+a,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,n=this._y1,l=i-t,c=a-r,h=s-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>ao)if(!(Math.abs(d*l-c*h)>ao)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-s,p=a-n,g=l*l+c*c,m=f*f+p*p,y=Math.sqrt(g),x=Math.sqrt(u),C=o*Math.tan((Os-Math.acos((g+u-m)/(2*y*x)))/2),k=C/x,v=C/y;Math.abs(k-1)>ao&&this._append`L${t+k*h},${r+k*d}`,this._append`A${o},${o},0,0,${+(d*f>h*p)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,a,o,s){if(t=+t,r=+r,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(a),l=i*Math.sin(a),c=t+n,h=r+l,d=1^s,u=s?a-o:o-a;if(this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>ao||Math.abs(this._y1-h)>ao)&&this._append`L${c},${h}`,!!i){if(u<0&&(u=u%yh+yh),u>zS)this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`;else if(u>ao){const f=t+i*Math.cos(o),p=r+i*Math.sin(o);if(u>=Os&&this._equal(c,h,f,p)){u/=2;let g=a+u;this._append`A${i},${i},0,${+(u>=Os)},${d},${t+i*Math.cos(g)},${r+i*Math.sin(g)}`}this._append`A${i},${i},0,${+(u>=Os)},${d},${this._x1=f},${this._y1=p}`}}}rect(t,r,i,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+a}h${-i}Z`}toString(){return this._}}function Fr(e){return function(){return e}}const Ff=Math.abs,Gr=Math.atan2,Ja=Math.cos,jS=Math.max,Ic=Math.min,ji=Math.sin,No=Math.sqrt,Vr=1e-12,rn=Math.PI,pl=rn/2,Un=2*rn;function GS(e){return e>1?0:e<-1?rn:Math.acos(e)}function $f(e){return e>=1?pl:e<=-1?-pl:Math.asin(e)}function vm(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new XS(t)}function US(e){return e.innerRadius}function VS(e){return e.outerRadius}function ZS(e){return e.startAngle}function KS(e){return e.endAngle}function QS(e){return e&&e.padAngle}function JS(e,t,r,i,a,o,s,n){var l=r-e,c=i-t,h=s-a,d=n-o,u=d*l-h*c;if(!(u*u<Vr))return u=(h*(t-o)-d*(e-a))/u,[e+u*l,t+u*c]}function Tn(e,t,r,i,a,o,s){var n=e-r,l=t-i,c=(s?o:-o)/No(n*n+l*l),h=c*l,d=-c*n,u=e+h,f=t+d,p=r+h,g=i+d,m=(u+p)/2,y=(f+g)/2,x=p-u,C=g-f,k=x*x+C*C,v=a-o,T=u*g-p*f,F=(C<0?-1:1)*No(jS(0,v*v*k-T*T)),A=(T*C-x*F)/k,M=(-T*x-C*F)/k,B=(T*C+x*F)/k,$=(-T*x+C*F)/k,P=A-m,I=M-y,_=B-m,E=$-y;return P*P+I*I>_*_+E*E&&(A=B,M=$),{cx:A,cy:M,x01:-h,y01:-d,x11:A*(a/v-1),y11:M*(a/v-1)}}function P4(){var e=US,t=VS,r=Fr(0),i=null,a=ZS,o=KS,s=QS,n=null,l=vm(c);function c(){var h,d,u=+e.apply(this,arguments),f=+t.apply(this,arguments),p=a.apply(this,arguments)-pl,g=o.apply(this,arguments)-pl,m=Ff(g-p),y=g>p;if(n||(n=h=l()),f<u&&(d=f,f=u,u=d),!(f>Vr))n.moveTo(0,0);else if(m>Un-Vr)n.moveTo(f*Ja(p),f*ji(p)),n.arc(0,0,f,p,g,!y),u>Vr&&(n.moveTo(u*Ja(g),u*ji(g)),n.arc(0,0,u,g,p,y));else{var x=p,C=g,k=p,v=g,T=m,F=m,A=s.apply(this,arguments)/2,M=A>Vr&&(i?+i.apply(this,arguments):No(u*u+f*f)),B=Ic(Ff(f-u)/2,+r.apply(this,arguments)),$=B,P=B,I,_;if(M>Vr){var E=$f(M/u*ji(A)),L=$f(M/f*ji(A));(T-=E*2)>Vr?(E*=y?1:-1,k+=E,v-=E):(T=0,k=v=(p+g)/2),(F-=L*2)>Vr?(L*=y?1:-1,x+=L,C-=L):(F=0,x=C=(p+g)/2)}var q=f*Ja(x),W=f*ji(x),R=u*Ja(v),D=u*ji(v);if(B>Vr){var G=f*Ja(C),j=f*ji(C),z=u*Ja(k),Q=u*ji(k),et;if(m<rn)if(et=JS(q,W,z,Q,G,j,R,D)){var rt=q-et[0],J=W-et[1],at=G-et[0],xt=j-et[1],H=1/ji(GS((rt*at+J*xt)/(No(rt*rt+J*J)*No(at*at+xt*xt)))/2),Y=No(et[0]*et[0]+et[1]*et[1]);$=Ic(B,(u-Y)/(H-1)),P=Ic(B,(f-Y)/(H+1))}else $=P=0}F>Vr?P>Vr?(I=Tn(z,Q,q,W,f,P,y),_=Tn(G,j,R,D,f,P,y),n.moveTo(I.cx+I.x01,I.cy+I.y01),P<B?n.arc(I.cx,I.cy,P,Gr(I.y01,I.x01),Gr(_.y01,_.x01),!y):(n.arc(I.cx,I.cy,P,Gr(I.y01,I.x01),Gr(I.y11,I.x11),!y),n.arc(0,0,f,Gr(I.cy+I.y11,I.cx+I.x11),Gr(_.cy+_.y11,_.cx+_.x11),!y),n.arc(_.cx,_.cy,P,Gr(_.y11,_.x11),Gr(_.y01,_.x01),!y))):(n.moveTo(q,W),n.arc(0,0,f,x,C,!y)):n.moveTo(q,W),!(u>Vr)||!(T>Vr)?n.lineTo(R,D):$>Vr?(I=Tn(R,D,G,j,u,-$,y),_=Tn(q,W,z,Q,u,-$,y),n.lineTo(I.cx+I.x01,I.cy+I.y01),$<B?n.arc(I.cx,I.cy,$,Gr(I.y01,I.x01),Gr(_.y01,_.x01),!y):(n.arc(I.cx,I.cy,$,Gr(I.y01,I.x01),Gr(I.y11,I.x11),!y),n.arc(0,0,u,Gr(I.cy+I.y11,I.cx+I.x11),Gr(_.cy+_.y11,_.cx+_.x11),y),n.arc(_.cx,_.cy,$,Gr(_.y11,_.x11),Gr(_.y01,_.x01),!y))):n.arc(0,0,u,v,k,y)}if(n.closePath(),h)return n=null,h+""||null}return c.centroid=function(){var h=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-rn/2;return[Ja(d)*h,ji(d)*h]},c.innerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Fr(+h),c):e},c.outerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Fr(+h),c):t},c.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:Fr(+h),c):r},c.padRadius=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:Fr(+h),c):i},c.startAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Fr(+h),c):a},c.endAngle=function(h){return arguments.length?(o=typeof h=="function"?h:Fr(+h),c):o},c.padAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Fr(+h),c):s},c.context=function(h){return arguments.length?(n=h??null,c):n},c}function Mm(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Tm(e){this._context=e}Tm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Vs(e){return new Tm(e)}function tv(e){return e[0]}function ev(e){return e[1]}function rv(e,t){var r=Fr(!0),i=null,a=Vs,o=null,s=vm(n);e=typeof e=="function"?e:e===void 0?tv:Fr(e),t=typeof t=="function"?t:t===void 0?ev:Fr(t);function n(l){var c,h=(l=Mm(l)).length,d,u=!1,f;for(i==null&&(o=a(f=s())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(d,c,l),+t(d,c,l));if(f)return o=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:Fr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:Fr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Fr(!!l),n):r},n.curve=function(l){return arguments.length?(a=l,i!=null&&(o=a(i)),n):a},n.context=function(l){return arguments.length?(l==null?i=o=null:o=a(i=l),n):i},n}function iv(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function av(e){return e}function I4(){var e=av,t=iv,r=null,i=Fr(0),a=Fr(Un),o=Fr(0);function s(n){var l,c=(n=Mm(n)).length,h,d,u=0,f=new Array(c),p=new Array(c),g=+i.apply(this,arguments),m=Math.min(Un,Math.max(-Un,a.apply(this,arguments)-g)),y,x=Math.min(Math.abs(m)/c,o.apply(this,arguments)),C=x*(m<0?-1:1),k;for(l=0;l<c;++l)(k=p[f[l]=l]=+e(n[l],l,n))>0&&(u+=k);for(t!=null?f.sort(function(v,T){return t(p[v],p[T])}):r!=null&&f.sort(function(v,T){return r(n[v],n[T])}),l=0,d=u?(m-c*C)/u:0;l<c;++l,g=y)h=f[l],k=p[h],y=g+(k>0?k*d:0)+C,p[h]={data:n[h],index:l,value:k,startAngle:g,endAngle:y,padAngle:x};return p}return s.value=function(n){return arguments.length?(e=typeof n=="function"?n:Fr(+n),s):e},s.sortValues=function(n){return arguments.length?(t=n,r=null,s):t},s.sort=function(n){return arguments.length?(r=n,t=null,s):r},s.startAngle=function(n){return arguments.length?(i=typeof n=="function"?n:Fr(+n),s):i},s.endAngle=function(n){return arguments.length?(a=typeof n=="function"?n:Fr(+n),s):a},s.padAngle=function(n){return arguments.length?(o=typeof n=="function"?n:Fr(+n),s):o},s}class Bm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function _m(e){return new Bm(e,!0)}function Lm(e){return new Bm(e,!1)}function Xa(){}function ml(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Nl(e){this._context=e}Nl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ml(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ml(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xh(e){return new Nl(e)}function Am(e){this._context=e}Am.prototype={areaStart:Xa,areaEnd:Xa,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ml(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ov(e){return new Am(e)}function Fm(e){this._context=e}Fm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:ml(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sv(e){return new Fm(e)}function $m(e,t){this._basis=new Nl(e),this._beta=t}$m.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],a=t[0],o=e[r]-i,s=t[r]-a,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*o),this._beta*t[n]+(1-this._beta)*(a+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var nv=(function e(t){function r(i){return t===1?new Nl(i):new $m(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function yl(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function vd(e,t){this._context=e,this._k=(1-t)/6}vd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:yl(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:yl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Em=(function e(t){function r(i){return new vd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Md(e,t){this._context=e,this._k=(1-t)/6}Md.prototype={areaStart:Xa,areaEnd:Xa,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:yl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var lv=(function e(t){function r(i){return new Md(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Td(e,t){this._context=e,this._k=(1-t)/6}Td.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:yl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var cv=(function e(t){function r(i){return new Td(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Bd(e,t,r){var i=e._x1,a=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Vr){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,a=(a*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Vr){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/h,s=(s*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,a,o,s,e._x2,e._y2)}function Pm(e,t){this._context=e,this._alpha=t}Pm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Bd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Im=(function e(t){function r(i){return t?new Pm(i,t):new vd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Om(e,t){this._context=e,this._alpha=t}Om.prototype={areaStart:Xa,areaEnd:Xa,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Bd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var hv=(function e(t){function r(i){return t?new Om(i,t):new Md(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Rm(e,t){this._context=e,this._alpha=t}Rm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var dv=(function e(t){function r(i){return t?new Rm(i,t):new Td(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Dm(e){this._context=e}Dm.prototype={areaStart:Xa,areaEnd:Xa,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function uv(e){return new Dm(e)}function Ef(e){return e<0?-1:1}function Pf(e,t,r){var i=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(i||a<0&&-0),s=(r-e._y1)/(a||i<0&&-0),n=(o*a+s*i)/(i+a);return(Ef(o)+Ef(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(n))||0}function If(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Oc(e,t,r){var i=e._x0,a=e._y0,o=e._x1,s=e._y1,n=(o-i)/3;e._context.bezierCurveTo(i+n,a+n*t,o-n,s-n*r,o,s)}function xl(e){this._context=e}xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Oc(this,this._t0,If(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Oc(this,If(this,r=Pf(this,e,t)),r);break;default:Oc(this,this._t0,r=Pf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Nm(e){this._context=new qm(e)}(Nm.prototype=Object.create(xl.prototype)).point=function(e,t){xl.prototype.point.call(this,t,e)};function qm(e){this._context=e}qm.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,a,o){this._context.bezierCurveTo(t,e,i,r,o,a)}};function Wm(e){return new xl(e)}function zm(e){return new Nm(e)}function Hm(e){this._context=e}Hm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Of(e),a=Of(t),o=0,s=1;s<r;++o,++s)this._context.bezierCurveTo(i[0][o],a[0][o],i[1][o],a[1][o],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Of(e){var t,r=e.length-1,i,a=new Array(r),o=new Array(r),s=new Array(r);for(a[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=a[t]/o[t-1],o[t]-=i,s[t]-=i*s[t-1];for(a[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)a[t]=(s[t]-a[t+1])/o[t];for(o[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-a[t+1];return[a,o]}function Ym(e){return new Hm(e)}function ql(e,t){this._context=e,this._t=t}ql.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Xm(e){return new ql(e,.5)}function jm(e){return new ql(e,0)}function Gm(e){return new ql(e,1)}function Rc(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function fv(){}function Um(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function _d(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const gv="[object RegExp]",Vm="[object String]",Zm="[object Number]",Km="[object Boolean]",Qm="[object Arguments]",pv="[object Symbol]",mv="[object Date]",yv="[object Map]",xv="[object Set]",bv="[object Array]",Cv="[object ArrayBuffer]",wv="[object Object]",kv="[object DataView]",Sv="[object Uint8Array]",vv="[object Uint8ClampedArray]",Mv="[object Uint16Array]",Tv="[object Uint32Array]",Bv="[object Int8Array]",_v="[object Int16Array]",Lv="[object Int32Array]",Av="[object Float32Array]",Fv="[object Float64Array]",Rf=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Ld(e){return typeof Rf.Buffer<"u"&&Rf.Buffer.isBuffer(e)}function $v(e){return Number.isSafeInteger(e)&&e>=0}function Jm(e){return e!=null&&typeof e!="function"&&$v(e.length)}function Ev(e){return e==="__proto__"}function Ad(e){return e==null||typeof e!="object"&&typeof e!="function"}function Fd(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pv(e,t){return qo(e,void 0,e,new Map,t)}function qo(e,t,r,i=new Map,a=void 0){const o=a?.(e,t,r,i);if(o!==void 0)return o;if(Ad(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const s=new Array(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=qo(e[n],n,r,i,a);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;i.set(e,s);for(const[n,l]of e)s.set(n,qo(l,n,r,i,a));return s}if(e instanceof Set){const s=new Set;i.set(e,s);for(const n of e)s.add(qo(n,void 0,r,i,a));return s}if(Ld(e))return e.subarray();if(Fd(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=qo(e[n],n,r,i,a);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,s),Ei(s,e,r,i,a),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return i.set(e,s),Ei(s,e,r,i,a),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return i.set(e,s),Ei(s,e,r,i,a),s}if(e instanceof Error){const s=structuredClone(e);return i.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Ei(s,e,r,i,a),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return i.set(e,s),Ei(s,e,r,i,a),s}if(e instanceof Number){const s=new Number(e.valueOf());return i.set(e,s),Ei(s,e,r,i,a),s}if(e instanceof String){const s=new String(e.valueOf());return i.set(e,s),Ei(s,e,r,i,a),s}if(typeof e=="object"&&Iv(e)){const s=Object.create(Object.getPrototypeOf(e));return i.set(e,s),Ei(s,e,r,i,a),s}return e}function Ei(e,t,r=e,i,a){const o=[...Object.keys(t),...Um(t)];for(let s=0;s<o.length;s++){const n=o[s],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=qo(t[n],n,r,i,a))}}function Iv(e){switch(_d(e)){case Qm:case bv:case Cv:case kv:case Km:case mv:case Av:case Fv:case Bv:case _v:case Lv:case yv:case Zm:case wv:case gv:case xv:case Vm:case pv:case Sv:case vv:case Mv:case Tv:return!0;default:return!1}}function Ov(e,t){return Pv(e,(r,i,a,o)=>{if(typeof e=="object"){if(_d(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return o.set(e,s),Ei(s,e,a,o),s}switch(Object.prototype.toString.call(e)){case Zm:case Vm:case Km:{const s=new e.constructor(e?.valueOf());return Ei(s,e),s}case Qm:{const s={};return Ei(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function Df(e){return Ov(e)}function bh(e){return e!==null&&typeof e=="object"&&_d(e)==="[object Arguments]"}function Ch(e){return typeof e=="object"&&e!==null}function Rv(e){return Ch(e)&&Jm(e)}function Vn(e){return Fd(e)}function Dv(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function un(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const a=t?t.apply(this,i):i[0],o=r.cache;if(o.has(a))return o.get(a);const s=e.apply(this,i);return r.cache=o.set(a,s)||o,s};return r.cache=new(un.Cache||Map),r}un.Cache=Map;function Nv(e){if(Ad(e))return e;if(Array.isArray(e)||Fd(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function qv(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let a=e;for(let o=0;o<r.length;o++){const s=r[o];a=Zn(a,s,i,new Map)}return a}function Zn(e,t,r,i){if(Ad(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return Nv(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let o=0;o<t.length;o++)o in t||(t[o]=void 0)}const a=[...Object.keys(t),...Um(t)];for(let o=0;o<a.length;o++){const s=a[o];if(Ev(s))continue;let n=t[s],l=e[s];if(bh(n)&&(n={...n}),bh(l)&&(l={...l}),Ld(n)&&(n=Df(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(Rv(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,s,e,t,i);c!==void 0?e[s]=c:Array.isArray(n)||Ch(l)&&Ch(n)&&(Rc(l)||Rc(n)||Vn(l)||Vn(n))?e[s]=Zn(l,n,r,i):l==null&&Rc(n)?e[s]=Zn({},n,r,i):l==null&&Vn(n)?e[s]=Df(n):(l===void 0||n!==void 0)&&(e[s]=n)}return e}function Wv(e,...t){return qv(e,...t,fv)}function Nf(e){if(e==null)return!0;if(Jm(e))return typeof e.splice!="function"&&typeof e!="string"&&!Ld(e)&&!Vn(e)&&!bh(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return Dv(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var zv="​",Hv={curveBasis:xh,curveBasisClosed:ov,curveBasisOpen:sv,curveBumpX:_m,curveBumpY:Lm,curveBundle:nv,curveCardinalClosed:lv,curveCardinalOpen:cv,curveCardinal:Em,curveCatmullRomClosed:hv,curveCatmullRomOpen:dv,curveCatmullRom:Im,curveLinear:Vs,curveLinearClosed:uv,curveMonotoneX:Wm,curveMonotoneY:zm,curveNatural:Ym,curveStep:Xm,curveStepAfter:Gm,curveStepBefore:jm},Yv=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Xv=b(function(e,t){const r=ty(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const s=r.map(n=>n.args);al(s),i=Ir(i,[...s])}else i=r.args;if(!i)return;let a=Ol(e,t);const o="config";return i[o]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),i[a]=i[o],delete i[o]),i},"detectInit"),ty=b(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${Yv.source})(?=[}][%]{2}).*
160
- `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),Tt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const a=[];for(;(i=js.exec(e))!==null;)if(i.index===js.lastIndex&&js.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const o=i[1]?i[1]:i[2],s=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;a.push({type:o,args:s})}return a.length===0?{type:e,args:null}:a.length===1?a[0]:a}catch(r){return Tt.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),jv=b(function(e){return e.replace(js,"")},"removeDirectives"),Gv=b(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function $d(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return Hv[r]??t}b($d,"interpolateToCurve");function ey(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Ww.sanitizeUrl(r):r}b(ey,"formatUrl");var Uv=b((e,...t)=>{const r=e.split("."),i=r.length-1,a=r[i];let o=window;for(let s=0;s<i;s++)if(o=o[r[s]],!o){Tt.error(`Function name: ${e} not found in window`);return}o[a](...t)},"runFunc");function Ed(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}b(Ed,"distance");function ry(e){let t,r=0;e.forEach(a=>{r+=Ed(a,t),t=a});const i=r/2;return Pd(e,i)}b(ry,"traverseEdge");function iy(e){return e.length===1?e[0]:ry(e)}b(iy,"calcLabelPosition");var qf=b((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Pd=b((e,t)=>{let r,i=t;for(const a of e){if(r){const o=Ed(a,r);if(o===0)return r;if(o<i)i-=o;else{const s=i/o;if(s<=0)return r;if(s>=1)return{x:a.x,y:a.y};if(s>0&&s<1)return{x:qf((1-s)*r.x+s*a.x,5),y:qf((1-s)*r.y+s*a.y,5)}}}r=a}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Vv=b((e,t,r)=>{Tt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const a=Pd(t,25),o=e?10:5,s=Math.atan2(t[0].y-a.y,t[0].x-a.x),n={x:0,y:0};return n.x=Math.sin(s)*o+(t[0].x+a.x)/2,n.y=-Math.cos(s)*o+(t[0].y+a.y)/2,n},"calcCardinalityPosition");function ay(e,t,r){const i=structuredClone(r);Tt.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const a=25+e,o=Pd(i,a),s=10+e*.5,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*s+(i[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n-Math.PI)*s+(i[0].y+o.y)/2):(l.x=Math.sin(n)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n)*s+(i[0].y+o.y)/2),l}b(ay,"calcTerminalLabelPosition");function oy(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}b(oy,"getStylesFromArray");var Wf=0,Zv=b(()=>(Wf++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Wf),"generateId");function sy(e){let t="";const r="0123456789abcdef",i=r.length;for(let a=0;a<e;a++)t+=r.charAt(Math.floor(Math.random()*i));return t}b(sy,"makeRandomHex");var Kv=b(e=>sy(e.length),"random"),Qv=b(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Jv=b(function(e,t){const r=t.text.replace(hn.lineBreakRegex," "),[,i]=Wl(t.fontSize),a=e.append("text");a.attr("x",t.x),a.attr("y",t.y),a.style("text-anchor",t.anchor),a.style("font-family",t.fontFamily),a.style("font-size",i),a.style("font-weight",t.fontWeight),a.attr("fill",t.fill),t.class!==void 0&&a.attr("class",t.class);const o=a.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),a},"drawSimpleText"),tM=un((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),hn.hasBreaks(e)))return e;const i=e.split(" ").filter(Boolean),a=[];let o="";return i.forEach((s,n)=>{const l=Ta(`${s} `,r),c=Ta(o,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=eM(s,t,"-",r);a.push(o,...u),o=f}else c+l>=t?(a.push(o),o=s):o=[o,s].filter(Boolean).join(" ");n+1===i.length&&a.push(o)}),a.filter(s=>s!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),eM=un((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const a=[...e],o=[];let s="";return a.forEach((n,l)=>{const c=`${s}${n}`;if(Ta(c,i)>=t){const d=l+1,u=a.length===d,f=`${c}${r}`;o.push(u?c:f),s=""}else s=c}),{hyphenatedStrings:o,remainingWord:s}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function ny(e,t){return Id(e,t).height}b(ny,"calculateTextHeight");function Ta(e,t){return Id(e,t).width}b(Ta,"calculateTextWidth");var Id=un((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=t;if(!e)return{width:0,height:0};const[,o]=Wl(r),s=["sans-serif",i],n=e.split(hn.lineBreakRegex),l=[],c=He("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of s){let f=0;const p={width:0,height:0,lineHeight:0};for(const g of n){const m=Qv();m.text=g||zv;const y=Jv(h,m).style("font-size",o).style("font-weight",a).style("font-family",u),x=(y._groups||y)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,x.width)),f=Math.round(x.height),p.height+=f,p.lineHeight=Math.round(Math.max(p.lineHeight,f))}l.push(p)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),ns,rM=(ns=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},b(ns,"InitIDGenerator"),ns),Bn,iM=b(function(e){return Bn=Bn||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Bn.innerHTML=e,unescape(Bn.textContent)},"entityDecode");function Od(e){return"str"in e}b(Od,"isDetailedError");function ly(e){return e instanceof Error?e.message:String(e)}b(ly,"getErrorMessage");var aM=b((e,t,r,i)=>{if(!i)return;const a=e.node()?.getBBox();a&&e.append("text").text(i).attr("text-anchor","middle").attr("x",a.x+a.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Wl=b(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Rd(e,t){return Wv({},e,t)}b(Rd,"cleanAndMerge");var pi={assignWithDepth:Ir,wrapLabel:tM,calculateTextHeight:ny,calculateTextWidth:Ta,calculateTextDimensions:Id,cleanAndMerge:Rd,detectInit:Xv,detectDirective:ty,isSubstringInArray:Gv,interpolateToCurve:$d,calcLabelPosition:iy,calcCardinalityPosition:Vv,calcTerminalLabelPosition:ay,formatUrl:ey,getStylesFromArray:oy,generateId:Zv,random:Kv,runFunc:Uv,entityDecode:iM,insertTitle:aM,isLabelCoordinateInPath:cy,parseFontSize:Wl,InitIDGenerator:rM},oM=b(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),ja=b(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),O4=b((e,t,{counter:r=0,prefix:i,suffix:a},o)=>o||`${i?`${i}_`:""}${e}_${t}_${r}${a?`_${a}`:""}`,"getEdgeId");function Rr(e){return e??null}b(Rr,"handleUndefinedAttr");function cy(e,t){const r=Math.round(e.x),i=Math.round(e.y),a=t.replace(/(\d+\.\d+)/g,o=>Math.round(parseFloat(o)).toString());return a.includes(r.toString())||a.includes(i.toString())}b(cy,"isLabelCoordinateInPath");function Dd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vo=Dd();function hy(e){vo=e}var Zs={exec:()=>null};function lr(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(a,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(ii.caret,"$1"),r=r.replace(a,s),i},getRegex:()=>new RegExp(r,t)};return i}var sM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ii={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},nM=/^(?:[ \t]*(?:\n|$))+/,lM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nd=/(?:[*+-]|\d{1,9}[.)])/,dy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uy=lr(dy).replace(/bull/g,Nd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),dM=lr(dy).replace(/bull/g,Nd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uM=/^[^\n]+/,Wd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fM=lr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gM=lr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Nd).getRegex(),zl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,pM=lr("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zd).replace("tag",zl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fy=lr(qd).replace("hr",fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zl).getRegex(),mM=lr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fy).getRegex(),Hd={blockquote:mM,code:lM,def:fM,fences:cM,heading:hM,hr:fn,html:pM,lheading:uy,list:gM,newline:nM,paragraph:fy,table:Zs,text:uM},zf=lr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zl).getRegex(),yM={...Hd,lheading:dM,table:zf,paragraph:lr(qd).replace("hr",fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",zf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zl).getRegex()},xM={...Hd,html:lr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Zs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lr(qd).replace("hr",fn).replace("heading",` *#{1,6} *[^
161
- ]`).replace("lheading",uy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,CM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gy=/^( {2,}|\\)\n(?!\s*$)/,wM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hl=/[\p{P}\p{S}]/u,Yd=/[\s\p{P}\p{S}]/u,py=/[^\s\p{P}\p{S}]/u,kM=lr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yd).getRegex(),my=/(?!~)[\p{P}\p{S}]/u,SM=/(?!~)[\s\p{P}\p{S}]/u,vM=/(?:[^\s\p{P}\p{S}]|~)/u,MM=lr(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),yy=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,TM=lr(yy,"u").replace(/punct/g,Hl).getRegex(),BM=lr(yy,"u").replace(/punct/g,my).getRegex(),xy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_M=lr(xy,"gu").replace(/notPunctSpace/g,py).replace(/punctSpace/g,Yd).replace(/punct/g,Hl).getRegex(),LM=lr(xy,"gu").replace(/notPunctSpace/g,vM).replace(/punctSpace/g,SM).replace(/punct/g,my).getRegex(),AM=lr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,py).replace(/punctSpace/g,Yd).replace(/punct/g,Hl).getRegex(),FM=lr(/\\(punct)/,"gu").replace(/punct/g,Hl).getRegex(),$M=lr(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),EM=lr(zd).replace("(?:-->|$)","-->").getRegex(),PM=lr("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",EM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bl=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,IM=lr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",bl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),by=lr(/^!?\[(label)\]\[(ref)\]/).replace("label",bl).replace("ref",Wd).getRegex(),Cy=lr(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wd).getRegex(),OM=lr("reflink|nolink(?!\\()","g").replace("reflink",by).replace("nolink",Cy).getRegex(),Hf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xd={_backpedal:Zs,anyPunctuation:FM,autolink:$M,blockSkip:MM,br:gy,code:CM,del:Zs,emStrongLDelim:TM,emStrongRDelimAst:_M,emStrongRDelimUnd:AM,escape:bM,link:IM,nolink:Cy,punctuation:kM,reflink:by,reflinkSearch:OM,tag:PM,text:wM,url:Zs},RM={...Xd,link:lr(/^!?\[(label)\]\((.*?)\)/).replace("label",bl).getRegex(),reflink:lr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bl).getRegex()},wh={...Xd,emStrongRDelimAst:LM,emStrongLDelim:BM,url:lr(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hf).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:lr(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Hf).getRegex()},DM={...wh,br:lr(gy).replace("{2,}","*").getRegex(),text:lr(wh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_n={normal:Hd,gfm:yM,pedantic:xM},Ts={normal:Xd,gfm:wh,breaks:DM,pedantic:RM},NM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Yf=e=>NM[e];function Vi(e,t){if(t){if(ii.escapeTest.test(e))return e.replace(ii.escapeReplace,Yf)}else if(ii.escapeTestNoEncode.test(e))return e.replace(ii.escapeReplaceNoEncode,Yf);return e}function Xf(e){try{e=encodeURI(e).replace(ii.percentDecode,"%")}catch{return null}return e}function jf(e,t){let r=e.replace(ii.findPipe,(o,s,n)=>{let l=!1,c=s;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ii.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(ii.slashPipe,"|");return i}function Bs(e,t,r){let i=e.length;if(i===0)return"";let a=0;for(;a<i&&e.charAt(i-a-1)===t;)a++;return e.slice(0,i-a)}function qM(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function Gf(e,t,r,i,a){let o=t.href,s=t.title||null,n=e[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:s,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function WM(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let a=i[1];return t.split(`
162
- `).map(o=>{let s=o.match(r.other.beginningSpace);if(s===null)return o;let[n]=s;return n.length>=a.length?o.slice(a.length):o}).join(`
163
- `)}var Cl=class{constructor(t){gr(this,"options");gr(this,"rules");gr(this,"lexer");this.options=t||vo}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Bs(i,`
164
- `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],a=WM(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:a}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let a=Bs(i,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(i=a.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Bs(r[0],`
165
- `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Bs(r[0],`
166
- `).split(`
167
- `),a="",o="",s=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
168
- `),d=h.replace(this.rules.other.blockquoteSetextReplace,`
169
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
170
- ${h}`:h,o=o?`${o}
171
- ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=u,i.length===0)break;let f=s.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let p=f,g=p.raw+`
172
- `+i.join(`
173
- `),m=this.blockquote(g);s[s.length-1]=m,a=a.substring(0,a.length-p.raw.length)+m.raw,o=o.substring(0,o.length-p.text.length)+m.text;break}else if(f?.type==="list"){let p=f,g=p.raw+`
174
- `+i.join(`
175
- `),m=this.list(g);s[s.length-1]=m,a=a.substring(0,a.length-f.raw.length)+m.raw,o=o.substring(0,o.length-p.raw.length)+m.raw,i=g.substring(s.at(-1).raw.length).split(`
176
- `);continue}}return{type:"blockquote",raw:a,tokens:s,text:o}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),a=i.length>1,o={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");let s=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=s.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let u=r[2].split(`
177
- `,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),f=t.split(`
178
- `,1)[0],p=!u.trim(),g=0;if(this.options.pedantic?(g=2,d=u.trimStart()):p?g=r[1].length+1:(g=r[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=u.slice(g),g+=r[1].length),p&&this.rules.other.blankLine.test(f)&&(h+=f+`
179
- `,t=t.substring(f.length+1),c=!0),!c){let x=this.rules.other.nextBulletRegex(g),C=this.rules.other.hrRegex(g),k=this.rules.other.fencesBeginRegex(g),v=this.rules.other.headingBeginRegex(g),T=this.rules.other.htmlBeginRegex(g);for(;t;){let F=t.split(`
180
- `,1)[0],A;if(f=F,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),A=f):A=f.replace(this.rules.other.tabCharGlobal," "),k.test(f)||v.test(f)||T.test(f)||x.test(f)||C.test(f))break;if(A.search(this.rules.other.nonSpaceChar)>=g||!f.trim())d+=`
181
- `+A.slice(g);else{if(p||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(u)||v.test(u)||C.test(u))break;d+=`
182
- `+f}!p&&!f.trim()&&(p=!0),h+=F+`
183
- `,t=t.substring(F.length+1),u=A.slice(g)}}o.loose||(n?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let m=null,y;this.options.gfm&&(m=this.rules.other.listIsTask.exec(d),m&&(y=m[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!m,checked:y,loose:!1,text:d,tokens:[]}),o.raw+=h}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let c=0;c<o.items.length;c++)if(this.lexer.state.top=!1,o.items[c].tokens=this.lexer.blockTokens(o.items[c].text,[]),!o.loose){let h=o.items[c].tokens.filter(u=>u.type==="space"),d=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));o.loose=d}if(o.loose)for(let c=0;c<o.items.length;c++)o.items[c].loose=!0;return o}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:a,title:o}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=jf(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
184
- `):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===a.length){for(let n of a)this.rules.other.tableAlignRight.test(n)?s.align.push("right"):this.rules.other.tableAlignCenter.test(n)?s.align.push("center"):this.rules.other.tableAlignLeft.test(n)?s.align.push("left"):s.align.push(null);for(let n=0;n<i.length;n++)s.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:s.align[n]});for(let n of o)s.rows.push(jf(n,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
185
- `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=Bs(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=qM(r[2],"()");if(s===-2)return;if(s>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let a=r[2],o="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],o=s[3])}else o=r[3]?r[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?a=a.slice(1):a=a.slice(1,-1)),Gf(r,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let a=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=r[a.toLowerCase()];if(!o){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return Gf(i,o,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||a[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...a[0]].length-1,s,n,l=o,c=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+o);(a=h.exec(r))!=null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(n=[...s].length,a[3]||a[4]){l+=n;continue}else if((a[5]||a[6])&&o%3&&!((o+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...a[0]][0].length,u=t.slice(0,o+a.index+d+n);if(Math.min(o,n)%2){let p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return a&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,a;return r[2]==="@"?(i=r[1],a="mailto:"+i):(i=r[1],a=i),{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(o!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Pi=class kh{constructor(t){gr(this,"tokens");gr(this,"options");gr(this,"state");gr(this,"tokenizer");gr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||vo,this.options.tokenizer=this.options.tokenizer||new Cl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ii,block:_n.normal,inline:Ts.normal};this.options.pedantic?(r.block=_n.pedantic,r.inline=Ts.pedantic):this.options.gfm&&(r.block=_n.gfm,this.options.breaks?r.inline=Ts.breaks:r.inline=Ts.gfm),this.tokenizer.rules=r}static get rules(){return{block:_n,inline:Ts}}static lex(t,r){return new kh(r).lex(t)}static lexInline(t,r){return new kh(r).inlineTokens(t)}lex(t){t=t.replace(ii.carriageReturn,`
186
- `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(ii.tabCharGlobal," ").replace(ii.spaceLine,""));t;){let a;if(this.options.extensions?.block?.some(s=>(a=s.call({lexer:this},t,r))?(t=t.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let s=r.at(-1);a.raw.length===1&&s!==void 0?s.raw+=`
187
- `:r.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
188
- `)?"":`
189
- `)+a.raw,s.text+=`
190
- `+a.text,this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
191
- `)?"":`
192
- `)+a.raw,s.text+=`
193
- `+a.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),r.push(a);continue}let o=t;if(this.options.extensions?.startBlock){let s=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(o=t.substring(0,s+1))}if(this.state.top&&(a=this.tokenizer.paragraph(o))){let s=r.at(-1);i&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
194
- `)?"":`
195
- `)+a.raw,s.text+=`
196
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a),i=o.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
197
- `)?"":`
198
- `)+a.raw,s.text+=`
199
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,a=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)o=a[2]?a[2].length:0,i=i.slice(0,a.index+o)+"["+"a".repeat(a[0].length-o-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let s=!1,n="";for(;t;){s||(n=""),s=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(h=Math.min(h,u))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),s=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},wl=class{constructor(t){gr(this,"options");gr(this,"parser");this.options=t||vo}space(t){return""}code({text:t,lang:r,escaped:i}){let a=(r||"").match(ii.notSpaceStart)?.[0],o=t.replace(ii.endingNewline,"")+`
200
- `;return a?'<pre><code class="language-'+Vi(a)+'">'+(i?o:Vi(o,!0))+`</code></pre>
201
- `:"<pre><code>"+(i?o:Vi(o,!0))+`</code></pre>
202
- `}blockquote({tokens:t}){return`<blockquote>
203
- ${this.parser.parse(t)}</blockquote>
204
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
205
- `}hr(t){return`<hr>
206
- `}list(t){let r=t.ordered,i=t.start,a="";for(let n=0;n<t.items.length;n++){let l=t.items[n];a+=this.listitem(l)}let o=r?"ol":"ul",s=r&&i!==1?' start="'+i+'"':"";return"<"+o+s+`>
207
- `+a+"</"+o+`>
208
- `}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Vi(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
209
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
210
- `}table(t){let r="",i="";for(let o=0;o<t.header.length;o++)i+=this.tablecell(t.header[o]);r+=this.tablerow({text:i});let a="";for(let o=0;o<t.rows.length;o++){let s=t.rows[o];i="";for(let n=0;n<s.length;n++)i+=this.tablecell(s[n]);a+=this.tablerow({text:i})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
211
- <thead>
212
- `+r+`</thead>
213
- `+a+`</table>
214
- `}tablerow({text:t}){return`<tr>
215
- ${t}</tr>
216
- `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
217
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Vi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let a=this.parser.parseInline(i),o=Xf(t);if(o===null)return a;t=o;let s='<a href="'+t+'"';return r&&(s+=' title="'+Vi(r)+'"'),s+=">"+a+"</a>",s}image({href:t,title:r,text:i,tokens:a}){a&&(i=this.parser.parseInline(a,this.parser.textRenderer));let o=Xf(t);if(o===null)return Vi(i);t=o;let s=`<img src="${t}" alt="${i}"`;return r&&(s+=` title="${Vi(r)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Vi(t.text)}},jd=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ii=class Sh{constructor(t){gr(this,"options");gr(this,"renderer");gr(this,"textRenderer");this.options=t||vo,this.options.renderer=this.options.renderer||new wl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jd}static parse(t,r){return new Sh(r).parse(t)}static parseInline(t,r){return new Sh(r).parseInline(t)}parse(t,r=!0){let i="";for(let a=0;a<t.length;a++){let o=t[a];if(this.options.extensions?.renderers?.[o.type]){let n=o,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let s=o;switch(s.type){case"space":{i+=this.renderer.space(s);continue}case"hr":{i+=this.renderer.hr(s);continue}case"heading":{i+=this.renderer.heading(s);continue}case"code":{i+=this.renderer.code(s);continue}case"table":{i+=this.renderer.table(s);continue}case"blockquote":{i+=this.renderer.blockquote(s);continue}case"list":{i+=this.renderer.list(s);continue}case"html":{i+=this.renderer.html(s);continue}case"def":{i+=this.renderer.def(s);continue}case"paragraph":{i+=this.renderer.paragraph(s);continue}case"text":{let n=s,l=this.renderer.text(n);for(;a+1<t.length&&t[a+1].type==="text";)n=t[++a],l+=`
218
- `+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let a=0;a<t.length;a++){let o=t[a];if(this.options.extensions?.renderers?.[o.type]){let n=this.options.extensions.renderers[o.type].call({parser:this},o);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=n||"";continue}}let s=o;switch(s.type){case"escape":{i+=r.text(s);break}case"html":{i+=r.html(s);break}case"link":{i+=r.link(s);break}case"image":{i+=r.image(s);break}case"strong":{i+=r.strong(s);break}case"em":{i+=r.em(s);break}case"codespan":{i+=r.codespan(s);break}case"br":{i+=r.br(s);break}case"del":{i+=r.del(s);break}case"text":{i+=r.text(s);break}default:{let n='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},Wn,Rs=(Wn=class{constructor(t){gr(this,"options");gr(this,"block");this.options=t||vo}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Pi.lex:Pi.lexInline}provideParser(){return this.block?Ii.parse:Ii.parseInline}},gr(Wn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),gr(Wn,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Wn),zM=class{constructor(...t){gr(this,"defaults",Dd());gr(this,"options",this.setOptions);gr(this,"parse",this.parseMarkdown(!0));gr(this,"parseInline",this.parseMarkdown(!1));gr(this,"Parser",Ii);gr(this,"Renderer",wl);gr(this,"TextRenderer",jd);gr(this,"Lexer",Pi);gr(this,"Tokenizer",Cl);gr(this,"Hooks",Rs);this.use(...t)}walkTokens(t,r){let i=[];for(let a of t)switch(i=i.concat(r.call(this,a)),a.type){case"table":{let o=a;for(let s of o.header)i=i.concat(this.walkTokens(s.tokens,r));for(let s of o.rows)for(let n of s)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let o=a;i=i.concat(this.walkTokens(o.items,r));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(s=>{let n=o[s].flat(1/0);i=i.concat(this.walkTokens(n,r))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let s=r.renderers[o.name];s?r.renderers[o.name]=function(...n){let l=o.renderer.apply(this,n);return l===!1&&(l=s.apply(this,n)),l}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[o.level];s?s.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),a.extensions=r),i.renderer){let o=this.defaults.renderer||new wl(this.defaults);for(let s in i.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let n=s,l=i.renderer[n],c=o[n];o[n]=(...h)=>{let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d||""}}a.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Cl(this.defaults);for(let s in i.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let n=s,l=i.tokenizer[n],c=o[n];o[n]=(...h)=>{let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d}}a.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new Rs;for(let s in i.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let n=s,l=i.hooks[n],c=o[n];Rs.passThroughHooks.has(s)?o[n]=h=>{if(this.defaults.async&&Rs.passThroughHooksRespectAsync.has(s))return(async()=>{let u=await l.call(o,h);return c.call(o,u)})();let d=l.call(o,h);return c.call(o,d)}:o[n]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(o,h);return u===!1&&(u=await c.apply(o,h)),u})();let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d}}a.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,s=i.walkTokens;a.walkTokens=function(n){let l=[];return l.push(s.call(this,n)),o&&(l=l.concat(o.call(this,n))),l}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Pi.lex(t,r??this.defaults)}parser(t,r){return Ii.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let a={...i},o={...this.defaults,...a},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(r):r,l=await(o.hooks?await o.hooks.provideLexer():t?Pi.lex:Pi.lexInline)(n,o),c=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(c,o.walkTokens));let h=await(o.hooks?await o.hooks.provideParser():t?Ii.parse:Ii.parseInline)(c,o);return o.hooks?await o.hooks.postprocess(h):h})().catch(s);try{o.hooks&&(r=o.hooks.preprocess(r));let n=(o.hooks?o.hooks.provideLexer():t?Pi.lex:Pi.lexInline)(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():t?Ii.parse:Ii.parseInline)(n,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(n){return s(n)}}}onError(t,r){return i=>{if(i.message+=`
219
- Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+Vi(i.message+"",!0)+"</pre>";return r?Promise.resolve(a):a}if(r)return Promise.reject(i);throw i}}},bo=new zM;function cr(e,t){return bo.parse(e,t)}cr.options=cr.setOptions=function(e){return bo.setOptions(e),cr.defaults=bo.defaults,hy(cr.defaults),cr};cr.getDefaults=Dd;cr.defaults=vo;cr.use=function(...e){return bo.use(...e),cr.defaults=bo.defaults,hy(cr.defaults),cr};cr.walkTokens=function(e,t){return bo.walkTokens(e,t)};cr.parseInline=bo.parseInline;cr.Parser=Ii;cr.parser=Ii.parse;cr.Renderer=wl;cr.TextRenderer=jd;cr.Lexer=Pi;cr.lexer=Pi.lex;cr.Tokenizer=Cl;cr.Hooks=Rs;cr.parse=cr;cr.options;cr.setOptions;cr.use;cr.walkTokens;cr.parseInline;Ii.parse;Pi.lex;function wy(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var a=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,u;return(u=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&u!==void 0?u:0})):n},[]);if(a.length){var o=new RegExp(`
220
- [ ]{`.concat(Math.min.apply(Math,a),"}"),"g");i=i.map(function(n){return n.replace(o,`
221
- `)})}i[0]=i[0].replace(/^\r?\n/,"");var s=i[0];return t.forEach(function(n,l){var c=s.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
222
- `)&&(d=String(n).split(`
223
- `).map(function(u,f){return f===0?u:"".concat(h).concat(u)}).join(`
224
- `)),s+=d+i[l+1]}),s}var vh=typeof performance<"u"&&typeof performance.now=="function",_o=b(()=>vh?performance.now():0,"now"),Dc="🧜 ",HM="Mermaid render",YM="Mermaid",XM={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},ls;ls=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(t){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(t))}tickSync(t,r){if(!this.enabled)return r();const i=_o();try{return r()}finally{this.buckets[t]=(this.buckets[t]??0)+(_o()-i)}}async tick(t,r){if(!this.enabled)return r();const i=_o();try{return await r()}finally{this.buckets[t]=(this.buckets[t]??0)+(_o()-i)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const t=this.roots.at(-1),r=this.runLabel??t?.name;return t&&(this.records.push({label:r??t.name,tree:t,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(t,r)),this.runLabel=void 0,t}begin(t){if(!this.enabled)return;const r={name:t,start:_o(),duration:-1,children:[]},i=this.stack.at(-1);if(i?i.children.push(r):this.roots.push(r),this.stack.push(r),vh&&typeof performance.mark=="function")try{performance.mark(`${Dc}${t} ▶`)}catch{}}end(){if(!this.enabled)return;const t=this.stack.pop();if(!t)return;const r=_o();if(t.duration=r-t.start,vh&&typeof performance.measure=="function")try{performance.measure(`${Dc}${t.name}`,{start:t.start,end:r,detail:{devtools:{dataType:"track-entry",track:HM,trackGroup:YM,color:XM[t.name]??"primary",tooltipText:`${t.name} — ${t.duration.toFixed(1)} ms`}}})}catch{}}async span(t,r){if(!this.enabled)return r();this.begin(t);try{return await r()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(t=this.report(),r){if(!t)return;const i=t.duration,a=r&&r!==t.name?`${t.name} [${r}]`:t.name,o=["ms % phase"],s=b((l,c)=>{const h=" ".repeat(c),d=l.duration.toFixed(1).padStart(8),u=i>0?`${(l.duration/i*100).toFixed(0).padStart(3)}%`:" -";o.push(`${d} ${u} ${h}${l.name}`);for(const f of l.children)s(f,c+1);if(l.children.length>0){const f=l.children.reduce((g,m)=>g+m.duration,0),p=l.duration-f;if(p>.5){const g=p.toFixed(1).padStart(8);o.push(`${g} ${h} (self)`)}}},"walk");s(t,0);const n=Object.keys(this.buckets);if(n.length>0){o.push("—— buckets (summed) ——");for(const l of n)o.push(`${this.buckets[l].toFixed(1).padStart(8)} ${l}`)}console.log(`${Dc}mermaid render profile · ${a}
225
- ${o.join(`
226
- `)}`)}},b(ls,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};function ky(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
227
- `).replace(/\n{2,}/g,`
228
- `);return wy(i)}b(ky,"preprocessMarkdown");function Sy(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}b(Sy,"nonMarkdownToLines");function vy(e,t={}){const r=ky(e,t),i=cr.lexer(r),a=[[]];let o=0;function s(n,l="normal"){n.type==="text"?n.text.split(`
229
- `).forEach((h,d)=>{d!==0&&(o++,a.push([])),h.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&a[o].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{s(c,n.type)}):n.type==="html"&&a[o].push({content:n.text,type:"normal"})}return b(s,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{s(l)}):n.type==="html"?a[o].push({content:n.text,type:"normal"}):a[o].push({content:n.raw,type:"normal"})}),a}b(vy,"markdownToLines");function My(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}b(My,"nonMarkdownToHTML");function Ty(e,{markdownAutoWrap:t}={}){const r=cr.lexer(e);function i(a){return a.type==="text"?t===!1?a.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):a.text.replace(/\n */g,"<br/>"):a.type==="strong"?`<strong>${a.tokens?.map(i).join("")}</strong>`:a.type==="em"?`<em>${a.tokens?.map(i).join("")}</em>`:a.type==="paragraph"?`<p>${a.tokens?.map(i).join("")}</p>`:a.type==="space"?"":a.type==="html"?`${a.text}`:a.type==="escape"?a.text:(Tt.warn(`Unsupported markdown: ${a.type}`),a.raw)}return b(i,"output"),r.map(i).join("")}b(Ty,"markdownToHTML");var jM=(function(e){var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function i(){var c=this;c.reads=[],c.writes=[],c.raf=r.bind(e)}b(i,"FastDom"),i.prototype={constructor:i,runTasks:b(function(c){for(var h;h=c.shift();)h()},"runTasks"),measure:b(function(c,h){var d=h?c.bind(h):c;return this.reads.push(d),a(this),d},"measure"),mutate:b(function(c,h){var d=h?c.bind(h):c;return this.writes.push(d),a(this),d},"mutate"),clear:b(function(c){return s(this.reads,c)||s(this.writes,c)},"clear"),extend:b(function(c){if(typeof c!="object")throw new Error("expected object");var h=Object.create(this);return n(h,c),h.fastdom=this,h.initialize&&h.initialize(),h},"extend"),catch:null};function a(c){c.scheduled||(c.scheduled=!0,c.raf(o.bind(null,c)))}b(a,"scheduleFlush");function o(c){var h=c.writes,d=c.reads,u;try{t("flushing reads",d.length),c.runTasks(d),t("flushing writes",h.length),c.runTasks(h)}catch(f){u=f}if(c.scheduled=!1,(d.length||h.length)&&a(c),u)if(t("task errored",u.message),c.catch)c.catch(u);else throw u}b(o,"flush");function s(c,h){var d=c.indexOf(h);return!!~d&&!!c.splice(d,1)}b(s,"remove");function n(c,h){for(var d in h)h.hasOwnProperty(d)&&(c[d]=h[d])}b(n,"mixin");var l=e.fastdom=e.fastdom||new i;return l})(typeof window<"u"?window:globalThis),By={initialize:b(function(){this._tasks=new Map},"initialize"),mutate:b(function(e,t){return Mh(this,"mutate",e,t)},"mutate"),measure:b(function(e,t){return Mh(this,"measure",e,t)},"measure"),clear:b(function(e){var t=this._tasks,r=t.get(e);this.fastdom.clear(r),t.delete(e)},"clear")};function Mh(e,t,r,i){var a=e._tasks,o=e.fastdom,s,n=new Promise(function(l,c){s=o[t](function(){a.delete(n);try{l(i?r.call(i):r())}catch(h){c(h)}},i)});return a.set(n,s),n}b(Mh,"create");var{initialize:z4,mutate:H4,measure:Y4,clear:X4}=By,GM=By,UM=jM.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(GM),Co=UM;function _y(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}b(_y,"splitTextToChars");function Ly(e,t){const r=_y(t.content);return Gd(e,[],r,t.type)}b(Ly,"splitWordToFitWidth");function Gd(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[a,...o]=r,s=[...t,a];return e([{content:s.join(""),type:i}])?Gd(e,s,o,i):(t.length===0&&a&&(t.push(a),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}b(Gd,"splitWordToFitWidthRecursion");function Ay(e,t){if(e.some(({content:r})=>r.includes(`
230
- `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return kl(e,t)}b(Ay,"splitLineToFitWidth");function kl(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let a="";e[0].content===" "&&(a=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},s=[...i];if(a!==""&&s.push({content:a,type:"normal"}),s.push(o),t(s))return kl(e,t,r,s);if(i.length>0)r.push(i),e.unshift(o);else if(o.content){const[n,l]=Ly(t,o);r.push([n]),l.content&&e.unshift(l)}return kl(e,t,r)}b(kl,"splitLineToFitWidthRecursion");function Th(e,t){t&&e.attr("style",t)}b(Th,"applyStyle");var Uf=16384;async function Fy(e,t,r,i,a=!1,o=Tr(),s=0){const n=e.append("foreignObject");n.attr("width",`${Math.min(10*r,Uf)}px`),n.attr("height",`${Math.min(10*r,Uf)}px`);const l=n.append("xhtml:div"),c=Js(t.label)?await jp(t.label.replace(hn.lineBreakRegex,`
231
- `),o):Ti(t.label,o),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(c),Th(d,t.labelStyle),d.attr("class",`${h} ${i}`),Th(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&l.attr("class","labelBkg");const u=await Co.measure(()=>l.node().getBoundingClientRect());return u.width===r?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")):u.width<s&&(l.style("display","table"),l.style("width",s+"px"),l.style("text-align","center")),n.node()}b(Fy,"addHtmlSpan");function Yl(e,t,r,i=!1){const a=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&a.attr("text-anchor","middle"),a}b(Yl,"createTspan");function $y(e,t,r){const i=e.append("text"),a=Yl(i,1,t);Xl(a,r);const o=a.node().getComputedTextLength();return i.remove(),o}b($y,"computeWidthOfText");function VM(e,t,r){const i=e.append("text"),a=Yl(i,1,t);Xl(a,[{content:r,type:"normal"}]);const o=a.node()?.getBoundingClientRect();return o&&i.remove(),o}b(VM,"computeDimensionOfText");function Ey(e,t,r,i=!1,a=!1){const s=t.append("g"),n=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");a&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=b(f=>$y(s,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:Ay(h,d);for(const f of u){const p=Yl(l,c,1.1,a);Xl(p,f),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}b(Ey,"createFormattedText");function Bh(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}b(Bh,"decodeHTMLEntities");function Xl(e,t){e.text(""),t.forEach((r,i)=>{const a=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?a.text(Bh(r.content)):a.text(" "+Bh(r.content))})}b(Xl,"updateTextContentAndStyles");async function Py(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(a,o,s)=>(r.push((async()=>{const n=`${o}:${s}`;return await Jp(n)?await So(n,void 0,{class:"label-icon"}):`<i class='${Ti(a,t).replace(":"," ")}'></i>`})()),a));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}b(Py,"replaceIconSubstring");var mi=b(async(e,t="",{style:r="",isTitle:i=!1,classes:a="",useHtmlLabels:o=!0,markdown:s=!0,isNode:n=!0,width:l=200,minWidth:c=0,addSvgBackground:h=!1}={},d)=>{if(Tt.debug("XYZ createText",t,r,i,a,o,n,"addSvgBackground: ",h),o){const u=s?Ty(t,d):My(t),f=await Py(ja(u),d),p=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Js(t)?p:f,labelStyle:r.replace("fill:","color:")};return await Fy(e,g,l,a,h,d,c)}else{const u=ja(t.replace(/<br\s*\/?>/g,"<br/>")),f=s?vy(u.replace("<br>","<br/>"),d):Sy(u),p=Ey(l,e,f,t?h:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");He(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");He(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");He(p).select("text").attr("style",m)}return i?He(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):He(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText"),ZM=new Set(["redux-color","redux-dark-color"]),KM=12,QM=64,Ud=b(e=>Array.isArray(e)&&e.length>0,"hasPalette"),JM=b((e,t)=>e!=null&&ZM.has(e)&&Ud(t),"isColorTheme"),tT=/^[\w-]+$/,j4=b(e=>{const t=typeof e=="string"||typeof e=="number"?String(e):"";return tT.test(t)?t:"classic"},"safeLook"),Iy=b(e=>Ud(e)?e.length:0,"paletteSlotCount"),G4=b((e,t)=>Ud(t)?Iy(t):typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=QM?e:KM,"colorSlotCount"),Li=b((e,t,r,i)=>{if(t===void 0||!JM(r,i))return;const a=t%Iy(i);e.attr("data-color-id",`color-${a}`)},"stampColorSlot");function Nc(e,t,r){if(e&&e.length){const[i,a]=t,o=Math.PI/180*r,s=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-i)*s-(h-a)*n+i,l[1]=(c-i)*n+(h-a)*s+a}}}function eT(e,t){return e[0]===t[0]&&e[1]===t[1]}function rT(e,t,r,i=1){const a=r,o=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(a)for(const c of s)Nc(c,n,a);const l=(function(c,h,d){const u=[];for(const x of c){const C=[...x];eT(C[0],C[C.length-1])||C.push([C[0][0],C[0][1]]),C.length>2&&u.push(C)}const f=[];h=Math.max(h,.1);const p=[];for(const x of u)for(let C=0;C<x.length-1;C++){const k=x[C],v=x[C+1];if(k[1]!==v[1]){const T=Math.min(k[1],v[1]);p.push({ymin:T,ymax:Math.max(k[1],v[1]),x:T===k[1]?k[0]:v[0],islope:(v[0]-k[0])/(v[1]-k[1])})}}if(p.sort(((x,C)=>x.ymin<C.ymin?-1:x.ymin>C.ymin?1:x.x<C.x?-1:x.x>C.x?1:x.ymax===C.ymax?0:(x.ymax-C.ymax)/Math.abs(x.ymax-C.ymax))),!p.length)return f;let g=[],m=p[0].ymin,y=0;for(;g.length||p.length;){if(p.length){let x=-1;for(let C=0;C<p.length&&!(p[C].ymin>m);C++)x=C;p.splice(0,x+1).forEach((C=>{g.push({s:m,edge:C})}))}if(g=g.filter((x=>!(x.edge.ymax<=m))),g.sort(((x,C)=>x.edge.x===C.edge.x?0:(x.edge.x-C.edge.x)/Math.abs(x.edge.x-C.edge.x))),(d!==1||y%h==0)&&g.length>1)for(let x=0;x<g.length;x+=2){const C=x+1;if(C>=g.length)break;const k=g[x].edge,v=g[C].edge;f.push([[Math.round(k.x),m],[Math.round(v.x),m]])}m+=d,g.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),y++}return f})(s,o,i);if(a){for(const c of s)Nc(c,n,-a);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Nc(u,h,d)})(l,n,-a)}return l}function gn(e,t){var r;const i=t.hachureAngle+90;let a=t.hachureGap;a<0&&(a=4*t.strokeWidth),a=Math.round(Math.max(a,.1));let o=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(o=a),rT(e,a,i,o||1)}class Vd{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=gn(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const a of t)i.push(...this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],r));return i}}function jl(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class iT extends Vd{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const a=gn(t,Object.assign({},r,{hachureGap:i})),o=Math.PI/180*r.hachureAngle,s=[],n=.5*i*Math.cos(o),l=.5*i*Math.sin(o);for(const[c,h]of a)jl([c,h])&&s.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class aT extends Vd{fillPolygons(t,r){const i=this._fillPolygons(t,r),a=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),o=this._fillPolygons(t,a);return i.ops=i.ops.concat(o.ops),i}}class oT{constructor(t){this.helper=t}fillPolygons(t,r){const i=gn(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let a=r.hachureGap;a<0&&(a=4*r.strokeWidth),a=Math.max(a,.1);let o=r.fillWeight;o<0&&(o=r.strokeWidth/2);const s=a/4;for(const n of t){const l=jl(n),c=l/a,h=Math.ceil(c)-1,d=l-h*a,u=(n[0][0]+n[1][0])/2-a/4,f=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const g=f+d+p*a,m=u-s+2*Math.random()*s,y=g-s+2*Math.random()*s,x=this.helper.ellipse(m,y,o,o,r);i.push(...x.ops)}}return{type:"fillSketch",ops:i}}}class sT{constructor(t){this.helper=t}fillPolygons(t,r){const i=gn(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,a=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,o=[];return t.forEach((s=>{const n=jl(s),l=Math.floor(n/(i+a)),c=(n+a-l*(i+a))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const p=f*(i+a),g=p+i,m=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)],y=[h[0]+g*Math.cos(u)+c*Math.cos(u),h[1]+g*Math.sin(u)+c*Math.sin(u)];o.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],r))}})),o}}class nT{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,a=r.zigzagOffset<0?i:r.zigzagOffset,o=gn(t,r=Object.assign({},r,{hachureGap:i+a}));return{type:"fillSketch",ops:this.zigzagLines(o,a,r)}}zigzagLines(t,r,i){const a=[];return t.forEach((o=>{const s=jl(o),n=Math.round(s/(2*r));let l=o[0],c=o[1];l[0]>c[0]&&(l=o[1],c=o[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),g=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[g[0]+p*Math.cos(h+Math.PI/4),g[1]+p*Math.sin(h+Math.PI/4)];a.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],i),...this.helper.doubleLineOps(y[0],y[1],m[0],m[1],i))}})),a}}const ci={};class lT{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const cT=0,qc=1,Vf=2,Ln={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Wc(e,t){return e.type===t}function Zd(e){const t=[],r=(function(s){const n=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:cT,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:qc,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return n[n.length]={type:Vf,text:""},n})(e);let i="BOD",a=0,o=r[a];for(;!Wc(o,Vf);){let s=0;const n=[];if(i==="BOD"){if(o.text!=="M"&&o.text!=="m")return Zd("M0,0"+e);a++,s=Ln[o.text],i=o.text}else Wc(o,qc)?s=Ln[i]:(a++,s=Ln[o.text],i=o.text);if(!(a+s<r.length))throw new Error("Path data ended short");for(let l=a;l<a+s;l++){const c=r[l];if(!Wc(c,qc))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Ln[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),a+=s,o=r[a],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Oy(e){let t=0,r=0,i=0,a=0;const o=[];for(const{key:s,data:n}of e)switch(s){case"M":o.push({key:"M",data:[...n]}),[t,r]=n,[i,a]=n;break;case"m":t+=n[0],r+=n[1],o.push({key:"M",data:[t,r]}),i=t,a=r;break;case"L":o.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],o.push({key:"L",data:[t,r]});break;case"C":o.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":o.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":o.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],o.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":o.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],o.push({key:"V",data:[r]});break;case"S":o.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":o.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],o.push({key:"T",data:[t,r]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=i,r=a}return o}function Ry(e){const t=[];let r="",i=0,a=0,o=0,s=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,a]=h,[o,s]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],a=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,a]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,a]});break;case"V":a=h[0],t.push({key:"L",data:[i,a]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=a+(a-l)):(d=i,u=a),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],a=h[3];break}case"T":{const[d,u]=h;let f=0,p=0;r==="Q"||r==="T"?(f=i+(i-n),p=a+(a-l)):(f=i,p=a);const g=i+2*(f-i)/3,m=a+2*(p-a)/3,y=d+2*(f-d)/3,x=u+2*(p-u)/3;t.push({key:"C",data:[g,m,y,x,d,u]}),n=f,l=p,i=d,a=u;break}case"Q":{const[d,u,f,p]=h,g=i+2*(d-i)/3,m=a+2*(u-a)/3,y=f+2*(d-f)/3,x=p+2*(u-p)/3;t.push({key:"C",data:[g,m,y,x,f,p]}),n=d,l=u,i=f,a=p;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],p=h[3],g=h[4],m=h[5],y=h[6];d===0||u===0?(t.push({key:"C",data:[i,a,m,y,m,y]}),i=m,a=y):(i!==m||a!==y)&&(Dy(i,a,m,y,d,u,f,p,g).forEach((function(x){t.push({key:"C",data:x})})),i=m,a=y);break}case"Z":t.push({key:"Z",data:[]}),i=o,a=s}r=c}return t}function _s(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Dy(e,t,r,i,a,o,s,n,l,c){const h=(d=s,Math.PI*d/180);var d;let u=[],f=0,p=0,g=0,m=0;if(c)[f,p,g,m]=c;else{[e,t]=_s(e,t,-h),[r,i]=_s(r,i,-h);const I=(e-r)/2,_=(t-i)/2;let E=I*I/(a*a)+_*_/(o*o);E>1&&(E=Math.sqrt(E),a*=E,o*=E);const L=a*a,q=o*o,W=L*q-L*_*_-q*I*I,R=L*_*_+q*I*I,D=(n===l?-1:1)*Math.sqrt(Math.abs(W/R));g=D*a*_/o+(e+r)/2,m=D*-o*I/a+(t+i)/2,f=Math.asin(parseFloat(((t-m)/o).toFixed(9))),p=Math.asin(parseFloat(((i-m)/o).toFixed(9))),e<g&&(f=Math.PI-f),r<g&&(p=Math.PI-p),f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),l&&f>p&&(f-=2*Math.PI),!l&&p>f&&(p-=2*Math.PI)}let y=p-f;if(Math.abs(y)>120*Math.PI/180){const I=p,_=r,E=i;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=Dy(r=g+a*Math.cos(p),i=m+o*Math.sin(p),_,E,a,o,s,0,l,[p,I,g,m])}y=p-f;const x=Math.cos(f),C=Math.sin(f),k=Math.cos(p),v=Math.sin(p),T=Math.tan(y/4),F=4/3*a*T,A=4/3*o*T,M=[e,t],B=[e+F*C,t-A*x],$=[r+F*v,i-A*k],P=[r,i];if(B[0]=2*M[0]-B[0],B[1]=2*M[1]-B[1],c)return[B,$,P].concat(u);{u=[B,$,P].concat(u);const I=[];for(let _=0;_<u.length;_+=3){const E=_s(u[_][0],u[_][1],h),L=_s(u[_+1][0],u[_+1][1],h),q=_s(u[_+2][0],u[_+2][1],h);I.push([E[0],E[1],L[0],L[1],q[0],q[1]])}return I}}const hT={randOffset:function(e,t){return Re(e,t)},randOffsetWithRange:function(e,t,r){return Sl(e,t,r)},ellipse:function(e,t,r,i,a){const o=qy(r,i,a);return _h(e,t,a,o).opset},doubleLineOps:function(e,t,r,i,a){return Ga(e,t,r,i,a,!0)}};function Ny(e,t,r,i,a){return{type:"path",ops:Ga(e,t,r,i,a)}}function Kn(e,t,r){const i=(e||[]).length;if(i>2){const a=[];for(let o=0;o<i-1;o++)a.push(...Ga(e[o][0],e[o][1],e[o+1][0],e[o+1][1],r));return t&&a.push(...Ga(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:a}}return i===2?Ny(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function dT(e,t,r,i,a){return(function(o,s){return Kn(o,!0,s)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],a)}function Zf(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=An(r[0],1*(1+.2*t.roughness),t),a=t.disableMultiStroke?[]:An(r[0],1.5*(1+.22*t.roughness),Jf(t));for(let o=1;o<r.length;o++){const s=r[o];if(s.length){const n=An(s,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:An(s,1.5*(1+.22*t.roughness),Jf(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&a.push(c)}}return{type:"path",ops:i.concat(a)}}return{type:"path",ops:[]}}function qy(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),a=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),o=2*Math.PI/a;let s=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return s+=Re(s*l,r),n+=Re(n*l,r),{increment:o,rx:s,ry:n}}function _h(e,t,r,i){const[a,o]=tg(i.increment,e,t,i.rx,i.ry,1,i.increment*Sl(.1,Sl(.4,1,r),r),r);let s=vl(a,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=tg(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=vl(n,null,r);s=s.concat(l)}return{estimatedPoints:o,opset:{type:"path",ops:s}}}function Kf(e,t,r,i,a,o,s,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=Re(.01*d,l),u+=Re(.01*u,l);let f=a,p=o;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);const g=2*Math.PI/l.curveStepCount,m=Math.min(g/2,(p-f)/2),y=eg(m,c,h,d,u,f,p,1,l);if(!l.disableMultiStroke){const x=eg(m,c,h,d,u,f,p,1.5,l);y.push(...x)}return s&&(n?y.push(...Ga(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...Ga(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:y}}function Qf(e,t){const r=Ry(Oy(Zd(e))),i=[];let a=[0,0],o=[0,0];for(const{key:s,data:n}of r)switch(s){case"M":o=[n[0],n[1]],a=[n[0],n[1]];break;case"L":i.push(...Ga(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...uT(l,c,h,d,u,f,o,t)),o=[u,f];break}case"Z":i.push(...Ga(o[0],o[1],a[0],a[1],t)),o=[a[0],a[1]]}return{type:"path",ops:i}}function zc(e,t){const r=[];for(const i of e)if(i.length){const a=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+Re(a,t),i[0][1]+Re(a,t)]});for(let s=1;s<o;s++)r.push({op:"lineTo",data:[i[s][0]+Re(a,t),i[s][1]+Re(a,t)]})}}return{type:"fillPath",ops:r}}function Lo(e,t){return(function(r,i){let a=r.fillStyle||"hachure";if(!ci[a])switch(a){case"zigzag":ci[a]||(ci[a]=new iT(i));break;case"cross-hatch":ci[a]||(ci[a]=new aT(i));break;case"dots":ci[a]||(ci[a]=new oT(i));break;case"dashed":ci[a]||(ci[a]=new sT(i));break;case"zigzag-line":ci[a]||(ci[a]=new nT(i));break;default:a="hachure",ci[a]||(ci[a]=new Vd(i))}return ci[a]})(t,hT).fillPolygons(e,t)}function Jf(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Wy(e){return e.randomizer||(e.randomizer=new lT(e.seed||0)),e.randomizer.next()}function Sl(e,t,r,i=1){return r.roughness*i*(Wy(r)*(t-e)+e)}function Re(e,t,r=1){return Sl(-e,e,t,r)}function Ga(e,t,r,i,a,o=!1){const s=o?a.disableMultiStrokeFill:a.disableMultiStroke,n=Lh(e,t,r,i,a,!0,!1);if(s)return n;const l=Lh(e,t,r,i,a,!0,!0);return n.concat(l)}function Lh(e,t,r,i,a,o,s){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=a.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*Wy(a);let f=a.bowing*a.maxRandomnessOffset*(i-t)/200,p=a.bowing*a.maxRandomnessOffset*(e-r)/200;f=Re(f,a,c),p=Re(p,a,c);const g=[],m=()=>Re(d,a,c),y=()=>Re(h,a,c),x=a.preserveVertices;return s?g.push({op:"move",data:[e+(x?0:m()),t+(x?0:m())]}):g.push({op:"move",data:[e+(x?0:Re(h,a,c)),t+(x?0:Re(h,a,c))]}),s?g.push({op:"bcurveTo",data:[f+e+(r-e)*u+m(),p+t+(i-t)*u+m(),f+e+2*(r-e)*u+m(),p+t+2*(i-t)*u+m(),r+(x?0:m()),i+(x?0:m())]}):g.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),p+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),p+t+2*(i-t)*u+y(),r+(x?0:y()),i+(x?0:y())]}),g}function An(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+Re(t,r),e[0][1]+Re(t,r)]),i.push([e[0][0]+Re(t,r),e[0][1]+Re(t,r)]);for(let a=1;a<e.length;a++)i.push([e[a][0]+Re(t,r),e[a][1]+Re(t,r)]),a===e.length-1&&i.push([e[a][0]+Re(t,r),e[a][1]+Re(t,r)]);return vl(i,null,r)}function vl(e,t,r){const i=e.length,a=[];if(i>3){const o=[],s=1-r.curveTightness;a.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(s*e[n+1][0]-s*e[n-1][0])/6,l[1]+(s*e[n+1][1]-s*e[n-1][1])/6],o[2]=[e[n+1][0]+(s*e[n][0]-s*e[n+2][0])/6,e[n+1][1]+(s*e[n][1]-s*e[n+2][1])/6],o[3]=[e[n+1][0],e[n+1][1]],a.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}}else i===3?(a.push({op:"move",data:[e[1][0],e[1][1]]}),a.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&a.push(...Lh(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return a}function tg(e,t,r,i,a,o,s,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+a*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+a*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+a*Math.sin(0)]),c.push([t+i*Math.cos(e),r+a*Math.sin(e)])}else{const h=Re(.5,n)-Math.PI/2;c.push([Re(o,n)+t+.9*i*Math.cos(h-e),Re(o,n)+r+.9*a*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[Re(o,n)+t+i*Math.cos(u),Re(o,n)+r+a*Math.sin(u)];l.push(f),c.push(f)}c.push([Re(o,n)+t+i*Math.cos(h+2*Math.PI+.5*s),Re(o,n)+r+a*Math.sin(h+2*Math.PI+.5*s)]),c.push([Re(o,n)+t+.98*i*Math.cos(h+s),Re(o,n)+r+.98*a*Math.sin(h+s)]),c.push([Re(o,n)+t+.9*i*Math.cos(h+.5*s),Re(o,n)+r+.9*a*Math.sin(h+.5*s)])}return[c,l]}function eg(e,t,r,i,a,o,s,n,l){const c=o+Re(.1,l),h=[];h.push([Re(n,l)+t+.9*i*Math.cos(c-e),Re(n,l)+r+.9*a*Math.sin(c-e)]);for(let d=c;d<=s;d+=e)h.push([Re(n,l)+t+i*Math.cos(d),Re(n,l)+r+a*Math.sin(d)]);return h.push([t+i*Math.cos(s),r+a*Math.sin(s)]),h.push([t+i*Math.cos(s),r+a*Math.sin(s)]),vl(h,null,l)}function uT(e,t,r,i,a,o,s,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(u?0:Re(c[0],n)),s[1]+(u?0:Re(c[0],n))]}),h=u?[a,o]:[a+Re(c[f],n),o+Re(c[f],n)],l.push({op:"bcurveTo",data:[e+Re(c[f],n),t+Re(c[f],n),r+Re(c[f],n),i+Re(c[f],n),h[0],h[1]]});return l}function Ls(e){return[...e]}function rg(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ls(e[0]),Ls(e[1]),Ls(e[2]),Ls(e[2]));else{const a=[];a.push(e[0],e[0]);for(let n=1;n<e.length;n++)a.push(e[n]),n===e.length-1&&a.push(e[n]);const o=[],s=1-t;i.push(Ls(a[0]));for(let n=1;n+2<a.length;n++){const l=a[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(s*a[n+1][0]-s*a[n-1][0])/6,l[1]+(s*a[n+1][1]-s*a[n-1][1])/6],o[2]=[a[n+1][0]+(s*a[n][0]-s*a[n+2][0])/6,a[n+1][1]+(s*a[n][1]-s*a[n+2][1])/6],o[3]=[a[n+1][0],a[n+1][1]],i.push(o[1],o[2],o[3])}}return i}function Qn(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function fT(e,t,r){const i=Qn(t,r);if(i===0)return Qn(e,t);let a=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return a=Math.max(0,Math.min(1,a)),Qn(e,oo(t,r,a))}function oo(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Ah(e,t,r,i){const a=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let p=3*h[1]-2*c[1]-u[1];p*=p;let g=3*d[0]-2*u[0]-c[0];g*=g;let m=3*d[1]-2*u[1]-c[1];return m*=m,f<g&&(f=g),p<m&&(p=m),f+p})(e,t)<r){const n=e[t+0];a.length?(o=a[a.length-1],s=n,Math.sqrt(Qn(o,s))>1&&a.push(n)):a.push(n),a.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=oo(l,c,.5),f=oo(c,h,.5),p=oo(h,d,.5),g=oo(u,f,.5),m=oo(f,p,.5),y=oo(g,m,.5);Ah([l,u,g,y],0,r,a),Ah([y,m,p,d],0,r,a)}var o,s;return a}function gT(e,t){return Ml(e,0,e.length,t)}function Ml(e,t,r,i,a){const o=a||[],s=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=fT(e[h],s,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Ml(e,t,c+1,i,o),Ml(e,c,r,i,o)):(o.length||o.push(s),o.push(n)),o}function Hc(e,t=.15,r){const i=[],a=(e.length-1)/3;for(let o=0;o<a;o++)Ah(e,3*o,t,i);return r&&r>0?Ml(i,0,i.length,r):i}const gi="none";class Tl{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,a,o){const s=this._o(o);return this._d("line",[Ny(t,r,i,a,s)],s)}rectangle(t,r,i,a,o){const s=this._o(o),n=[],l=dT(t,r,i,a,s);if(s.fill){const c=[[t,r],[t+i,r],[t+i,r+a],[t,r+a]];s.fillStyle==="solid"?n.push(zc([c],s)):n.push(Lo([c],s))}return s.stroke!==gi&&n.push(l),this._d("rectangle",n,s)}ellipse(t,r,i,a,o){const s=this._o(o),n=[],l=qy(i,a,s),c=_h(t,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=_h(t,r,s,l).opset;h.type="fillPath",n.push(h)}else n.push(Lo([c.estimatedPoints],s));return s.stroke!==gi&&n.push(c.opset),this._d("ellipse",n,s)}circle(t,r,i,a){const o=this.ellipse(t,r,i,i,a);return o.shape="circle",o}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Kn(t,!1,i)],i)}arc(t,r,i,a,o,s,n=!1,l){const c=this._o(l),h=[],d=Kf(t,r,i,a,o,s,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=Kf(t,r,i,a,o,s,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,p,g,m,y,x){const C=u,k=f;let v=Math.abs(p/2),T=Math.abs(g/2);v+=Re(.01*v,x),T+=Re(.01*T,x);let F=m,A=y;for(;F<0;)F+=2*Math.PI,A+=2*Math.PI;A-F>2*Math.PI&&(F=0,A=2*Math.PI);const M=(A-F)/x.curveStepCount,B=[];for(let $=F;$<=A;$+=M)B.push([C+v*Math.cos($),k+T*Math.sin($)]);return B.push([C+v*Math.cos(A),k+T*Math.sin(A)]),B.push([C,k]),Lo([B],x)})(t,r,i,a,o,s,c));return c.stroke!==gi&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),a=[],o=Zf(t,i);if(i.fill&&i.fill!==gi)if(i.fillStyle==="solid"){const s=Zf(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?s.push(...c):c.length===3?s.push(...Hc(rg([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):s.push(...Hc(rg(c),10,(1+i.roughness)/2))}s.length&&a.push(Lo([s],i))}return i.stroke!==gi&&a.push(o),this._d("curve",a,i)}polygon(t,r){const i=this._o(r),a=[],o=Kn(t,!0,i);return i.fill&&(i.fillStyle==="solid"?a.push(zc([t],i)):a.push(Lo([t],i))),i.stroke!==gi&&a.push(o),this._d("polygon",a,i)}path(t,r){const i=this._o(r),a=[];if(!t)return this._d("path",a,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=i.fill&&i.fill!=="transparent"&&i.fill!==gi,s=i.stroke!==gi,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=Ry(Oy(Zd(h))),p=[];let g=[],m=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...Hc(y,d)),y=[]},C=()=>{x(),g.length&&(p.push(g),g=[])};for(const{key:v,data:T}of f)switch(v){case"M":C(),m=[T[0],T[1]],g.push(m);break;case"L":x(),g.push([T[0],T[1]]);break;case"C":if(!y.length){const F=g.length?g[g.length-1]:m;y.push([F[0],F[1]])}y.push([T[0],T[1]]),y.push([T[2],T[3]]),y.push([T[4],T[5]]);break;case"Z":x(),g.push([m[0],m[1]])}if(C(),!u)return p;const k=[];for(const v of p){const T=gT(v,u);T.length&&k.push(T)}return k})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=Qf(t,i);if(o)if(i.fillStyle==="solid")if(l.length===1){const h=Qf(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else a.push(zc(l,i));else a.push(Lo(l,i));return s&&(n?l.forEach((h=>{a.push(Kn(h,!1,i))})):a.push(c)),this._d("path",a,i)}opsToPath(t,r){let i="";for(const a of t.ops){const o=typeof r=="number"&&r>=0?a.data.map((s=>+s.toFixed(r))):a.data;switch(a.op){case"move":i+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":i+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":i+=`L${o[0]} ${o[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,a=[];for(const o of r){let s=null;switch(o.type){case"path":s={d:this.opsToPath(o),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:gi};break;case"fillPath":s={d:this.opsToPath(o),stroke:gi,strokeWidth:0,fill:i.fill||gi};break;case"fillSketch":s=this.fillSketch(o,i)}s&&a.push(s)}return a}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||gi,strokeWidth:i,fill:gi}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class pT{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Tl(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),a=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":a.save(),a.strokeStyle=i.stroke==="none"?"transparent":i.stroke,a.lineWidth=i.strokeWidth,i.strokeLineDash&&a.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(a.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(a,s,o),a.restore();break;case"fillPath":{a.save(),a.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(a,s,o,n),a.restore();break}case"fillSketch":this.fillSketch(a,s,i)}}fillSketch(t,r,i){let a=i.fillWeight;a<0&&(a=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=a,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,a="nonzero"){t.beginPath();for(const o of r.ops){const s=typeof i=="number"&&i>=0?o.data.map((n=>+n.toFixed(i))):o.data;switch(o.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(a):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,a,o){const s=this.gen.line(t,r,i,a,o);return this.draw(s),s}rectangle(t,r,i,a,o){const s=this.gen.rectangle(t,r,i,a,o);return this.draw(s),s}ellipse(t,r,i,a,o){const s=this.gen.ellipse(t,r,i,a,o);return this.draw(s),s}circle(t,r,i,a){const o=this.gen.circle(t,r,i,a);return this.draw(o),o}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,a,o,s,n=!1,l){const c=this.gen.arc(t,r,i,a,o,s,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Fn="http://www.w3.org/2000/svg";class mT{constructor(t,r){this.svg=t,this.gen=new Tl(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,o=a.createElementNS(Fn,"g"),s=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=a.createElementNS(Fn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=a.createElementNS(Fn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(a,n,i)}l&&o.appendChild(l)}return o}fillSketch(t,r,i){let a=i.fillWeight;a<0&&(a=i.strokeWidth/2);const o=t.createElementNS(Fn,"path");return o.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),o.setAttribute("stroke",i.fill||""),o.setAttribute("stroke-width",a+""),o.setAttribute("fill","none"),i.fillLineDash&&o.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,a,o){const s=this.gen.line(t,r,i,a,o);return this.draw(s)}rectangle(t,r,i,a,o){const s=this.gen.rectangle(t,r,i,a,o);return this.draw(s)}ellipse(t,r,i,a,o){const s=this.gen.ellipse(t,r,i,a,o);return this.draw(s)}circle(t,r,i,a){const o=this.gen.circle(t,r,i,a);return this.draw(o)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,a,o,s,n=!1,l){const c=this.gen.arc(t,r,i,a,o,s,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var Vt={canvas:(e,t)=>new pT(e,t),svg:(e,t)=>new mT(e,t),generator:e=>new Tl(e),newSeed:()=>Tl.newSeed()},yT=1,xT=3;async function Kd(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!Qd(e);await Promise.all([...t].map(i=>new Promise(a=>{function o(){if(i.style.display="flex",i.style.flexDirection="column",r){const s=Xe().fontSize?Xe().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[l=ud.fontSize]=Wl(s),c=l*n+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";a(i)}b(o,"setupImage"),setTimeout(()=>{i.complete&&o()}),i.addEventListener("error",o),i.addEventListener("load",o)})))}b(Kd,"configureLabelImages");function Qd(e){return e.nodeType===xT?e.textContent?.trim()!=="":e.nodeType!==yT||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(Qd)}b(Qd,"hasTextBesidesImages");var ig=3,bT=32,CT=b(async(e,t,r)=>{const i=Xe(),a=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",Rr(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),l=t.width?Math.max(t.width-2*(t.padding??0),bT):Xe().flowchart?.wrappingWidth??200,h=i.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async y=>{const x=o.append("g").attr("class",y.cssClass),C=await mi(x,Ti(ja(y.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},i);return He(C).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),He(C).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),u=Math.max(...d.map(({box:y})=>y.width),0);let f=0;for(const{el:y,box:x}of d)y.attr("transform",`translate(${u/2-x.x-x.width/2}, ${f-x.y})`),f+=x.height+ig;const p=d.length>0?f-ig:0;o.insert("rect",":first-child"),o.attr("transform",`translate(${-u/2}, ${-p/2})`);const g=o.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:a,bbox:g,halfPadding:m,label:o}},"c4LabelHelper"),ag=b((e,t)=>{const{x:r,y:i,width:a,height:o}=e;return a>=t?e:"left"in e?{x:r,y:i,width:t,height:o,top:i,left:r,bottom:i+o,right:r+t,toJSON:b(()=>({}),"toJSON")}:{x:r-(t-a)/2,y:i,width:t,height:o}},"withMinWidth"),he=b(async(e,t,r,{ignoreMinWidth:i=!1}={})=>{if(t.stereotype!==void 0)return CT(e,t,r);let a;const o=t.useHtmlLabels||ca(Xe()?.htmlLabels);r?a=r:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",Rr(t.labelStyle));let l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];const c=!!t.icon||!!t.img,h=t.labelType==="markdown",d=l&&!t.width&&!i?t.minWidth??0:0,u=await mi(n,Ti(ja(l),Xe()),{useHtmlLabels:o,width:t.width||t.wrappingWidth||Xe().flowchart?.wrappingWidth,minWidth:d,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:c,markdown:h},Xe()),f=(t?.padding??0)/2;let p;if(o){const g=u.children[0],m=He(u);await Kd(g),p=await Co.measure(()=>g.getBoundingClientRect()),p=ag(p,d),m.attr("width",p.width),m.attr("height",p.height)}else p=await Co.measure(()=>u.getBBox()),p=ag(p,d);return o?n.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):n.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:p,halfPadding:f,label:n}},"labelHelper"),fo=b(async(e,t,r)=>{const i=r.useHtmlLabels??zr(Xe()),a=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),o=await mi(a,Ti(ja(t),Xe()),{useHtmlLabels:i,width:r.width||Xe()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=r.padding/2;let n;if(zr(Xe())){const l=o.children[0],c=He(o);n=await Co.measure(()=>l.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await Co.measure(()=>o.getBBox());return i?a.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):a.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&a.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:s,label:a}},"insertLabel"),ee=b((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}const i=t.node().getBBox();e.width=i.width,e.height=i.height},"updateNodeBounds"),se=b((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function rr(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}b(rr,"createPathFromPoints");function Ua(e,t,r,i,a,o){const s=[],l=r-e,c=i-t,h=l/o,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const p=f/50,g=e+p*l,m=u+a*Math.sin(d*(g-e));s.push({x:g,y:m})}return s}b(Ua,"generateFullSineWavePoints");function Ji(e,t,r,i,a,o){const s=[],n=a*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:-f,y:-p})}return s}b(Ji,"generateCirclePoints");function Fh(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const a=t.find(l=>l.getAttribute("fill")!=="none"),o=t.find(l=>l.getAttribute("stroke")!=="none"),s=b((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(a){const l={fill:s(a,"fill"),"fill-opacity":s(a,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(o){const l={stroke:s(o,"stroke"),"stroke-width":s(o,"stroke-width")??"1","stroke-opacity":s(o,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}b(Fh,"mergePaths");var wT=b((e,t)=>{var r=e.x,i=e.y,a=t.x-r,o=t.y-i,s=e.width/2,n=e.height/2,l,c;return Math.abs(o)*s>Math.abs(a)*n?(o<0&&(n=-n),l=o===0?0:n*a/o,c=n):(a<0&&(s=-s),l=s,c=a===0?0:s*o/a),{x:r+l,y:i+c}},"intersectRect"),Ea=wT;function zy(e,t){return e.intersect(t)}b(zy,"intersectNode");var kT=zy;function Hy(e,t,r,i){var a=e.x,o=e.y,s=a-i.x,n=o-i.y,l=Math.sqrt(t*t*n*n+r*r*s*s),c=Math.abs(t*r*s/l);i.x<a&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<o&&(h=-h),{x:a+c,y:o+h}}b(Hy,"intersectEllipse");var Yy=Hy;function Xy(e,t,r){return Yy(e,t,t,r)}b(Xy,"intersectCircle");var ST=Xy;function jy(e,t,r,i){{const a=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,n=a*r.x+o*r.y+s,l=a*i.x+o*i.y+s,c=1e-6;if(n!==0&&l!==0&&$h(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,p=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(p)<c&&$h(f,p))return;const g=a*d-h*o;if(g===0)return;const m=(o*u-d*s)/g,y=(h*s-a*u)/g;return{x:m,y}}}b(jy,"intersectLine");function $h(e,t){return e*t>0}b($h,"sameSign");var vT=jy;function Gy(e,t,r){let i=e.x,a=e.y,o=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){s=Math.min(s,h.x),n=Math.min(n,h.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));let l=i-e.width/2-s,c=a-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=vT(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&o.push(f)}return o.length?(o.length>1&&o.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,p=Math.sqrt(u*u+f*f),g=d.x-r.x,m=d.y-r.y,y=Math.sqrt(g*g+m*m);return p<y?-1:p===y?0:1}),o[0]):e}b(Gy,"intersectPolygon");var MT=Gy,Ht={node:kT,circle:ST,ellipse:Yy,polygon:MT,rect:Ea},yi=b((e,t,r,i,a)=>["M",e+a,t,"H",e+r-a,"A",a,a,0,0,1,e+r,t+a,"V",t+i-a,"A",a,a,0,0,1,e+r-a,t+i,"H",e+a,"A",a,a,0,0,1,e,t+i-a,"V",t+a,"A",a,a,0,0,1,e+a,t,"Z"].join(" "),"createRoundedRectPathD"),TT=b(async(e,t,r,i=!1,a=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);const s=Xe(),n=zr(s);return await mi(e,o,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:a,width:Number.POSITIVE_INFINITY},s)},"createLabel"),wa=TT;function Uy(e,t){const{labelStyles:r}=Gt(t);t.labelStyle=r;const i=se(t);let a=i;i||(a="anchor");const o=e.insert("g").attr("class",a).attr("id",t.domId||t.id),s=1,{cssStyles:n}=t,l=Vt.svg(o),c=jt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,s*2,c),d=o.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Rr(n)),ee(t,d),t.intersect=function(u){return Tt.info("Circle intersect",t,s,u),Ht.circle(t,s,u)},o}b(Uy,"anchor");function Eh(e,t,r,i,a,o,s){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/a,p=u/o,g=Math.sqrt(f**2+p**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");const m=Math.sqrt(1-g**2),y=l+m*o*Math.sin(h)*(s?-1:1),x=c-m*a*Math.cos(h)*(s?-1:1),C=Math.atan2((t-x)/o,(e-y)/a);let v=Math.atan2((i-x)/o,(r-y)/a)-C;s&&v<0&&(v+=2*Math.PI),!s&&v>0&&(v-=2*Math.PI);const T=[];for(let F=0;F<20;F++){const A=F/19,M=C+A*v,B=y+a*Math.cos(M),$=x+o*Math.sin(M);T.push({x:B,y:$})}return T}b(Eh,"generateArcPoints");function Vy(e,t,r){const[i,a]=[t,r].sort((o,s)=>s-o);return a*(1-Math.sqrt(1-(e/i/2)**2))}b(Vy,"calculateArcSagitta");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a,n=b(M=>M+s,"calcTotalHeight"),l=b(M=>{const B=M/2;return[B/(2.5+M/50),B]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),p=Vy(d,u,f),m=(t?.width?t?.width:h.width)+o*2+p-p,y=d,{cssStyles:x}=t,C=[{x:m/2,y:-y/2},{x:-m/2,y:-y/2},...Eh(-m/2,-y/2,-m/2,y/2,u,f,!1),{x:m/2,y:y/2},...Eh(m/2,y/2,m/2,-y/2,u,f,!0)],k=Vt.svg(c),v=jt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=rr(C),F=k.path(T,v),A=c.insert(()=>F,":first-child");return A.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(${u/2}, 0)`),ee(t,A),t.intersect=function(M){return Ht.polygon(t,C,M)},c}b(Zy,"bowTieRect");async function Ky(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{shapeSvg:o,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=Math.max(s.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(s.height+c*2+d,t.height??0),f=-u/2+d,p=u/2,g=h*.72,m=[`M${-h/2},${f}`,`L${-g/2},${p}`,`A${g/2},${d} 0 0 0 ${g/2},${p}`,`L${h/2},${f}`,`A${h/2},${d} 0 0 0 ${-h/2},${f}`,"Z"].join(" "),{cssStyles:y}=t,x=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const A=Vt.svg(o).path(m,jt(t,{}));x.node()?.appendChild(A),y&&x.attr("style",y)}else x.append("path").attr("d",m).attr("style",a);x.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),ee(t,x);const C=f+(p-f)/2;n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${C-s.height/2-(s.y-(s.top??0))})`);const k=12,v=b((F,A,M)=>Array.from({length:k+1},(B,$)=>{const P=Math.PI-$*Math.PI/k;return{x:F*Math.cos(P),y:A+M*d*Math.sin(P)}}),"arc"),T=[...v(h/2,f,-1),...v(g/2,p,1).reverse()];return t.intersect=function(F){return Ht.polygon(t,T,F)},o}b(Ky,"bucket");var og=20,sg=8,BT=80,_T=8;function Qy(e){const{themeVariables:t}=Xe(),r=t.clusterBkg,i=t.clusterBorder;switch(e){case"flow":return{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"};default:return{rx:_T,fill:r,stroke:i,cssClass:"collapsed-group"}}}b(Qy,"getCollapsedStyle");async function Jy(e,t){const r=Qy(t.metadata?.containerType),{fill:i,stroke:a}=r,{nodeStyles:o}=Gt(t),{shapeSvg:s,bbox:n}=await he(e,t,se(t)),{theme:l,themeVariables:c}=Xe();Li(s,t.colorIndex,l,c.borderColorArray);const h=t.padding??8,d=n.height,u=Math.max(n.width+h*2,BT,t?.width??0),f=Math.max(d+sg+og+h*2,t?.height??0),p=-u/2,g=-f/2,m=-28/2,y=s.select(".label");y&&(t.useHtmlLabels??zr(Xe())?y.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):y.attr("transform",`translate(0, ${-n.height/2+m})`));let x;if(t.look==="handDrawn"){const F=Vt.svg(s),A=jt(t,{fill:i,stroke:a,...r.strokeWidth===void 0?{}:{strokeWidth:r.strokeWidth},...i==="none"?{fillWeight:0}:{fillStyle:"solid"}}),M=F.path(yi(p,g,u,f,r.rx),A);x=s.insert(()=>M,":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",Rr(t.cssStyles))}else x=s.insert("rect",":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",o).attr("rx",r.rx).attr("ry",r.rx).attr("x",p).attr("y",g).attr("width",u).attr("height",f).attr("fill",i).attr("stroke",a),r.strokeWidth!==void 0&&x.attr("stroke-width",r.strokeWidth+"px");const C=g+h+d+sg;s.append("line").attr("class","collapsed-separator").attr("x1",p+8).attr("y1",C).attr("x2",p+u-8).attr("y2",C).attr("stroke",a).attr("stroke-dasharray","3, 3");const k=C+og/2,v=2.5,T=10;for(let F=-1;F<=1;F++)s.append("circle").attr("class","collapsed-indicator").attr("cx",F*T).attr("cy",k).attr("r",v).attr("fill",a);return ee(t,x),t.calcIntersect=function(F,A){return Ht.rect(F,A)},t.intersect=function(F){return Ht.rect(t,F)},s}b(Jy,"collapsedGroup");function ha(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}b(ha,"insertPolygonShape");var LT=["right","left","up","down"],Jd="point",AT=b(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),FT=b(e=>LT.filter(t=>e.has(t)).join("|")||Jd,"getDirectionKey"),ng={"right|left|up|down":b(({height:e,midpoint:t,padding:r,width:i})=>[{x:0,y:0},{x:t,y:0},{x:i/2,y:2*r},{x:i-t,y:0},{x:i,y:0},{x:i,y:-e/3},{x:i+2*r,y:-e/2},{x:i,y:-2*e/3},{x:i,y:-e},{x:i-t,y:-e},{x:i/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":b(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":b(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":b(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":b(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":b(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"up|down"),"right|up":b(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":b(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":b(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":b(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r}],"up"),down:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"down"),[Jd]:()=>[{x:0,y:0}]},$T=b((e,t,r,i)=>{const a=AT(e),o=(r.padding??0)/2,s=t.height+4*o,n=s/2,l=i??t.width+2*n+2*o,c=FT(a);return(ng[c]??ng[Jd])({height:s,midpoint:n,padding:o,width:l})},"getArrowPoints");async function tx(e,t){const r=t,{shapeSvg:i,bbox:a}=await he(e,r,se(r)),o=r.padding??0,s=a.height+2*o,n=s/2,l=a.width+2*n+o,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>l?c:l,u=$T(r.directions??[],a,r,d),f=ha(i,d,s,u);return f.attr("style",r.style??null),ee(r,f),r.intersect=function(p){return Ht.polygon(r,u,p)},i}b(tx,"block_arrow");async function ex(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{shapeSvg:o,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),p=-f/2,{cssStyles:g}=t,m=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const C=Vt.svg(o).path(yi(-u/2,p,u,f,d),jt(t,{}));m.node()?.appendChild(C),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",p).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",a);m.append("line").attr("x1",-u/2).attr("y1",p+h).attr("x2",u/2).attr("y2",p+h).attr("style",`stroke:${l};stroke-width:1px`);for(let x=0;x<3;x++)m.append("circle").attr("cx",-u/2+12+x*9).attr("cy",p+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",p+4).attr("width",Math.max(u-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),ee(t,m);const y=p+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Ht.rect(t,x)},o}b(ex,"browser");var $n=12;async function rx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?28:a,s=t.look==="neo"?24:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.width??l.width)+(t.look==="neo"?o*2:o+$n),h=(t?.height??l.height)+(t.look==="neo"?s*2:s),d=0,u=c,f=-h,p=0,g=[{x:d+$n,y:f},{x:u,y:f},{x:u,y:p},{x:d,y:p},{x:d,y:f+$n},{x:d+$n,y:f}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Vt.svg(n),C=jt(t,{}),k=rr(g),v=x.path(k,C);m=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),y&&m.attr("style",y)}else m=ha(n,c,h,g);return i&&m.attr("style",i),ee(t,m),t.intersect=function(x){return Ht.polygon(t,g,x)},n}b(rx,"card");function ix(e,t){const{nodeStyles:r}=Gt(t);t.label="";const i=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(28,t.width??0),s=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],n=Vt.svg(i),l=jt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=rr(s),h=n.path(c,l),d=i.insert(()=>h,":first-child");return a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return Ht.polygon(t,s,u)},i}b(ix,"choice");async function tu(e,t,r){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{shapeSvg:o,bbox:s,halfPadding:n}=await he(e,t,se(t),{ignoreMinWidth:!0}),l=16,c=r?.padding??n,h=Math.sqrt(s.width**2+s.height**2)/2,d=t.look==="neo"?h+l:h+c;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(o),g=jt(t,{}),m=p.circle(0,0,d*2,g);u=o.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",Rr(f))}else u=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",a).attr("r",d).attr("cx",0).attr("cy",0);return ee(t,u),t.calcIntersect=function(p,g){const m=p.width/2;return Ht.circle(p,m,g)},t.intersect=function(p){return Tt.info("Circle intersect",t,d,p),Ht.circle(t,d,p)},o}b(tu,"circle");async function ax(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:a,bbox:o,halfPadding:s}=await he(e,r,i),n=a.insert("rect",":first-child"),l=r.padding??0,c=r.positioned?r.width??0:o.width+l,h=r.positioned?r.height??0:o.height+l,d=r.positioned?-c/2:-o.width/2-s,u=r.positioned?-h/2:-o.height/2-s;return n.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",h),ee(r,n),r.intersect=function(f){return Ht.rect(r,f)},a}b(ax,"composite");async function ox(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{shapeSvg:o,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),p=-f/2,{cssStyles:g}=t,m=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const C=Vt.svg(o).path(yi(-u/2,p,u,f,d),jt(t,{}));m.node()?.appendChild(C),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",p).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",a);m.append("text").attr("x",-u/2+12).attr("y",p+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),ee(t,m);const y=p+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Ht.rect(t,x)},o}b(ox,"consoleWindow");function sx(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,a={x:i/2*t,y:i/2*r},o={x:-(i/2)*t,y:i/2*r},s={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${o.x},${o.y} L ${n.x},${n.y}
232
- M ${a.x},${a.y} L ${s.x},${s.y}`}b(sx,"createLine");function nx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r,t.label="";const a=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:s}=t,n=Vt.svg(a),l=jt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,o*2,l),h=sx(o),d=n.path(h,l),u=a.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),s&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),ee(t,u),t.intersect=function(f){return Tt.info("crossedCircle intersect",t,{radius:o,point:f}),Ht.circle(t,o,f)},a}b(nx,"crossedCircle");function ma(e,t,r,i=100,a=0,o=180){const s=[],n=a*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:-f,y:-p})}return s}b(ma,"generateCirclePoints");async function lx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+n,h=o.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...ma(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...ma(c/2+d*2,-d,d,20,-180,-270),...ma(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...ma(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...ma(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...ma(c/2+c*.1,-d,d,20,-180,-270),...ma(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...ma(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],g=Vt.svg(a),m=jt(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=rr(f).replace("Z",""),C=g.path(x,m),k=rr(p),v=g.path(k,{...m}),T=a.insert("g",":first-child");return T.insert(()=>v,":first-child").attr("stroke-opacity",0),T.insert(()=>C,":first-child"),T.attr("class","text"),u&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-c/2+d-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ee(t,T),t.intersect=function(F){return Ht.polygon(t,p,F)},a}b(lx,"curlyBraceLeft");function ya(e,t,r,i=100,a=0,o=180){const s=[],n=a*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:f,y:p})}return s}b(ya,"generateCirclePoints");async function cx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...ya(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...ya(c/2+d*2,-d,d,20,-180,-270),...ya(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...ya(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...ya(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...ya(c/2+d*2,-d,d,20,-180,-270),...ya(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...ya(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],g=Vt.svg(a),m=jt(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=rr(f).replace("Z",""),C=g.path(x,m),k=rr(p),v=g.path(k,{...m}),T=a.insert("g",":first-child");return T.insert(()=>v,":first-child").attr("stroke-opacity",0),T.insert(()=>C,":first-child"),T.attr("class","text"),u&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ee(t,T),t.intersect=function(F){return Ht.polygon(t,p,F)},a}b(cx,"curlyBraceRight");function Hr(e,t,r,i=100,a=0,o=180){const s=[],n=a*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:-f,y:-p})}return s}b(Hr,"generateCirclePoints");async function hx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Hr(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Hr(c/2+d*2,-d,d,20,-180,-270),...Hr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Hr(c/2,h/2,d,20,0,90)],p=[...Hr(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Hr(-c/2-d/2,-d,d,20,0,90),...Hr(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Hr(-c/2+d+d/2,h/2,d,30,-180,-270)],g=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Hr(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Hr(c/2+d*2,-d,d,20,-180,-270),...Hr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Hr(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...Hr(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Hr(-c/2-d/2,-d,d,20,0,90),...Hr(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Hr(-c/2+d+d/2,h/2,d,30,-180,-270)],m=Vt.svg(a),y=jt(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=rr(f).replace("Z",""),k=m.path(C,y),T=rr(p).replace("Z",""),F=m.path(T,y),A=rr(g),M=m.path(A,{...y}),B=a.insert("g",":first-child");return B.insert(()=>M,":first-child").attr("stroke-opacity",0),B.insert(()=>k,":first-child"),B.insert(()=>F,":first-child"),B.attr("class","text"),u&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ee(t,B),t.intersect=function($){return Ht.polygon(t,g,$)},a}b(hx,"curlyBraces");async function dx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a,n=20,l=5,{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=Math.max(l,h.height+s*2,t?.height??0),u=d/2,f=u-Math.sqrt(Math.max(0,u**2-(h.height/2)**2)),p=Math.max(d/4,f),g=Math.max(n,h.width+o*2+p*2,(h.width+o*2)*1.25,t?.width??0),{cssStyles:m}=t,y=Vt.svg(c),x=jt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=g,k=d,v=C-u,T=k/4,F=[{x:v,y:0},{x:T,y:0},{x:0,y:k/2},{x:T,y:k},{x:v,y:k},...Ji(-v,-k/2,u,50,270,90)],A=rr(F),M=y.path(A,x),B=c.insert(()=>M,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-g/2}, ${-d/2})`),ee(t,B),t.intersect=function($){return Ht.polygon(t,F,$)},c}b(dx,"curvedTrapezoid");async function ux(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=t.padding??20,l=Math.max(o.width+n*2,t.width??0,100),c=Math.min(Math.max(l*.23,16),56),h=c*.27,d=Math.max(o.height+n*2,t.height?t.height-(2*c-h):0),u=Math.min(l*.177,d*.45),f=d+2*c-h,p=-f/2,g=p+2*c-h,m=a.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:y}=t;if(t.look==="handDrawn"){const A=Vt.svg(a),M=jt(t,{}),B=A.path(yi(-l/2,g,l,d,u),M),$=A.circle(0,p+c,c*2,M);m.insert(()=>$,":first-child"),m.insert(()=>B,":first-child"),y&&m.attr("style",y)}else m.append("rect").attr("x",-l/2).attr("y",g).attr("width",l).attr("height",d).attr("rx",u).attr("ry",u).attr("style",i),m.append("circle").attr("cx",0).attr("cy",p+c).attr("r",c).attr("style",i);ee(t,m);const x=g+d/2;s.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${x-o.height/2-(o.y-(o.top??0))})`);const C=p+c,k=Math.asin(Math.min(1,(g-C)/c))*180/Math.PI,F=[...Ji(0,-C,c,24,180+k,-k),...Ji(-(-l/2+u),-(g+u),u,12,90,0),...Ji(-(-l/2+u),-(f/2-u),u,12,360,270),...Ji(-(l/2-u),-(f/2-u),u,12,270,180),...Ji(-(l/2-u),-(g+u),u,12,180,90)];return t.intersect=function(A){return Ht.polygon(t,F,A)},a}b(ux,"person");var ET=b((e,t,r,i,a,o)=>[`M${e},${t+o}`,`a${a},${o} 0,0,0 ${r},0`,`a${a},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${o} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),PT=b((e,t,r,i,a,o)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${a},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${o} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),IT=b((e,t,r,i,a,o)=>[`M${e-r/2},${-i/2}`,`a${a},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),lg=8,cg=8;async function fx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?24:a,s=t.look==="neo"?24:a,n=t.width??0;if(t.width&&(t.width=t.width-s,t.width<cg&&(t.width=cg)),t.height){const x=n/2/(2.5+n/50);t.height=t.height-o-x*3,t.height<lg&&(t.height=lg)}const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=Math.max(t.width??0,c.width)+s,u=d/2,f=u/(2.5+d/50),p=Math.max(t.height??0,c.height)+o+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Vt.svg(l),x=PT(0,0,d,p,u,f),C=IT(0,f,d,p,u,f),k=jt(t,{}),v=y.path(x,k),T=y.path(C,jt(t,{fill:"none"}));g=l.insert(()=>T,":first-child"),g=l.insert(()=>v,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=ET(0,0,d,p,u,f);g=l.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Rr(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-d/2}, ${-(p/2+f)})`),ee(t,g),h.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(y){const x=Ht.rect(t,y),C=x.x-(t.x??0);if(u!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-C*C/(u*u));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},l}b(fx,"cylinder");async function Cs(e,t,r){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{shapeSvg:o,bbox:s}=await he(e,t,se(t)),n=Math.max(s.width+r.labelPaddingX*2,t?.width||0),l=Math.max(s.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:u,ry:f}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const g=Vt.svg(o),m=jt(t,{}),y=u||f?g.path(yi(c,h,n,l,u||0),m):g.rectangle(c,h,n,l,m);d=o.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Rr(p))}else d=o.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",a).attr("rx",Rr(u)).attr("ry",Rr(f)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return ee(t,d,t.look==="handDrawn"?void 0:{width:n,height:l}),t.calcIntersect=function(g,m){return Ht.rect(g,m)},t.intersect=function(g){return Ht.rect(t,g)},o}b(Cs,"drawRect");async function gx(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:a,padding:o,width:s,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(o??0)*2,labelPaddingY:a??o??0},c=await Cs(e,t,l);if(t.look==="handDrawn"){const f=Vt.svg(c),p=jt(t,{}),g=c.select(".basic.label-container > path:nth-child(2)"),m=g.node();if(!m)return c;let y=null;if(m instanceof SVGGraphicsElement)y=m.getBBox();else return c;return c.insert(()=>f.line(y.x,y.y,y.x+y.width,y.y,p),".basic.label-container g.label"),c.insert(()=>f.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,p),".basic.label-container g.label"),g.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}b(gx,"datastore");async function px(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?16:t.padding??0,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=n.width+a,h=n.height+o,d=h*.2,u=-c/2,f=-h/2-d/2,{cssStyles:p}=t,g=Vt.svg(s),m=jt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],x=g.polygon(y.map(k=>[k.x,k.y]),m),C=s.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),l.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ee(t,C),t.intersect=function(k){return Ht.rect(t,k)},s}b(px,"dividedRectangle");async function mx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t),a=t.look==="neo"?12:5;t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t),{ignoreMinWidth:!0}),c=Math.sqrt(l.width**2+l.height**2)/2,h=(t?.width?t?.width/2:c)+(s??0),d=h+a;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=jt(t,{roughness:.2,strokeWidth:2.5}),m=jt(t,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,d*2,g),x=p.circle(0,0,h*2,m);u=n.insert("g",":first-child"),u.attr("class",Rr(t.cssClasses)).attr("style",Rr(f)),u.node()?.appendChild(y),u.node()?.appendChild(x)}else{u=n.insert("g",":first-child");const p=u.insert("circle",":first-child"),g=u.insert("circle");u.attr("class","basic label-container").attr("style",i),p.attr("class","outer-circle").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ee(t,u),t.intersect=function(p){return Tt.info("DoubleCircle intersect",t,d,p),Ht.circle(t,d,p)},n}b(mx,"doublecircle");async function yx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,halfPadding:s}=await he(e,t,se(t)),{theme:n,themeVariables:l}=Xe();Li(a,t.colorIndex,n,l.borderColorArray);const c=s??10,h=o.width/2+c*2,d=o.height/2+c*2;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(a),g=jt(t,{}),m=p.ellipse(0,0,h*2,d*2,g);u=a.insert(()=>m,":first-child"),u.attr("class","basic label-container"),f&&u.attr("style",f)}else u=a.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",i).attr("rx",h).attr("ry",d).attr("cx",0).attr("cy",0);return t.width=h*2,t.height=d*2,ee(t,u),t.calcIntersect=function(p,g){const m=p.width/2,y=p.height/2;return Ht.ellipse(p,m,y,g)},t.intersect=function(p){return Ht.ellipse(t,h,d,p)},a}b(yx,"usecaseEllipse");function xx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.label="",t.labelStyle=i;const o=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),s=7,{cssStyles:n}=t,l=Vt.svg(o),{nodeBorder:c}=r,h=jt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),u=o.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),ee(t,u),t.intersect=function(f){return Tt.info("filledCircle intersect",t,{radius:s,point:f}),Ht.circle(t,s,f)},o}b(xx,"filledCircle");var hg=10,dg=10;async function bx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?a*2:a;(t.width||t.height)&&(t.height=t?.height??0,t.height<hg&&(t.height=hg),t.width=(t?.width??0)-o-o/2,t.width<dg&&(t.width=dg));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width?t?.width:n.width)+(o??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,p=Vt.svg(s),g=jt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=rr(u),y=p.path(m,g),x=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),t.width=c,t.height=h,ee(t,x),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(C){return Tt.info("Triangle intersect",t,u,C),Ht.polygon(t,u,C)},s}b(bx,"flippedTriangle");async function Cx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=t.padding??12,l=Math.max(o.width+n*2,t.width??0,90),c=o.height+n*2,h=Math.max(Math.min(c*.16,14),8),d=Math.max(c+h,t.height??0),u=d-h,f=Math.max(l*.38,28),p=-d/2,g=[{x:-l/2,y:p},{x:-l/2+f,y:p},{x:-l/2+f,y:p+h},{x:l/2,y:p+h},{x:l/2,y:d/2},{x:-l/2,y:d/2}],m=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(k=>`L${k.x},${k.y}`),"Z"].join(" "),{cssStyles:y}=t;let x;if(t.look==="handDrawn"){const v=Vt.svg(a).path(m,jt(t,{}));x=a.insert(()=>v,":first-child").attr("class","basic label-container"),y&&x.attr("style",y)}else x=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",i);t.look==="handDrawn"?ee(t,x):ee(t,x,{width:l,height:d});const C=p+h+u/2;return s.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${C-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(k){return Ht.polygon(t,g,k)},a}b(Cx,"folder");function wx(e,t,{dir:r,config:{state:i,themeVariables:a}}){const{nodeStyles:o}=Gt(t);t.label="";const s=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);(r==="LR"||r==="RL")&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,u=Vt.svg(s),f=jt(t,{stroke:a.lineColor,fill:a.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=u.rectangle(h,d,l,c,f),g=s.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),ee(t,g);const m=i?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(y){return Ht.rect(t,y)},s}b(wx,"forkJoin");async function kx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=15,o=10,s=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<o&&(t.height=o),t.width=(t?.width??0)-s*2,t.width<a&&(t.width=a));const{shapeSvg:l,bbox:c}=await he(e,t,se(t)),h=(t?.height?t?.height:Math.max(o,c.height))+n*2,d=h/2,u=d-Math.sqrt(Math.max(0,d**2-(c.height/2)**2)),f=(t?.width?t?.width:Math.max(a,c.width)+u*2)+s*2,{cssStyles:p}=t,g=Vt.svg(l),m=jt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-f/2,y:-h/2},{x:f/2-d,y:-h/2},...Ji(-f/2+d,0,d,50,90,270),{x:f/2-d,y:h/2},{x:-f/2,y:h/2}],x=rr(y),C=g.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ee(t,k),t.intersect=function(v){return Tt.info("Pill intersect",t,{radius:d,point:v}),Ht.polygon(t,y,v)},l}b(kx,"halfRoundedRectangle");var OT=b((e,t,r,i,a)=>[`M${e+a},${t}`,`L${e+r-a},${t}`,`L${e+r},${t-i/2}`,`L${e+r-a},${t-i}`,`L${e+a},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Sx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t),a=t.look==="neo"?3.5:4;t.labelStyle=r;const o=t.padding??0,s=70,n=32,l=t.look==="neo"?s:o,c=t.look==="neo"?n:o;if(t.width||t.height){const C=(t.height??0)/a;t.width=(t?.width??0)-2*C-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await he(e,t,se(t)),u=(t?.height?t?.height:d.height)+l,f=u/a,p=(t?.width?t?.width:d.width)+2*f+c,g=[{x:f,y:0},{x:p-f,y:0},{x:p,y:-u/2},{x:p-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Vt.svg(h),C=jt(t,{}),k=OT(0,0,p,u,f),v=x.path(k,C);m=h.insert(()=>v,":first-child").attr("transform",`translate(${-p/2}, ${u/2})`),y&&m.attr("style",y)}else m=ha(h,p,u,g);return i&&m.attr("style",i),t.width=p,t.height=u,ee(t,m),t.intersect=function(x){return Ht.polygon(t,g,x)},h}b(Sx,"hexagon");async function vx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.label="",t.labelStyle=r;const{shapeSvg:a}=await he(e,t,se(t)),o=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:n}=t,l=Vt.svg(a),c=jt(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],d=rr(h),u=l.path(d,c),f=a.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-o/2}, ${-s/2})`),ee(t,f),t.intersect=function(p){return Tt.info("Pill intersect",t,{points:h}),Ht.polygon(t,h,p)},a}b(vx,"hourglass");async function Mx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=Gt(t);t.labelStyle=a;const o=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await he(e,t,"icon-shape default"),u=t.pos==="t",f=n,p=n,{nodeBorder:g}=r,{stylesMap:m}=Za(t),y=-p/2,x=-f/2,C=t.label?8:0,k=Vt.svg(c),v=jt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=k.rectangle(y,x,p,f,v),F=Math.max(p,h.width),A=f+h.height+C,M=k.rectangle(-F/2,-A/2,F,A,{...v,fill:"transparent",stroke:"none"}),B=c.insert(()=>T,":first-child"),$=c.insert(()=>M);if(t.icon){const P=c.append("g");P.html(`<g>${await So(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const I=P.node().getBBox(),_=I.width,E=I.height,L=I.x,q=I.y;P.attr("transform",`translate(${-_/2-L},${u?h.height/2+C/2-E/2-q:-h.height/2-C/2-E/2-q})`),P.attr("style",`color: ${m.get("stroke")??g};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-A/2:A/2-h.height})`),B.attr("transform",`translate(0,${u?h.height/2+C/2:-h.height/2-C/2})`),ee(t,$),t.intersect=function(P){if(Tt.info("iconSquare intersect",t,P),!t.label)return Ht.rect(t,P);const I=t.x??0,_=t.y??0,E=t.height??0;let L=[];return u?L=[{x:I-h.width/2,y:_-E/2},{x:I+h.width/2,y:_-E/2},{x:I+h.width/2,y:_-E/2+h.height+C},{x:I+p/2,y:_-E/2+h.height+C},{x:I+p/2,y:_+E/2},{x:I-p/2,y:_+E/2},{x:I-p/2,y:_-E/2+h.height+C},{x:I-h.width/2,y:_-E/2+h.height+C}]:L=[{x:I-p/2,y:_-E/2},{x:I+p/2,y:_-E/2},{x:I+p/2,y:_-E/2+f},{x:I+h.width/2,y:_-E/2+f},{x:I+h.width/2/2,y:_+E/2},{x:I-h.width/2,y:_+E/2},{x:I-h.width/2,y:_-E/2+f},{x:I-p/2,y:_-E/2+f}],Ht.polygon(t,L,P)},c}b(Mx,"icon");async function Tx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=Gt(t);t.labelStyle=a;const o=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await he(e,t,"icon-shape default"),u=20,f=t.label?8:0,p=t.pos==="t",{nodeBorder:g,mainBkg:m}=r,{stylesMap:y}=Za(t),x=Vt.svg(c),C=jt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=y.get("fill");C.stroke=k??m;const v=c.append("g");t.icon&&v.html(`<g>${await So(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const T=v.node().getBBox(),F=T.width,A=T.height,M=T.x,B=T.y,$=Math.max(F,A)*Math.SQRT2+u*2,P=x.circle(0,0,$,C),I=Math.max($,h.width),_=$+h.height+f,E=x.rectangle(-I/2,-_/2,I,_,{...C,fill:"transparent",stroke:"none"}),L=c.insert(()=>P,":first-child"),q=c.insert(()=>E);return v.attr("transform",`translate(${-F/2-M},${p?h.height/2+f/2-A/2-B:-h.height/2-f/2-A/2-B})`),v.attr("style",`color: ${y.get("stroke")??g};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-_/2:_/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+f/2:-h.height/2-f/2})`),ee(t,q),t.intersect=function(W){return Tt.info("iconSquare intersect",t,W),Ht.rect(t,W)},c}b(Tx,"iconCircle");async function Bx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=Gt(t);t.labelStyle=a;const o=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await he(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,g=n+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Za(t),C=-g/2,k=-p/2,v=t.label?8:0,T=Vt.svg(c),F=jt(t,{});t.look!=="handDrawn"&&(F.roughness=0,F.fillStyle="solid");const A=x.get("fill");F.stroke=A??y;const M=T.path(yi(C,k,g,p,5),F),B=Math.max(g,h.width),$=p+h.height+v,P=T.rectangle(-B/2,-$/2,B,$,{...F,fill:"transparent",stroke:"none"}),I=c.insert(()=>M,":first-child").attr("class","icon-shape2"),_=c.insert(()=>P);if(t.icon){const E=c.append("g");E.html(`<g>${await So(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const L=E.node().getBBox(),q=L.width,W=L.height,R=L.x,D=L.y;E.attr("transform",`translate(${-q/2-R},${f?h.height/2+v/2-W/2-D:-h.height/2-v/2-W/2-D})`),E.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-$/2:$/2-h.height})`),I.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),ee(t,_),t.intersect=function(E){if(Tt.info("iconSquare intersect",t,E),!t.label)return Ht.rect(t,E);const L=t.x??0,q=t.y??0,W=t.height??0;let R=[];return f?R=[{x:L-h.width/2,y:q-W/2},{x:L+h.width/2,y:q-W/2},{x:L+h.width/2,y:q-W/2+h.height+v},{x:L+g/2,y:q-W/2+h.height+v},{x:L+g/2,y:q+W/2},{x:L-g/2,y:q+W/2},{x:L-g/2,y:q-W/2+h.height+v},{x:L-h.width/2,y:q-W/2+h.height+v}]:R=[{x:L-g/2,y:q-W/2},{x:L+g/2,y:q-W/2},{x:L+g/2,y:q-W/2+p},{x:L+h.width/2,y:q-W/2+p},{x:L+h.width/2/2,y:q+W/2},{x:L-h.width/2,y:q+W/2},{x:L-h.width/2,y:q-W/2+p},{x:L-g/2,y:q-W/2+p}],Ht.polygon(t,R,E)},c}b(Bx,"iconRounded");async function _x(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:a}=Gt(t);t.labelStyle=a;const o=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(o,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await he(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,g=n+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Za(t),C=-g/2,k=-p/2,v=t.label?8:0,T=Vt.svg(c),F=jt(t,{});t.look!=="handDrawn"&&(F.roughness=0,F.fillStyle="solid");const A=x.get("fill");F.stroke=A??y;const M=T.path(yi(C,k,g,p,.1),F),B=Math.max(g,h.width),$=p+h.height+v,P=T.rectangle(-B/2,-$/2,B,$,{...F,fill:"transparent",stroke:"none"}),I=c.insert(()=>M,":first-child"),_=c.insert(()=>P);if(t.icon){const E=c.append("g");E.html(`<g>${await So(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const L=E.node().getBBox(),q=L.width,W=L.height,R=L.x,D=L.y;E.attr("transform",`translate(${-q/2-R},${f?h.height/2+v/2-W/2-D:-h.height/2-v/2-W/2-D})`),E.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-$/2:$/2-h.height})`),I.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),ee(t,_),t.intersect=function(E){if(Tt.info("iconSquare intersect",t,E),!t.label)return Ht.rect(t,E);const L=t.x??0,q=t.y??0,W=t.height??0;let R=[];return f?R=[{x:L-h.width/2,y:q-W/2},{x:L+h.width/2,y:q-W/2},{x:L+h.width/2,y:q-W/2+h.height+v},{x:L+g/2,y:q-W/2+h.height+v},{x:L+g/2,y:q+W/2},{x:L-g/2,y:q+W/2},{x:L-g/2,y:q-W/2+h.height+v},{x:L-h.width/2,y:q-W/2+h.height+v}]:R=[{x:L-g/2,y:q-W/2},{x:L+g/2,y:q-W/2},{x:L+g/2,y:q-W/2+p},{x:L+h.width/2,y:q-W/2+p},{x:L+h.width/2/2,y:q+W/2},{x:L-h.width/2,y:q+W/2},{x:L-h.width/2,y:q-W/2+p},{x:L-g/2,y:q-W/2+p}],Ht.polygon(t,R,E)},c}b(_x,"iconSquare");async function Lx(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const a=Number(i.naturalWidth.toString().replace("px","")),o=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=a/o;const{labelStyles:s}=Gt(t);t.labelStyle=s;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??a),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await he(e,t,"image-shape default"),p=t.pos==="t",g=-c/2,m=-h/2,y=t.label?8:0,x=Vt.svg(d),C=jt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=x.rectangle(g,m,c,h,C),v=Math.max(c,u.width),T=h+u.height+y,F=x.rectangle(-v/2,-T/2,v,T,{...C,fill:"none",stroke:"none"}),A=d.insert(()=>k,":first-child"),M=d.insert(()=>F);if(t.img){const B=d.append("image");B.attr("href",t.img),B.attr("width",c),B.attr("height",h),B.attr("preserveAspectRatio","none"),B.attr("transform",`translate(${-c/2},${p?T/2-h:-T/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-h/2-u.height/2-y/2:h/2-u.height/2+y/2})`),A.attr("transform",`translate(0,${p?u.height/2+y/2:-u.height/2-y/2})`),ee(t,M),t.intersect=function(B){if(Tt.info("iconSquare intersect",t,B),!t.label)return Ht.rect(t,B);const $=t.x??0,P=t.y??0,I=t.height??0;let _=[];return p?_=[{x:$-u.width/2,y:P-I/2},{x:$+u.width/2,y:P-I/2},{x:$+u.width/2,y:P-I/2+u.height+y},{x:$+c/2,y:P-I/2+u.height+y},{x:$+c/2,y:P+I/2},{x:$-c/2,y:P+I/2},{x:$-c/2,y:P-I/2+u.height+y},{x:$-u.width/2,y:P-I/2+u.height+y}]:_=[{x:$-c/2,y:P-I/2},{x:$+c/2,y:P-I/2},{x:$+c/2,y:P-I/2+h},{x:$+u.width/2,y:P-I/2+h},{x:$+u.width/2/2,y:P+I/2},{x:$-u.width/2,y:P+I/2},{x:$-u.width/2,y:P-I/2+h},{x:$-c/2,y:P-I/2+h}],Ht.polygon(t,_,B)},d}b(Lx,"imageSquare");async function Ax(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=a,s=t.look==="neo"?a*2:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+o*2,t.height??0),h=Math.max(l.width+s*2,(t.width??0)-c),d=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=jt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=ha(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(Ax,"inv_trapezoid");async function Fx(e,t){const{shapeSvg:r,bbox:i,label:a}=await he(e,t,"label"),o=r.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ee(t,o),t.intersect=function(l){return Ht.rect(t,l)},r}b(Fx,"labelRect");async function $x(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=a,s=t.look==="neo"?a*2:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=jt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=ha(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b($x,"lean_left");async function Ex(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=a,s=t.look==="neo"?a*2:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=jt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=ha(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(Ex,"lean_right");function Px(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.label="",t.labelStyle=r;const a=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:s,y:0},{x:0,y:n+l/2},{x:s-2*l,y:n+l/2},{x:0,y:2*n},{x:s,y:n-l/2},{x:2*l,y:n-l/2}],h=Vt.svg(a),d=jt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=rr(c),f=h.path(u,d),p=a.insert(()=>f,":first-child");return p.attr("class","outer-path"),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${s/2},${-n})`),ee(t,p),t.intersect=function(g){return Tt.info("lightningBolt intersect",t,g),Ht.polygon(t,c,g)},a}b(Px,"lightningBolt");var RT=b((e,t,r,i,a,o,s)=>[`M${e},${t+o}`,`a${a},${o} 0,0,0 ${r},0`,`a${a},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${o} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+o+s}`,`a${a},${o} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),DT=b((e,t,r,i,a,o,s)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${a},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${o} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+o+s}`,`a${a},${o} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),NT=b((e,t,r,i,a,o)=>[`M${e-r/2},${-i/2}`,`a${a},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ug=10,fg=10;async function Ix(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?24:a;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-o,t.width<fg&&(t.width=fg);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<ug&&(t.height=ug)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+o*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+s*2,p=f*.1;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Vt.svg(n),x=DT(0,0,h,f,d,u,p),C=NT(0,u,h,f,d,u),k=jt(t,{}),v=y.path(x,k),T=y.path(C,k);n.insert(()=>T,":first-child").attr("class","line"),g=n.insert(()=>v,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=RT(0,0,h,f,d,u,p);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Rr(m)).attr("style",i)}return g.attr("label-offset-y",u),g.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),ee(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(l.y-(l.top??0))})`),t.intersect=function(y){const x=Ht.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-u)){let k=u*u*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=u-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}b(Ix,"linedCylinder");async function Ox(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a;if(t.width||t.height){const k=t.width;t.width=(k??0)*10/11-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+(o??0)*2,d=(t?.height?t?.height:l.height)+(s??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:p}=t,g=Vt.svg(n),m=jt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2-h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:f/2},...Ua(-h/2-h/2*.1,f/2,h/2+h/2*.1,f/2,u,.8),{x:h/2+h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:-f/2},{x:-h/2,y:-f/2},{x:-h/2,y:f/2*1.1},{x:-h/2,y:-f/2}],x=g.polygon(y.map(k=>[k.x,k.y]),m),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),C.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u-(l.y-(l.top??0))})`),ee(t,C),t.intersect=function(k){return Ht.polygon(t,y,k)},n}b(Ox,"linedWaveEdgedRect");var qT=56,Yc=72,gg=8,pg=2,WT=8,zT={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},mg=Math.PI/3,yg=.6,Xc=b((e,t)=>{const r=t*yg,i=t*Math.sqrt(1-yg**2),a=Math.cos(mg),o=-Math.sin(mg),s=r*-o,n=e+r*a,l=i*a,c=i*o;return`M ${s-l} ${n-c} L ${s+l} ${n+c}`},"businessMarkerPathForCircle"),HT={normal:Xc(-24,12),hollow:Xc(-23,9),awesome:Xc(-21,13),icon:"M 12 -8 L 26 -26"},xg=b((e,t,r)=>{const i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-a})`)},"positionLabel"),eu=b((e,t,r,i,a=!1)=>{if(t.look==="handDrawn"){const n=Vt.svg(e).path(r,jt(t,a?{fill:"none"}:{}));return e.insert(()=>n,":first-child").attr("class",i)}const o=e.append("path").attr("class",i).attr("d",r);return a&&o.attr("fill","none"),o},"appendActorPath"),YT=b((e,t,r,i,a,o,s=!1)=>{if(t.look==="handDrawn"){const c=Vt.svg(e).circle(r,i,a*2,jt(t,s?{fill:"none"}:{}));return e.insert(()=>c,":first-child").attr("class",o)}const n=e.append("circle").attr("class",o).attr("cx",r).attr("cy",i).attr("r",a);return s&&n.attr("fill","none"),n},"appendActorCircle"),XT=b((e,t,r)=>{t.business&&e.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",HT[r]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function pn(e,t,r,i){const{labelStyles:a,nodeStyles:o}=Gt(t);t.labelStyle=a;const s=r==="icon"||t.stereotype!==void 0?{...t,icon:r==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:n,bbox:l,label:c}=await he(e,s,se(t,`usecase-actor-variant usecase-actor-${r}`)),h=t.accessibleName??t.label;h&&n.attr("role","img").attr("aria-label",h),c.attr("class","label actor-label usecase-actor-label");const{theme:d,themeVariables:u}=Xe();Li(n,t.colorIndex,d,u.borderColorArray);let f,p;if(t.stereotype){const A=await fo(n,`«${t.stereotype}»`,{labelStyle:a,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=A.label.attr("class","label usecase-stereotype"),p=A.bbox}const g=n.append("g").attr("class",`usecase-actor-glyph ${zT[r]}`).attr("style",o||null);await i(g,t),XT(g,t,r);const m=t.padding??WT,y=p?.height??0,x=Yc+gg+l.height+(p?y+pg:0),C=Math.max(qT,l.width,p?.width??0)+m*2,k=x+m*2,v=-x/2;g.attr("transform",`translate(0,${v+Yc/2})`);let T=v+Yc+gg;f&&p&&(T+=y/2,xg(f,p,T),T+=y/2+pg),xg(c,l,T+l.height/2);const F=n.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-C/2).attr("y",-k/2).attr("width",C).attr("height",k).attr("opacity",0).attr("aria-hidden","true");return ee(t,F),t.intersect=A=>Ht.rect(t,A),n}b(pn,"renderUsecaseActor");var jT=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function Rx(e,t){return pn(e,t,"normal",(r,i)=>{eu(r,i,jT,"usecase-actor-stick")})}b(Rx,"usecaseActor");var GT=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function Dx(e,t){return pn(e,t,"awesome",(r,i)=>{eu(r,i,GT,"usecase-actor-awesome-silhouette")})}b(Dx,"usecaseActorAwesome");var UT=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function Nx(e,t){return pn(e,t,"hollow",(r,i)=>{YT(r,i,0,-23,9,"usecase-actor-hollow-head",!0),eu(r,i,UT,"usecase-actor-hollow-body",!0)})}b(Nx,"usecaseActorHollow");var Ao=52,bg=42,Cg=-2,VT=b(async(e,t)=>{const r=-Ao/2,i=Cg-Ao/2;if(t.look==="handDrawn"){const h=Vt.svg(e).rectangle(r,i,Ao,Ao,jt(t,{}));e.insert(()=>h,":first-child").attr("class","usecase-actor-icon-frame")}else e.append("rect").attr("class","usecase-actor-icon-frame").attr("x",r).attr("y",i).attr("width",Ao).attr("height",Ao).attr("rx",4).attr("ry",4);const a=t.icon??"",o=await Jp(a.includes(":")?a:`fa:${a}`),s=await So(a,{height:bg,width:bg,fallbackPrefix:"fa"}),n=e.append("g").attr("class",`usecase-actor-icon-symbol${o?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${s}</g>`),l=n.node()?.getBBox();l&&n.attr("transform",`translate(${-l.width/2-l.x},${Cg-l.height/2-l.y})`)},"drawIconActor");async function qx(e,t){return pn(e,t,"icon",VT)}b(qx,"usecaseActorIcon");var wg=b((e,t,r)=>{const i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-a})`)},"positionLabel");async function Wx(e,t){const r=t,{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const o=r.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:s,bbox:n,halfPadding:l,label:c}=await he(e,o,se(t,"usecase-business-shape"));c.attr("class","label usecase-label");const{theme:h,themeVariables:d}=Xe();Li(s,t.colorIndex,h,d.borderColorArray);let u,f;if(r.stereotype){const I=await fo(s,`«${r.stereotype}»`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});u=I.label.attr("class","label usecase-stereotype"),f=I.bbox}const p=f?2:0,g=n.height+(f?.height??0)+p,m=Math.max(n.width,f?.width??0),y=l??10,x=m/2+y*2,C=g/2+y*2,k=Math.min(Math.max(y/5,1),y/2),v=m/2+k,T=x-k,F=v/x,A=T/x,M=C*Math.sqrt(Math.max(0,1-F*F)),B=-C*Math.sqrt(Math.max(0,1-A*A));u&&f&&wg(u,f,-g/2+f.height/2),wg(c,n,g/2-n.height/2);let $;if(t.look==="handDrawn"){const _=Vt.svg(s).ellipse(0,0,x*2,C*2,jt(t,{}));$=s.insert(()=>_,":first-child").attr("class","basic label-container usecase-business-ellipse")}else $=s.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",a).attr("rx",x).attr("ry",C).attr("cx",0).attr("cy",0);s.append("path").attr("class","usecase-business-marker").attr("d",`M ${v} ${M} L ${T} ${B}`).attr("fill","none").attr("style",a||null);const P=r.accessibleName??r.label;return P&&s.attr("role","img").attr("aria-label",P),ee(t,$),t.calcIntersect=(I,_)=>Ht.ellipse(I,I.width/2,I.height/2,_),t.intersect=I=>Ht.ellipse(t,x,C,I),s}b(Wx,"usecaseBusiness");var jc=8,kg=4,ZT=1,Gc=b((e,t,r,i)=>{const a=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${r-t.width/2-a},${i-t.height/2-o})`)},"positionLabel"),KT=b(e=>{const t=Number.parseFloat(e??"");return Number.isFinite(t)&&t>=0?t:ZT},"numericStrokeWidth");async function zx(e,t){const r=t,{labelStyles:i,nodeStyles:a}=Gt(t),{stylesMap:o}=Za(t);t.labelStyle=i;const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"usecase-json-table"));s.attr("role","img"),r.accessibleName&&s.attr("aria-label",r.accessibleName),l.attr("class","label usecase-json-title");const c=s.append("g").attr("class","usecase-json-table-grid"),h=[];for(const I of r.jsonRows??[]){const _=await fo(c,I.key,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),E=await fo(c,I.value,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});h.push({key:{label:_.label.attr("class","label usecase-json-key"),bbox:_.bbox},value:{label:E.label.attr("class","label usecase-json-value"),bbox:E.bbox}})}const d=Math.max(0,...h.map(({key:I})=>I.bbox.width))+jc*2,u=Math.max(0,...h.map(({value:I})=>I.bbox.width))+jc*2,f=n.width+jc*2,p=Math.max(f,d+u),g=u+Math.max(0,p-d-u),m=n.height+kg*2,y=h.map(({key:I,value:_})=>Math.max(I.bbox.height,_.bbox.height)+kg*2),x=m+y.reduce((I,_)=>I+_,0),C=KT(o.get("stroke-width")),k=p+C*2,v=x+C*2,T=-p/2,F=-x/2,A=t.look==="handDrawn"?Vt.svg(s):void 0,M=A?jt(t,{}):void 0,B=b((I,_,E,L,q,W)=>{if(A&&M){const R=A.rectangle(E,L,q,W,M);return I.insert(()=>R,":first-child").attr("class",_)}return I.insert("rect",":first-child").attr("class",_).attr("x",E).attr("y",L).attr("width",q).attr("height",W).attr("style",a)},"insertCell"),$=B(s,"label-container usecase-json-border",-k/2,-v/2,k,v);B(c,"usecase-json-cell usecase-json-title-cell",T,F,p,m),c.node()?.append(l.node()),Gc(l,n,0,F+m/2);let P=F+m;return h.forEach(({key:I,value:_},E)=>{const L=y[E],q=c.append("g").attr("class","usecase-json-row").attr("data-row-index",E).attr("transform",`translate(0,${P})`);B(q,"usecase-json-cell usecase-json-key-cell",T,0,d,L),B(q,"usecase-json-cell usecase-json-value-cell",T+d,0,g,L),q.node()?.append(I.label.node(),_.label.node()),Gc(I.label,I.bbox,T+d/2,L/2),Gc(_.label,_.bbox,T+d+g/2,L/2),P+=L}),ee(t,$),t.intersect=I=>Ht.rect(t,I),s}b(zx,"usecaseJsonTable");async function Hx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-2*n,10),t.height=Math.max((t?.height??0)-s*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=(t?.width?t?.width:c.width)+o*2+2*n,u=(t?.height?t?.height:c.height)+s*2+2*n,f=d-2*n,p=u-2*n,g=-f/2,m=-p/2,{cssStyles:y}=t,x=Vt.svg(l),C=jt(t,{}),k=[{x:g-n,y:m+n},{x:g-n,y:m+p+n},{x:g+f-n,y:m+p+n},{x:g+f-n,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m+p-n},{x:g+f+n,y:m+p-n},{x:g+f+n,y:m-n},{x:g+n,y:m-n},{x:g+n,y:m},{x:g,y:m},{x:g,y:m+n}],v=[{x:g,y:m+n},{x:g+f-n,y:m+n},{x:g+f-n,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m},{x:g,y:m}];t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=rr(k);let F=x.path(T,C);const A=rr(v);let M=x.path(A,C);t.look!=="handDrawn"&&(F=Fh(F),M=Fh(M));const B=l.insert("g",":first-child");return B.insert(()=>F),B.insert(()=>M),B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ee(t,B),t.intersect=function($){return Ht.polygon(t,k,$)},l}b(Hx,"multiRect");async function Yx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(o.width,t?.width??0)+l*2,u=Math.max(o.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,p=u+(h?f/2:-f/2),g=-d/2,m=-p/2,y=10,{cssStyles:x}=t,C=Ua(g-y,m+p+y,g+d-y,m+p+y,f,.8),k=C?.[C.length-1],v=[{x:g-y,y:m+y},{x:g-y,y:m+p+y},...C,{x:g+d-y,y:k.y-y},{x:g+d,y:k.y-y},{x:g+d,y:k.y-2*y},{x:g+d+y,y:k.y-2*y},{x:g+d+y,y:m-y},{x:g+y,y:m-y},{x:g+y,y:m},{x:g,y:m},{x:g,y:m+y}],T=[{x:g,y:m+y},{x:g+d-y,y:m+y},{x:g+d-y,y:k.y-y},{x:g+d,y:k.y-y},{x:g+d,y:m},{x:g,y:m}],F=Vt.svg(a),A=jt(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const M=rr(v),B=F.path(M,A),$=rr(T),P=F.path($,A),I=a.insert(()=>B,":first-child");return I.insert(()=>P),I.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&I.selectAll("path").attr("style",i),I.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-(o.width/2)-y-(o.x-(o.left??0))}, ${-(o.height/2)+y-f-(o.y-(o.top??0))})`),ee(t,I),t.intersect=function(_){return Ht.polygon(t,v,_)},a}b(Yx,"multiWaveEdgedRectangle");async function Xx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i,t.useHtmlLabels||zr(Tr())||(t.centerLabel=!0);const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-h/2,{cssStyles:f}=t,p=Vt.svg(s),g=jt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=p.rectangle(d,u,c,h,g),y=s.insert(()=>m,":first-child");return y.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),a&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",a),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ee(t,y),t.intersect=function(x){return Ht.rect(t,x)},s}b(Xx,"note");var QT=b((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function jx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o}=await he(e,t,se(t)),s=o.width+(t.padding??0),n=o.height+(t.padding??0),l=s+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=Vt.svg(a),p=jt(t,{}),g=QT(0,0,l),m=f.path(g,p);d=a.insert(()=>m,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=ha(a,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ee(t,d),t.calcIntersect=function(f,p){const g=f.width,m=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}];return Ht.polygon(f,m,p)},t.intersect=function(f){return this.calcIntersect(t,f)},a}b(jx,"question");async function Gx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?21:a??0,s=t.look==="neo"?12:a??0,{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=l.width+(t.look==="neo"?o*2:o),d=Math.max(l.height+(t.look==="neo"?s*2:s),t.height??0),u=d/4,p=-Math.max(h,(t.width??0)-u)/2,g=-d/2,m=g/2,y=[{x:p+m,y:g},{x:p,y:0},{x:p+m,y:-g},{x:-p,y:-g},{x:-p,y:g}],{cssStyles:x}=t,C=Vt.svg(n),k=jt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=rr(y),T=C.path(v,k),F=n.insert(()=>T,":first-child");return F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(${-m/2},0)`),c.attr("transform",`translate(${-m/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ee(t,F),t.intersect=function(A){return Ht.polygon(t,y,A)},n}b(Gx,"rect_left_inv_arrow");async function Ux(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;let a;t.cssClasses?a="node "+t.cssClasses:a="node default";const o=e.insert("g").attr("class",a).attr("id",t.domId||t.id),s=o.insert("g"),n=o.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await wa(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(zr(Xe())){const A=h.children[0],M=He(h);d=A.getBoundingClientRect(),M.attr("width",d.width),M.attr("height",d.height)}Tt.info("Text 2",l);const u=l||[],f=h.getBBox(),p=await wa(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),g=p.children[0],m=He(p);d=g.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height);const y=(t.padding||0)/2;He(p).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+y+5)+")"),He(h).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")");const x=d.width+(t.padding||0),C=d.height+(t.padding||0),k=-d.width/2-y,v=-d.height/2-y;let T,F;if(t.look==="handDrawn"){const A=Vt.svg(o),M=jt(t,{}),B=A.path(yi(k,v,x,C,t.rx||0),M),$=A.line(-d.width/2-y,-d.height/2-y+f.height+y,d.width/2+y,-d.height/2-y+f.height+y,M);F=o.insert(()=>(Tt.debug("Rough node insert CXC",B),$),":first-child"),T=o.insert(()=>(Tt.debug("Rough node insert CXC",B),B),":first-child")}else T=s.insert("rect",":first-child"),F=s.insert("line"),T.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),F.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+f.height+y).attr("y2",-d.height/2-y+f.height+y);return ee(t,T),t.intersect=function(A){return Ht.rect(t,A)},o}b(Ux,"rectWithTitle");async function Vx(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,a={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Cs(e,t,a)}b(Vx,"roundedRect");var to=8;async function Zx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width??n.width)+a*2+(t.look==="neo"?to:to*2),h=(t?.height??n.height)+o*2,d=c-to,u=h,f=to-c/2,p=-h/2,{cssStyles:g}=t,m=Vt.svg(s),y=jt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:p},{x:f+d,y:p},{x:f+d,y:p+u},{x:f-to,y:p+u},{x:f-to,y:p},{x:f,y:p},{x:f,y:p+u}],C=m.polygon(x.map(v=>[v.x,v.y]),y),k=s.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path").attr("style",Rr(g)),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${to/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ee(t,k),t.intersect=function(v){return Ht.rect(t,v)},s}b(Zx,"shadedProcess");async function Kx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2,10),t.height=Math.max((t?.height??0)/1.5-s*2,10));const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+o*2,d=((t?.height?t?.height:l.height)+s*2)*1.5,u=h,f=d/1.5,p=-u/2,g=-f/2,{cssStyles:m}=t,y=Vt.svg(n),x=jt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:p,y:g},{x:p,y:g+f},{x:p+u,y:g+f},{x:p+u,y:g-f/2}],k=rr(C),v=y.path(k,x),T=n.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),T.attr("transform",`translate(0, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-f/4+(t.padding??0)-(l.y-(l.top??0))})`),ee(t,T),t.intersect=function(F){return Ht.polygon(t,C,F)},n}b(Kx,"slopedRect");async function Qx(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,a=t.look==="neo"?12:r,o={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:a},s=await Cs(e,t,o);if(t.colorIndex!==void 0){const{theme:n,themeVariables:l}=Xe();Li(s,t.colorIndex,n,l.borderColorArray)}return s}b(Qx,"squareRect");var Ph=50,JT=b((e,t,r)=>{const i=e.height+r,a=i*Math.cos(Math.PI/(2*(Ph-1))),o=Math.sqrt(Math.max(0,a**2-e.height**2));return{w:Math.max(e.width+i/4+t,1.5*i+(i-a),e.width+t+i-o),h:i}},"stadiumDimensions");async function Jx(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?40:a,s=t.look==="neo"?24:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),{w:c,h}=JT(l,o,s),d=h/2,{cssStyles:u}=t,f=Vt.svg(n),p=jt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-c/2+d,y:-h/2},{x:c/2-d,y:-h/2},...Ji(-c/2+d,0,d,Ph,90,270),{x:c/2-d,y:h/2},...Ji(c/2-d,0,d,Ph,270,450)],m=rr(g),y=f.path(m,p),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),ee(t,x),t.intersect=function(C){return Ht.polygon(t,g,C)},n}b(Jx,"stadium");async function t0(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Cs(e,t,r)}b(t0,"state");function e0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{cssStyles:o}=t,{lineColor:s,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=Vt.svg(h),u=jt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:s,strokeWidth:2}),p=n??l,g=(t.width??0)*5/14,m=d.circle(0,0,g,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>f,":first-child");if(y.insert(()=>m),t.look!=="handDrawn"&&y.attr("class","outer-path"),o&&y.selectAll("path").attr("style",o),a&&y.selectAll("path").attr("style",a),t.width<25&&c&&t.look!=="handDrawn"){const x=e.node()?.ownerSVGElement?.id??"",C=x?`${x}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${C})`)}return ee(t,y),t.intersect=function(x){return Ht.circle(t,(t.width??0)/2,x)},h}b(e0,"stateEnd");function r0(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:a}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const o=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let s;if(t.look==="handDrawn"){const l=Vt.svg(o).circle(0,0,t.width,gw(i));s=o.insert(()=>l),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else s=o.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&a&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${l})`)}return ee(t,s),t.intersect=function(n){return Ht.circle(t,(t.width??7)/2,n)},o}b(r0,"stateStart");var Fo=8;async function i0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t?.padding??8,o=t.look==="neo"?28:a,s=t.look==="neo"?12:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.width+2*Fo+o,t.width??0),h=Math.max(l.height+s,t.height??0),d=c-2*Fo,u=h,f=-c/2,p=-h/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const m=Vt.svg(n),y=jt(t,{}),x=m.rectangle(f,p,d+16,u,y),C=m.line(f+Fo,p,f+Fo,p+u,y),k=m.line(f+Fo+d,p,f+Fo+d,p+u,y);n.insert(()=>C,":first-child"),n.insert(()=>k,":first-child");const v=n.insert(()=>x,":first-child"),{cssStyles:T}=t;v.attr("class","basic label-container").attr("style",Rr(T)),ee(t,v)}else{const m=ha(n,d,u,g);i&&m.attr("style",i),ee(t,m)}return t.intersect=function(m){return Ht.polygon(t,g,m)},n}b(i0,"subroutine");var Uc=.2;async function a0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-s*2,10),t.width=Math.max((t?.width??0)-o*2-Uc*(t.height+s*2),10));const{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.height?t?.height:l.height)+s*2,h=Uc*c,d=Uc*c,f=(t?.width?t?.width:l.width)+o*2+h-h,p=c,g=-f/2,m=-p/2,{cssStyles:y}=t,x=Vt.svg(n),C=jt(t,{}),k=[{x:g-h/2,y:m},{x:g+f+h/2,y:m},{x:g+f+h/2,y:m+p},{x:g-h/2,y:m+p}],v=[{x:g+f-h/2,y:m+p},{x:g+f+h/2,y:m+p},{x:g+f+h/2,y:m+p-d}];t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=rr(k),F=x.path(T,C),A=rr(v),M=x.path(A,{...C,fillStyle:"solid"}),B=n.insert(()=>M,":first-child");return B.insert(()=>F,":first-child"),B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),ee(t,B),t.intersect=function($){return Ht.polygon(t,k,$)},n}b(a0,"taggedRect");async function o0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t)),n=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:f}=t,p=Vt.svg(a),g=jt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-n/2-n/2*.1,y:u/2},...Ua(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],y=-n/2+n/2*.1,x=-u/2-d*.4,C=[{x:y+n-h,y:(x+l)*1.3},{x:y+n,y:x+l-d},{x:y+n,y:(x+l)*.9},...Ua(y+n,(x+l)*1.25,y+n-h,(x+l)*1.3,-l*.02,.5)],k=rr(m),v=p.path(k,g),T=rr(C),F=p.path(T,{...g,fillStyle:"solid"}),A=a.insert(()=>F,":first-child");return A.insert(()=>v,":first-child"),A.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-n/2+(t.padding??0)-(o.x-(o.left??0))},${-l/2+(t.padding??0)-c/2-(o.y-(o.top??0))})`),ee(t,A),t.intersect=function(M){return Ht.polygon(t,m,M)},a}b(o0,"taggedWaveEdgedRectangle");async function s0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o}=await he(e,t,se(t)),s=Math.max(o.width+(t.padding??0),t?.width||0),n=Math.max(o.height+(t.padding??0),t?.height||0),l=-s/2,c=-n/2,h=a.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",n),ee(t,h),t.intersect=function(d){return Ht.rect(t,d)},a}b(s0,"text");var tB=b((e,t,r,i,a,o)=>`M${e},${t}
233
- a${a},${o} 0,0,1 0,${-i}
234
- l${r},0
235
- a${a},${o} 0,0,1 0,${i}
236
- M${r},${-i}
237
- a${a},${o} 0,0,0 0,${i}
238
- l${-r},0`,"createCylinderPathD"),eB=b((e,t,r,i,a,o)=>[`M${e},${t}`,`M${e+r},${t}`,`a${a},${o} 0,0,0 0,${-i}`,`l${-r},0`,`a${a},${o} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),rB=b((e,t,r,i,a,o)=>[`M${e+r/2},${-i/2}`,`a${a},${o} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Sg=5,vg=10;async function n0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?12:a/2,s=t.height??0;if(t.height&&(t.height=t.height-o,t.height<Sg&&(t.height=Sg)),t.width){const y=s/2/(2.5+s/50);t.width=t.width-o-y*3,t.width<vg&&(t.width=vg)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=Math.max(t.height??0,l.height)+o,d=h/2,u=d/(2.5+h/50),f=Math.max(t.width??0,l.width)+u+o,{cssStyles:p}=t;let g;if(t.look==="handDrawn"){const m=Vt.svg(n),y=eB(0,0,f,h,u,d),x=rB(0,0,f,h,u,d),C=m.path(y,jt(t,{})),k=m.path(x,jt(t,{fill:"none"}));g=n.insert(()=>k,":first-child"),g=n.insert(()=>C,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=tB(0,0,f,h,u,d);g=n.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Rr(p)).attr("style",i),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-f/2}, ${h/2} )`),c.attr("transform",`translate(${-(l.width/2)-u-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ee(t,g),t.intersect=function(m){const y=Ht.rect(t,m),x=y.y-(t.y??0);if(d!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-u)){let C=u*u*(1-x*x/(d*d));C!=0&&(C=Math.sqrt(Math.abs(C))),C=u-C,m.x-(t.x??0)>0&&(C=-C),y.x+=C}return y},n}b(n0,"tiltedCylinder");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=(t.look==="neo",a),s=t.look==="neo"?a*2:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=jt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=ha(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(l0,"trapezoid");async function c0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-s*2,t.height<l&&(t.height=l),t.width=(t.width??0)-o*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=(t?.width?t?.width:h.width)+o*2,u=(t?.height?t?.height:h.height)+s*2,{cssStyles:f}=t,p=Vt.svg(c),g=jt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-d/2*.8,y:-u/2},{x:d/2*.8,y:-u/2},{x:d/2,y:-u/2*.6},{x:d/2,y:u/2},{x:-d/2,y:u/2},{x:-d/2,y:-u/2*.6}],y=rr(m),x=p.path(y,g),C=c.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),ee(t,C),t.intersect=function(k){return Ht.polygon(t,m,k)},c}b(c0,"trapezoidalPentagon");var Mg=10,Tg=10;async function h0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?a*2:a;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<Tg&&(t.width=Tg),t.height=t?.height??0,t.height<Mg&&(t.height=Mg));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=ca(Xe().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+o,d=t?.height?t?.height:h+n.height,u=d,f=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-d}],{cssStyles:p}=t,g=Vt.svg(s),m=jt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=rr(f),x=g.path(y,m),C=s.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=h,t.height=d,ee(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(k){return Tt.info("Triangle intersect",t,f,k),Ht.polygon(t,f,k)},s}b(h0,"triangle");async function d0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?12:a;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=(t?.width?t?.width:c.width)+(o??0)*2,u=(t?.height?t?.height:c.height)+(s??0)*2,f=t.look==="neo"?u/4:u/8,p=u+(n?f:-f),{cssStyles:g}=t,y=14-d,x=y>0?y/2:0,C=Vt.svg(l),k=jt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=[{x:-d/2-x,y:p/2},...Ua(-d/2-x,p/2,d/2+x,p/2,f,.8),{x:d/2+x,y:-p/2},{x:-d/2-x,y:-p/2}],T=rr(v),F=C.path(T,k),A=l.insert(()=>F,":first-child");return A.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(0,${-f/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-u/2+(t.padding??0)-f-(c.y-(c.top??0))})`),ee(t,A),t.intersect=function(M){return Ht.polygon(t,v,M)},l}b(d0,"waveEdgedRectangle");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.padding??0,o=t.look==="neo"?16:a,s=t.look==="neo"?20:a;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const k=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-s-k*(20/9)),t.width=t.width-o*2}const{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.width?t?.width:l.width)+o*2,h=(t?.height?t?.height:l.height)+s,d=h/8,u=h+d*2,{cssStyles:f}=t,p=Vt.svg(n),g=jt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-c/2,y:u/2},...Ua(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...Ua(c/2,-u/2,-c/2,-u/2,d,-1)],y=rr(m),x=p.path(y,g),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),ee(t,C),t.intersect=function(k){return Ht.polygon(t,m,k)},n}b(u0,"waveRectangle");var _r=10;async function f0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-_r,10),t.height=Math.max((t?.height??0)-o*2-_r,10));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width?t?.width:n.width)+a*2+_r,h=(t?.height?t?.height:n.height)+o*2+_r,d=c-_r,u=h-_r,f=-d/2,p=-u/2,{cssStyles:g}=t,m=Vt.svg(s),y=jt(t,{}),x=[{x:f-_r,y:p-_r},{x:f-_r,y:p+u},{x:f+d,y:p+u},{x:f+d,y:p-_r}],C=`M${f-_r},${p-_r} L${f+d},${p-_r} L${f+d},${p+u} L${f-_r},${p+u} L${f-_r},${p-_r}
239
- M${f-_r},${p} L${f+d},${p}
240
- M${f},${p-_r} L${f},${p+u}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const k=m.path(C,y),v=s.insert(()=>k,":first-child");return v.attr("transform",`translate(${_r/2}, ${_r/2})`),v.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+_r/2-(n.x-(n.left??0))}, ${-(n.height/2)+_r/2-(n.y-(n.top??0))})`),ee(t,v),t.intersect=function(T){return Ht.polygon(t,x,T)},s}b(f0,"windowPane");var Bg=new Set(["redux-color","redux-dark-color"]),iB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function ru(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:a}=Tr(),{rowEven:o,rowOdd:s,nodeBorder:n,borderColorArray:l}=a;if(t.look==="handDrawn"){const{themeVariables:rt}=Tr(),{background:J}=rt,at={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${J}`]};await ru(e,at)}const c=Tr();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:p}=Gt(t);if(r.attributes.length===0&&t.label){const rt={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ta(t.label,c)+rt.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const J=await Cs(e,t,rt);if(i!=null&&Bg.has(i)){const at=r.colorIndex??0;J.attr("data-color-id",`color-${at%l.length}`)}if(!ca(c.htmlLabels)){const at=J.select("text"),xt=at.node()?.getBBox();at.attr("transform",`translate(${-xt.width/2}, 0)`)}return J}c.htmlLabels||(h*=1.25,d*=1.25);let g=se(t);g||(g="node default");const m=e.insert("g").attr("class",g).attr("id",t.domId||t.id),y=await Ro(m,t.label??"",c,0,0,["name"],f);y.height+=d;let x=0;const C=[],k=[];let v=0,T=0,F=0,A=0,M=!0,B=!0;for(const rt of r.attributes){const J=await Ro(m,rt.type,c,0,x,["attribute-type"],f);v=Math.max(v,J.width+h);const at=await Ro(m,rt.name,c,0,x,["attribute-name"],f);T=Math.max(T,at.width+h);const xt=await Ro(m,rt.keys.join(),c,0,x,["attribute-keys"],f);F=Math.max(F,xt.width+h);const H=await Ro(m,rt.comment,c,0,x,["attribute-comment"],f);A=Math.max(A,H.width+h);const Y=Math.max(J.height,at.height,xt.height,H.height)+d;k.push({yOffset:x,rowHeight:Y}),x+=Y}let $=4;F<=h&&(M=!1,F=0,$--),A<=h&&(B=!1,A=0,$--);const P=m.node().getBBox();if(y.width+h*2-(v+T+F+A)>0){const rt=y.width+h*2-(v+T+F+A);v+=rt/$,T+=rt/$,F>0&&(F+=rt/$),A>0&&(A+=rt/$)}const I=v+T+F+A,_=Vt.svg(m),E=jt(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let L=0;k.length>0&&(L=k.reduce((rt,J)=>rt+(J?.rowHeight??0),0));const q=Math.max(P.width+h*2,t?.width||0,I),W=Math.max((L??0)+y.height,t?.height||0),R=-q/2,D=-W/2;if(m.selectAll("g:not(:first-child)").each((rt,J,at)=>{const xt=He(at[J]),H=xt.attr("transform");let Y=0,Z=0;if(H){const st=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(H);st&&(Y=parseFloat(st[1]),Z=parseFloat(st[2]),xt.attr("class").includes("attribute-name")?Y+=v:xt.attr("class").includes("attribute-keys")?Y+=v+T:xt.attr("class").includes("attribute-comment")&&(Y+=v+T+F))}xt.attr("transform",`translate(${R+h/2+Y}, ${Z+D+y.height+d/2})`)}),m.select(".name").attr("transform","translate("+-y.width/2+", "+(D+d/2)+")"),i!=null&&Bg.has(i)){const rt=r.colorIndex??0;m.attr("data-color-id",`color-${rt%l.length}`)}const G=_.rectangle(R,D,q,W,E),j=m.insert(()=>G,":first-child").attr("class","outer-path").attr("style",u.join(""));C.push(0);for(const[rt,J]of k.entries()){const xt=(rt+1)%2===0&&J.yOffset!==0,H=_.rectangle(R,y.height+D+J?.yOffset,q,J?.rowHeight,{...E,fill:xt?o:s,stroke:n});m.insert(()=>H,"g.label").attr("style",u.join("")).attr("class",`row-rect-${xt?"even":"odd"}`)}const z=1e-4;let Q=Do(R,y.height+D,q+R,y.height+D,z),et=_.polygon(Q.map(rt=>[rt.x,rt.y]),E);if(m.insert(()=>et).attr("class","divider"),Q=Do(v+R,y.height+D,v+R,W+D,z),et=_.polygon(Q.map(rt=>[rt.x,rt.y]),E),m.insert(()=>et).attr("class","divider"),M){const rt=v+T+R;Q=Do(rt,y.height+D,rt,W+D,z),et=_.polygon(Q.map(J=>[J.x,J.y]),E),m.insert(()=>et).attr("class","divider")}if(B){const rt=v+T+F+R;Q=Do(rt,y.height+D,rt,W+D,z),et=_.polygon(Q.map(J=>[J.x,J.y]),E),m.insert(()=>et).attr("class","divider")}for(const rt of C){const J=y.height+D+rt;Q=Do(R,J,q+R,J,z),et=_.polygon(Q.map(at=>[at.x,at.y]),E),m.insert(()=>et).attr("class","divider")}if(ee(t,j),p&&t.look!=="handDrawn")if(i!=null&&iB.has(i))m.selectAll("path").attr("style",p);else{const J=p.split(";")?.filter(at=>at.includes("stroke"))?.map(at=>`${at}`).join("; ");m.selectAll("path").attr("style",J??""),m.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(rt){return Ht.rect(t,rt)},m}b(ru,"erBox");async function Ro(e,t,r,i=0,a=0,o=[],s=""){const n=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${i}, ${a})`).attr("style",s);t!==cf(t)&&(t=cf(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=n.node().appendChild(await mi(n,t,{width:Ta(t,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(ca(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=He(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}b(Ro,"addText");function Do(e,t,r,i,a){return e===r?[{x:e-a/2,y:t},{x:e+a/2,y:t},{x:r+a/2,y:i},{x:r-a/2,y:i}]:[{x:e,y:t-a/2},{x:e,y:t+a/2},{x:r,y:i+a/2},{x:r,y:i-a/2}]}b(Do,"lineToPolygon");async function g0(e,t,r,i,a=r.class.padding??12){const o=i?0:3,s=e.insert("g").attr("class",se(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,u=0,f=0;if(n=s.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const x=t.annotations[0];await Ds(n,{text:`«${x}»`},0),d=n.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await Ds(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();u=p.height,c=s.insert("g").attr("class","members-group text");let g=0;for(const x of t.members){const C=await Ds(c,x,g,[x.parseClassifier()]);g+=C+o}f=c.node().getBBox().height,f<=0&&(f=a/2),h=s.insert("g").attr("class","methods-group text");let m=0;for(const x of t.methods){const C=await Ds(h,x,m,[x.parseClassifier()]);m+=C+o}let y=s.node().getBBox();if(n!==null){const x=n.node().getBBox();n.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${d})`),y=s.node().getBBox(),c.attr("transform",`translate(0, ${d+u+a*2})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(f?f+a*4:a*2)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}b(g0,"textHelper");async function Ds(e,t,r,i=[]){const a=e.insert("g").attr("class","label").attr("style",i.join("; ")),o=Tr();let s="useHtmlLabels"in t?t.useHtmlLabels:ca(o.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!s&&n.startsWith("\\")&&(n=n.substring(1)),Js(n)&&(s=!0);const l=await mi(a,xd(ja(n)),{width:Ta(n,o)+50,classes:"markdown-node-label",useHtmlLabels:s},o);let c,h=1;if(s){const d=l.children[0],u=He(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1),await Kd(d),c=d.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&He(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(d.textContent=n[0]+n.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return a.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}b(Ds,"addText");async function p0(e,t){const r=Xe(),{theme:i,themeVariables:a}=r,{useGradient:o,borderColorArray:s}=a,n=r.class.padding??12,l=n,c=t.useHtmlLabels??ca(r.htmlLabels)??!0,h=t;h.annotations=h.annotations??[],h.members=h.members??[],h.methods=h.methods??[];const{shapeSvg:d,bbox:u}=await g0(e,t,r,c,l);Li(d,t.colorIndex,i,s);const{labelStyles:f,nodeStyles:p}=Gt(t);t.labelStyle=f,t.cssStyles=h.styles||"";const g=h.styles?.join(";")||p||"";t.cssStyles||(t.cssStyles=g.replaceAll("!important","").split(";"));const m=h.members.length===0&&h.methods.length===0&&!r.class?.hideEmptyMembersBox,y=Vt.svg(d),x=jt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Math.max(t.width??0,u.width);let k=Math.max(t.height??0,u.height);const v=(t.height??0)>u.height;h.members.length===0&&h.methods.length===0?k+=l:h.members.length>0&&h.methods.length===0&&(k+=l*2);const T=-C/2,F=-k/2;let A=m?n*2:h.members.length===0&&h.methods.length===0?-n:0;v&&(A=n*2);const M=y.rectangle(T-n,F-n-(m?n:h.members.length===0&&h.methods.length===0?-n/2:0),C+2*n,k+2*n+A,x),B=d.insert(()=>M,":first-child");B.attr("class","basic label-container outer-path");const $=B.node().getBBox(),P=d.select(".annotation-group").node().getBBox().height-(m?n/2:0)||0,I=d.select(".label-group").node().getBBox().height-(m?n/2:0)||0,_=d.select(".members-group").node().getBBox().height-(m?n/2:0)||0,E=(P+I+F+n-(F-n-(m?n:h.members.length===0&&h.methods.length===0?-n/2:0)))/2;if(d.selectAll(".text").each((L,q,W)=>{const R=He(W[q]),D=R.attr("transform");let G=0;if(D){const et=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);et&&(G=parseFloat(et[2]))}let j=G+F+n-(m?n:h.members.length===0&&h.methods.length===0?-n/2:0);if(R.attr("class").includes("methods-group")){const Q=Math.max(_,l/2);v?j=Math.max(E,P+I+Q+F+l*2+n)+l*2:j=P+I+Q+F+l*4+n}h.members.length===0&&h.methods.length===0&&r.class?.hideEmptyMembersBox&&(h.annotations.length>0?j=G-l:j=G),c||(j-=4);let z=T;(R.attr("class").includes("label-group")||R.attr("class").includes("annotation-group"))&&(z=-R.node()?.getBBox().width/2||0,d.selectAll("text").each(function(Q,et,rt){window.getComputedStyle(rt[et]).textAnchor==="middle"&&(z=0)})),R.attr("transform",`translate(${z}, ${j})`)}),h.members.length>0||h.methods.length>0||m){const L=P+I+F+n,q=y.line($.x,L,$.x+$.width,L+.001,x);d.insert(()=>q).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",g)}if(m||h.members.length>0||h.methods.length>0){const L=P+I+_+F+l*2+n,q=y.line($.x,v?Math.max(E,L):L,$.x+$.width,(v?Math.max(E,L):L)+.001,x);d.insert(()=>q).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",g)}if(h.look!=="handDrawn"&&d.selectAll("path").attr("style",g),B.select(":nth-child(2)").attr("style",g),d.selectAll(".divider").select("path").attr("style",g),t.labelStyle?d.selectAll("span").attr("style",t.labelStyle):d.selectAll("span").attr("style",g),!c){const L=RegExp(/color\s*:\s*([^;]*)/),q=L.exec(g);if(q){const W=q[0].replace("color","fill");d.selectAll("tspan").attr("style",W)}else if(f){const W=L.exec(f);if(W){const R=W[0].replace("color","fill");d.selectAll("tspan").attr("style",R)}}}return ee(t,B),t.intersect=function(L){return Ht.rect(t,L)},d}b(p0,"classBox");async function m0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const a=t,o=t,s=20,n=20,l="verifyMethod"in t,c=se(t),h=Xe(),{themeVariables:d}=h,{borderColorArray:u,requirementEdgeLabelBackground:f}=d,p=h.layout==="elk"?"start":"center",g=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let m;l?m=await Zi(g,`&lt;&lt;${a.type}&gt;&gt;`,0,t.labelStyle):m=await Zi(g,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let y=m;const x=await Zi(g,a.name,y,t.labelStyle+"; font-weight: bold;");if(y+=x+n,l){const $=await Zi(g,`${a.requirementId?`ID: ${a.requirementId}`:""}`,y,t.labelStyle,p);y+=$;const P=await Zi(g,`${a.text?`Text: ${a.text}`:""}`,y,t.labelStyle,p);y+=P;const I=await Zi(g,`${a.risk?`Risk: ${a.risk}`:""}`,y,t.labelStyle,p);y+=I,await Zi(g,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:""}`,y,t.labelStyle,p)}else{const $=await Zi(g,`${o.type?`Type: ${o.type}`:""}`,y,t.labelStyle,p);y+=$,await Zi(g,`${o.docRef?`Doc Ref: ${o.docRef}`:""}`,y,t.labelStyle,p)}const C=(g.node()?.getBBox().width??200)+s,k=(g.node()?.getBBox().height??200)+s,v=-C/2,T=-k/2,F=Vt.svg(g),A=jt(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const M=F.rectangle(v,T,C,k,A),B=g.insert(()=>M,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),u?.length){const $=t.colorIndex??0;g.attr("data-color-id",`color-${$%u.length}`)}if(g.selectAll(".label").each(($,P,I)=>{const _=He(I[P]),E=_.attr("transform");let L=0,q=0;if(E){const G=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(E);G&&(L=parseFloat(G[1]),q=parseFloat(G[2]))}const W=q-k/2;let R=v+s/2;(P===0||P===1)&&(R=L),_.attr("transform",`translate(${R}, ${W+s})`)}),y>m+x+n){const $=T+m+x+n;let P;if(t.look==="neo"){const E=[[v,$],[v+C,$],[v+C,$+.001],[v,$+.001]];P=F.polygon(E,A)}else P=F.line(v,$,v+C,$,A);g.insert(()=>P).attr("class","divider")}return ee(t,B),t.intersect=function($){return Ht.rect(t,$)},i&&t.look!=="handDrawn"&&(f||u?.length)&&g.selectAll("path").attr("style",i),g}b(m0,"requirementBox");async function Zi(e,t,r,i="",a="center"){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=Xe(),n=s.htmlLabels??!0,l=await mi(o,xd(ja(t)),{width:Ta(t,s)+50,classes:"markdown-node-label",useHtmlLabels:n,style:i},s);let c;if(n){const h=l.children[0],d=He(l);a==="start"&&He(h).style("text-align","left"),c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}else{const h=l.children[0];for(const d of h.children)i&&d.setAttribute("style",i);if(a==="start"){h.setAttribute("text-anchor","start");for(const d of h.children)d.setAttribute("text-anchor","start")}c=l.getBBox(),c.height+=6}return o.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}b(Zi,"addText");var aB=b(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function y0(e,t,{config:r}){const{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i||"";const o=10,s=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,g;u?{label:p,bbox:g}=await fo(u,"ticket"in t&&t.ticket||"",f):{label:p,bbox:g}=await fo(n,"ticket"in t&&t.ticket||"",f);const{label:m,bbox:y}=await fo(n,"assigned"in t&&t.assigned||"",f);t.width=s;const x=10,C=t?.width||0,k=Math.max(g.height,y.height)/2,v=Math.max(l.height+x*2,t?.height||0)+k,T=-C/2,F=-v/2;c.attr("transform","translate("+(h-C/2)+", "+(-k-l.height/2)+")"),p.attr("transform","translate("+(h-C/2)+", "+(-k+l.height/2)+")"),m.attr("transform","translate("+(h+C/2-y.width-2*o)+", "+(-k+l.height/2)+")");let A;const{rx:M,ry:B}=t,{cssStyles:$}=t;if(t.look==="handDrawn"){const P=Vt.svg(n),I=jt(t,{}),_=M||B?P.path(yi(T,F,C,v,M||0),I):P.rectangle(T,F,C,v,I);A=n.insert(()=>_,":first-child"),A.attr("class","basic label-container").attr("style",$||null)}else{A=n.insert("rect",":first-child"),A.attr("class","basic label-container __APA__").attr("style",a).attr("rx",M??5).attr("ry",B??5).attr("x",T).attr("y",F).attr("width",C).attr("height",v);const P="priority"in t&&t.priority;if(P){const I=n.append("line"),_=T+2,E=F+Math.floor((M??0)/2),L=F+v-Math.floor((M??0)/2);I.attr("x1",_).attr("y1",E).attr("x2",_).attr("y2",L).attr("stroke-width","4").attr("stroke",aB(P))}}return ee(t,A),t.height=v,t.intersect=function(P){return Ht.rect(t,P)},n}b(y0,"kanbanItem");async function x0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,halfPadding:s,label:n}=await he(e,t,se(t)),l=o.width+10*s,c=o.height+8*s,h=.15*l,{cssStyles:d}=t,u=o.width+20,f=o.height+20,p=Math.max(l,u),g=Math.max(c,f);n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);let m;const y=`M0 0
241
- a${h},${h} 1 0,0 ${p*.25},${-1*g*.1}
242
- a${h},${h} 1 0,0 ${p*.25},0
243
- a${h},${h} 1 0,0 ${p*.25},0
244
- a${h},${h} 1 0,0 ${p*.25},${g*.1}
245
-
246
- a${h},${h} 1 0,0 ${p*.15},${g*.33}
247
- a${h*.8},${h*.8} 1 0,0 0,${g*.34}
248
- a${h},${h} 1 0,0 ${-1*p*.15},${g*.33}
249
-
250
- a${h},${h} 1 0,0 ${-1*p*.25},${g*.15}
251
- a${h},${h} 1 0,0 ${-1*p*.25},0
252
- a${h},${h} 1 0,0 ${-1*p*.25},0
253
- a${h},${h} 1 0,0 ${-1*p*.25},${-1*g*.15}
254
-
255
- a${h},${h} 1 0,0 ${-1*p*.1},${-1*g*.33}
256
- a${h*.8},${h*.8} 1 0,0 0,${-1*g*.34}
257
- a${h},${h} 1 0,0 ${p*.1},${-1*g*.33}
258
- H0 V0 Z`;if(t.look==="handDrawn"){const x=Vt.svg(a),C=jt(t,{}),k=x.path(y,C);m=a.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Rr(d))}else m=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return m.attr("transform",`translate(${-p/2}, ${-g/2})`),ee(t,m),t.calcIntersect=function(x,C){return Ht.rect(x,C)},t.intersect=function(x){return Tt.info("Bang intersect",t,x),Ht.rect(t,x)},a}b(x0,"bang");async function b0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,halfPadding:s,label:n}=await he(e,t,se(t)),l=o.width+2*s,c=o.height+2*s,h=.15*l,d=.25*l,u=.35*l,f=.2*l,{cssStyles:p}=t;let g;const m=`M0 0
259
- a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
260
- a${u},${u} 1 0,1 ${l*.4},${-1*l*.1}
261
- a${d},${d} 1 0,1 ${l*.35},${l*.2}
262
-
263
- a${h},${h} 1 0,1 ${l*.15},${c*.35}
264
- a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
265
-
266
- a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
267
- a${u},${u} 1 0,1 ${-1*l*.5},0
268
- a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
269
-
270
- a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
271
- a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
272
- H0 V0 Z`;if(t.look==="handDrawn"){const y=Vt.svg(a),x=jt(t,{}),C=y.path(m,x);g=a.insert(()=>C,":first-child"),g.attr("class","basic label-container").attr("style",Rr(p))}else g=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",m);return n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),g.attr("transform",`translate(${-l/2}, ${-c/2})`),ee(t,g),t.calcIntersect=function(y,x){return Ht.rect(y,x)},t.intersect=function(y){return Tt.info("Cloud intersect",t,y),Ht.rect(t,y)},a}b(b0,"cloud");async function C0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,halfPadding:s,label:n}=await he(e,t,se(t)),l=o.width+8*s,c=o.height+2*s,h=5,d=t.look==="neo"?`
273
- M${-l/2} ${c/2-h}
274
- v${-c+2*h}
275
- q0,-${h} ${h},-${h}
276
- h${l-2*h}
277
- q${h},0 ${h},${h}
278
- v${c-h}
279
- H${-l/2}
280
- Z
281
- `:`
282
- M${-l/2} ${c/2-h}
283
- v${-c+2*h}
284
- q0,-${h} ${h},-${h}
285
- h${l-2*h}
286
- q${h},0 ${h},${h}
287
- v${c-2*h}
288
- q0,${h} ${-h},${h}
289
- h${-(l-2*h)}
290
- q${-h},0 ${-h},${-h}
291
- Z
292
- `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=a.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return a.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),a.append(()=>n.node()),ee(t,u),t.calcIntersect=function(f,p){return Ht.rect(f,p)},t.intersect=function(f){return Ht.rect(t,f)},a}b(C0,"defaultMindmapNode");async function w0(e,t){const r={padding:t.padding??0};return tu(e,t,r)}b(w0,"mindmapCircle");var $o=36,eo=50,oB=100,sB=80,Va=6,Wo=16,nB="bpmn",lB={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},_g;async function k0(){return _g??=Ge(async()=>{const{bpmnIcons:e}=await import("./ByGoYv9M.js");return{bpmnIcons:e}},[],import.meta.url).then(({bpmnIcons:e})=>{Dw(e.prefix)||Kp([{name:e.prefix,icons:e}])}),_g}b(k0,"ensureBpmnIcons");function S0(e){const t=e.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}b(S0,"dataDirectionOf");function v0(e){return e.metadata?.isCollection===!0}b(v0,"isCollectionData");async function Bl(e,t){return await k0(),So(e,{height:t,width:t,fallbackPrefix:nB})}b(Bl,"glyphSvg");var mn=b((e,t,r)=>{const i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-a})`)},"positionLabelBelow"),M0=b(async(e,t,r)=>{if(!t)return;const i=e.append("g").attr("class","bpmn-glyph");i.html(`<g>${await Bl(t,r)}</g>`),i.attr("transform",`translate(${-r/2}, ${-r/2})`)},"appendGlyph"),yn=b((e,t,r,i,a)=>{a&&(t.metadata={...t.metadata??{},drawnExtent:a});const o=e.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-r/2).attr("y",-i/2).attr("width",r).attr("height",i).attr("opacity",0).attr("aria-hidden","true");return ee(t,o),o},"reserveBounds"),cB=8,_l=b((e,t,r)=>Math.min(Math.max(e,t),r),"clamp"),Gl=b((e,t,r,i,a)=>{const o=e.x??0,s=e.y??0,n=t/2,l=r/2,c=i.x-o,h=i.y-s,d=a??(Math.abs(c)*l>Math.abs(h)*n?c>=0?"right":"left":h>=0?"bottom":"top"),u=b(f=>Math.max(0,f-Math.min(cB,f/2)),"reach");return d==="left"||d==="right"?{x:o+(d==="right"?n:-n),y:_l(i.y,s-u(l),s+u(l))}:{x:_l(i.x,o-u(n),o+u(n)),y:s+(d==="bottom"?l:-l)}},"faceProjectIntersect"),hB=b((e,t,r)=>{const i=e.x??0,a=e.y??0,o=t/2,s=r.x-i,n=r.y-a,l=o*.85;if(Math.abs(n)>=Math.abs(s)){const h=_l(s,-l,l);return{x:i+h,y:a+Math.sign(n||1)*Math.sqrt(o*o-h*h)}}const c=_l(n,-l,l);return{x:i+Math.sign(s||1)*Math.sqrt(o*o-c*c),y:a+c}},"ringIntersect"),dB=b((e,t,r,i)=>{const a=e.x??0,o=e.y??0,s=t/2,n=r/2,l=i.x-a,c=i.y-o;return Math.abs(l)*n>Math.abs(c)*s?{x:a+Math.sign(l)*s,y:o}:{x:a,y:o+Math.sign(c||1)*n}},"faceCentreIntersect");async function xn(e,t,r){const i=t,{labelStyles:a,nodeStyles:o}=Gt(t);t.labelStyle=a;const{rings:s,strokeWidth:n}=lB[r],l=$o/2,{shapeSvg:c,bbox:h,label:d}=await he(e,t,se(t,`bpmn-event bpmn-event-${r}`)),u=c.insert("g",":first-child").attr("class","bpmn-event-body");u.attr("style",o);for(let y=0;y<s;y++)u.append("circle").attr("class",y===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",l-y*3).style("stroke-width",`${n}px`);await M0(u,i.icon,Wo);const f=h.height>0&&!!t.label,p=f?Va+h.height:0,g=$o+2*p,m=Math.max($o,f?h.width:0);return f&&mn(d,h,l+Va+h.height/2),yn(c,t,m,g,{width:$o,height:$o}),t.intersect=function(y){return hB(t,$o,y)},c}b(xn,"renderBpmnEvent");async function T0(e,t){return xn(e,t,"start")}b(T0,"bpmnStart");async function B0(e,t){return xn(e,t,"intermediate")}b(B0,"bpmnIntermediate");async function _0(e,t){return xn(e,t,"boundary")}b(_0,"bpmnBoundary");async function L0(e,t){return xn(e,t,"end")}b(L0,"bpmnEnd");async function A0(e,t){const r=t,{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const o=eo/2,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"bpmn-gateway")),c=s.insert("g",":first-child").attr("class","bpmn-gateway-body");c.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-o} ${o},0 0,${o} ${-o},0`).attr("style",a),await M0(c,r.icon,Wo+2);const h=n.height>0&&!!t.label,d=h?Va+n.height:0,u=eo+2*d,f=Math.max(eo,h?n.width:0);return h&&mn(l,n,o+Va+n.height/2),yn(s,t,f,u,{width:eo,height:eo}),t.intersect=function(p){return dB(t,eo,eo,p)},s}b(A0,"bpmnGateway");async function F0(e,t){const r=t,{labelStyles:i,nodeStyles:a}=Gt(t);t.labelStyle=i;const{shapeSvg:o,bbox:s,label:n}=await he(e,t,se(t,"bpmn-activity")),l=r.markers??[],c=r.icon,h=c?Wo+6:10,d=l.length>0?Wo+4:10,u=Math.max(oB,s.width+16),f=Math.max(sB,s.height+h+d),p=o.insert("g",":first-child").attr("class","bpmn-activity-body");if(p.append("rect").attr("class","bpmn-activity-rect").attr("x",-u/2).attr("y",-f/2).attr("width",u).attr("height",f).attr("rx",10).attr("ry",10).attr("style",a),c){const g=p.append("g").attr("class","bpmn-activity-icon");g.html(`<g>${await Bl(c,Wo)}</g>`),g.attr("transform",`translate(${-u/2+6}, ${-f/2+6})`)}if(l.length>0){const g=p.append("g").attr("class","bpmn-activity-markers"),m=Wo-2,y=l.length*m;for(const[x,C]of l.entries()){const k=g.append("g");k.html(`<g>${await Bl(C,m)}</g>`),k.attr("transform",`translate(${-y/2+x*m}, 0)`)}g.attr("transform",`translate(0, ${f/2-m-3})`)}if(s.height>0){const g=-f/2+h,m=f/2-d;mn(n,s,(g+m)/2)}return ee(t,p),t.intersect=function(g){return Gl(t,u,f,g)},o}b(F0,"bpmnActivity");var As=36,Eo=50,En=10;async function $0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t,"bpmn-data-object")),n=a.insert("g",":first-child").attr("class","bpmn-data-body"),l=-As/2,c=-Eo/2,h=As/2,d=Eo/2;n.append("path").attr("class","bpmn-data-page").attr("d",`M${l},${c} H${h-En} L${h},${c+En} V${d} H${l} Z`).attr("style",i),n.append("path").attr("class","bpmn-data-fold").attr("d",`M${h-En},${c} V${c+En} H${h}`);const u=S0(t);u&&n.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${u}`).attr("d",`M${l+4},${c+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),v0(t)&&n.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${d-11} v9 M0,${d-11} v9 M4,${d-11} v9`);const f=o.height>0&&!!t.label,p=f?Va+o.height:0,g=Eo+2*p,m=Math.max(As,f?o.width:0);return f&&mn(s,o,Eo/2+Va+o.height/2),yn(a,t,m,g,{width:As,height:Eo}),t.intersect=function(y){return Gl(t,As,Eo,y)},a}b($0,"bpmnDataObject");var Gi=50;async function E0(e,t){const{labelStyles:r,nodeStyles:i}=Gt(t);t.labelStyle=r;const{shapeSvg:a,bbox:o,label:s}=await he(e,t,se(t,"bpmn-data-store")),n=a.insert("g",":first-child").attr("class","bpmn-data-body"),l=Gi/2,c=6;n.append("path").attr("class","bpmn-store-body").attr("d",`M${-l},${-l+c} a${l},${c} 0 0 1 ${Gi},0 V${l-c} a${l},${c} 0 0 1 ${-Gi},0 Z`).attr("style",i);for(const p of[0,5,10])n.append("path").attr("class","bpmn-store-rings").attr("d",`M${-l},${-l+c+p} a${l},${c} 0 0 0 ${Gi},0`);const h=o.height>0&&!!t.label,d=h?Va+o.height:0,u=Gi+2*d,f=Math.max(Gi,h?o.width:0);return h&&mn(s,o,l+Va+o.height/2),yn(a,t,f,u,{width:Gi,height:Gi}),t.intersect=function(p){return Gl(t,Gi,Gi,p)},a}b(E0,"bpmnDataStore");async function P0(e,t){const{labelStyles:r}=Gt(t);t.labelStyle=r,t.wrappingWidth=160;const{shapeSvg:i,bbox:a,label:o}=await he(e,t,se(t,"bpmn-annotation")),s=8,n=Math.max(28,a.height+s*2),l=a.width+s*2+6,c=t.metadata?.attachFace==="right"?"right":"left";i.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",c==="right"?`M${l/2-6},${-n/2} h6 V${n/2} h-6`:`M${-l/2+6},${-n/2} h-6 V${n/2} h6`);const d=c==="right"?-l/2+s:-l/2+s+6;return o.attr("transform",`translate(${d-(a.x??0)+(a.left??0)},${-a.height/2-((a.y??0)-(a.top??0))})`),yn(i,t,l,n),t.intersect=function(u){return Gl(t,l,n,u,c)},i}b(P0,"bpmnAnnotation");var uB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Qx},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Vx},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Jx},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:i0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:fx},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:gx},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Cx},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Ky},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:ox},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:ex},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:ux},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:tu},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:x0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:b0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:jx},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Sx},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ex},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:$x},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:l0},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Ax},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:mx},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:s0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:rx},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Zx},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:r0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:e0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:wx},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:vx},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:lx},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:cx},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:hx},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Px},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:d0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:kx},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:n0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ix},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:dx},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:px},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:h0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:f0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:xx},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:c0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:bx},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Kx},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Yx},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Hx},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Zy},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:nx},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:o0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:a0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:u0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Gx},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ox}],fB=b(()=>{const t=[...Object.entries({state:t0,choice:ix,note:Xx,composite:ax,rectWithTitle:Ux,labelRect:Fx,block_arrow:tx,collapsedGroup:Jy,iconSquare:_x,iconCircle:Tx,icon:Mx,iconRounded:Bx,imageSquare:Lx,anchor:Uy,kanbanItem:y0,mindmapCircle:w0,defaultMindmapNode:C0,classBox:p0,erBox:ru,requirementBox:m0,usecaseActor:Rx,usecaseActorHollow:Nx,usecaseActorAwesome:Dx,usecaseActorIcon:qx,usecaseBusiness:Wx,usecaseEllipse:yx,usecaseJsonTable:zx,"bpmn-start":T0,"bpmn-intermediate":B0,"bpmn-boundary":_0,"bpmn-end":L0,"bpmn-gateway":A0,"bpmn-activity":F0,"bpmn-data":$0,"bpmn-data-store":E0,"bpmn-annotation":P0}),...uB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(a=>[a,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),I0=fB();function gB(e){return e in I0}b(gB,"isValidShape");var bn=b(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),Ul=new Map;async function O0(e,t,r){let i,a;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const o=t.shape?I0[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),a=await o(i,t,r)}else a=await o(e,t,r),i=a;return i.attr("data-look",Rr(t.look)),t.tooltip&&a.attr("title",t.tooltip),Ul.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}b(O0,"insertNode");var U4=b((e,t)=>{Ul.set(t.id,e)},"setNodeElem"),V4=b(()=>{Ul.clear()},"clear"),Z4=b(e=>{const t=Ul.get(e.id);Tt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),R0=b(async(e,t,{variant:r="swimlane"}={})=>{const i=r==="pool",a=i?"pool swimlane":"swimlane",o=i?"pool-label swimlane-label":"swimlane-label",s=i?"pool-title swimlane-title":"swimlane-title",n=i?"pool-body swimlane-body":"swimlane-body",l=Xe(),{theme:c,themeVariables:h,handDrawnSeed:d}=l,{clusterBkg:u,clusterBorder:f,borderColorArray:p}=h,g=f,{labelStyles:m,nodeStyles:y,borderStyles:x,backgroundStyles:C}=Gt(t),k=e.insert("g").attr("class","cluster "+a+" "+(t.cssClasses||"")).attr("id",t.domId??t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);Li(k,t.colorIndex,c,p);const v=ca(l.flowchart.htmlLabels),T=t.direction==="LR",F=k.insert("g").attr("class","cluster-label "+o),A=await mi(F,t.label,{style:t.labelStyle,useHtmlLabels:v,isNode:!0,width:t.width});let M=A.getBBox();if(v){const G=A.children[0],j=He(A);M=G.getBoundingClientRect(),j.attr("width",M.width),j.attr("height",M.height)}const B=t.padding??0,$=t.width<=M.width+B?M.width+B:t.width;t.width<=M.width+B?t.diff=($-t.width)/2-B:t.diff=-B;const P=t.height,I=t.y-P/2,_=t.y+P/2,E=t.x-$/2,L=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:I+P/3,q=T?4:0,W=M.height+2*q;let R,D;if(T){const G=Math.max(W,M.height+2*q),j=E+G,z=Math.max(0,$-G);if(t.look==="handDrawn"){const rt=Vt.svg(k),J=jt(t,{roughness:.7,fill:u,stroke:g,seed:d}),at=jt(t,{roughness:.7,fill:"none",stroke:g,seed:d}),xt=rt.rectangle(E,I,G,P,J);R=k.insert(()=>xt,":first-child").attr("class",s);const H=rt.rectangle(j,I,z,P,at);D=k.insert(()=>H,":first-child").attr("class",n),R.select("path:nth-child(2)").attr("style",x.join(";")),R.select("path").attr("style",C.join(";").replace("fill","stroke"))}else R=k.insert("rect",":first-child"),D=k.insert("rect",":first-child"),R.attr("class",s).attr("style",y).attr("x",E).attr("y",I).attr("width",G).attr("height",P).attr("fill",u).attr("stroke",g),D.attr("class",n).attr("style",y).attr("x",j).attr("y",I).attr("width",z).attr("height",P).attr("fill","none").attr("stroke",g);const Q=E+G/2,et=t.y;F.attr("transform",`translate(${Q}, ${et}) rotate(-90) translate(${-M.width/2}, ${-M.height/2})`)}else{const G=Math.max(0,L-I),j=Math.min(W,G),z=I+j,Q=Math.max(0,_-z),et=t.x-$/2;if(t.look==="handDrawn"){const at=Vt.svg(k),xt=jt(t,{roughness:.7,fill:u,stroke:g,fillWeight:3,seed:d}),H=jt(t,{roughness:.7,fill:"none",stroke:g,seed:d}),Y=at.rectangle(et,I,$,j,xt);R=k.insert(()=>Y,":first-child").attr("class",s);const Z=at.rectangle(et,z,$,Q,H);D=k.insert(()=>Z,":first-child").attr("class",n),R.select("path:nth-child(2)").attr("style",x.join(";")),R.select("path").attr("style",C.join(";").replace("fill","stroke"))}else R=k.insert("rect",":first-child"),D=k.insert("rect",":first-child"),R.attr("class",s).attr("style",y).attr("x",et).attr("y",I).attr("width",$).attr("height",j).attr("fill",u).attr("stroke",g),D.attr("class",n).attr("style",y).attr("x",et).attr("y",z).attr("width",$).attr("height",Q).attr("fill","none").attr("stroke",g);const rt=t.x-M.width/2,J=I+(j-M.height)/2;F.attr("transform",`translate(${rt}, ${J})`)}if(Tt.trace("Swimlane data ",t,JSON.stringify(t)),m){const G=F.select("span");G&&G.attr("style",m)}return t.offsetX=0,t.width=$,t.height=P,t.offsetY=M.height-B/2,t.intersect=function(G){return Ea(t,G)},{cluster:k,labelBBox:M}},"swimlane"),D0=b(async(e,t)=>{Tt.info("Creating subgraph rect for ",t.id,t);const r=Xe(),{theme:i,themeVariables:a,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=a,{labelStyles:c,nodeStyles:h,borderStyles:d,backgroundStyles:u}=Gt(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);Li(f,t.colorIndex,i,l);const p=zr(r),g=f.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await mi(g,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):m=await wa(g,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(zr(r)){const M=m.children[0],B=He(m);y=M.getBoundingClientRect(),B.attr("width",y.width),B.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,k=t.x-x/2,v=t.y-C/2;Tt.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const M=Vt.svg(f),B=jt(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),$=M.path(yi(k,v,x,C,0),B);T=f.insert(()=>(Tt.debug("Rough node insert CXC",$),$),":first-child"),T.select("path:nth-child(2)").attr("style",d.join(";")),T.select("path").attr("style",u.join(";").replace("fill","stroke"))}else T=f.insert("rect",":first-child"),T.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",k).attr("y",v).attr("width",x).attr("height",C);const{subGraphTitleTopMargin:F}=bn(r);if(g.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+F})`),c){const M=g.select("span");M&&M.attr("style",c)}const A=T.node().getBBox();return t.offsetX=0,t.width=A.width,t.height=A.height,t.offsetY=y.height-t.padding/2,t.intersect=function(M){return Ea(t,M)},{cluster:f,labelBBox:y}},"rect"),pB=b((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),a=0*t.padding,o=a/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+a).attr("height",t.height+a).attr("fill","none");const s=i.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(n){return Ea(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),mB=b(async(e,t)=>{const r=Xe(),{theme:i,themeVariables:a,handDrawnSeed:o}=r,{altBackground:s,borderColorArray:n,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=a,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);Li(d,t.colorIndex,i,n);const u=d.insert("g",":first-child"),f=d.insert("g").attr("class","cluster-label");let p=d.append("rect");const g=await wa(f,t.label,t.labelStyle,void 0,!0);let m=g.getBBox();if(zr(r)){const $=g.children[0],P=He(g);m=$.getBoundingClientRect(),P.attr("width",m.width),P.attr("height",m.height)}const y=0*t.padding,x=y/2,C=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const k=t.height+y,v=t.height+y-m.height-6,T=t.x-C/2,F=t.y-k/2;t.width=C;const A=t.y-t.height/2-x+m.height+2;let M;if(t.look==="handDrawn"){const $=t.cssClasses.includes("statediagram-cluster-alt"),P=Vt.svg(d),I=t.rx||t.ry?P.path(yi(T,F,C,k,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:o}):P.rectangle(T,F,C,k,{seed:o});M=d.insert(()=>I,":first-child");const _=P.rectangle(T,A,C,v,{fill:$?s:l,fillStyle:$?"hachure":"solid",stroke:h,seed:o});M=d.insert(()=>I,":first-child"),p=d.insert(()=>_),M.attr("class","outer"),p.attr("class","inner")}else M=u.insert("rect",":first-child"),M.attr("class","outer").attr("x",T).attr("y",F).attr("width",C).attr("height",k).attr("data-look",t.look),p.attr("class","inner").attr("x",T).attr("y",A).attr("width",C).attr("height",v);f.attr("transform",`translate(${t.x-m.width/2}, ${F+1-(zr(r)?0:3)})`);const B=M.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function($){return Ea(t,$)},{cluster:d,labelBBox:m}},"roundedWithTitle"),yB=b(async(e,t)=>{Tt.info("Creating subgraph rect for ",t.id,t);const r=Xe(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:o,clusterBorder:s}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Gt(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=zr(r),f=d.insert("g").attr("class","cluster-label "),p=await mi(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let g=p.getBBox();if(zr(r)){const F=p.children[0],A=He(p);g=F.getBoundingClientRect(),A.attr("width",g.width),A.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,x=t.x-m/2,C=t.y-y/2;Tt.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const F=Vt.svg(d),A=jt(t,{roughness:.7,fill:o,stroke:s,fillWeight:4,seed:a}),M=F.path(yi(x,C,m,y,t.rx),A);k=d.insert(()=>(Tt.debug("Rough node insert CXC",M),M),":first-child"),k.select("path:nth-child(2)").attr("style",c.join(";")),k.select("path").attr("style",h.join(";").replace("fill","stroke"))}else k=d.insert("rect",":first-child"),k.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",x).attr("y",C).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:v}=bn(r);if(f.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+v})`),n){const F=f.select("span");F&&F.attr("style",n)}const T=k.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=g.height-t.padding/2,t.intersect=function(F){return Ea(t,F)},{cluster:d,labelBBox:g}},"kanbanSection"),xB=b((e,t)=>{const r=Xe(),{theme:i,themeVariables:a,handDrawnSeed:o}=r,{altBackground:s,nodeBorder:n,borderColorArray:l}=a,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);Li(c,t.colorIndex,i,l);const h=c.insert("g",":first-child"),d=0*t.padding,u=t.width+d;t.diff=-t.padding;const f=t.height+d,p=t.x-u/2,g=t.y-f/2;t.width=u;let m;if(t.look==="handDrawn"){const C=Vt.svg(c).rectangle(p,g,u,f,{fill:s??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:n,seed:o});m=c.insert(()=>C,":first-child").attr("class","divider")}else{m=h.insert("rect",":first-child");let x="outer";t.look,x="divider",m.attr("class",x).attr("x",p).attr("y",g).attr("width",u).attr("height",f).attr("data-look",t.look)}const y=m.node().getBBox();return t.height=y.height,t.offsetX=0,t.offsetY=0,t.intersect=function(x){return Ea(t,x)},{cluster:c,labelBBox:{}}},"divider"),bB=b(async(e,t,r)=>{Tt.info(`Creating ${r.cssClass} for `,t.id,t);const i=Xe(),{theme:a,themeVariables:o,handDrawnSeed:s}=i,{borderColorArray:n}=o,{labelStyles:l,borderStyles:c}=Gt(t),h=e.insert("g").attr("class","cluster "+r.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);Li(h,t.colorIndex,a,n);const d=zr(i),u=h.insert("g").attr("class","cluster-label");let f={width:0,height:0};const p=t.label?.trim();if(p){let v;if(t.labelType==="markdown"?v=await mi(u,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width}):v=await wa(u,t.label,t.labelStyle||"",!1,!0),f=v.getBBox(),d){const T=v.children[0],F=He(v);f=T.getBoundingClientRect(),F.attr("width",f.width),F.attr("height",f.height)}}const g=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(g-t.width)/2-t.padding:t.diff=-t.padding;const m=t.height,y=t.x-g/2,x=t.y-m/2;let C;if(t.look==="handDrawn"){const v=Vt.svg(h),T=jt(t,{roughness:r.roughness,fill:r.fill,stroke:r.stroke,strokeWidth:r.strokeWidth,seed:s,...r.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...r.strokeDash?{strokeLineDash:r.strokeDash}:{}}),F=v.path(yi(y,x,g,m,r.rx),T);C=h.insert(()=>F,":first-child"),C.select("path:nth-child(2)").attr("style",c.join(";"))}else C=h.insert("rect",":first-child"),C.attr("rx",r.rx).attr("ry",r.rx).attr("x",y).attr("y",x).attr("width",g).attr("height",m).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",r.strokeWidth+"px"),r.strokeDash&&C.attr("stroke-dasharray",r.strokeDash.join(", "));if(p){const{subGraphTitleTopMargin:v}=bn(i);if(u.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+v})`),l){const T=u.select("span");T&&T.attr("style",l)}}const k=C.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=f.height-t.padding/2,t.intersect=function(v){return Ea(t,v)},{cluster:h,labelBBox:f}},"createContainerGroup"),CB=b(async(e,t)=>{const{themeVariables:r}=Xe(),i=r.flowContainerStroke||r.secondaryBorderColor;return bB(e,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:i,strokeWidth:.75,roughness:.7})},"flowGroup"),wB=b((e,t)=>{const r=e.boundaryType||"rect",i=r==="package"?20:e.padding,a=r==="package"?t.height+10:0,o=Math.max(e.width,t.width+i),s=r==="package"?Math.max(e.height,a+e.padding*2):e.height,n=e.x-o/2,l=e.y-s/2;return{boundaryType:r,width:o,height:s,x:n,y:l,bodyY:l+a,bodyHeight:s-a,tabHeight:a,tabWidth:r==="package"?Math.min(o,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),kB=b(async(e,t)=>{Tt.info("Creating usecase system boundary for ",t.id,t);const r=Xe(),{theme:i,themeVariables:a,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=a,{labelStyles:c,nodeStyles:h}=Gt(t),{stylesMap:d}=Za(t),u=t.boundaryType||"rect",f=e.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${u} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",u).attr("data-look",t.look);Li(f,t.colorIndex,i,l);const p=zr(r),g=f.insert("g").attr("class","cluster-label system-boundary-title"),m=await mi(g,t.label,{style:c,useHtmlLabels:p,isNode:!0});let y=m.getBBox();if(p){const I=m.children[0],_=He(m);y=I.getBoundingClientRect(),_.attr("width",y.width),_.attr("height",y.height)}const x=wB(t,y),{width:C,height:k,x:v,y:T,bodyY:F,bodyHeight:A,tabHeight:M,tabWidth:B}=x;t.diff=t.width<=y.width+t.padding?(C-t.width)/2-t.padding:-t.padding;const $=jt(t,{fill:d.get("fill")||s,stroke:d.get("stroke")||n,strokeWidth:d.get("stroke-width")?.replace("px","")||1,seed:o});if(t.look==="handDrawn"){const I=Vt.svg(f),_=I.rectangle(v,F,C,A,$);if(f.insert(()=>_,":first-child").attr("class","boundary-body label-container"),u==="package"){const E=I.rectangle(v,T,B,M,$);f.insert(()=>E,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else f.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",h).attr("x",v).attr("y",F).attr("width",C).attr("height",A),u==="package"&&f.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",h).attr("x",v).attr("y",T).attr("width",B).attr("height",M);const{subGraphTitleTopMargin:P}=bn(r);return u==="package"?g.attr("transform",`translate(${v+(B-y.width)/2}, ${T+(M-y.height)/2})`):g.attr("transform",`translate(${t.x-y.width/2}, ${T+P})`),c&&(g.attr("style",c),g.select("span").attr("style",c)),t.offsetX=0,t.width=C,t.height=k,t.offsetY=y.height-t.padding/2,t.labelBBox=y,t.intersect=function(I){return Ea(t,I)},{cluster:f,labelBBox:y}},"usecaseSystemBoundary"),SB=D0,vB=b((e,t)=>R0(e,t,{variant:"pool"}),"pool"),MB={rect:D0,squareRect:SB,roundedWithTitle:mB,noteGroup:pB,divider:xB,kanbanSection:yB,flowGroup:CB,usecaseSystemBoundary:kB,swimlane:R0,pool:vB},TB=new Set(["noteGroup","divider"]),K4=b(e=>!TB.has(e??"rect"),"clusterPaintsTitle"),N0=new Map,BB=b(async(e,t)=>{const r=t.shape||"rect",i=await MB[r](e,t);return N0.set(t.id,i),i},"insertCluster"),Q4=b(()=>{N0=new Map},"clear"),Fs=b((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),qr={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Lg={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5,arrow_open_head:4,arrow_hollow_circle:8};function Ns(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Mr(e),t=Mr(t);const[r,i]=[e.x,e.y],[a,o]=[t.x,t.y],s=a-r,n=o-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}b(Ns,"calculateDeltaAndAngle");var Mr=b(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),_B=b(e=>({x:b(function(t,r,i){let a=0;const o=Mr(i[0]).x<Mr(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(qr,e.arrowTypeStart)){const{angle:f,deltaX:p}=Ns(i[0],i[1]);a=qr[e.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(qr,e.arrowTypeEnd)){const{angle:f,deltaX:p}=Ns(i[i.length-1],i[i.length-2]);a=qr[e.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const s=Math.abs(Mr(t).x-Mr(i[i.length-1]).x),n=Math.abs(Mr(t).y-Mr(i[i.length-1]).y),l=Math.abs(Mr(t).x-Mr(i[0]).x),c=Math.abs(Mr(t).y-Mr(i[0]).y),h=qr[e.arrowTypeStart],d=qr[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=o==="right"?-1:1,a-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=o==="right"?-1:1,a+=f}return Mr(t).x+a},"x"),y:b(function(t,r,i){let a=0;const o=Mr(i[0]).y<Mr(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(qr,e.arrowTypeStart)){const{angle:f,deltaY:p}=Ns(i[0],i[1]);a=qr[e.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(qr,e.arrowTypeEnd)){const{angle:f,deltaY:p}=Ns(i[i.length-1],i[i.length-2]);a=qr[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const s=Math.abs(Mr(t).y-Mr(i[i.length-1]).y),n=Math.abs(Mr(t).x-Mr(i[i.length-1]).x),l=Math.abs(Mr(t).y-Mr(i[0]).y),c=Math.abs(Mr(t).x-Mr(i[0]).x),h=qr[e.arrowTypeStart],d=qr[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=o==="up"?-1:1,a-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=o==="up"?-1:1,a+=f}return Mr(t).y+a},"y")}),"getLineFunctionsWithOffset"),q0=1,LB=b(e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:q0,"getStepDuration"),iu=b(e=>typeof e.step=="number"&&Number.isInteger(e.step)&&e.step>0,"isStepEdge"),Ag=[.25,.35,.15,.65,.75,.5,.85,.1,.9],Ih=9,AB=11,FB=2,$B="#333333",Fg=12,$g=6,Eg=14,Pg=.01,EB=4.5,W0=/translate\(\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i,PB=4,IB=.6,OB=4,RB=b((e,t,r=q0)=>{const i=Math.max(t,e);return{begin:(e-1)*r,dur:r,gap:(i-1)*r}},"getEdgeStepTiming"),DB=b(e=>`step_${Array.from(e,t=>/[\dA-Za-z]/.test(t)?t:`_${(t.codePointAt(0)??0).toString(16)}_`).join("")}`,"toAnimationId"),NB=b(e=>{const t=/^m\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i.exec(e.trim());return t?`translate(${t[1]},${t[2]}) `:""},"pathStartTranslate"),qB=b(e=>Array.from(e,(t,r)=>{const i=t.codePointAt(0)??0;if(i===0)return"�";const a=i<=31||i===127,o=/\d/.test(t)&&(r===0||r===1&&e.startsWith("-"));return a||o?`\\${i.toString(16)} `:e==="-"?"\\-":i>=128||/[\w-]/.test(t)?t:`\\${t}`}).join(""),"escapeCssIdentifierFallback"),WB=b(e=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):qB(e),"escapeCssIdentifier"),zB=b((e,t)=>{const r=e.node(),i=r?.ownerSVGElement??r?.closest?.("svg")??r,a=t||i?.getAttribute("id");if(!i||!a||i.querySelector("style.edge-step-style"))return;const o=`#${WB(a)} `,s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","style");s.setAttribute("class","edge-step-style"),s.textContent=`@media (prefers-reduced-motion: reduce) { ${o}.edge-step-dot, ${o}.edge-step-highlight { display: none; } }`,i.appendChild(s)},"ensureReducedMotionStyle"),HB=b((e,t)=>{const r=e.filter(o=>Number.isFinite(o.x)&&Number.isFinite(o.y));if(r.length===0)return;const i=r.slice(1).map((o,s)=>Math.hypot(o.x-r[s].x,o.y-r[s].y));let a=i.reduce((o,s)=>o+s,0)*t;for(const[o,s]of i.entries()){if(a<=s&&s>0){const n=a/s,l=r[o],c=r[o+1];return{x:l.x+(c.x-l.x)*n,y:l.y+(c.y-l.y)*n}}a-=s}return r[r.length-1]},"pointAlongPolyline"),YB=b((e,t)=>{const r=typeof t?.getTotalLength=="function"?t.getTotalLength():0,i=t?.getPointAtLength?.bind(t);return r>0&&i?a=>{const{x:o,y:s}=i(r*a);return{x:o,y:s}}:a=>HB(e,a)},"createPathSampler"),XB=b((e,t)=>Math.min(Number.POSITIVE_INFINITY,...t.map(r=>{const i=Math.max(Math.abs(e.x-r.x)-r.halfWidth,0),a=Math.max(Math.abs(e.y-r.y)-r.halfHeight,0);return Math.hypot(i,a)-Ih})),"roomAround"),jB=b((e,t)=>{const r=e(t),i=e(Math.max(t-Pg,0)),a=e(Math.min(t+Pg,1));if(!r||!i||!a)return[];const o=Math.hypot(a.x-i.x,a.y-i.y);if(o===0)return[];const s={x:-(a.y-i.y)/o,y:(a.x-i.x)/o};return[1,-1].map(n=>({x:r.x+s.x*Eg*n,y:r.y+s.y*Eg*n}))},"besideThePath"),GB=b((e,t)=>{const r=[...Ag.map(e),...Ag.flatMap(o=>jB(e,o))];let i,a=Number.NEGATIVE_INFINITY;for(const o of r){if(!o||!Number.isFinite(o.x)||!Number.isFinite(o.y))continue;const s=XB(o,t);if(s>=FB)return o;s>a&&(i=o,a=s)}return i},"chooseBadgePosition"),z0=b((e,t)=>({...e,halfWidth:t,halfHeight:t}),"square"),UB=b(e=>{const t=W0.exec(e.getAttribute("transform")??"");return t?{x:Number(t[1]),y:Number(t[2])}:{x:0,y:0}},"translationOf"),au=b(e=>{const t={x:0,y:0};for(let r=e;r&&r.localName!=="svg";r=r.parentElement){const{x:i,y:a}=UB(r);t.x+=i,t.y+=a}return t},"offsetInSvg"),VB=b((e,t)=>{if(!W0.test(e.getAttribute("transform")??""))return;const r=au(e),i=r.x-t.x,a=r.y-t.y,o=e.getBBox?.();if(o)return{x:i+o.x+o.width/2,y:a+o.y+o.height/2,halfWidth:o.width/2,halfHeight:o.height/2}},"boxedObstacle"),ZB=b(e=>{try{const t=JSON.parse(atob(e.getAttribute("data-points")??""));return Array.isArray(t)?t:[]}catch{return[]}},"readPoints"),Ig=b((e,t)=>{const r=Math.hypot(e.x-t.x,e.y-t.y);if(r===0)return z0(e,Fg);const i={x:(e.x-t.x)/r,y:(e.y-t.y)/r},a=Fg/2;return{x:e.x-i.x*a,y:e.y-i.y*a,halfWidth:Math.abs(i.x)*a+Math.abs(i.y)*$g,halfHeight:Math.abs(i.y)*a+Math.abs(i.x)*$g}},"arrowheadObstacle"),Og=b((e,t)=>{const r=e.getAttribute(t);return!!r&&r!=="none"},"hasMarker"),KB=b((e,t)=>{const r=ZB(e).filter(n=>Number.isFinite(n?.x)&&Number.isFinite(n?.y));if(r.length===0)return[];const i=au(e),a=b(n=>({x:n.x+i.x-t.x,y:n.y+i.y-t.y}),"toSvg"),o=r.length-1,s=[];return Og(e,"marker-start")&&s.push(Ig(a(r[0]),a(r[Math.min(1,o)]))),Og(e,"marker-end")&&s.push(Ig(a(r[o]),a(r[Math.max(o-1,0)]))),s},"arrowheadObstacles"),H0=b(e=>{const t={x:0,y:0},r=[...e?.querySelectorAll(".edgeLabel, .node")??[]].map(a=>VB(a,t)).filter(a=>a!==void 0),i=[...e?.querySelectorAll('path[data-edge="true"]')??[]].flatMap(a=>KB(a,t));return[...r,...i]},"collectBadgeObstacles"),QB=b((e,t)=>{if(!e.label||t.length===0)return[];const{x:r,y:i}=pi.calcLabelPosition(t);return[{x:r,y:i,halfWidth:(e.width??0)/2,halfHeight:(e.height??0)/2}]},"edgeLabelObstacles"),JB=b(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},"linearChannel"),Rg=b(e=>{try{const[t,r,i]=["r","g","b"].map(a=>JB(GC(e,a)));return .2126*t+.7152*r+.0722*i}catch{return}},"relativeLuminance"),t_=b((e,t)=>{const r=Rg(e),i=Rg(t);return r===void 0||i===void 0?0:(Math.max(r,i)+.05)/(Math.min(r,i)+.05)},"contrastRatio"),e_=b((e,t)=>{const i=[...t.filter(o=>!!o),"#ffffff","#000000"].map(o=>({color:o,ratio:t_(e,o)}));return(i.find(({ratio:o})=>o>=EB)??i.reduce((o,s)=>s.ratio>o.ratio?s:o)).color},"pickBadgeTextColor"),r_=b(e=>{const t=e?.replace(/^stroke:\s*/,"").trim();return t===""?void 0:t},"bareColor"),i_=b((e,t,r,i=H0(e.node()?.closest("svg")))=>{if(!iu(t)||!t.showStepNumber)return;const a=au(e.node()),o=i.map(c=>({...c,x:c.x-a.x,y:c.y-a.y})),s=GB(YB(r.points,r.pathNode),[...o,...QB(t,r.points)]);if(!s)return;const n=r_(r.color)??$B,l=e.append("g").attr("class","edge-step-badge").attr("transform",`translate(${s.x},${s.y})`).attr("pointer-events","none").attr("data-step",t.step);return l.append("circle").attr("r",Ih).attr("fill",n),l.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",AB).attr("fill",e_(n,r.textColors??[])).text(String(t.step)),z0({x:s.x+a.x,y:s.y+a.y},Ih)},"insertEdgeStepBadge"),Dg=b((e,t,r)=>{e.append("animateTransform").attr("attributeName","transform").attr("type","scale").attr("values","1;1").attr("dur",`${r}s`).attr("begin",`${t}.begin`).attr("fill","remove")},"showWhileStepPlays"),a_=b((e,t,r,i,a)=>{if(!iu(t)||!r)return;const{begin:o,dur:s,gap:n}=RB(t.step,t.stepCount??t.step,LB(t.stepDuration)),l=DB(`${i}-${t.id}-step`),c=`${NB(r)}scale(0)`,h=a?.replace(/^stroke:\s*/,""),d=e.append("path").attr("class","edge-step-highlight").attr("aria-hidden","true").attr("d",r).attr("fill","none").attr("stroke",h??"currentColor").attr("stroke-width",PB).attr("stroke-linecap","round").attr("stroke-opacity",IB).attr("pointer-events","none").attr("transform",c).attr("data-step",t.step);Dg(d,l,s);const u=e.append("circle").attr("class","edge-step-dot").attr("r",OB).attr("aria-hidden","true").attr("transform",c).attr("data-step",t.step);h&&u.attr("fill",h).attr("stroke","none"),u.append("animateMotion").attr("id",l).attr("path",r).attr("dur",`${s}s`).attr("begin",`${o}s;${l}.end+${n}s`).attr("fill","remove"),Dg(u,l,s),zB(e,i)},"insertEdgeStepDot"),Ll=new WeakMap,o_=b(e=>{const t=e.querySelector(":scope > g.edge-step-badges");if(t)return t;const r=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");return r.setAttribute("class","edge-step-badges"),e.appendChild(r)},"badgeLayer"),s_=b(e=>{const t=e?Ll.get(e):void 0;if(!e||!t)return;Ll.delete(e);const r=H0(e);for(const{elem:i,edge:a,options:o}of t){const s=i.node()?.parentElement;if(!s)continue;const n=He(o_(s)),l=i_(n,a,o,r);l&&r.push(l)}},"placeQueuedStepBadges"),n_=b((e,t,r,i,a)=>{a_(e,t,r,i,a.color);const o=e.node(),s=o?.ownerSVGElement??o;!s||!iu(t)||!t.showStepNumber||Ll.set(s,[...Ll.get(s)??[],{elem:e,edge:t,options:a}])},"insertEdgeStepMarks"),l_=b((e,t,r,i,a,o=!1,s)=>{t.arrowTypeStart&&Ng(e,"start",t.arrowTypeStart,r,i,a,o,s),t.arrowTypeEnd&&Ng(e,"end",t.arrowTypeEnd,r,i,a,o,s)},"addEdgeMarkers"),c_={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},arrow_open_head:{type:"openArrow",fill:!1},arrow_hollow_circle:{type:"hollowCircle",fill:!1},arrow_hierarchy:{type:"hierarchy",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},h_=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Ng=b((e,t,r,i,a,o,s=!1,n)=>{if(!r||r==="none")return;const l=c_[r],c=l&&h_.includes(l.type);if(!l){Tt.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${a}_${o}-${h}${t==="start"?"Start":"End"}${s&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),g=`${f}_${p}`;if(!document.getElementById(g)){const m=document.getElementById(f);if(m){const y=m.cloneNode(!0);y.id=g,y.querySelectorAll("path, circle, line").forEach(C=>{C.setAttribute("stroke",n),l.fill&&C.setAttribute("fill",n)}),m.parentNode?.appendChild(y)}}e.attr(`marker-${t}`,`url(${i}#${g})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),d_=b(e=>typeof e=="string"?e:Xe()?.flowchart?.curve,"resolveEdgeCurveType"),Al=new Map,Xr=new Map,J4=b(()=>{Al.clear(),Xr.clear()},"clear"),tP=b(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),$s=b(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),u_=b(async(e,t)=>{const r=Xe();let i=zr(r);const{labelStyles:a}=Gt(t);t.labelStyle=a;const o=e.insert("g").attr("class","edgeLabel"),s=o.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await mi(e,t.label,{style:$s(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);s.node().appendChild(c),Tt.info("abc82",t,t.labelType);let h,d;if(i){const f=c.children[0],p=He(c);h=await Co.measure(()=>f.getBoundingClientRect()),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const f=He(c).select("text").node();await Co.measure(()=>{h=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=h})}s.attr("transform",Fs(d,i)),Al.set(t.id,o),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await wa(p,t.startLabelLeft,$s(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Fs(m,i)),Xr.get(t.id)||Xr.set(t.id,{}),Xr.get(t.id).startLeft=f,Ws(u,t.startLabelLeft,m),qs(t,"startLeft",m)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await wa(p,t.startLabelRight,$s(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Fs(m,i)),Xr.get(t.id)||Xr.set(t.id,{}),Xr.get(t.id).startRight=f,Ws(u,t.startLabelRight,m),qs(t,"startRight",m)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await wa(p,t.endLabelLeft,$s(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Fs(m,i)),Xr.get(t.id)||Xr.set(t.id,{}),Xr.get(t.id).endLeft=f,Ws(u,t.endLabelLeft,m),qs(t,"endLeft",m)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await wa(p,t.endLabelRight,$s(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Fs(m,i)),Xr.get(t.id)||Xr.set(t.id,{}),Xr.get(t.id).endRight=f,Ws(u,t.endLabelRight,m),qs(t,"endRight",m)}return c},"insertEdgeLabel");function qs(e,t,r){e.terminalLabelSizes??={},e.terminalLabelSizes[t]={width:r.width,height:r.height}}b(qs,"recordTerminalLabelSize");function Ws(e,t,r){zr(Xe())&&e&&(e.style.width=Math.max(t.length*9,r.width)+"px",e.style.height=r.height+"px")}b(Ws,"setTerminalWidth");var f_=b((e,t)=>{let r=e.x,i=e.y;if(t?.updatedPath){const a=pi.calcLabelPosition(t.updatedPath);if(t.originalPath){const o=pi.calcLabelPosition(t.originalPath);r=e.x+(a.x-o.x),i=e.y+(a.y-o.y)}else r=a.x,i=a.y}return{x:r,y:i}},"resolveEdgeLabelPosition"),g_=b((e,t)=>{Tt.debug("Moving label abc88 ",e.id,e.label,Al.get(e.id),t);const r=Xe(),{subGraphTitleTotalMargin:i}=bn(r);if(e.label){const o=Al.get(e.id),{x:s,y:n}=f_(e,t);Tt.debug("Moving label "+e.label+" from (",e.x,",",e.y,") to (",s,",",n,") abc88"),o.attr("transform",`translate(${s}, ${n+i/2})`)}const a=t.updatedPath?t.updatedPath:t.originalPath;if(e.startLabelLeft){const o=Xr.get(e.id).startLeft;let s=e.x,n=e.y;if(a){const l=pi.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);s=l.x,n=l.y}o.attr("transform",`translate(${s}, ${n})`)}if(e.startLabelRight){const o=Xr.get(e.id).startRight;let s=e.x,n=e.y;if(a){const l=pi.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);s=l.x,n=l.y}o.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelLeft){const o=Xr.get(e.id).endLeft;let s=e.x,n=e.y;if(a){const l=pi.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);s=l.x,n=l.y}o.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelRight){const o=Xr.get(e.id).endRight;let s=e.x,n=e.y;if(a){const l=pi.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);s=l.x,n=l.y}o.attr("transform",`translate(${s}, ${n})`)}},"positionEdgeLabel"),ds=.5,ka=b((e,t)=>Math.abs(e.x-t.x)<ds,"sharesColumn"),Sa=b((e,t)=>Math.abs(e.y-t.y)<ds,"sharesRow"),Y0=b((e,t)=>ka(e,t)&&Sa(e,t),"coincides");function X0(e,t,r){return ka(e,t)&&!Sa(e,t)?ka(r,t):Sa(e,t)&&!ka(e,t)?Sa(r,t):ka(r,t)||Sa(r,t)}b(X0,"keepsArrivalAxis");function j0(e,t,r){return Y0(e,t)?{heading:t,from:r}:{heading:e,from:t}}b(j0,"arrivalSegment");function G0({heading:e,from:t},r,i){return(e.x-t.x)*(i.x-r.x)+(e.y-t.y)*(i.y-r.y)<0}b(G0,"runsAgainstHeading");function U0({heading:e,from:t},r,i){return Sa(e,t)&&!ka(e,t)?{x:i.x,y:r.y}:ka(e,t)&&!Sa(e,t)?{x:r.x,y:i.y}:i}b(U0,"snapToArrivalAxis");function V0(e,t,r,i){if((ka(e,t)||Sa(e,t))&&!X0(e,t,i))return e;const o=j0(e,t,r);return G0(o,t,i)?t:U0(o,t,i)}b(V0,"dockFinalPoint");function Z0(e){const t=Object.hasOwn(qr,e)?qr[e]:0;return Number.isFinite(t)?t:0}b(Z0,"markerPullBack");function K0({originalLast:e,lastInner:t,newLast:r,minLength:i}){const a=!Y0(e,t),o=Math.hypot(r.x-t.x,r.y-t.y);return o>=Math.max(ds,i)?r:a&&o>=ds?e:void 0}b(K0,"finalDockPoint");var p_=b((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,a=Math.abs(i.x-r.x),o=Math.abs(i.y-r.y);return a<.001||o<.001?t:o>=a?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),m_=b((e,t)=>{const r=e.x,i=e.y,a=Math.abs(t.x-r),o=Math.abs(t.y-i),s=e.width/2,n=e.height/2;return a>=s||o>=n},"outsideNode"),y_=b((e,t,r)=>{Tt.debug(`intersection calc abc89:
293
- outsidePoint: ${JSON.stringify(t)}
294
- insidePoint : ${JSON.stringify(r)}
295
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2;let n=r.x<t.x?s-o:s+o;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(a-t.y)*s>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-a:a-l-t.y;n=h*d/c;const u={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),Tt.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{r.x<t.x?n=t.x-s-i:n=i-s-t.x;let d=c*n/h,u=r.x<t.x?r.x+h-n:r.x-h+n,f=r.y<t.y?r.y+d:r.y-d;return Tt.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:u,_y:f}),n===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),qg=b((e,t)=>{Tt.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],a=!1;return e.forEach(o=>{if(Tt.info("abc88 checking point",o,t),!m_(t,o)&&!a){const s=y_(t,i,o);Tt.debug("abc88 inside",o,i,s),Tt.debug("abc88 intersection",s,t);let n=!1;r.forEach(l=>{n=n||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?Tt.warn("abc88 no intersect",s,r):r.push(s),a=!0}else Tt.warn("abc88 outside",o,i),i=o,a||r.push(o)}),Tt.debug("returning points",r),r},"cutPathAtIntersect");function Q0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const a=e[i-1],o=e[i],s=e[i+1];(a.x===o.x&&o.y===s.y&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5||a.y===o.y&&o.x===s.x&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5)&&(t.push(o),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}b(Q0,"extractCornerPoints");var Wg=b(function(e,t,r){const i=t.x-e.x,a=t.y-e.y,o=Math.sqrt(i*i+a*a),s=r/o;return{x:t.x-s*i,y:t.y-s*a}},"findAdjacentPoint"),x_=b(function(e){const{cornerPointPositions:t}=Q0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const a=e[i-1],o=e[i+1],s=e[i],n=Wg(a,s,5),l=Wg(o,s,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:s.x,y:s.y};if(Math.abs(o.x-a.x)>10&&Math.abs(o.y-a.y)>=10){Tt.debug("Corner point fixing",Math.abs(o.x-a.x),Math.abs(o.y-a.y));const f=5;s.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-f+d:n.y+f-d}}else Tt.debug("Corner point skipping fixing",Math.abs(o.x-a.x),Math.abs(o.y-a.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),b_=b((e,t,r)=>{const i=e-t-r,a=2,o=2,s=a+o,n=Math.floor(i/s),l=Number.isFinite(n)?Math.max(0,n):0,c=Array(l).fill(`${a} ${o}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),C_=b(function(e,t,r,i,a,o,s,n=!1,l=void 0){if(!s)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:c,layout:h}=Xe(),d=l??h;let u=t.points,f=!1;const p=a;var g=o;const m=[];for(const D in t.cssCompiledStyles)Vp(D)||m.push(t.cssCompiledStyles[D]);if(d==="swimlane"){if(!n&&g.intersect&&p.intersect&&Array.isArray(u)&&u.length>=2)if(u.length===2){const[D,G]=u;u=ka(D,G)||Sa(D,G)?[p.intersect(D),g.intersect(G)]:[p.intersect(G),g.intersect(D)]}else{const D=u.slice(1,-1),G=D[0],j=D[D.length-1],z=p.intersect(G),Q=u[u.length-1],et=g.intersect(j),rt=D.at(-2)??u[0],J=V0(Q,j,rt,et),at=K0({originalLast:Q,lastInner:j,newLast:J,minLength:Z0(t.arrowTypeEnd)}),H=Math.abs(z.x-G.x)<ds&&Math.abs(z.y-G.y)<ds?[]:[z],Y=at?[at]:[];u=[...H,...D,...Y]}u=p_(t,u)}else g.intersect&&p.intersect&&!n&&(u=u.slice(1,t.points.length-1),u.unshift(p.intersect(u[0])),u.push(g.intersect(u[u.length-1])));const y=btoa(JSON.stringify(u));t.toCluster&&(Tt.info("to cluster abc88",r.get(t.toCluster)),u=qg(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(Tt.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(u,null,2)),u=qg(u.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let x=u.filter(D=>!Number.isNaN(D.y));const C=d_(t.curve);C!=="rounded"&&(x=x_(x));let k=Vs;switch(C){case"linear":k=Vs;break;case"basis":k=xh;break;case"cardinal":k=Em;break;case"bumpX":k=_m;break;case"bumpY":k=Lm;break;case"catmullRom":k=Im;break;case"monotoneX":k=Wm;break;case"monotoneY":k=zm;break;case"natural":k=Ym;break;case"step":k=Xm;break;case"stepAfter":k=Gm;break;case"stepBefore":k=jm;break;case"rounded":k=Vs;break;default:k=xh}const{x:v,y:T}=_B(t),F=rv().x(v).y(T).curve(k);let A;switch(t.thickness){case"normal":A="edge-thickness-normal";break;case"thick":A="edge-thickness-thick";break;case"invisible":A="edge-thickness-invisible";break;default:A="edge-thickness-normal"}switch(t.pattern){case"solid":A+=" edge-pattern-solid";break;case"dotted":A+=" edge-pattern-dotted";break;case"dashed":A+=" edge-pattern-dashed";break;default:A+=" edge-pattern-solid"}let M,B=C==="rounded"?J0(tb(x,t),5):F(x);const $=Array.isArray(t.style)?t.style:[t.style];let P=$.find(D=>D?.startsWith("stroke:")),I="";t.animate&&(I="edge-animation-fast"),t.animation&&(I="edge-animation-"+t.animation);let _=!1;if(t.look==="handDrawn"){const D=Vt.svg(e);Object.assign([],x);const G=D.path(B,{roughness:.3,seed:c});A+=" transition",M=He(G).select("path").attr("id",`${s}-${t.id}`).attr("class"," "+A+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",$?$.reduce((z,Q)=>z+";"+Q,""):"");let j=M.attr("d");M.attr("d",j),e.node().appendChild(M.node())}else{const D=m.join(";"),G=$?$.reduce((J,at)=>J+at+";",""):"",j=(D?D+";"+G+";":G)+";"+($?$.reduce((J,at)=>J+";"+at,""):"");M=e.append("path").attr("d",B).attr("id",`${s}-${t.id}`).attr("class"," "+A+(t.classes?" "+t.classes:"")+(I?" "+I:"")).attr("style",j),P=j.match(/stroke:([^;]+)/)?.[1],_=t.animate===!0||!!t.animation||D.includes("animation");const z=M.node(),Q=typeof z.getTotalLength=="function"?z.getTotalLength():0,et=Lg[t.arrowTypeStart]||0,rt=Lg[t.arrowTypeEnd]||0;if(t.look==="neo"&&!_){const at=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?b_(Q,et,rt):`0 ${et} ${Q-et-rt} ${rt}`}; stroke-dashoffset: 0;`;M.attr("style",at+M.attr("style"))}}if(M.attr("data-edge",!0),M.attr("data-et","edge"),M.attr("data-id",t.id),M.attr("data-points",y),M.attr("data-look",Rr(t.look)),t.step!==void 0){const{themeVariables:D}=Xe(),G=P??D?.lineColor;n_(e,t,B,s,{points:x,pathNode:M.node(),color:G,textColors:[D?.background,D?.primaryTextColor]})}t.showPoints&&x.forEach(D=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",D.x).attr("cy",D.y)});let E="";(Xe().flowchart.arrowMarkerAbsolute||Xe().state.arrowMarkerAbsolute)&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Tt.info("arrowTypeStart",t.arrowTypeStart),Tt.info("arrowTypeEnd",t.arrowTypeEnd);const L=!_&&t?.look==="neo";l_(M,t,E,s,i,L,P);const q=Math.floor(u.length/2),W=u[q];pi.isLabelCoordinateInPath(W,M.attr("d"))||(f=!0);let R={};return f&&(R.updatedPath=u),R.originalPath=t.points,R},"insertEdge");function J0(e,t){if(e.length<2)return"";let r="";const i=e.length,a=1e-5;for(let o=0;o<i;o++){const s=e[o],n=e[o-1],l=e[o+1];if(o===0)r+=`M${s.x},${s.y}`;else if(o===i-1)r+=`L${s.x},${s.y}`;else{const c=s.x-n.x,h=s.y-n.y,d=l.x-s.x,u=l.y-s.y,f=Math.hypot(c,h),p=Math.hypot(d,u);if(f<a||p<a){r+=`L${s.x},${s.y}`;continue}const g=c/f,m=h/f,y=d/p,x=u/p,C=g*y+m*x,k=Math.max(-1,Math.min(1,C)),v=Math.acos(k);if(v<a||Math.abs(Math.PI-v)<a){r+=`L${s.x},${s.y}`;continue}const T=Math.min(t/Math.sin(v/2),f/2,p/2),F=s.x-g*T,A=s.y-m*T,M=s.x+y*T,B=s.y+x*T;r+=`L${F},${A}`,r+=`Q${s.x},${s.y} ${M},${B}`}}return r}b(J0,"generateRoundedPath");function Oh(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}b(Oh,"calculateDeltaAndAngle");function tb(e,t){const r=e.map(a=>({...a}));if(e.length>=2&&qr[t.arrowTypeStart]){const a=qr[t.arrowTypeStart],o=e[0],s=e[1],{angle:n}=Oh(o,s),l=a*Math.cos(n),c=a*Math.sin(n);r[0].x=o.x+l,r[0].y=o.y+c}const i=e.length;if(i>=2&&qr[t.arrowTypeEnd]){const a=qr[t.arrowTypeEnd],o=e[i-1],s=e[i-2],{angle:n}=Oh(s,o),l=a*Math.cos(n),c=a*Math.sin(n);r[i-1].x=o.x-l,r[i-1].y=o.y-c}return r}b(tb,"applyMarkerOffsetsToPoints");var w_=b((e,t,r,i)=>{t.forEach(a=>{G_[a](e,r,i)})},"insertMarkers"),k_=b((e,t,r)=>{Tt.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),S_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),v_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),M_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),T_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),B_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),__=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),L_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),A_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),F_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{transitionColor:o}=a;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${o}`)},"barbNeo"),$_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),E_=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const a=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),a.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),P_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),I_=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const a=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),a.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),O_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${o}`)},"only_one_neo"),R_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o,mainBkg:s}=a,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${o}`)},"zero_or_one_neo"),D_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${o}`)},"one_or_more_neo"),N_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o,mainBkg:s}=a,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${o}`)},"zero_or_more_neo"),q_=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
296
- L20,10
297
- M20,10
298
- L0,20`)},"requirement_arrow"),W_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
299
- L20,10
300
- M20,10
301
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),z_=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),H_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Y_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),X_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),j_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),G_={extension:k_,composition:S_,aggregation:v_,dependency:M_,lollipop:T_,point:B_,circle:__,cross:L_,barb:A_,barbNeo:F_,hierarchy:Y_,only_one:$_,zero_or_one:E_,one_or_more:P_,zero_or_more:I_,only_one_neo:O_,zero_or_one_neo:R_,one_or_more_neo:D_,zero_or_more_neo:N_,requirement_arrow:q_,requirement_contains:z_,requirement_arrow_neo:W_,requirement_contains_neo:H_,openArrow:X_,hollowCircle:j_},U_=w_,V_={common:hn,getConfig:Tr,insertCluster:BB,insertEdge:C_,insertEdgeLabel:u_,insertMarkers:U_,insertNode:O0,interpolateToCurve:$d,labelHelper:he,log:Tt,positionEdgeLabel:g_},Z_=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],an=Object.create(null),eb=b(e=>{for(const t of e)an[t.name]=t},"registerLayoutLoaders"),K_=b(()=>{const e=b(async()=>await Ge(()=>import("./Bx3b0rPd.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...Z_.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),Q_=b(()=>{eb([{name:"dagre",loader:b(async()=>await Ge(()=>import("./D58P1mNO.js"),__vite__mapDeps([7,2,3,4,5]),import.meta.url),"loader")},{name:"swimlane",loader:b(async()=>await Ge(()=>import("./1JAPG9y2.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url),"loader")},{name:"cose-bilkent",loader:b(async()=>await Ge(()=>import("./CckzaWai.js"),__vite__mapDeps([9,10,6]),import.meta.url),"loader")},...K_()])},"registerDefaultLayoutLoaders");Q_();var eP=b(async(e,t)=>{if(!Object.hasOwn(an,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const o of e.nodes){const s=o.domId||o.id;o.domId=`${e.diagramId}-${s}`}const r=an[e.layoutAlgorithm],i=await r.loader();DC(t,e.config);const a=await i.render(e,t,V_,{algorithm:r.algorithm});return s_(t.node()),a},"render"),Vc="dagre",rP=b((e="",{fallback:t=Vc}={})=>{if(Object.hasOwn(an,e))return e;for(const r of[t,Vc])if(Object.hasOwn(an,r))return Tt.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${Vc} is registered.`)},"getRegisteredLayoutAlgorithm"),J_=b(e=>{const{securityLevel:t}=Xe();let r=He("body");if(t==="sandbox"){const o=He(`#i${e}`).node()?.contentDocument??document;r=He(o.body)}return r.select(`#${e}`)},"selectSvgElement"),ou="comm",rb="rule",ib="decl",tL="@media",eL="@import",rL="@supports",iL="@namespace",Rh="@keyframes",ab="@layer",aL="@scope",oL=Math.abs,Ks=String.fromCharCode;function ob(e){return e.trim()}function Dh(e,t,r){return e.replace(t,r)}function Go(e,t){return e.charCodeAt(t)|0}function us(e,t,r){return e.slice(t,r)}function Ki(e){return e.length}function sb(e){return e.length}function Pn(e,t){return t.push(e),e}var Vl=1,fs=1,nb=0,_i=0,Pr=0,ws="";function su(e,t,r,i,a,o,s,n){return{value:e,root:t,parent:r,type:i,props:a,children:o,line:Vl,column:fs,length:s,return:"",siblings:n}}function sL(){return Pr}function nL(){return Pr=_i>0?Go(ws,--_i):0,fs--,Pr===10&&(fs=1,Vl--),Pr}function Di(){return Pr=_i<nb?Go(ws,_i++):0,fs++,Pr===10&&(fs=1,Vl++),Pr}function qa(){return Go(ws,_i)}function Jn(){return _i}function Zl(e,t){return us(ws,e,t)}function on(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function lL(e){return Vl=fs=1,nb=Ki(ws=e),_i=0,[]}function cL(e){return ws="",e}function Zc(e){return ob(Zl(_i-1,Nh(e===91?e+2:e===40?e+1:e)))}function hL(e){for(;(Pr=qa())&&Pr<33;)Di();return on(e)>2||on(Pr)>3?"":" "}function dL(e,t){for(;--t&&Di()&&!(Pr<48||Pr>102||Pr>57&&Pr<65||Pr>70&&Pr<97););return Zl(e,Jn()+(t<6&&qa()==32&&Di()==32))}function Nh(e){for(;Di();)switch(Pr){case e:return _i;case 34:case 39:e!==34&&e!==39&&Nh(Pr);break;case 40:e===41&&Nh(e);break;case 92:Di();break}return _i}function uL(e,t){for(;Di()&&e+Pr!==57;)if(e+Pr===84&&qa()===47)break;return"/*"+Zl(t,_i-1)+"*"+Ks(e===47?e:Di())}function fL(e){for(;!on(qa());)Di();return Zl(e,_i)}function gL(e){return cL(tl("",null,null,null,[""],e=lL(e),0,[0],e))}function tl(e,t,r,i,a,o,s,n,l){for(var c=0,h=0,d=s,u=0,f=0,p=0,g=1,m=1,y=1,x=0,C=0,k="",v=a,T=o,F=i,A=k;m;)switch(p=C,C=Di()){case 40:p!=108&&Go(A,d-1)==58?(x++,A+="("):A+=Zc(C);break;case 41:x--,A+=")";break;case 34:case 39:case 91:A+=Zc(C);break;case 9:case 10:case 13:case 32:if(x>0){A+=Ks(C);break}A+=hL(p);break;case 92:A+=dL(Jn()-1,7);continue;case 47:switch(qa()){case 42:case 47:Pn(pL(uL(Di(),Jn()),t,r,l),l),(on(p||1)==5||on(qa()||1)==5)&&Ki(A)&&us(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*g:n[c++]=Ki(A)*y;case 125*g:case 59:case 0:if(x>0&&C){A+=Ks(C);break}switch(C){case 0:case 125:m=0;case 59+h:y==-1&&(A=Dh(A,/\f/g,"")),f>0&&(Ki(A)-d||g===0)&&Pn(f>32?Hg(A+";",i,r,d-1,l):Hg(Dh(A," ","")+";",i,r,d-2,l),l);break;case 59:A+=";";default:if(Pn(F=zg(A,t,r,c,h,a,n,k,v=[],T=[],d,o),o),C===123)if(h===0)tl(A,t,F,F,v,o,d,n,T);else{switch(u){case 99:if(Go(A,3)===110)break;case 108:if(Go(A,2)===97)break;default:h=0;case 100:case 109:case 115:}h?tl(e,F,F,i&&Pn(zg(e,F,F,0,0,a,n,k,a,v=[],d,T),T),a,T,d,n,i?v:T):tl(A,F,F,F,[""],T,0,n,T)}}c=h=f=0,g=y=1,k=A="",d=s;break;case 58:d=1+Ki(A),f=p;default:if(g<1){if(C==123)--g;else if(C==125&&g++==0&&nL()==125)continue}switch(A+=Ks(C),C*g){case 38:y=h>0?1:(A+="\f",-1);break;case 44:if(x>0)break;n[c++]=(Ki(A)-1)*y,y=1;break;case 64:qa()===45&&(A+=Zc(Di())),u=qa(),h=d=Ki(k=A+=fL(Jn())),C++;break;case 45:p===45&&Ki(A)==2&&(g=0)}}return o}function zg(e,t,r,i,a,o,s,n,l,c,h,d){for(var u=a-1,f=a===0?o:[""],p=sb(f),g=0,m=0,y=0;g<i;++g)for(var x=0,C=us(e,u+1,u=oL(m=s[g])),k=e;x<p;++x)(k=ob(m>0?f[x]+" "+C:Dh(C,/&\f/g,f[x])))&&(l[y++]=k);return su(e,t,r,a===0?rb:n,l,c,h,d)}function pL(e,t,r,i){return su(e,t,r,ou,Ks(sL()),us(e,2,-2),0,i)}function Hg(e,t,r,i,a){return su(e,t,r,ib,us(e,0,i),us(e,i+1,-1),i,a)}function qh(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function mL(e,t,r,i){switch(e.type){case ab:if(e.children.length)break;case eL:case iL:case ib:return e.return=e.return||e.value;case ou:return"";case Rh:return e.return=e.value+"{"+qh(e.children,i)+"}";case rb:if(!Ki(e.value=e.props.join(",")))return""}return Ki(r=qh(e.children,i))?e.return=e.value+"{"+r+"}":""}function yL(e){var t=sb(e);return function(r,i,a,o){for(var s="",n=0;n<t;n++)s+=e[n](r,i,a,o)||"";return s}}var lb="c4",xL=b(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),bL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DGznsmsL.js");return{diagram:t}},__vite__mapDeps([11,12]),import.meta.url);return{id:lb,diagram:e}},"loader"),CL={id:lb,detector:xL,loader:bL},wL=CL,cb="flowchart-v2",kL=b(e=>/^\s*(graph|flowchart)/.test(e),"detector"),SL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DxMdBYgz.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:cb,diagram:e}},"loader"),vL={id:cb,detector:kL,loader:SL},ML=vL,hb="agentflow",TL=b(e=>/^\s*agentflow-beta\b/.test(e),"detector"),BL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DDaNHu84.js");return{diagram:t}},__vite__mapDeps([55,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:hb,diagram:e}},"loader"),_L={id:hb,detector:TL,loader:BL},LL=_L,db="swimlane",AL=b(e=>/^\s*swimlane-beta\b/.test(e),"detector"),FL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BayXe-e8.js");return{diagram:t}},__vite__mapDeps([56,13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:db,diagram:e}},"loader"),$L={id:db,detector:AL,loader:FL},EL=$L,ub="er",PL=b(e=>/^\s*erDiagram/.test(e),"detector"),IL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Ci-yONgL.js");return{diagram:t}},__vite__mapDeps([57,15,16]),import.meta.url);return{id:ub,diagram:e}},"loader"),OL={id:ub,detector:PL,loader:IL},RL=OL,fb="gitGraph",DL=b(e=>/^\s*gitGraph/.test(e),"detector"),NL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BziNoOeQ.js");return{diagram:t}},__vite__mapDeps([58,59,60,61,3,4]),import.meta.url);return{id:fb,diagram:e}},"loader"),qL={id:fb,detector:DL,loader:NL},WL=qL,gb="gantt",zL=b(e=>/^\s*gantt/.test(e),"detector"),HL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Dv_vjHi2.js");return{diagram:t}},__vite__mapDeps([62,6,63]),import.meta.url);return{id:gb,diagram:e}},"loader"),YL={id:gb,detector:zL,loader:HL},XL=YL,pb="info",jL=b(e=>/^\s*info/.test(e),"detector"),GL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BmmYJ5hU.js");return{diagram:t}},__vite__mapDeps([64,61,3,4]),import.meta.url);return{id:pb,diagram:e}},"loader"),UL={id:pb,detector:jL,loader:GL},mb="pie",VL=b(e=>/^\s*pie/.test(e),"detector"),ZL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./v2vpkl1z.js");return{diagram:t}},__vite__mapDeps([65,60,61,3,4,63]),import.meta.url);return{id:mb,diagram:e}},"loader"),KL={id:mb,detector:VL,loader:ZL},yb="quadrantChart",QL=b(e=>/^\s*quadrantChart/.test(e),"detector"),JL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DJ0uFT5X.js");return{diagram:t}},__vite__mapDeps([66,63]),import.meta.url);return{id:yb,diagram:e}},"loader"),tA={id:yb,detector:QL,loader:JL},eA=tA,xb="xychart",rA=b(e=>/^\s*xychart(-beta)?/.test(e),"detector"),iA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ClQaWwZN.js");return{diagram:t}},__vite__mapDeps([67,63]),import.meta.url);return{id:xb,diagram:e}},"loader"),aA={id:xb,detector:rA,loader:iA},oA=aA,bb="requirement",sA=b(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),nA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DZGCpHpr.js");return{diagram:t}},__vite__mapDeps([68,15,16]),import.meta.url);return{id:bb,diagram:e}},"loader"),lA={id:bb,detector:sA,loader:nA},cA=lA,Cb="sequence",hA=b(e=>/^\s*sequenceDiagram/.test(e),"detector"),dA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D7Ydchf3.js");return{diagram:t}},__vite__mapDeps([69,59,12]),import.meta.url);return{id:Cb,diagram:e}},"loader"),uA={id:Cb,detector:hA,loader:dA},fA=uA,wb="classDiagram",gA=b(e=>/^\s*classDiagram/.test(e),"detector"),pA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./OrocR3hK.js");return{diagram:t}},__vite__mapDeps([70,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:wb,diagram:e}},"loader"),mA={id:wb,detector:gA,loader:pA},yA=mA,kb="stateDiagram",xA=b(e=>/^\s*stateDiagram/.test(e),"detector"),bA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ZN-mesLP.js");return{diagram:t}},__vite__mapDeps([71,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:kb,diagram:e}},"loader"),CA={id:kb,detector:xA,loader:bA},wA=CA,Sb="journey",kA=b(e=>/^\s*journey/.test(e),"detector"),SA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Bc5tOdcb.js");return{diagram:t}},__vite__mapDeps([72,14,12]),import.meta.url);return{id:Sb,diagram:e}},"loader"),vA={id:Sb,detector:kA,loader:SA},MA=vA,In=4,Es=75,TA=b(e=>{const t=[];for(const a of e.split(/\s+/)){let o=[...a];for(;o.length>Es;)t.push(o.slice(0,Es).join("")),o=o.slice(Es);o.length>0&&t.push(o.join(""))}const r=[];let i="";for(const a of t){const o=i?`${i} ${a}`:a;[...o].length>Es?(r.push(i),i=a):i=o}if(i&&r.push(i),r.length>In){r.length=In;const a=r[In-1]??"";r[In-1]=`${[...a].slice(0,Es-3).join("")}...`}return r},"wrapErrorMessage"),BA=b((e,t,r,i)=>{Tt.debug(`rendering svg for syntax error
302
- `);const a=J_(t),o=a.append("g"),s=TA(i?.db.getErrorMessage?.()??""),n=s.length>0?500+s.length*56:512;a.attr("viewBox",`0 0 2412 ${n}`),Gp(a,100,n,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`),s.forEach((l,c)=>{o.append("text").attr("class","error-text").attr("x",1440).attr("y",510+c*56).attr("font-size","42px").style("text-anchor","middle").text(l)})},"draw"),vb={draw:BA},_A=vb,Kc,LA={clear(){Kc=void 0},setErrorMessage(e){Kc=e},getErrorMessage(){return Kc}},AA={db:LA,renderer:vb,parser:{parse:b(()=>{},"parse")}},FA=AA,Mb="flowchart-elk",$A=b((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),EA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DxMdBYgz.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Mb,diagram:e}},"loader"),PA={id:Mb,detector:$A,loader:EA},IA=PA,Tb="timeline",OA=b(e=>/^\s*timeline/.test(e),"detector"),RA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CFK6lvfY.js");return{diagram:t}},[],import.meta.url);return{id:Tb,diagram:e}},"loader"),DA={id:Tb,detector:OA,loader:RA},NA=DA,Bb="mindmap",qA=b(e=>/^\s*mindmap/.test(e),"detector"),WA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Cu8zpbs5.js");return{diagram:t}},__vite__mapDeps([73,15,16]),import.meta.url);return{id:Bb,diagram:e}},"loader"),zA={id:Bb,detector:qA,loader:WA},HA=zA,_b="kanban",YA=b(e=>/^\s*kanban/.test(e),"detector"),XA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BIGnKucK.js");return{diagram:t}},__vite__mapDeps([74,14]),import.meta.url);return{id:_b,diagram:e}},"loader"),jA={id:_b,detector:YA,loader:XA},GA=jA,Lb="sankey",UA=b(e=>/^\s*sankey(-beta)?/.test(e),"detector"),VA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./COjSVIHG.js");return{diagram:t}},__vite__mapDeps([75,63]),import.meta.url);return{id:Lb,diagram:e}},"loader"),ZA={id:Lb,detector:UA,loader:VA},KA=ZA,Ab="packet",QA=b(e=>/^\s*packet(-beta)?/.test(e),"detector"),JA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DoWkfKYp.js");return{diagram:t}},__vite__mapDeps([76,60,61,3,4]),import.meta.url);return{id:Ab,diagram:e}},"loader"),t5={id:Ab,detector:QA,loader:JA},Fb="radar",e5=b(e=>/^\s*radar-beta/.test(e),"detector"),r5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./35fhULrG.js");return{diagram:t}},__vite__mapDeps([77,60,61,3,4]),import.meta.url);return{id:Fb,diagram:e}},"loader"),i5={id:Fb,detector:e5,loader:r5},$b="block",a5=b(e=>/^\s*block(-beta)?/.test(e),"detector"),o5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BaA_OrGq.js");return{diagram:t}},__vite__mapDeps([78,14,5]),import.meta.url);return{id:$b,diagram:e}},"loader"),s5={id:$b,detector:a5,loader:o5},n5=s5,Eb="treeView",l5=b(e=>/^\s*treeView-beta/.test(e),"detector"),c5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BSDp34Kf.js");return{diagram:t}},__vite__mapDeps([79,59,60,61,3,4]),import.meta.url);return{id:Eb,diagram:e}},"loader"),h5={id:Eb,detector:l5,loader:c5},d5=h5,Pb="architecture",u5=b(e=>/^\s*architecture/.test(e),"detector"),f5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D__c4Yl1.js");return{diagram:t}},__vite__mapDeps([80,60,61,3,4,10,6]),import.meta.url);return{id:Pb,diagram:e}},"loader"),g5={id:Pb,detector:u5,loader:f5},p5=g5,Ib="eventmodeling",m5=b(e=>/^\s*eventmodeling/.test(e),"detector"),y5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BIjcjB3s.js");return{diagram:t}},__vite__mapDeps([81,60,61,3,4]),import.meta.url);return{id:Ib,diagram:e}},"loader"),x5={id:Ib,detector:m5,loader:y5},b5=x5,Ob="ishikawa",C5=b(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),w5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./m1QfmWoj.js");return{diagram:t}},[],import.meta.url);return{id:Ob,diagram:e}},"loader"),k5={id:Ob,detector:C5,loader:w5},Rb="venn",S5=b(e=>/^\s*venn-beta/.test(e),"detector"),v5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Dp7jUSi9.js");return{diagram:t}},[],import.meta.url);return{id:Rb,diagram:e}},"loader"),M5={id:Rb,detector:S5,loader:v5},T5=M5,Db="treemap",B5=b(e=>/^\s*treemap/.test(e),"detector"),_5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Dyc_CyAW.js");return{diagram:t}},__vite__mapDeps([82,16,60,61,3,4,63]),import.meta.url);return{id:Db,diagram:e}},"loader"),L5={id:Db,detector:B5,loader:_5},Nb="usecase",A5=b(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),F5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Bka1VG1N.js");return{diagram:t}},__vite__mapDeps([83,15,16]),import.meta.url);return{id:Nb,diagram:e}},"loader"),$5={id:Nb,detector:A5,loader:F5},qb="wardley",E5=b(e=>/^\s*wardley-beta/i.test(e),"detector"),P5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./p3CrvZe2.js");return{diagram:t}},__vite__mapDeps([84,60,61,3,4]),import.meta.url);return{id:qb,diagram:e}},"loader"),I5={id:qb,detector:E5,loader:P5},O5=I5,Wb="cynefin",R5=b(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),D5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DbboHfqH.js");return{diagram:t}},__vite__mapDeps([85,60,61,3,4]),import.meta.url);return{id:Wb,diagram:e}},"loader"),N5={id:Wb,detector:R5,loader:D5},zb="railroad",q5=b(e=>/^\s*railroad-beta/i.test(e),"detector"),W5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Cx2Zr_EY.js");return{diagram:t}},__vite__mapDeps([86,87,60,61,3,4]),import.meta.url);return{id:zb,diagram:e}},"loader"),z5={id:zb,detector:q5,loader:W5},Hb="railroadEbnf",H5=b(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Y5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CIQcnDuR.js");return{diagram:t}},__vite__mapDeps([88,87,60,61,3,4]),import.meta.url);return{id:Hb,diagram:e}},"loader"),X5={id:Hb,detector:H5,loader:Y5},Yb="railroadAbnf",j5=b(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),G5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BvXEM_ru.js");return{diagram:t}},__vite__mapDeps([89,87,60,61,3,4]),import.meta.url);return{id:Yb,diagram:e}},"loader"),U5={id:Yb,detector:j5,loader:G5},Xb="railroadPeg",V5=b(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Z5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BtXKsHf_.js");return{diagram:t}},__vite__mapDeps([90,87,60,61,3,4]),import.meta.url);return{id:Xb,diagram:e}},"loader"),K5={id:Xb,detector:V5,loader:Z5},Yg=!1,Kl=b(()=>{Yg||(Yg=!0,cl("error",FA,e=>e.toLowerCase().trim()==="error"),cl("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:b(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),hh(IA,HA,p5),hh(LL,wL,GA,yA,RL,XL,UL,KL,cA,fA,EL,ML,NA,WL,wA,MA,eA,KA,t5,oA,n5,b5,d5,i5,k5,L5,z5,X5,U5,K5,T5,O5,N5,$5))},"addDiagrams"),Q5=b(async()=>{Tt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(yo).map(async([r,{detector:i,loader:a}])=>{if(a)try{ph(r)}catch{try{const{diagram:o,id:s}=await a();cl(s,o,i)}catch(o){throw Tt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete yo[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){Tt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Tt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),J5="graphics-document document";function jb(e,t){e.attr("role",J5),t!==""&&e.attr("aria-roledescription",t)}b(jb,"setA11yDiagramInfo");function Gb(e,t,r,i){if(e.insert!==void 0){if(r){const a=`chart-desc-${i}`;e.attr("aria-describedby",a),e.insert("desc",":first-child").attr("id",a).text(r)}if(t){const a=`chart-title-${i}`;e.attr("aria-labelledby",a),e.insert("title",":first-child").attr("id",a).text(t)}}}b(Gb,"addSVGa11yTitleDescription");var mo,Fl=(mo=class{constructor(t,r,i,a,o){this.type=t,this.text=r,this.db=i,this.parser=a,this.renderer=o}static async fromText(t,r={}){const i=typeof t=="string"?{cleaned:t}:t,a=Tr(),o=Ol(i.cleaned,a);try{ph(o)}catch{const u=JC(o);if(!u)throw new Pp(`Diagram ${o} not found.`);const{id:f,diagram:p}=await u();cl(f,p)}const{db:s,parser:n,renderer:l,init:c}=ph(o);n.parser&&(n.parser.yy=s),s.clear?.(),c?.(a),r.title&&s.setDiagramTitle?.(r.title);let h=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){const u=a.maxTextSize??ud.maxTextSize;i.withComments.length>u?Tt.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=i.withComments}const d=oM(h)+`
303
- `;return i.frontmatterLineOffset&&s.setFrontmatterLineOffset?.(i.frontmatterLineOffset),await n.parse(d),new mo(o,d,s,n,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},b(mo,"Diagram"),mo),Xg=[],tF=b(()=>{Xg.forEach(e=>{e()}),Xg=[]},"attachFunctions"),eF=b(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Ub(e){const t=Ep(e);if(!t)return{text:e,metadata:{}};const r=t.indent,i=r?t.body.split(`
304
- `).map(s=>s.startsWith(r)?s.slice(r.length):s).join(`
305
- `):t.body;let a=RC(i,{schema:OC})??{};a=typeof a=="object"&&!Array.isArray(a)?a:{};const o={};return a.displayMode&&(o.displayMode=a.displayMode.toString()),a.title&&(o.title=a.title.toString()),a.config&&(o.config=a.config),{text:e.slice(t.length),metadata:o}}b(Ub,"extractFrontMatter");var rF=b(e=>e.replace(/\r\n?/g,`
306
- `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),iF=b(e=>{const{text:t,metadata:r}=Ub(e),{displayMode:i,title:a,config:o={}}=r;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:a,config:o,text:t}},"processFrontmatter"),aF=b(e=>{const t=pi.detectInit(e)??{},r=pi.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:jv(e),directive:t}},"processDirectives");function nu(e){const t=e,r=rF(e),i=iF(r),a=aF(i.text),o=Rd(i.config,a.directive),s=a.text,n=eF(s),l=r.length>i.text.length?(r.substring(0,r.length-i.text.length).match(/\n/g)??[]).length:0;return{code:{raw:t,cleaned:n,withComments:s,frontmatterLineOffset:l},title:i.title,config:o}}b(nu,"preprocessDiagram");function Vb(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}b(Vb,"toBase64");var oF=5e4,sF="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",nF="sandbox",lF="loose",cF="http://www.w3.org/2000/svg",hF="http://www.w3.org/1999/xlink",dF="http://www.w3.org/1999/xhtml",uF="100%",fF="100%",gF="border:0;margin:0;",pF="margin:0",mF="allow-top-navigation-by-user-activation allow-popups",yF='The "iframe" tag is not supported by your browser.',xF=["foreignobject"],bF=["dominant-baseline"];function lu(e){const t=nu(e);nl();let r;try{r=Ol(t.code.cleaned,Tr())}catch{r=void 0}return fd(r),I2(t.config??{}),t}b(lu,"processAndSetConfigs");async function Zb(e,t){Kl();try{const{code:r,config:i}=lu(e);return{diagramType:(await Fl.fromText(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}finally{fd(void 0)}}b(Zb,"parse");var jg=b((e,t,r=[])=>{const i=Dp(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),CF=b((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=zr(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Nf(l.styles)||n.forEach(c=>{r.insertRule(jg(l.id,c,l.styles),r.cssRules.length)}),Nf(l.textStyles)||r.insertRule(jg(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const a=new CSSStyleSheet;a.replaceSync(e.themeCSS),i=gh(a)+`
307
- `}else i+=`${e.themeCSS}
308
- `;return i+gh(r)},"createCssStyles"),wF=b((e,t)=>qh(gL(`${e}{${t}}`),yL([b(function(i,a,o,s){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===Rh)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[tL,rL,ab,aL,"@container","@starting-style"],Rh].includes(i.type)||(Tt.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=ou))},"addNamespace"),mL])),"compileCSS"),kF=b((e,t,r,i)=>{const a=CF(e,r),o=rw(t,a,{...e.themeVariables,theme:e.theme,look:e.look},i);return wF(i,o)},"createUserStyles"),SF=b((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=ja(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),vF=b((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":fF,i=Vb(`<body style="${pF}">${e}</body>`);return`<iframe style="width:${uF};height:${r};${gF}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${mF}">
309
- ${yF}
310
- </iframe>`},"putIntoIFrame"),Gg=b((e,t,r,i,a)=>{const o=e.append("div");o.attr("id",r),i&&o.attr("style",i);const s=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",cF);return a&&s.attr("xmlns:xlink",a),s.append("g"),e},"appendDivSvgG");function Wh(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}b(Wh,"sandboxedIframe");var MF=b((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),TF=b(async function(e,t,r){Kl();const i=lu(t);let a=i.code;t=a.cleaned;const o=Tr();Tt.debug(o),t.length>(o?.maxTextSize??oF)&&(t=sF,a={raw:t,cleaned:t});const s=`#${e}`,n="i"+e,l="#"+n,c="d"+e,h="#"+c,d=b(()=>{const E=He(f?l:h).node();E&&"remove"in E&&E.remove()},"removeTempElements");let u=He(document.body);const f=o.securityLevel===nF,p=o.securityLevel===lF,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const _=Wh(He(r),n);u=He(_.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=He(r);Gg(u,e,c,`font-family: ${g}`,hF)}else{if(MF(document,e,c,n),f){const _=Wh(He(document.body),n);u=He(_.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=He("body");Gg(u,e,c)}let m,y;try{m=await Fl.fromText(a,{title:i.title})}catch(_){if(o.suppressErrorRendering)throw d(),_;m=await Fl.fromText("error"),y=_,m.db.setErrorMessage?.(ly(_))}const x=u.select(h).node(),C=m.type,k=x.firstChild,v=k.firstChild,T=m.renderer.getClasses?.(t,m),F=kF(o,C,T,s),A=document.createElement("style");A.innerHTML=F,k.insertBefore(A,v);try{await m.renderer.draw(t,e,"12.3.0",m)}catch(_){throw o.suppressErrorRendering?d():_A.draw(t,e,"12.3.0"),_}const M=u.select(`${h} svg`),B=m.db.getAccTitle?.(),$=m.db.getAccDescription?.();Qb(C,M,B,$);const I=b(()=>{u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",dF);let _=u.select(h).node().innerHTML;if(Tt.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),_=SF(_,f,ca(o.arrowMarkerAbsolute)),f){const E=u.select(h+" svg").node();_=vF(_,E)}else p||(_=cs.sanitize(_,{ADD_TAGS:xF,ADD_ATTR:bF,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return tF(),_},"serializeSvg")();if(y)throw y;return d(),{diagramType:C,svg:I,bindFunctions:m.db.bindFunctions}},"renderDiagram"),BF=b(async function(e,t,r){try{return await TF(e,t,r)}finally{fd(void 0)}},"render");function Kb(e={}){const t=Ir({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),E2(t);const r=Ya.theme;t?.theme&&Object.hasOwn(va,t.theme)?t.themeVariables=va[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!=="null"&&(t.theme=r),t.themeVariables=va[r].getThemeVariables(t.themeVariables));const i=typeof t=="object"?$2(t):Np();dd(i.logLevel),Kl()}b(Kb,"initialize");var _F=b((e,t={})=>{const{code:r}=nu(e);return Fl.fromText(r,t)},"getDiagramFromText");function Qb(e,t,r,i){jb(t,e),Gb(t,r,i,t.attr("id"))}b(Qb,"addA11yInfo");var wo=Object.freeze({render:BF,parse:Zb,getDiagramFromText:_F,initialize:Kb,getConfig:Tr,setConfig:qp,getSiteConfig:Np,updateSiteConfig:P2,reset:b(()=>{nl()},"reset"),globalReset:b(()=>{nl(Ya)},"globalReset"),defaultConfig:Ya});dd(Tr().logLevel);nl(Tr());var LF=b((e,t,r)=>{Tt.warn(e),Od(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Jb=b(async function(e={querySelector:".mermaid"}){try{await AF(e)}catch(t){if(Od(t)&&Tt.error(t.str),Ba.parseError&&Ba.parseError(t),!e.suppressErrors)throw Tt.error("Use the suppressErrors option to suppress these errors"),t}},"run"),AF=b(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=wo.getConfig();Tt.debug(`${e?"":"No "}Callback function found`);let a;if(r)a=r;else if(t)a=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Tt.debug(`Found ${a.length} diagrams`),i?.startOnLoad!==void 0&&(Tt.debug("Start On Load: "+i?.startOnLoad),wo.updateSiteConfig({startOnLoad:i?.startOnLoad}));const o=new pi.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let s;const n=[];for(const l of Array.from(a)){if(Tt.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${o.next()}`;s=l.innerHTML,s=wy(pi.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=pi.detectInit(s);h&&Tt.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await i1(c,s,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){LF(d,n,Ba.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),t1=b(function(e){wo.initialize(e)},"initialize"),FF=b(async function(e,t,r){Tt.warn("mermaid.init is deprecated. Please use run instead."),e&&t1(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Jb(i)},"init"),$F=b(async(e,{lazyLoad:t=!0}={})=>{Kl(),hh(...e),t===!1&&await Q5()},"registerExternalDiagrams"),e1=b(function(){if(Ba.startOnLoad){const{startOnLoad:e}=wo.getConfig();e&&Ba.run().catch(t=>Tt.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",e1,!1);var EF=b(function(e){Ba.parseError=e},"setParseErrorHandler"),$l=[],Qc=!1,r1=b(async()=>{if(!Qc){for(Qc=!0;$l.length>0;){const e=$l.shift();if(e)try{await e()}catch(t){Tt.error("Error executing queue",t)}}Qc=!1}},"executeQueue"),PF=b(async(e,t)=>new Promise((r,i)=>{const a=b(()=>new Promise((o,s)=>{wo.parse(e,t).then(n=>{o(n),r(n)},n=>{Tt.error("Error parsing",n),Ba.parseError?.(n),s(n),i(n)})}),"performCall");$l.push(a),r1().catch(i)}),"parse"),i1=b((e,t,r)=>new Promise((i,a)=>{const o=b(()=>new Promise((s,n)=>{wo.render(e,t,r).then(l=>{s(l),i(l)},l=>{Tt.error("Error parsing",l),Ba.parseError?.(l),n(l),a(l)})}),"performCall");$l.push(o),r1().catch(a)}),"render"),IF=b(()=>Object.keys(yo).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Ba={startOnLoad:!0,mermaidAPI:wo,parse:PF,render:i1,init:FF,run:Jb,registerExternalDiagrams:$F,registerLayoutLoaders:eb,initialize:t1,parseError:void 0,contentLoaded:e1,setParseErrorHandler:EF,detectType:Ol,registerIconPacks:Kp,getRegisteredDiagramsMetadata:IF},Jc=Ba;/*! Check if previously processed *//*!
311
- * Wait for document loaded before starting the execution
312
- */function OF(e,t=80){let r,i,a=!1,o=!1,s=0,n;async function l(){if(n=void 0,o||a||!i)return;const c=i,h=s;i=void 0,a=!0;try{await e(c,()=>!o&&h===s)}finally{a=!1,!o&&i&&(n=setTimeout(()=>void l(),t))}}return{update(c){o||r?.source===c.source&&r.isStreaming===c.isStreaming&&r.revision===c.revision||(r&&(!c.isStreaming||!r.isStreaming||c.revision!==r.revision||!c.source.startsWith(r.source))&&(s+=1),r=c,i=c,!a&&n===void 0&&l())},dispose(){o=!0,s+=1,i=void 0,n!==void 0&&clearTimeout(n)}}}const a1="http://www.w3.org/2000/svg",o1="http://www.w3.org/1999/xhtml",s1=["align-items","background","background-color","border","border-color","border-radius","border-style","border-width","box-sizing","color","display","fill","fill-opacity","flex","flex-direction","font-family","font-feature-settings","font-kerning","font-size","font-style","font-variant","font-variation-settings","font-weight","gap","height","justify-content","letter-spacing","line-height","margin","opacity","overflow","overflow-wrap","padding","rx","ry","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-align","text-anchor","text-transform","transform","transform-origin","vector-effect","white-space","-webkit-box-orient","-webkit-line-clamp","width","word-break"];function RF(e,t){const r=getComputedStyle(e);for(const i of s1){const a=r.getPropertyValue(i);a&&(t instanceof SVGElement||t instanceof HTMLElement)&&t.style.setProperty(i,a,"important")}}function DF(e,t){if(!(e instanceof HTMLElement)||e.dataset.storeNode!=="true"&&!e.matches("foreignObject.edge-label-surface > .labelBkg, .edge-label-html"))return;const r=getComputedStyle(e,"::before"),i=document.createElementNS(o1,"span");i.setAttribute("aria-hidden","true"),i.setAttribute("data-diagram-export-pseudo","before");for(const a of s1){const o=r.getPropertyValue(a);o&&i.style.setProperty(a,o)}for(const a of["position","z-index","top","right","bottom","left","pointer-events","mask-image","mask-composite","mask-size","mask-repeat"]){const o=r.getPropertyValue(a);o&&i.style.setProperty(a,o)}t.prepend(i)}function n1(e){const t=e.getAttribute("viewBox")?.trim().split(/[ ,]+/).map(Number),r=e.getBoundingClientRect(),i=t?.length===4?t[2]:0,a=t?.length===4?t[3]:0,o=e.getAttribute("width")??"",s=e.getAttribute("height")??"",n=/^\d+(?:\.\d+)?(?:px)?$/.test(o)?Number.parseFloat(o):0,l=/^\d+(?:\.\d+)?(?:px)?$/.test(s)?Number.parseFloat(s):0,c=e.classList.contains("diagram-svg-layer"),h=(c?n:0)||r.width||n||i||1,d=(c?l:0)||r.height||l||a||1;return{width:h,height:d}}function NF(e){let t=e;for(;t;){const r=getComputedStyle(t).backgroundColor;if(r&&r!=="transparent"&&r!=="rgba(0, 0, 0, 0)")return r;t=t.parentElement}return"transparent"}function Ql(e){const t=e.querySelectorAll(".mermaid-svg > svg, svg.diagram-svg-layer"),r=t.length===1?t[0]:void 0,i=r?.closest(".mermaid-renderer, .diagram-renderer");if(!r||r.closest('[data-diagram-presentation-settled="false"]')||i?.getAttribute("data-render-settled")==="false"||i?.getAttribute("data-diagram-settled")==="false")throw new Error("Diagram SVG is unavailable");return r}function Jl(e){const t=e.cloneNode(!0);t.setAttribute("xmlns",a1),t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const r=[e,...e.querySelectorAll("*")],i=[t,...t.querySelectorAll("*")];r.forEach((s,n)=>{const l=i[n];if(l){if(RF(s,l),s.parentElement?.localName==="foreignObject"&&s instanceof HTMLElement&&l.setAttribute("xmlns",o1),s instanceof HTMLElement&&l instanceof HTMLElement)for(const c of["position","isolation","z-index"])l.style.setProperty(c,getComputedStyle(s).getPropertyValue(c));DF(s,l)}});const{width:a,height:o}=n1(e);return t.hasAttribute("viewBox")||t.setAttribute("viewBox",`0 0 ${a} ${o}`),t.setAttribute("width",String(a)),t.setAttribute("height",String(o)),t.style.setProperty("width",`${a}px`,"important"),t.style.setProperty("height",`${o}px`,"important"),t.style.setProperty("overflow","hidden","important"),t.style.removeProperty("position"),t.style.removeProperty("left"),t.style.removeProperty("top"),t.style.removeProperty("max-width"),t.style.removeProperty("min-width"),t.style.removeProperty("transform"),t}function iP(e){return new XMLSerializer().serializeToString(Jl(Ql(e)))}async function cu(e){const t=n=>n.trim().replace(/^["']|["']$/g,"").toLowerCase(),r=new Set([e,...e.querySelectorAll("[style]")].flatMap(n=>n.style.fontFamily.split(",").map(t))),i=[],a=n=>{let l;try{l=n.cssRules}catch(c){if(c instanceof DOMException&&c.name==="SecurityError")return;throw c}for(const c of Array.from(l))c instanceof CSSFontFaceRule&&r.has(t(c.style.getPropertyValue("font-family")))?i.push(c):c instanceof CSSImportRule&&c.styleSheet?a(c.styleSheet):"cssRules"in c&&a(c)};for(const n of Array.from(e.ownerDocument.styleSheets))a(n);if(!i.length)return;const o=await Promise.all(i.map(async n=>{const l=[...n.cssText.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/g)];let c=n.cssText;for(const[h,,d]of l){if(d.startsWith("data:"))continue;const u=await fetch(new URL(d,n.parentStyleSheet?.href??e.ownerDocument.baseURI));if(!u.ok)throw new Error("Diagram font is unavailable");const f=await u.blob(),p=await new Promise((g,m)=>{const y=new FileReader;y.onload=()=>g(String(y.result)),y.onerror=()=>m(y.error??new Error("Diagram font encoding failed")),y.readAsDataURL(f)});c=c.replace(h,`url("${p}")`)}return c})),s=document.createElementNS(a1,"style");s.textContent=o.join(`
313
- `),e.prepend(s)}async function qF(e){const t=Jl(Ql(e));await cu(t),await FC(new XMLSerializer().serializeToString(t))}async function WF(e){const t=Ql(e),r=Jl(t),{width:i,height:a}=n1(t);await cu(r);const o=2,s=new Image;try{s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`,await s.decode();const n=document.createElement("canvas");n.width=Math.round(i*o),n.height=Math.round(a*o);const l=n.getContext("2d");if(!l)throw new Error("Canvas context is unavailable");l.fillStyle=NF(t),l.fillRect(0,0,n.width,n.height),l.drawImage(s,0,0,n.width,n.height);const c=await new Promise((h,d)=>{n.toBlob(u=>u?h(u):d(new Error("PNG encoding failed")),"image/png")});await navigator.clipboard.write([new ClipboardItem({"image/png":c})])}finally{s.src=""}}async function zF(e,t="diagram"){const r=Jl(Ql(e));await cu(r);const i=new Blob([new XMLSerializer().serializeToString(r)],{type:"image/svg+xml"}),a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=`${t.replace(/[^a-z0-9._-]+/gi,"-").replace(/^-|-$/g,"")||"diagram"}.svg`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)}var HF=er("<!> <!> <!>",1),YF=er("<!> <!>",1);function hu(e,t){if(new.target)return _a({component:hu,...e});Fa(t,!0);let r=ze(t,"container",7),i=ze(t,"fileName",7,"diagram"),a=ze(t,"compactTrigger",7,!1);async function o(){if(!r())return ga.error(Ye.diagram_actions_copyFailed_error());try{await WF(r()),ga.success(Ye.diagram_actions_imageCopied_label())}catch{ga.error(Ye.diagram_actions_copyFailed_error())}}async function s(){if(!r())return ga.error(Ye.diagram_actions_copyFailed_error());try{await qF(r()),ga.success(Ye.diagram_actions_svgCopied_label())}catch{ga.error(Ye.diagram_actions_copyFailed_error())}}async function n(){if(!r())return ga.error(Ye.diagram_actions_downloadFailed_error());try{await zF(r(),i()),ga.success(Ye.diagram_actions_svgDownloaded_label())}catch{ga.error(Ye.diagram_actions_downloadFailed_error())}}var l={get container(){return r()},set container(d){r(d),Te()},get fileName(){return i()},set fileName(d="diagram"){i(d),Te()},get compactTrigger(){return a()},set compactTrigger(d=!1){a(d),Te()},$set:La,$on:(d,u)=>Aa(t,d,u)},c=za(),h=ri(c);return io(h,()=>AC,(d,u)=>{u(d,{children:(f,p)=>{var g=YF(),m=ri(g);{let x=Et(()=>Ye.diagram_actions_menu_ariaLabel()),C=Et(()=>a()?"size-(--control-height-compact) p-0":void 0);io(m,()=>BC,(k,v)=>{v(k,{get"aria-label"(){return S(x)},get class(){return S(C)},children:(T,F)=>{_C(T,{class:"size-3.5"})},$$slots:{default:!0}})})}var y=qe(m,2);io(y,()=>LC,(x,C)=>{C(x,{align:"end",children:(k,v)=>{var T=HF(),F=ri(T);io(F,()=>sc,(B,$)=>{$(B,{onSelect:()=>void o(),children:(P,I)=>{Hs();var _=zn();or(E=>pr(_,E),[()=>Ye.diagram_actions_copyImage_label()]),ge(P,_)},$$slots:{default:!0}})});var A=qe(F,2);io(A,()=>sc,(B,$)=>{$(B,{onSelect:()=>void s(),children:(P,I)=>{Hs();var _=zn();or(E=>pr(_,E),[()=>Ye.diagram_actions_copySvg_label()]),ge(P,_)},$$slots:{default:!0}})});var M=qe(A,2);io(M,()=>sc,(B,$)=>{$(B,{onSelect:()=>void n(),children:(P,I)=>{Hs();var _=zn();or(E=>pr(_,E),[()=>Ye.diagram_actions_downloadSvg_label()]),ge(P,_)},$$slots:{default:!0}})}),ge(k,T)},$$slots:{default:!0}})}),ge(f,g)},$$slots:{default:!0}})}),ge(e,c),$a(l)}const XF="Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",jF="Inter";function tc(e,t,r){const i=e.getPropertyValue(t).trim();if(!i&&r)return tc(e,r);if(!i)throw new Error(`Missing Mermaid design token: ${t}`);return i}function Ui(e,t,r){const i=tc(e,t,r);if(i.startsWith("color-mix(")&&typeof document<"u"){const a=document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");if(o){o.fillStyle=i,o.fillRect(0,0,1,1);const[s,n,l,c]=o.getImageData(0,0,1,1).data;return c===255?`rgb(${s}, ${n}, ${l})`:`rgba(${s}, ${n}, ${l}, ${c/255})`}}return/^(#|rgb|hsl|oklch|color(?:-mix)?\()/.test(i)?i:`hsl(${i})`}function GF(e,t,r){const i=tc(e,t,r);if(!i.endsWith("rem"))return i;const a=Number.parseFloat(e.fontSize);if(!Number.isFinite(a))throw new Error("Missing root font size for Mermaid");return`${Number.parseFloat(i)*a}px`}function UF(e,t=!0){const r=Ui(e,"--foreground"),i=Ui(e,"--card-foreground"),a=Ui(e,"--muted"),o=Ui(e,"--border"),s=Ui(e,"--accent"),n=Ui(e,"--accent-foreground"),l=Ui(e,"--diagram-canvas","--background"),c=Ui(e,"--diagram-node-surface","--card"),h=Ui(e,"--diagram-connector","--muted-foreground"),d=Ui(e,"--muted-foreground"),u=e.getPropertyValue("--font-ui").trim()||XF,f=GF(e,"--text-caption-size");return tc(e,"--radius-small"),{startOnLoad:!1,theme:"base",look:"classic",elk:{preset:"legacy",lineHops:!1,straightenEdges:!1,orientFeedbackEdges:!1},securityLevel:"loose",fontFamily:u,fontSize:Number.parseFloat(f),htmlLabels:t,themeCSS:[".label, foreignObject { transition-property: opacity, color, background-color !important; }",`.cluster-label text { fill: ${d}; }`,`.cluster-label span { color: ${d}; }`].join(`
314
- `),flowchart:{useMaxWidth:!1,curve:"stepAfter",diagramPadding:8,nodeSpacing:32,rankSpacing:40,wrappingWidth:200,minNodeWidth:0},sequence:{useMaxWidth:!1,wrap:!0,mirrorActors:!1,actorMargin:40,boxMargin:8,boxTextMargin:6,noteMargin:8,messageMargin:24,width:140,wrapPadding:6},class:{htmlLabels:!1},state:{minNodeWidth:0,wrappingWidth:200,nodeSpacing:48,rankSpacing:48,padding:8},themeVariables:{background:l,primaryColor:c,primaryTextColor:r,primaryBorderColor:c,secondaryColor:a,secondaryTextColor:r,secondaryBorderColor:a,tertiaryColor:l,tertiaryTextColor:r,tertiaryBorderColor:o,lineColor:h,arrowheadColor:h,textColor:r,mainBkg:c,nodeBkg:c,nodeBorder:c,nodeTextColor:i,clusterBkg:l,clusterBorder:o,defaultLinkColor:h,edgeLabelBackground:l,titleColor:r,actorBkg:c,actorBorder:c,actorTextColor:i,actorLineColor:o,signalColor:h,signalTextColor:r,labelBoxBkgColor:a,labelBoxBorderColor:o,labelTextColor:r,loopTextColor:r,activationBkgColor:s,activationBorderColor:o,noteBkgColor:s,noteBorderColor:o,noteTextColor:n,transitionColor:h,transitionLabelColor:d,stateBkg:c,stateLabelColor:i,labelBackgroundColor:l,compositeBackground:l,compositeTitleBackground:l,compositeBorder:o,classText:i,fillType0:c,fillType1:a,fontFamily:u}}}let Ug=Promise.resolve();function VF(e,t=()=>!0){const r=async()=>{if(t()&&(await new Promise(a=>setTimeout(a,0)),!!t()))return e()},i=Ug.then(r,r);return Ug=i.then(()=>{},()=>{}),i}const ZF=/[./\\:_-]/;function ec(e){const t=[];let r="";const i=(a,o=!1)=>{r&&t.push({text:r,breakAfter:a,hardBreak:o}),r=""};for(let a=0;a<e.length;a+=1){const o=e[a],s=e[a-1]??"";if(r&&/[A-Z]/.test(o)&&/[a-z0-9]/.test(s)&&i(!0),o===`
315
- `){i(!0,!0);continue}r+=o,(/\s/.test(o)||ZF.test(o))&&i(!0)}return i(!1),t}function Vg(e){return ec(e).map(t=>t.text.trim()).filter(Boolean)}function du(e){if(/\s/.test(e)||!/\.[A-Za-z][A-Za-z0-9]*$/.test(e))return null;const t=e.split(".");return t.length<=2?e.length<=21?[e]:[t[0],`.${t[1]}`]:[`${t.slice(0,-2).join(".")}.`,t.slice(-2).join(".")]}function KF(e){const t=du(e);return t||e.split(/\s+/).flatMap(r=>r.match(/[^./\\]+[./\\]?/g)??[]).filter(Boolean)}const QF=new Intl.Segmenter(void 0,{granularity:"grapheme"});function zh(e){return Array.from(QF.segment(e),({segment:t})=>t)}function Zg(e,t,r,i=!1){const a=Math.max(1,t);let o=1,s="";for(const[n,l]of e.entries()){const c=l.replace(/[\t\r\f ]+/g," "),h=`${s}${c}`.trimStart();if(r(h.trimEnd())<=a){s=h;continue}s.trim()&&(o+=1),s="";for(const d of zh(c.trimStart()))s&&r(`${s}${d}`.trimEnd())>a&&(o+=1,s=""),s+=d;i&&r(c.trim())>a&&n<e.length-1&&(o+=1,s="")}return o}function JF(e){const t=new Map(e.map(({id:i,nodes:a})=>[i,[...a]])),r=new Map;for(const i of t.keys()){const a=new Set,o=s=>{if(!(s===i||a.has(s))){a.add(s);for(const n of t.get(s)??[])o(n)}};for(const s of t.get(i)??[])o(s);r.set(i,a)}return r}function uu(e,t){return t.has(e.id)?e.id:[...t.keys()].filter(r=>e.id.endsWith(`-${r}`)).toSorted((r,i)=>i.length-r.length)[0]}function l1(e,t,r){const i=document.createElementNS("http://www.w3.org/2000/svg","rect");i.classList.add("edge-label-knockout"),i.setAttribute("x",String(r.x-6)),i.setAttribute("y",String(r.y-4)),i.setAttribute("width",String(r.width+12)),i.setAttribute("height",String(r.height+8)),i.setAttribute("rx","2"),i.dataset.labelPaddingX="6",i.dataset.labelPaddingY="4",e.insertBefore(i,t)}function Kg(e){const t=[];for(const r of e.querySelectorAll("g.edgeLabel")){if(r.querySelector(".edge-label-knockout, rect.background, foreignObject"))continue;const i=r.querySelector("text");i&&t.push({parent:r,before:r.firstElementChild,bounds:i.getBBox()})}for(const r of e.querySelectorAll("text.messageText, text.loopText")){if(r.dataset.labelKnockout==="true"||!r.textContent?.trim())continue;const i=r.parentElement;i&&t.push({parent:i,before:r,bounds:r.getBBox(),text:r})}for(const{parent:r,before:i,bounds:a,text:o}of t)l1(r,i,a),o&&(o.dataset.labelKnockout="true")}function t3(e){const t=getComputedStyle(e),r=t.font||`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return document.fonts?.load(r,e.textContent??"")}const Qg="rect, circle, ellipse, polygon, path",Jg=new WeakMap;function e3(){const e=new Map;let t;return r=>{if(e.has(r))return e.get(r);let i=r==="none"?Qi(0,0,0,0):Rl(r)?.rgb()??null;if(!i&&typeof CSS<"u"&&CSS.supports("color",r)){if(t===void 0){const a=document.createElement("canvas");a.width=a.height=1,t=a.getContext("2d")}if(t){t.clearRect(0,0,1,1),t.fillStyle=r,t.fillRect(0,0,1,1);const[a,o,s,n]=t.getImageData(0,0,1,1).data;i=Qi(a,o,s,n/255)}}return i=i?.clamp()??null,e.set(r,i),i}}function On(e,t){const r=e.opacity+t.opacity*(1-e.opacity);if(!r)return Qi(0,0,0,0);const i=(a,o)=>(a*e.opacity+o*t.opacity*(1-e.opacity))/r;return Qi(i(e.r,t.r),i(e.g,t.g),i(e.b,t.b),r)}function Rn(e){return e?e.endsWith("%")?Number.parseFloat(e)/100:Number(e):1}function r3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;for(const d of Jg.get(e)??[])d();const r=[];Jg.set(e,r);const i=e3();let a=Qi(0,0,0,0);for(let d=e;d;d=d.parentElement){const u=getComputedStyle(d);if(u.backgroundImage&&u.backgroundImage!=="none")return;const f=i(u.backgroundColor);if(!f)return;if(a=On(a,f),a.opacity===1)break}if(a.opacity!==1)return;const o=[...e.querySelectorAll("g.cluster")],s=new Map(o.map(d=>[d,t?uu(d,t):d.id])),n=d=>{const u=s.get(d)??d.id.match(/flowchart-(.+?)-\d+$/)?.[1]??d.id,f=o.filter(p=>{const g=s.get(p);return p!==d&&g&&t?.get(g)?.has(u)});return f.length?f.sort((p,g)=>t.get(s.get(p)).size-t.get(s.get(g)).size)[0]:d.parentElement?.closest("g.cluster")??void 0},l=new Map,c=(d,u=new Set)=>{if(l.has(d))return l.get(d);if(u.has(d))return null;u.add(d);const f=n(d),p=f?c(f,u):a;if(!p)return null;const g=d.querySelector(":scope > .label-container"),m=g?.matches(Qg)?g:g?.querySelector(Qg)??d.querySelector(":scope > rect, :scope > circle, :scope > ellipse, :scope > polygon, :scope > path");if(!m)return null;const y=getComputedStyle(m),x=i(y.fill),C=x?On(Qi(x.r,x.g,x.b,x.opacity*Rn(y.fillOpacity)*Rn(y.opacity)),p):null;return l.set(d,C),C},h=[];for(const d of e.querySelectorAll("g.node, g.cluster")){const u=c(d);if(!u)continue;const f=d.querySelector(":scope > .label, :scope > .cluster-label");if(f)for(const p of f.querySelectorAll("text, tspan, foreignObject *")){if(p.closest("svg")!==e||![...p.childNodes].some(M=>M.nodeType===3&&M.textContent?.trim()))continue;let g=!1,m=u;const y=[];for(let M=p;M&&M!==e;M=M.parentElement){const B=getComputedStyle(M);(B.display==="none"||B.visibility==="hidden"||Rn(B.opacity)!==1)&&(g=!0),M.namespaceURI==="http://www.w3.org/1999/xhtml"&&y.unshift(M)}if(g)continue;for(const M of y){const B=getComputedStyle(M),$=i(B.backgroundColor);if(!$||B.backgroundImage&&B.backgroundImage!=="none"){g=!0;break}m=On($,m)}if(g)continue;const x=getComputedStyle(p),C=p.namespaceURI==="http://www.w3.org/1999/xhtml"?"color":"fill",k=i(x.getPropertyValue(C)),v=C==="fill"?Rn(x.fillOpacity):1;if(!k||!k.opacity||!v)continue;const T=M=>kC(On(Qi(M.r,M.g,M.b,M.opacity*v),m).formatHex(),m.formatHex()).ratio;if(T(k)>=4.5)continue;const A=[i(getComputedStyle(e).color),Qi(0,0,0),Qi(255,255,255)].filter(M=>M!==null).filter(M=>T(M)>=4.55)[0];A&&h.push({element:p,property:C,value:A.formatRgb()})}}for(const{element:d,property:u,value:f}of h){const p=d.style.getPropertyValue(u),g=d.style.getPropertyPriority(u);r.push(()=>{p?d.style.setProperty(u,p,g):d.style.removeProperty(u)}),d.style.setProperty(u,f,"important")}}const c1=6,ai=16,i3=18,a3=4,Dn=7,h1=8,fu=8;function Oi(e,t){return t==="top"?Lt(e,.5,0):t==="right"?Lt(e,1,.5):t==="bottom"?Lt(e,.5,1):Lt(e,0,.5)}function o3(e,t){const r=e.x+e.width/2,i=t.filter(Number.isFinite).toSorted((s,n)=>s-n);if(!i.some(s=>Math.abs(s-r)<=1))return r;const a=i.length+1,o=Math.min(ai,e.width*.6/(a-1));return r-o*(a-1)/2}function s3(e,t){const r=e.x+e.width/2;if(!t.some(o=>o<r)||!t.some(o=>o>r)||t.every(o=>Math.abs(o-r)>=ai))return;const i=Math.min(...t)-ai,a=Math.min(e.width/2,e.corner?.x??0);return i>=e.x+a&&i<=e.x+e.width-a?i:void 0}function gu(e,t,r){const i=e.getScreenCTM(),a=Math.hypot(r.x-t.x,r.y-t.y);if(!i||a<=0)return 1;const o=new DOMPoint(t.x,t.y).matrixTransform(i),s=new DOMPoint(r.x,r.y).matrixTransform(i);return Math.hypot(s.x-o.x,s.y-o.y)/a||1}const Zr=24,n3=32;function sn(e){return Math.ceil(Math.max(e,18))+Zr+n3}function l3(e,t,r,i,a=!1){if((!a||r==="upper")&&t.y>=e.y+e.height+16){const u=Oi(e,"bottom"),f=Oi(t,"top"),p=(u.y+f.y)/2,g=vr([u,{x:u.x,y:p},{x:f.x,y:p},f]),m=i.filter(y=>![e,t].some(x=>Math.abs(y.x-x.x)<.001&&Math.abs(y.y-x.y)<.001&&Math.abs(y.width-x.width)<.001&&Math.abs(y.height-x.height)<.001));if(ar(g).every(y=>!m.some(x=>Sr(y,x,8))))return g}const o=r==="upper"&&t.y>=e.y+e.height,s=r==="upper"&&!o?"top":"right";if(a&&o){const u=Oi(e,"bottom"),f=Oi(t,"top"),p={x:Math.max(t.x,Math.min(u.x,t.x+t.width)),y:f.y},g=(x,C)=>Math.abs(x.x-C.x)<.001&&Math.abs(x.y-C.y)<.001&&Math.abs(x.width-C.width)<.001&&Math.abs(x.height-C.height)<.001,m={start:u,end:p};if(Math.abs(u.x-p.x)<.001&&!i.some(x=>!g(x,e)&&!g(x,t)&&Sr(m,x,fu)))return[u,p]}const n=o?"right":r==="upper"?"top":t.x>=e.x+e.width?"left":"right",l=Oi(e,s),c=Oi(t,n),h=a?16:32;if(s==="top"){const u=Math.min(...i.map(f=>f.y),t.y,e.y)-h;if(Math.abs(l.x-c.x)<.001){const f=Math.max(e.x+e.width,t.x+t.width,...i.map(p=>p.x+p.width))+h;return vr([l,{x:l.x,y:u},{x:f,y:u},{x:f,y:c.y},c])}return vr([l,{x:l.x,y:u},{x:c.x,y:u},c])}if(n==="left"&&l.y>=t.y&&l.y<=t.y+t.height)return[l,{x:t.x,y:l.y}];if(n==="left"){if(Math.abs(l.y-c.y)<.001)return[l,c];const u=(l.x+c.x)/2;return[l,{x:u,y:l.y},{x:u,y:c.y},c]}const d=Math.max(...i.map(u=>u.x+u.width))+h*2;return vr([l,{x:d,y:l.y},{x:d,y:c.y},c])}function c3(e,t,r,i=!1){const a=Oi(e,"bottom"),o=Oi(t,i?"left":"bottom"),s=i?16:32,n=Math.max(...r.map(l=>l.y+l.height))+s;if(i){const l=Math.min(e.x,t.x,...r.map(h=>h.x))-s-12,c=a.y+12;return vr([a,{x:a.x,y:c},{x:l,y:c},{x:l,y:o.y},o])}return vr([a,{x:a.x,y:n},{x:o.x,y:n},o])}function h3(e,t,r,i=!1){const a=i?e.x+e.width+28:Math.max(...r.map(c=>c.x+c.width))+28,o=Math.min(...r.map(c=>c.x))-(i?12:28),s=Math.max(...r.map(c=>c.y+c.height))+(i?12:28),n=e.y+e.height/2,l=t.x+t.width/2;return[{x:e.x+e.width,y:n},{x:a,y:n},{x:a,y:s},{x:o,y:s},{x:o,y:t.y+t.height+12},{x:l,y:t.y+t.height+12},{x:l,y:t.y+t.height+.25}]}function d3(e,t,r,i=!1){const a=Math.max(...r.map(n=>n.x+n.width))+(i?18:28),o=e.y+e.height/2,s=t.y+t.height/2;return[{x:e.x+e.width,y:o},{x:a,y:o},{x:a,y:s},{x:t.x+t.width,y:s}]}function u3(e,t){if(e.length!==7||e[3].x!==e[4].x||e[3].y<=e[4].y)return e;const r=Math.min(e[3].x,...t.filter(i=>i.y<e[3].y&&i.y+i.height>e[4].y).map(i=>i.x-20));return r===e[3].x?e:e.map((i,a)=>a===3||a===4?{...i,x:r}:i)}function Si(e,t,r=4){return e.x<t.x+t.width+r&&e.x+e.width+r>t.x&&e.y<t.y+t.height+r&&e.y+e.height+r>t.y}function Sr(e,t,r=0){const i=t.x-r,a=t.x+t.width+r,o=t.y-r,s=t.y+t.height+r;return Math.abs(e.start.x-e.end.x)<.001?e.start.x>i&&e.start.x<a&&Math.max(e.start.y,e.end.y)>o&&Math.min(e.start.y,e.end.y)<s:Math.abs(e.start.y-e.end.y)>=.001?!1:e.start.y>o&&e.start.y<s&&Math.max(e.start.x,e.end.x)>i&&Math.min(e.start.x,e.end.x)<a}function f3(e,t,r=fu,i=[]){let a=vr(e);for(let o=0;o<t.length*2+1;o+=1){let s;for(let n=0;n<a.length-1&&!s;n+=1){const l={start:a[n],end:a[n+1]},c=t.find(m=>Sr(l,m,r));if(!c)continue;const h=Math.abs(l.start.x-l.end.x)<.001,d=h?l.end.y>=l.start.y:l.end.x>=l.start.x,u=h?d?c.y-r:c.y+c.height+r:d?c.x-r:c.x+c.width+r,f=h?d?c.y+c.height+r:c.y-r:d?c.x+c.width+r:c.x-r,g=(h?[c.x-r,c.x+c.width+r]:[c.y-r,c.y+c.height+r]).map(m=>{const y=h?[l.start,{x:l.start.x,y:u},{x:m,y:u},{x:m,y:f},{x:l.end.x,y:f},l.end]:[l.start,{x:u,y:l.start.y},{x:u,y:m},{x:f,y:m},{x:f,y:l.end.y},l.end],x=ar(vr(y)),C=x.reduce((T,F)=>T+t.filter(A=>A!==c&&Sr(F,A,r)).length,0),k=x.filter(T=>i.some(F=>gs(T,F))).length,v=x.reduce((T,F)=>T+Math.hypot(F.end.x-F.start.x,F.end.y-F.start.y),0);return{detour:y,score:C*1e6+k*1e4+v}});s={index:n,points:g.toSorted((m,y)=>m.score-y.score)[0].detour}}if(!s)break;a=vr([...a.slice(0,s.index),...s.points,...a.slice(s.index+2)])}return a}const Me={userSendsMessage:"User sends message",agentResponds:"Agent responds",toolStarts:"Tool starts",toolCompletes:"Tool completes",agentAsksUser:"Agent asks user",userReplies:"User replies",agentFinishes:"Agent finishes",requestFails:"Request fails",streamFails:"Stream fails",userRetries:"User retries"},tp={[Me.userSendsMessage]:["Idle","Starting"],[Me.agentResponds]:["Starting","Streaming"],[Me.toolStarts]:["Streaming","RunningTool"],[Me.toolCompletes]:["RunningTool","Streaming"],[Me.agentAsksUser]:["Streaming","NeedsInput"],[Me.userReplies]:["NeedsInput","Streaming"],[Me.agentFinishes]:["Streaming","Complete"],[Me.requestFails]:["Starting","Failed"],[Me.streamFails]:["Streaming","Failed"],[Me.userRetries]:["Failed","Starting"]};function g3(e){return{direction:e.direction,nodes:e.nodes.map(({id:t,domId:r,shape:i,isGroup:a,parentId:o})=>({id:t,domId:r,shape:i,isGroup:a,parentId:o})),edges:e.edges.map(({id:t,start:r,end:i,label:a})=>({id:t,start:r,end:i,label:a}))}}function Hh(e,t){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`(${r})([\\s,]+)(${r})\\s*$`,"i"));if(!i||i.index===void 0)return null;const a=`${e.slice(0,i.index)}${t.x}${i[2]}${t.y}`,o=a.match(new RegExp(`L\\s*(${r})[\\s,]+(${r})\\s*$`,"i"));if(!o||o.index===void 0)return a;const s=a.slice(0,o.index).match(new RegExp(`(${r})[\\s,]+(${r})\\s*$`,"i"));return s&&Math.hypot(Number(s[1])-t.x,Number(s[2])-t.y)<.001?a.slice(0,o.index).trimEnd():a}function p3(e,t,r){const i=e.match(/[a-zA-Z]|-?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi);if(!i)return null;const a={M:2,L:2,Q:4,C:6},o=[];let s={x:0,y:0};for(let p=0;p<i.length;){const g=i[p++],m=a[g];if(!m)return Hh(e,t);const y=i.slice(p,p+m).map(Number);if(y.length!==m||!y.every(Number.isFinite))return null;p+=m;const x=Array.from({length:m/2},(C,k)=>({x:y[k*2],y:y[k*2+1]}));o.push({command:g,points:x,start:s}),s=x.at(-1)}const n=p=>(p.x-t.x)*r.x+(p.y-t.y)*r.y;let l=o.length-1;for(;l>0&&n(o[l].start)>=0;)l-=1;const c=o[l];if(!c||c.command==="M"||n(c.points.at(-1))<0)return Hh(e,t);const h=p=>{let g=[c.start,...c.points];const m=[g[0]];for(;g.length>1;)g=g.slice(1).map((y,x)=>({x:g[x].x+(y.x-g[x].x)*p,y:g[x].y+(y.y-g[x].y)*p})),m.push(g[0]);return m.slice(1)};let d=0,u=1;for(let p=0;p<32;p++){const g=(d+u)/2;n(h(g).at(-1))<0?d=g:u=g}return[...o.slice(0,l),{...c,points:h((d+u)/2)}].map(({command:p,points:g})=>`${p} ${g.map(m=>`${m.x} ${m.y}`).join(" ")}`).join(" ")}function Qe(e,t){const r=e.getScreenCTM(),i=t.getScreenCTM();if(!r||!i)return null;const a=i.inverse(),o=e.getBBox(),s=[new DOMPoint(o.x,o.y),new DOMPoint(o.x+o.width,o.y),new DOMPoint(o.x+o.width,o.y+o.height),new DOMPoint(o.x,o.y+o.height)].map(d=>d.matrixTransform(r).matrixTransform(a)),n=Math.min(...s.map(d=>d.x)),l=Math.min(...s.map(d=>d.y)),c=Math.max(...s.map(d=>d.x)),h=Math.max(...s.map(d=>d.y));return{x:n,y:l,width:c-n,height:h-l}}function xr(e,t){const r=t.getScreenCTM();if(!r)return Qe(e,t);const i=r.inverse(),a=e.getBoundingClientRect(),o=[new DOMPoint(a.left,a.top),new DOMPoint(a.right,a.top),new DOMPoint(a.right,a.bottom),new DOMPoint(a.left,a.bottom)].map(h=>h.matrixTransform(i)),s=Math.min(...o.map(h=>h.x)),n=Math.min(...o.map(h=>h.y)),l=Math.max(...o.map(h=>h.x)),c=Math.max(...o.map(h=>h.y));return{x:s,y:n,width:l-s,height:c-n}}function d1(e,t,r,i=0){let a=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;for(const[s,n,l,c]of[[e.x,t.x,r.x,r.x+r.width],[e.y,t.y,r.y,r.y+r.height]]){if(Math.abs(n)<1e-4){if(s<l-i||s>c+i)return null;continue}const h=(l-s)/n,d=(c-s)/n;a=Math.max(a,Math.min(h,d)),o=Math.min(o,Math.max(h,d))}return a<0||a>o?null:{x:e.x+t.x*a,y:e.y+t.y*a}}function ea(e,t){return Math.hypot(Math.max(t.x-e.x,0,e.x-t.x-t.width),Math.max(t.y-e.y,0,e.y-t.y-t.height))}function m3(e,t,r){const i=r.x-t.x,a=r.y-t.y,o=i*i+a*a,s=o?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*a)/o)):0;return Math.hypot(e.x-t.x-i*s,e.y-t.y-a*s)}function y3(e,t){const r=Number.parseFloat(t.dataset.cylinderRimRatio??"0.14"),i=Math.max(1,Math.min(e.height/2,e.height*r)),a=e.x+e.width/2,o=e.width/2,s=[];for(let n=0;n<=32;n+=1){const l=Math.PI+Math.PI*n/32;s.push({x:a+Math.cos(l)*o,y:e.y+i+Math.sin(l)*i})}s.push({x:e.x+e.width,y:e.y+e.height-i});for(let n=0;n<=32;n+=1){const l=Math.PI*n/32;s.push({x:a+Math.cos(l)*o,y:e.y+e.height-i+Math.sin(l)*i})}return s.push({x:e.x,y:e.y+i}),s}function oa(e){return e.tagName.toLowerCase()!=="polygon"?!1:e.getAttribute("points")?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number)?.length===8}function u1(e){const t=Lt(e,.5,.5);return[{x:t.x,y:e.y},{x:e.x+e.width,y:t.y},{x:t.x,y:e.y+e.height},{x:e.x,y:t.y}]}function x3(e,t,r){const i=(o,s)=>o.x*s.y-o.y*s.x,a=u1(r);return a.map((o,s)=>({start:o,end:a[(s+1)%a.length]})).flatMap(({start:o,end:s})=>{const n={x:s.x-o.x,y:s.y-o.y},l=i(t,n);if(Math.abs(l)<1e-4)return[];const c={x:o.x-e.x,y:o.y-e.y},h=i(c,n)/l,d=i(c,t)/l;return h>=0&&d>=0&&d<=1?[{point:{x:e.x+t.x*h,y:e.y+t.y*h},rayProgress:h}]:[]}).toSorted((o,s)=>o.rayProgress-s.rayProgress)[0]?.point}function ep(e,t,r){if(r.tagName.toLowerCase()==="rect"&&r.closest("svg")?.classList.contains("statediagram")){const a=r.getScreenCTM(),o=getComputedStyle(r),s=r.getBBox(),n=h=>/^\d+(?:\.\d+)?(?:px)?$/.test(h)?Number.parseFloat(h):NaN,l=n(o.rx==="auto"?o.ry:o.rx),c=n(o.ry==="auto"?o.rx:o.ry);if(a&&Math.abs(a.b)<1e-8&&Math.abs(a.c)<1e-8){const h=Math.min(s.width/2,l)*Math.abs(a.a),d=Math.min(s.height/2,c)*Math.abs(a.d);if(h>0&&Math.abs(h-d)<1e-6){const u=Math.abs(e.x-t.x-t.width/2)-(t.width/2-h),f=Math.abs(e.y-t.y-t.height/2)-(t.height/2-h);return Math.max(0,Math.hypot(Math.max(0,u),Math.max(0,f))-h)}}}const i=oa(r)?u1(t):r.dataset.diagramCylinder==="true"?y3(t,r):null;return i?Math.min(...i.map((a,o)=>m3(e,a,i[(o+1)%i.length]))):ea(e,t)}function b3(e,t,r,i,a=0){const o=d1(e,t,r,a);if(!o)return null;if(oa(i))return x3(e,t,r)??o;if(i.dataset.diagramCylinder!=="true")return o;const s={x:r.x+r.width/2,y:r.y+r.height/2};let n=Math.hypot(o.x-e.x,o.y-e.y),l=(s.x-e.x)*t.x+(s.y-e.y)*t.y;const c=Number.parseFloat(i.dataset.cylinderRimRatio??"0.14"),h=Math.max(1,Math.min(r.height/2,r.height*c)),d=u=>{const f={x:e.x+t.x*u,y:e.y+t.y*u};if(f.y>=r.y+h&&f.y<=r.y+r.height-h)return f.x>=r.x&&f.x<=r.x+r.width;const p=f.y<r.y+h?r.y+h:r.y+r.height-h,g=(f.x-s.x)/(r.width/2),m=(f.y-p)/h;return g*g+m*m<=1};for(let u=0;u<24;u+=1){const f=(n+l)/2;d(f)?l=f:n=f}return{x:e.x+t.x*l,y:e.y+t.y*l}}function rp(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll("g.node")].flatMap(r=>{const i=r.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > polygon");return i?[{node:r,shape:i}]:[]});for(const r of e.querySelectorAll('.edgePaths path[marker-end], path.transition[data-edge="true"][marker-end]')){const i=r.getTotalLength();if(i<.25)continue;const a=r.getPointAtLength(i),o=r.getPointAtLength(Math.max(0,i-.1)),s=(r.dataset.terminalDirection??"").split(",").map(Number),n=s.length===2&&s.every(Number.isFinite)?{x:s[0],y:s[1]}:{x:a.x-o.x,y:a.y-o.y},l=Math.hypot(n.x,n.y);if(l<1e-4)continue;const c={x:n.x/l,y:n.y/l},h={x:a.x-c.x*256,y:a.y-c.y*256},d=r.dataset.terminalTarget,f=t.flatMap(({node:g,shape:m})=>{const y=xr(m,r);if(!y)return[];const x=y,C=d1(h,c,x,.5);if(!C)return[];const k=Math.hypot(C.x-a.x,C.y-a.y),v={x:x.x+x.width/2,y:x.y+x.height/2};return c.x*(v.x-C.x)+c.y*(v.y-C.y)>0&&(g.id===d||k<=a3)?[{node:g,intersection:C,correction:k}]:[]}).sort((g,m)=>g.correction-m.correction)[0];if(!f)continue;const p=Hh(r.getAttribute("d")??"",f.intersection);p&&(r.setAttribute("d",p),r.dataset.terminalTarget=f.node.id,r.dataset.terminalDirection=`${c.x},${c.y}`)}}function ip(e,t){const i=(t.getAttribute("marker-end")??"").match(/#([^)'"]+)/)?.[1];return i?e.querySelector(`marker[id="${CSS.escape(i)}"]`):null}function Ps(e,t=5){const r=[...e.querySelectorAll("g.node")].flatMap(i=>{const a=Ke(i);return a?[{node:i,shape:a}]:[]});for(const i of e.querySelectorAll(".edgePaths path[marker-end], .edges.edgePath path[marker-end]")){if(ip(e,i)?.dataset.diagramChevron!=="true")continue;const a=i.dataset.terminalGapBasePath??i.getAttribute("d");if(!a)continue;i.dataset.terminalGapBasePath=a,i.setAttribute("d",a);const o=i.getTotalLength();if(o<.25)continue;const s=i.getPointAtLength(o),n=i.getPointAtLength(Math.max(0,o-.1)),l=i.getScreenCTM();if(!l)continue;const c=new DOMPoint(s.x,s.y).matrixTransform(l),h=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(R=>R.split(",").map(Number)).filter(R=>R.length===2&&R.every(Number.isFinite)).map(([R,D])=>({x:R,y:D})),d=h.at(-2)??n,u=h.at(-1)??s,f=(i.dataset.terminalDirection??"").split(",").map(Number),p=h.length>=2?{x:u.x-d.x,y:u.y-d.y}:f.length===2&&f.every(Number.isFinite)?{x:f[0],y:f[1]}:{x:s.x-n.x,y:s.y-n.y},g=new DOMPoint(0,0).matrixTransform(l),m=new DOMPoint(p.x,p.y).matrixTransform(l),y=Math.hypot(m.x-g.x,m.y-g.y);if(y<=0)continue;const x={x:(m.x-g.x)/y,y:(m.y-g.y)/y},C=Cr(i),k=i.dataset.terminalTarget??C?.target,v={x:c.x-x.x*256,y:c.y-x.y*256},F=r.flatMap(({node:R,shape:D})=>{if(k&&R.id!==k&&Or(R)!==k)return[];const G=D.getBoundingClientRect(),j={x:G.left,y:G.top,width:G.width,height:G.height},z=b3(v,x,j,D,e.classList.contains("statediagram")?.5:0);if(!z)return[];const Q={x:j.x+j.width/2,y:j.y+j.height/2},et=x.x*(Q.x-z.x)+x.y*(Q.y-z.y)>0,rt=Math.hypot(z.x-c.x,z.y-c.y);return et&&(k||rt<=12)?[{node:R,shape:D,bounds:j,intersection:z,correction:rt}]:[]}).sort((R,D)=>R.correction-D.correction)[0];if(!F)continue;const A=ip(e,i)?.querySelector("path"),M=Number.parseFloat(A?getComputedStyle(A).strokeWidth:"0"),B=t+(Number.isFinite(M)?M/2:0);let $=0,P=B;const I=R=>({x:F.intersection.x-x.x*R,y:F.intersection.y-x.y*R});for(;ep(I(P),F.bounds,F.shape)<B&&P<256;)P*=2;for(let R=0;R<24;R+=1){const D=($+P)/2;ep(I(D),F.bounds,F.shape)<B?$=D:P=D}const _=I(P),E=new DOMPoint(_.x,_.y).matrixTransform(l.inverse()),L=I(P+1),q=new DOMPoint(L.x,L.y).matrixTransform(l.inverse()),W=p3(i.getAttribute("d")??"",q,p);W&&(i.setAttribute("d",`${W} L ${E.x} ${E.y}`),i.dataset.terminalTarget=F.node.id,i.dataset.terminalGapCss=String(t))}}function pu(e,t=3){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`[ML]|${r}`,"gi")),a=e.replace(new RegExp(`[ML]|${r}|[\\s,]`,"gi"),"").trim();if(!i||a)return null;const o=[];let s="";for(let n=0;n<i.length;n+=1){const l=i[n];if(/^[ML]$/i.test(l)){s=l.toUpperCase();continue}const c=i[n+1];if(!s||!c||/^[ML]$/i.test(c))return null;o.push({x:Number(l),y:Number(c)}),n+=1,s="L"}return o.length<t?null:o.slice(1).every((n,l)=>{const c=o[l];return Math.abs(n.x-c.x)<.001||Math.abs(n.y-c.y)<.001})?o:null}function vr(e){const t=e.filter((i,a)=>!a||Math.hypot(i.x-e[a-1].x,i.y-e[a-1].y)>=.001),r=[];for(const i of t){const a=r.at(-1),o=r.at(-2);a&&o&&(Math.abs(o.x-a.x)<.001&&Math.abs(a.x-i.x)<.001||Math.abs(o.y-a.y)<.001&&Math.abs(a.y-i.y)<.001)?r[r.length-1]=i:r.push(i)}return r}function mu(e,t=c1){const r=[`M ${e[0].x} ${e[0].y}`];for(let a=1;a<e.length-1;a+=1){const o=e[a-1],s=e[a],n=e[a+1],l=Math.hypot(s.x-o.x,s.y-o.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-o.x)*(n.y-s.y)-(s.y-o.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u=s.x-(s.x-o.x)/l*d,f=s.y-(s.y-o.y)/l*d,p=s.x+(n.x-s.x)/c*d,g=s.y+(n.y-s.y)/c*d;r.push(`L ${u} ${f}`,`Q ${s.x} ${s.y} ${p} ${g}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function th(e){for(const t of e.querySelectorAll('.flowchart-link, .edgePaths path, path.relation, path.transition[data-edge="true"]')){const r=pu(t.getAttribute("d")??"");if(!r)continue;const i=vr(r);t.dataset.manhattanPoints??=i.map(o=>`${o.x},${o.y}`).join(" ");const a=mu(i);t.dataset.feedbackLane||(t.dataset.manhattanSegments=String(Math.max(0,i.length-1))),a.includes(" Q ")&&(t.setAttribute("d",a),t.dataset.cornerRadius=String(c1))}}function Ke(e){return e.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > .outer-path, :scope > .basic.label-container, :scope > polygon")}function C3(e){for(const t of e.querySelectorAll("g.node")){const r=t.querySelector(":scope > path.basic.label-container.outer-path[label-offset-y]");if(!r||r.dataset.diagramCylinder==="true")continue;const i=r.getBBox(),a=i.height,s=i.width/2,n=Math.min(8,a*.14),l=-a/2,c=a/2;r.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} L ${s} ${c-n} A ${s} ${n} 0 0 1 ${-s} ${c-n} Z`),r.removeAttribute("transform"),r.dataset.diagramCylinder="true",r.dataset.cylinderRimRatio=String(n/a);const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} A ${s} ${n} 0 0 1 ${-s} ${l+n} Z`),h.setAttribute("class","diagram-cylinder-rim"),h.setAttribute("aria-hidden","true"),h.setAttribute("focusable","false"),r.after(h)}}function w3(e){if(e.getAttribute("aria-roledescription")==="flowchart-v2")for(const t of e.querySelectorAll("g.node")){t.querySelector(":scope > .flowchart-node-outline")?.remove();const r=Ke(t);if(!r)continue;const i=r.cloneNode(!1);i.removeAttribute("id"),i.classList.add("flowchart-node-outline"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false"),i.style.setProperty("fill","none","important"),t.append(i)}}function k3(e){if(e.getAttribute("aria-roledescription")==="er")for(const t of e.querySelectorAll("g.node")){t.querySelectorAll(":scope > .er-negative-space-divider").forEach(d=>d.remove());const r=[...t.querySelectorAll(":scope > .row-rect-odd, :scope > .row-rect-even")].map(d=>d.getBBox());if(!r.length)continue;const i=[...t.querySelectorAll(":scope > .divider")],a=i.map(d=>d.getBBox()).filter(d=>d.height>d.width).toSorted((d,u)=>u.x-d.x);i.forEach(d=>d.remove());const o=Math.min(...r.map(d=>d.x)),s=Math.max(...r.map(d=>d.x+d.width)),n=Math.max(...r.map(d=>d.y+d.height)),l=(d,u,f)=>{const p=document.createElementNS("http://www.w3.org/2000/svg","line");p.classList.add("er-negative-space-divider"),p.dataset.dividerKind=d,p.setAttribute("x1",String(u.x)),p.setAttribute("y1",String(u.y)),p.setAttribute("x2",String(f.x)),p.setAttribute("y2",String(f.y)),p.setAttribute("aria-hidden","true"),t.insertBefore(p,t.querySelector(":scope > .label"))};for(const d of r.map(u=>u.y))l("row",{x:o,y:d},{x:s,y:d});const c=[...t.querySelectorAll(":scope > .label.attribute-keys")].some(d=>!!d.textContent?.trim()),h=a[0];if(c&&h){const d=h.x+h.width/2;l("key",{x:d,y:r[0].y},{x:d,y:n})}}}function Po(e){for(const t of e.querySelectorAll("marker")){const r=t.querySelector("path"),i=t.id.endsWith("-arrowhead"),a=t.id.includes("pointEnd")||t.id.includes("barbEnd")||i,o=t.id.includes("pointStart");!r||!a&&!o||(t.setAttribute("viewBox",`0 0 ${Dn} ${Dn}`),t.setAttribute("markerWidth",String(Dn)),t.setAttribute("markerHeight",String(Dn)),t.setAttribute("refX",a?"6.5":"0.5"),t.setAttribute("refY","3.5"),t.setAttribute("orient",i?"auto-start-reverse":"auto"),t.setAttribute("markerUnits","userSpaceOnUse"),t.dataset.diagramChevron="true",r.setAttribute("d",a?"M 3.5 0.5 L 6.5 3.5 L 3.5 6.5":"M 3.5 0.5 L 0.5 3.5 L 3.5 6.5"),r.setAttribute("fill","none"),r.setAttribute("stroke","context-stroke"),r.setAttribute("stroke-width","1"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("vector-effect","non-scaling-stroke"))}}function Cr(e){const t=e.id.match(/-L_([^_]+)_([^_]+)_\d+$/);return t?{source:t[1],target:t[2]}:null}function Mi(e,t){const r=t.id.match(/-(L_.+)$/)?.[1];if(r)return[...e.querySelectorAll(".edgeLabels > .edgeLabel")].find(i=>i.querySelector(":scope > .label")?.getAttribute("data-id")===r)}function Je(e,t){return[...e.querySelectorAll("g.node")].find(r=>Or(r)===t)}function S3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return!1;const t=[...e.querySelectorAll(".edgePaths path")].find(F=>{const A=Cr(F);return A?.source==="Client"&&A.target==="Gateway"}),r=Je(e,"Client"),i=Je(e,"Gateway"),a=Je(e,"Queue"),o=[...e.querySelectorAll(".edgePaths path")].find(F=>{const A=Cr(F);return A?.source==="Gateway"&&A.target==="Queue"}),s=t&&Mi(e,t);let n=r&&br(r);const l=i&&br(i),c=a&&br(a),h=t&&s&&xr(s,t);if(!t||!r||!n||!l||!s||!h)return!1;const d=Lt(l,.5,.5),u=[...e.querySelectorAll("g.cluster > rect")].flatMap(F=>{const A=xr(F,t);return A?[A]:[]}).filter(F=>d.x>F.x&&d.x<F.x+F.width&&d.y>F.y&&d.y<F.y+F.height).toSorted((F,A)=>A.width*A.height-F.width*F.height)[0];if(!u)return!1;const f=Math.max(52,h.height+24),p=u.y-(n.y+n.height),g=Math.max(0,f-p),m=r.transform.baseVal.consolidate()?.matrix;m&&g>0&&(r.setAttribute("transform",`translate(${m.e}, ${m.f-g})`),r.dataset.requestLaneRaised="true",r.dataset.requestLaneShift=String(Number(r.dataset.requestLaneShift??0)+g),n={...n,y:n.y-g});const y=Lt(n,.5,1),x=Lt(l,0,.35),C=(y.y+u.y)/2,k=u.x-Math.max(20,h.height/2+4),v=[y,{x:y.x,y:C},{x:k,y:C},{x:k,y:x.y},x];t.setAttribute("d",v.map((F,A)=>`${A?"L":"M"}${F.x},${F.y}`).join("")),t.dataset.clientRequestLane="downward",t.dataset.manhattanPoints=v.map(F=>`${F.x},${F.y}`).join(" "),sa(s,t,v,1);const T=o&&Mi(e,o);if(o&&T&&c){const F=Lt(l,0,.65),A=Lt(c,0,.5),M=u.x+12,B=[F,{x:M,y:F.y},{x:M,y:A.y},A];o.setAttribute("d",B.map(($,P)=>`${P?"L":"M"}${$.x},${$.y}`).join("")),o.dataset.clientRequestLane="enqueue",o.dataset.manhattanPoints=B.map($=>`${$.x},${$.y}`).join(" "),sa(T,o,B,1)}return f1(e,"Client",n),!0}function v3(e,t,r){if(!Si(e,r,12))return{x:0,y:0};const i=[{x:e.x-r.x-r.width-12,y:0,clear:r.x+r.width<=t.x},{x:e.x+e.width-r.x+12,y:0,clear:r.x>=t.x+t.width},{x:0,y:e.y-r.y-r.height-12,clear:r.y+r.height<=t.y},{x:0,y:e.y+e.height-r.y+12,clear:r.y>=t.y+t.height}],{x:a,y:o}=i.toSorted((s,n)=>Number(n.clear)-Number(s.clear)||Math.hypot(s.x,s.y)-Math.hypot(n.x,n.y))[0];return{x:a,y:o}}function ap(e){const t=Math.min(...e.map(i=>i.x)),r=Math.min(...e.map(i=>i.y));return{x:t,y:r,width:Math.max(...e.map(i=>i.x+i.width))-t,height:Math.max(...e.map(i=>i.y+i.height))-r}}function M3(e,t,r){const i=e.parentElement?.getScreenCTM(),a=t.getScreenCTM();if(!i||!a)return;const o=new DOMPoint(0,0).matrixTransform(a).matrixTransform(i.inverse()),s=new DOMPoint(r.x,r.y).matrixTransform(a).matrixTransform(i.inverse()),n=e.getAttribute("transform")??"";e.setAttribute("transform",`translate(${s.x-o.x}, ${s.y-o.y}) ${n}`)}function T3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=[...e.querySelectorAll("g.node")],i=[...e.querySelectorAll("g.cluster")].flatMap(s=>{const n=s.querySelector(":scope > rect"),l=s.querySelector(":scope > g.cluster-label");if(!n||!l)return[];const c=t&&uu(s,t),h=c?t?.get(c):void 0;if(t&&!h)return[];const d=n.getBBox(),u=r.filter(f=>{if(h)return h.has(Or(f));const p=br(f);if(!p)return!1;const g=Lt(p,.5,.5);return g.x>=d.x&&g.x<=d.x+d.width&&g.y>=d.y&&g.y<=d.y+d.height});return[{cluster:s,rect:n,label:l,frame:d,members:u,id:c,memberIds:h}]}),a=t?[...e.querySelectorAll(".edgePaths path")].flatMap(s=>{const n=Cr(s),l=pu(s.getAttribute("d")??"",2);if(!n||!l)return[];const c=h=>{const d=Je(e,h),u=(d&&Ke(d))??i.find(p=>p.id===h)?.rect,f=u&&Qe(u,s);return u&&f?{shape:u,bounds:f}:null};return[{path:s,points:l,source:c(n.source),target:c(n.target)}]}):[],o=new Map;for(const s of i.toSorted((n,l)=>(n.memberIds?.size??0)-(l.memberIds?.size??0)||n.frame.width*n.frame.height-l.frame.width*l.frame.height)){const n=i.filter(P=>P!==s&&(s.memberIds?!!(P.id&&s.memberIds.has(P.id)):P.frame.x>=s.frame.x&&P.frame.y>=s.frame.y&&P.frame.x+P.frame.width<=s.frame.x+s.frame.width&&P.frame.y+P.frame.height<=s.frame.y+s.frame.height)).flatMap(({cluster:P,rect:I})=>{const _=t?Qe(I,s.cluster):o.get(P);return _?[_]:[]}),c=[...s.members.flatMap(P=>{const I=Ke(P),_=t&&I?Qe(I,s.cluster):br(P);return _?[_]:[]}),...n];if(!c.length)continue;const h=s.label.querySelector("foreignObject"),d=h?.querySelector("div"),u=ap(c),f=t?r.filter(P=>!s.members.includes(P)).flatMap(P=>{const I=Ke(P),_=I&&Qe(I,s.cluster);return _?[_]:[]}):[];let p=Math.ceil(Math.max(d?.getBoundingClientRect().height??0,d?.scrollHeight??0,s.label.getBBox().height,18)),g=sn(p);const m=Math.min(...c.map(({x:P})=>P)),y=Math.max(...c.map(({x:P,width:I})=>P+I)),x=Math.min(...c.map(({y:P})=>P)),C=Math.max(...c.map(({y:P,height:I})=>P+I));let k=Math.min(s.frame.x,m-Zr),v=Math.min(s.frame.y,x-g),T=Math.max(s.frame.x+s.frame.width,y+Zr),F=Math.max(s.frame.y+s.frame.height,C+20);if(t&&f.some(P=>Si({x:k,y:v,width:T-k,height:F-v},P,12))){if(k=m-Zr,T=y+Zr,F=C+20,h&&d){const P=h.cloneNode(!0),I=P.querySelector("div");P.style.visibility="hidden",P.setAttribute("height","1"),P.setAttribute("width",String(T-k-Zr*2)),I.style.setProperty("height","auto","important"),I.style.setProperty("width","100%","important"),s.label.append(P);try{const _=Math.max(u.width,I.scrollWidth);T=k+_+Zr*2,P.setAttribute("width",String(_)),p=Math.ceil(Math.max(18,I.scrollHeight))}finally{P.remove()}}else T=Math.max(T,k+s.label.getBBox().width+Zr*2);g=sn(p),v=x-g}const A={x:k,y:v,width:T-k,height:F-v};if(s.rect.setAttribute("x",String(A.x)),s.rect.setAttribute("y",String(A.y)),s.rect.setAttribute("width",String(A.width)),s.rect.setAttribute("height",String(A.height)),s.cluster.dataset.headerHeight=String(g),h)h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width",String(Math.max(24,A.width-Zr*2))),h.setAttribute("height",String(p)),s.label.setAttribute("transform",`translate(${A.x+Zr}, ${A.y+Zr})`);else{const P=s.label.getBBox();s.label.setAttribute("transform",`translate(${A.x+A.width/2-P.x-P.width/2}, ${A.y+Zr-P.y})`)}if(o.set(s.cluster,A),!t)continue;const M=i.filter(P=>P!==s&&P.id&&s.id&&!s.memberIds?.has(P.id)&&!P.memberIds?.has(s.id)),B=M.filter(P=>!M.some(I=>I!==P&&P.id&&I.memberIds?.has(P.id))),$=B.map(P=>[P.cluster,...P.members,...i.filter(I=>I.id&&P.memberIds?.has(I.id)).map(I=>I.cluster)]);$.push(...r.filter(P=>!s.members.includes(P)&&!B.some(I=>I.members.includes(P))).map(P=>[P]));for(const P of $){const I=R=>{const D=R.flatMap(G=>{const j=G.matches("g.node")?Ke(G):G.querySelector(":scope > rect"),z=j&&Qe(j,s.cluster);return z?[z]:[]});return D.length?ap(D):null},_=I(P);if(!_)continue;const E=v3(A,u,_);if(!E.x&&!E.y)continue;const L=E.x?"x":"y",q=E.x?"width":"height",W=$.filter(R=>{const D=I(R);return D&&(E[L]>0?D[L]+D[q]>_[L]:D[L]<_[L]+_[q])}).flat();for(const R of new Set(W))W.some(D=>D!==R&&D.contains(R))||M3(R,s.cluster,E)}}for(const{path:s,points:n,source:l,target:c}of a){let h=!1;const d=(g,m)=>{const y=g&&Qe(g.shape,s);if(!g||!y)return m;const x=g.bounds;return["x","y","width","height"].every(C=>Math.abs(y[C]-x[C])<.001)?m:(h=!0,{x:y.x+(m.x-x.x)*y.width/(x.width||1),y:y.y+(m.y-x.y)*y.height/(x.height||1)})},u=d(l,n[0]),f=d(c,n[n.length-1]);if(!h)continue;const p=rc(n,u,f,Math.abs(n[1].x-n[0].x)<.001);s.setAttribute("d",p.map((g,m)=>`${m?"L":"M"}${g.x},${g.y}`).join("")),s.dataset.manhattanPoints=p.map(g=>`${g.x},${g.y}`).join(" ")}}function eh(e,t=!1){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const i=[...e.querySelectorAll(".edgePaths path")].flatMap(y=>{const x=Cr(y);return x?[{path:y,...x}]:[]}),a=new Map,o=new Map;for(const y of i.filter(({source:x,target:C})=>x!==C))a.set(y.target,(a.get(y.target)??0)+1),o.set(y.source,(o.get(y.source)??0)+1);const s=i.find(y=>y.source!==y.target&&(a.get(y.source)??0)>=2&&(o.get(y.source)??0)===1&&(o.get(y.target)??0)>=2);if(!s)return;if(!t&&s.path.dataset.feedbackLane==="outer")return s.path.getBBox();const n=Je(e,s.source),l=Je(e,s.target),c=n&&Ke(n),h=l&&Ke(l);if(!c||!h)return;const d=n&&br(n),u=l&&br(l),f=[...e.querySelectorAll("g.node")].flatMap(y=>{const x=br(y);return x?[x]:[]});if(!d||!u||!f.length)return;const p=[...e.querySelectorAll(".edgePaths path")].filter(y=>y!==s.path).map(y=>y.getBBox()),g=s.path.dataset.compactFlowchart==="true",m=h3(d,u,g?f:[...f,...p],g);s.path.setAttribute("d",m.map((y,x)=>`${x?"L":"M"}${y.x},${y.y}`).join("")),s.path.dataset.feedbackLane="outer",s.path.dataset.feedbackSource=s.source,s.path.dataset.feedbackTarget=s.target,s.path.dataset.manhattanSegments="4",s.path.dataset.manhattanPoints=m.map(y=>`${y.x},${y.y}`).join(" ")}function f1(e,t,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return;const i=[...e.querySelectorAll(".edgePaths path")],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")];i.forEach((o,s)=>{if(o.dataset.nestedDecisionRoute)return;const n=Cr(o),l=n?i.filter(v=>Cr(v)?.source===n.source).length:0,c=n&&Je(e,n.source),h=n&&Je(e,n.target),d=c&&Qe(c,o),u=n?.target===t?r:h&&xr(h,o);if(!n||!d||!u||l>1||u.y>=d.y)return;const f=[...[...e.querySelectorAll("g.node")].flatMap(v=>{const T=Qe(v,o);return T?[T]:[]}),...[...e.querySelectorAll("g.cluster > rect")].flatMap(v=>{const T=Qe(v,o);return T?[T]:[]})],p=d3(d,u,f,o.dataset.compactFlowchart==="true");o.setAttribute("d",p.map((v,T)=>`${T?"L":"M"}${v.x},${v.y}`).join("")),o.dataset.groupedReturnLane="right",o.dataset.manhattanPoints=p.map(v=>`${v.x},${v.y}`).join(" ");const g=a[s];if(!g)return;const m={x:p[1].x,y:(p[1].y+p[2].y)/2},y=g.getBBox(),x=o.getCTM(),C=g.parentElement?.getCTM(),k=x&&C?new DOMPoint(m.x,m.y).matrixTransform(x).matrixTransform(C.inverse()):m;g.setAttribute("transform",`translate(${k.x-y.x-y.width/2}, ${k.y-y.y-y.height/2})`),g.dataset.finalPathCenter=`${m.x},${m.y}`})}function B3(e){f1(e)}function op(e){const t=e.querySelector('path[data-feedback-lane="outer"]'),r=t?.dataset.feedbackSource&&Je(e,t.dataset.feedbackSource),i=t?.dataset.feedbackTarget&&Je(e,t.dataset.feedbackTarget),a=t?.getScreenCTM(),o=(t?.dataset.manhattanPoints??"").split(" ").map(P=>P.split(",").map(Number)).filter(P=>P.length===2&&P.every(Number.isFinite)).map(([P,I])=>({x:P,y:I}));if(!t||!r||!i||!a||o.length<4)return;const s=a.inverse(),n=r.getBoundingClientRect(),l=i.getBoundingClientRect(),c=t.dataset.feedbackTarget,h=[...e.querySelectorAll(".edgePaths path")].flatMap(P=>{if(P===t)return[];const I=Cr(P),_=(P.dataset.manhattanPoints??"").trim().split(/\s+/).map(G=>G.split(",").map(Number)).filter(G=>G.length===2&&G.every(Number.isFinite)).map(([G,j])=>({x:G,y:j})),E=P.getScreenCTM();if(!I||!E||_.length<2)return[];const L=I.source===c?0:I.target===c?-1:null;if(L===null)return[];const q=_[L===0?0:_.length-1],W=_[L===0?1:_.length-2],R=new DOMPoint(q.x,q.y).matrixTransform(E),D=new DOMPoint(W.x,W.y).matrixTransform(E);return Math.abs(R.y-l.bottom)>1||Math.abs(R.x-D.x)>1?[]:[R.matrixTransform(s).x]}),d=new DOMPoint(l.left,l.bottom).matrixTransform(s).x,u=new DOMPoint(l.right,l.bottom).matrixTransform(s).x;let f=o3({x:Math.min(d,u),width:Math.abs(u-d)},h);const p=(d+u)/2,g=new DOMPoint(n.right,n.top+n.height/2).matrixTransform(s),m=Ke(i),y=m&&Qe(m,t),x=m?getComputedStyle(m).rx:"0",C=m?.getBBox().width??0,k=y&&C&&o.at(-2).y>y.y+y.height?s3({...y,corner:{x:(Number.parseFloat(x)||0)*(x.endsWith("%")?y.width/100:y.width/C),y:0}},h):void 0,v=k===void 0?[]:[{...o[o.length-3]},{x:k,y:o[o.length-2].y},{x:k,y:new DOMPoint(l.left,l.bottom).matrixTransform(s).y}],T=[...e.querySelectorAll("g.node")].filter(P=>P!==i).flatMap(P=>{const I=Qe(P,t);return I?[I]:[]}),F=Mi(e,t),A=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(P=>P!==F&&P.textContent?.trim()).flatMap(P=>{const I=xr(P,t);return I?[I]:[]}),M=yu(e).filter(P=>P.path!==t).flatMap(P=>{const I=P.path.getScreenCTM();return I?ar(P.points.map(({x:_,y:E})=>new DOMPoint(_,E).matrixTransform(I).matrixTransform(s))):[]}),B=v.length>0&&ar(v).every(P=>!T.some(I=>Sr(P,I,8))&&!A.some(I=>Sr(P,I,4))&&!M.some(({start:I,end:_})=>Sr(P,{x:Math.min(I.x,_.x),y:Math.min(I.y,_.y),width:Math.abs(_.x-I.x),height:Math.abs(_.y-I.y)},6)));if(B&&(f=k),!B&&Math.abs(f-p)>1&&o.length>=7){const P=new DOMPoint(l.left+l.width/2,l.top-.25).matrixTransform(s),I=new DOMPoint(l.left+l.width/2,l.top-12).matrixTransform(s);o[0]={x:g.x,y:g.y},o[1].y=g.y,o[4]={x:o[3].x,y:I.y},o[5]={x:I.x,y:I.y},o[6]={x:P.x,y:P.y},t.dataset.feedbackTargetSide="top",t.dataset.manhattanPoints=o.map(({x:_,y:E})=>`${_},${E}`).join(" "),t.setAttribute("d",o.map(({x:_,y:E},L)=>`${L===0?"M":"L"}${_},${E}`).join("")),sa(Mi(e,t),t,o);return}const $=new DOMPoint(l.left+l.width/2,l.bottom+.25).matrixTransform(s);$.x=f,o[0]={x:g.x,y:g.y},o[1].y=g.y,o[o.length-2].x=$.x,o[o.length-1]={x:$.x,y:$.y},t.dataset.feedbackTargetSide="bottom",t.dataset.manhattanPoints=o.map(({x:P,y:I})=>`${P},${I}`).join(" "),t.setAttribute("d",o.map(({x:P,y:I},_)=>`${_===0?"M":"L"}${P},${I}`).join("")),sa(Mi(e,t),t,o)}function sp(e){const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{if(i.dataset.clusterHeaderClearance||i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)return[];const a=Cr(i),o=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));return a&&o.length>=2?[{path:i,points:o,...a}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,a]of r){const o=a.length>=2&&Je(e,i),s=o&&br(o);if(!s)continue;const n=a.filter(({points:u})=>Math.abs(u[0].x-u[1].x)<.001);if(n.length<2)continue;const l=n.toSorted((u,f)=>{const p=Je(e,u.target),g=Je(e,f.target),m=p&&br(p),y=g&&br(g);return(m?.x??0)+(m?.width??0)/2-((y?.x??0)+(y?.width??0)/2)||(m?.y??0)+(m?.height??0)/2-((y?.y??0)+(y?.height??0)/2)||u.path.id.localeCompare(f.path.id)}),c=Math.min(i3,s.width*.4/(l.length-1)),d=s.x+s.width/2-c*(l.length-1)/2;l.forEach(({path:u,points:f},p)=>{const g={x:d+c*p,y:f[0].y},m=f.at(-1),y=rc(f,g,m,!0);u.dataset.fanoutPort=`${g.x},${g.y}`,u.dataset.manhattanPoints=y.map(({x,y:C})=>`${x},${C}`).join(" "),u.setAttribute("d",y.map(({x,y:C},k)=>`${k===0?"M":"L"}${x},${C}`).join(""))})}}function rc(e,t,r,i){if(e.length<2)return e;if(e.length===2){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}if(e.length===3){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}const a=e.map(s=>({...s}));return a[0]=t,a[a.length-1]=r,i?(a[1].x=t.x,a[a.length-2].x=r.x):(a[1].y=t.y,a[a.length-2].y=r.y),a.slice(1).some((s,n)=>{const l=a[n];return Math.abs(s.x-l.x)>=.001&&Math.abs(s.y-l.y)>=.001})?rc([t,r],t,r,i):a}function sa(e,t,r,i,a){if(!e?.textContent?.trim())return!0;if(r.length<2)return!1;const o=t.getScreenCTM(),s=e.parentElement?.getScreenCTM();if(!o||!s)return!1;const n=e.getBoundingClientRect(),l=xr(e,t);if(a&&!l)return!1;const c=new DOMPoint(n.left+n.width/2,n.top+n.height/2).matrixTransform(o.inverse()),h=e.getAttribute("transform");e.removeAttribute("transform");const d=e.getBBox();h&&e.setAttribute("transform",h);const u=[...t.ownerSVGElement?.querySelectorAll("g.edgeLabel")??[]].filter(x=>x!==e&&x.textContent?.trim()).map(x=>x.getBoundingClientRect()),f=[...t.ownerSVGElement?.querySelectorAll("g.node")??[]].map(x=>x.getBoundingClientRect()),p=(x,C)=>x.left<C.right+4&&x.right+4>C.left&&x.top<C.bottom+4&&x.bottom+4>C.top,m=r.slice(1).flatMap((x,C)=>{const k=r[C],v=Math.abs(k.y-x.y)<.001,T=Math.hypot(x.x-k.x,x.y-k.y),F=(v?d.width:d.height)+12;return T<F?[]:[.5,.35,.65,.2,.8].flatMap(A=>{if(T*Math.min(A,1-A)<F/2)return[];const M={x:k.x+(x.x-k.x)*A,y:k.y+(x.y-k.y)*A};if(a&&l){const I={x:M.x-l.width/2,y:M.y-l.height/2,width:l.width,height:l.height};if(a.obstacles.some(_=>Si(I,_,4))||a.occupied.some(_=>Sr(_,I,4)))return[]}const B=new DOMPoint(M.x,M.y).matrixTransform(o),$=DOMRect.fromRect({x:B.x-n.width/2,y:B.y-n.height/2,width:n.width,height:n.height}),P=u.filter(I=>p($,I)).length+f.filter(I=>p($,I)).length;return[{start:k,end:x,center:M,preferred:C===i,collisions:P,distance:Math.hypot(M.x-c.x,M.y-c.y)}]})}).toSorted((x,C)=>Number(C.preferred)-Number(x.preferred)||x.collisions-C.collisions||x.distance-C.distance)[0];if(!m)return!1;const y=new DOMPoint(m.center.x,m.center.y).matrixTransform(o).matrixTransform(s.inverse());return e.setAttribute("transform",`translate(${y.x-d.x-d.width/2}, ${y.y-d.y-d.height/2})`),e.dataset.routePathId=t.id,e.dataset.finalPathCenter=`${m.center.x},${m.center.y}`,t.dataset.labelSegment=`${m.start.x},${m.start.y} ${m.end.x},${m.end.y}`,!0}function np(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")].flatMap(a=>{const o=Ke(a);return o?[{node:a,bounds:o.getBoundingClientRect()}]:[]}),i=new Map;for(const a of t){const o=Cr(a);if(!o||o.source===o.target)continue;const s=[o.source,o.target].toSorted().join("\0");i.set(s,[...i.get(s)??[],a])}for(const a of t){if(a.dataset.feedbackLane||a.dataset.fanoutSource||a.dataset.groupedReturnLane||a.dataset.decisionBranch||a.dataset.decisionReturn||a.dataset.clientRequestLane||a.dataset.clusterHeaderClearance||a.dataset.compactGroupedRoute||a.dataset.decisionCycleRoute||a.dataset.nestedDecisionRoute)continue;const o=Cr(a),s=o&&Je(e,o.source),n=o&&Je(e,o.target),l=s&&Ke(s),c=n&&Ke(n),h=a.getScreenCTM(),d=(a.dataset.manhattanPoints??"").trim().split(/\s+/).map(Q=>Q.split(",").map(Number)).filter(Q=>Q.length===2&&Q.every(Number.isFinite)).map(([Q,et])=>({x:Q,y:et}));if(!l||!c||!h)continue;const u=l.getBoundingClientRect(),f=c.getBoundingClientRect(),p={x:u.x+u.width/2,y:u.y+u.height/2},g={x:f.x+f.width/2,y:f.y+f.height/2},m=f.top>=u.bottom||u.top>=f.bottom,y=f.left>=u.right||u.left>=f.right,x=m||!y&&Math.abs(g.y-p.y)>=Math.abs(g.x-p.x),C=g.y>=p.y,k=g.x>=p.x,v=Math.max(u.left,f.left),T=Math.min(u.right,f.right),F=Math.max(u.top,f.top),A=Math.min(u.bottom,f.bottom),M=v<=T?(v+T)/2:p.x,B=v<=T?M:g.x,$=F<=A?(F+A)/2:p.y,P=F<=A?$:g.y,I=x?{x:M,y:C?u.bottom:u.top}:{x:k?u.right:u.left,y:$},_=x?{x:B,y:C?f.top:f.bottom}:{x:k?f.left:f.right,y:P},E=h.inverse(),L=(Q,et)=>{const rt=new DOMPoint(Q,et).matrixTransform(E);return{x:rt.x,y:rt.y}};let q=L(I.x,I.y),W=L(_.x,_.y),R=null;if(o?.source===o?.target){const Q=u.right+48;R=[L(u.right,u.top+u.height*.2),L(Q,u.top+u.height*.2),L(Q,u.top+u.height*.8),L(u.right,u.top+u.height*.8)],a.dataset.selfLoop="right"}else if(!a.dataset.compactFlowchart&&o){const Q=[o.source,o.target].toSorted().join("\0"),et=i.get(Q)??[],rt=et.indexOf(a)-(et.length-1)/2;if(et.length>1){if(rt===0&&x){const J=(p.x+g.x)/2;R=[L(J,C?u.bottom:u.top),L(J,C?f.top:f.bottom)]}else if(rt===0){const J=(p.y+g.y)/2;R=[L(k?u.right:u.left,J),L(k?f.left:f.right,J)]}else if(x){const J=24+(Math.ceil(Math.abs(rt))-1)*16,at=rt<0,xt=Math.min(p.y,g.y),H=Math.max(p.y,g.y),Y=r.filter(({node:It,bounds:zt})=>It!==s&&It!==n&&zt.bottom>xt&&zt.top<H),Z=at?Math.min(u.left,f.left,...Y.map(({bounds:It})=>It.left))-J:Math.max(u.right,f.right,...Y.map(({bounds:It})=>It.right))+J,tt=at?u.left:u.right,st=at?f.left:f.right;R=[L(tt,p.y),L(Z,p.y),L(Z,g.y),L(st,g.y)]}else{const J=24+(Math.ceil(Math.abs(rt))-1)*16,at=rt<0,xt=Math.min(p.x,g.x),H=Math.max(p.x,g.x),Y=r.filter(({node:It,bounds:zt})=>It!==s&&It!==n&&zt.right>xt&&zt.left<H),Z=at?Math.min(u.top,f.top,...Y.map(({bounds:It})=>It.top))-J:Math.max(u.bottom,f.bottom,...Y.map(({bounds:It})=>It.bottom))+J,tt=at?u.top:u.bottom,st=at?f.top:f.bottom;R=[L(p.x,tt),L(p.x,Z),L(g.x,Z),L(g.x,st)]}a.dataset.parallelLane=rt<0?"before":rt>0?"after":"center"}}R&&(q=R[0],W=R[R.length-1]);const D=R??(d.length>=2?d:[q,W]),G=D.slice(1).some((Q,et)=>{const rt=D[et];return Math.abs(Q.x-rt.x)>=.001&&Math.abs(Q.y-rt.y)>=.001}),j=R??rc(D,q,W,x),z=vr(j);G&&(a.dataset.cardinalRepaired="true"),a.dataset.manhattanPoints=z.map(({x:Q,y:et})=>`${Q},${et}`).join(" "),a.setAttribute("d",z.map(({x:Q,y:et},rt)=>`${rt===0?"M":"L"}${Q},${et}`).join("")),a.dataset.compactFlowchart||sa(Mi(e,a),a,z)}}function Cn(e,t,r,i){const a=Lt(t,.5,.5),o=n=>!r.some(l=>Si(n,l,4))&&!i.some(l=>Sr(l,n,4));return ar(e).flatMap(({start:n,end:l})=>{const c=Math.abs(n.y-l.y)<.001,h=c?"x":"y",d=c?"y":"x",u=(c?t.width:t.height)/2,f=Math.min(n[h],l[h])+u+6,p=Math.max(n[h],l[h])-u-6;return f>p?[]:[a[h],(f+p)/2,f,p,f*.75+p*.25,f*.25+p*.75].flatMap(g=>{const m={[h]:Math.max(f,Math.min(p,g)),[d]:n[d]},y={...t,x:m.x-t.width/2,y:m.y-t.height/2};return o(y)?[{center:m,bounds:y,start:n,end:l,distance:Math.hypot(m.x-a.x,m.y-a.y)}]:[]})}).toSorted((n,l)=>n.distance-l.distance)[0]}function g1(e,t,r,i,a,o=[],s=[],n,l=!1,c=!1){if(e.length<2)return e;const h=M=>ar(M).some(B=>i.some($=>Sr(B,$,8))),d=M=>ar(M).some(B=>a.some($=>gs(B,$))),u=M=>!n||Cn(M,n.bounds,[t,r,...i,...n.obstacles],n.occupied);if(!c&&!h(e)&&!d(e)&&u(e))return e;const f=(M,B,$,P,I=!1)=>{const _=ko(B,$),E=[{point:B,side:_}];for(const L of I?[]:["top","right","bottom","left"])for(const q of c?[.5,.25,.75,0,1]:[.5,.25,.75]){const W=L==="top"||L==="bottom"?Lt(M,q,L==="top"?0:1):Lt(M,L==="left"?0:1,q);if(L==="top"||L==="bottom"){const R=Math.min(M.width/2,M.corner?.x??0);W.x=Math.max(M.x+R,Math.min(M.x+M.width-R,W.x))}else{const R=Math.min(M.height/2,M.corner?.y??0);W.y=Math.max(M.y+R,Math.min(M.y+M.height-R,W.y))}P.every(R=>Math.hypot(R.x-W.x,R.y-W.y)>=(c?8:ai))&&E.push({point:W,side:L})}return E.map(L=>{const q={...L.point},W=Math.max(16,(n?.bounds.height??0)/2+(c?4:8)),R=Math.max(16,(n?.bounds.width??0)/2+(c?4:8));return L.side==="top"&&(q.y-=W),L.side==="bottom"&&(q.y+=W),L.side==="left"&&(q.x-=R),L.side==="right"&&(q.x+=R),{...L,lead:q}})},p=f(t,e[0],e[1],o,l),g=f(r,e.at(-1),e.at(-2),s),m=[t,r,...i,...a.map(({start:M,end:B})=>({x:Math.min(M.x,B.x),y:Math.min(M.y,B.y),width:Math.abs(M.x-B.x),height:Math.abs(M.y-B.y)}))],y=Math.max(16,(n?.bounds.width??0)/2+8),x=Math.max(16,(n?.bounds.height??0)/2+8),C=[Math.min(...m.map(M=>M.x))-y,Math.max(...m.map(M=>M.x+M.width))+y],k=[Math.min(...m.map(M=>M.y))-x,Math.max(...m.map(M=>M.y+M.height))+x];if(c){const M=(B,$)=>[...new Set(i.flatMap(P=>[P[B]-16,P[B]+P[$]+16]))].toSorted((P,I)=>Math.abs(P-t[B])-Math.abs(I-t[B])).slice(0,12);C.push(...M("x","width")),k.push(...M("y","height"))}const v=p.flatMap(M=>g.flatMap(B=>[[M.point,M.lead,{x:M.lead.x,y:B.lead.y},B.lead,B.point],[M.point,M.lead,{x:B.lead.x,y:M.lead.y},B.lead,B.point],...C.map($=>[M.point,M.lead,{x:$,y:M.lead.y},{x:$,y:B.lead.y},B.lead,B.point]),...k.map($=>[M.point,M.lead,{x:M.lead.x,y:$},{x:B.lead.x,y:$},B.lead,B.point])].map(vr))),T=M=>ar(M).reduce((B,$)=>B+Math.hypot($.end.x-$.start.x,$.end.y-$.start.y),0);let F,A=1/0;for(const{candidate:M,length:B}of v.map($=>({candidate:$,length:T($)})).toSorted(($,P)=>$.length-P.length)){if(c&&(B>=T(e)-1||M.some(P=>P.y<Math.min(t.y,r.y)-x))||h(M)||!u(M)||ar(M).some(P=>Sr(P,t)||Sr(P,r)))continue;const $=ar(M).reduce((P,I)=>P+a.reduce((_,E)=>{const L={x:Math.min(E.start.x,E.end.x),y:Math.min(E.start.y,E.end.y),width:Math.abs(E.end.x-E.start.x),height:Math.abs(E.end.y-E.start.y)};return _+(gs(I,E)?100:Sr(I,L,6)?1:0)},0),0);if($<A&&(!c||$===0)&&(F=M,A=$),A===0)break}return F??e}function yu(e){return[...e.querySelectorAll(".edgePaths path")].flatMap(t=>{const r=Cr(t),i=(t.dataset.manhattanPoints??"").trim().split(/\s+/).map(a=>{const[o,s]=a.split(",").map(Number);return{x:o,y:s}});return r&&i.length>=2&&i.every(a=>Number.isFinite(a.x)&&Number.isFinite(a.y))?[{path:t,...r,points:i,label:Mi(e,t)}]:[]})}function _3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=yu(e),r=t[0]?.path;if(!r)return;const i=new Map([...e.querySelectorAll("g.node")].flatMap(l=>{const c=Ke(l),h=c&&Qe(c,r);if(!c||!h)return[];const d=getComputedStyle(c),u=c.getBBox(),f=(g,m)=>(Number.parseFloat(g)||0)*(g.endsWith("%")?m/100:1),p={x:f(d.rx,u.width)*h.width/u.width,y:f(d.ry,u.height)*h.height/u.height};return[[Or(l),{bounds:{...h,corner:p},shape:c}]]})),a=new Map(t.flatMap(l=>{const c=l.label?.textContent?.trim()&&xr(l.label,r);return c?[[l,c]]:[]})),o=[...e.querySelectorAll("g.cluster > .cluster-label")].flatMap(l=>{const c=xr(l,r);return c?[c]:[]}),s=new Map,n=t.map(l=>{const c=i.get(l.source),h=i.get(l.target),d=!!(l.source===l.target||l.path.dataset.fanoutSource||l.path.dataset.feedbackLane||l.path.dataset.groupedReturnLane||l.path.dataset.decisionCycleRoute||l.path.dataset.nestedDecisionRoute||c?.shape.tagName.toLowerCase()!=="rect"||h?.shape.tagName.toLowerCase()!=="rect");return{route:l,source:c,target:h,fixed:d}}).sort((l,c)=>Number(c.fixed)-Number(l.fixed));for(const{route:l,source:c,target:h,fixed:d}of n){const u=t.filter(v=>v!==l),f=v=>u.flatMap(T=>[...T.source===v?[T.points[0]]:[],...T.target===v?[T.points.at(-1)]:[]]),p=u.filter(v=>v.source!==l.source||v.target===l.target).flatMap(v=>ar(v.points)),g=[...i].filter(([v])=>v!==l.source&&v!==l.target).map(([,v])=>v.bounds).concat(o,[...a].filter(([v])=>v!==l).map(([,v])=>v)),m=a.get(l),y=(v,T=!1)=>!d&&c&&h?g1(v,c.bounds,h.bounds,g,p,f(l.source),f(l.target),m?{bounds:m,obstacles:[...a].filter(([F])=>F!==l).map(([,F])=>F),occupied:u.flatMap(F=>ar(F.points))}:void 0,!!l.path.dataset.fanoutPort&&u.some(F=>F.source===l.source&&F.target!==l.target),T):v,x=A3(e,l.path,c?.bounds,h?.bounds),C=x?[Lt(c.bounds,1,.5),{x:x.x,y:c.bounds.y+c.bounds.height/2},{x:x.x,y:h.bounds.y+h.bounds.height/2},Lt(h.bounds,1,.5)]:l.points;let k=y(C);if(!d&&!x&&k.length>4&&(k=y(k,!0)),!d&&!x&&!e.querySelector("g.cluster")&&(k=L3(k,u.filter(v=>v.path.dataset.feedbackLane).flatMap(v=>ar(v.points)),g)),!d&&c&&h&&h.bounds.y>c.bounds.y&&u.some(v=>v.path.dataset.feedbackLane&&v.target===l.source&&ar(k).some(T=>ar(v.points).some(({start:F,end:A})=>Sr(T,{x:Math.min(F.x,A.x),y:Math.min(F.y,A.y),width:Math.abs(A.x-F.x),height:Math.abs(A.y-F.y)}))))&&(k=y(k,!0)),m){const v=Cn(k,m,[...[c,h].flatMap(T=>T?[T.bounds]:[]),...g],u.flatMap(T=>ar(T.points)));v&&(a.set(l,v.bounds),s.set(l.path.id,v.center))}k!==l.points&&(l.points=k,l.path.dataset.manhattanPoints=k.map(({x:v,y:T})=>`${v},${T}`).join(" "),l.path.setAttribute("d",k.map(({x:v,y:T},F)=>`${F?"L":"M"}${v},${T}`).join("")))}for(const l of t.filter(c=>c.path.dataset.feedbackLane==="outer")){const h=t.filter(u=>u!==l).flatMap(u=>ar(u.points).map(({start:f,end:p})=>({x:Math.min(f.x,p.x),y:Math.min(f.y,p.y),width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)})));h.push(...[...a].filter(([u])=>u!==l).map(([,u])=>u));const d=u3(l.points,h);d!==l.points&&(l.path.dataset.manhattanPoints=d.map(({x:u,y:f})=>`${u},${f}`).join(" "),l.path.setAttribute("d",d.map(({x:u,y:f},p)=>`${p?"L":"M"}${u},${f}`).join("")),s.delete(l.path.id))}return s}function L3(e,t,r){for(let i=1;i<e.length-2;i++){const a=e[i],o=e[i+1];if(Math.abs(a.x-o.x)>.001||Math.abs(a.y-o.y)<32)continue;const s=t.filter(l=>Math.abs(l.start.x-l.end.x)<.001&&Math.abs(l.start.x-a.x)<20&&Math.abs(l.start.x-a.x)>.001&&Math.min(Math.max(a.y,o.y),Math.max(l.start.y,l.end.y))-Math.max(Math.min(a.y,o.y),Math.min(l.start.y,l.end.y))>20);if(!s.length)continue;const n=s.flatMap(l=>[l.start.x-20,l.start.x+20]).filter(l=>Math.abs(l-a.x)<=20).toSorted((l,c)=>Math.abs(l-a.x)-Math.abs(c-a.x));for(const l of n){const c=e.map((d,u)=>u===i||u===i+1?{...d,x:l}:d),h=ar(c).slice(i-1,i+2);if(!(s.some(d=>Math.abs(d.start.x-l)<19.99)||h.some(d=>r.some(u=>Sr(d,u,4)))))return c}}return e}function A3(e,t,r,i){if(!r||!i||t.dataset.nestedDecisionRoute)return null;const a=(l,c)=>c.x>=l.x-.5&&c.x+c.width<=l.x+l.width+.5&&c.y>=l.y-.5&&c.y+c.height<=l.y+l.height+.5,o=[...e.querySelectorAll("g.cluster > rect")].flatMap(l=>{const c=Qe(l,t);return c?[c]:[]}),s=o.filter(l=>a(l,i)&&!a(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0],n=s&&o.filter(l=>l!==s&&a(l,s)&&a(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0];return!s||!n||r.y+r.height>s.y?null:{x:(s.x+s.width+n.x+n.width)/2}}function F3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=yu(e),i=r[0]?.path;if(!i)return;const a=[...e.querySelectorAll("g.node, g.cluster > .cluster-label")].flatMap(s=>{const n=xr(s,i);return n?[n]:[]}),o=r.flatMap(s=>{const n=s.label;if(!n?.textContent?.trim())return[];const l=xr(n,i),c=t?.get(s.path.id);l&&c&&(l.x=c.x-l.width/2,l.y=c.y-l.height/2);const h=i.getScreenCTM(),d=n.parentElement?.getScreenCTM(),u=n.getBBox();return l&&h&&d?[{route:s,label:n,current:l,matrix:h,inverse:d.inverse(),local:u}]:[]});for(const s of o){const{route:n,label:l,current:c,matrix:h,inverse:d,local:u}=s,f=r.filter(m=>m!==n).flatMap(m=>ar(m.points)),p=Cn(n.points,c,[...a,...o.filter(m=>m!==s).map(m=>m.current)],f);if(!p)continue;const g=new DOMPoint(p.center.x,p.center.y).matrixTransform(h).matrixTransform(d);l.setAttribute("transform",`translate(${g.x-u.x-u.width/2},${g.y-u.y-u.height/2})`),l.dataset.labelSegmentStart=`${p.start.x},${p.start.y}`,l.dataset.labelSegmentEnd=`${p.end.x},${p.end.y}`,s.current=p.bounds}}function $3(e,t,r,i,a=[],o=[],s=[],n=8){if({top:"bottom",right:"left",bottom:"top",left:"right"}[t.side]!==r.side)return e;const c=t.side==="left"||t.side==="right",h=c?"y":"x",d=c?"x":"y",u=t.side==="right"||t.side==="bottom"?1:-1;if((r.point[d]-t.point[d])*u<=0)return e;const f=t.range??[t.point[h],t.point[h]],p=r.range??[r.point[h],r.point[h]],g=Math.max(f[0],p[0]),m=Math.min(f[1],p[1]);if(g>m)return e;const y=C=>Math.max(g,Math.min(m,C)),x=[...new Set([y(t.point[h]),y(r.point[h]),g,m,(g+m)/2,...[...o,...s].flatMap(C=>[C[h]-ai,C[h]+ai]),...i.flatMap(C=>[C[h]-n,C[h]+(c?C.height:C.width)+n]),...a.flatMap(C=>[Math.min(C.start[h],C.end[h])-n,Math.max(C.start[h],C.end[h])+n])])].filter(C=>C>=g&&C<=m).toSorted((C,k)=>Math.abs(C-t.point[h])+Math.abs(C-r.point[h])-Math.abs(k-t.point[h])-Math.abs(k-r.point[h]));for(const C of x){const k={...t.point,[h]:C},v={...r.point,[h]:C};if(o.some(F=>Math.hypot(k.x-F.x,k.y-F.y)<ai-.001)||s.some(F=>Math.hypot(v.x-F.x,v.y-F.y)<ai-.001))continue;const T={start:k,end:v};if(!i.some(F=>Sr(T,F,n))&&!a.some(F=>Sr(T,{x:Math.min(F.start.x,F.end.x),y:Math.min(F.start.y,F.end.y),width:Math.abs(F.start.x-F.end.x),height:Math.abs(F.start.y-F.end.y)},n)))return[k,v]}return e}function ko(e,t){const r=t.x-e.x,i=t.y-e.y;return Math.abs(r)>=Math.abs(i)?r>=0?"right":"left":i>=0?"bottom":"top"}function E3(e,t,r,i,a){const o=s=>ar(s).reduce((n,{start:l,end:c})=>n+Math.hypot(c.x-l.x,c.y-l.y),0);return t.map(vr).filter(s=>s.length<=e.length&&o(s)<o(e)-1).filter(s=>ar(s).every(n=>!r.some(l=>Sr(n,l,8))&&!i.some(({start:l,end:c})=>Sr(n,{x:Math.min(l.x,c.x),y:Math.min(l.y,c.y),width:Math.abs(c.x-l.x),height:Math.abs(c.y-l.y)},8)))).filter(s=>!a||Cn(s,a.bounds,[...r,...a.obstacles],i)).sort((s,n)=>o(s)-o(n))[0]??e}function P3(e,t){const r=t.map(i=>({...i,points:(i.path.dataset.manhattanPoints??"").split(" ").map(a=>{const[o,s]=a.split(",").map(Number);return{x:o,y:s}})})).filter(({points:i})=>i.length>=2&&i.every(({x:a,y:o})=>Number.isFinite(a)&&Number.isFinite(o)));for(const i of r){if(i.source===i.target||i.points.length===2)continue;const{path:a,points:o}=i,s=y=>{const x=Je(e,i[y]),C=x&&Ke(x),k=C&&Qe(C,a);if(!C||!k)return;const v=y==="source"?o[0]:o[o.length-1],T=y==="source"?o[1]:o[o.length-2],F=ko(v,T),A=F==="left"||F==="right",M=Math.max(8,Number(C.getAttribute(A?"ry":"rx"))||0),B=C.tagName.toLowerCase()==="rect"?A?[k.y+M,k.y+k.height-M]:[k.x+M,k.x+k.width-M]:void 0;return{point:v,side:F,range:B}},n=s("source"),l=s("target");if(!n||!l)continue;const c=r.filter(y=>y!==i),h=y=>c.flatMap(x=>[...x.source===y?[x.points[0]]:[],...x.target===y?[x.points[x.points.length-1]]:[]]),d=(y,x)=>x.x>=y.x&&x.x<=y.x+y.width&&x.y>=y.y&&x.y<=y.y+y.height,u=[...[...e.querySelectorAll("g.node")].filter(y=>![i.source,i.target].includes(Or(y))),...e.querySelectorAll("g.cluster > .cluster-label"),...[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y!==i.label&&y.textContent?.trim())].map(y=>xr(y,a)).filter(y=>!!y);for(const y of e.querySelectorAll("g.cluster > rect")){const x=Qe(y,a);x&&!d(x,n.point)&&!d(x,l.point)&&u.push(x)}const f=c.flatMap(y=>ar(y.points));let p=$3(o,n,l,u,f,h(i.source),h(i.target));if(p===o&&a.dataset.nestedDecisionRoute==="secondary-retry"){const y=Je(e,i.source),x=Je(e,i.target),C=y&&Ke(y),k=x&&Ke(x),v=C&&Qe(C,a),T=k&&Qe(k,a);if(C?.tagName.toLowerCase()==="rect"&&k&&oa(k)&&v&&T){const F=Lt(v,.5,0),A=[];if(l.side==="bottom"&&F.y>T.y+T.height+8&&F.x>l.point.x){const I=(F.y+T.y+T.height)/2;A.push([F,{x:F.x,y:I},{x:l.point.x,y:I},l.point])}const M=Yr(T,"left",24);F.x<M.x&&F.y>M.y&&A.push([F,{x:F.x,y:M.y},M]);const B=Yr(T,"right",T.height*.32);F.x>B.x&&F.y>B.y&&A.push([F,{x:F.x,y:B.y},B]);const $=A.filter(I=>!h(i.source).some(_=>Math.hypot(_.x-F.x,_.y-F.y)<ai)&&!h(i.target).some(_=>Math.hypot(_.x-I.at(-1).x,_.y-I.at(-1).y)<ai)),P=i.label&&xr(i.label,a);p=E3(o,$,u,f,P?{bounds:P,obstacles:[v,T]}:void 0)}}if(p===o||!sa(i.label,a,p,void 0,{obstacles:u,occupied:f}))continue;i.points=p,a.dataset.manhattanPoints=p.map(({x:y,y:x})=>`${y},${x}`).join(" "),a.dataset.manhattanSegments=String(p.length-1);const g=p.at(-1),m=p.at(-2);a.dataset.terminalDirection=`${g.x-m.x},${g.y-m.y}`,a.dataset.nestedDecisionRoute==="secondary-retry"&&(a.dataset.diamondTargetSide=ko(g,m)),a.setAttribute("d",p.map(({x:y,y:x},C)=>`${C?"L":"M"}${y},${x}`).join(""))}}function p1(e,t,r){const i=e.map(a=>({...a}));if(t){const a=i[1],o=i[0];i[0]=t.point;const s=t.side==="top"||t.side==="bottom";if(i.length>2&&(s&&Math.abs(o.x-a.x)<.001?a.x=t.point.x:!s&&Math.abs(o.y-a.y)<.001&&(a.y=t.point.y)),!(s?Math.abs(a.x-t.point.x)<.001:Math.abs(a.y-t.point.y)<.001))if(t.lead){const l=s?{x:a.x,y:t.lead.y}:{x:t.lead.x,y:a.y};i.splice(1,0,t.lead,l)}else{const l=s?{x:t.point.x,y:a.y}:{x:a.x,y:t.point.y};i.splice(1,0,l)}}if(r){const a=i[i.length-2],o=i[i.length-1];i[i.length-1]=r.point;const s=r.side==="top"||r.side==="bottom";if(i.length>2&&(s&&Math.abs(o.x-a.x)<.001?a.x=r.point.x:!s&&Math.abs(o.y-a.y)<.001&&(a.y=r.point.y)),!(s?Math.abs(a.x-r.point.x)<.001:Math.abs(a.y-r.point.y)<.001))if(r.lead){const l=s?{x:a.x,y:r.lead.y}:{x:r.lead.x,y:a.y};i.splice(i.length-1,0,l,r.lead)}else{const l=s?{x:r.point.x,y:a.y}:{x:a.x,y:r.point.y};i.splice(i.length-1,0,l)}}return vr(i)}function Yr(e,t,r=0){const i=Lt(e,.5,.5),a=e.width/2,o=e.height/2;if(t==="top"||t==="bottom"){const l=Math.max(-a*.7,Math.min(a*.7,r)),c=o*(1-Math.abs(l)/a);return{x:i.x+l,y:i.y+(t==="top"?-c:c)}}const s=Math.max(-o*.7,Math.min(o*.7,r)),n=a*(1-Math.abs(s)/o);return{x:i.x+(t==="left"?-n:n),y:i.y+s}}function I3(e,t,r=0){const i=Yr(e,t,r),a={...i};return t==="top"?a.y-=12:t==="right"?a.x+=12:t==="bottom"?a.y+=12:a.x-=12,{point:i,side:t,lead:a}}function O3(e,t){const r=new Map(t.map(s=>[s,Cr(s)])),i=[];for(const s of t){const n=r.get(s),l=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,p])=>({x:f,y:p}));if(!n||l.length<2)continue;const c=Je(e,n.source),h=c&&Ke(c);if(h&&oa(h)){const f=Qe(h,s);if(f){const p=ko(Lt(f,.5,.5),l[1]);i.push({path:s,role:"source",nodeId:n.source,bounds:f,side:p,adjacent:l[1]})}}const d=Je(e,n.target),u=d&&Ke(d);if(u&&oa(u)){const f=Qe(u,s);if(f){const p=t.some(m=>{const y=r.get(m);return m!==s&&y?.source===n.target&&y.target===n.source}),g=s.dataset.decisionReturn&&s.dataset.compactFlowchart==="true"?"left":s.dataset.decisionReturn||p?"bottom":ko(Lt(f,.5,.5),l[l.length-2]);i.push({path:s,role:"target",nodeId:n.target,bounds:f,side:g,adjacent:l[l.length-2]})}}}const a=new Map;for(const s of i){const n=`${s.nodeId}\0${s.side}`;a.set(n,[...a.get(n)??[],s])}const o=new Map;for(const s of a.values()){const n=s[0].side,l=n==="top"||n==="bottom",c=s.toSorted((u,f)=>(l?u.adjacent.x-f.adjacent.x:u.adjacent.y-f.adjacent.y)||u.path.id.localeCompare(f.path.id)||u.role.localeCompare(f.role)),h=(l?s[0].bounds.width:s[0].bounds.height)*.5,d=Math.min(ai,h/Math.max(1,s.length-1));c.forEach((u,f)=>{const p=s.length===1?0:(f-(s.length-1)/2)*d,g=o.get(u.path)??{};g[u.role]=I3(u.bounds,n,p),o.set(u.path,g)})}return o}function R3(e){const t=new Map;for(const i of e.querySelectorAll(".edgePaths path")){if(i.dataset.feedbackLane||i.dataset.groupedReturnLane||i.dataset.clientRequestLane||i.dataset.compactGroupedRoute||i.dataset.decisionCycleRoute||i.dataset.nestedDecisionRoute)continue;const a=Cr(i),o=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));if(!(!a||o.length<2))for(const s of["source","target"]){if(s==="source"&&i.dataset.fanoutSource)continue;const n=a[s],l=Je(e,n),c=l&&Ke(l),h=c&&Qe(c,i);if(!c||!h||oa(c))continue;const d=s==="source"?o[0]:o[o.length-1],f=[["top",Math.abs(d.y-h.y)],["right",Math.abs(d.x-h.x-h.width)],["bottom",Math.abs(d.y-h.y-h.height)],["left",Math.abs(d.x-h.x)]].toSorted((g,m)=>g[1]-m[1])[0][0],p=`${n}\0${f}`;t.set(p,[...t.get(p)??[],{path:i,role:s,side:f,bounds:h,endpoint:d}])}}const r=new Map;for(const i of t.values()){if(i.length<2)continue;const a=i[0].side,o=a==="top"||a==="bottom",s=i.toSorted((c,h)=>(o?c.endpoint.x-h.endpoint.x:c.endpoint.y-h.endpoint.y)||c.path.id.localeCompare(h.path.id)||c.role.localeCompare(h.role)),n=(o?i[0].bounds.width:i[0].bounds.height)*.6,l=Math.min(ai,n/Math.max(1,i.length-1));s.forEach((c,h)=>{const d=(h-(i.length-1)/2)*l,u=Oi(c.bounds,a),f=o?{x:u.x+d,y:u.y}:{x:u.x,y:u.y+d},p=r.get(c.path)??{};p[c.role]={point:f,side:a},r.set(c.path,p)})}for(const[i,a]of r){const o=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(n=>n.split(",").map(Number)).filter(n=>n.length===2&&n.every(Number.isFinite)).map(([n,l])=>({x:n,y:l}));if(o.length<2)continue;const s=p1(o,a.source,a.target);i.dataset.manhattanPoints=s.map(({x:n,y:l})=>`${n},${l}`).join(" "),a.source&&(i.dataset.crowdedSourcePort=`${a.source.point.x},${a.source.point.y}`),a.target&&(i.dataset.crowdedTargetPort=`${a.target.point.x},${a.target.point.y}`),i.setAttribute("d",s.map(({x:n,y:l},c)=>`${c===0?"M":"L"}${n},${l}`).join(""))}}function D3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;R3(e);const t=[...e.querySelectorAll(".edgePaths path")],r=O3(e,t);for(const i of t){if(i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)continue;const a=Cr(i),o=a&&Je(e,a.source),s=a&&Je(e,a.target),n=o&&Ke(o),l=s&&Ke(s),c=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(m=>m.split(",").map(Number)).filter(m=>m.length===2&&m.every(Number.isFinite)).map(([m,y])=>({x:m,y}));if(c.length<2)continue;let h,d;const u=Mi(e,i)?.textContent?.trim().toLocaleLowerCase();if(n&&oa(n)){const m=Qe(n,i),y=r.get(i)?.source;if(m&&y){const x=Lt(m,.5,.5),C=ko(x,c[1]),{side:k}=y;if(u==="no"&&C!==k&&c.length>2){const T=c.slice(1).map((F,A)=>({index:A,length:Math.abs(c[A].y-F.y)<.001?Math.abs(c[A].x-F.x):0})).toSorted((F,A)=>A.length-F.length)[0];if(T?.length){const F=(c[T.index].y>=x.y?1:-1)*ai;c[T.index].y+=F,c[T.index+1].y+=F,i.dataset.decisionLane=String(c[T.index].y)}}const{point:v}=y;h=y,i.dataset.diamondSourcePort=`${v.x},${v.y}`,i.dataset.diamondSourceSide=k,i.dataset.decisionBranch&&(i.dataset.decisionPort=`${v.x},${v.y}`)}}if(l&&oa(l)){const m=r.get(i)?.target;if(m){const{side:y}=m,{point:x}=m;d=m,s&&(i.dataset.diamondTargetPort=`${x.x},${x.y}`,i.dataset.diamondTargetSide=y,i.dataset.terminalTarget=s.id)}}const f=p1(c,h,d),p=f[f.length-2],g=f[f.length-1];d&&(i.dataset.terminalDirection=`${g.x-p.x},${g.y-p.y}`),i.dataset.manhattanPoints=f.map(({x:m,y})=>`${m},${y}`).join(" "),i.dataset.manhattanSegments=String(f.length-1),i.setAttribute("d",f.map(({x:m,y},x)=>`${x===0?"M":"L"}${m},${y}`).join("")),i.dataset.compactFlowchart||sa(Mi(e,i),i,f)}}function N3(e,t,r,i){const o=Oi(e,"right");if(t.length!==2||[e,...t.map(({bounds:d})=>d),...r,...i].some(d=>!Object.values(d).every(Number.isFinite)||d.width<0||d.height<0)||t.some(({bounds:d,port:u})=>!Number.isFinite(u.x)||!Number.isFinite(u.y)||d.y<e.y+e.height+32||!(Math.abs(u.x-d.x)<.001&&Math.abs(u.y-d.y-d.height/2)<.001)&&(u.x<=o.x+16||Math.abs(u.y-d.y)>.001||u.x<d.x+8||u.x>d.x+d.width-8)))return null;const s={x:o.x+16,y:o.y},n=[];for(const{bounds:d,port:u,tail:f}of t){const m=(Math.abs(u.x-d.x)<.001?[[o,s,{x:s.x,y:e.y+e.height+16},{x:d.x-16,y:e.y+e.height+16},{x:d.x-16,y:u.y},u]]:[...f?.length===2&&Math.abs(f[0].x-u.x)<.001&&f[0].y>=e.y+e.height+8&&f[0].y<=d.y-16?[[o,s,{x:s.x,y:f[0].y},f[0],u]]:[],[o,s,{x:s.x,y:d.y-32},{x:u.x,y:d.y-32},u]]).map(vr).find(y=>ar(y).every((x,C)=>Math.abs(x.start.x-x.end.x)>=.001&&Math.abs(x.start.y-x.end.y)>=.001?!1:![...r,...i].some(k=>Sr(x,k,8))&&!Sr(x,e,C===0?0:8)&&!t.some(({bounds:k})=>Sr(x,k,k===d&&C===y.length-2?0:8))));if(!m)return null;n.push(m)}const[l,c]=n.map(ar);let h=0;for(;h<Math.min(l.length,c.length);){const d=l[h],u=c[h];if(Math.hypot(d.start.x-u.start.x,d.start.y-u.start.y)>.001)break;if(Math.hypot(d.end.x-u.end.x,d.end.y-u.end.y)>.001){gs(d,u)&&((Math.hypot(d.end.x-d.start.x,d.end.y-d.start.y)<Math.hypot(u.end.x-u.start.x,u.end.y-u.start.y)?d:u)===d?c[h]={start:d.end,end:u.end}:l[h]={start:u.end,end:d.end});break}h++}for(const d of l.slice(h))for(const u of c.slice(h)){if(gs(d,u))return null;const f=Math.abs(d.start.y-d.end.y)<.001,p=Math.abs(u.start.y-u.end.y)<.001;if(f===p)continue;const g=f?d:u,m=f?u:d;if(m.start.x>Math.min(g.start.x,g.end.x)+.001&&m.start.x<Math.max(g.start.x,g.end.x)-.001&&g.start.y>Math.min(m.start.y,m.end.y)+.001&&g.start.y<Math.max(m.start.y,m.end.y)-.001)return null}return n}function q3(e,t,r){if(r.length!==2||e.querySelector("g.cluster")||r.some(({path:y})=>y.dataset.compactFlowchart||y.dataset.feedbackLane))return;const i=r[0].path,a=i.getScreenCTM();if(!a||a.a<=0||a.d<=0||Math.abs(a.b)>.001||Math.abs(a.c)>.001)return;const o=a.inverse(),s=[...e.querySelectorAll("g.node")].map(y=>{const x=Ke(y);return{id:Or(y),shape:x,bounds:x&&Qe(x,i)}});if(s.some(({bounds:y})=>!y)||new Set(s.map(({id:y})=>y)).size!==s.length)return;const n=s.find(({id:y})=>y===t);if(!n?.bounds||n.shape?.tagName.toLowerCase()!=="rect")return;const c=[...e.querySelectorAll(".edgePaths path")].filter(y=>!r.some(x=>x.path===y)).map(y=>{const x=y.getScreenCTM(),C=y.getTotalLength();if(!x||!C||!Number.isFinite(C)||C>16384)return null;const k=Math.ceil(C/2);return{path:y,points:Array.from({length:k+1},(v,T)=>y.getPointAtLength(C*T/k).matrixTransform(x).matrixTransform(o))}});if(c.some(y=>!y))return;const h=c.flatMap(y=>ar(y.points).map(({start:x,end:C})=>({x:Math.min(x.x,C.x),y:Math.min(x.y,C.y),width:Math.abs(C.x-x.x),height:Math.abs(C.y-x.y)}))),d=r.map(({path:y,target:x})=>{const C=s.find(({id:$})=>$===x),k=y.getScreenCTM();if(!C?.bounds||C.shape?.tagName.toLowerCase()!=="rect"||!k||["a","b","c","d","e","f"].some($=>Math.abs(k[$]-a[$])>.001))return null;const v=C.bounds,T=c.filter($=>Cr($.path)?.target===x);if(T.length>1||T.length&&v.width*.6<ai||T.some($=>{const P=$.points.at(-1);return Math.abs(P.y-v.y)>8||P.x<v.x+v.width/2}))return null;const F=v.x<=n.bounds.x+n.bounds.width+16?Oi(v,"left"):{x:v.x+v.width/2-(T.length?ai/2:0),y:v.y},A=y.dataset.manhattanPoints?.split(" ").map(($,P)=>`${P?"L":"M"}${$}`).join(""),B=pu(A??y.getAttribute("d")??"")?.slice(-2);return{bounds:v,port:F,tail:B&&Math.abs(B[0].x-F.x)<.001&&Math.abs(B[1].y-F.y)<.001?[B[0],F]:void 0}});if(d.some(y=>!y))return;const u=r.map(({path:y})=>Mi(e,y)),f=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y.textContent?.trim()&&!u.includes(y)).map(y=>xr(y,i));if(f.some(y=>!y))return;const p=[...s.filter(y=>y!==n&&!d.some(x=>x.bounds===y.bounds)).map(y=>y.bounds),...f],g=N3(n.bounds,d,p,h);if(!g)return;const m=[];for(const[y,x]of u.entries()){if(!x?.textContent?.trim())continue;const C=xr(x,i),k=x.parentElement?.getScreenCTM();if(!C||!k)return;const v=ar(g[y]).find(M=>{const B={x:(M.start.x+M.end.x)/2,y:(M.start.y+M.end.y)/2},$={x:B.x-C.width/2,y:B.y-C.height/2,width:C.width,height:C.height},P=Math.abs(M.start.y-M.end.y)<.001;return Math.hypot(M.end.x-M.start.x,M.end.y-M.start.y)>=(P?C.width:C.height)+16&&![...s.map(I=>I.bounds),...f,...h,...m.map(I=>I.bounds)].some(I=>Si($,I,8))&&!g.filter((I,_)=>_!==y).some(I=>ar(I).some(_=>Sr(_,$,8)))});if(!v)return;const T={x:(v.start.x+v.end.x)/2,y:(v.start.y+v.end.y)/2},F=x.getBBox(),A=new DOMPoint(T.x,T.y).matrixTransform(a).matrixTransform(k.inverse());m.push({label:x,center:T,segment:v,bounds:{x:T.x-C.width/2,y:T.y-C.height/2,width:C.width,height:C.height},transform:`translate(${A.x-F.x-F.width/2}, ${A.y-F.y-F.height/2})`})}g.forEach((y,x)=>{const{path:C,target:k}=r[x];C.setAttribute("d",y.map(({x:v,y:T},F)=>`${F?"L":"M"}${v},${T}`).join("")),delete C.dataset.terminalGapBasePath,C.dataset.fanoutSource=t,C.dataset.fanoutTarget=k,C.dataset.fanoutTrunk=y.slice(0,2).map(({x:v,y:T})=>`${v},${T}`).join(" "),C.dataset.manhattanPoints=y.map(({x:v,y:T})=>`${v},${T}`).join(" ")}),m.forEach(({label:y,transform:x,center:C,segment:k})=>{y.setAttribute("transform",x);const v=r[u.indexOf(y)].path;y.dataset.routePathId=v.id,y.dataset.finalPathCenter=`${C.x},${C.y}`,v.dataset.labelSegment=`${k.start.x},${k.start.y} ${k.end.x},${k.end.y}`})}function lp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{const a=Cr(i);return a?[{path:i,...a}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,a]of r){if(a.length<2)continue;const o=Je(e,i);if(!o||o.querySelector(":scope > polygon.label-container"))continue;const s=a.flatMap(f=>{const p=br(o),g=Je(e,f.target),m=g&&br(g);return p&&m?[{...f,targetId:f.target,source:p,target:m}]:[]});if(s.length!==a.length||new Set(s.map(({targetId:f})=>f)).size!==s.length)continue;const n=s[0].source.x+s[0].source.width,l=s[0].source.y+s[0].source.height;if(s.length===3&&s.every(f=>f.target.y>=l+16)&&Math.max(...s.map(f=>f.target.y))-Math.min(...s.map(f=>f.target.y))<=8){const f=s.toSorted((y,x)=>y.target.x+y.target.width/2-(x.target.x+x.target.width/2)),p=f[0].source,g=p.y+p.height/2,m=[{x:p.x,y:g},{x:p.x+p.width/2,y:l},{x:n,y:g}];f.forEach((y,x)=>{const C=m[x],k=x===0?{x:C.x-16,y:C.y}:x===1?{x:C.x,y:C.y+16}:{x:C.x+16,y:C.y},v=y.target.x+y.target.width/2,T=y.target.y,F=T-16,A=[k,{x:k.x,y:F},{x:v,y:F}];A.unshift(C),A.push({x:v,y:T}),y.path.setAttribute("d",A.map((M,B)=>`${B?"L":"M"}${M.x},${M.y}`).join("")),y.path.dataset.fanoutSource=i,y.path.dataset.fanoutTarget=y.targetId,y.path.dataset.fanoutPort=`${C.x},${C.y}`,y.path.dataset.fanoutTrunk=`${C.x},${C.y} ${k.x},${k.y}`,y.path.dataset.manhattanPoints=A.map(M=>`${M.x},${M.y}`).join(" "),sa(Mi(e,y.path),y.path,A)});continue}if(s.some(f=>f.target.x<=n+16)){q3(e,i,a);continue}const h=Math.min(...s.map(f=>f.target.x)),d=n+Math.min(36,Math.max(16,(h-n)/2)),u=s[0].source.y+s[0].source.height/2;for(const f of s){const p=f.target.y+f.target.height/2,g=[{x:n,y:u},{x:d,y:u},{x:d,y:p},{x:f.target.x,y:p}];f.path.setAttribute("d",g.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),f.path.dataset.fanoutSource=i,f.path.dataset.fanoutTarget=f.targetId,f.path.dataset.fanoutTrunk=`${n},${u} ${d},${u}`,f.path.dataset.manhattanPoints=g.map(m=>`${m.x},${m.y}`).join(" ")}}}function W3(e,t,r,i){if(!e.textContent?.trim())return;const a=e.getAttribute("transform");e.removeAttribute("transform");const o=e.getBBox();a&&e.setAttribute("transform",a);const s=t.getCTM(),n=e.parentElement?.getCTM();if(!s||!n)return;const l={x:r.x+(i.x-r.x)*.55,y:r.y+(i.y-r.y)*.55},c=new DOMPoint(l.x,l.y).matrixTransform(s).matrixTransform(n.inverse());e.setAttribute("transform",`translate(${c.x-o.x-o.width/2}, ${c.y-o.y-o.height/2})`),e.dataset.finalPathCenter=`${l.x},${l.y}`,e.dataset.routePathId=t.id,t.dataset.labelSegment=`${r.x},${r.y} ${i.x},${i.y}`}function m1(e,t,r){const i=Ke(e),a=i&&Qe(i,r),o=e.transform.baseVal.consolidate()?.matrix;!a||!o||(e.style.setProperty("transition-property","none","important"),e.setAttribute("transform",`translate(${o.e+t.x-a.x-a.width/2}, ${o.f+t.y-a.y-a.height/2})`))}function z3(e,t){const r=new Map;for(const i of e.toSorted((a,o)=>a.frame.width*a.frame.height-o.frame.width*o.frame.height)){const a=e.filter(f=>f!==i&&f.frame.x>=i.frame.x&&f.frame.y>=i.frame.y&&f.frame.x+f.frame.width<=i.frame.x+i.frame.width&&f.frame.y+f.frame.height<=i.frame.y+i.frame.height).flatMap(({cluster:f})=>{const p=r.get(f);return p?[p]:[]}),o=[...i.members.flatMap(f=>{const p=Ke(f),g=p&&Qe(p,t);return g?[g]:[]}),...a];if(!o.length)continue;const s=Number(i.cluster.dataset.headerHeight)||sn(18),n=Math.min(...o.map(f=>f.x))-24,l=Math.min(...o.map(f=>f.y))-s,c=Math.max(...o.map(f=>f.x+f.width))+24,h=Math.max(...o.map(f=>f.y+f.height))+24,d={x:n,y:l,width:c-n,height:h-l};i.rect.style.setProperty("transition-property","none","important");for(const[f,p]of Object.entries(d))i.rect.setAttribute(f,String(p));const u=i.label.querySelector("foreignObject");if(u)u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(Math.max(24,d.width-Zr*2))),i.label.setAttribute("transform",`translate(${d.x+Zr}, ${d.y+Zr})`);else{const f=i.label.getBBox();i.label.setAttribute("transform",`translate(${d.x+d.width/2-f.x-f.width/2}, ${d.y+Zr-f.y})`)}r.set(i.cluster,d)}}function H3(e,t){if(e.querySelectorAll("g.cluster").length<2)return!1;const r=t[0]?.path;if(!r)return!1;const i=R=>{const D=R&&Ke(R);return D?Qe(D,r):null},a=[...e.querySelectorAll("g.node")].flatMap(R=>{const D=Or(R),G=Ke(R);if(!G||!oa(G))return[];const j=t.filter(tt=>tt.source===D&&tt.target!==D),z=j.find(tt=>t.some(st=>st.source===tt.target&&st.target===D))?.target;if(!z)return[];const Q=j.find(tt=>tt.target!==z&&t.some(st=>st.source===z&&st.target===tt.target)&&t.some(st=>st.source===tt.target&&st.target===tt.target))?.target;if(!Q)return[];const et=new Map;for(const tt of t.filter(st=>st.target===D&&st.source!==z))et.set(tt.source,[...et.get(tt.source)??[],tt]);const rt=[...et.values()].find(tt=>tt.length>=2),J=t.filter(tt=>tt.source===D&&tt.target===Q),at=t.find(tt=>tt.source===D&&tt.target===z),xt=t.find(tt=>tt.source===z&&tt.target===D),H=t.find(tt=>tt.source===z&&tt.target===Q),Y=t.find(tt=>tt.source===Q&&tt.target===Q),Z=t.find(tt=>tt.source===Q&&tt.target!==Q);return!rt||J.length<2||!at||!xt||!H||!Y||!Z?[]:[{decisionId:D,secondary:z,merge:Q,ingress:rt,branches:J,add:at,retry:xt,done:H,loop:Y,downstream:Z}]})[0];if(!a)return!1;const o=a.ingress[0].source,s=a.downstream.target,n=new Set([a.decisionId,a.secondary,a.merge,o,s]),l=[...e.querySelectorAll("g.node")],c=new Map(l.filter(R=>n.has(Or(R))).map(R=>[Or(R),R]));if(c.size!==n.size)return!1;const h=[...e.querySelectorAll("g.cluster")].flatMap(R=>{const D=R.querySelector(":scope > rect"),G=R.querySelector(":scope > g.cluster-label");if(!D||!G)return[];const j=Qe(D,r);if(!j)return[];const z=l.filter(Q=>{const et=i(Q);if(!et)return!1;const rt=Lt(et,.5,.5);return rt.x>=j.x&&rt.x<=j.x+j.width&&rt.y>=j.y&&rt.y<=j.y+j.height});return[{cluster:R,rect:D,label:G,frame:j,members:z}]}),d=h.filter(R=>R.members.some(D=>Or(D)===a.decisionId)).toSorted((R,D)=>R.frame.width*R.frame.height-D.frame.width*D.frame.height)[0],u=d?h.filter(R=>R!==d&&d.frame.x>=R.frame.x&&d.frame.y>=R.frame.y&&d.frame.x+d.frame.width<=R.frame.x+R.frame.width&&d.frame.y+d.frame.height<=R.frame.y+R.frame.height).toSorted((R,D)=>R.frame.width*R.frame.height-D.frame.width*D.frame.height)[0]:void 0,f=(R,D)=>{const G=c.get(D);R&&G&&!R.members.includes(G)&&R.members.push(G)};f(d,a.decisionId),f(d,a.secondary),f(u,o),f(u,a.merge);const p=new Map([...c].flatMap(([R,D])=>{const G=i(D);return G?[[R,G]]:[]}));if(p.size!==c.size)return!1;const g=t.some(({path:R})=>R.dataset.compactFlowchart==="true"),m=g?"compact":"wide",y=e.dataset.nestedDecisionLayout!==m,x=p.get(o),C=p.get(a.decisionId),k=p.get(a.secondary),v=p.get(a.merge),T=p.get(s),F=g?(()=>{const R=Lt(C,.5,.5).x,D=Lt(x,.5,.5).y,G=Math.max(x.height,C.height,v.height,T.height)+94;return{intake:{x:R,y:D},decision:{x:R,y:D+G},secondary:{x:R+k.width/2,y:D+G*1.5},merge:{x:R,y:D+G*2},registry:{x:R,y:D+G*3}}})():(()=>{const R=Lt(C,.5,.5).y,D=Lt(x,.5,.5).x,G=D+x.width/2+C.width/2+116,j=G+C.width/2+v.width/2+184;return{intake:{x:D,y:R},decision:{x:G,y:R},secondary:{x:(G+j)/2+8,y:R+95},merge:{x:j,y:R},registry:{x:j+v.width/2+T.width/2+124,y:R}}})();if(y){for(const[R,D]of[[o,F.intake],[a.decisionId,F.decision],[a.secondary,F.secondary],[a.merge,F.merge],[s,F.registry]])m1(c.get(R),D,r);e.dataset.nestedDecisionLayout=m}z3(h,r);const A=R=>i(c.get(R)),M=A(o),B=A(a.decisionId),$=A(a.secondary),P=A(a.merge),I=A(s),[_,E]=a.ingress,[L,q]=a.branches,W=[];if(g){const R=Math.min(M.x,B.x,P.x,I.x)-16,D=Math.max(B.x+B.width,$.x+$.width)+12,G=D+20,j=Yr(B,"top",-8),z=Yr(B,"left",-8),Q=Yr(B,"top",8),et=Yr(B,"bottom",-8),rt=Yr(B,"left",8);W.push({edge:_,role:"primary-ingress",points:[Lt(M,.5,1),{x:j.x,y:Lt(M,.5,1).y},j],targetSide:"top"},{edge:E,role:"metadata-return",points:[Lt(M,0,.55),{x:R-22,y:Lt(M,0,.55).y},{x:R-22,y:z.y},z],labelSegment:1,targetSide:"left"},{edge:a.add,role:"secondary-add",points:[Yr(B,"right",-8),{x:D,y:Yr(B,"right",-8).y},{x:D,y:Lt($,1,.35).y},Lt($,1,.35)],labelSegment:1,sourceSide:"right"},{edge:a.retry,role:"secondary-retry",points:[Lt($,1,.68),{x:G,y:Lt($,1,.68).y},{x:G,y:B.y-24},{x:Q.x,y:B.y-24},Q],labelSegment:1,targetSide:"top"},{edge:L,role:"primary-branch",points:[et,{x:et.x,y:B.y+B.height+12},{x:et.x-16,y:B.y+B.height+12},{x:et.x-16,y:P.y-12},{x:Lt(P,.42,0).x,y:P.y-12},Lt(P,.42,0)],labelSegment:2,sourceSide:"bottom"},{edge:q,role:"decision-return",points:[rt,{x:R,y:rt.y},{x:R,y:Lt(P,0,.65).y},Lt(P,0,.65)],labelSegment:1,sourceSide:"left"},{edge:a.done,role:"secondary-done",points:[Lt($,1,.65),{x:$.x+$.width,y:Lt(P,1,.65).y},Lt(P,1,.65)],labelSegment:0},{edge:a.downstream,role:"primary-save",points:[Lt(P,.5,1),Lt(I,.5,0)]})}else{const R=Math.min(M.y,B.y)-44,D=$.y+$.height+72,G=Yr(B,"left",-8),j=Yr(B,"top",-8),z=Yr(B,"right",-8),Q=Yr(B,"right",8),et={x:P.x,y:Q.y},rt=Yr(B,"bottom",-10),J=Yr(B,"bottom",10),at={x:P.x,y:z.y};W.push({edge:_,role:"primary-ingress",points:[{x:M.x+M.width,y:G.y},G],targetSide:"left"},{edge:E,role:"metadata-return",points:[Lt(M,.5,0),{x:Lt(M,.5,0).x,y:R},{x:j.x,y:R},j],labelSegment:1,targetSide:"top"},{edge:a.add,role:"secondary-add",points:[rt,{x:rt.x,y:Lt($,0,.38).y},Lt($,0,.38)],labelSegment:1,sourceSide:"bottom"},{edge:a.retry,role:"secondary-retry",points:[Lt($,.38,1),{x:Lt($,.38,1).x,y:D},{x:J.x,y:D},J],labelSegment:1,targetSide:"bottom"},{edge:L,role:"primary-branch",points:[z,at],sourceSide:"right"},{edge:q,role:"decision-return",points:[Q,et],sourceSide:"right"},{edge:a.done,role:"secondary-done",points:[Lt($,1,.62),{x:Lt(P,.42,1).x,y:Lt($,1,.62).y},Lt(P,.42,1)]},{edge:a.downstream,role:"primary-save",points:[Lt(P,1,.64),{x:I.x,y:Lt(P,1,.64).y}]})}W.push({edge:a.loop,role:"compact-loop",points:[Lt(P,1,.16),{x:P.x+P.width+30,y:Lt(P,1,.16).y},{x:P.x+P.width+30,y:Lt(P,1,.4).y},Lt(P,1,.4)]});for(const{edge:R,role:D,points:G,labelSegment:j,sourceSide:z,targetSide:Q}of W){const et=vr(G);for(const at of["feedbackLane","fanoutSource","groupedReturnLane","decisionBranch","decisionReturn","clusterHeaderClearance","compactGroupedRoute"])delete R.path.dataset[at];R.path.dataset.nestedDecisionRoute=D,D==="compact-loop"?R.path.dataset.selfLoop="right":delete R.path.dataset.selfLoop,z?R.path.dataset.diamondSourceSide=z:delete R.path.dataset.diamondSourceSide,Q?R.path.dataset.diamondTargetSide=Q:delete R.path.dataset.diamondTargetSide,R.path.dataset.manhattanPoints=et.map(({x:at,y:xt})=>`${at},${xt}`).join(" "),R.path.dataset.manhattanSegments=String(et.length-1),R.path.dataset.terminalTarget=c.get(R.target)?.id??"";const rt=et.at(-1),J=et.at(-2);R.path.dataset.terminalDirection=`${rt.x-J.x},${rt.y-J.y}`,R.path.setAttribute("d",et.map(({x:at,y:xt},H)=>`${H?"L":"M"}${at},${xt}`).join("")),sa(R.label,R.path,et,j)}return P3(e,t),!0}function Y3(e,t){if(t.length!==1)return null;const r=t[0],i=e.filter(c=>c.source===r);if(i.length!==2)return null;const a=i.filter(c=>e.some(h=>h.source===c.target&&h.target===r));if(a.length!==1)return null;const o=a[0].target;if(o===r||e.filter(c=>c.source===o||c.target===o).length!==2)return null;const s=e.filter(c=>c.source!==o&&c.target!==o),n=s.filter(c=>!s.some(h=>h.target===c.source));if(n.length!==1)return null;const l=[n[0].source];for(;;){const c=s.filter(h=>h.source===l.at(-1));if(!c.length)break;if(c.length!==1||l.includes(c[0].target))return null;l.push(c[0].target)}return l.length!==s.length+1||l.indexOf(r)<=0||l.at(-1)===r?null:{decision:r,retry:o,spine:l}}function X3(e,t){if(!["TD","TB"].includes(e.dataset.flowchartDirection??"")||e.querySelector("g.cluster"))return!1;const r=[...e.querySelectorAll("g.node")],i=Y3(t,r.filter(p=>{const g=Ke(p);return g&&oa(g)}).map(Or));if(!i||r.length!==i.spine.length+1)return!1;const a=t[0].path,o=new Map(r.flatMap(p=>{const g=Ke(p),m=g&&Qe(g,a);return m?[[Or(p),m]]:[]}));if(o.size!==r.length)return!1;const s=t.find(p=>p.source===i.decision&&p.target===i.retry),n=s.label?.getBBox(),l=o.get(i.spine[0]),c=l.x+l.width/2;let h=l.y;const d=a.dataset.compactFlowchart==="true";for(const p of i.spine){const g=o.get(p);g.x=c-g.width/2,g.y=h,h+=g.height+(d?100:64)}const u=o.get(i.decision),f=o.get(i.retry);f.x=u.x+u.width+Math.max(80,(n?.width??0)+48),f.y=u.y+(u.height-f.height)/2;for(const p of r)m1(p,Lt(o.get(Or(p)),.5,.5),a);for(const p of t){const g=o.get(p.source),m=o.get(p.target),y=p.source===i.retry,x=p===s;let C;if(y){const k=Yr(m,"right",-Math.min(32,m.height/4)),v=Math.min(g.y,m.y)-32;C=[Lt(g,.5,0),{x:g.x+g.width/2,y:v},{x:m.x+m.width+24,y:v},{x:m.x+m.width+24,y:k.y},k]}else x?C=[Lt(g,1,.5),Lt(m,0,.5)]:C=[Lt(g,.5,1),Lt(m,.5,0)];for(const k of["feedbackLane","fanoutSource","fanoutPort","parallelLane","decisionBranch","decisionReturn"])delete p.path.dataset[k];p.path.dataset.decisionCycleRoute=y?"return":x?"branch":"spine",p.path.dataset.manhattanPoints=C.map(({x:k,y:v})=>`${k},${v}`).join(" "),p.path.dataset.manhattanSegments=String(C.length-1),p.path.setAttribute("d",C.map(({x:k,y:v},T)=>`${T?"L":"M"}${k},${v}`).join("")),sa(p.label,p.path,C)}return e.dataset.decisionCycleLayout="vertical",!0}function Nn(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],r=[...e.querySelectorAll(".edgePaths path")].flatMap((s,n)=>{const l=Cr(s);return l?[{path:s,label:t[n],...l}]:[]}),i=r[0]?.path;if(!i||H3(e,r)||X3(e,r))return;const a=s=>{const n=s&&Ke(s);return n?Qe(n,i):null},o=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=a(s);return n?[n]:[]});for(const s of new Set(r.map(({source:n})=>n))){const n=Je(e,s),l=a(n),c=r.filter(({source:m})=>m===s).flatMap(m=>{const y=Je(e,m.target),x=a(y);return x?[{...m,targetBounds:x}]:[]});if(!n?.querySelector(":scope > polygon.label-container")||!l||c.length!==2||!o.length)continue;const h=c.toSorted((m,y)=>+(y.label?.textContent?.trim()==="Yes")-+(m.label?.textContent?.trim()==="Yes"));if(new Set(h.map(({label:m})=>m?.textContent?.trim())).size!==2||!h.some(({label:m})=>m?.textContent?.trim()==="Yes")||!h.some(({label:m})=>m?.textContent?.trim()==="No"))continue;h.forEach((m,y)=>{const x=y===0?"upper":"lower",C=m.path.dataset.compactFlowchart==="true",k=l3(l,m.targetBounds,x,o,C);if(m.path.setAttribute("d",k.map((v,T)=>`${T?"L":"M"}${v.x},${v.y}`).join("")),m.path.dataset.decisionBranch=x,m.path.dataset.decisionSource=s,m.path.dataset.decisionTarget=m.target,m.path.dataset.decisionPort=`${k[0].x},${k[0].y}`,m.path.dataset.decisionLane=String(k[1].x),m.path.dataset.manhattanPoints=k.map(v=>`${v.x},${v.y}`).join(" "),m.label){const v=Math.hypot(k[1].x-k[0].x,k[1].y-k[0].y)<=12;W3(m.label,m.path,v&&k[2]?k[1]:k[0],v&&k[2]?k[2]:k[1])}});const d=new Set(h.map(({target:m})=>m)),u=r.find(({source:m,target:y})=>d.has(m)&&y===s),f=u&&Je(e,u.source),p=a(f);if(!u||!p)continue;const g=c3(p,l,o,u.path.dataset.compactFlowchart==="true");u.path.setAttribute("d",g.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),u.path.dataset.decisionReturn="outer",u.path.dataset.decisionSource=u.source,u.path.dataset.decisionTarget=s,u.path.dataset.decisionLane=String(Math.max(...g.map(({y:m})=>m))),u.path.dataset.manhattanPoints=g.map(m=>`${m.x},${m.y}`).join(" ")}}function j3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return!1;const t=[...e.querySelectorAll("g.node")].map(Or),r=new Set(t),i=new Map,a=new Set;for(const n of e.querySelectorAll(".edgePaths path")){const l=Cr(n);if(!l||!r.has(l.source)||!r.has(l.target)||i.has(l.source)||a.has(l.target))return!1;i.set(l.source,l.target),a.add(l.target)}const o=t.filter(n=>!a.has(n));if(o.length<2||o.some(n=>!i.has(n)))return!1;const s=new Set;for(const n of o){let l=n;for(;l!==void 0;){if(s.has(l))return!1;s.add(l),l=i.get(l)}}return s.size===t.length}function rh(e,t=!0,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return null;const i=[...e.querySelectorAll("g.node")];if(e.querySelector("g.cluster"))return t?K3(e):Z3(e,r),t?G3(e,i):null;if(i.length<2)return null;if(!t){let x=0;for(const C of i){const v=Ke(C)?.getBBox()??C.getBBox();C.setAttribute("transform",`translate(${-v.x-v.width/2}, ${x-v.y})`),x+=v.height+100}return null}const a=[...e.querySelectorAll(".edgePaths path")],o=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=new Map(i.map((x,C)=>[Or(x),C])),n=new Map,l=new Map;for(const x of a){const C=Cr(x);if(!C)continue;const k=[C.source,C.target].toSorted().join("\0");n.set(k,(n.get(k)??0)+1),l.set(C.source,(l.get(C.source)??0)+1)}const c={left:0,right:0},h=new Map,d=new Map,u=[],f=i.flatMap(x=>{const C=x.transform.baseVal.consolidate()?.matrix;if(!C)return[];const k=x.getBBox();return[{x:k.x+C.e,y:k.y+C.f,width:k.width,height:k.height}]});if(a.forEach((x,C)=>{const k=Cr(x),v=k&&Je(e,k.source),T=k&&Je(e,k.target),F=v&&br(v),A=T&&br(T);if(!k||!F||!A)return;f.push(F,A);const M=s.get(k.source)??0,B=s.get(k.target)??0,$=[k.source,k.target].toSorted().join("\0"),P=n.get($)??0,I=d.get($)??0;if(d.set($,I+1),P>1){const J=I-(P-1)/2;x.dataset.parallelLane=J<0?"before":J>0?"after":"center"}else delete x.dataset.parallelLane;let _;if(B===M+1&&n.get($)===1&&l.get(k.source)===1)_=[Lt(F,.5,1),Lt(A,.5,0)];else{const J=B<=M?"left":"right",at=c[J]++,xt=`${k.source}\0${J}`,H=h.get(xt)??0;h.set(xt,H+1);const Y=B>M,Z=Lt(F,.5,Y?1:0),tt=Lt(A,.5,Y?0:1),st=28+H*30,It=Z.y+(Y?st:-st),zt=tt.y+(Y?-28:28),Wt=42+at%2*6,Zt=J==="left"?Math.min(F.x,A.x)-Wt:Math.max(F.x+F.width,A.x+A.width)+Wt;_=[Z,{x:Z.x,y:It},{x:Zt,y:It},{x:Zt,y:zt},{x:tt.x,y:zt},tt]}_=vr(_);const E=Math.min(..._.map(J=>J.x)),L=Math.min(..._.map(J=>J.y)),q=Math.max(..._.map(J=>J.x)),W=Math.max(..._.map(J=>J.y));f.push({x:E,y:L,width:q-E,height:W-L}),x.setAttribute("d",_.map((J,at)=>`${at?"L":"M"}${J.x},${J.y}`).join("")),x.dataset.compactFlowchart="true",x.dataset.manhattanPoints=_.map(J=>`${J.x},${J.y}`).join(" ");const R=o[C];if(!R)return;const G=_.slice(1).map((J,at)=>({start:_[at],end:J})).toSorted((J,at)=>+(Math.abs(at.end.y-at.start.y)<.001)-+(Math.abs(J.end.y-J.start.y)<.001)||Math.hypot(at.end.x-at.start.x,at.end.y-at.start.y)-Math.hypot(J.end.x-J.start.x,J.end.y-J.start.y)),j=R.getBBox(),z=G.flatMap(J=>[.5,.35,.65,.2,.8].map(at=>({segment:J,midpoint:{x:J.start.x+(J.end.x-J.start.x)*at,y:J.start.y+(J.end.y-J.start.y)*at}}))),Q=z.find(({midpoint:J})=>{const at={x:J.x-j.width/2,y:J.y-j.height/2,width:j.width,height:j.height};return!u.some(xt=>Si(at,xt,4))})??z[0];if(!Q)return;const{midpoint:et}=Q;R.setAttribute("transform",`translate(${et.x-j.x-j.width/2}, ${et.y-j.y-j.height/2})`);const rt={x:et.x-j.width/2,y:et.y-j.height/2,width:j.width,height:j.height};u.push(rt),f.push(rt)}),!f.length)return null;const p=Math.min(...f.map(x=>x.x)),g=Math.min(...f.map(x=>x.y)),m=Math.max(...f.map(x=>x.x+x.width)),y=Math.max(...f.map(x=>x.y+x.height));return{x:p,y:g,width:m-p,height:y-g}}function G3(e,t){const r=t.map(br).filter(n=>!!n);for(const n of e.querySelectorAll(".edgePaths path")){const l=n.getBBox();r.push({x:l.x,y:l.y,width:l.width,height:l.height})}if(!r.length)return null;const i=Math.min(...r.map(n=>n.x)),a=Math.min(...r.map(n=>n.y)),o=Math.max(...r.map(n=>n.x+n.width)),s=Math.max(...r.map(n=>n.y+n.height));return{x:i-6,y:a-46,width:o-i+12,height:s-a+54}}function U3(e){const t=e.querySelector(".edgePaths path");if(!t)return null;const i=[...[...e.querySelectorAll("g.node")].flatMap(l=>{const c=Ke(l);return c?[c]:[]}),...e.querySelectorAll("g.cluster > rect"),...e.querySelectorAll(".edgePaths path")].flatMap(l=>{const c=Qe(l,t);return c?[c]:[]});if(!i.length)return null;const a=Math.min(...i.map(l=>l.x)),o=Math.min(...i.map(l=>l.y)),s=Math.max(...i.map(l=>l.x+l.width)),n=Math.max(...i.map(l=>l.y+l.height));return{x:a,y:o,width:s-a,height:n-o}}function Or(e){return e.id.match(/flowchart-(.+?)-\d+$/)?.[1]??e.id}function br(e){const t=Ke(e),r=e.transform.baseVal.consolidate()?.matrix;if(!t||!r)return null;const i=t.getBBox();return{x:i.x+r.e,y:i.y+r.f,width:i.width,height:i.height}}function V3(e,t,r){if(!e.length)return null;const i=Math.min(...e.map(l=>l.x))-20,a=Math.min(...e.map(l=>l.y))-r,o=Math.max(...e.map(l=>l.x+l.width))+20,s=Math.max(...e.map(l=>l.y+l.height))+20,n={x:i,y:a,width:o-i,height:s-a};return t.some(l=>Si(n,l,4))?null:n}function Z3(e,t){const r=[...e.querySelectorAll("g.node")],i=new Map(r.map(u=>[u,br(u)])),a=[...e.querySelectorAll("g.cluster")].flatMap(u=>{const f=u.querySelector(":scope > rect"),p=u.querySelector(":scope > g.cluster-label");if(!f||!p)return[];const g=f.getBBox(),m=t&&uu(u,t),y=m?t?.get(m):void 0;if(t&&!y)return[];const x=r.filter(C=>{if(y)return y.has(Or(C));const k=i.get(C);if(!k)return!1;const v=Lt(k,.5,.5);return v.x>=g.x&&v.x<=g.x+g.width&&v.y>=g.y&&v.y<=g.y+g.height});return[{cluster:u,rect:f,label:p,originalRect:g,members:x,id:m,memberIds:y}]}),o=new Map,s=(u,f,p)=>{let g=p;for(const m of u){const y=m.getBBox();o.set(m,{x:f-y.x-y.width/2,y:g-y.y}),g+=y.height+100}},n=Math.max(...r.map(u=>u.getBBox().width)),l=j3(e);let c=l;if(c){const u=new Map([...e.querySelectorAll(".edgePaths path")].map(x=>{const C=Cr(x);return[C.source,C.target]})),f=new Set(u.values()),p=new Map(r.map(x=>[Or(x),x])),g=r.filter(x=>!f.has(Or(x))).map(x=>{const C=[x];let k=u.get(Or(x));for(;k!==void 0;)C.push(p.get(k)),k=u.get(k);return C}),m=Array.from({length:Math.max(...g.map(x=>x.length))},(x,C)=>Math.max(...g.map(k=>k[C]?.getBBox().height??0)));let y=0;for(const x of g){const C=Math.max(...x.map(v=>v.getBBox().width));let k=48;x.forEach((v,T)=>{const F=v.getBBox();o.set(v,{x:y+C/2-F.x-F.width/2,y:k+m[T]/2-F.y-F.height/2}),k+=m[T]+100}),y+=C+24}}else s(r,n/2,48);const h=()=>{const u=new Map(r.flatMap(p=>{const g=Ke(p),m=o.get(p);if(!g||!m)return[];const y=g.getBBox();return[[p,{x:y.x+m.x,y:y.y+m.y,width:y.width,height:y.height}]]}));if(l&&(u.size!==r.length||a.length!==e.querySelectorAll("g.cluster").length||a.some(({members:p})=>!p.length)))return null;const f=new Map;for(const p of a.toSorted((g,m)=>(g.memberIds?.size??0)-(m.memberIds?.size??0)||g.originalRect.width*g.originalRect.height-m.originalRect.width*m.originalRect.height)){const g=p.members.flatMap(A=>{const M=u.get(A);return M?[M]:[]}),m=a.filter(A=>A!==p&&(p.memberIds?!!(A.id&&p.memberIds.has(A.id)):A.originalRect.x>=p.originalRect.x&&A.originalRect.y>=p.originalRect.y&&A.originalRect.x+A.originalRect.width<=p.originalRect.x+p.originalRect.width&&A.originalRect.y+A.originalRect.height<=p.originalRect.y+p.originalRect.height)).flatMap(({cluster:A})=>{const M=f.get(A);return M?[M.frame]:[]}),y=[...g,...m];if(!y.length)continue;const x=p.label.querySelector("foreignObject"),C=l&&x?x.cloneNode(!0):null;if(C){const A=Math.max(...y.map(B=>B.x+B.width))-Math.min(...y.map(B=>B.x));C.setAttribute("width",String(Math.max(24,A))),C.style.visibility="hidden";const M=C.querySelector("div");M&&(M.style.width="100%",M.style.whiteSpace="normal",M.style.overflowWrap="normal",M.style.wordBreak="normal"),p.label.append(C)}let k;try{const A=(C??x)?.querySelector("div");k=Math.ceil(Math.max(A?.getBoundingClientRect().height??0,A?.scrollHeight??0,18))}finally{C?.remove()}const v=sn(k),T=l?r.filter(A=>!p.members.includes(A)).flatMap(A=>{const M=u.get(A);return M?[M]:[]}):[],F=V3(y,T,v);if(!F)return null;f.set(p.cluster,{frame:F,measuredTitleHeight:k,headerHeight:v})}return f};let d=h();if(c&&!d&&(c=!1,s(r,n/2,48),d=h()),e.dataset.compactGroupedLayout=d?c?"parallel":"column":"original",!!d){for(const[u,f]of o)u.setAttribute("transform",`translate(${f.x}, ${f.y})`);for(const u of a){const f=d.get(u.cluster);if(!f)continue;const{frame:p,measuredTitleHeight:g,headerHeight:m}=f,y=p.x,x=p.x+p.width,C=p.y,k=u.label.querySelector("foreignObject"),v=k?.querySelector("div");if(u.rect.setAttribute("x",String(p.x)),u.rect.setAttribute("y",String(p.y)),u.rect.setAttribute("width",String(p.width)),u.rect.setAttribute("height",String(p.height)),u.cluster.dataset.headerHeight=String(m),k)k.setAttribute("x","0"),k.setAttribute("y","0"),k.setAttribute("width",String(Math.max(24,p.width-40))),k.setAttribute("height",String(g)),k.style.overflow="hidden",v&&(v.style.width="100%",v.style.whiteSpace="normal",v.style.overflowWrap="normal",v.style.wordBreak="normal"),u.label.setAttribute("transform",`translate(${y+20}, ${C+20})`);else{const T=u.label.getBBox();u.label.setAttribute("transform",`translate(${(y+x)/2-T.x-T.width/2}, ${C+20-T.y})`)}}}}function K3(e){if(e.dataset.compactGroupedLayout==="original")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")],i=e.dataset.compactGroupedLayout==="parallel",a=new Map(r.map((g,m)=>[Or(g),m])),o=t.flatMap(g=>{const m=Cr(g);return m?[{path:g,...m}]:[]}),s=new Map;for(const g of o){const m=[g.source,g.target].toSorted().join("\0");s.set(m,[...s.get(m)??[],g])}const n={left:0,right:0},l=o.flatMap(g=>{if(g.source===g.target)return[{...g,side:"right"}];const m=[g.source,g.target].toSorted().join("\0"),y=s.get(m)??[];if(y.length>1)return[{...g,side:y.indexOf(g)%2?"right":"left"}];const x=a.get(g.source)??0,C=a.get(g.target)??0;return[{...g,side:i||Math.abs(C-x)===1?null:C<x?"left":"right"}]}),c=new Map;for(const g of l)if(!(!g.side||g.source===g.target))for(const m of[g.source,g.target]){const y=`${m}\0${g.side}`;c.set(y,(c.get(y)??0)+1)}const h=new Map,d=(g,m)=>{const y=`${g}\0${m}`,x=c.get(y)??1,C=h.get(y)??0;return h.set(y,C+1),x===1?.5:.25+C*.5/(x-1)},u=r.map(br).filter(g=>!!g),f=Math.min(...u.map(g=>g.x))-24,p=Math.max(...u.map(g=>g.x+g.width))+24;for(const g of l){const{path:m,source:y,target:x,side:C}=g,k=Je(e,y),v=Je(e,x),T=k&&br(k),F=v&&br(v);if(!T||!F)continue;let A;if(y===x){const M=T.x+T.width+24;A=[Lt(T,1,.3),{x:M,y:T.y+T.height*.3},{x:M,y:T.y+T.height*.7},Lt(T,1,.7)],m.dataset.selfLoop="right"}else if(C){const M=Lt(T,C==="left"?0:1,d(y,C)),B=Lt(F,C==="left"?0:1,d(x,C)),$=n[C]++,P=(C==="left"?f:p)+(C==="left"?-1:1)*$*12;A=[M,{x:P,y:M.y},{x:P,y:B.y},B],m.dataset.compactGroupedSide=C,m.dataset.compactGroupedPort=`${M.x},${M.y} ${B.x},${B.y}`}else if(F.x>=T.x+T.width||T.x>=F.x+F.width){const B=F.x>=T.x,$=Lt(T,B?1:0,.5),P=Lt(F,B?0:1,.5),I=($.x+P.x)/2;A=vr([$,{x:I,y:$.y},{x:I,y:P.y},P])}else{const B=F.y>=T.y,$=Lt(T,.5,B?1:0),P=Lt(F,.5,B?0:1),I=($.y+P.y)/2;A=vr([$,{x:$.x,y:I},{x:P.x,y:I},P])}A=vr(A),m.setAttribute("d",A.map((M,B)=>`${B?"L":"M"}${M.x},${M.y}`).join("")),m.dataset.compactFlowchart="true",m.dataset.compactGroupedRoute="true",m.dataset.manhattanPoints=A.map(M=>`${M.x},${M.y}`).join(" ")}for(const g of e.querySelectorAll("g.cluster")){const m=g.querySelector(":scope > rect"),y=g.querySelector(":scope > g.cluster-label");if(!m||!y)continue;const x=m.getBBox(),C=y.getBBox();y.setAttribute("transform",`translate(${x.x+x.width/2-C.x-C.width/2}, ${x.y+20-C.y})`)}}function Q3(e){if(e.dataset.nestedDecisionLayout)return;const t=[...e.querySelectorAll("g.node")],r=[...e.querySelectorAll("g.cluster")].flatMap(a=>{const o=a.querySelector(":scope > rect");return o?[{cluster:a,rect:o,frame:{x:Number(o.getAttribute("x")),y:Number(o.getAttribute("y")),width:Number(o.getAttribute("width")),height:Number(o.getAttribute("height"))}}]:[]}),i=(a,o)=>o.x>=a.x&&o.x+o.width<=a.x+a.width&&o.y>=a.y&&o.y+o.height<=a.y+a.height;for(const a of r){const o=r.filter(g=>g!==a&&i(g.frame,a.frame)).toSorted((g,m)=>g.frame.width*g.frame.height-m.frame.width*m.frame.height)[0];if(!o)continue;const s=[...e.querySelectorAll(".edgePaths path")].flatMap(g=>{const m=Cr(g),y=m&&Je(e,m.source),x=m&&Je(e,m.target),C=y&&br(y),k=x&&br(x),v=Mi(e,g);return!C||!k||!i(a.frame,k)||i(a.frame,C)||!i(o.frame,C)||C.y+C.height>a.frame.y?[]:[{source:C,labelWidth:v?.getBBox().width??0}]});if(!s.length)continue;const n=24,l=Math.max(0,...s.map(({source:g})=>g.y+g.height+n-a.frame.y)),c=t.filter(g=>{const m=br(g);return m&&i(a.frame,m)}),h=t.filter(g=>!c.includes(g)).flatMap(g=>{const m=br(g);return m&&m.y>=a.frame.y+a.frame.height?[m.y]:[]}),d=Math.min(o.frame.y+o.frame.height,...h)-a.frame.y-a.frame.height-n,u=Math.min(l,Math.max(0,d));if(u>0){for(const g of c){const m=g.transform.baseVal.consolidate()?.matrix;m&&g.setAttribute("transform",`translate(${m.e}, ${m.f+u})`)}for(const g of r.filter(m=>i(a.frame,m.frame))){g.rect.setAttribute("y",String(g.frame.y+u));const m=g.cluster.querySelector(":scope > .cluster-label"),y=m?.transform.baseVal.consolidate()?.matrix;y&&m.setAttribute("transform",`translate(${y.e}, ${y.f+u})`)}}const f=Math.max(...s.map(({labelWidth:g})=>g+12)),p=Math.max(o.frame.x+o.frame.width,a.frame.x+a.frame.width+f);o.rect.setAttribute("width",String(p-o.frame.x))}}function ih(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll("g.cluster")];for(const r of e.querySelectorAll(".edgePaths path")){if(r.dataset.feedbackLane||r.dataset.nestedDecisionRoute)continue;const i=r.dataset.fanoutSource&&Cr(r),a=i&&Je(e,i.source),o=i&&Je(e,i.target),s=a&&br(a),n=o&&br(o),l=B=>t.flatMap($=>{const I=$.querySelector(":scope > rect")?.getBBox();return I?[{cluster:$,frame:I}]:[]}).filter(({frame:$})=>B.x+B.width/2>$.x&&B.x+B.width/2<$.x+$.width&&B.y+B.height/2>$.y&&B.y+B.height/2<$.y+$.height).toSorted(($,P)=>$.frame.width-P.frame.width)[0];if(s&&n){const B=l(s),$=l(n);if(B&&$&&B.cluster!==$.cluster){const P=Lt(s,1,.5),I=Lt(n,0,.5),_=(B.frame.x+B.frame.width+$.frame.x)/2,E=[P,{x:_,y:P.y},{x:_,y:I.y},I];r.setAttribute("d",E.map((L,q)=>`${q?"L":"M"}${L.x},${L.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort="left",r.dataset.manhattanPoints=E.map(L=>`${L.x},${L.y}`).join(" ");continue}}const c=r.getTotalLength();if(!c)continue;const h=r.getPointAtLength(0),d=r.getPointAtLength(c);if(Math.abs(d.y-h.y)<=Math.abs(d.x-h.x))continue;const u=Cr(r),f=u&&Je(e,u.source),p=u&&Je(e,u.target),g=f&&Ke(f),m=p&&Ke(p),y=g?Qe(g,r):null,x=m?Qe(m,r):null,C=B=>B?t.map($=>{const P=$.querySelector(":scope > rect"),I=P&&xr(P,r),_=Number($.dataset.headerHeight);return I?{bounds:I,protectedBottom:I.y+(Number.isFinite(_)?_:48)+8}:null}).filter($=>!!$).filter(({bounds:$})=>B.x+B.width/2>$.x&&B.x+B.width/2<$.x+$.width&&B.y+B.height/2>$.y&&B.y+B.height/2<$.y+$.height).toSorted(($,P)=>$.bounds.width-P.bounds.width)[0]:null,k=C(y),v=C(x);if(x&&v&&d.y<v.protectedBottom){const B=x.y+x.height/2,$=Math.abs(h.x-(v.bounds.x-8))<=Math.abs(h.x-(v.bounds.x+v.bounds.width+8)),P=$?v.bounds.x-8:v.bounds.x+v.bounds.width+8,I=$?x.x:x.x+x.width,_=y&&k&&(k.bounds.x!==v.bounds.x||k.bounds.y!==v.bounds.y),E=v.bounds.y-6,L=y?y.y+y.height/2:h.y,q=y?P<y.x+y.width/2?y.x:y.x+y.width:h.x,W=vr(_?[{x:q,y:L},{x:P,y:L},{x:P,y:B},{x:I,y:B}]:[{x:h.x,y:h.y},{x:h.x,y:E},{x:P,y:E},{x:P,y:B},{x:I,y:B}]);r.setAttribute("d",W.map((R,D)=>`${D?"L":"M"}${R.x},${R.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort=$?"left":"right",r.dataset.manhattanPoints=W.map(R=>`${R.x},${R.y}`).join(" ");continue}const T=t.flatMap(B=>{const $=B.querySelector(":scope > rect"),P=$&&xr($,r);if(!P)return[];const I=Number(B.dataset.headerHeight),_={...P,height:Math.min(P.height,(Number.isFinite(I)?I:48)+8)};return Array.from({length:101},(L,q)=>r.getPointAtLength(c*q/100)).some(L=>L.x>_.x-6&&L.x<_.x+_.width+6&&L.y>_.y-6&&L.y<_.y+_.height+6)?[_]:[]}).sort((B,$)=>d.y>=h.y?B.y-$.y:$.y+$.height-(B.y+B.height));if(!T.length)continue;const F=d.y>=h.y,A=[{x:h.x,y:h.y}];for(const B of T){const $=F?B.y-6:B.y+B.height+6,P=F?B.y+B.height+6:B.y-6,I=B.x-8,_=B.x+B.width+8,E=Math.abs(h.x-I)<=Math.abs(h.x-_)?I:_;A.push({x:h.x,y:$},{x:E,y:$},{x:E,y:P},{x:h.x,y:P})}A.push({x:h.x,y:d.y},{x:d.x,y:d.y});const M=vr(A);r.setAttribute("d",M.map((B,$)=>`${$?"L":"M"}${B.x},${B.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.manhattanPoints=M.map(B=>`${B.x},${B.y}`).join(" ")}}function Io(e){if(!e.querySelector("g.cluster"))return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=[...e.querySelectorAll("g.cluster > g.cluster-label")],a=s=>{const n=s.getAttribute("transform");s.removeAttribute("transform");const l=s.getBBox();return n&&s.setAttribute("transform",n),l},o=[];t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute&&l){const C=xr(l,s);C&&o.push(C);return}if(s.dataset.clientRequestLane==="downward"&&l){const C=xr(l,s);C&&o.push(C);return}const c=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(C=>C.split(",").map(Number)).filter(C=>C.length===2&&C.every(Number.isFinite)).map(([C,k])=>({x:C,y:k}));if(!l||c.length<2)return;const h=a(l),d=xr(l,s);if(!d)return;const u=[...[...e.querySelectorAll("g.node")].map(C=>xr(C,s)).filter(C=>!!C),...i.map(C=>xr(C,s)).filter(C=>!!C),...o],f=ar(c);let g=f.flatMap(C=>{const k=Math.abs(C.start.y-C.end.y)<.001,v=Math.hypot(C.end.x-C.start.x,C.end.y-C.start.y),T=(k?d.width:d.height)+12;return v<T?[]:[.5,.35,.65,.2,.8].map(F=>{const A={x:C.start.x+(C.end.x-C.start.x)*F,y:C.start.y+(C.end.y-C.start.y)*F},M={x:A.x-d.width/2,y:A.y-d.height/2,width:d.width,height:d.height};return{center:A,bounds:M,horizontal:k,capacity:v}})}).filter(({bounds:C})=>u.every(k=>!Si(C,k,4))).sort((C,k)=>Number(k.horizontal)-Number(C.horizontal)||k.capacity-C.capacity)[0];if(!g){const C=f.map(A=>({...A,capacity:Math.hypot(A.end.x-A.start.x,A.end.y-A.start.y)})).sort((A,M)=>M.capacity-A.capacity)[0];if(!C)return;const k=Math.abs(C.end.y-C.start.y)>Math.abs(C.end.x-C.start.x),v={x:(C.start.x+C.end.x)/2,y:(C.start.y+C.end.y)/2},T=k?d.width/2:d.height/2,F=u.flatMap(A=>k?[{x:A.x-4-T,y:v.y},{x:A.x+A.width+4+T,y:v.y}]:[{x:v.x,y:A.y-4-T},{x:v.x,y:A.y+A.height+4+T}]);g=[k?{x:v.x+T+4,y:v.y}:{x:v.x,y:v.y+T+4},k?{x:v.x-T-4,y:v.y}:{x:v.x,y:v.y-T-4},...F].map(A=>({center:A,bounds:{x:A.x-d.width/2,y:A.y-d.height/2,width:d.width,height:d.height},horizontal:!k,capacity:C.capacity})).filter(({bounds:A})=>u.every(M=>!Si(A,M,4))&&o.every(M=>!Si(A,M,4))).toSorted((A,M)=>Math.hypot(A.center.x-v.x,A.center.y-v.y)-Math.hypot(M.center.x-v.x,M.center.y-v.y))[0]}if(!g)return;if(s.dataset.groupedReturnLane==="right"&&!g.horizontal){const C=h.width/2-6;g={...g,center:{...g.center,x:g.center.x-C},bounds:{...g.bounds,x:g.bounds.x-C}}}const m=s.getCTM(),y=l.parentElement?.getCTM(),x=m&&y?new DOMPoint(g.center.x,g.center.y).matrixTransform(m).matrixTransform(y.inverse()):g.center;l.setAttribute("transform",`translate(${x.x-h.x-h.width/2}, ${x.y-h.y-h.height/2})`),l.dataset.finalPathCenter=`${g.center.x},${g.center.y}`,o.push(g.bounds)}),t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute||s.dataset.clientRequestLane==="downward")return;const c=l?.dataset.finalPathCenter,h=s.dataset.manhattanPoints;if(!l?.textContent?.trim()||!h)return;const d=xr(l,s);if(!d)return;const u=i.flatMap(B=>{const $=xr(B,s);return $?[$]:[]}),f=u.find(B=>Si(d,B,4));if(!f)return;const p=B=>{const[$,P]=B.split(",").map(Number);return{x:$,y:P}},g=h.split(" ").map(p),m=g.slice(1).map((B,$)=>({start:g[$],end:B})),y=c?p(c):null,x=y?m.find(({start:B,end:$})=>{const P=Math.min(B.x,$.x)-1,I=Math.max(B.x,$.x)+1,_=Math.min(B.y,$.y)-1,E=Math.max(B.y,$.y)+1;return y.x>=P&&y.x<=I&&y.y>=_&&y.y<=E}):m.slice().sort((B,$)=>Math.hypot($.end.x-$.start.x,$.end.y-$.start.y)-Math.hypot(B.end.x-B.start.x,B.end.y-B.start.y))[0];if(!x)return;const C=Math.abs(x.end.y-x.start.y)>Math.abs(x.end.x-x.start.x),k={x:(x.start.x+x.end.x)/2,y:(x.start.y+x.end.y)/2},v={...y??k};if(y)if(C){const B=d.height/2,$=f.y+f.height+4+B,P=f.y-4-B,I=Math.min(x.start.y,x.end.y)+B,_=Math.max(x.start.y,x.end.y)-B;v.y=$<=_?Math.max(I,$):Math.min(_,P)}else{const B=d.width/2,$=f.x+f.width+4+B,P=f.x-4-B,I=Math.min(x.start.x,x.end.x)+B,_=Math.max(x.start.x,x.end.x)-B;v.x=$<=_?Math.max(I,$):Math.min(_,P)}else{const B=C?d.width/2:d.height/2,$=[1,-1].map(P=>C?{x:k.x+P*(B+4),y:k.y}:{x:k.x,y:k.y+P*(B+4)}).find(P=>{const I={x:P.x-d.width/2,y:P.y-d.height/2,width:d.width,height:d.height};return u.every(_=>!Si(I,_,4))});if(!$)return;v.x=$.x,v.y=$.y}const T=a(l),F=s.getCTM(),A=l.parentElement?.getCTM();if(!F||!A)return;const M=new DOMPoint(v.x,v.y).matrixTransform(F).matrixTransform(A.inverse());l.setAttribute("transform",`translate(${M.x-T.x-T.width/2}, ${M.y-T.y-T.height/2})`),l.dataset.finalPathCenter=`${v.x},${v.y}`})}function Lt(e,t,r){return{x:e.x+e.width*t,y:e.y+e.height*r}}function J3(e,t,r,i,a=!1){const o=Math.min(...i.map(f=>f.x)),s=Math.max(...i.map(f=>f.x+f.width)),n=Math.min(...i.map(f=>f.y)),l=Lt(t,.5,1),c=Lt(r,.5,0);if(e===Me.userSendsMessage)return[l,c];if(e===Me.agentResponds){const f=Lt(t,.28,1),p=Lt(r,.28,0),g=f.y+(a?38:50);return[f,{x:f.x,y:g},{x:p.x,y:g},p]}if(e===Me.toolStarts){if(a){const y=Math.min(t.x+t.width,r.x+r.width)-16;return[{x:y,y:t.y+t.height},{x:y,y:r.y}]}const f=r.y>=t.y,p=Lt(t,.64,f?1:0),g=Lt(r,.5,f?0:1),m=(p.y+g.y)/2;return[p,{x:p.x,y:m},{x:g.x,y:m},g]}if(e===Me.toolCompletes){if(a){const x=Math.max(t.x,r.x);return[{x,y:t.y},{x,y:r.y+r.height}]}const f=r.y>=t.y,p=Lt(t,.72,f?1:0),g=Lt(r,.8,f?0:1),m=92,y=p.y+(f?m:-m);return[p,{x:p.x,y},{x:g.x,y},g]}if(e===Me.agentAsksUser){const f=Lt(t,0,a?.75:.35),p=Lt(r,0,a?.25:.35),g=Math.min(f.x,p.x)-(a?60:50);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Me.userReplies){const f=Lt(t,1,.65),p=Lt(r,1,a?.95:.65),g=Math.max(f.x,p.x)+(a?32:30);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Me.agentFinishes){const f=Lt(t,1,.35),p=Lt(r,1,.35),g=a?Math.max(f.x,p.x)+40:s+90;return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Me.requestFails){const f=Lt(t,0,a?.9:.25),p=Lt(r,0,a?.75:.25),g=o-(a?88:40);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Me.streamFails){if(a){const y=Lt(t,0,.25),x=Lt(r,0,.25),C=o-60;return[y,{x:C,y:y.y},{x:C,y:x.y},x]}const f=Lt(t,.5,0),p=Lt(r,0,.5),g=o-80,m=n-40;return[f,{x:f.x,y:m},{x:g,y:m},{x:g,y:p.y},p]}if(a){const f=Lt(t,0,.9),p=Lt(r,0,.1),g=o-92;return[f,{x:g,y:f.y},{x:g,y:p.y},p]}const h=Lt(t,1,.75),d=Lt(r,0,.75),u=(h.x+d.x)/2;return[h,{x:u,y:h.y},{x:u,y:d.y},d]}function ar(e){return e.slice(1).map((t,r)=>({start:e[r],end:t}))}function gs(e,t){const r=Math.abs(e.start.y-e.end.y)<.001,i=Math.abs(t.start.y-t.end.y)<.001;return r!==i?!1:r?Math.abs(e.start.y-t.start.y)>=.001?!1:Math.min(e.start.x,e.end.x)<Math.max(t.start.x,t.end.x)-.001&&Math.min(t.start.x,t.end.x)<Math.max(e.start.x,e.end.x)-.001:Math.abs(e.start.x-t.start.x)>=.001?!1:Math.min(e.start.y,e.end.y)<Math.max(t.start.y,t.end.y)-.001&&Math.min(t.start.y,t.end.y)<Math.max(e.start.y,e.end.y)-.001}function t$(e,t,r=[],i){return ar(e).flatMap((a,o)=>{const s=Math.abs(a.start.y-a.end.y)<.001,n=Math.hypot(a.end.x-a.start.x,a.end.y-a.start.y),l=i?gu(i,a.start,a.end):1,c=(s?t.width:t.height)+h1*2/l;return n>=c&&!r.some(h=>gs(a,h))?[{segment:a,index:o,horizontal:s,capacity:n,excess:n-c}]:[]}).sort((a,o)=>Number(o.horizontal)-Number(a.horizontal)||o.excess-a.excess)[0]}function e$(e,t){if(!t||t.direction!=="TB"||!e.id)return;const r=Object.entries(tp),i=new Set(["root_start",...Object.values(tp).flat()]);if(t.nodes.length!==i.size||new Set(t.nodes.map(d=>d.id)).size!==i.size||new Set(t.nodes.map(d=>d.domId)).size!==i.size||t.nodes.some(d=>!i.has(d.id)||!d.domId||d.isGroup||d.parentId||d.shape!==(d.id==="root_start"?"stateStart":"rect"))||t.edges.length!==r.length+1||new Set(t.edges.map(d=>d.id)).size!==t.edges.length||t.edges.filter(d=>d.start==="root_start"&&d.end==="Idle").length!==1)return;const a=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],o=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=[...e.querySelectorAll("g.node")];if(a.length!==t.edges.length||s.length!==t.nodes.length)return;const n=new Map;for(const d of a){const u=d.dataset.id;if(!u||n.has(u)||d.id!==`${e.id}-${u}`||!t.edges.some(f=>f.id===u))return;n.set(u,d)}const l=new Map;for(const d of o){const u=d.querySelector(":scope > .label[data-id]")?.getAttribute("data-id");if(!u||l.has(u)||!n.has(u))return;l.set(u,d)}const c=new Map;for(const d of t.nodes){const u=s.filter(f=>f.id===`${e.id}-${d.domId}`);if(u.length!==1)return;c.set(d.id,u[0])}const h=[];for(const[d,[u,f]]of r){const p=t.edges.filter(x=>x.start===u&&x.end===f);if(p.length!==1)return;const g=p[0],m=n.get(g.id),y=l.get(g.id);if(!m||!y)return;h.push({edge:g,path:m,label:y,kind:d})}return{paths:a,labels:o,nodesById:c,routes:h,diagram:t}}function r$(e,t=!1,r){if(!e.classList.contains("statediagram"))return;for(const C of e.querySelectorAll("g.statediagram-cluster")){const k=C.querySelector(":scope > g > rect.outer"),v=C.querySelector(":scope > rect.inner"),T=C.querySelector(":scope > .cluster-label");if(!k||!v||!T)continue;const F=Qe(T,C),A=T.transform.baseVal.consolidate()?.matrix;if(!F||!A)continue;const M=k.y.baseVal.value+6;T.setAttribute("transform",`translate(${A.e},${A.f+M-F.y})`);const B=Math.max(v.y.baseVal.value,M+F.height+6);v.setAttribute("height",String(Math.max(0,v.height.baseVal.value-(B-v.y.baseVal.value)))),v.setAttribute("y",String(B));for(const $ of e.querySelectorAll("path.transition[data-points]")){let P;try{P=JSON.parse(atob($.dataset.points))}catch{continue}if(P.length<4)continue;const[I,_,E]=P,L=Qe(k,$);if(!L||Math.abs(I.y-L.y)>.5||I.x<L.x||I.x>L.x+L.width||I.x!==_.x||_.y!==E.y||Math.abs(_.x-E.x)>8||E.x<L.x+8||E.x>L.x+L.width-8)continue;P[0]={x:E.x,y:I.y},P.splice(1,1),P=vr(P);const q=mu(P);$.setAttribute("d",q),$.dataset.terminalGapBasePath=q,$.dataset.manhattanPoints=P.map(({x:W,y:R})=>`${W},${R}`).join(" ")}}let i;try{i=e$(e,r??JSON.parse(e.dataset.stateRouteGraph??"null"))}catch{return}if(!i)return;const{paths:a,labels:o,nodesById:s,routes:n}=i,l=a[0];if(!l)return;const c=new Map,h=new Map;for(const[C,k]of s){const v=Ke(k),T=v&&Qe(v,l);if(!v||!T||!Object.values(T).every(Number.isFinite)||t&&!k.transform.baseVal.consolidate()?.matrix)return;c.set(C,T),h.set(C,{node:k,shape:v})}e.dataset.stateRouteGraph=JSON.stringify({direction:i.diagram.direction,nodes:i.diagram.nodes.map(({id:C,domId:k,shape:v})=>({id:C,domId:k,shape:v})),edges:i.diagram.edges.map(({id:C,start:k,end:v})=>({id:C,start:k,end:v}))});for(const C of[...a,...o])C.style.setProperty("transition-property","none","important");if(t){const C=c.get("Idle");if(!C)return;const k=C.x+C.width/2;[{name:"Starting",centerOffset:0,yOffset:138},{name:"Streaming",centerOffset:0,yOffset:258},{name:"RunningTool",centerOffset:0,yOffset:396},{name:"NeedsInput",centerOffset:0,yOffset:578},{name:"Complete",centerOffset:0,yOffset:738},{name:"Failed",centerOffset:0,yOffset:898}].forEach(({name:T,centerOffset:F,yOffset:A})=>{const M=h.get(T),B=c.get(T),$=M?.node.transform.baseVal.consolidate()?.matrix;if(!M||!B||!$)return;const P={x:k+F-B.width/2,y:C.y+A};M.node.style.setProperty("transition-property","none","important"),M.node.setAttribute("transform",`translate(${$.e+P.x-B.x}, ${$.f+P.y-B.y})`),c.set(T,{...B,...P})})}const d=[...c].flatMap(([C,k])=>C==="root_start"?[]:[k]),u=[],f=[],p=[];n.forEach(({edge:C,path:k,label:v,kind:T})=>{v.dataset.routePathId=k.id,k.dataset.routeLabel=T;const F=c.get(C.start),A=c.get(C.end);if(!F||!A)return;const M=vr(J3(T,F,A,d,t)),B=M[1]?gu(k,M[0],M[1]):1,$=f3(M,d.filter(L=>L!==F&&L!==A),fu/B,f);p.push(...$);const P=v.getBBox(),I=T===Me.agentFinishes?$.slice(1,3):$,_=t$(I,P,u,k)??I.slice(0,-1).map((L,q)=>{const W=I[q+1];return{segment:{start:L,end:W},capacity:Math.hypot(W.x-L.x,W.y-L.y)}}).sort((L,q)=>q.capacity-L.capacity)[0];if(!_)return;k.setAttribute("d",$.map((L,q)=>`${q?"L":"M"}${L.x},${L.y}`).join(""));const E=T===Me.toolStarts&&$[1]&&$[2]?{start:$[1],end:$[2]}:T===Me.agentAsksUser&&$[1]&&$[2]?{start:$[1],end:$[2]}:T===Me.agentFinishes&&$[1]&&$[2]?{start:$[1],end:$[2]}:!t&&T===Me.userReplies&&$[1]&&$[2]?{start:$[1],end:$[2]}:T===Me.requestFails&&$[1]&&$[2]?{start:$[1],end:$[2]}:t&&T===Me.userRetries&&$[2]&&$[3]?{start:$[2],end:$[3]}:_.segment;k.dataset.routeLabel=T,k.dataset.labelSegment=`${E.start.x},${E.start.y} ${E.end.x},${E.end.y}`,k.dataset.labelCapacity=String(Math.hypot(E.end.x-E.start.x,E.end.y-E.start.y)),k.dataset.manhattanSegments=String($.length-1),k.dataset.manhattanPoints=$.map(L=>`${L.x},${L.y}`).join(" "),k.dataset.terminalTarget=h.get(C.end)?.node.id??C.end,v.dataset.routePathId=k.id,u.push(E),f.push(...ar($))});const g=Math.min(...d.map(C=>C.x),...p.map(C=>C.x)),m=Math.min(2,...d.map(C=>C.y),...p.map(C=>C.y)),y=Math.max(...d.map(C=>C.x+C.width),...p.map(C=>C.x)),x=Math.max(...d.map(C=>C.y+C.height),...p.map(C=>C.y));return{x:g,y:m,width:y-g,height:x-m}}function i$(e,t,r,i,a=8){if(e.length<2)return e;const o=i.map(({start:f,end:p})=>({x:Math.min(f.x,p.x),y:Math.min(f.y,p.y),width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)})),s=f=>ar(f).every(p=>!Sr(p,t)&&[...r,...o].every(g=>!Sr(p,g,a)));if(s(e))return e;const n=e[0],l=ko(n,e[1]),c={...n},h=a*2;l==="top"&&(c.y-=h),l==="bottom"&&(c.y+=h),l==="left"&&(c.x-=h),l==="right"&&(c.x+=h);const d=[{point:Lt(t,.5,0),dx:0,dy:-h},{point:Lt(t,1,.5),dx:h,dy:0},{point:Lt(t,.5,1),dx:0,dy:h},{point:Lt(t,0,.5),dx:-h,dy:0}].flatMap(({point:f,dx:p,dy:g})=>{const m={x:f.x+p,y:f.y+g};return[[n,c,{x:c.x,y:m.y},m,f],[n,c,{x:m.x,y:c.y},m,f]].map(vr).filter(y=>{const x=y[1],C=y.at(-2);return(x.x-n.x)*(c.x-n.x)+(x.y-n.y)*(c.y-n.y)>0&&(C.x-f.x)*p+(C.y-f.y)*g>0&&s(y)})}),u=f=>ar(f).reduce((p,{start:g,end:m})=>p+Math.hypot(m.x-g.x,m.y-g.y),0);return d.toSorted((f,p)=>u(f)-u(p))[0]??e}function a$(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=t[0];if(!r)return;const i=[...e.querySelectorAll("g.node")].flatMap(o=>{const s=Ke(o),n=s&&Qe(s,r);return s&&n?[{node:o,shape:s,bounds:n}]:[]}),a=t.flatMap(o=>{let s;try{s=o.dataset.manhattanPoints?o.dataset.manhattanPoints.split(" ").map(l=>{const[c,h]=l.split(",").map(Number);return{x:c,y:h}}):JSON.parse(atob(o.dataset.points??""))}catch{return[]}if(!Array.isArray(s)||s.length<2||s.some(l=>!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)))return[];const n=l=>i.toSorted((c,h)=>ea(l,c.bounds)-ea(l,h.bounds))[0];return[{path:o,points:s,source:n(s[0]),target:n(s.at(-1))}]});for(const o of a){const{path:s,points:n,source:l,target:c}=o;if(!l||!c||l===c||l.shape.tagName!=="circle"||c.shape.tagName!=="rect"||a.some(g=>g.target===l))continue;const h=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(g=>{if(!g.textContent?.trim())return[];const m=xr(g,s);return m?[m]:[]}),d=i$(n,c.bounds,[...i.filter(g=>g!==l&&g!==c).map(g=>g.bounds),...h],a.filter(g=>g!==o).flatMap(g=>ar(g.points)));if(d===n)continue;const u=mu(d);s.setAttribute("d",u),s.dataset.terminalGapBasePath=u,s.dataset.manhattanPoints=d.map(({x:g,y:m})=>`${g},${m}`).join(" "),s.dataset.manhattanSegments=String(d.length-1),s.dataset.terminalTarget=c.node.id;const f=d.at(-1),p=d.at(-2);s.dataset.terminalDirection=`${f.x-p.x},${f.y-p.y}`,o.points=d}}function o$(e){const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=t[0];if(!i)return;const a=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=Ke(s),l=n&&Qe(n,i);if(!n||!l)return[];const c=getComputedStyle(n);return[{...l,corner:{x:Math.min(l.width/2,Number.parseFloat(c.rx)||0),y:Math.min(l.height/2,Number.parseFloat(c.ry)||0)}}]}),o=t.flatMap(s=>{const n=(s.dataset.manhattanPoints??"").split(" ").map(c=>{const[h,d]=c.split(",").map(Number);return{x:h,y:d}});if(n.length<2||n.some(({x:c,y:h})=>!Number.isFinite(c)||!Number.isFinite(h)))return[];const l=c=>a.toSorted((h,d)=>ea(c,h)-ea(c,d))[0];return[{path:s,points:n,source:l(n[0]),target:l(n.at(-1))}]});for(const s of o){const{path:n,points:l,source:c,target:h}=s;if(!c||!h||h.y<=c.y||l[1].y>=Math.min(c.y,h.y)-Math.max(c.height,h.height))continue;const d=r.find(M=>M.dataset.routePathId===n.id),u=d&&xr(d,n);if(!d||!u)continue;const f=o.filter(M=>M!==s),p=f.flatMap(M=>ar(M.points)),g=a.filter(M=>M!==c&&M!==h),m=r.filter(M=>M!==d).flatMap(M=>{const B=xr(M,n);return B?[B]:[]}),y=M=>f.flatMap(B=>[...B.source===M?[B.points[0]]:[],...B.target===M?[B.points.at(-1)]:[]]),x=g1(l,c,h,[...g,...m],p,y(c),y(h),{bounds:u,obstacles:m,occupied:p},!1,!0);if(x===l)continue;const C=Cn(x,u,[...a,...m],p);if(!C)continue;s.points=x,n.setAttribute("d",x.map(({x:M,y:B},$)=>`${$?"L":"M"}${M},${B}`).join("")),n.dataset.manhattanPoints=x.map(({x:M,y:B})=>`${M},${B}`).join(" "),n.dataset.manhattanSegments=String(x.length-1),n.dataset.labelSegment=`${C.start.x},${C.start.y} ${C.end.x},${C.end.y}`;const k=x.at(-1),v=x.at(-2);n.dataset.terminalDirection=`${k.x-v.x},${k.y-v.y}`,delete n.dataset.terminalGapBasePath;const T=d.getBBox(),F=d.parentElement?.getCTM(),A=n.getCTM();if(F&&A){const M=new DOMPoint(C.center.x,C.center.y).matrixTransform(A).matrixTransform(F.inverse());d.setAttribute("transform",`translate(${M.x-T.x-T.width/2},${M.y-T.y-T.height/2})`),d.dataset.finalPathCenter=`${C.center.x},${C.center.y}`}}}function s$(e,t){if(e.nativeId){const i=t.flatMap((a,o)=>a.nativeId===e.nativeId?[o]:[]);if(i.length)return i.length===1?i[0]:null}if(e.routePathId){const i=t.flatMap((a,o)=>a.id===e.routePathId?[o]:[]);if(i.length)return i.length===1?i[0]:null}const r=t.flatMap((i,a)=>i.intersectsLabel?[a]:[]);return r.length===1?r[0]:null}function n$(e,t){const r=xr(t,e),i=e.getTotalLength();if(!r||!i)return!1;const a=Math.max(1,Math.min(r.width,r.height)/4),o=Math.max(16,Math.min(2048,Math.ceil(i/a)));return Array.from({length:o+1},(s,n)=>e.getPointAtLength(i*n/o)).some(s=>ea(s,r)<=.5)}function l$(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=new Set;r.forEach(a=>{if(a.textContent?.replace(/\s+/g," ").trim().toLowerCase()!=="fail")return;const o=a.querySelector(":scope > .label[data-id]")?.getAttribute("data-id"),s=s$({nativeId:o??void 0,routePathId:a.dataset.routePathId},t.map(A=>({id:A.id,nativeId:A.dataset.id,intersectsLabel:n$(A,a)}))),n=s===null?void 0:t[s];if(!n||i.has(n))return;const l=n.getTotalLength();if(!l)return;const c=n.getPointAtLength(0),h=n.getPointAtLength(l),d=[...e.querySelectorAll("g.node")].flatMap(A=>{const M=Ke(A),B=M&&Qe(M,n);return M&&B?[{node:A,shape:M,bounds:B}]:[]}),u=d.toSorted((A,M)=>ea(c,A.bounds)-ea(c,M.bounds))[0],f=d.toSorted((A,M)=>ea(h,A.bounds)-ea(h,M.bounds))[0];if(!u||!f||u===f||f.bounds.y>=u.bounds.y)return;const p=Math.max(u.bounds.x,f.bounds.x),g=Math.min(u.bounds.x+u.bounds.width,f.bounds.x+f.bounds.width);if(g<=p)return;const m=p+(g-p)*.75,y=getComputedStyle(u.shape),x=Math.min(u.bounds.width/2,Number.parseFloat(y.rx)||0),C=Math.min(u.bounds.height/2,Number.parseFloat(y.ry)||0),k=Math.max(u.bounds.x+x-m,m-(u.bounds.x+u.bounds.width-x),0),v=x>0?C*(1-Math.sqrt(Math.max(0,1-(k/x)**2))):0,T=[{x:m,y:u.bounds.y+v},{x:m,y:f.bounds.y+f.bounds.height}],F=`M${T[0].x},${T[0].y}L${T[1].x},${T[1].y}`;n.setAttribute("d",F),n.dataset.terminalGapBasePath=F,n.dataset.manhattanPoints=T.map(A=>`${A.x},${A.y}`).join(" "),n.dataset.manhattanSegments="1",n.dataset.labelSegment=`${T[0].x},${T[0].y} ${T[1].x},${T[1].y}`,n.dataset.routeLabel="fail",n.dataset.terminalTarget=f.node.id,n.dataset.terminalDirection="0,-1",a.dataset.routePathId=n.id,i.add(n)})}function c$(e,t=!1){if(!e.classList.contains("statediagram"))return null;const r=[],i=[...e.querySelectorAll("g.node")].flatMap(d=>{const u=d.transform.baseVal.consolidate()?.matrix,f=d.getBBox();return u?[{x:f.x+u.e,y:f.y+u.f,width:f.width,height:f.height}]:[]}),a=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')].map(d=>{const u=(d.dataset.manhattanPoints??"").split(" ").map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,p])=>({x:f,y:p}));return{path:d,segments:u.slice(1).map((f,p)=>({start:u[p],end:f}))}}),o=(d,u,f=4)=>d.x<u.x+u.width+f&&d.x+d.width+f>u.x&&d.y<u.y+u.height+f&&d.y+d.height+f>u.y,s=(d,u)=>{if(Math.abs(d.start.x-d.end.x)<.5){const g=Math.min(d.start.y,d.end.y),m=Math.max(d.start.y,d.end.y);return d.start.x>u.x-3&&d.start.x<u.x+u.width+3&&m>u.y-3&&g<u.y+u.height+3}const f=Math.min(d.start.x,d.end.x),p=Math.max(d.start.x,d.end.x);return d.start.y>u.y-3&&d.start.y<u.y+u.height+3&&p>u.x-3&&f<u.x+u.width+3};for(const d of e.querySelectorAll(".edgeLabels > .edgeLabel")){const u=d.dataset.routePathId,f=u?e.querySelector(`#${CSS.escape(u)}`):null,p=f?.dataset.labelSegment?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);if(!f||!p||p.length!==4)continue;const g=d.getBBox(),m=t?f.dataset.routeLabel===Me.requestFails?[.03]:[.5,.25,.75,.15,.35,.65,.85]:[.5,.25,.75],y=a.find(_=>_.path===f)?.segments??[],x=t&&f.dataset.routeLabel===Me.userRetries?y.findLast(_=>Math.abs(_.start.y-_.end.y)<.5&&Math.abs(_.start.x-_.end.x)>=g.width):void 0,C=t&&(f.dataset.routeLabel===Me.agentAsksUser||f.dataset.routeLabel===Me.toolStarts||f.dataset.routeLabel===Me.requestFails||f.dataset.routeLabel===Me.userRetries)||!t&&(f.dataset.routeLabel===Me.agentAsksUser||f.dataset.routeLabel===Me.agentFinishes||f.dataset.routeLabel===Me.toolStarts||f.dataset.routeLabel===Me.userReplies||f.dataset.routeLabel===Me.requestFails),v=[x?{x1:x.start.x,y1:x.start.y,x2:x.end.x,y2:x.end.y}:{x1:p[0],y1:p[1],x2:p[2],y2:p[3]},...C?[]:y.map(({start:_,end:E})=>({x1:_.x,y1:_.y,x2:E.x,y2:E.y}))].filter((_,E,L)=>L.findIndex(q=>q.x1===_.x1&&q.y1===_.y1&&q.x2===_.x2&&q.y2===_.y2)===E).flatMap(_=>{const E={start:{x:_.x1,y:_.y1},end:{x:_.x2,y:_.y2}},L=Math.hypot(E.end.x-E.start.x,E.end.y-E.start.y),W=(Math.abs(E.start.y-E.end.y)<.5?g.width:g.height)/2,R=h1/gu(f,E.start,E.end);return m.filter(D=>L*Math.max(D,1-D)>=W+R).map(D=>{const G={x:_.x1+(_.x2-_.x1)*D,y:_.y1+(_.y2-_.y1)*D};if(t&&Math.abs(_.x1-_.x2)<.5&&(f.dataset.routeLabel===Me.userReplies||f.dataset.routeLabel===Me.agentFinishes)&&(G.x-=g.width/2-(f.dataset.routeLabel===Me.userReplies?0:6)),t&&Math.abs(_.x1-_.x2)<.5&&f.dataset.routeLabel===Me.agentResponds&&(G.y+=6),Math.abs(_.x1-_.x2)<.5&&(t&&(f.dataset.routeLabel===Me.agentAsksUser||f.dataset.routeLabel===Me.requestFails||f.dataset.routeLabel===Me.streamFails)||!t&&f.dataset.routeLabel===Me.requestFails)){const Z=f.dataset.routeLabel===Me.agentAsksUser?0:f.dataset.routeLabel===Me.streamFails?-26:0;G.x+=g.width/2+Z}t&&Math.abs(_.y1-_.y2)<.5&&f.dataset.routeLabel===Me.userRetries&&(G.x+=12,G.y-=g.height/2-4),!t&&Math.abs(_.x1-_.x2)<.5&&f.dataset.routeLabel===Me.toolCompletes&&(G.x+=g.width/2-6);const J={x:G.x-g.width/2,y:G.y-g.height/2,width:g.width,height:g.height},at=r.filter(Z=>o(J,Z)).length,xt=i.filter(Z=>o(J,Z,5)).length,H=a.filter(Z=>Z.path!==f).flatMap(Z=>Z.segments).filter(Z=>s(Z,J)).length,Y=L*Math.min(D,1-D);return{midpoint:G,bounds:J,score:at*1e4+xt*1e4+H*1e3+(Y<W+R?100:0)+Math.abs(D-.5)}})});if(v.length===0)continue;const T=v;T.sort((_,E)=>{const L=Math.floor(_.score/1e3)-Math.floor(E.score/1e3);if(L!==0)return L;if(t&&f.dataset.routeLabel===Me.toolStarts){const q=p[1]+(p[3]-p[1])*.65;return Math.abs(_.midpoint.y-q)-Math.abs(E.midpoint.y-q)}if(t&&f.dataset.routeLabel===Me.agentAsksUser){const q=p[1]+(p[3]-p[1])*.65;return Math.abs(_.midpoint.y-q)-Math.abs(E.midpoint.y-q)}if(t&&f.dataset.routeLabel===Me.requestFails){const q=p[1]+(p[3]-p[1])*.04;return Math.abs(_.midpoint.y-q)-Math.abs(E.midpoint.y-q)}if(!t&&f.dataset.routeLabel===Me.agentAsksUser)return _.midpoint.x-E.midpoint.x;if(!t&&f.dataset.routeLabel===Me.agentFinishes){const q=(p[0]+p[2])/2;return Math.abs(_.midpoint.x-q)-Math.abs(E.midpoint.x-q)}return!t&&f.dataset.routeLabel===Me.toolStarts?E.midpoint.y-_.midpoint.y:!t&&f.dataset.routeLabel===Me.userReplies?E.midpoint.x-_.midpoint.x:_.score-E.score});const F=T[0].midpoint,A={x:F.x-g.width/2,y:F.y-g.height/2,width:g.width,height:g.height},M=f.getCTM(),B=d.parentElement?.getCTM(),$=M&&B?new DOMPoint(F.x,F.y).matrixTransform(M).matrixTransform(B.inverse()):F,P=$.x-(g.x+g.width/2),I=$.y-(g.y+g.height/2);d.setAttribute("transform",`translate(${P}, ${I})`),d.dataset.finalPathCenter=`${F.x},${F.y}`,r.push(A)}if(o$(e),!r.length)return null;const n=Math.min(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.x+d.width)),h=Math.max(...r.map(d=>d.y+d.height));return{x:n,y:l,width:c-n,height:h-l}}var h$=er('<div class="mermaid-error svelte-9cn23y"><div class="error-feedback svelte-9cn23y" role="alert"><strong class="svelte-9cn23y"> </strong> <p class="svelte-9cn23y"> </p></div> <details class="error-details svelte-9cn23y"><summary class="svelte-9cn23y"> </summary> <pre class="error-message svelte-9cn23y"> </pre> <strong class="svelte-9cn23y"> </strong> <pre class="error-source-code svelte-9cn23y"> </pre></details></div>'),d$=er('<div role="toolbar"><!> <!> <!></div>'),u$=er('<div class="mermaid-source svelte-9cn23y" role="region"><pre class="svelte-9cn23y"> </pre></div>'),f$=er('<div class="mermaid-svg-container svelte-9cn23y"><div><div class="mermaid-svg mermaid-presentation svelte-9cn23y"></div></div> <!></div> <!>',1),g$=er('<div class="mermaid-empty svelte-9cn23y" role="status"><strong class="svelte-9cn23y"> </strong> <span class="svelte-9cn23y"> </span></div>'),p$=er('<div class="mermaid-loading svelte-9cn23y" role="status"> </div>'),m$=er('<div class="fullscreen-diagram mermaid-presentation svelte-9cn23y" style="--mermaid-font-family: var(--font-ui)"></div>'),y$=er('<div class="fullscreen-surface h-[90vh] w-[90vw] overflow-hidden rounded-lg shadow-2xl svelte-9cn23y" data-media-lightbox-content=""><!></div>'),x$=er('<div style="--mermaid-font-family: var(--font-ui)"><span class="mermaid-actor-icon-template svelte-9cn23y" aria-hidden="true"><!></span> <!></div> <!>',1);function b$(e,t){if(new.target)return _a({component:b$,...e});Fa(t,!0);const r=J1("MermaidRenderer"),i=12,a=16,o=["--background","--foreground","--card","--card-foreground","--muted","--muted-foreground","--border","--accent","--accent-foreground","--diagram-canvas","--diagram-node-surface","--diagram-connector","--font-ui","--text-caption-size","--radius-small"],s={streamFails:"Stream fails"};let n=ze(t,"code",7),l=ze(t,"isStreaming",7,!1),c=ze(t,"className",7,""),h=ze(t,"showExpandButton",7,!0),d=ze(t,"showSourceButton",7,!0),u=ze(t,"showExportButton",7,!1),f=ze(t,"showSource",15,!1),p=ze(t,"onRenderStateChange",7),g=ce(""),m=ce(null),y=ce(!1),x=ce(!1),C=ce(""),k=ce(null),v=ce(void 0),T=ce(void 0),F=ce(void 0),A=ce(void 0),M,B=ce(0),$=ce(!1),P=ce(!1),I=0,_=ce(0),E=0,L=ce(0),q=Et(()=>z(D(n())));const W=tC(eC);function R(){const it=getComputedStyle(document.documentElement);return[it.fontSize,...o.map(dt=>it.getPropertyValue(dt).trim())].join("\0")}function D(it){try{return/^[A-Za-z0-9+/=]+$/.test(it.trim())?decodeURIComponent(escape(atob(it))):it}catch{return it}}function G(it){return!/^\s*stateDiagram(?:-v2)?\b/m.test(it)||/^\s*direction\s+(?:LR|RL|TB|BT)\b/m.test(it)?it:it.replace(/^(\s*stateDiagram(?:-v2)?\b[^\n]*)/m,`$1
316
- direction TB`)}function j(it){return!S($)||!S(P)||!/^\s*sequenceDiagram\b/m.test(it)?it:`---
317
- config:
318
- sequence:
319
- actorMargin: 0
320
- diagramMarginX: 0
321
- messageMargin: 24
322
- noteMargin: 4
323
- width: 96
324
- wrap: true
325
- ---
326
- ${it}`}function z(it){return it.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/")}const Q=12,et=10,rt=6;function J(it){const dt=it.transform.baseVal.consolidate()?.matrix;return dt?{x:dt.e,y:dt.f}:null}function at(it){const dt=document.createTreeWalker(it,NodeFilter.SHOW_TEXT),Ct=[];for(;dt.nextNode();){if(!dt.currentNode.textContent?.trim())continue;const At=document.createRange();At.selectNodeContents(dt.currentNode),Ct.push(...Array.from(At.getClientRects()))}if(!Ct.length)return null;const _t=Math.min(...Ct.map(At=>At.left)),wt=Math.min(...Ct.map(At=>At.top)),X=Math.max(...Ct.map(At=>At.right)),St=Math.max(...Ct.map(At=>At.bottom));return new DOMRect(_t,wt,X-_t,St-wt)}function xt(it){if(it.getAttribute("aria-roledescription")==="flowchart-v2")for(const dt of it.querySelectorAll("g.node .nodeLabel > p, g.cluster .nodeLabel > p")){if(dt.dataset.semanticBreaks==="true")continue;const Ct=dt.cloneNode(!0);Ct.querySelectorAll("br").forEach(wt=>wt.replaceWith(`
327
- `));const _t=Ct.textContent?.replace(/[^\S\n]+/g," ").trim();if(_t){dt.replaceChildren();for(const wt of ec(_t))dt.append(document.createTextNode(wt.text)),wt.hardBreak?dt.append(document.createElement("br")):wt.breakAfter&&dt.append(document.createElement("wbr"));dt.dataset.semanticBreaks="true"}}}function H(it){for(const dt of it.querySelectorAll("g.edgeLabel"))dt.textContent?.trim()||(dt.style.display="none")}function Y(it){if(it.getAttribute("aria-roledescription")==="flowchart-v2")for(const dt of it.querySelectorAll("g.node")){const Ct=dt.querySelector(":scope > .label"),_t=Ct?.querySelector("foreignObject"),wt=_t?.firstElementChild,X=dt.querySelector(":scope > .label-container, :scope > .outer-path, :scope > .basic.label-container");if(!Ct||!_t||!(wt instanceof HTMLElement)||!X)continue;const St=Number.parseFloat(_t.getAttribute("height")??"0"),At=at(Ct),Dt=Ct.getScreenCTM(),qt=Dt&&Math.hypot(Dt.c,Dt.d)||1,Ut=Math.max(wt.scrollHeight,At?At.height/qt:0);if(Ut>St+.5){const ie=Math.ceil(Ut+1);_t.setAttribute("height",String(ie));const Pe=J(Ct);if(Pe&&Ct.setAttribute("transform",`translate(${Pe.x}, ${-ie/2})`),X instanceof SVGRectElement){const ke=Math.max(0,(Number(X.getAttribute("height"))-St)/2);X.setAttribute("y",String(-ie/2-ke)),X.setAttribute("height",String(ie+ke*2))}}const de=X.getBoundingClientRect(),Se=at(Ct),Rt=J(Ct),Ae=Ct.getScreenCTM();if(!Se||!Rt||!Ae)continue;const Ue=Math.hypot(Ae.a,Ae.b)||1,_e=Math.hypot(Ae.c,Ae.d)||1,ne=Se.x+Se.width/2-(de.x+de.width/2),Ft=Se.y+Se.height/2-(de.y+de.height/2);Ct.setAttribute("transform",`translate(${Rt.x-ne/Ue}, ${Rt.y-Ft/_e})`)}}function Z(it){if(it.classList.contains("statediagram"))for(const dt of it.querySelectorAll("g.statediagram-state")){const Ct=dt.querySelector(":scope > rect.basic.label-container"),_t=dt.querySelector(":scope > g.label");if(!Ct||!_t||!dt.textContent?.trim())continue;const wt=Ct.getBoundingClientRect(),X=at(_t),St=J(_t),At=_t.getScreenCTM();if(!X||!St||!At)continue;const Dt=Math.hypot(At.a,At.b)||1,qt=X.x+X.width/2-(wt.x+wt.width/2);_t.setAttribute("transform",`translate(${St.x-qt/Dt}, ${St.y})`)}}function tt(it){for(const dt of it.querySelectorAll("foreignObject:has(span.edgeLabel)")){if(dt.dataset.labelPadded==="true")continue;const Ct=dt.x.baseVal.value,_t=dt.y.baseVal.value,wt=dt.width.baseVal.value,X=dt.height.baseVal.value,St=dt.querySelector("span.edgeLabel");if(!St?.textContent?.trim())continue;const At=St?.textContent?.trim()===s.streamFails;At&&St&&(St.style.display="inline-block",St.style.width="40px",St.style.whiteSpace="normal");const Dt=At?52:wt+12;dt.setAttribute("x",String(Ct+wt/2-Dt/2)),dt.setAttribute("y",String(_t-4)),dt.setAttribute("width",String(Dt)),dt.setAttribute("height",String(At?Math.max(44,X+8):X+8)),dt.classList.add("edge-label-surface"),dt.dataset.labelPaddingX="6",dt.dataset.labelPaddingY="4",dt.dataset.labelPadded="true"}for(const dt of it.querySelectorAll(".edgeLabel rect.background:not([data-label-padded])")){const Ct=Number(dt.getAttribute("x")),_t=Number(dt.getAttribute("y")),wt=Number(dt.getAttribute("width")),X=Number(dt.getAttribute("height"));[Ct,_t,wt,X].every(Number.isFinite)&&(dt.setAttribute("x",String(Ct-6)),dt.setAttribute("y",String(_t-5)),dt.setAttribute("width",String(wt+12)),dt.setAttribute("height",String(X+10)),dt.setAttribute("rx","2"),dt.dataset.labelPaddingX="6",dt.dataset.labelPaddingY="5",dt.dataset.labelPadded="true")}}function st(it){const dt=[...it.querySelectorAll(".edgeLabel rect.background[data-label-padded], .edge-label-knockout")];if(dt.length===0)return;const Ct=dt.map(X=>[X.getAttribute("x"),X.getAttribute("y"),X.getAttribute("width"),X.getAttribute("height"),X.dataset.labelPaddingX??"6",X.dataset.labelPaddingY??"4"].join(",")).join(";"),_t=it.querySelector(":scope > defs.edge-label-feather-defs");if(_t?.dataset.signature===Ct&&dt.every(X=>X.hasAttribute("mask")))return;_t?.remove();const wt=document.createElementNS("http://www.w3.org/2000/svg","defs");wt.classList.add("edge-label-feather-defs"),wt.dataset.signature=Ct,it.prepend(wt),dt.forEach((X,St)=>{const At=Number(X.getAttribute("width")),Dt=Number(X.getAttribute("height")),qt=Number(X.dataset.labelPaddingX??6),Ut=Number(X.dataset.labelPaddingY??4);if(!Number.isFinite(At)||!Number.isFinite(Dt)||At<=0||Dt<=0)return;const de=`${it.id||"mermaid"}-edge-label-feather-${St}`,Se=`${de}-blur`,Rt=`${de}-mask`,Ae=Number(X.getAttribute("x")??0),Ue=Number(X.getAttribute("y")??0),_e=document.createElementNS("http://www.w3.org/2000/svg","filter");_e.id=Se,_e.setAttribute("filterUnits","userSpaceOnUse"),_e.setAttribute("x",String(Ae)),_e.setAttribute("y",String(Ue)),_e.setAttribute("width",String(At)),_e.setAttribute("height",String(Dt));const ne=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur");ne.setAttribute("stdDeviation",`${qt/6} ${Ut/6}`),_e.append(ne),wt.append(_e);const Ft=document.createElementNS("http://www.w3.org/2000/svg","mask");Ft.id=Rt,Ft.setAttribute("maskContentUnits","userSpaceOnUse"),Ft.setAttribute("maskUnits","userSpaceOnUse"),Ft.setAttribute("mask-type","alpha"),Ft.setAttribute("x",String(Ae)),Ft.setAttribute("y",String(Ue)),Ft.setAttribute("width",String(At)),Ft.setAttribute("height",String(Dt));const ie=document.createElementNS("http://www.w3.org/2000/svg","rect");ie.setAttribute("x",String(Ae+qt/2)),ie.setAttribute("y",String(Ue+Ut/2)),ie.setAttribute("width",String(Math.max(0,At-qt))),ie.setAttribute("height",String(Math.max(0,Dt-Ut))),ie.setAttribute("fill","hsl(var(--foreground))"),ie.setAttribute("filter",`url(#${Se})`),Ft.append(ie),wt.append(Ft),X.setAttribute("mask",`url(#${Rt})`),X.dataset.labelFeathered="true"})}function It(it){const Ct=document.createElement("canvas").getContext("2d");if(Ct)for(const _t of it.querySelectorAll("span.edgeLabel")){const wt=_t.querySelector("p");if(!wt)continue;const X=getComputedStyle(wt);Ct.font=X.font;const St=wt.innerText.split(`
328
- `).filter(Ae=>Ae.length>0);if(St.length===0)continue;const At=Ct.measureText(St[0]),Dt=Ct.measureText(St.at(-1)),qt=At.fontBoundingBoxAscent||At.actualBoundingBoxAscent,Ut=Dt.fontBoundingBoxDescent||Dt.actualBoundingBoxDescent,de=qt-At.actualBoundingBoxAscent,Se=Ut-Dt.actualBoundingBoxDescent,Rt=(Se-de)/2;wt.style.transform=`translateY(${Rt}px)`,_t.dataset.opticalTopGap=String(3+de+Rt),_t.dataset.opticalBottomGap=String(3+Se-Rt)}}function zt(it){for(const dt of it.querySelectorAll("g.edgeLabel[data-route-path-id]")){const Ct=dt.dataset.finalPathCenter?.split(",").map(Number),wt=(dt.dataset.routePathId?it.querySelector(`#${CSS.escape(dt.dataset.routePathId)}`):null)?.getCTM(),X=dt.parentElement?.getCTM();if(!Ct||Ct.length!==2||!wt||!X)continue;const St=new DOMPoint(Ct[0],Ct[1]).matrixTransform(wt).matrixTransform(X.inverse()),At=dt.getBBox();dt.setAttribute("transform",`translate(${St.x-(At.x+At.width/2)}, ${St.y-(At.y+At.height/2)})`)}}function Wt(it){for(const dt of it.querySelectorAll("g.cluster")){const Ct=dt.querySelector(":scope > rect"),_t=dt.querySelector(":scope > g.cluster-label"),wt=_t?.querySelector("foreignObject");if(!Ct||!_t||!wt)continue;const X=Number(Ct.getAttribute("x")),St=Number(Ct.getAttribute("y")),At=Number(Ct.getAttribute("width")),Dt=Number(Ct.getAttribute("height"));if(![X,St,At,Dt].every(Number.isFinite))continue;wt.setAttribute("x","0"),wt.setAttribute("y","0"),wt.setAttribute("width",String(Math.max(24,At-40)));const qt=wt.querySelector("div"),Ut=Math.ceil(Math.max(qt?.getBoundingClientRect().height??0,qt?.scrollHeight??0,18)),de=sn(Ut),Se=Number(dt.dataset.headerHeight)||de,Rt=Math.max(0,de-Se),Ae=St-Rt;wt.setAttribute("height",String(Ut)),Ct.setAttribute("y",String(Ae)),Ct.setAttribute("height",String(Dt+Rt)),dt.dataset.headerHeight=String(Math.max(Se,de)),_t.setAttribute("transform",`translate(${X+20}, ${Ae+20})`)}}function Zt(it){if(it.getAttribute("aria-roledescription")!=="sequence")return;const dt=S(F)?.querySelector("svg");if(dt)for(const Ct of it.querySelectorAll("g.actor-man")){const _t=Ct.querySelector(":scope > circle"),wt=Ct.querySelector(":scope > text.actor-man");if(!_t||!wt)continue;const X=Number(_t.getAttribute("cx")),St=Number(_t.getAttribute("cy"))-10,At=wt.getBBox().height;Ct.querySelectorAll(":scope > line, :scope > circle").forEach(qt=>qt.remove());const Dt=dt.cloneNode(!0);Dt.classList.add("mermaid-actor-user-icon"),Dt.setAttribute("x",String(X-15)),Dt.setAttribute("y",String(St+1)),Dt.setAttribute("width","30"),Dt.setAttribute("height","30"),Dt.setAttribute("aria-hidden","true"),Dt.setAttribute("focusable","false"),Dt.removeAttribute("role"),wt.setAttribute("y",String(St+37+At/2)),Ct.insertBefore(Dt,wt)}}function $t(it){const dt=it.toLowerCase();return/invalid|fail|error|denied|reject|unavailable/.test(dt)?"failure":/valid|success|accepted|ready|available|complete/.test(dt)?"success":"neutral"}function Nt(it,dt,Ct){const _t=it.replace(/^\[|\]$/g,"").trim().split(/\s+/),wt=document.createElement("canvas").getContext("2d");if(!wt||_t.length===0)return[it];const X=getComputedStyle(Ct);wt.font=`${X.fontWeight} ${X.fontSize} ${X.fontFamily}`;const St=[];for(const At of _t){const Dt=St.length?`${St.at(-1)} ${At}`:At;St.length&&wt.measureText(Dt).width>dt?St.push(At):St.length?St[St.length-1]=Dt:St.push(At)}return St}function Be(it,dt,Ct){const _t=it.trim().split(/\s+/),wt=document.createElement("canvas").getContext("2d");if(!wt||_t.length===0)return[it];const X=getComputedStyle(Ct);wt.font=`${X.fontWeight} ${X.fontSize} ${X.fontFamily}`;const St=[];for(const At of _t){const Dt=St.length?`${St.at(-1)} ${At}`:At;St.length&&wt.measureText(Dt).width>dt?St.push(At):St.length?St[St.length-1]=Dt:St.push(At)}return St}function Ot(it,dt,Ct){for(const wt of it.querySelectorAll("line"))for(const X of["y1","y2"]){const St=Number(wt.getAttribute(X));Number.isFinite(St)&&St>=dt&&wt.setAttribute(X,String(St+Ct))}for(const wt of it.querySelectorAll("text")){if(wt.closest("g.actor-man"))continue;const X=Number(wt.getAttribute("y"));Number.isFinite(X)&&X>=dt&&wt.setAttribute("y",String(X+Ct))}for(const wt of it.querySelectorAll("rect")){const X=Number(wt.getAttribute("y")),St=Number(wt.getAttribute("height"));[X,St].every(Number.isFinite)&&(X>=dt?wt.setAttribute("y",String(X+Ct)):X+St>=dt&&wt.setAttribute("height",String(St+Ct)))}const _t=it.getScreenCTM();for(const wt of it.querySelectorAll("g.actor-man")){const X=wt.getScreenCTM(),St=wt.parentElement?.getScreenCTM();if(!_t||!X||!St)continue;const At=wt.getBBox();if(new DOMPoint(At.x,At.y).matrixTransform(X).matrixTransform(_t.inverse()).y<dt)continue;const qt=St.inverse().multiply(_t),Ut=it.createSVGTransform();Ut.setTranslate(qt.c*Ct,qt.d*Ct),wt.transform.baseVal.insertItemBefore(Ut,0)}for(const wt of it.querySelectorAll("path, polygon, polyline")){if(wt.ownerSVGElement!==it||wt.closest("defs, marker"))continue;const X=wt.transform.baseVal.consolidate()?.matrix;if(wt.getBBox().y+(X?.f??0)<dt)continue;const At=it.createSVGTransform();At.setTranslate(0,Ct),wt.transform.baseVal.insertItemBefore(At,0)}}function ue(it,dt){const Ct=[...it.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")].filter(_t=>_t.y1.baseVal.value===_t.y2.baseVal.value);if(Ct.length!==0)for(const _t of dt){const wt=_t.y.baseVal.value,X=Ct.filter(qt=>qt.y1.baseVal.value<wt).sort((qt,Ut)=>Ut.y1.baseVal.value-qt.y1.baseVal.value)[0];if(!X)continue;const St=Number.parseFloat(getComputedStyle(X).strokeWidth)||0;let At=St/2;for(const qt of["marker-start","marker-end"]){const Ut=X.getAttribute(qt)?.match(/#([^)'"\s]+)/)?.[1],de=Ut?it.querySelector(`marker[id="${CSS.escape(Ut)}"]`):null;if(!de)continue;const Se=de.viewBox.baseVal.height||de.markerHeight.baseVal.value,Rt=de.markerHeight.baseVal.value/Se,Ae=de.markerUnits.baseVal===SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH?St:1,Ue=de.refY.baseVal.value-de.viewBox.baseVal.y;At=Math.max(At,Math.max(Ue,Se-Ue)*Rt*Ae)}const Dt=X.y1.baseVal.value+At+i-wt;Dt>0&&Ot(it,wt,Dt)}}function $e(it,dt){const Ct=[];let _t=[];for(const wt of it.children){if(wt.matches("text.messageText")&&_t.push(wt),wt.matches("path.messageLine0, path.messageLine1")){_t=[];continue}wt.matches("line.messageLine0, line.messageLine1")&&(Ct.push({labels:_t,line:wt}),_t=[])}for(const wt of Ct){if(wt.labels.length===0)continue;const X=Number(wt.line.getAttribute("x1")),St=Number(wt.line.getAttribute("x2")),At=dt.reduce((ne,Ft)=>Math.abs(Ft-X)<Math.abs(ne-X)?Ft:ne),Dt=dt.reduce((ne,Ft)=>Math.abs(Ft-St)<Math.abs(ne-St)?Ft:ne),qt=(At+Dt)/2,Ut=Math.abs(Dt-At)-i*2,de=wt.labels.map(ne=>ne.textContent?.trim()).join(" "),Se=Be(de,Ut,wt.labels[0]),Rt=(Se.length-wt.labels.length)*a,Ae=Number(wt.line.getAttribute("y1"));Rt>0&&Number.isFinite(Ae)&&Ot(it,Ae,Rt);const Ue=wt.labels[0],_e=Number(Ue.getAttribute("y"));for(const ne of wt.labels.slice(1))ne.remove();Se.forEach((ne,Ft)=>{const ie=Ft===0?Ue:Ue.cloneNode(!1);ie.textContent=ne,ie.setAttribute("x",String(qt)),ie.setAttribute("y",String(_e+Ft*a)),ie.setAttribute("text-anchor","middle"),Ft>0&&wt.line.before(ie)})}}async function Ce(it,dt){if(it.getAttribute("aria-roledescription")!=="sequence")return;const Ct={x:it.viewBox.baseVal.x,y:it.viewBox.baseVal.y,width:it.viewBox.baseVal.width,height:it.viewBox.baseVal.height},_t=it.getBBox(),wt=Ct.y+Ct.height-(_t.y+_t.height),X=[...it.querySelectorAll(".actor-line")].map(Ft=>Number(Ft.getAttribute("x1")));$e(it,X);for(const Ft of it.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")){const ie=Number(Ft.getAttribute("x1")),Pe=Number(Ft.getAttribute("x2")),ke=Number(Ft.getAttribute("y1")),Ie=Number(Ft.getAttribute("y2")),Ve=Math.sign(Pe-ie);if(![ie,Pe,ke,Ie].every(Number.isFinite)||ke!==Ie||Ve===0)continue;const Oe=X.reduce((ve,me)=>Math.abs(me-Pe)<Math.abs(ve-Pe)?me:ve);Math.abs(Oe-Pe)>12||Ft.setAttribute("x2",String(Oe-Ve*5))}for(const Ft of it.querySelectorAll(":scope > g")){const ie=[...Ft.querySelectorAll(":scope > line.loopLine")],Pe=Ft.querySelector(":scope > text.labelText");if(ie.length<4||!Pe)continue;const ke=Pe.textContent?.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-")||"group";Ft.classList.add("sequence-construct",`sequence-construct-${ke}`),Pe.classList.add("sequence-construct-label-text"),Ft.querySelector(":scope > .labelBox")?.classList.add("sequence-construct-label");const Ie=ie.flatMap(fr=>[Number(fr.getAttribute("x1")),Number(fr.getAttribute("x2"))]),Ve=ie.flatMap(fr=>[Number(fr.getAttribute("y1")),Number(fr.getAttribute("y2"))]),Oe=Math.min(...Ie),ve=Math.max(...Ie),me=Math.min(...Ve),je=Math.max(...Ve);if(![Oe,ve,me,je].every(Number.isFinite))continue;const Jt=[];for(const fr of ie){const bi=Number(fr.getAttribute("x1")),ni=Number(fr.getAttribute("x2")),di=Number(fr.getAttribute("y1")),Qr=Number(fr.getAttribute("y2")),Mo=bi===ni&&(bi===Oe||bi===ve)||di===Qr&&(di===me||di===je);fr.classList.add(Mo?"sequence-frame-line":"sequence-branch-divider"),!Mo&&di===Qr&&Jt.push(di)}const ir=[...Ft.querySelectorAll(":scope > text.loopText, :scope > text.sectionTitle")],mr=Ft.querySelector(":scope > .sequence-construct-label")?.getBBox(),sr=Math.max(Oe+12,(mr?.x??Oe)+(mr?.width??42)+12),xi=[me,...Jt.sort((fr,bi)=>fr-bi),je],zi=xi.slice(0,-1).map(()=>[]);ir.forEach(fr=>{fr.classList.add("sequence-branch-condition"),fr.setAttribute("x",String(sr)),fr.setAttribute("text-anchor","start");const bi=Number(fr.getAttribute("y")),ni=Math.max(0,Math.min(zi.length-1,xi.findIndex((di,Qr)=>Qr>0&&bi<di)-1));zi[ni].push(fr)}),zi.forEach((fr,bi)=>{if(fr.length===0)return;const ni=fr.map(Fi=>Fi.textContent??"").join(" ").replace(/-\s+/g,"").replace(/\[\s+/g,"[").replace(/\s+\]/g,"]").replace(/\]\s+\[/g," "),di=$t(ni),Qr=fr[0];for(const Fi of fr)Fi.previousElementSibling?.classList.contains("edge-label-knockout")&&Fi.previousElementSibling.remove(),Fi!==Qr&&Fi.remove();Qr.replaceChildren();const Mo=Nt(ni,Math.max(48,ve-sr-12),Qr);Qr.setAttribute("aria-label",ni.replace(/^\[|\]$/g,"").trim()),Qr.dataset.sequenceBranch=di;for(const[Fi,ic]of Mo.entries()){const To=document.createElementNS("http://www.w3.org/2000/svg","tspan");To.setAttribute("x",String(sr)),To.setAttribute("dy",Fi===0?"0":"1.15em"),To.textContent=ic,Qr.append(To)}l1(Ft,Qr,Qr.getBBox());const Hi=xi[bi],Qa=xi[bi+1],Yi=document.createElementNS("http://www.w3.org/2000/svg","rect");Yi.classList.add("sequence-branch-surface"),Yi.setAttribute("x",String(Oe+4)),Yi.setAttribute("y",String(Hi+4)),Yi.setAttribute("width",String(Math.max(0,ve-Oe-8))),Yi.setAttribute("height",String(Math.max(0,Qa-Hi-8))),Yi.setAttribute("rx","6"),Yi.dataset.sequenceBranch="neutral";const Ai=document.createElementNS("http://www.w3.org/2000/svg","line");Ai.classList.add("sequence-branch-cue",`sequence-branch-${di}`),Ai.setAttribute("x1",String(Oe+8)),Ai.setAttribute("x2",String(Oe+8)),Ai.setAttribute("y1",String(Hi+12)),Ai.setAttribute("y2",String(Qa-10)),Ai.dataset.sequenceBranch=di,Ft.insertBefore(Ai,Ft.firstElementChild),Ft.insertBefore(Yi,Ft.firstElementChild)})}const St=[...it.querySelectorAll(":scope > .sequence-construct")];St.sort((Ft,ie)=>{const Pe=Ft.getBBox(),ke=ie.getBBox();return ke.width*ke.height-Pe.width*Pe.height});const At=[...it.children].filter(Ft=>Ft.matches("rect.rect")||Ft.matches("g")&&Ft.querySelector(":scope > rect.rect"));it.prepend(...At,...St);const Dt=Ft=>Ft.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim(),qt=(Ft,ie)=>{const Pe=[];let ke=0;for(const Ie of ie){const Ve=Dt(Ie);let Oe="";for(;ke<Ft.length&&Dt(Oe)!==Ve;){const ve=[Oe,Ft[ke]].filter(Boolean).join(" ");if(!Ve.startsWith(Dt(ve)))return Ft;Oe=ve,ke+=1}if(Dt(Oe)!==Ve)return Ft;Pe.push(Oe)}return ke===Ft.length?Pe:Ft},Ut=dt.split(`
329
- `).map(Ft=>/^\s*note\s+(?:left of|right of|over)\s+[^:]+:\s*(.*)$/i.exec(Ft)?.[1]).filter(Ft=>Ft!==void 0).map(Ft=>Ft.split(/<br\s*\/?>/i)),Se=[...it.querySelectorAll(":scope > g")].flatMap(Ft=>{const ie=Ft.querySelector(":scope > rect.note"),Pe=[...Ft.querySelectorAll(":scope > text.noteText")];return ie&&Pe.length?[{group:Ft,note:ie,lines:Pe}]:[]}).map(({group:Ft,note:ie,lines:Pe},ke)=>{const Ie=Pe.map(me=>me.textContent?.trim()).filter(Boolean),Ve=Ut[ke]??[],Oe=Ve.length>1?qt(Ie,Ve):[Ie.join(" ")];Oe.forEach((me,je)=>{const Jt=Pe[je],ir=Jt.querySelector("tspan")?.getAttribute("x")??Jt.getAttribute("x"),mr=document.createElementNS("http://www.w3.org/2000/svg","tspan");ir&&mr.setAttribute("x",ir),mr.textContent=me,Jt.replaceChildren(mr)}),Pe.slice(Oe.length).forEach(me=>me.remove());const ve=Pe.slice(0,Oe.length);return{group:Ft,note:ie,texts:ve}});for(const{group:Ft,texts:ie}of Se){Ft.classList.add("sequence-note");for(const Pe of ie)Pe.style.setProperty("transition-property","none","important"),Pe.classList.add("sequence-note-text")}Se.length&&await Promise.all(Se.flatMap(({texts:Ft})=>Ft.map(t3)));for(const{note:Ft,texts:ie}of Se){const Pe=ie.map(sr=>sr.getBBox()),ke=Math.min(...Pe.map(sr=>sr.x)),Ie=Math.min(...Pe.map(sr=>sr.y)),Ve=Math.max(...Pe.map(sr=>sr.x+sr.width)),Oe=Math.max(...Pe.map(sr=>sr.y+sr.height)),ve=document.createElement("canvas").getContext("2d"),je=Math.max(...ie.map((sr,xi)=>{const zi=getComputedStyle(sr);return ve&&(ve.font=`${zi.fontWeight} ${zi.fontSize} ${zi.fontFamily}`),ve?.measureText(sr.textContent??"").width??Pe[xi].width}))+20,Jt=Math.max(28,Oe-Ie+12),ir=Number(ie[0].getAttribute("x")),mr=Number.isFinite(ir)?ir:(ke+Ve)/2;Ft.style.setProperty("transition-property","none","important"),Ft.setAttribute("x",String(mr-je/2)),Ft.setAttribute("y",String(Ie-6)),Ft.setAttribute("width",String(je)),Ft.setAttribute("height",String(Jt)),Ft.setAttribute("rx","6")}ue(it,Se.map(({note:Ft})=>Ft));const Rt=it.getBBox(),Ae=Math.min(Ct.x,Math.floor(Rt.x)),_e=Math.max(Ct.x+Ct.width,Math.ceil(Rt.x+Rt.width))-Ae,ne=Math.ceil(Rt.y+Rt.height+wt-Ct.y);(_e>Ct.width||ne>Ct.height)&&(it.setAttribute("viewBox",`${Ae} ${Ct.y} ${_e} ${Math.max(Ct.height,ne)}`),it.setAttribute("width",String(_e)),it.setAttribute("height",String(Math.max(Ct.height,ne))))}function we(it){if(!it)return null;const dt=Array.from(it.children).filter(X=>X instanceof SVGGElement&&X.classList.contains("label")&&!!X.textContent?.trim());if(!dt.length)return it.style.display="none",null;it.style.removeProperty("display");let Ct=0,_t=Number.POSITIVE_INFINITY,wt=Number.NEGATIVE_INFINITY;for(const[X,St]of dt.entries()){const At=St.getBBox();St.setAttribute("transform",`translate(0, ${Ct-At.y})`),_t=Math.min(_t,At.x),wt=Math.max(wt,At.x+At.width),Ct+=At.height,X<dt.length-1&&(Ct+=rt)}return{element:it,bounds:new DOMRect(_t,0,wt-_t,Ct)}}function Mt(it){if(!it.classList.contains("classDiagram"))return null;const dt=Array.from(it.querySelectorAll("g.node")).flatMap(qt=>{const Ut=qt.querySelector(".outer-path"),de=J(qt);if(!Ut||!de)return[];const Se=Ut.getBBox();qt.querySelectorAll(":scope > .divider").forEach(Jt=>Jt.remove()),qt.querySelector(":scope > .class-box-outline")?.remove();const Rt=we(qt.querySelector(":scope > .annotation-group")),Ae=we(qt.querySelector(":scope > .label-group")),Ue=we(qt.querySelector(":scope > .members-group")),_e=we(qt.querySelector(":scope > .methods-group")),ne=[Rt,Ae].filter(Jt=>Jt!==null),Ft=[{groups:ne,centered:!0},...Ue?[{groups:[Ue],centered:!1}]:[],..._e?[{groups:[_e],centered:!1}]:[]];if(!ne.length)return[];const ie=Ft.map(({groups:Jt})=>Jt.reduce((ir,mr,sr)=>ir+mr.bounds.height+(sr?rt:0),0)),Pe=Math.max(...Ft.flatMap(({groups:Jt})=>Jt.map(ir=>ir.bounds.width))),ke=Math.max(Se.width,Pe+Q*2),Ie=-ke/2,Ve=-(ie[0]+et*2)/2;let Oe=Ve+et;const ve=[];for(const[Jt,ir]of Ft.entries()){for(const[mr,sr]of ir.groups.entries()){mr&&(Oe+=rt);const xi=ir.centered?-sr.bounds.width/2-sr.bounds.x:Ie+Q-sr.bounds.x;sr.element.setAttribute("transform",`translate(${xi}, ${Oe-sr.bounds.y})`),Oe+=sr.bounds.height}if(Oe+=et,Jt<Ft.length-1){const mr=document.createElementNS("http://www.w3.org/2000/svg","line");mr.classList.add("class-box-divider"),mr.setAttribute("x1",String(Ie)),mr.setAttribute("x2",String(Ie+ke)),mr.setAttribute("y1",String(Oe)),mr.setAttribute("y2",String(Oe)),ve.push(mr),Oe+=et}}const me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("class-box-outline"),me.setAttribute("x",String(Ie)),me.setAttribute("y",String(Ve)),me.setAttribute("width",String(ke)),me.setAttribute("height",String(Oe-Ve)),qt.insertBefore(me,Ut),Ut.style.display="none";const je=qt.querySelector(":scope > .annotation-group, :scope > .label-group, :scope > .members-group, :scope > .methods-group");for(const Jt of ve)qt.insertBefore(Jt,je);return[{element:qt,name:Ae.element.textContent?.trim()??"",...de,box:me.getBBox(),originalBox:Se,deltaX:0,deltaY:0}]}),Ct=()=>{const qt=Math.min(...dt.map(Rt=>Rt.x+Rt.deltaX+Rt.box.x)),Ut=Math.min(...dt.map(Rt=>Rt.y+Rt.deltaY+Rt.box.y)),de=Math.max(...dt.map(Rt=>Rt.x+Rt.deltaX+Rt.box.x+Rt.box.width)),Se=Math.max(...dt.map(Rt=>Rt.y+Rt.deltaY+Rt.box.y+Rt.box.height));return new DOMRect(qt,Ut,de-qt,Se-Ut)};if(dt.length<2)return dt.length?Ct():null;const _t=Math.max(...dt.map(qt=>qt.x))-Math.min(...dt.map(qt=>qt.x)),X=Math.max(...dt.map(qt=>qt.y))-Math.min(...dt.map(qt=>qt.y))>=_t,St=qt=>X?qt.y:qt.x,At=[];for(const qt of dt.toSorted((Ut,de)=>St(Ut)-St(de))){const Ut=At.at(-1);Ut&&Math.abs(St(Ut[0])-St(qt))<1?Ut.push(qt):At.push([qt])}let Dt=Number.NEGATIVE_INFINITY;for(const qt of At){const Ut=Math.min(...qt.map(Rt=>St(Rt)+(X?Rt.box.y:Rt.box.x))),de=Math.max(...qt.map(Rt=>St(Rt)+(X?Rt.box.y+Rt.box.height:Rt.box.x+Rt.box.width))),Se=Number.isFinite(Dt)?Math.max(0,Dt+24-Ut):0;for(const Rt of qt)X?Rt.deltaY=Se:Rt.deltaX=Se,Rt.element.setAttribute("transform",`translate(${Rt.x+Rt.deltaX}, ${Rt.y+Rt.deltaY})`);Dt=de+Se}for(const qt of it.querySelectorAll('.edgePaths path[data-edge="true"]')){const Ut=qt.getTotalLength();if(!Ut)continue;const de=qt.getPointAtLength(0),Se=qt.getPointAtLength(Ut),Rt=ke=>dt.toSorted((Ie,Ve)=>{const Oe=ve=>{const{originalBox:me}=ve,je=Math.max(ve.x+me.x-ke.x,0,ke.x-ve.x-me.x-me.width),Jt=Math.max(ve.y+me.y-ke.y,0,ke.y-ve.y-me.y-me.height);return Math.hypot(je,Jt)};return Oe(Ie)-Oe(Ve)})[0],Ae=qt.dataset.id??"",Ue=dt.flatMap(ke=>dt.filter(Ie=>Ie!==ke).map(Ie=>({source:ke,target:Ie}))).find(({source:ke,target:Ie})=>Ae.startsWith(`id_${ke.name}_${Ie.name}_`)),_e=Ue?.source??Rt(de),ne=Ue?.target??Rt(Se);if(!_e||!ne||_e===ne)continue;const Ft={x:_e.x+_e.deltaX+_e.box.x+_e.box.width/2,y:_e.y+_e.deltaY+_e.box.y+_e.box.height/2},ie={x:ne.x+ne.deltaX+ne.box.x+ne.box.width/2,y:ne.y+ne.deltaY+ne.box.y+ne.box.height/2};if(Math.abs(ie.x-Ft.x)>Math.abs(ie.y-Ft.y)){const ke=Math.sign(ie.x-Ft.x)||1,Ie=_e.x+_e.deltaX+(ke>0?_e.box.x+_e.box.width:_e.box.x),Ve=ne.x+ne.deltaX+(ke>0?ne.box.x:ne.box.x+ne.box.width),Oe=(Ie+Ve)/2,ve=[{x:Ie,y:Ft.y},{x:Oe,y:Ft.y},{x:Oe,y:ie.y},{x:Ve,y:ie.y}];qt.setAttribute("d",ve.map((me,je)=>`${je?"L":"M"}${me.x},${me.y}`).join("")),qt.dataset.manhattanPoints=ve.map(me=>`${me.x},${me.y}`).join(" ")}else{const ke=Math.sign(ie.y-Ft.y)||1,Ie=_e.y+_e.deltaY+(ke>0?_e.box.y+_e.box.height:_e.box.y),Ve=ne.y+ne.deltaY+(ke>0?ne.box.y:ne.box.y+ne.box.height),Oe=(Ie+Ve)/2,ve=[{x:Ft.x,y:Ie},{x:Ft.x,y:Oe},{x:ie.x,y:Oe},{x:ie.x,y:Ve}];qt.setAttribute("d",ve.map((me,je)=>`${je?"L":"M"}${me.x},${me.y}`).join("")),qt.dataset.manhattanPoints=ve.map(me=>`${me.x},${me.y}`).join(" ")}}return Ct()}function Yt(it,dt){const Ct=Number.parseFloat(getComputedStyle(it).fontSize),_t=dt*(12/(Number.isFinite(Ct)?Ct:13));it.style.setProperty("--mermaid-readable-width",`${_t.toFixed(3)}px`)}function w(it){const dt=it.getBBox(),_t=it.querySelector(".edgePaths path, g.node")?.getScreenCTM()?.inverse();if(!_t)return dt;const wt=[...it.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(Ut=>{if(!Ut.textContent?.trim())return[];const de=Ut.getBoundingClientRect(),Se=[new DOMPoint(de.left,de.top),new DOMPoint(de.right,de.top),new DOMPoint(de.right,de.bottom),new DOMPoint(de.left,de.bottom)].map(ne=>ne.matrixTransform(_t)),Rt=Math.min(...Se.map(ne=>ne.x)),Ae=Math.min(...Se.map(ne=>ne.y)),Ue=Math.max(...Se.map(ne=>ne.x)),_e=Math.max(...Se.map(ne=>ne.y));return[{x:Rt,y:Ae,width:Ue-Rt,height:_e-Ae}]}),X=[dt,...wt],St=Math.min(...X.map(Ut=>Ut.x)),At=Math.min(...X.map(Ut=>Ut.y)),Dt=Math.max(...X.map(Ut=>Ut.x+Ut.width)),qt=Math.max(...X.map(Ut=>Ut.y+Ut.height));return{x:St,y:At,width:Dt-St,height:qt-At}}async function U(it,dt,Ct,_t){const wt=++E;if(await ch(),await document.fonts?.ready,it!==I)return!1;const X=S(T)?.querySelector(".mermaid-svg svg");if(!X||(r3(X,Ct),typeof X.getBBox!="function"))return!1;if(delete X.dataset.layoutSettled,Zt(X),Po(X),X.getAttribute("aria-roledescription")==="sequence")return await Ce(X,dt),it!==I||wt!==E?!1:(Kg(X),st(X),Yt(X,X.viewBox.baseVal.width),X.dataset.layoutGeneration=String(it),X.dataset.layoutSettled="true",!0);xt(X),H(X),Y(X),Z(X),It(X),tt(X),Kg(X),st(X),X.getAttribute("aria-roledescription")!=="flowchart-v2"&&T3(X,Ct),k3(X),C3(X),w3(X);const St=X.getAttribute("aria-roledescription")==="flowchart-v2";if(St&&(X.dataset.flowchartDirection=dt.match(/^\s*(?:flowchart|graph)\s+(\w+)\b/m)?.[1]??""),St){const Jt=X.getBBox(),ir=16,mr=Math.ceil(Jt.width+ir*2),sr=Math.ceil(Jt.height+ir*2);return X.setAttribute("viewBox",`${Jt.x-ir} ${Jt.y-ir} ${mr} ${sr}`),X.setAttribute("width",String(mr)),X.setAttribute("height",String(sr)),Yt(X,mr),Ps(X),Ys(X.ownerDocument)||await new Promise(xi=>setTimeout(xi,64)),it!==I||wt!==E?!1:(X.dataset.layoutGeneration=String(it),X.dataset.layoutSettled="true",!0)}const At=S(T)?.clientWidth??0,Dt=At>0?At<=620:S($);St&&!Dt&&X.querySelectorAll("g.cluster").length>=2&&Nn(X);const qt=X.dataset.nestedDecisionLayout==="wide"?U3(X)??X.getBBox():X.getBBox(),Ut=Number.parseFloat(getComputedStyle(X).fontSize),de=12/(Number.isFinite(Ut)?Ut:13),Rt=!/^\s*(?:flowchart|graph)\s+(?:LR|RL|BT)\b/m.test(dt)&&(Dt||St&&qt.width*de>At);if(Rt&&(rh(X,!1,Ct),rh(X,!0,Ct)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),it!==I)return!1;X.getBoundingClientRect(),Rt&&Wt(X),St&&Q3(X),eh(X),lp(X),Nn(X);let Ae=null;Rt?(rh(X,!0,Ct),eh(X,!0),lp(X),Nn(X),Wt(X),ih(X),Io(X),Ae=X.getBBox()):(ih(X),X.querySelector("g.cluster")&&Io(X));const Ue=X.classList.contains("statediagram"),_e=S(P)?"compact":"wide",Ft=(!Ue||X.dataset.stateRouteLayout!==_e)&&r$(X,S(P),_t);l$(X),a$(X),Ue&&Ft&&(X.dataset.stateRouteLayout=_e);const ie=Mt(X);if(th(X),Po(X),rp(X),c$(X,S(P)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),it!==I)return!1;zt(X),Nn(X),th(X),Po(X),X.querySelector("g.cluster")&&Io(X);const Pe=X.getBBox(),ke=[ie,Ae].filter(Jt=>!!Jt),Ie=Pe,Ve=ke.length?DOMRect.fromRect({x:Math.min(Ie.x,...ke.map(Jt=>Jt.x)),y:Math.min(Ie.y,...ke.map(Jt=>Jt.y)),width:Math.max(Ie.x+Ie.width,...ke.map(Jt=>Jt.x+Jt.width))-Math.min(Ie.x,...ke.map(Jt=>Jt.x)),height:Math.max(Ie.y+Ie.height,...ke.map(Jt=>Jt.y+Jt.height))-Math.min(Ie.y,...ke.map(Jt=>Jt.y))}):Ie;if(![Ve.x,Ve.y,Ve.width,Ve.height].every(Number.isFinite))return!1;const Oe=!!X.querySelector("g.cluster");let ve=St?Rt?X.querySelector("g.cluster")?14:20:28:Oe?24:S($)?Ue?10:8:10,me=Math.ceil(Ve.width+ve*2),je=Math.ceil(Ve.height+ve*2);if(X.setAttribute("viewBox",`${Ve.x-ve} ${Ve.y-ve} ${me} ${je}`),X.style.removeProperty("width"),X.setAttribute("width",String(me)),X.setAttribute("height",String(je)),Ue){if(await new Promise(ir=>requestAnimationFrame(()=>ir())),it!==I)return!1;const Jt=X.getBBox();me=Math.ceil(Jt.width+ve*2),je=Math.ceil(Jt.height+ve*2),X.setAttribute("viewBox",`${Jt.x-ve} ${Jt.y-ve} ${me} ${je}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(je))}if(Yt(X,me),Ys(X.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,64)),it!==I)return!1;if(!Rt&&X.getAttribute("aria-roledescription")==="flowchart-v2"){eh(X,!0),Po(X);const Jt=w(X);me=Math.ceil(Jt.width+ve*2),je=Math.ceil(Jt.height+ve*2),X.setAttribute("viewBox",`${Jt.x-ve} ${Jt.y-ve} ${me} ${je}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(je)),Yt(X,me)}if(X.getAttribute("aria-roledescription")==="flowchart-v2"){if(await new Promise(Jt=>requestAnimationFrame(()=>Jt())),it!==I)return!1;np(X),sp(X),op(X),B3(X),Po(X),Rt&&X.querySelector("g.cluster")&&Io(X)}if(Rt&&(Wt(X),ih(X),Io(X)),X.getAttribute("aria-roledescription")==="flowchart-v2"){np(X),sp(X),op(X),S3(X),D3(X);const Jt=_3(X);th(X),Oe&&Io(X),F3(X,Jt),Po(X),Rt&&X.querySelector('path[data-grouped-return-lane="right"]')&&(ve=Math.max(ve,23));const ir=w(X);me=Math.ceil(ir.width+ve*2),je=Math.ceil(ir.height+ve*2),X.setAttribute("viewBox",`${ir.x-ve} ${ir.y-ve} ${me} ${je}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(je)),Yt(X,me)}if((Ue||Rt&&St&&!Oe&&!X.dataset.decisionCycleLayout)&&(X.style.setProperty("--mermaid-readable-width","0px"),X.style.setProperty("max-width","100%")),Ue&&rp(X),Ps(X),Ys(X.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,120)),it!==I||wt!==E)return!1;if(X.getAttribute("aria-roledescription")==="flowchart-v2"){const Jt=w(X);if(me=Math.ceil(Jt.width+ve*2),je=Math.ceil(Jt.height+ve*2),X.setAttribute("viewBox",`${Jt.x-ve} ${Jt.y-ve} ${me} ${je}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(je)),Yt(X,me),await new Promise(ir=>requestAnimationFrame(()=>ir())),it!==I||wt!==E)return!1}return Ps(X),X.dataset.layoutGeneration=String(it),X.dataset.layoutSettled="true",!0}async function ht(it,dt,Ct){const _t=++I;ft(_,_t,!0),ft(L,0);const wt=D(it),X=z(wt);if(!X?.trim()){dt||ft(g,""),ft(m,null),ft(L,_t,!0);return}try{const St=j(G(X)),At=/(?:^|\n)\s*(?:flowchart|graph)\s/i.test(St),Dt=UF(getComputedStyle(document.documentElement),At);Dt.suppressErrorRendering=!0;const qt=/^\s*stateDiagram(?:-v2)?\b/m.test(St),Ut=/^\s*erDiagram\b/m.test(St);if(Dt.layout=qt||Ut?"elk":"dagre",At&&(Dt.flowchart={...Dt.flowchart,curve:"basis",nodeSpacing:48,rankSpacing:64}),S($)&&(Dt.flowchart={...Dt.flowchart,nodeSpacing:48,padding:9,rankSpacing:48,wrappingWidth:S(P)&&/\bsubgraph\b/.test(St)?80:120},S(P)&&(Dt.sequence={...Dt.sequence,actorMargin:0,diagramMarginX:0,messageMargin:24,noteMargin:4,width:96,wrap:!0})),Dt.state={...Dt.state,wrappingWidth:Dt.flowchart?.wrappingWidth},await document.fonts?.load(`400 ${Dt.fontSize}px "${jF}"`),!Ct())return;const de=await VF(async()=>{Jc.initialize(Dt);const Rt=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,{svg:Ae}=await Jc.render(Rt,St);if(_t!==I||!Ct())return;let Ue,_e;if(qt||At&&/class="[^"]*\bcluster\b/.test(Ae)){const ne=await Jc.mermaidAPI.getDiagramFromText(St);if(_t!==I||!Ct())return;ne.type==="flowchart-v2"&&(Ue=JF(ne.db.getSubGraphs())),ne.type==="stateDiagram"&&(_e=g3(ne.db.getData()))}return{svg:Ae,clusterMembership:Ue,stateDiagram:_e}},()=>_t===I&&Ct());if(!de||_t!==I||!Ct())return;ft(g,de.svg,!0),ft(m,null),await U(_t,St,de.clusterMembership,de.stateDiagram)&&_t===I&&ft(L,_t,!0)}catch(St){if(_t!==I||!Ct())return;if(dt){ft(m,null),ft(L,_t,!0);return}r.error("Failed to render mermaid diagram:",St),ft(m,St instanceof Error?St.message:Ye.markdown_mermaid_renderFailed_error(),!0),ft(g,""),ft(L,_t,!0)}}const pt=OF((it,dt)=>ht(it.source,it.isStreaming,dt));function ut(it){it.stopPropagation(),it.preventDefault(),ft(k,it.currentTarget,!0),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),ft(C,S(T)?.querySelector(".mermaid-svg svg")?.outerHTML??S(g),!0),ft(x,!0)}function O(it){it.stopPropagation(),it.preventDefault(),f(!f())}function V(){ft(x,!1),ft(C,"")}function K(it){it.defaultPrevented||S(v)?.handleKeydown(it)}function ct(){M!==void 0&&cancelAnimationFrame(M),M=requestAnimationFrame(()=>{M=void 0;const it=S(A)?.querySelector("svg");it&&Ps(it)})}Gh(()=>{ft(y,!0);const it=S(T)?.closest(".node-mermaidBlock"),dt=it??S(T),Ct=()=>it?.clientWidth??S(T)?.clientWidth??0;let _t,wt;const X=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{const Dt=Ct();Dt!==_t&&(_t=Dt,ft($,Dt<=620),ft(P,S(P)?Dt<440:Dt<=420,!0));const qt=S(T)?.clientWidth;if(qt===wt)return;wt=qt;const Ut=S(T)?.querySelector(".mermaid-svg svg");Ut?.dataset.layoutSettled==="true"&&Ps(Ut)});dt&&X&&(_t=Ct(),ft($,_t<=620),ft(P,_t<=420),X.observe(dt),S(T)&&S(T)!==dt&&X.observe(S(T)));let St=R();const At=new MutationObserver(()=>{const Dt=R();Dt!==St&&(St=Dt,ft(B,S(B)+1))});return At.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>{At.disconnect(),X?.disconnect(),M!==void 0&&cancelAnimationFrame(M),pt.dispose(),I+=1}}),ba(()=>{const it={source:n(),isStreaming:l(),revision:`${S(B)}:${S($)}:${S(P)}`};S(y)&&S(T)&&el(()=>pt.update(it))});let yt=Et(()=>S(m)?"error":S(g)?"rendered":!n()?.trim()&&!l()?"empty":"pending");ba(()=>{p()?.(S(yt))});var vt={get code(){return n()},set code(it){n(it),Te()},get isStreaming(){return l()},set isStreaming(it=!1){l(it),Te()},get className(){return c()},set className(it=""){c(it),Te()},get showExpandButton(){return h()},set showExpandButton(it=!0){h(it),Te()},get showSourceButton(){return d()},set showSourceButton(it=!0){d(it),Te()},get showExportButton(){return u()},set showExportButton(it=!1){u(it),Te()},get showSource(){return f()},set showSource(it=!1){f(it),Te()},get onRenderStateChange(){return p()},set onRenderStateChange(it){p(it),Te()},$set:La,$on:(it,dt)=>Aa(t,it,dt)},ot=x$(),kt=ri(ot);let Xt;var re=Ne(kt),Kt=Ne(re);W(Kt,{size:30,weight:"light"}),Fe(re),ta(re,it=>ft(F,it),()=>S(F));var xe=qe(re,2);{var Ee=it=>{var dt=h$(),Ct=Ne(dt),_t=Ne(Ct),wt=kr(_t,!0),X=qe(_t,2),St=kr(X,!0);Fe(Ct);var At=qe(Ct,2),Dt=Ne(At),qt=kr(Dt,!0),Ut=qe(Dt,2),de=kr(Ut,!0),Se=qe(Ut,2),Rt=kr(Se,!0),Ae=qe(Se,2),Ue=kr(Ae,!0);Fe(At),Fe(dt),or((_e,ne,Ft,ie)=>{pr(wt,_e),pr(St,ne),pr(qt,Ft),pr(de,S(m)),pr(Rt,ie),pr(Ue,S(q))},[()=>Ye.markdown_mermaid_renderFailed_error(),()=>Ye.markdown_mermaid_invalid_description(),()=>Ye.markdown_mermaid_errorDetails_label(),()=>Ye.markdown_mermaid_viewSource_label()]),ge(it,dt)},si=it=>{var dt=f$(),Ct=ri(dt),_t=Ne(Ct);let wt;var X=Ne(_t);Mu(X,()=>S(g),!0),Fe(X),Fe(_t);var St=qe(_t,2);{var At=Ut=>{var de=d$();let Se;var Rt=Ne(de);{var Ae=ie=>{{let Pe=Et(()=>Ye.markdown_mermaid_viewSource_label()),ke=Et(()=>Ye.markdown_mermaid_viewSource_label());Ho(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button",onclick:O,get"aria-pressed"(){return f()},get"aria-label"(){return S(Pe)},get tooltip(){return S(ke)},children:(Ie,Ve)=>{Qs(Ie,{get icon(){return rC},size:"sm"})},$$slots:{default:!0}})}};ur(Rt,ie=>{d()&&ie(Ae)})}var Ue=qe(Rt,2);{var _e=ie=>{{let Pe=Et(()=>Ye.markdown_mermaid_expand_ariaLabel()),ke=Et(()=>Ye.markdown_mermaid_expand_tooltip());Ho(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button expand-button",onclick:ut,get"aria-label"(){return S(Pe)},get tooltip(){return S(ke)},children:(Ie,Ve)=>{Qs(Ie,{get icon(){return Sp},size:"sm"})},$$slots:{default:!0}})}};ur(Ue,ie=>{h()&&ie(_e)})}var ne=qe(Ue,2);{var Ft=ie=>{hu(ie,{get container(){return S(T)},compactTrigger:!0})};ur(ne,ie=>{u()&&ie(Ft)})}Fe(de),or(ie=>{Se=ra(de,1,"mermaid-actions svelte-9cn23y",null,Se,{"with-export":u()}),fe(de,"aria-label",ie)},[()=>Ye.markdown_mermaid_actions_ariaLabel()]),ge(Ut,de)};ur(St,Ut=>{(d()||h()||u())&&Ut(At)})}Fe(Ct);var Dt=qe(Ct,2);{var qt=Ut=>{var de=u$(),Se=Ne(de),Rt=kr(Se,!0);Fe(de),or(Ae=>{fe(de,"aria-label",Ae),pr(Rt,S(q))},[()=>Ye.markdown_mermaid_viewSource_label()]),ge(Ut,de)};ur(Dt,Ut=>{f()&&Ut(qt)})}or(()=>wt=ra(_t,1,"mermaid-svg-viewport svelte-9cn23y",null,wt,{"without-actions":!d()&&!h()&&!u()})),ge(it,dt)},da=it=>{var dt=g$(),Ct=Ne(dt),_t=kr(Ct,!0),wt=qe(Ct,2),X=kr(wt,!0);Fe(dt),or((St,At)=>{pr(_t,St),pr(X,At)},[()=>Ye.markdown_mermaid_noCode_label(),()=>Ye.markdown_mermaid_noCode_description()]),ge(it,dt)},ua=Et(()=>!n()?.trim()&&!l()),ks=it=>{var dt=p$(),Ct=kr(dt,!0);or(_t=>pr(Ct,_t),[()=>Ye.ui_spinner_loading_ariaLabel()]),ge(it,dt)};ur(xe,it=>{S(m)?it(Ee):S(g)?it(si,1):S(ua)?it(da,2):it(ks,-1)})}Fe(kt),ta(kt,it=>ft(T,it),()=>S(T));var Ss=qe(kt,2);{let it=Et(()=>Ye.markdown_mermaid_fullscreenView_ariaLabel()),dt=Et(()=>Ye.markdown_mermaid_closeFullscreen_ariaLabel());CC(Ss,{get ariaLabel(){return S(it)},get closeLabel(){return S(dt)},onClose:V,get openerElement(){return S(k)},onKeydown:K,get open(){return S(x)},set open(Ct){ft(x,Ct,!0)},children:(Ct,_t)=>{var wt=y$(),X=Ne(wt);ta(wC(X,{onScaleChange:ct,children:(St,At)=>{var Dt=m$();Mu(Dt,()=>S(C),!0),Fe(Dt),ta(Dt,qt=>ft(A,qt),()=>S(A)),ge(St,Dt)},$$slots:{default:!0}}),St=>ft(v,St,!0),()=>S(v)),Fe(wt),ge(Ct,wt)},$$slots:{default:!0}})}return or(it=>{Xt=ra(kt,1,`mermaid-renderer ${c()??""}`,"svelte-9cn23y",Xt,{"has-diagram":it}),fe(kt,"data-render-generation",S(_)),fe(kt,"data-render-settled-generation",S(L)),fe(kt,"data-render-settled",S(_)>0&&S(L)===S(_))},[()=>!!S(g)]),ge(e,ot),$a(vt)}const Ni={labelFontSize:13,labelCharWidthRatio:.6,labelLineHeight:1.26,kindFontSize:11,kindCharWidthRatio:.88,kindLineHeight:1,paddingX:16,paddingY:12,gap:4,maxLines:3,maxWidth:250},vi=Object.freeze({fontSize:Ni.kindFontSize,lineHeight:Ni.labelLineHeight,paddingX:6,paddingY:4}),C$={architecture:{defaultNodeKinds:["service","db","queue","actor","ui_component"],defaultEdgeKinds:["request","response","event","data"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},sequence:{defaultNodeKinds:["actor"],defaultEdgeKinds:["message","return"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"polyline"},nodeDefaults:{width:75,height:32}},state_machine:{defaultNodeKinds:["state","start","end"],defaultEdgeKinds:["transition"],defaultLayout:{type:"layered",direction:"LR",spacing:35,edgeRouting:"curved"},nodeDefaults:{width:75,height:38}},data_flow:{defaultNodeKinds:["process","data_store","external"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"polyline"},nodeDefaults:{width:80,height:40}},network:{defaultNodeKinds:["node","router","switch","server"],defaultEdgeKinds:["connection"],defaultLayout:{type:"force",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:60,height:60}},flowchart:{defaultNodeKinds:["process","decision","start","end","data"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},timeline:{defaultNodeKinds:["event","milestone"],defaultEdgeKinds:["sequence"],defaultLayout:{type:"layered",direction:"LR",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}},dependency_graph:{defaultNodeKinds:["module","package","file"],defaultEdgeKinds:["depends_on","imports"],defaultLayout:{type:"layered",direction:"TB",spacing:40,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}}},w$=1.78,k$=900,S$=30,v$=300,Wa=6,M$=112,cp=32,T$=vi.fontSize*Ni.labelCharWidthRatio,zo=vi.paddingX*2,B$=vi.paddingY*2,ah=0,_$=vi.fontSize*vi.lineHeight,L$=14,A$=8,F$=32,Yh=500,$$=.84,Na=16,go=Object.freeze({centerY:24,headerHeight:68,horizontalPadding:24});function nn(e,t=Number.POSITIVE_INFINITY){if(e.length>=48)return 100;const r=ei(e,60);return r.lines>=3&&t<r.height+16?80:60}let so,oh;function po(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function El(e,t,r,i,a=0,o=po("--font-ui","Inter, system-ui, sans-serif")){return so===void 0&&(so=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null),so?(so.font=`${r} ${t}px ${o}`,so.measureText(e).width+Math.max(0,e.length-1)*a):e.length*i}function xu(e){const t=vi.fontSize,r=po("--text-caption-weight","500"),i=po("--text-caption-tracking","-0.01em"),a=Number.parseFloat(i),o=Number.isFinite(a)?i.endsWith("em")?a*t:a:t*-.01,s=Math.max(...e.split(`
330
- `).map(n=>El(n,t,r,t*.5,o)));return Math.ceil(s)+go.horizontalPadding*2}function Xh(e){const t=xu(e.label)-go.horizontalPadding*2,r=vi.fontSize;return{left:e.x+(e.width-t)/2-Wa,right:e.x+(e.width+t)/2+Wa,top:e.y+go.centerY-r,bottom:e.y+go.centerY+r}}function ei(e,t=M$){const r=vi.fontSize,i=po("--text-body-weight","400"),a=po("--text-caption-tracking","-0.01em"),o=Number.parseFloat(a),s=Number.isFinite(o)?a.endsWith("em")?o*r:o:-.01*r;oh===void 0&&(oh=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null);const n=oh;n&&(n.font=`${i} ${r}px ${po("--font-ui","Inter, system-ui, sans-serif")}`,n.letterSpacing=`${s}px`);const l=m=>n?.measureText(m).width??El(m,r,i,T$,s),c=e.split(`
331
- `),h=Math.max(...c.map(l))+zo+ah,d=Math.max(...e.split(/\s+/).map(l),cp-zo)+zo+ah,u=Math.max(t,d),f=Math.ceil(Math.max(cp,Math.min(h,u))),p=f-zo-ah,g=c.reduce((m,y)=>{const x=y.trim().split(/\s+/).filter(Boolean);if(!x.length)return m+1;let C=1,k="";for(const v of x){const T=l(v);if(T>p){k&&(C+=1),C+=Math.max(1,Math.ceil(T/p))-1,k="";continue}const F=k?`${k} ${v}`:v;k&&l(F)>p?(C+=1,k=v):k=F}return m+C},0);return{width:f,height:Math.min(g,3)*_$+B$,lines:g}}function sh(e){return ei(e).width}function ln(e,t=Wa){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];for(let a=1;a<e.length-1;a+=1){const o=e[a-1],s=e[a],n=e[a+1],l=Math.hypot(s.x-o.x,s.y-o.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-o.x)*(n.y-s.y)-(s.y-o.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u={x:s.x-(s.x-o.x)/l*d,y:s.y-(s.y-o.y)/l*d},f={x:s.x+(n.x-s.x)/c*d,y:s.y+(n.y-s.y)/c*d};r.push(`L ${u.x} ${u.y}`,`Q ${s.x} ${s.y} ${f.x} ${f.y}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function ps(e,t=80){return Math.max(S$,Math.min(v$,e??t))}function E$(e,t,r,i=Ni,a=k$){const o=new Set(e.nodes.map(p=>p.id)),s={...e,edges:e.edges.filter(p=>o.has(p.from)&&o.has(p.to))},n=C$[r],l=n?.nodeDefaults||{width:100,height:60},c=s.nodes.map(p=>({...p,size:p.size||x1(p,l,i)})),h={...n?.defaultLayout,...t.layout,edgeRouting:t.layout.edgeRouting||t.edgeRouting||n?.defaultLayout?.edgeRouting},d=t.layout.direction;if(!d&&["layered","tree"].includes(h.type)){const p={...h,direction:"LR"},g={...h,direction:"TB"},m=nh(c,s,p,l),y=nh(c,s,g,l),x=P$(m,y,a),C=x===m?p:g;return a<Yh||x.bounds.width>a?dp(x,a,ps(h.spacing,80),C,l,i):x}const u=nh(c,s,h,l);return d==="LR"||d==="RL"?u:a<Yh||!s.groups?.length&&(u.bounds.width>a||u.bounds.height>0&&u.bounds.width/u.bounds.height>w$)?dp(u,a,ps(h.spacing,80),h,l,i):u}function P$(e,t,r){if(r<Yh)return t;const i=hp(e,r),a=hp(t,r);return i.unreadable!==a.unreadable?i.unreadable?t:e:i.collisions!==a.collisions?i.collisions<a.collisions?e:t:i.overlaps!==a.overlaps?i.overlaps<a.overlaps?e:t:i.crossings>a.crossings+1||i.overflow>a.overflow+.1?t:e}function hp(e,t){const r=e.edges.flatMap(n=>y1(n.points??[]));let i=0,a=0,o=0;for(let n=0;n<r.length;n+=1){for(let l=n+1;l<r.length;l+=1){const c=I$(r[n],r[l]);c==="crossing"&&(i+=1),c==="overlap"&&(a+=1)}o+=e.nodes.filter(l=>O$(r[n],l)).length}const s=Math.min(1,t/Math.max(e.bounds.width,1));return{crossings:i,overlaps:a,collisions:o,unreadable:s<$$,overflow:Math.max(0,e.bounds.width/Math.max(t,1)-1)}}function y1(e){return e.slice(1).flatMap((t,r)=>{const i=e[r],a=Math.abs(i.y-t.y)<.001,o=Math.abs(i.x-t.x)<.001;return a||o?[{start:i,end:t,horizontal:a}]:[]})}function I$(e,t){const r=(c,h)=>[Math.min(c,h),Math.max(c,h)];if(e.horizontal===t.horizontal){const c=e.horizontal?e.start.y:e.start.x,h=t.horizontal?t.start.y:t.start.x;if(Math.abs(c-h)>=.001)return"none";const[d,u]=e.horizontal?r(e.start.x,e.end.x):r(e.start.y,e.end.y),[f,p]=t.horizontal?r(t.start.x,t.end.x):r(t.start.y,t.end.y);return Math.min(u,p)-Math.max(d,f)>.5?"overlap":"none"}const i=e.horizontal?e:t,a=e.horizontal?t:e,[o,s]=r(i.start.x,i.end.x),[n,l]=r(a.start.y,a.end.y);return a.start.x>o+.5&&a.start.x<s-.5&&i.start.y>n+.5&&i.start.y<l-.5?"crossing":"none"}function O$(e,t){if(e.horizontal){const a=Math.min(e.start.x,e.end.x),o=Math.max(e.start.x,e.end.x);return e.start.y>t.y+.5&&e.start.y<t.y+t.height-.5&&o>t.x+.5&&a<t.x+t.width-.5}const r=Math.min(e.start.y,e.end.y),i=Math.max(e.start.y,e.end.y);return e.start.x>t.x+.5&&e.start.x<t.x+t.width-.5&&i>t.y+.5&&r<t.y+t.height-.5}function dp(e,t,r,i,a,o){const s=e.edges.some(x=>!!x.label)||e.nodes.some(x=>x.width>t),n=i.type==="manual"&&e.bounds.width>t;if(t<500&&s||n){const x=Math.max(150,Math.min(260,t)),C=e.nodes.map(B=>{const $=Math.min(B.width,x),P=x1(B,a,o,$).height;return{...B,width:$,height:B.size?Math.max(B.size.height,P):P}}),k=Math.max(...C.map(B=>B.width)),v=new Map;for(const B of e.edges)B.label&&v.set(B.from,(v.get(B.from)??0)+1);let T=0;const F=C.map(B=>{const $={...B,x:(k-B.width)/2,y:T},P=v.get(B.id)??0;return T+=B.height+Math.max(140,P*62+60,r*.65),$}),A=e.groups?up(e.groups,F):void 0,M=G$(e.edges,F,A);return{nodes:F,groups:A,edges:M,bounds:fp(F,A,M)}}if(e.bounds.width<=t)return e;const l=[...e.nodes],c=Math.max(...l.map(x=>x.height))+r,h=[...l].sort((x,C)=>x.x-C.x),d=new Map;let u=0,f=0;h.forEach(x=>{const C=x.x-e.bounds.minX-f;C+x.width>t&&C>0&&(f=x.x-e.bounds.minX,u+=c+r),d.set(x.id,{dx:-f,dy:u})});const p=l.map(x=>{const C=d.get(x.id)||{dx:0,dy:0};return{...x,x:x.x+C.dx,y:x.y+C.dy}}),g=e.groups?up(e.groups,p):void 0,m=C1(e.edges,p,i,g),y=fp(p,g,m);return{nodes:p,edges:m,groups:g,bounds:y}}function up(e,t){return e.map(r=>{const i=new Set(r.nodeIds??[]),a=t.filter(p=>p.group===r.id||i.has(p.id));if(a.length===0)return r;const o=30,s=go.headerHeight,n=30,l=Math.min(...a.map(p=>p.x)),c=Math.max(...a.map(p=>p.x+p.width)),h=Math.max(c-l+o*2,xu(r.label)),d=(l+c-h)/2,u=Math.min(...a.map(p=>p.y))-s,f=Math.max(...a.map(p=>p.y+p.height))+n;return{...r,x:d,y:u,width:h,height:f-u}})}function fp(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),a=Math.min(...e.map(n=>n.y)),o=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),a=Math.min(a,...t.map(n=>n.y)),o=Math.max(o,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),a=Math.min(a,l.y),o=Math.max(o,l.x),s=Math.max(s,l.y)}return{minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}}function nh(e,t,r,i){const a=R$(e,t.edges,r,i,t.groups);if((r.type==="layered"||r.type==="tree")&&r.direction==="RL"){const c=Math.min(...a.map(({x:d})=>d)),h=Math.max(...a.map(({x:d,width:u})=>d+u));for(const d of a)d.x=c+h-d.x-d.width}if((r.type==="layered"||r.type==="tree")&&r.direction==="BT"){const c=Math.min(...a.map(({y:d})=>d)),h=Math.max(...a.map(({y:d,height:u})=>d+u));for(const d of a)d.y=c+h-d.y-d.height}const o=t.groups?Z$(t.groups,a):void 0,s=H$(t.edges,a,r,o),n=new Map;for(const c of s){const h=c.id,d=n.get(h)??0;d>0&&(c.id=`${h}-${d}`),n.set(h,d+1)}const l=K$(a,o,s);return{nodes:a,edges:s,groups:o,bounds:l}}function x1(e,t,r,i=r.maxWidth){const a=r===Ni,o=["db","store","data_store"].includes(e.kind??""),s=(a?10:r.paddingX)+(o?8:0),n=a?7:r.paddingY,l=a?2:r.gap,c=a?11:r.kindFontSize,h=L$+A$,d=0,u=Math.min(r.maxWidth,i),f=/[^\x00-\x7f]/.test(e.label)?10:8,p=.6,g=r.labelFontSize*(a?p:r.labelCharWidthRatio),m=c*(a?p:r.kindCharWidthRatio),y=e.label.split(/\r\n?|\n/),C=Vg(e.label).length<=2&&e.label.length<=20,k="600",v=po("--font-editorial","Georgia, Times New Roman, serif"),T=et=>El(et,r.labelFontSize,k,g,-.01*r.labelFontSize,v)+(so?(et.length-zh(et).length)*.01*r.labelFontSize:0),F=et=>El(et,c,"500",m,.015*c)-(so?(et.length-zh(et).length)*.015*c:0),A=y.map(T),M=Math.max(...A),B=Math.max(...KF(e.label).map(T),0),$=B>u,P=Math.max(1,u-s*2-h-d-f,$?0:B);let I,_=1;if(C&&!$)I=M,_=y.length;else{const et=Math.min(M,P),rt=Math.min(P,Math.max(et,B));I=rt,_=y.reduce((at,xt)=>{const H=du(xt);if(B>P||/[^\x00-\x7f]/.test(xt))return at+Zg(H??ec(xt).map(({text:st})=>st),rt,T,H!==null);const Y=H??Vg(xt);if(!Y.length)return at+1;let Z=1,tt="";for(const st of Y){const It=T(st);if(It>rt+.5){tt&&(Z+=1),Z+=Math.max(1,Math.ceil((It-.5)/rt))-1,tt="";continue}const zt=tt?`${tt}${H?"":" "}${st}`:st;tt&&T(zt)>rt+.5?(Z+=1,tt=st):tt=zt}return at+Z},0)}const E=r.labelFontSize*r.labelLineHeight*_;let L=0,q=0;if(e.kind){const et=e.kind.split(`
332
- `);L=Math.min(P,Math.max(...et.map(F))),q=c*r.kindLineHeight*et.reduce((rt,J)=>rt+Zg(J.match(/\S+[\t ]*|[\t ]+/g)??[],P,F),0)}const W=e.kind?1:0,R=Math.max(I+f,L+W)+h,D=E+(e.kind?l+q:0),G=Math.max(C?72:t.width*.6,o?112:0),j=h+s*2+d,z=Math.max(Math.min(Math.max(R+s*2+d,G),u),Math.min(B,P)+j+f),Q=Math.max(D+n*2+d,F$,o?90:0);return{width:z,height:Q}}function R$(e,t,r,i,a){if(e.some(s=>s.position)||r.type==="manual"){const s=[],n=[];for(const u of e){const f=u.size?.width??i.width,p=u.size?.height??i.height;if(u.position){const g={...u,x:u.position.x,y:u.position.y,width:f,height:p};n.push(g),s.push(g)}else n.push({...u,x:0,y:0,width:f,height:p})}const l=ps(r.spacing,80);for(let u=0;u<n.length;u++){if(e[u].position)continue;const p=n[u].width,g=n[u].height;let m=0,y=0,x=!1;for(let C=0;C<20&&!x;C++)for(let k=0;k<20&&!x;k++){const v=k*(p+l),T=C*(g+l);s.some(A=>!(v+p+l*.3<A.x||v>A.x+A.width+l*.3||T+g+l*.3<A.y||T>A.y+A.height+l*.3))||(m=v,y=T,x=!0)}n[u]={...n[u],x:m,y},s.push({x:m,y,width:p,height:g})}const c=new Map;for(const u of n){const f=e.find(({id:m})=>m===u.id)?.position;if(!f)continue;const p=[...c.keys()].find(m=>Math.abs(m-f.x)<=8),g=c.get(p??f.x)??[];g.push(u),c.set(p??f.x,g)}const h=Math.min(...n.map(u=>u.x)),d=new Set;for(const[u,f]of c){if(f.length<2)continue;const p=Math.max(...f.map(m=>m.width)),g=h+(u+p/2-h)*.89;for(const m of f)m.x=g-m.width/2,d.add(m.id)}for(const u of n)d.has(u.id)||(u.x=h+(u.x-h)*.89);return n}switch(r.type){case"layered":return gp(e,t,r,i,a);case"force":return q$(e,t,r,i,a);case"circular":return W$(e,r,i);case"tree":return z$(e,t,r,i);default:return gp(e,t,r,i,a)}}function gp(e,t,r,i,a){const o=ps(r.spacing,80),s=r.direction??"LR",n=s==="LR"||s==="RL",l=new Map;a&&(a.forEach(u=>{Array.isArray(u.nodeIds)&&u.nodeIds.forEach(f=>l.set(f,u.id))}),e.forEach(u=>{u.group&&l.set(u.id,u.group)}));const c=new Map,h=new Map;e.forEach(u=>{c.set(u.id,[]),h.set(u.id,[])}),t.forEach(u=>{c.get(u.from)?.push(u.to),h.get(u.to)?.push(u.from)});const d=new Map;return e.forEach(u=>{d.set(u.id,{width:u.size?.width??i.width,height:u.size?.height??i.height})}),a&&a.length>0?D$(e,t,a,d,l,c,h,o,n):N$(e,t,d,o,n)}function D$(e,t,r,i,a,o,s,n,l){const c="__ungrouped__",d=n<=40,u=Math.max(d?35:48,n*.75),f=Math.max(20,n*.32),p=new Map;r.forEach(_=>p.set(_.id,[])),p.set(c,[]),e.forEach(_=>{const E=a.get(_.id)||c;let L=p.get(E);L||(L=[],p.set(E,L)),L.push(_.id)});const g=new Map,m=new Map,y=[...r.map(_=>_.id),c];y.forEach(_=>{g.set(_,new Set),m.set(_,new Set)}),t.forEach(_=>{const E=a.get(_.from)||c,L=a.get(_.to)||c;E!==L&&(g.get(E)?.add(L),m.get(L)?.add(E))});const x=new Map,C=new Set;function k(_){const E=x.get(_);if(E!==void 0)return E;if(C.has(_))return 0;C.add(_);const L=y.indexOf(_),q=[...m.get(_)||new Set].filter(D=>!(g.get(_)?.has(D)??!1)||y.indexOf(D)<L);let W=-1;q.forEach(D=>{W=Math.max(W,k(D))});const R=W+1;return x.set(_,R),R}y.forEach(_=>{(p.get(_)?.length??0)>0&&k(_)});const v=Math.max(...Array.from(x.values()),0),T=Array.from({length:v+1},()=>[]);x.forEach((_,E)=>{(p.get(E)?.length??0)>0&&T[_].push(E)});const F=new Map,A=new Map,M=new Map,B=new Map;e.forEach(_=>{M.set(_.id,[]),B.set(_.id,[])}),t.forEach(_=>{const E=a.get(_.from)||c,L=a.get(_.to)||c;E===L&&(M.get(_.from)?.push(_.to),B.get(_.to)?.push(_.from))}),y.forEach(_=>{const E=p.get(_)||[];if(E.length===0){A.set(_,{width:0,height:0}),F.set(_,{layers:[],nodeLayer:new Map,layerSpacing:[]});return}const L=new Set(E),q=new Map,W=new Set;function R(J){const at=q.get(J);if(at!==void 0)return at;if(W.has(J))return 0;W.add(J);const xt=(B.get(J)||[]).filter(Z=>L.has(Z));let H=-1;xt.forEach(Z=>{H=Math.max(H,R(Z))});const Y=H+1;return q.set(J,Y),Y}E.forEach(J=>R(J));const D=Math.max(...Array.from(q.values()),0),G=Array.from({length:D+1},()=>[]);q.forEach((J,at)=>{L.has(at)&&G[J].push(at)});for(let J=0;J<4;J++){for(let at=1;at<G.length;at++){const xt=G[at],H=G[at-1],Y=new Map;xt.forEach(Z=>{const st=(B.get(Z)||[]).filter(It=>L.has(It)).map(It=>H.indexOf(It)).filter(It=>It!==-1);st.length>0?Y.set(Z,st.reduce((It,zt)=>It+zt,0)/st.length):Y.set(Z,xt.indexOf(Z))}),xt.sort((Z,tt)=>(Y.get(Z)??0)-(Y.get(tt)??0))}for(let at=G.length-2;at>=0;at--){const xt=G[at],H=G[at+1],Y=new Map;xt.forEach(Z=>{const st=(M.get(Z)||[]).filter(It=>L.has(It)).map(It=>H.indexOf(It)).filter(It=>It!==-1);st.length>0?Y.set(Z,st.reduce((It,zt)=>It+zt,0)/st.length):Y.set(Z,xt.indexOf(Z))}),xt.sort((Z,tt)=>(Y.get(Z)??0)-(Y.get(tt)??0))}}const j=G.slice(0,-1).map((J,at)=>{const xt=t.reduce((H,Y)=>{if(!Y.label||a.get(Y.from)!==_||a.get(Y.to)!==_||q.get(Y.from)!==at||q.get(Y.to)!==at+1)return H;const Z=ei(Y.label);return Math.max(H,(l?Z.width:Z.height)+(d?18:24))},0);return Math.max(n*.5,xt)});F.set(_,{layers:G,nodeLayer:q,layerSpacing:j});let z=0,Q=0;G.forEach((J,at)=>{let xt=0,H=0;J.forEach(Y=>{const Z=i.get(Y);Z&&(l?(H+=Z.height+f,xt=Math.max(xt,Z.width)):(H+=Z.width+f,xt=Math.max(xt,Z.height)))}),H-=f,Q=Math.max(Q,H),z+=xt,at>0&&(z+=j[at-1]??n*.5)});const et=l?z+64:Q+64,rt=l?Q+64:z+64;A.set(_,{width:et,height:rt})});for(let _=0;_<4;_++){for(let E=1;E<T.length;E++){const L=T[E],q=T[E-1],W=new Map;L.forEach(R=>{const G=Array.from(m.get(R)||[]).map(j=>q.indexOf(j)).filter(j=>j!==-1);G.length>0?W.set(R,G.reduce((j,z)=>j+z,0)/G.length):W.set(R,L.indexOf(R))}),L.sort((R,D)=>(W.get(R)??0)-(W.get(D)??0))}for(let E=T.length-2;E>=0;E--){const L=T[E],q=T[E+1],W=new Map;L.forEach(R=>{const G=Array.from(g.get(R)||[]).map(j=>q.indexOf(j)).filter(j=>j!==-1);G.length>0?W.set(R,G.reduce((j,z)=>j+z,0)/G.length):W.set(R,L.indexOf(R))}),L.sort((R,D)=>(W.get(R)??0)-(W.get(D)??0))}}const $=new Map;let P=0;if(T.forEach(_=>{let E=0,L=0;_.forEach(q=>{const W=A.get(q);W&&(l?($.set(q,{x:P,y:E}),E+=W.height+u,L=Math.max(L,W.width)):($.set(q,{x:E,y:P}),E+=W.width+u,L=Math.max(L,W.height)))}),P+=L+u}),!l){const _=[];for(const[E,L]of $){const q=_.find(W=>Math.abs(W.x-L.x)<.5);q?q.groupIds.push(E):_.push({x:L.x,groupIds:[E]})}for(const E of _){const L=Math.max(...E.groupIds.map(q=>A.get(q)?.width??0));for(const q of E.groupIds){const W=$.get(q),R=A.get(q)?.width;!W||R===void 0||$.set(q,{...W,x:W.x+(L-R)/2})}}}const I=[];return y.forEach(_=>{const E=p.get(_)||[],L=$.get(_),q=F.get(_);if(!L||E.length===0||!q)return;const{layers:W,layerSpacing:R}=q;let D=32;W.forEach((G,j)=>{let z=0;G.forEach(at=>{const xt=i.get(at);xt&&(z+=(l?xt.height:xt.width)+f)}),z-=f;const Q=A.get(_);if(!Q)return;let rt=32+((l?Q.height:Q.width)-64-z)/2,J=0;G.forEach(at=>{const xt=e.find(tt=>tt.id===at),H=i.get(at);if(!xt||!H)return;let Y,Z;l?(Y=L.x+D,Z=L.y+rt,rt+=H.height+f,J=Math.max(J,H.width)):(Y=L.x+rt,Z=L.y+D,rt+=H.width+f,J=Math.max(J,H.height)),I.push({...xt,x:Y,y:Z,width:H.width,height:H.height})}),D+=J+(R[j]??n*.5)})}),I}function N$(e,t,r,i,a){const o=new Map(e.map((k,v)=>[k.id,v])),s=new Set,n=new Map;for(const k of t){const v=n.get(k.from)??[];v.push(k),n.set(k.from,v)}const l=(k,v,T)=>{const F=[k],A=new Set;for(;F.length;){const M=F.pop();if(M){if(M===v)return!0;if(!A.has(M)){A.add(M);for(const B of n.get(M)??[])B.id!==T&&F.push(B.to)}}}return!1};for(const k of t){const v=o.get(k.from)??0,T=o.get(k.to)??0;v>T&&l(k.to,k.from,k.id)&&s.add(k.id)}const c=new Map,h=new Map;for(const k of t)s.has(k.id)||(c.set(k.to,[...c.get(k.to)??[],k.from]),h.set(k.from,[...h.get(k.from)??[],k.to]));const d=new Map,u=new Set;function f(k){const v=d.get(k);if(v!==void 0)return v;if(u.has(k))return 0;u.add(k);const T=c.get(k)||[];let F=-1;T.forEach(M=>{F=Math.max(F,f(M))});const A=F+1;return d.set(k,A),A}e.forEach(k=>f(k.id));const p=Math.max(...Array.from(d.values()),0),g=Array.from({length:p+1},()=>[]);d.forEach((k,v)=>{g[k].push(v)});for(let k=0;k<4;k++){for(let v=1;v<g.length;v++){const T=g[v],F=g[v-1],A=new Map;T.forEach(M=>{const $=(c.get(M)||[]).map(P=>F.indexOf(P)).filter(P=>P!==-1);$.length>0?A.set(M,$.reduce((P,I)=>P+I,0)/$.length):A.set(M,T.indexOf(M))}),T.sort((M,B)=>(A.get(M)??0)-(A.get(B)??0))}for(let v=g.length-2;v>=0;v--){const T=g[v],F=g[v+1],A=new Map;T.forEach(M=>{const $=(h.get(M)||[]).map(P=>F.indexOf(P)).filter(P=>P!==-1);$.length>0?A.set(M,$.reduce((P,I)=>P+I,0)/$.length):A.set(M,T.indexOf(M))}),T.sort((M,B)=>(A.get(M)??0)-(A.get(B)??0))}}const m=[],y=i*.4,x=g.slice(0,-1).map((k,v)=>{const T=t.reduce((F,A)=>{const M=d.get(A.from),B=d.get(A.to);if(!A.label||s.has(A.id)||M!==v||B!==v+1)return F;const $=ei(A.label);return Math.max(F,(a?$.width:$.height)+36)},0);return Math.max(i*.65,T)});let C=0;return g.forEach((k,v)=>{let T=0,F=0;F=-k.reduce((M,B)=>{const $=r.get(B);return $?M+(a?$.height:$.width)+y:M},-y)/2,k.forEach(M=>{const B=e.find(_=>_.id===M),$=r.get(M);if(!B||!$)return;let P,I;a?(P=C,I=F,F+=$.height+y,T=Math.max(T,$.width)):(P=F,I=C,F+=$.width+y,T=Math.max(T,$.height)),m.push({...B,x:P,y:I,width:$.width,height:$.height})}),C+=T+(x[v]??i*.8)}),m}function q$(e,t,r,i,a){const o=ps(r.spacing,100),s=r.direction??"LR",n=s==="LR"||s==="RL",l=150,c=o*o*8,h=.04,d=1.5,u=.7,f=new Map;a&&(a.forEach(E=>{Array.isArray(E.nodeIds)&&E.nodeIds.forEach(L=>{f.set(L,E.id)})}),e.forEach(E=>{E.group&&f.set(E.id,E.group)}));const p=new Map,g=new Map;e.forEach(E=>{p.set(E.id,[]),g.set(E.id,[])}),t.forEach(E=>{p.get(E.from)?.push(E.to),g.get(E.to)?.push(E.from)});const m=new Map,y=new Set,x=e.filter(E=>(g.get(E.id)?.length??0)===0),k=(x.length>0?x:[e[0]]).map(E=>({id:E.id,depth:0}));let v=0;for(;k.length>0;){const E=k.shift();if(!E)break;const{id:L,depth:q}=E;if(y.has(L))continue;y.add(L),m.set(L,q),v=Math.max(v,q),(p.get(L)??[]).forEach(R=>{y.has(R)||k.push({id:R,depth:q+1})})}e.forEach(E=>{m.has(E.id)||m.set(E.id,0)});const T=new Map;m.forEach(E=>{T.set(E,(T.get(E)??0)+1)});const F=new Map,A=new Map;if(a&&a.length>0){const E=a.length;let L,q;n?(L=E,q=1):(L=1,q=E);const W=o*.8;a.forEach((R,D)=>{const G=D%L,j=Math.floor(D/L),z=(G-(L-1)/2)*W,Q=(j-(q-1)/2)*W;A.set(R.id,{x:n?z:Q,y:n?Q:z,vx:0,vy:0})})}const M=e.map(E=>{const L=m.get(E.id)??0,q=T.get(L)??1,W=F.get(L)??0;F.set(L,W+1);const R=n?2:1.5,D=n?1:1.2,G=L/Math.max(v,1)*o*R;let j=(W-q/2)/Math.max(q,1)*o*D;const z=f.get(E.id),Q=z?A.get(z):void 0;Q&&(n?j=Q.y+j*.2:j=Q.x+j*.2);const et=E.id.split("").reduce((at,xt)=>at+xt.charCodeAt(0),0),rt=(et%100/100-.5)*o*.1,J=(et*7%100/100-.5)*o*.1;return{node:E,x:(n?G:j)+rt,y:(n?j:G)+J,vx:0,vy:0,width:E.size?.width??i.width,height:E.size?.height??i.height}}),B=E=>M.find(L=>L.node.id===E);for(let E=0;E<l;E++){M.forEach(L=>{L.vx=0,L.vy=0});for(let L=0;L<M.length;L++)for(let q=L+1;q<M.length;q++){const W=M[q].x-M[L].x,R=M[q].y-M[L].y,D=W*W+R*R+.01,G=Math.sqrt(D),j=(M[L].width+M[q].width)/2+o*.25,z=(M[L].height+M[q].height)/2+o*.25,Q=Math.sqrt(j*j+z*z),et=G<Q?c*3/D:c*1/D;let rt=W/G*et,J=R/G*et;n?(rt*=1.5,J*=.6):(rt*=.6,J*=1.5),M[L].vx-=rt,M[L].vy-=J,M[q].vx+=rt,M[q].vy+=J}t.forEach(L=>{const q=B(L.from),W=B(L.to);if(!q||!W)return;const R=W.x-q.x,D=W.y-q.y,G=Math.sqrt(R*R+D*D+.01),j=h*G,z=R/G*j,Q=D/G*j;q.vx+=z,q.vy+=Q,W.vx-=z,W.vy-=Q}),M.forEach(L=>{t.forEach(q=>{if(q.from===L.node.id||q.to===L.node.id)return;const W=B(q.from),R=B(q.to);if(!W||!R)return;const D=R.x-W.x,G=R.y-W.y,j=D*D+G*G;if(j<.01)return;const z=Math.max(0,Math.min(1,((L.x-W.x)*D+(L.y-W.y)*G)/j));if(z<.1||z>.9)return;const Q=W.x+z*D,et=W.y+z*G,rt=L.x-Q,J=L.y-et,at=rt*rt+J*J+.01,xt=Math.sqrt(at),Y=Math.max(L.width,L.height)/2+o*.1;if(xt<Y){const Z=xt/Y,tt=d*(1-Z)*(1-Z)*o;L.vx+=rt/xt*tt,L.vy+=J/xt*tt}})});for(let L=0;L<t.length;L++)for(let q=L+1;q<t.length;q++){const W=t[L],R=t[q];if(W.from===R.from||W.from===R.to||W.to===R.from||W.to===R.to)continue;const D=B(W.from),G=B(W.to),j=B(R.from),z=B(R.to);if(!D||!G||!j||!z)continue;const Q=(G.x-D.x)*(z.y-j.y)-(G.y-D.y)*(z.x-j.x);if(Math.abs(Q)<.01)continue;const et=((j.x-D.x)*(z.y-j.y)-(j.y-D.y)*(z.x-j.x))/Q,rt=((j.x-D.x)*(G.y-D.y)-(j.y-D.y)*(G.x-D.x))/Q;if(et>.1&&et<.9&&rt>.1&&rt<.9){const J=d*o*.15,at=z.x-j.x,xt=z.y-j.y,H=Math.sqrt(at*at+xt*xt),Y=-xt/H,Z=at/H,st=(z.x-j.x)*(D.y-j.y)-(z.y-j.y)*(D.x-j.x)>0?1:-1;D.vx+=Y*J*st,D.vy+=Z*J*st,G.vx+=Y*J*st,G.vy+=Z*J*st,j.vx-=Y*J*st,j.vy-=Z*J*st,z.vx-=Y*J*st,z.vy-=Z*J*st}}if(a&&a.length>0&&A.size>0){A.forEach(D=>{D.vx=0,D.vy=0});const L=o*o*5,q=Array.from(A.entries());for(let D=0;D<q.length;D++)for(let G=D+1;G<q.length;G++){const[,j]=q[D],[,z]=q[G],Q=z.x-j.x,et=z.y-j.y,rt=Q*Q+et*et+.01,J=Math.sqrt(rt),at=L/rt,xt=Q/J*at,H=et/J*at;j.vx-=xt,j.vy-=H,z.vx+=xt,z.vy+=H}const W=.05;M.forEach(D=>{const G=f.get(D.node.id),j=G?A.get(G):void 0;if(j){const z=j.x-D.x,Q=j.y-D.y;D.vx+=z*W,D.vy+=Q*W,j.vx-=z*W*.1,j.vy-=Q*W*.1}});const R=o*2;for(let D=0;D<M.length;D++)for(let G=D+1;G<M.length;G++){const j=f.get(M[D].node.id),z=f.get(M[G].node.id);if(j&&z&&j!==z||(j&&!z||!j&&z)){const rt=M[G].x-M[D].x,J=M[G].y-M[D].y,at=Math.sqrt(rt*rt+J*J+.01),xt=R/(at*1+o*.5),H=rt/at*xt,Y=J/at*xt;M[D].vx-=H,M[D].vy-=Y,M[G].vx+=H,M[G].vy+=Y}}A.forEach(D=>{D.x+=D.vx*u,D.y+=D.vy*u})}M.forEach(L=>{L.x+=L.vx*u,L.y+=L.vy*u})}for(let E=0;E<10;E++){let L=!1;for(let q=0;q<M.length;q++)for(let W=q+1;W<M.length;W++){const R=(M[q].width+M[W].width)/2+o*.15-Math.abs(M[W].x-M[q].x),D=(M[q].height+M[W].height)/2+o*.15-Math.abs(M[W].y-M[q].y);if(R>0&&D>0)if(L=!0,R<D){const G=R/2+1;M[W].x>=M[q].x?(M[q].x-=G,M[W].x+=G):(M[q].x+=G,M[W].x-=G)}else{const G=D/2+1;M[W].y>=M[q].y?(M[q].y-=G,M[W].y+=G):(M[q].y+=G,M[W].y-=G)}}if(!L)break}const $=60,P=new Map;M.forEach(E=>P.set(E.node.id,new Set)),t.forEach(E=>{P.get(E.from)?.add(E.to),P.get(E.to)?.add(E.from)});const I=new Map;let _=0;if(M.forEach(E=>{if(I.has(E.node.id))return;const L=_++,q=[E.node.id];for(;q.length>0;){const W=q.pop();if(W===void 0)break;I.has(W)||(I.set(W,L),P.get(W)?.forEach(R=>{I.has(R)||q.push(R)}))}}),_>1){const E=new Map;M.forEach(j=>{const z=I.get(j.node.id);if(z===void 0)return;const Q=E.get(z);Q?(Q.minX=Math.min(Q.minX,j.x),Q.minY=Math.min(Q.minY,j.y),Q.maxX=Math.max(Q.maxX,j.x+j.width),Q.maxY=Math.max(Q.maxY,j.y+j.height)):E.set(z,{minX:j.x,minY:j.y,maxX:j.x+j.width,maxY:j.y+j.height})});const L=Array.from(E.keys()).sort((j,z)=>{const Q=E.get(j),et=E.get(z);return!Q||!et?0:(et.maxX-et.minX)*(et.maxY-et.minY)-(Q.maxX-Q.minX)*(Q.maxY-Q.minY)}),q=Math.ceil(Math.sqrt(L.length));let W=0,R=0,D=0,G=0;for(const j of L){const z=E.get(j);if(!z)continue;const Q=z.maxX-z.minX,et=z.maxY-z.minY,rt=W-z.minX,J=R-z.minY;M.forEach(at=>{I.get(at.node.id)===j&&(at.x+=rt,at.y+=J)}),W+=Q+$,D=Math.max(D,et),G++,G>=q&&(G=0,W=0,R+=D+$,D=0)}}return M.map(E=>({...E.node,x:E.x,y:E.y,width:E.width,height:E.height}))}function W$(e,t,r){const a=2*Math.PI/e.length;return e.map((o,s)=>{const n=s*a,l=200*Math.cos(n),c=200*Math.sin(n),h=o.size?.width??r.width,d=o.size?.height??r.height;return{...o,x:l,y:c,width:h,height:d}})}function z$(e,t,r,i){const a=ps(r.spacing,60),o=r.direction??"TB",s=o==="TB"||o==="BT",n=new Map,l=new Map;t.forEach(f=>{let p=n.get(f.from);p||(p=[],n.set(f.from,p)),p.push(f.to),l.set(f.to,f.from)});const c=e.filter(f=>!l.has(f.id));c.length===0&&e.length>0&&c.push(e[0]);const h=new Map;let d=0;function u(f,p){const g=e.find(M=>M.id===f);if(!g)return{width:0,height:0};const m=g.size?.width??i.width,y=g.size?.height??i.height,x=n.get(f)||[];if(x.length===0){const M=s?d:p*(m+a),B=s?p*(y+a):d;return h.set(f,{x:M,y:B,width:m,height:y}),d+=(s?m:y)+a,{width:m,height:y}}const C=[];x.forEach(M=>{const B=u(M,p+1);C.push(s?B.width:B.height)});const T=(d-C.reduce((M,B)=>M+B,0)-a*(C.length-1)+d)/2,F=s?T:p*(m+a),A=s?p*(y+a):T;return h.set(f,{x:F,y:A,width:m,height:y}),{width:m,height:y}}return c.forEach(f=>{u(f.id,0)}),e.map(f=>{const p=h.get(f.id)||{x:0,y:0,width:i.width,height:i.height};return{...f,x:p.x,y:p.y,width:p.width,height:p.height}})}function H$(e,t,r,i){const a=r.edgeRouting||"polyline";return r.type==="circular"?mp(e,t):a==="orthogonal"||a==="curved"?C1(e,t,r,i):mp(e,t)}const Y$=32,X$=6;function j$(e,t){return Math.max(Y$,(e+t)/4+X$/2)}function b1(e,t){const r=new Map,i=new Map(t.map(s=>[s.id,s])),a=new Map;for(const s of e){if(s.from===s.to)continue;const n=`${s.from}::${s.to}`;let l=a.get(n);l||(l=[],a.set(n,l)),l.push(s)}const o=new Set;for(const[s]of a){const[n,l]=s.split("::"),c=`${l}::${n}`,h=[n,l].sort().join("::");if(o.has(h)||!a.has(c))continue;o.add(h);const d=a.get(s),u=a.get(c);if(!d||!u)continue;const f=i.get(n),p=i.get(l),g=f&&p?Math.abs(p.x+p.width/2-(f.x+f.width/2))>=Math.abs(p.y+p.height/2-(f.y+f.height/2)):!1,m=x=>Math.max(0,...x.map(C=>{if(!C.label)return 0;const k=ei(C.label);return g?k.height:k.width})),y=j$(m(d),m(u));for(const x of d)r.set(x.id,y);for(const x of u)r.set(x.id,y)}return r}function pp(e,t,r,i){const a=r.x-t.x,o=r.y-t.y,s=Math.sqrt(a*a+o*o);if(s===0)return e;const n=-o/s,l=a/s;return{x:e.x+n*i,y:e.y+l*i}}function mp(e,t){const r=new Map(t.map(o=>[o.id,o])),i=b1(e,t),a=new Map;return e.map(o=>{const s=r.get(o.from),n=r.get(o.to);if(!s||!n)return{...o,path:"",points:[]};if(s.id===n.id){const M=a.get(o.from)??0;a.set(o.from,M+1);const{path:B,points:$}=w1(s,M);return{...o,path:B,points:$}}const l=s.x+s.width/2,c=s.y+s.height/2,h=n.x+n.width/2,d=n.y+n.height/2,u=h-l,f=d-c;let p,g;const m=Math.atan2(f,u),y=Math.abs(m);y<Math.PI/4?(p={x:s.x+s.width,y:c},g={x:n.x,y:d}):y>3*Math.PI/4?(p={x:s.x,y:c},g={x:n.x+n.width,y:d}):m>0?(p={x:l,y:s.y+s.height},g={x:h,y:n.y}):(p={x:l,y:s.y},g={x:h,y:n.y+n.height});const x=2,C=g.x-p.x,k=g.y-p.y,v=Math.sqrt(C*C+k*k);if(v>x*2){const M=C/v,B=k/v;p={x:p.x+M*x,y:p.y+B*x}}const T=i.get(o.id);if(T){const M={x:l,y:c},B={x:h,y:d};p=pp(p,M,B,T),g=pp(g,M,B,T)}const F=`M ${p.x} ${p.y} L ${g.x} ${g.y}`,A=[p,{x:(p.x+g.x)/2,y:(p.y+g.y)/2},g];return{...o,path:F,points:A}})}function C1(e,t,r,i){const a=new Map(t.map(H=>[H.id,H])),o=new Map(t.flatMap(H=>H.group?[[H.id,H.group]]:[]));i?.forEach(H=>H.nodeIds?.forEach(Y=>o.set(Y,H.id)));const s=b1(e,t),n=r.direction||"TB",l=n==="TB"||n==="BT",c=16,h=24,d=32,u=10,f=12,p=10,g=12;let m=1/0,y=-1/0,x=-1/0;for(const H of t)m=Math.min(m,H.x),y=Math.max(y,H.x+H.width),x=Math.max(x,H.y+H.height);const C=[],k=[],v=new Map;for(const[H,Y]of e.entries()){const Z=a.get(Y.from),tt=a.get(Y.to);if(!Z||!tt)continue;if(Z.id===tt.id){const Zt=v.get(Y.from)??0;v.set(Y.from,Zt+1);const{path:$t,points:Nt}=w1(Z,Zt);k.push({...Y,path:$t,points:Nt});continue}const{fromSide:st,toSide:It}=V$(Z,tt,l),Wt=(r.type==="layered"||r.type==="tree")&&(l?Z.y+Z.height/2>tt.y+tt.height/2:Z.x+Z.width/2>tt.x+tt.width/2);C.push({index:H,edge:Y,fromNode:Z,toNode:tt,fromSide:st,toSide:It,goesBackward:Wt})}const T=xt(C),F=new Map;C.forEach(H=>{const{fromNode:Y,toNode:Z,fromSide:tt,toSide:st}=H,It=tt==="top"||tt==="bottom",zt=st==="top"||st==="bottom",Wt=Y.x+Y.width/2,Zt=Y.y+Y.height/2,$t=Z.x+Z.width/2,Nt=Z.y+Z.height/2;let Be=!1,Ot=!1,ue;if(tt==="bottom"&&st==="top"){const Ce=Y.y+Y.height,we=Z.y;ue=(Ce+we)/2,ue=Math.max(ue,Ce+h),ue=Math.min(ue,we-h)}else if(tt==="top"&&st==="bottom"){const Ce=Y.y,we=Z.y+Z.height;ue=(Ce+we)/2,ue=Math.min(ue,Ce-h),ue=Math.max(ue,we+h)}else ue=(Zt+Nt)/2;let $e;if(tt==="right"&&st==="left"){const Ce=Y.x+Y.width,we=Z.x;$e=(Ce+we)/2}else if(tt==="left"&&st==="right"){const Ce=Y.x,we=Z.x+Z.width;$e=(Ce+we)/2}else $e=(Wt+$t)/2;It&&zt&&Math.abs(Wt-$t)>5?Be=!0:!It&&!zt&&(Ot=!0),F.set(H.edge.id,{needsHorizontalChannel:Be,needsVerticalChannel:Ot,horizontalY:ue,verticalX:$e})});const A=C.filter(H=>F.get(H.edge.id)?.needsHorizontalChannel),M=C.filter(H=>F.get(H.edge.id)?.needsVerticalChannel);A.sort((H,Y)=>{const Z=F.get(H.edge.id),tt=F.get(Y.edge.id);return!Z||!tt?0:Z.horizontalY-tt.horizontalY}),M.sort((H,Y)=>{const Z=F.get(H.edge.id),tt=F.get(Y.edge.id);return!Z||!tt?0:Z.verticalX-tt.verticalX});const B=new Map,$=new Map,P=()=>{const H=[];A.forEach(Y=>{const{fromNode:Z,toNode:tt}=Y,st=F.get(Y.edge.id);if(!st)return;const It=st.horizontalY,zt=Math.min(Z.x,tt.x),Wt=Math.max(Z.x+Z.width,tt.x+tt.width),Zt=H.filter(Nt=>!(Wt<Nt.minX-10||zt>Nt.maxX+10)&&(Nt.sourceId!==Y.edge.from||Nt.targetId===Y.edge.to));let $t=It;if(Zt.length>0){const Nt=Zt.map(Ot=>Ot.y).sort((Ot,ue)=>Ot-ue);let Be=!1;for(let Ot=0;Ot<=Zt.length;Ot++){const ue=It+Ot*c;if(!Nt.some(Mt=>Math.abs(Mt-ue)<c-1)){$t=ue,Be=!0;break}const Ce=It-Ot*c;if(!Nt.some(Mt=>Math.abs(Mt-Ce)<c-1)&&Ot>0){$t=Ce,Be=!0;break}}Be||($t=It+Zt.length*c)}H.push({minX:zt,maxX:Wt,y:$t,edgeId:Y.edge.id,sourceId:Y.edge.from,targetId:Y.edge.to}),B.set(Y.edge.id,$t)})},I=()=>{const H=[];M.forEach(Y=>{const{fromNode:Z,toNode:tt}=Y,st=F.get(Y.edge.id);if(!st)return;const It=st.verticalX,zt=Math.min(Z.y,tt.y),Wt=Math.max(Z.y+Z.height,tt.y+tt.height),Zt=H.filter(Nt=>!(Wt<Nt.minY-10||zt>Nt.maxY+10));let $t=It;if(Zt.length>0){const Nt=Zt.map(Ot=>Ot.x).sort((Ot,ue)=>Ot-ue);let Be=!1;for(let Ot=0;Ot<=Zt.length;Ot++){const ue=It+Ot*c;if(!Nt.some(Mt=>Math.abs(Mt-ue)<c-1)){$t=ue,Be=!0;break}const Ce=It-Ot*c;if(!Nt.some(Mt=>Math.abs(Mt-Ce)<c-1)&&Ot>0){$t=Ce,Be=!0;break}}Be||($t=It+Zt.length*c)}H.push({minY:zt,maxY:Wt,x:$t,edgeId:Y.edge.id}),$.set(Y.edge.id,$t)})};P(),I();const _=C.filter(H=>H.goesBackward);_.sort((H,Y)=>{const Z=Math.abs(l?H.fromNode.y-H.toNode.y:H.fromNode.x-H.toNode.x);return Math.abs(l?Y.fromNode.y-Y.toNode.y:Y.fromNode.x-Y.toNode.x)-Z});const E=new Map;_.forEach((H,Y)=>{E.set(H.edge.id,Y)});const L=xt(l?_.map(H=>({...H,fromSide:"left",toSide:"left"})):[]),q=new Map;if(l)for(const H of _){const Y=Math.max(i?.length?0:32,H.edge.label?sh(H.edge.label)/2+4:0),Z=Math.min(H.fromNode.y,H.toNode.y),tt=Math.max(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),st=Math.min(...[...t,...i??[]].filter(Wt=>Wt.y<tt&&Wt.y+Wt.height>Z).map(Wt=>Wt.x));let It=i?.length?m-h-Y-((E.get(H.edge.id)??0)+1)*c:st-h-Y-c;const zt=_.filter(Wt=>{const Zt=Math.min(Wt.fromNode.y,Wt.toNode.y),$t=Math.max(Wt.fromNode.y+Wt.fromNode.height,Wt.toNode.y+Wt.toNode.height);return Zt<=tt&&$t>=Z}).flatMap(Wt=>q.has(Wt.edge.id)?[q.get(Wt.edge.id)]:[]).sort((Wt,Zt)=>Zt-Wt);for(const Wt of zt)Math.abs(It-Wt)<c&&(It=Wt-c);q.set(H.edge.id,It)}const W=new Map,R=new Map;for(const H of C){const Y=`${H.edge.from}->${H.edge.to}`,Z=R.get(Y)??[];Z.push(H),R.set(Y,Z)}for(const H of R.values())H.forEach((Y,Z)=>W.set(Y.edge.id,{index:Z,count:H.length}));const D=H=>{const Y=(H.fromNode.x+H.fromNode.width/2+H.toNode.x+H.toNode.width/2)/2,Z=Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),tt=Math.max(H.fromNode.y,H.toNode.y);return tt<=Z?!1:t.some(st=>st.id!==H.fromNode.id&&st.id!==H.toNode.id&&Y>=st.x-d&&Y<=st.x+st.width+d&&st.y<tt&&st.y+st.height>Z)},G=H=>{if(!H.edge.label)return!1;const Y=Math.max(0,Math.max(H.fromNode.y,H.toNode.y)-Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height)),Z=ei(H.edge.label,nn(H.edge.label,Y));return Z.lines>=3&&Y<Z.height+16},j=(H,Y,Z)=>Math.abs(H.x-Y.x)<.001?H.x>Z.left&&H.x<Z.right&&Math.max(H.y,Y.y)>Z.top&&Math.min(H.y,Y.y)<Z.bottom:H.y>Z.top&&H.y<Z.bottom&&Math.max(H.x,Y.x)>Z.left&&Math.min(H.x,Y.x)<Z.right,z=(H,Y)=>H.slice(1).some((Z,tt)=>Y.some(st=>j(H[tt],Z,st))),Q=(H,Y)=>Math.abs(Y.x-H.x)>=Math.abs(Y.y-H.y)?{x:H.x+Math.sign(Y.x-H.x)*d,y:H.y}:{x:H.x,y:H.y+Math.sign(Y.y-H.y)*d},et=H=>H.slice(1).reduce((Y,Z,tt)=>Y+Math.abs(Z.x-H[tt].x)+Math.abs(Z.y-H[tt].y),0),rt=(H,Y)=>{const Z=(V,K)=>Math.abs(K.x-V.x)>=Math.abs(K.y-V.y)?`${Math.sign(K.x-V.x)},0`:`0,${Math.sign(K.y-V.y)}`,tt=new Set([o.get(H.fromNode.id),o.get(H.toNode.id)].filter(V=>V!==void 0)),st=t.map(V=>{const K=V.id===H.fromNode.id||V.id===H.toNode.id?0:u;return{left:V.x-K,right:V.x+V.width+K,top:V.y-K,bottom:V.y+V.height+K}}),It=(i??[]).filter(V=>!tt.has(V.id)&&V.width>0&&V.height>0).map(V=>({left:V.x-f,right:V.x+V.width+f,top:V.y-f,bottom:V.y+V.height+f})),zt=(i??[]).map(Xh),Wt=[...st,...It,...zt],Zt=zs(Y);if(!z(Zt,Wt))return Zt;const $t=H.edge.label?ei(H.edge.label):void 0,Nt=[...zt,...t.map(V=>({left:V.x,right:V.x+V.width,top:V.y,bottom:V.y+V.height})),...(i??[]).filter(V=>!tt.has(V.id)&&V.width>0&&V.height>0).map(V=>({left:V.x,right:V.x+V.width,top:V.y,bottom:V.y+V.height}))],Be=V=>{if(!$t)return Number.POSITIVE_INFINITY;const K=[.5,.25,.75,.125,.875];return V.slice(1).reduce((ct,yt,vt)=>{const ot=V[vt];return ct+K.filter(kt=>{const Xt=ot.x+(yt.x-ot.x)*kt,re=ot.y+(yt.y-ot.y)*kt,Kt={left:Xt-$t.width/2-p,right:Xt+$t.width/2+p,top:re-$t.height/2-p,bottom:re+$t.height/2+p};return!Nt.some(xe=>Kt.left<xe.right&&Kt.right>xe.left&&Kt.top<xe.bottom&&Kt.bottom>xe.top)}).length},0)},Ot=V=>Be(V)>=3,ue=Zt[0],$e=Zt[Zt.length-1],Ce=Z(ue,Y[1]),we=Z(Y[Y.length-2],$e),Mt=Q(ue,Zt[1]),Yt=Q($e,Zt[Zt.length-2]),w=V=>[...new Set(V)].sort((K,ct)=>K-ct),U=w([...Wt.flatMap(({left:V,right:K})=>[V,K]),...$t?Nt.flatMap(({left:V,right:K})=>[V-$t.width/2-g,K+$t.width/2+g]):[]]),ht=w([...Wt.flatMap(({top:V,bottom:K})=>[V,K]),...$t?Nt.flatMap(({top:V,bottom:K})=>[V-$t.height/2-g,K+$t.height/2+g]):[]]),pt=[...U.map(V=>zs([ue,Mt,{x:V,y:Mt.y},{x:V,y:Yt.y},Yt,$e])),...ht.map(V=>zs([ue,Mt,{x:Mt.x,y:V},{x:Yt.x,y:V},Yt,$e]))].filter(V=>!z(V,Wt)&&Z(V[0],V[1])===Ce&&Z(V[V.length-2],V[V.length-1])===we),ut=pt.filter(Ot);return(ut.length>0?ut:pt).toSorted((V,K)=>{const ct=yt=>et(yt)+yt.length*c;return ct(V)-ct(K)||JSON.stringify(V).localeCompare(JSON.stringify(K))})[0]??Zt},J=C.map(H=>{const{index:Y,edge:Z,fromNode:tt,toNode:st,fromSide:It,toSide:zt,goesBackward:Wt}=H,Zt=(Mt,Yt)=>{switch(Yt){case"top":return{x:Mt.x+Mt.width/2,y:Mt.y};case"bottom":return{x:Mt.x+Mt.width/2,y:Mt.y+Mt.height};case"left":return{x:Mt.x,y:Mt.y+Mt.height/2};case"right":return{x:Mt.x+Mt.width,y:Mt.y+Mt.height/2}}},$t=T.get(`${Y}:from`)??Zt(tt,It);let Nt=T.get(`${Y}:to`)??Zt(st,zt);const Be=s.get(Z.id),Ot=[$t],ue=It==="top"||It==="bottom",$e=zt==="top"||zt==="bottom",Ce=(()=>{if(ue||$e||Be||T.has(`${Y}:from`)||T.has(`${Y}:to`))return null;const Mt=ot=>Math.min(ot.height/4,["db","store","data_store"].includes(ot.kind??"")?10:6),Yt=Math.max(tt.y+Mt(tt),st.y+Mt(st)),w=Math.min(tt.y+tt.height-Mt(tt),st.y+st.height-Mt(st));if(Yt>w)return null;const U=Math.max(Yt,Math.min(w,(tt.y+tt.height/2+st.y+st.height/2)/2)),ht={x:It==="right"?tt.x+tt.width:tt.x,y:U},pt={x:zt==="left"?st.x:st.x+st.width,y:U},ut=Math.min(ht.x,pt.x),O=Math.max(ht.x,pt.x),V=new Set([o.get(tt.id),o.get(st.id)].filter(ot=>ot!==void 0)),K=t.some(ot=>ot.id!==tt.id&&ot.id!==st.id&&ot.x<O&&ot.x+ot.width>ut&&U>ot.y-u&&U<ot.y+ot.height+u),ct=(i??[]).some(ot=>!V.has(ot.id)&&ot.x<O&&ot.x+ot.width>ut&&U>ot.y-f&&U<ot.y+ot.height+f),yt=Z.label?ei(Z.label).width:0,vt=O-ut>=yt+p*2;return K||ct||!vt?null:{source:ht,target:pt}})();if(tt.id===st.id){const Mt={x:tt.x+tt.width,y:tt.y+tt.height/2},Yt={x:tt.x+tt.width/2,y:tt.y+tt.height},w=Mt.x+h+c+80,U=Yt.y+h+c;Ot[0]=Mt,Ot.push({x:w,y:Mt.y},{x:w,y:U},{x:Yt.x,y:U}),Nt=Yt}else if(t.length<=6&&Z.dashed&&e.some(Mt=>Mt.id!==Z.id&&Mt.from===Z.from&&Mt.to===Z.to)){const Mt={x:tt.x+tt.width,y:tt.y+tt.height/2},Yt={x:st.x+st.width,y:st.y+st.height/2},w=Math.max(Mt.x,Yt.x)+h+c;Ot[0]=Mt,Ot.push({x:w,y:Mt.y},{x:w,y:Yt.y}),Nt=Yt}else if(Wt){const Mt=E.get(Z.id)??0;if(l){const Yt=q.get(Z.id),w=L.get(`${Y}:from`)??{x:tt.x,y:tt.y+tt.height/2},U=L.get(`${Y}:to`)??{x:st.x,y:st.y+st.height/2};Ot[0]=w,Ot.push({x:Yt,y:w.y},{x:Yt,y:U.y}),Nt=U}else{const Yt=x+h+(Mt+1)*c,w=d+Mt*c,U=It==="right"?$t.x+w:$t.x-w,ht=zt==="left"?Nt.x-w:Nt.x+w;Ot.push({x:U,y:$t.y}),Ot.push({x:U,y:Yt}),Ot.push({x:ht,y:Yt}),Ot.push({x:ht,y:Nt.y})}}else if(l&&ue&&$e&&o.has(tt.id)&&o.has(st.id)&&o.get(tt.id)!==o.get(st.id)){const Mt=Z.label?sh(Z.label):0,Yt=new Set([o.get(tt.id),o.get(st.id)].filter(ct=>ct!==void 0)),w=(i??[]).filter(ct=>Yt.has(ct.id)),U=Math.max(tt.x+tt.width,st.x+st.width,...w.map(ct=>ct.x+ct.width)),ht=Math.min(tt.y,st.y),pt=Math.max(tt.y+tt.height,st.y+st.height),ut=(i??[]).some(ct=>!Yt.has(ct.id)&&ct.x>=U&&ct.y<pt&&ct.y+ct.height>ht),O=tt.x+tt.width/2,V=st.x+st.width/2;if((i?.length??0)>=3&&Math.abs(O-V)<12&&!D(H)&&!ut){const ct=Zt(tt,It),yt=Zt(st,zt);if(Ot[0]=ct,Math.abs(ct.x-yt.x)>=.5){const vt=(ct.y+yt.y)/2;Ot.push({x:ct.x,y:vt},{x:yt.x,y:vt})}Nt=yt}else if(ut){const ct={x:tt.x,y:tt.y+tt.height/2},yt={x:st.x,y:st.y+st.height/2},ot=Math.min(ct.x,yt.x,...w.map(kt=>kt.x))-h-Mt/2-p;Ot[0]=ct,Ot.push({x:ot,y:ct.y},{x:ot,y:yt.y}),Nt=yt}else{const ct={x:tt.x+tt.width,y:tt.y+tt.height/2},yt={x:st.x+st.width,y:st.y+st.height/2},vt=Math.max(y+h+d,ct.x+d,yt.x+d);Ot[0]=ct,Ot.push({x:vt,y:ct.y},{x:vt,y:yt.y}),Nt=yt}}else if(l&&ue&&$e&&(D(H)||G(H))){const Mt=Z.label?sh(Z.label):0,Yt={x:tt.x+tt.width,y:tt.y+tt.height/2},w={x:st.x+st.width,y:st.y+st.height/2},U=Math.max(y+h+Mt/2+c,Yt.x+Math.max(Mt+zo,d),w.x+Math.max(Mt+zo,d));Ot[0]=Yt,Ot.push({x:U,y:Yt.y},{x:U,y:w.y}),Nt=w}else if(ue&&$e){const Mt=tt.x+tt.width/2,Yt=st.x+st.width/2,w=Math.abs($t.x-Nt.x)<1;if(Math.abs(Mt-Yt)<5&&!Be&&w){const U=(Mt+Yt)/2;Ot[0]={x:U,y:$t.y},Nt={x:U,y:Nt.y}}else if(Math.abs(Mt-Yt)<5&&!Be){const U=(Mt+Yt)/2;Ot[0]={x:U,y:$t.y},Nt={x:U,y:Nt.y}}else if(Math.abs(Mt-Yt)<5){const U=$t.y<=Nt.y?1:-1,ht=(Mt+Yt)/2+U*Math.abs(Be??0);Ot[0]={x:ht,y:$t.y},Nt={x:ht,y:Nt.y}}else{const U=B.get(Z.id)??($t.y+Nt.y)/2,ht=It==="bottom"?Math.max($t.y+d,U):Math.min($t.y-d,U),pt=zt==="top"?Math.min(Nt.y-d,U):Math.max(Nt.y+d,U);Math.abs(ht-U)>2&&Ot.push({x:$t.x,y:ht}),Ot.push({x:$t.x,y:U}),Ot.push({x:Nt.x,y:U}),Math.abs(pt-U)>2&&Ot.push({x:Nt.x,y:pt})}}else if(!ue&&!$e&&Be){const Mt=$t.x<Nt.x,Yt=Mt?Math.max(tt.y+tt.height,st.y+st.height)+h+Math.abs(Be)/2+(Z.dashed?28:0):Math.min(tt.y,st.y)-h-Math.abs(Be)/2-(Z.dashed?28:0);if(Mt){const w={x:tt.x+tt.width*.65,y:tt.y+tt.height},U={x:st.x+st.width*.35,y:st.y+st.height};Ot[0]=w,Ot.push({x:w.x,y:Yt},{x:U.x,y:Yt}),Nt=U}else{const w=Zt(tt,It),U=Zt(st,zt),ht=It==="right"?w.x+d:w.x-d,pt=zt==="left"?U.x-d:U.x+d;Ot[0]=w,Ot.push({x:ht,y:w.y},{x:ht,y:Yt},{x:pt,y:Yt},{x:pt,y:U.y}),Nt=U}}else if(Ce)Ot[0]=Ce.source,Nt=Ce.target;else if(!ue&&!$e){const Mt=$.get(Z.id)??($t.x+Nt.x)/2,Yt=It==="right"?Math.max($t.x+d,Mt):Math.min($t.x-d,Mt),w=zt==="left"?Math.min(Nt.x-d,Mt):Math.max(Nt.x+d,Mt);Math.abs(Yt-Mt)>2&&Ot.push({x:Yt,y:$t.y}),Ot.push({x:Mt,y:$t.y}),Ot.push({x:Mt,y:Nt.y}),Math.abs(w-Mt)>2&&Ot.push({x:w,y:Nt.y})}else if(ue){const Mt=It==="bottom"?$t.y+d:$t.y-d;Math.abs(Mt-Nt.y)>5?(Ot.push({x:$t.x,y:Mt}),Ot.push({x:Nt.x,y:Mt})):Ot.push({x:$t.x,y:Nt.y})}else{const Mt=It==="right"?$t.x+d:$t.x-d;Math.abs(Mt-Nt.x)>5?(Ot.push({x:Mt,y:$t.y}),Ot.push({x:Mt,y:Nt.y})):Ot.push({x:Nt.x,y:$t.y})}Ot.push(Nt);const we=rt(H,Ot);return{...Z,path:ln(we),points:we}}),at=C.map((H,Y)=>({info:H,route:J[Y]})).toSorted((H,Y)=>+(H.info.fromNode.x<H.info.toNode.x)-+(Y.info.fromNode.x<Y.info.toNode.x)||H.info.fromNode.x-Y.info.fromNode.x||H.info.fromNode.y-Y.info.fromNode.y||H.info.toNode.x-Y.info.toNode.x||H.info.toNode.y-Y.info.toNode.y);for(const{info:H,route:Y}of at){const{fromNode:Z,toNode:tt,fromSide:st,toSide:It}=H;if(l||!["left","right"].includes(st)||!["left","right"].includes(It)||(W.get(Y.id)?.count??1)>1||!Y.points||Y.points.length<=2)continue;const zt=Z.x<tt.x,Wt=zt?Z.x+Z.width:Z.x,Zt=zt?tt.x:tt.x+tt.width;if((Zt-Wt)*(zt?1:-1)<=0)continue;const $t=Y.label?ei(Y.label):void 0,Nt=new Set([o.get(Z.id),o.get(tt.id)]),Be=[...t.map(K=>({node:K,clearance:K.id===Z.id||K.id===tt.id?0:u})),...(i??[]).filter(K=>!Nt.has(K.id)).map(K=>({node:K,clearance:f}))].map(({node:K,clearance:ct})=>({left:K.x-ct,right:K.x+K.width+ct,top:K.y-ct,bottom:K.y+K.height+ct}));Be.push(...(i??[]).map(Xh));const Ot=[...t.map(K=>({left:K.x,right:K.x+K.width,top:K.y,bottom:K.y+K.height})),...Be.slice(t.length)],ue=[...k,...J].filter(K=>K!==Y).flatMap(K=>{const ct=K.label?ei(K.label):void 0,yt=(K.points??[]).slice(1).map((ot,kt)=>({start:K.points[kt],end:ot})),vt=ct&&yt.some(({start:ot,end:kt})=>{if(ot.y!==kt.y||Math.abs(kt.x-ot.x)<ct.width+16||yt.some(Kt=>Math.abs(Kt.end.y-Kt.start.y)>Math.abs(kt.x-ot.x)))return!1;const Xt=(ot.x+kt.x)/2,re={left:Xt-ct.width/2-8,right:Xt+ct.width/2+8,top:ot.y-ct.height/2-8,bottom:ot.y+ct.height/2+8};return!Ot.some(Kt=>re.left<Kt.right&&re.right>Kt.left&&re.top<Kt.bottom&&re.bottom>Kt.top)&&![...k,...J].some(Kt=>Kt!==K&&Kt!==Y&&z(Kt.points??[],[re]))});return yt.map(({start:ot,end:kt})=>{const Xt=Math.abs(ot.y-kt.y)<.001,re=ct&&(Xt||!vt)&&Math.hypot(kt.x-ot.x,kt.y-ot.y)>=(Xt?ct.width:ct.height)+16,Kt=Math.max(c,re&&!Xt?ct.width/2+2:0),xe=Math.max(c,re&&Xt?ct.height/2+2:0);return{left:Math.min(ot.x,kt.x)-Kt,right:Math.max(ot.x,kt.x)+Kt,top:Math.min(ot.y,kt.y)-xe,bottom:Math.max(ot.y,kt.y)+xe}})}),$e=[...Be,...ue],Ce=[...Ot,...ue],we=[],Mt=K=>Math.min(K.height/4,["db","store","data_store"].includes(K.kind??"")?10:6),Yt=Math.max(Z.y+Mt(Z),tt.y+Mt(tt)),w=Math.min(Z.y+Z.height-Mt(Z),tt.y+tt.height-Mt(tt));if(Yt<=w)for(const K of[(Yt+w)/2,Yt,w])we.push([{x:Wt,y:K},{x:Zt,y:K}]);const U=K=>[K.y+K.height/2,K.y+Mt(K),K.y+K.height-Mt(K)],ht=zt?1:-1;if(Math.abs(Zt-Wt)>=c*2){const K=[(Wt+Zt)/2,Wt+ht*d,Zt-ht*d,Wt+ht*c,Zt-ht*c].filter(ct=>(ct-Wt)*ht>=c&&(Zt-ct)*ht>=c);for(const ct of U(Z))for(const yt of U(tt))for(const vt of K)we.push([{x:Wt,y:ct},{x:vt,y:ct},{x:vt,y:yt},{x:Zt,y:yt}])}for(const K of[!1,!0]){const ct={x:Z.x+Z.width/2,y:Z.y+(K?Z.height:0)},yt={x:tt.x+tt.width/2,y:tt.y+(K?tt.height:0)},vt=Math.max(d,($t?.height??0)/2+p),ot=K?Math.max(ct.y,yt.y)+vt:Math.min(ct.y,yt.y)-vt;we.push([ct,{x:ct.x,y:ot},{x:yt.x,y:ot},yt])}const pt=(K,ct=!1)=>{if(!$t)return!0;const yt=y1(K);return(ct?yt.filter(({horizontal:ot})=>ot).toSorted((ot,kt)=>Math.abs(kt.end.x-kt.start.x)-Math.abs(ot.end.x-ot.start.x)).slice(0,1):yt).some(({start:ot,end:kt})=>{const Xt=ot.y===kt.y?$t.width:$t.height;return Math.hypot(kt.x-ot.x,kt.y-ot.y)<Xt+16?!1:(ct?[.5]:[.5,.25,.75]).some(re=>{const Kt=ot.x+(kt.x-ot.x)*re,xe=ot.y+(kt.y-ot.y)*re;return!Ce.some(Ee=>Kt-$t.width/2-8<Ee.right&&Kt+$t.width/2+8>Ee.left&&xe-$t.height/2-8<Ee.bottom&&xe+$t.height/2+8>Ee.top)})})},ut=z(Y.points,Be),O=pt(Y.points,!0),V=we.map(zs).map(K=>({points:K,centeredLabel:pt(K,!0)})).filter(({points:K,centeredLabel:ct})=>(ut||K.length<Y.points.length||K.length===Y.points.length&&(ct&&!O||ct===O&&et(K)<et(Y.points)))&&!z(K,$e)&&pt(K)).toSorted((K,ct)=>K.points.length-ct.points.length||Number(ct.centeredLabel)-Number(K.centeredLabel)||et(K.points)-et(ct.points))[0]?.points;V&&(Y.points=V,Y.path=ln(V))}return[...k,...J];function xt(H){const Y=new Map,Z=st=>{const It=`${st.node.id}:${st.side}`;Y.set(It,[...Y.get(It)??[],st])};for(const st of H){const It=st.fromSide==="top"||st.fromSide==="bottom",zt=st.toSide==="top"||st.toSide==="bottom";Z({key:`${st.index}:from`,node:st.fromNode,side:st.fromSide,desired:It?st.toNode.x+st.toNode.width/2:st.toNode.y+st.toNode.height/2,role:"from",edgeId:st.edge.id}),Z({key:`${st.index}:to`,node:st.toNode,side:st.toSide,desired:zt?st.fromNode.x+st.fromNode.width/2:st.fromNode.y+st.fromNode.height/2,role:"to",edgeId:st.edge.id})}const tt=new Map;for(const st of Y.values()){const It=new Set(st.map(({role:w})=>w)),zt=new Set(st.map(w=>{const U=H.find(ht=>ht.index===Number(w.key.split(":")[0]));return w.role==="from"?U?.toNode.id:U?.fromNode.id}));if(!(st.length>=2&&(It.size>1||zt.size>1)))continue;const Zt=st.toSorted((w,U)=>w.desired-U.desired||w.role.localeCompare(U.role)||w.edgeId.localeCompare(U.edgeId)||w.key.localeCompare(U.key)),{node:$t,side:Nt}=Zt[0],Be=Nt==="top"||Nt==="bottom",Ot=Be?$t.width:$t.height,ue=Be?$t.x+$t.width/2:$t.y+$t.height/2,$e=Math.max(0,Ot-Math.min(32,Ot*.4)),Ce=Zt.map(w=>{const U=H.find(pt=>pt.edge.id===w.edgeId)?.edge,ht=U?.label?ei(U.label):void 0;return ht?Be?ht.width:ht.height:0}),we=It.size===1?Math.max(Na,...Ce.slice(1).map((w,U)=>(w+Ce[U])/2+p)):Na,Mt=Zt.length>1?Math.min(we,$e/(Zt.length-1)):0,Yt=ue-Mt*(Zt.length-1)/2;Zt.forEach((w,U)=>{const ht=Yt+U*Mt;tt.set(w.key,Be?{x:ht,y:Nt==="top"?$t.y:$t.y+$t.height}:{x:Nt==="left"?$t.x:$t.x+$t.width,y:ht})})}return tt}}function G$(e,t,r){const i=new Map(t.map((u,f)=>[u.id,{node:u,index:f}])),a=new Map,o=[],s=(r??[]).map(Xh),n=Math.max(...t.map(u=>u.x+u.width)),l=(e.length>=t.length*1.5?24:32)+Wa,c=u=>{const f=i.get(u.from),p=i.get(u.to);if(!f||!p||f.index===p.index)return!1;if(p.index!==f.index+1)return!0;const g=u.label?ei(u.label,nn(u.label)):null,m=f.node.x+f.node.width/2;return!!(g&&g.height+16>p.node.y-(f.node.y+f.node.height))||s.some(y=>m>y.left&&m<y.right&&f.node.y+f.node.height<y.bottom&&p.node.y>y.top)},h=e.filter(c),d=(u,f,p)=>{const g=h.flatMap(x=>{const C=i.get(x.from),k=i.get(x.to);return!C||!k?[]:k.index>C.index!==p?[]:x.from===u.id?[{edge:x,opposite:k.index,role:"from"}]:x.to===u.id?[{edge:x,opposite:C.index,role:"to"}]:[]}).sort((x,C)=>x.opposite-C.opposite||x.role.localeCompare(C.role)||x.edge.id.localeCompare(C.edge.id)),m=g.findIndex(x=>x.edge.id===f.id),y=g.length>1?Math.min(Na,u.height*.6/(g.length-1)):0;return u.y+u.height/2+(m-(g.length-1)/2)*y};return e.flatMap(u=>{const f=i.get(u.from),p=i.get(u.to);if(!f||!p)return[];const{node:g,index:m}=f,{node:y,index:x}=p,C=a.get(u.from)??0;a.set(u.from,C+1);const k=u.label?ei(u.label,nn(u.label)):null,v=c(u);let T;if(u.from===u.to){const A=u.label?64:28,M={x:g.x+g.width/2,y:g.y},B={x:g.x+g.width,y:g.y+g.height/2},$=n+A,P=g.y-32-C*26;T=[M,{x:M.x,y:P},{x:$,y:P},{x:$,y:B.y},B]}else if(x===m+1&&!v)T=[{x:g.x+g.width/2,y:g.y+g.height},{x:y.x+y.width/2,y:y.y}];else{const A=x>m,M={x:A?g.x+g.width:g.x,y:d(g,u,A)},B={x:A?y.x+y.width:y.x,y:d(y,u,A)},$=Math.max(l,(k?.width??0)/2+10),P=Math.min(M.y,B.y),I=Math.max(M.y,B.y),_=t.filter(D=>D.id!==g.id&&D.id!==y.id&&D.y<I&&D.y+D.height>P),E=Math.max(g.x+g.width+l,y.x+y.width+l,..._.map(D=>D.x+D.width+(k?.width??0)/2+10),...s.filter(D=>D.top<I&&D.bottom>P).map(D=>D.right+$)),L=Math.min(g.x,y.x,..._.map(D=>D.x),...s.filter(D=>D.top<I&&D.bottom>P).map(D=>D.left))-$,q=(k?.width??0)/2,W=o.filter(D=>D.downward===A&&D.top<I&&D.bottom>P);let R=A?Math.max(E,...W.map(D=>D.x+D.halfWidth+q+Wa)):Math.min(L,...W.map(D=>D.x-D.halfWidth-q-Wa));if(!A){const D=o.filter(j=>!j.downward&&(j.from===u.to||j.to===u.from)).toSorted((j,z)=>z.x-j.x),G=j=>{if(W.length||Math.min(M.x,B.x)-j<Na+Wa||I-P<(k?.height??0)+Na)return!1;const z=(Y,Z)=>({left:Math.min(Y.x,Z.x),right:Math.max(Y.x,Z.x),top:Math.min(Y.y,Z.y),bottom:Math.max(Y.y,Z.y)}),Q=(Y,Z,tt)=>Y.left<Z.right+tt&&Y.right>Z.left-tt&&Y.top<Z.bottom+tt&&Y.bottom>Z.top-tt,et=(Y,Z,tt)=>[z(Z,{x:Y,y:Z.y}),z({x:Y,y:Z.y},{x:Y,y:tt.y}),z({x:Y,y:tt.y},tt)],rt=t.map(Y=>({...z(Y,{x:Y.x+Y.width,y:Y.y+Y.height}),id:Y.id})),J=(r??[]).map(Y=>z(Y,{x:Y.x+Y.width,y:Y.y+Y.height})),at=et(j,M,B),xt=[...rt.filter(Y=>Y.id!==g.id&&Y.id!==y.id),...J,...s];if(at.some(Y=>xt.some(Z=>Q(Y,Z,10))))return!1;const H={left:j-q,right:j+q,top:(P+I-(k?.height??0))/2,bottom:(P+I+(k?.height??0))/2};return[...rt,...J,...s].some(Y=>Q(H,Y,8))||H.right+10>Math.min(...t.map(Y=>Y.x+Y.width/2))?!1:o.every(Y=>{const Z=et(Y.x,Y.start,Y.end),tt={left:Y.x-Y.halfWidth,right:Y.x+Y.halfWidth,top:(Y.top+Y.bottom)/2-Y.halfHeight,bottom:(Y.top+Y.bottom)/2+Y.halfHeight};return at.every(st=>Z.every(It=>!Q(st,It,10)))&&(!k||Z.every(st=>!Q(H,st,10)))&&(!Y.halfWidth||at.every(st=>!Q(tt,st,10)))&&(!k||!Y.halfWidth||!Q(H,tt,6))})};for(const j of D)if(Math.abs(R-j.x)<Na){const z=j.x+Na;R=G(z)?z:j.x-Na}}o.push({x:R,top:P,bottom:I,halfWidth:q,downward:A,from:u.from,to:u.to,start:M,end:B,halfHeight:(k?.height??0)/2}),T=[M,{x:M.x+(A?l:-l),y:M.y},{x:R,y:M.y},{x:R,y:B.y},{x:B.x+(A?l:-l),y:B.y},B]}const F=zs(T);return[{...u,path:U$(F),points:F}]})}function U$(e,t=Wa){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];let i=e[0],a=!1;const o=s=>{a?Math.abs(s.y-i.y)<.001?r.push(`H ${s.x}`):r.push(`V ${s.y}`):(r.push(`L ${s.x} ${s.y}`),a=!0),i=s};for(let s=1;s<e.length-1;s+=1){const n=e[s-1],l=e[s],c=e[s+1],h=Math.hypot(l.x-n.x,l.y-n.y),d=Math.hypot(c.x-l.x,c.y-l.y),u=Math.min(t,h/2,d/2),f={x:l.x-(l.x-n.x)/h*u,y:l.y-(l.y-n.y)/h*u},p={x:l.x+(c.x-l.x)/d*u,y:l.y+(c.y-l.y)/d*u};o(f),r.push(`Q ${l.x} ${l.y} ${p.x} ${p.y}`),i=p}return o(e[e.length-1]),r.join(" ")}function zs(e){const t=[],r=(i,a)=>Math.abs(i-a)<.001;for(const i of e){const a=t[t.length-1];if(!(a&&r(a.x,i.x)&&r(a.y,i.y))){for(;t.length>=2;){const o=t[t.length-2],s=t[t.length-1];if(!(r(o.x,s.x)&&r(s.x,i.x)||r(o.y,s.y)&&r(s.y,i.y)))break;t.pop()}t.push(i)}}return t}function V$(e,t,r){const i=e.x+e.width/2,a=e.y+e.height/2,o=t.x+t.width/2,s=t.y+t.height/2,n=o-i,l=s-a;return r?e.y+e.height<=t.y?{fromSide:"bottom",toSide:"top"}:t.y+t.height<=e.y?{fromSide:"top",toSide:"bottom"}:n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:Math.abs(n)>10?n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:l>0?{fromSide:"bottom",toSide:"top"}:{fromSide:"top",toSide:"bottom"}}function w1(e,t=0){const r=e.y,i=Math.max(Math.min(e.width,e.height)*.4,28),a=t*12,o=r-i-a,s=e.x+e.width+i+a,n={x:e.x+e.width/2,y:r},l={x:e.x+e.width,y:e.y+e.height/2},c=[n,{x:n.x,y:o},{x:s,y:o},{x:s,y:l.y},l];return{path:ln(c),points:c}}function Z$(e,t){const r=new Map(t.map(i=>[i.id,i]));return e.map(i=>{const a=Array.isArray(i.nodeIds)?[...i.nodeIds]:[];t.forEach(g=>{g.group===i.id&&!a.includes(g.id)&&a.push(g.id)});const o=a.map(g=>r.get(g)).filter(Boolean);if(o.length===0)return{...i,x:0,y:0,width:0,height:0};const s=Math.min(...o.map(g=>g.x)),n=Math.min(...o.map(g=>g.y)),l=Math.max(...o.map(g=>g.x+g.width)),c=Math.max(...o.map(g=>g.y+g.height)),h=30,d=go.headerHeight,u=30,f=Math.max(l-s+h*2,xu(i.label)),p=(s+l-f)/2;return{...i,x:p,y:n-d,width:f,height:c-n+d+u}})}function K$(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),a=Math.min(...e.map(n=>n.y)),o=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),a=Math.min(a,...t.map(n=>n.y)),o=Math.max(o,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),a=Math.min(a,l.y),o=Math.max(o,l.x),s=Math.max(s,l.y)}return{minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}}var Q$=new Set(["$$slots","$$events","$$legacy","children"]),J$=oi('<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"></path>'),tE=oi('<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>',1),eE=oi('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),rE=oi('<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"></path>'),iE=oi('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),aE=oi('<path d="M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"></path>'),oE=oi('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');function k1(e,t){if(new.target)return _a({component:k1,...e});Fa(t,!0);const r=V1();let i=ze(t,"children",7),a=H1(t,Q$),o=Et(()=>t.weight??r.weight??"regular"),s=Et(()=>t.color??r.color??"currentColor"),n=Et(()=>t.size??r.size??"1em"),l=Et(()=>t.mirrored??r.mirrored??!1);function c(T){let{weight:F,color:A,size:M,mirrored:B,...$}=T;return $}var h={get children(){return i()},set children(T){i(T),Te()},$set:La,$on:(T,F)=>Aa(t,T,F)},d=oE();wp(d,(T,F)=>({xmlns:"http://www.w3.org/2000/svg",role:"img",width:S(n),height:S(n),fill:S(s),transform:S(l)?"scale(-1, 1)":void 0,viewBox:"0 0 256 256",...T,...F}),[()=>c(r),()=>c(a)]);var u=Ne(d);{var f=T=>{var F=za(),A=ri(F);Hn(A,i),ge(T,F)};ur(u,T=>{i()&&T(f)})}var p=qe(u,2);{var g=T=>{var F=J$();ge(T,F)},m=T=>{var F=tE();Hs(),ge(T,F)},y=T=>{var F=eE();ge(T,F)},x=T=>{var F=rE();ge(T,F)},C=T=>{var F=iE();ge(T,F)},k=T=>{var F=aE();ge(T,F)},v=T=>{var F=zn();F.nodeValue=(console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'),""),ge(T,F)};ur(p,T=>{S(o)==="bold"?T(g):S(o)==="duotone"?T(m,1):S(o)==="fill"?T(y,2):S(o)==="light"?T(x,3):S(o)==="regular"?T(C,4):S(o)==="thin"?T(k,5):T(v,-1)})}return Fe(d),ge(e,d),$a(h)}const Lr=(e,t)=>({name:e,component:t}),jh=Lr("cube",iC),sE={actor:Lr("user",pC),data:Lr("database",Lu),data_store:Lr("hard-drive",gC),db:Lr("database",Lu),decision:Lr("code-branch",_u),end:Lr("stop",K1),event:Lr("clock",fC),external:Lr("globe",k1),file:Lr("file-lines",uC),interface:Lr("plug",dC),milestone:Lr("flag",hC),module:jh,node:jh,package:Lr("box",cC),process:Lr("gear",lC),queue:Lr("message",nC),router:Lr("code-branch",_u),server:Lr("server",Bu),service:Lr("server",Bu),start:Lr("play",Z1),state:Lr("circle",sC),switch:Lr("right-left",oC),ui_component:Lr("desktop",aC)};function nE(e){return e&&sE[e]||jh}var yp=er("<wbr/>"),lE=er('<span class="semantic-filename-unit svelte-u4m0nr"> </span><!>',1),cE=er("<br/>"),hE=er(" <!>",1),dE=er('<div class="node-kind-label svelte-u4m0nr"> </div>'),uE=er('<div class="node-content svelte-u4m0nr"><div class="node-row svelte-u4m0nr"><span class="node-icon svelte-u4m0nr" data-node-icon="" aria-hidden="true"><!></span> <div class="node-copy svelte-u4m0nr"><div class="node-label svelte-u4m0nr"><!></div> <!></div></div></div>');function S1(e,t){if(new.target)return _a({component:S1,...e});Fa(t,!0);let r=ze(t,"node",7),i=ze(t,"editable",7,!1),a=ze(t,"dimmed",7,!1),o=ze(t,"highlighted",7,!1),s=ze(t,"styleConfig",7,Ni),n=ze(t,"onMove",7),l=ze(t,"onHover",7),c=ze(t,"onBindingClick",7),h=ce(!1),d=ce(0),u=ce(0),f=ce(void 0);function p(R,D){const G=S(f)?.closest("svg");if(G){const j=G.getScreenCTM();if(j){const z=j.inverse();return{x:z.a*R+z.c*D+z.e,y:z.b*R+z.d*D+z.f}}}return{x:R,y:D}}function g(R){if(!i())return;ft(h,!0);const D=p(R.clientX,R.clientY);ft(d,D.x-r().x),ft(u,D.y-r().y)}function m(R){if(!S(h)||!i())return;const D=p(R.clientX,R.clientY),G=D.x-S(d),j=D.y-S(u);n()?.(G,j)}function y(){ft(h,!1)}function x(){return r().binding?r().binding:r().bindings&&r().bindings.length>0?r().bindings[0]:null}let C=Et(()=>!!x()),k=Et(()=>s()===Ni),v=Et(()=>nE(r().kind)),T=Et(()=>S(v).component),F=Et(()=>S(k)?10:s().paddingX),A=Et(()=>S(k)?7:s().paddingY),M=Et(()=>S(k)?2:s().gap),B=Et(()=>S(k)?11:s().kindFontSize),$=Et(()=>["db","store","data_store"].includes(r().kind??"")),P=Et(()=>du(r().label)),I=Et(()=>{const R=x();if(R)return Ye.diagram_node_openBinding_ariaLabel({label:r().label,type:R.type})});function _(R){const D=x();D&&c()&&c()(R,D)}let E=Et(()=>{const R=["diagram-node-html"];return r().semanticStyle&&R.push(`node-${r().semanticStyle}`),r().kind&&R.push(`node-kind-${r().kind}`),S(C)&&R.push("node-clickable"),i()&&R.push("node-editable"),a()&&R.push("node-dimmed"),o()&&R.push("node-state-highlighted"),R.join(" ")});var L={get node(){return r()},set node(R){r(R),Te()},get editable(){return i()},set editable(R=!1){i(R),Te()},get dimmed(){return a()},set dimmed(R=!1){a(R),Te()},get highlighted(){return o()},set highlighted(R=!1){o(R),Te()},get styleConfig(){return s()},set styleConfig(R=Ni){s(R),Te()},get onMove(){return n()},set onMove(R){n(R),Te()},get onHover(){return l()},set onHover(R){l(R),Te()},get onBindingClick(){return c()},set onBindingClick(R){c(R),Te()},$set:La,$on:(R,D)=>Aa(t,R,D)},q=za();rl("mousemove",vu,m),rl("mouseup",vu,y);var W=ri(q);return vC(W,()=>S(C)?"button":"div",!1,(R,D)=>{ta(R,zt=>ft(f,zt,!0),()=>S(f));var G=()=>l()?.(r().id),j=()=>l()?.(null),z=()=>l()?.(r().id),Q=()=>l()?.(null);wp(R,()=>({type:S(C)?"button":void 0,role:S(C)?"button":void 0,class:S(E),"data-semantic-style":r().semanticStyle??"default","data-default-style":S(k),"data-state-highlighted":o(),"data-dimmed":a(),"data-store-node":S($),"aria-label":S(I),style:`
333
- --label-font-size: ${s().labelFontSize??""}px;
334
- --label-line-height: ${s().labelLineHeight??""};
335
- --kind-font-size: ${S(B)??""}px;
336
- --kind-line-height: ${s().kindLineHeight??""};
337
- --padding-x: ${S(F)??""}px;
338
- --padding-y: ${S(A)??""}px;
339
- --gap: ${S(M)??""}px;
340
- `,onmousedown:g,onclick:_,onmouseenter:G,onmouseleave:j,onfocus:z,onblur:Q}),void 0,void 0,void 0,"svelte-u4m0nr");var et=uE(),rt=Ne(et),J=Ne(rt),at=Ne(J);io(at,()=>S(T),(zt,Wt)=>{Wt(zt,{size:14,weight:"regular",get"data-icon"(){return S(v).name},"data-weight":"regular","aria-hidden":"true"})}),Fe(J);var xt=qe(J,2),H=Ne(xt),Y=Ne(H);{var Z=zt=>{var Wt=za(),Zt=ri(Wt);no(Zt,17,()=>S(P),Tu,($t,Nt,Be)=>{var Ot=lE(),ue=ri(Ot),$e=kr(ue,!0),Ce=qe(ue);{var we=Mt=>{var Yt=yp();ge(Mt,Yt)};ur(Ce,Mt=>{Be<S(P).length-1&&Mt(we)})}or(()=>pr($e,S(Nt))),ge($t,Ot)}),ge(zt,Wt)},tt=zt=>{var Wt=za(),Zt=ri(Wt);no(Zt,17,()=>ec(r().label),Tu,($t,Nt)=>{Hs();var Be=hE(),Ot=ri(Be,!0),ue=qe(Ot);{var $e=we=>{var Mt=cE();ge(we,Mt)},Ce=we=>{var Mt=yp();ge(we,Mt)};ur(ue,we=>{S(Nt).hardBreak?we($e):S(Nt).breakAfter&&we(Ce,1)})}or(()=>pr(Ot,S(Nt).text)),ge($t,Be)}),ge(zt,Wt)};ur(Y,zt=>{S(P)?zt(Z):zt(tt,-1)})}Fe(H),Q1(H,(zt,Wt)=>MC?.(zt,Wt),()=>r().label);var st=qe(H,2);{var It=zt=>{var Wt=dE(),Zt=kr(Wt,!0);or(()=>pr(Zt,r().kind)),ge(zt,Wt)};ur(st,zt=>{r().kind&&zt(It)})}Fe(xt),Fe(rt),Fe(et),ge(D,et)}),ge(e,q),$a(L)}var fE=oi('<circle class="edge-origin" r="1.5" aria-hidden="true"></circle>'),gE=oi('<g><defs><mask maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" style="mask-type: alpha;"><path class="edge-reveal-mask-path" pathLength="1" fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round"></path></mask></defs><g><path class="edge-path" vector-effect="non-scaling-stroke"></path><!></g></g>');function v1(e,t){if(new.target)return _a({component:v1,...e});Fa(t,!0);let r=ze(t,"edge",7),i=ze(t,"dimmed",7,!1),a=ze(t,"highlighted",7,!1),o=ze(t,"markerScope",7,""),s=ze(t,"terminalGap",7,0),n=ze(t,"motionDelay",7,0),l=ze(t,"onmotionchange",7),c=ce(""),h=ce(1),d=[],u="",f,p="",g,m=Et(()=>`edge-reveal-${o()}-${r().id}`),y=Et(()=>{S(c);const z=[...r().points??[],...d],Q=Math.max(16,s()*3),et=z.map(Y=>Y.x),rt=z.map(Y=>Y.y),J=et.length>0?Math.min(...et):0,at=rt.length>0?Math.min(...rt):0,xt=et.length>0?Math.max(...et):1,H=rt.length>0?Math.max(...rt):1;return{x:J-Q,y:at-Q,width:Math.max(1,xt-J)+Q*2,height:Math.max(1,H-at)+Q*2}});function x(z,Q){if(z.length<2||Q<=0)return z;const et=z.map(xt=>({...xt})),rt=et.at(-1),J=et.at(-2),at=Math.hypot(rt.x-J.x,rt.y-J.y);return at<=Q?z:(rt.x-=(rt.x-J.x)/at*Q,rt.y-=(rt.y-J.y)/at*Q,et)}function C(z){el(()=>l()?.(r().id,z))}function k(z){return g?.ownerSVGElement?.querySelector(`[data-node-id="${CSS.escape(z)}"]`)}function v(z){if(!z)return null;const Q=getComputedStyle(z),et=(rt,J)=>{const at=Number.parseFloat(Q.getPropertyValue(rt));return Number.isFinite(at)?at:J};return{x:et("x",z.x.baseVal.value),y:et("y",z.y.baseVal.value),width:et("width",z.width.baseVal.value),height:et("height",z.height.baseVal.value)}}function T(z,Q,et=0){if(!Q)return z;const rt=Q.x+Q.width/2,J=Q.y+Q.height/2,at=Q.width/2,xt=Q.height/2,H=z.x-rt,Y=z.y-J;if(Math.hypot(H,Y)<.001)return z;const tt=Math.abs(H)<.001?1/0:at/Math.abs(H),st=Math.abs(Y)<.001?1/0:xt/Math.abs(Y);return tt<=st?{x:rt+Math.sign(H)*(at+et),y:J+Y*tt}:{x:rt+H*st,y:J+Math.sign(Y)*(xt+et)}}function F(z,Q,et){const rt=1-et;return 3*rt*rt*et*z+3*rt*et*et*Q+et**3}function A(z){let Q=0,et=1,rt=z;for(let J=0;J<12;J+=1)F(.16,.3,rt)<z?Q=rt:et=rt,rt=(Q+et)/2;return F(1,1,rt)}function M(z,Q){if(z.length<2)return Array.from({length:Q},()=>z[0]??{x:0,y:0});const et=z.slice(1).map((J,at)=>Math.hypot(J.x-z[at].x,J.y-z[at].y)),rt=et.reduce((J,at)=>J+at,0);return Array.from({length:Q},(J,at)=>{let xt=rt*at/(Q-1),H=0;for(;H<et.length-1&&xt>et[H];)xt-=et[H],H+=1;const Y=z[H],Z=z[H+1],tt=et[H]?xt/et[H]:0;return{x:Y.x+(Z.x-Y.x)*tt,y:Y.y+(Z.y-Y.y)*tt}})}ba(()=>{const z=x(r().points??[],s()),Q=s()>0?ln(z):r().path;if(Ys()||u===Q&&f===r()||d.length<2||z.length<2){ft(c,Q,!0),d=z,u=Q,f=r(),p=r().id,ft(h,1),C(!1);return}const rt=M(d,24),J=M(z,24),at=p===r().id,xt=d[0],H=d[d.length-1],Y=z[0],Z=z[z.length-1],tt=k(r().from),st=k(r().to),It=at&&Math.abs(Y.x-xt.x-(Z.x-H.x))<1&&Math.abs(Y.y-xt.y-(Z.y-H.y))<1;u=Q,f=r(),p=r().id;let zt=0,Wt;ft(h,0),C(!0);const Zt=Be=>{const ue=Math.max(0,Math.min(1,(Be-$t)/220)),$e=A(ue),Ce=rt.map((we,Mt)=>({x:we.x+(J[Mt].x-we.x)*$e,y:we.y+(J[Mt].y-we.y)*$e}));It&&(Ce[0]=z[0],Ce[Ce.length-1]=z[z.length-1]),Ce[0]=T(Ce[0],v(tt)),Ce[Ce.length-1]=T(Ce[Ce.length-1],v(st),s()),d=Ce,ft(h,ue,!0),ft(c,ln(Ce),!0),ue<1?zt=requestAnimationFrame(Zt):(ft(c,Q,!0),d=z,ft(h,1),C(!1))};let $t;const Nt=()=>{$t=performance.now(),zt=requestAnimationFrame(Zt)};return n()>0?Wt=window.setTimeout(Nt,n()):Nt(),()=>{Wt!==void 0&&window.clearTimeout(Wt),cancelAnimationFrame(zt),C(!1)}});let B=Et(()=>{const z=["diagram-edge"];return r().semanticStyle&&z.push(`edge-${r().semanticStyle}`),r().animated&&z.push("edge-animated"),r().dashed&&z.push("edge-dashed"),i()&&z.push("edge-dimmed"),a()&&z.push("edge-state-highlighted"),z.join(" ")});const $=new Set(["danger","success","warning","muted","inactive","highlighted","active"]);let P=Et(()=>o()?`-${o()}`:""),I=Et(()=>r().semanticStyle&&$.has(r().semanticStyle)?`url(#arrowhead-${r().semanticStyle}${S(P)})`:`url(#arrowhead${S(P)})`);var _={get edge(){return r()},set edge(z){r(z),Te()},get dimmed(){return i()},set dimmed(z=!1){i(z),Te()},get highlighted(){return a()},set highlighted(z=!1){a(z),Te()},get markerScope(){return o()},set markerScope(z=""){o(z),Te()},get terminalGap(){return s()},set terminalGap(z=0){s(z),Te()},get motionDelay(){return n()},set motionDelay(z=0){n(z),Te()},get onmotionchange(){return l()},set onmotionchange(z){l(z),Te()},$set:La,$on:(z,Q)=>Aa(t,z,Q)},E=gE(),L=Ne(E),q=Ne(L),W=kr(q);Fe(L);var R=qe(L),D=Ne(R),G=qe(D);{var j=z=>{var Q=fE();or(()=>{fe(Q,"cx",r().points[0].x),fe(Q,"cy",r().points[0].y)}),ge(z,Q)};ur(G,z=>{(r().animated||r().dashed)&&r().points?.[0]&&z(j)})}return Fe(R),Fe(E),ta(E,z=>g=z,()=>g),or(z=>{ra(E,0,kp(S(B))),fe(E,"data-edge-id",r().id),fe(E,"data-edge-from",r().from),fe(E,"data-edge-to",r().to),fe(E,"data-edge-motion-progress",S(h)),fe(q,"id",S(m)),fe(q,"x",S(y).x),fe(q,"y",S(y).y),fe(q,"width",S(y).width),fe(q,"height",S(y).height),fe(W,"d",S(c)),fe(W,"stroke-width",z),fe(R,"mask",`url(#${S(m)})`),fe(D,"d",S(c)),fe(D,"marker-end",S(I))},[()=>Math.max(12,s()*3)]),ge(e,E),$a(_)}var pE=oi('<g><rect class="group-bg"></rect><text text-anchor="middle" dominant-baseline="middle" class="group-label"> </text></g>');function M1(e,t){if(new.target)return _a({component:M1,...e});Fa(t,!0);let r=ze(t,"group",7),i=ze(t,"dimmed",7,!1),a=ze(t,"onHover",7),o=Et(()=>{const f=["diagram-group"];return r().semanticStyle&&f.push(`group-${r().semanticStyle}`),i()&&f.push("group-dimmed"),f.join(" ")});function s(){a()?.(r().id)}function n(){a()?.(null)}var l={get group(){return r()},set group(f){r(f),Te()},get dimmed(){return i()},set dimmed(f=!1){i(f),Te()},get onHover(){return a()},set onHover(f){a(f),Te()},$set:La,$on:(f,p)=>Aa(t,f,p)},c=pE(),h=Ne(c),d=qe(h),u=kr(d,!0);return Fe(c),or(()=>{ra(c,0,kp(S(o))),fe(c,"data-group-id",r().id),fe(h,"x",r().x),fe(h,"y",r().y),fe(h,"width",r().width),fe(h,"height",r().height),fe(d,"x",r().x+r().width/2),fe(d,"y",r().y+go.centerY),pr(u,r().label)}),rl("mouseenter",c,s),rl("mouseleave",c,n),ge(e,c),$a(l)}var mE=er('<div class="narrative-title svelte-1v8paz2"> </div>'),yE=er('<div class="narrative-text svelte-1v8paz2"> </div>'),xE=er('<div class="narrative svelte-1v8paz2"><!> <!></div>'),bE=er('<div class="text-xs font-medium mb-0.5"> </div>'),CE=er('<div class="text-ui text-subtle leading-snug"> </div>'),wE=er('<div class="p-2.5"><!> <!></div>'),kE=er("<!> <!>",1),SE=er('<div class="navigation-buttons svelte-1v8paz2"><!> <!></div>'),vE=er('<div class="diagram-controls svelte-1v8paz2"><div class="controls-inner svelte-1v8paz2"><div class="narrative-region svelte-1v8paz2" aria-live="polite" aria-atomic="true"><!></div> <div class="state-navigation svelte-1v8paz2" role="group"><div class="stepper svelte-1v8paz2"></div> <span class="step-counter svelte-1v8paz2"> </span> <!></div></div></div>');function T1(e,t){if(new.target)return _a({component:T1,...e});Fa(t,!0);let r=ze(t,"states",7),i=ze(t,"currentStateId",7),a=ze(t,"onStateChange",7);function o(_){return _?typeof _=="string"?{text:_}:_:null}let s=Et(()=>i()?r().findIndex(_=>_.id===i()):-1),n=Et(()=>S(s)>=0?r()[S(s)]:null),l=ce(-1),c=Et(()=>S(l)<S(s)?"left":"right"),h=ce(null),d=ce(null),u;function f(){ft(l,S(s),!0),S(s)>0&&a()(r()[S(s)-1].id)}function p(){ft(l,S(s),!0),S(s)<r().length-1&&a()(r()[S(s)+1].id)}function g(_){ft(l,S(s),!0),ft(h,null),a()(r()[_].id)}function m(_){u!==void 0&&cancelAnimationFrame(u);const E=r()[_]?.id,L=r(),q=S(d);u=requestAnimationFrame(()=>{u=void 0,!(q!==S(d)||E!==i()||L!==r())&&S(d)?.querySelector(`[data-diagram-step-index="${_}"]`)?.focus({preventScroll:!0})})}function y(_,E){if(r().length<=1)return;let L=E;if(_.key==="ArrowLeft")L=Math.max(0,E-1);else if(_.key==="ArrowRight")L=Math.min(r().length-1,E+1);else if(_.key==="Home")L=0;else if(_.key==="End")L=r().length-1;else return;_.preventDefault(),L!==E&&(g(L),m(L))}Cp(()=>{u!==void 0&&cancelAnimationFrame(u)});var x={get states(){return r()},set states(_){r(_),Te()},get currentStateId(){return i()},set currentStateId(_){i(_),Te()},get onStateChange(){return a()},set onStateChange(_){a(_),Te()},$set:La,$on:(_,E)=>Aa(t,_,E)},C=vE(),k=Ne(C),v=Ne(k),T=Ne(v);{var F=_=>{const E=Et(()=>o(S(n).narrative));var L=za(),q=ri(L);vp(q,()=>S(s),W=>{var R=xE(),D=Ne(R);{var G=Q=>{var et=mE(),rt=kr(et,!0);or(()=>pr(rt,S(E).title)),ge(Q,et)};ur(D,Q=>{S(E)?.title&&Q(G)})}var j=qe(D,2);{var z=Q=>{var et=yE(),rt=kr(et,!0);or(()=>pr(rt,S(E).text)),ge(Q,et)};ur(j,Q=>{S(E)?.text&&Q(z)})}Fe(R),xa(1,R,()=>Au,()=>({axis:"x",distance:S(c)==="left"?8:-8,tier:"fast"})),xa(2,R,()=>Au,()=>({axis:"x",distance:S(c)==="left"?-8:8,tier:"fast"})),ge(W,R)}),ge(_,L)};ur(T,_=>{S(n)?.narrative&&_(F)})}Fe(v);var A=qe(v,2),M=Ne(A);no(M,23,r,_=>_.id,(_,E,L)=>{const q=Et(()=>o(S(E).narrative));var W=kE(),R=ri(W);{let j=Et(()=>S(L)===S(s)?"active":""),z=Et(()=>S(L)<S(s)?"completed":""),Q=Et(()=>S(L)===S(s)?"step":void 0),et=Et(()=>S(L)===S(s)?0:-1),rt=Et(()=>Ye.diagram_controls_state_ariaLabel({number:S(L)+1,title:S(q)?.title||Ye.diagram_controls_stateNumber_label({number:S(L)+1})}));Ho(R,{variant:"ghost",size:"icon-compact",iconOnly:!0,get class(){return`stepper-dot ${S(j)??""} ${S(z)??""}`},get"data-diagram-step-index"(){return S(L)},get style(){return`anchor-name: --segment-${S(L)??""};`},onclick:()=>g(S(L)),onkeydown:J=>y(J,S(L)),onmouseenter:()=>ft(h,S(L),!0),onmouseleave:()=>ft(h,null),get"aria-current"(){return S(Q)},get tabindex(){return S(et)},get"aria-label"(){return S(rt)}})}var D=qe(R,2);{var G=j=>{SC(j,{get anchor(){return`--segment-${S(L)??""}`},position:"top",class:"rounded-md !pointer-events-none",children:(z,Q)=>{var et=wE(),rt=Ne(et);{var J=H=>{var Y=bE(),Z=kr(Y,!0);or(()=>pr(Z,S(q).title)),ge(H,Y)};ur(rt,H=>{S(q).title&&H(J)})}var at=qe(rt,2);{var xt=H=>{var Y=CE(),Z=kr(Y,!0);or(()=>pr(Z,S(q).text)),ge(H,Y)};ur(at,H=>{S(q).text&&H(xt)})}Fe(et),ge(z,et)},$$slots:{default:!0}})};ur(D,j=>{S(h)===S(L)&&S(q)&&j(G)})}ge(_,W)}),Fe(M);var B=qe(M,2),$=kr(B),P=qe(B,2);{var I=_=>{var E=SE(),L=Ne(E);{let W=Et(()=>S(s)<=0),R=Et(()=>Ye.diagram_controls_previousStep_ariaLabel());Ho(L,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:f,get disabled(){return S(W)},get"aria-label"(){return S(R)},children:(D,G)=>{Qs(D,{get icon(){return mC},class:"text-ui"})},$$slots:{default:!0}})}var q=qe(L,2);{let W=Et(()=>S(s)>=r().length-1),R=Et(()=>Ye.diagram_controls_nextStep_ariaLabel());Ho(q,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:p,get disabled(){return S(W)},get"aria-label"(){return S(R)},children:(D,G)=>{Qs(D,{get icon(){return yC},class:"text-ui"})},$$slots:{default:!0}})}Fe(E),ge(_,E)};ur(P,_=>{r().length>1&&_(I)})}return Fe(A),ta(A,_=>ft(d,_),()=>S(d)),Fe(k),Fe(C),or((_,E)=>{fe(A,"aria-label",_),fe(B,"aria-label",E),pr($,`${S(s)+1}/${r().length??""}`)},[()=>Ye.diagram_controls_walkthrough_ariaLabel(),()=>Ye.diagram_controls_stepCounter_ariaLabel({current:S(s)+1,total:r().length})]),ge(e,C),$a(x)}function lh(e,t){const r=new Set(e),i=new Set(t);return{shared:t.filter(a=>r.has(a)),departing:e.filter(a=>!i.has(a)),entering:t.filter(a=>!r.has(a))}}function xp(e){const t=e.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);return t?.every(Number.isFinite)?t:null}function ME(e,t){if(e===t)return!0;const r=xp(e),i=xp(t);return r!==null&&i!==null&&r.length===i.length&&r.every((a,o)=>Math.abs(a-i[o])<.001)}function TE(e,t){return ME(e,t)?[]:[{transform:e},{transform:t}]}function BE(e,t,r,i,a){const o=t.x-e.x,s=t.y-e.y,n=Math.hypot(o,s),l=Math.abs(o)>=Math.abs(s)?r.width:r.height;if(n<=l+2*a)return[];const c=(l/2+a)/n,h=1-c,d=[];for(const p of i){const g=p.padding??0,m=[[e.x,o,p.x-r.width/2-g,p.x+p.width+r.width/2+g],[e.y,s,p.y-r.height/2-g,p.y+p.height+r.height/2+g]];let y=c,x=h;for(const[C,k,v,T]of m)if(k===0)(C<v||C>T)&&(x=-1);else{const F=(v-C)/k,A=(T-C)/k;y=Math.max(y,Math.min(F,A)),x=Math.min(x,Math.max(F,A))}y<=x&&d.push([y,x])}d.sort((p,g)=>p[0]-g[0]);const u=[];let f=c;for(const[p,g]of d)p>f&&u.push((f+p)/2),f=Math.max(f,g);return f<h&&u.push((f+h)/2),u}function _E(e,t){return(e===null||typeof e!="object"&&typeof e!="function")&&Object.is(e,t)}function ro(e,t,r=[]){const i=Reflect.ownKeys(e);return i.length===Reflect.ownKeys(t).length&&i.every(a=>Object.hasOwn(t,a)&&(r.includes(a)||_E(Reflect.get(e,a),Reflect.get(t,a))))}function qn(e,t,r){return e===void 0&&t===void 0||!!e&&!!t&&e.length===t.length&&e.every((i,a)=>r(i,t[a]))}function LE(e,t){return e!==null&&ro(e,t,["nodes","edges","groups","bounds"])&&ro(e.bounds,t.bounds)&&qn(e.nodes,t.nodes,(r,i)=>ro(r,i,["size"])&&(r.size===void 0&&i.size===void 0||!!r.size&&!!i.size&&ro(r.size,i.size)))&&qn(e.edges,t.edges,(r,i)=>ro(r,i,["points"])&&qn(r.points,i.points,ro))&&qn(e.groups,t.groups,ro)}var AE=er('<div class="diagram-actions svelte-10vg205" role="toolbar"><!></div>'),FE=er('<div class="diagram-feedback svelte-10vg205" role="alert"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),$E=er('<div class="diagram-feedback svelte-10vg205" role="status"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),EE=oi("<g><!></g>"),PE=oi('<g class="edge-reveal"><!></g>'),bp=er('<div class="edge-label-html"><span class="edge-label-text"> </span></div>'),IE=oi("<foreignObject><!></foreignObject>"),OE=oi('<foreignObject class="diagram-geometry-motion svelte-10vg205"><!></foreignObject>'),RE=oi('<g class="diagram-geometry-motion svelte-10vg205"><!><!><!><!></g>'),DE=er('<div class="diagram-content svelte-10vg205"><svg class="diagram-svg-layer svelte-10vg205"><defs><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker></defs><!></svg></div>'),NE=er('<div class="diagram-footer svelte-10vg205"><!></div>'),qE=er("<div><!> <div><!></div> <!></div>");function WE(e,t){if(new.target)return _a({component:WE,...e});Fa(t,!0);let r=ze(t,"diagram",7),i=ze(t,"onUpdate",7),a=ze(t,"editable",7,!1),o=ze(t,"styleConfig",7,Ni),s=ze(t,"onBindingClick",7),n=ze(t,"viewResetKey",7);const l=32,c=12,h=10,d=5,u=.5;let f=ce(!1),p=ce(0),g,m;function y(nt){return S(f)||Ys(S(M)?.ownerDocument)?0:nt}let x=ce(null),C=null,k=ce(!1),v=ce(!1),T=ce(1),F=ce(900),A=ce(900),M=ce(null),B=ce(null),$=ce(null),P=ce(void 0),I=ce(!1),_,E,L=ce(0);Gh(()=>{let nt=!1;return document.fonts?.ready.then(()=>{nt||ft(L,S(L)+1)}),()=>{nt=!0}});let q=ce(fi(r().currentStateId??(r().states&&r().states.length>0?r().states[0].id:void 0))),W=Et(()=>r().states?.find(nt=>nt.id===S(q))??null),R=ce(fi(S(q))),D,G=Et(()=>r().states?.find(nt=>nt.id===S(R))??S(W)),j=Et(()=>S(W)?.camera?.zoom??1),z=Et(()=>S(W)!==null),Q=Et(()=>S(B)!==null&&S(B)>0?S(B):S(M)?.clientWidth??null),et=Et(()=>S(A)<500||S(z)&&(S($)??S(Q)??0)>0&&(S($)??S(Q)??0)<500),rt=Et(()=>S(et)?4:l),J=Et(()=>S(et)?{...o(),maxWidth:Math.min(o().maxWidth,150),maxLines:Math.max(o().maxLines,5),paddingX:Math.min(o().paddingX,10)}:o()),at=Et(()=>S(j)*(S(v)||S(z)?S(T):1)),xt=Et(()=>Math.max(c/S(J).labelFontSize,h/(o()===Ni?11:S(J).kindFontSize))),H=Et(()=>(d+u)/S(at)),Y=Et(()=>8/S(at)),Z=ce(!1),tt=ce(fi([])),st=ce(fi([])),It=ce(fi([])),zt=ce(fi([])),Wt=ce(fi([])),Zt=ce(fi([])),$t=ce(fi(new Map)),Nt=ce(fi([])),Be=ce(fi([])),Ot=ce(fi([])),ue=ce(fi(new Map)),$e=ce(!1),Ce=ce(!1),we=ce(!0);const Mt=new Set;let Yt=ce(void 0),w=ce(!0),U=0,ht,pt=0,ut=ce("settled"),O=[];const V=180,K="cubic-bezier(0.65, 0, 0.35, 1)",ct=220,yt=160,vt=180,ot=180,kt=60,Xt=ot-kt;function re(){const nt=S(Yt)?.querySelector(".diagram-svg-layer"),Pt=S(Yt)?.querySelector(".diagram-geometry-motion")?.getScreenCTM?.();return{camera:nt?getComputedStyle(nt).transform:null,screenMatrix:Pt?new DOMMatrix([Pt.a,Pt.b,Pt.c,Pt.d,Pt.e,Pt.f]):null}}function Kt(nt){if(y(1)===0||!S(Yt))return[];const bt=S(Yt).querySelector(".diagram-svg-layer"),Pt=S(Yt).querySelector(".diagram-svg-layer > g");if(!bt||!Pt||!nt.camera)return[];for(const oe of bt.getAnimations({subtree:!1}))oe.cancel();const Qt=getComputedStyle(bt).transform;let te=nt.camera;const Bt=nt.screenMatrix?bt.getScreenCTM():null;if(Bt&&nt.screenMatrix){const oe=new DOMMatrix([Bt.a,Bt.b,Bt.c,Bt.d,Bt.e,Bt.f]),pe=new DOMMatrix(getComputedStyle(Pt).transform);te=new DOMMatrix(Qt).multiply(oe.inverse()).multiply(nt.screenMatrix).multiply(pe.inverse()).toString()}const le=TE(te,Qt);if(le.length===0)return[];const ae=bt.animate(le,{duration:V,easing:K});return ae.finished.catch(()=>{}),[ae]}function xe(nt,{delay:bt=0,duration:Pt}){return{delay:bt,duration:y(Pt),easing:Fu,css:Qt=>`--edge-reveal-progress: ${Qt};`}}function Ee(){return S(Yt)?.getAnimations?S(Yt).getAnimations({subtree:!0}).filter(nt=>{const bt=Number(nt.effect?.getComputedTiming().endTime);return Number.isFinite(bt)&&nt.playState!=="finished"&&nt.playState!=="idle"}):[]}async function si(nt){if(await ch(),await new Promise(Pt=>requestAnimationFrame(()=>Pt())),nt!==pt)return!1;const bt=Ee();return await Promise.allSettled(bt.map(Pt=>Pt.finished)),nt===pt}async function da(nt,bt,Pt){if(Pt.length>0&&(await Promise.allSettled(Pt.map(te=>te.finished)),nt!==pt)||S(Nt).length===0&&S(Rt).length>0&&(ft(ut,"scene"),ft(we,!0),Te(),!await si(nt))||(ft(ut,"exit"),ft($e,!1),ft(Ce,!1),ft(R,bt,!0),Te(),!await si(nt)))return;const Qt=re();ft(zt,[],!0),ft(Wt,[],!0),ft(Zt,[],!0),ft($t,new Map,!0),ft(Nt,[],!0),ft(Be,[],!0),ft(Ot,[],!0),ft(ue,new Map,!0),ft(ut,"camera"),Te(),O=Kt(Qt),await si(nt)&&(ft(ut,"scene"),ft(we,!0),Te())}function ua(){if(!S(Yt))return"";const nt=S(Yt).getBoundingClientRect(),bt=[".diagram-content",".diagram-svg-layer",".diagram-geometry-motion","[data-group-id]",".group-bg",".group-label",".diagram-edge",".edge-path",".edge-label-container","[data-node-id]",".diagram-node-html"].join(",");return[...S(Yt).querySelectorAll(bt)].map(Pt=>{const Qt=Pt.getBoundingClientRect(),te=getComputedStyle(Pt);return[Pt.tagName,Pt.getAttribute("data-node-id"),Pt.getAttribute("data-edge-id"),Pt.getAttribute("data-group-id"),Pt.getAttribute("class"),Pt.getAttribute("d"),(Qt.x-nt.x).toFixed(3),(Qt.y-nt.y).toFixed(3),Qt.width.toFixed(3),Qt.height.toFixed(3),te.opacity,te.transform].join("|")}).join(`
341
- `)}function ks(nt,bt){ht=requestAnimationFrame(()=>{if(nt!==U)return;E?.();const Pt=ua(),Qt=S(ut)==="camera"||S(ut)==="exit"||Mt.size>0||Ee().length>0;if(!Qt&&bt!==void 0&&Pt===bt){if(S(Z)){ft(Z,!1),ht=void 0,ch().then(()=>{nt===U&&ks(nt)});return}ft(w,!0),ft(ut,"settled"),ni(),ht=void 0;return}ks(nt,Qt?void 0:Pt)})}function Ss(){U+=1;const nt=U;ht!==void 0&&cancelAnimationFrame(ht),ht=void 0,y(1)===0&&ft(Z,!1),ft(w,!1),queueMicrotask(()=>{nt===U&&ks(nt)})}Cp(()=>{ni(),pt+=1,U+=1,ht!==void 0&&cancelAnimationFrame(ht),g!==void 0&&cancelAnimationFrame(g),Qa();for(const nt of O)nt.cancel();O=[],Mt.clear()});let it=ce(null),dt=ce(null),Ct=Et(()=>{if(!S(it))return new Set;const nt=new Set;return nt.add(S(it)),r().model.edges.forEach(bt=>{bt.from===S(it)&&nt.add(bt.to),bt.to===S(it)&&nt.add(bt.from)}),nt}),_t=Et(()=>{if(!S(it))return new Set;const nt=new Set;return r().model.edges.forEach(bt=>{(bt.from===S(it)||bt.to===S(it))&&nt.add(bt.id)}),nt}),wt=Et(()=>{if(!S(dt))return new Set;const nt=new Set;if(r().model.groups){const bt=r().model.groups.find(Pt=>Pt.id===S(dt));bt?.nodeIds&&bt.nodeIds.forEach(Pt=>nt.add(Pt))}return r().model.nodes.forEach(bt=>{bt.group===S(dt)&&nt.add(bt.id)}),nt}),X=Et(()=>{if(!S(dt))return new Set;const nt=S(wt),bt=new Set;return r().model.edges.forEach(Pt=>{(nt.has(Pt.from)||nt.has(Pt.to))&&bt.add(Pt.id)}),bt}),St=Et(()=>S(G)?.highlightedNodes&&S(G).highlightedNodes.length>0?new Set(S(G).highlightedNodes):null),At=Et(()=>S(G)?.highlightedEdges&&S(G).highlightedEdges.length>0?new Set(S(G).highlightedEdges):null),Dt=Et(()=>S(St)!==null||S(At)!==null),qt=Et(()=>S(W)?.visibleNodes??r().model.nodes.map(nt=>nt.id)),Ut=Et(()=>new Set(S(qt))),de=Et(()=>S(W)?.visibleEdges??r().model.edges.map(nt=>nt.id)),Se=Et(()=>S(de).filter(nt=>{const bt=r().model.edges.find(Pt=>Pt.id===nt);return bt&&S(Ut).has(bt.from)&&S(Ut).has(bt.to)})),Rt=Et(()=>S(x)?.nodes.filter(nt=>S(qt).includes(nt.id))??[]),Ae=Et(()=>S(x)?.edges.filter(nt=>S(Se).includes(nt.id))??[]),Ue=Et(()=>{S(L);const nt=new Map,bt=[],Pt=(le,ae,oe,pe,be=0)=>S(Rt).some(ye=>!(le+oe+be<ye.x||le-be>ye.x+ye.width||ae+pe+be<ye.y||ae-be>ye.y+ye.height)),Qt=(le,ae,oe,pe,be=6)=>bt.some(ye=>!(le+oe+be<ye.x||le-be>ye.x+ye.width||ae+pe+be<ye.y||ae-be>ye.y+ye.height)),te=(le,ae,oe,pe)=>(S(x)?.groups??[]).some(be=>le<be.x+be.width&&le+oe>be.x&&ae<be.y+34&&ae+pe>be.y),Bt=(le,ae,oe,pe,be,ye=2)=>S(Ae).some($r=>$r.id!==be&&($r.points??[]).slice(0,-1).some((Ci,Pa)=>{const ui=$r.points[Pa+1],Jr=Math.max(1,Math.ceil(Math.hypot(ui.x-Ci.x,ui.y-Ci.y)/4));for(let wi=0;wi<=Jr;wi+=1){const Ia=Ci.x+(ui.x-Ci.x)*wi/Jr,yr=Ci.y+(ui.y-Ci.y)*wi/Jr;if(Ia>le-ye&&Ia<le+oe+ye&&yr>ae-ye&&yr<ae+pe+ye)return!0}return!1}));for(const le of S(Ae)){if(!le.label||!le.points||le.points.length<2)continue;const ae=le.points,oe=ae.length===2&&Math.abs(ae[0].x-ae[1].x)<.5?Math.abs(ae[0].y-ae[1].y):void 0,{width:pe,height:be,lines:ye}=ei(le.label,S(et)?nn(le.label??"",oe):void 0),$r=ye>3,Ci=r().model.edges.find(({id:yr})=>yr===le.id),Pa=Ci&&r().model.edges.find(yr=>yr.from===Ci.to&&yr.to===Ci.from);if(Pa&&ae.length===2){const yr=ei(Pa.label??"",S(et)?nn(Pa.label??""):void 0),Ze=Math.abs(ae[1].x-ae[0].x),nr=Math.abs(ae[1].y-ae[0].y),Br=Math.max(Ze,nr),tr=Ze>=nr?(pe+yr.width)/2:(be+yr.height)/2,Le=S(Se).includes(Pa.id)?Math.max(.05,Math.min(.35,(1-(tr+6)/Br)/2)):.35,wr=Ze>=nr?pe:be,Er=Math.min(.5,(wr/2+4/S(at))/Br),hr=Math.max(Er,Math.min(1-Er,Le)),dr=ae[0].x+(ae[1].x-ae[0].x)*hr-pe/2,Nr=ae[0].y+(ae[1].y-ae[0].y)*hr-be/2;if(!Pt(dr,Nr,pe,be,8)&&!te(dr,Nr,pe,be)&&!Bt(dr,Nr,pe,be,le.id)&&!Qt(dr,Nr,pe,be,1)){nt.set(le.id,{x:dr,y:Nr,width:pe,height:be,truncated:$r}),bt.push({x:dr,y:Nr,width:pe,height:be});continue}}const ui=[],Jr=[],wi=[],Ia=(yr,Ze,nr,Br=ui)=>{const tr=yr-pe/2,Le=Ze-be/2;if(Pt(tr,Le,pe,be,8)||te(tr,Le,pe,be)||Bt(tr,Le,pe,be,le.id))return;const wr={x:tr,y:Le,score:nr};if(Qt(tr,Le,pe,be)){Qt(tr,Le,pe,be,1)||Jr.push(wr);return}Br.push(wr)};for(let yr=0;yr<ae.length-1;yr++){const Ze=ae[yr],nr=ae[yr+1],Br=Math.abs(nr.x-Ze.x),tr=Math.abs(nr.y-Ze.y),Le=Math.hypot(Br,tr);if(Le<8)continue;const wr=Br>=tr,Er=wr?pe:be,hr=[.5,.25,.75,.2,.3,.4,.6,.7,.8,.125,.875,.05,.1,.15,.85,.9,.95];for(const dr of hr){const Nr=Le*Math.min(dr,1-dr);if(Le*Math.max(dr,1-dr)<Er/2+S(Y))continue;const vs=Ze.x+(nr.x-Ze.x)*dr,li=Ze.y+(nr.y-Ze.y)*dr;Ia(vs,li,Le+(wr?1e3:0)-Math.abs(dr-.5)*16,Nr>=Er/2+S(Y)?ui:wi)}}if(!ui.length&&!Jr.length&&!wi.length){const yr=[...S(Rt).map(Ze=>({...Ze,padding:8})),...(S(x)?.groups??[]).map(Ze=>({...Ze,height:34,padding:0})),...bt.map(Ze=>({...Ze,padding:1})),...S(Ae).filter(Ze=>Ze.id!==le.id).flatMap(Ze=>(Ze.points??[]).slice(1).map((nr,Br)=>{const tr=Ze.points[Br];return{x:Math.min(tr.x,nr.x),y:Math.min(tr.y,nr.y),width:Math.abs(nr.x-tr.x),height:Math.abs(nr.y-tr.y),padding:2}}))];for(let Ze=1;Ze<ae.length;Ze+=1){const nr=ae[Ze-1],Br=ae[Ze],tr=Math.hypot(Br.x-nr.x,Br.y-nr.y),Le=Math.abs(Br.x-nr.x)>=Math.abs(Br.y-nr.y)?1e3:0;for(const wr of BE(nr,Br,{width:pe,height:be},yr,S(Y)))Ia(nr.x+(Br.x-nr.x)*wr,nr.y+(Br.y-nr.y)*wr,tr+Le-Math.abs(wr-.5)*16)}}if(ui.length>0||Jr.length>0||wi.length>0){const yr=ui.length>0?ui:Jr.length>0?Jr:wi;yr.sort((nr,Br)=>Br.score-nr.score);const Ze=yr[0];nt.set(le.id,{x:Ze.x,y:Ze.y,width:pe,height:be,truncated:$r}),bt.push({x:Ze.x,y:Ze.y,width:pe,height:be})}else if(ae.length>=2){const[yr,Ze]=ae.slice(0,-1).map((wr,Er)=>[wr,ae[Er+1]]).toSorted(([wr,Er],[hr,dr])=>Math.hypot(dr.x-hr.x,dr.y-hr.y)-Math.hypot(Er.x-wr.x,Er.y-wr.y))[0],nr=(yr.x+Ze.x)/2,Br=(yr.y+Ze.y)/2,tr=nr-pe/2,Le=Br-be/2;nt.set(le.id,{x:tr,y:Le,width:pe,height:be,truncated:$r}),bt.push({x:tr,y:Le,width:pe,height:be})}}return nt}),_e=Et(()=>{const nt=new Set(S(tt)),bt=S(we)?S(Rt):S(Rt).filter(Bt=>!nt.has(Bt.id)),Pt=new Map(S(Nt).map(Bt=>[Bt.id,Bt])),Qt=S($e)?bt.map(Bt=>Pt.get(Bt.id)??Bt):bt;if(!S(Ce))return Qt;const te=new Set(Qt.map(Bt=>Bt.id));return[...Qt,...S(zt).filter(Bt=>!te.has(Bt.id))]}),ne=Et(()=>{const nt=new Set(S(st)),bt=S(we)?S(Pe):S(Pe).filter(Bt=>!nt.has(Bt.id)),Pt=new Map(S(Be).map(Bt=>[Bt.id,Bt])),Qt=S($e)?bt.map(Bt=>Pt.get(Bt.id)??Bt):bt;if(!S(Ce))return Qt;const te=new Set(Qt.map(Bt=>Bt.id));return[...Qt,...S(Wt).filter(Bt=>!te.has(Bt.id))]}),Ft=Et(()=>{const nt=new Set(S(It)),bt=S(we)?S(Ae):S(Ae).filter(Bt=>!nt.has(Bt.id)),Pt=new Map(S(Ot).map(Bt=>[Bt.id,Bt])),Qt=S($e)?bt.map(Bt=>Pt.get(Bt.id)??Bt):bt;if(!S(Ce))return Qt;const te=new Set(Qt.map(Bt=>Bt.id));return[...Qt,...S(Zt).filter(Bt=>!te.has(Bt.id))]}),ie=Et(()=>{const nt=S(Ce)?new Map(S($t)):new Map;for(const[bt,Pt]of S(Ue))nt.set(bt,Pt);if(S($e))for(const[bt,Pt]of S(ue))nt.set(bt,Pt);return nt}),Pe=Et(()=>{if(!S(x)?.groups)return[];if(S(W)?.visibleGroups)return S(x).groups.filter(nt=>S(W).visibleGroups.includes(nt.id));if(S(W)?.highlightedNodes&&S(W).highlightedNodes.length>0){const nt=new Set(S(W).highlightedNodes);return S(x).groups.filter(bt=>Array.isArray(bt.nodeIds)&&bt.nodeIds.some(Pt=>nt.has(Pt)))}return S(x).groups.filter(nt=>Array.isArray(nt.nodeIds)&&nt.nodeIds.some(bt=>S(qt).includes(bt)))});ba(()=>{S(L);try{const nt=S(W)?r().model.groups?.filter(te=>{if(S(W).visibleGroups)return S(W).visibleGroups.includes(te.id);const Bt=S(W).highlightedNodes?.length?S(W).highlightedNodes:S(qt);return te.nodeIds?.some(le=>Bt.includes(le)&&S(Ut).has(le))}).map(te=>({...te,nodeIds:te.nodeIds?.filter(Bt=>S(Ut).has(Bt))})):r().model.groups,bt=new Set(nt?.map(te=>te.id)),Pt=S(W)?{...r().model,nodes:r().model.nodes.filter(te=>S(Ut).has(te.id)).map(te=>te.group&&!bt.has(te.group)?{...te,group:void 0}:te),edges:r().model.edges.filter(te=>S(Se).includes(te.id)),groups:nt}:r().model,Qt=E$(Pt,S(W)?{...r().baseView,layout:{...r().baseView.layout,spacing:Math.min(r().baseView.layout.spacing??80,S(et)?40:56)}}:r().baseView,r().grammar,S(J),S(F));LE(C,Qt)||(C=Qt,ft(x,Qt,!0)),ft(k,!1),Ss()}catch{C=null,ft(x,null),ft(k,!0)}});let ke=Et(()=>S(W)?.camera?.pan??null),Ie=Et(()=>S(W)?.camera?.focus??null),Ve=ce(!1);function Oe(){ft(Z,!1),ft(ut,"scene"),ft($e,!1),ft(Ce,!1),ft(we,!0),ft(tt,[],!0),ft(st,[],!0),ft(It,[],!0),ft(zt,[],!0),ft(Wt,[],!0),ft(Zt,[],!0),ft($t,new Map,!0),ft(Nt,[],!0),ft(Be,[],!0),ft(Ot,[],!0),ft(ue,new Map,!0),ft(R,S(q),!0)}G1(()=>{const nt=r().id,bt=r().states?.map(Qt=>Qt.id)??[],Pt=r().currentStateId;el(()=>{if(D===void 0){D=nt;return}const Qt=Bt=>Bt===void 0?bt.length===0:bt.includes(Bt);if(nt===D&&Qt(S(q))&&Qt(S(R)))return;const te=nt===D&&Qt(S(q));D=nt,pt+=1;for(const Bt of O)Bt.cancel();O=[],Qa(),ni(),Mt.clear(),te||ft(q,bt.find(Bt=>Bt===Pt)??bt[0],!0),Oe(),ft(p,S(p)+1)})}),ba(()=>{if(!S(M))return;const nt=S(M).closest(".node-diagram_block"),bt=nt??S(Yt)??S(M);let Pt=bt.clientWidth;el(()=>{ft($,nt?.clientWidth??null,!0),ft(B,S(M).clientWidth,!0),Hi()});const Qt=new ResizeObserver(()=>{if(S(z)&&S(B)!==null&&Math.abs(bt.clientWidth-Pt)>.5){ft(f,!0),ni(),pt+=1;for(const te of O)te.cancel();O=[],Mt.clear(),Oe()}if(Pt=bt.clientWidth,ft($,nt?.clientWidth??null,!0),ft(B,S(M).clientWidth,!0),Hi(),Te(),S(f)){ft(p,S(p)+1),Te();for(const te of Ee())te.finish();g!==void 0&&cancelAnimationFrame(g),g=requestAnimationFrame(()=>{ft(f,!1),g=void 0})}});return Qt.observe(S(M)),bt!==S(M)&&Qt.observe(bt),()=>Qt.disconnect()});let ve=Et(()=>{const nt=S(ke)?.x??0,bt=S(ke)?.y??0;if(S(z))return`scale(${S(at)}) translate(calc(-50% + ${nt/S(at)}px), calc(-50% + ${bt/S(at)}px))`;const Pt=[];return S(ke)&&Pt.push(`translate(${nt}px, ${bt}px)`),S(at)!==1&&Pt.push(`scale(${S(at)})`),Pt.length>0?Pt.join(" "):void 0});ba(()=>{if(!S(Ie)||!S(x)||!S(M))return;const nt=S(x).nodes.find(be=>be.id===S(Ie));if(!nt)return;const bt=S(je)??S(x).bounds,Pt=nt.x+nt.width/2-(bt.minX-S(rt)),Qt=nt.y+nt.height/2-(bt.minY-S(rt)),te=Pt*S(j),Bt=Qt*S(j),le=S(M).clientWidth,ae=S(M).clientHeight,oe=S(ke)?.x??0,pe=S(ke)?.y??0;S(M).scrollTo({left:Math.max(0,te+oe*S(j)-le/2),top:Math.max(0,Bt+pe*S(j)-ae/2),behavior:y(1)===0?"auto":"smooth"})});function me(nt=!0){if(!S(x))return null;if(!S(W)){let{minX:oe,minY:pe,maxX:be,maxY:ye}=S(x).bounds;for(const $r of S(Ue).values())oe=Math.min(oe,$r.x),pe=Math.min(pe,$r.y),be=Math.max(be,$r.x+$r.width),ye=Math.max(ye,$r.y+$r.height);return{minX:oe,minY:pe,maxX:be,maxY:ye,width:be-oe,height:ye-pe}}const bt=nt?[...S(Rt),...S(zt),...S(Nt)]:S(Rt),Pt=nt?[...S(Ae),...S(Zt),...S(Ot)]:S(Ae),Qt=nt?[...S(Pe),...S(Wt),...S(Be)]:S(Pe);if(bt.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let te=Math.min(...bt.map(oe=>oe.x)),Bt=Math.min(...bt.map(oe=>oe.y)),le=Math.max(...bt.map(oe=>oe.x+oe.width)),ae=Math.max(...bt.map(oe=>oe.y+oe.height));for(const oe of Qt)te=Math.min(te,oe.x),Bt=Math.min(Bt,oe.y),le=Math.max(le,oe.x+oe.width),ae=Math.max(ae,oe.y+oe.height);for(const oe of Pt)if(oe.points)for(const pe of oe.points)te=Math.min(te,pe.x-4),Bt=Math.min(Bt,pe.y-4),le=Math.max(le,pe.x+4),ae=Math.max(ae,pe.y+4);for(const oe of[...S(Ue).values(),...nt?S($t).values():[],...nt?S(ue).values():[]])te=Math.min(te,oe.x),Bt=Math.min(Bt,oe.y),le=Math.max(le,oe.x+oe.width),ae=Math.max(ae,oe.y+oe.height);return{minX:te,minY:Bt,maxX:le,maxY:ae,width:le-te,height:ae-Bt}}let je=Et(()=>me(!0)),Jt=Et(()=>S(je)?S(je).width+S(rt)*2:800),ir=Et(()=>S(je)?S(je).height+S(rt)*2:600),mr=Et(()=>S(Jt)*S(at)),sr=Et(()=>(S(x)?S(Jt)*S(j)*Math.max(1,S(xt)):0)+16),xi=Et(()=>(S(ir)+6)*S(at)),zi=Et(()=>Math.ceil((S(ir)+6)*S(at)+20)),fr=Et(()=>S(zi)),bi=Et(()=>S(z)&&(S(P)!==void 0&&S(fr)>S(P)*.9+1||S(Q)!==null&&S(mr)+16>S(Q)+1));function ni(){ft(I,!1),E=void 0,_?.(),_=void 0}function di(){if(ni(),!S(Yt))return;ft(I,!0);const nt=S(Yt),bt=[];for(let Bt=nt.parentElement;Bt;Bt=Bt.parentElement)/(auto|scroll)/.test(getComputedStyle(Bt).overflowY)&&bt.push(Bt);const Pt=document.scrollingElement;Pt&&!bt.includes(Pt)&&bt.push(Pt);const Qt=bt.map(Bt=>({element:Bt,value:Bt.style.getPropertyValue("overflow-anchor"),priority:Bt.style.getPropertyPriority("overflow-anchor")}));for(const{element:Bt}of Qt)Bt.style.setProperty("overflow-anchor","none");const te=()=>{E=void 0};for(const Bt of["wheel","touchstart","keydown"])window.addEventListener(Bt,te,{capture:!0,passive:!0});_=()=>{for(const{element:Bt,value:le,priority:ae}of Qt)le?Bt.style.setProperty("overflow-anchor",le,ae):Bt.style.removeProperty("overflow-anchor");for(const Bt of["wheel","touchstart","keydown"])window.removeEventListener(Bt,te,!0)},E=()=>{const Bt=nt.querySelector(".diagram-footer");if(Bt)for(const le of bt){const ae=le.getBoundingClientRect(),oe=le===Pt?0:Math.max(0,ae.top+le.clientTop),pe=le===Pt?window.innerHeight:Math.min(window.innerHeight,ae.top+le.clientTop+le.clientHeight);if(pe<=oe)continue;const be=Bt.getBoundingClientRect(),ye=be.height<=pe-oe?be:Bt.querySelector(".state-navigation").getBoundingClientRect(),$r=ye.bottom>pe?ye.bottom-pe:ye.top<oe?ye.top-oe:0;Math.abs($r)>.5&&le.scrollBy({top:$r,behavior:"instant"})}}}let Qr=Et(()=>S(je)?`translate(${-S(je).minX+S(rt)}px, ${-S(je).minY+S(rt)}px)`:"translate(0, 0)"),Mo=Et(()=>S(je)?`translate(${-S(je).minX+S(rt)}, ${-S(je).minY+S(rt)})`:"translate(0, 0)");function Hi(){if(!S(v)&&!S(z)||!S(M)){ft(T,1);return}const nt=Math.max(1,S(M).clientWidth-16),bt=Math.max(1,(S($)??S(M).clientWidth)-16),Pt=S(z)?Number.POSITIVE_INFINITY:Math.max(1,S(M).clientHeight-16),Qt=Math.max(1,S(Jt)*S(j)),te=Math.max(1,S(ir)*S(j)),Bt=S(z)&&bt>=500&&["TB","BT"].includes(r().baseView.layout.direction??"")?500:160;ft(A,Math.max(Bt,bt/S(xt)-l*2),!0),ft(F,Math.max(Bt,bt/S(xt)-S(rt)*2),!0),ft(T,Math.min(S($)===null?1.25:Math.max(1,S(xt)),Math.max(S(xt),Math.min(nt/Qt,Pt/te))),!0)}function Qa(){m!==void 0&&cancelAnimationFrame(m),m=void 0}function Yi(){Qa(),ft(v,!S(v)),Hi(),m=requestAnimationFrame(()=>{m=void 0,Hi(),S(M)?.scrollTo({left:0,top:0,behavior:y(1)===0?"auto":"smooth"})})}ba(()=>{S(Jt),S(ir),S(j),(S(v)||S(z))&&Hi()}),ba(()=>{if(S(Ve)||!S(x)||!S(M))return;const nt=S(M).clientWidth-16;nt<=0||(S(Jt)*S(j)>nt&&(ft(v,!0),Hi()),ft(Ve,!0))});let Ai=ce(void 0),Fi=ce(!1);ba(()=>{const nt=n();if(!S(Fi)){ft(Ai,nt,!0),ft(Fi,!0);return}nt!==S(Ai)&&(ft(Ai,nt,!0),Qa(),ni(),ft(v,!1),ft(T,1),S(M)?.scrollTo({left:0,top:0,behavior:"auto"}))});function ic(nt){if(nt===S(q))return;di();const bt=re();pt+=1;const Pt=pt,Qt=S(_e),te=S(ne),Bt=S(Ft),le=new Map(S(ie)),ae=y(1)>0;if(ft(Z,ae),ft(ut,ae?"camera":"scene",!0),Ss(),ae&&(ft($e,!0),ft(we,!1),ft(Ce,!0),ft(Nt,Qt,!0),ft(Be,te,!0),ft(Ot,Bt,!0),ft(ue,le,!0),ft(tt,r().model.nodes.map(oe=>oe.id).filter(oe=>!Qt.some(pe=>pe.id===oe)),!0),ft(st,(r().model.groups??[]).map(oe=>oe.id).filter(oe=>!te.some(pe=>pe.id===oe)),!0),ft(It,r().model.edges.map(oe=>oe.id).filter(oe=>!Bt.some(pe=>pe.id===oe)),!0),ft(zt,Qt,!0),ft(Wt,te,!0),ft(Zt,Bt,!0),ft($t,le,!0)),ft(q,nt,!0),Te(),ae){const oe=lh(Qt.map(ye=>ye.id),S(Rt).map(ye=>ye.id)),pe=lh(te.map(ye=>ye.id),S(Pe).map(ye=>ye.id)),be=lh(Bt.map(ye=>ye.id),S(Ae).map(ye=>ye.id));ft(tt,oe.entering,!0),ft(st,pe.entering,!0),ft(It,be.entering,!0),ft(Nt,Qt.filter(ye=>oe.shared.includes(ye.id)),!0),ft(Be,te.filter(ye=>pe.shared.includes(ye.id)),!0),ft(Ot,Bt.filter(ye=>be.shared.includes(ye.id)),!0),ft(ue,new Map([...le].filter(([ye])=>be.shared.includes(ye))),!0),ft(zt,Qt.filter(ye=>oe.departing.includes(ye.id)),!0),ft(Wt,te.filter(ye=>pe.departing.includes(ye.id)),!0),ft(Zt,Bt.filter(ye=>be.departing.includes(ye.id)),!0),ft($t,new Map([...le].filter(([ye])=>be.departing.includes(ye))),!0),Te()}else Oe();O=Kt(bt),ae&&(O.length===0&&ft(ut,"exit"),da(Pt,nt,O)),i()?.({currentStateId:nt}),E?.()}function To(nt,bt){(bt?!Mt.has(nt):Mt.has(nt))&&(bt?Mt.add(nt):Mt.delete(nt),bt&&Ss())}function B1(nt,bt,Pt){if(!a()||!i())return;const Qt=r().model.nodes.map(te=>te.id===nt?{...te,position:{x:bt,y:Pt}}:te);i()({model:{...r().model,nodes:Qt}})}var _1={get diagram(){return r()},set diagram(nt){r(nt),Te()},get onUpdate(){return i()},set onUpdate(nt){i(nt),Te()},get editable(){return a()},set editable(nt=!1){a(nt),Te()},get styleConfig(){return o()},set styleConfig(nt=Ni){o(nt),Te()},get onBindingClick(){return s()},set onBindingClick(nt){s(nt),Te()},get viewResetKey(){return n()},set viewResetKey(nt){n(nt),Te()},$set:La,$on:(nt,bt)=>Aa(t,nt,bt)},Xi=qE();let bu,Cu;var wu=Ne(Xi);{var L1=nt=>{var bt=AE(),Pt=Ne(bt);{let Qt=Et(()=>S(v)?Ye.diagram_renderer_actualSize_ariaLabel():Ye.diagram_renderer_fitToWidth_ariaLabel()),te=Et(()=>S(v)?Ye.diagram_renderer_actualSize_ariaLabel():Ye.diagram_renderer_fitToWidth_ariaLabel());Ho(Pt,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-fit-button",onclick:Yi,get"aria-pressed"(){return S(v)},get"aria-label"(){return S(Qt)},get tooltip(){return S(te)},children:(Bt,le)=>{{let ae=Et(()=>S(v)?Sp:xC);Qs(Bt,{get icon(){return S(ae)},size:"sm"})}},$$slots:{default:!0}})}Fe(bt),or(Qt=>fe(bt,"aria-label",Qt),[()=>Ye.diagram_renderer_actions_ariaLabel()]),ge(nt,bt)};ur(wu,nt=>{S(x)&&r().model.nodes.length>0&&nt(L1)})}var fa=qe(wu,2);let ku,Su;var A1=Ne(fa);{var F1=nt=>{var bt=FE(),Pt=Ne(bt),Qt=kr(Pt,!0),te=qe(Pt,2),Bt=kr(te,!0);Fe(bt),or((le,ae)=>{pr(Qt,le),pr(Bt,ae)},[()=>Ye.markdown_mermaid_renderFailed_error(),()=>Ye.diagram_renderer_error_description()]),ge(nt,bt)},$1=nt=>{var bt=$E(),Pt=Ne(bt),Qt=kr(Pt,!0),te=qe(Pt,2),Bt=kr(te,!0);Fe(bt),or((le,ae)=>{pr(Qt,le),pr(Bt,ae)},[()=>Ye.diagram_validator_noNodes_warning(),()=>Ye.diagram_renderer_empty_description()]),ge(nt,bt)},E1=nt=>{var bt=DE();let Pt;var Qt=Ne(bt);let te;var Bt=Ne(Qt),le=Ne(Bt),ae=qe(le),oe=qe(ae),pe=qe(oe),be=qe(pe),ye=qe(be),$r=qe(ye),Ci=qe($r);Fe(Bt);var Pa=qe(Bt);vp(Pa,()=>S(p),ui=>{var Jr=RE();let wi;var Ia=Ne(Jr);{var yr=tr=>{var Le=za(),wr=ri(Le);no(wr,17,()=>S(ne),Er=>Er.id,(Er,hr)=>{var dr=EE(),Nr=Ne(dr);{let $i=Et(()=>S(dt)!==null&&S(dt)!==S(hr).id);M1(Nr,{get group(){return S(hr)},get dimmed(){return S($i)},onHover:vs=>ft(dt,vs,!0)})}Fe(dr),xa(1,dr,()=>Ms,()=>({delay:0,duration:y(ot)})),xa(2,dr,()=>Ms,()=>({duration:y(yt)})),ge(Er,dr)}),ge(tr,Le)};ur(Ia,tr=>{S(ne)&&tr(yr)})}var Ze=qe(Ia);no(Ze,17,()=>S(Ft),tr=>tr.id,(tr,Le)=>{const wr=Et(()=>S(it)!==null&&!S(_t).has(S(Le).id)||S(dt)!==null&&!S(X).has(S(Le).id)||S(Dt)&&S(At)!==null&&!S(At).has(S(Le).id)),Er=Et(()=>S(At)!==null&&S(At).has(S(Le).id));var hr=PE(),dr=Ne(hr);v1(dr,{get edge(){return S(Le)},get dimmed(){return S(wr)},get highlighted(){return S(Er)},get markerScope(){return r().id},get terminalGap(){return S(H)},motionDelay:0,onmotionchange:To}),Fe(hr),xa(1,hr,()=>xe,()=>({duration:ot})),xa(2,hr,()=>xe,()=>({duration:vt})),ge(tr,hr)});var nr=qe(Ze);no(nr,17,()=>S(Ft),tr=>tr.id,(tr,Le)=>{var wr=za(),Er=ri(wr);{var hr=Nr=>{const $i=Et(()=>S(ie).get(S(Le).id)),vs=Et(()=>S(it)!==null&&!S(_t).has(S(Le).id)||S(dt)!==null&&!S(X).has(S(Le).id)||S(Dt)&&S(At)!==null&&!S(At).has(S(Le).id));var li=IE();let ac;var O1=Ne(li);{var R1=Oa=>{bC(Oa,{get content(){return S(Le).label},side:"top",class:"edge-label-tooltip",trigger:oc=>{var Bo=bp(),N1=Ne(Bo),q1=kr(N1,!0);Fe(Bo),or(()=>{fe(Bo,"aria-label",S(Le).label),pr(q1,S(Le).label)}),ge(oc,Bo)},$$slots:{trigger:!0}})},D1=Oa=>{var wn=bp(),oc=Ne(wn),Bo=kr(oc,!0);Fe(wn),or(()=>pr(Bo,S(Le).label)),ge(Oa,wn)};ur(O1,Oa=>{S($i).truncated?Oa(R1):Oa(D1,-1)})}Fe(li),or(Oa=>{fe(li,"x",S($i).x),fe(li,"y",S($i).y),fe(li,"width",S($i).width),fe(li,"height",S($i).height),ac=ra(li,0,`edge-label-container diagram-geometry-motion ${S(vs)?"edge-label-dimmed":""}`,null,ac,{"edge-label-entry":Oa}),fe(li,"data-edge-id",S(Le).id),fe(li,"data-semantic-style",S(Le).semanticStyle??"default"),fe(li,"data-truncated",S($i).truncated)},[()=>S(Z)&&S(It).includes(S(Le).id)]),xa(2,li,()=>Ms,()=>({duration:y(yt/2)})),ge(Nr,li)},dr=Et(()=>S(Le).label&&S(ie).has(S(Le).id));ur(Er,Nr=>{S(dr)&&Nr(hr)})}ge(tr,wr)});var Br=qe(nr);no(Br,17,()=>S(_e),tr=>tr.id,(tr,Le)=>{const wr=Et(()=>S(it)!==null&&!S(Ct).has(S(Le).id)||S(dt)!==null&&!S(wt).has(S(Le).id)||S(Dt)&&S(St)!==null&&!S(St).has(S(Le).id)),Er=Et(()=>S(St)!==null&&S(St).has(S(Le).id));var hr=OE(),dr=Ne(hr);S1(dr,{get node(){return S(Le)},get editable(){return a()},get styleConfig(){return S(J)},get dimmed(){return S(wr)},get highlighted(){return S(Er)},onMove:(Nr,$i)=>B1(S(Le).id,Nr,$i),onHover:Nr=>ft(it,Nr,!0),get onBindingClick(){return s()}}),Fe(hr),or(()=>{fe(hr,"data-node-id",S(Le).id),fe(hr,"x",S(Le).x),fe(hr,"y",S(Le).y),fe(hr,"width",S(Le).width),fe(hr,"height",S(Le).height)}),xa(1,hr,()=>Ms,()=>({delay:0,duration:S(Z)?y(ot):0,easing:Fu})),xa(2,hr,()=>Ms,()=>({duration:y(yt)})),ge(tr,hr)}),Fe(Jr),or(()=>{fe(Jr,"transform",S(Mo)),wi=Oo(Jr,"",wi,{transform:S(Qr)})}),ge(ui,Jr)}),Fe(Qt),Fe(bt),or(()=>{Pt=Oo(bt,"",Pt,{width:S(z)?`max(100%, ${S(mr)+16}px)`:`${S(mr)}px`,height:S(z)?`max(100%, ${S(fr)}px)`:`${S(xi)}px`}),fe(Qt,"width",S(Jt)),fe(Qt,"height",S(ir)+6),te=Oo(Qt,"",te,{top:S(z)?`${S(zi)/2}px`:void 0,transform:S(ve)}),fe(le,"id",`arrowhead-${r().id??""}`),fe(ae,"id",`arrowhead-danger-${r().id??""}`),fe(oe,"id",`arrowhead-success-${r().id??""}`),fe(pe,"id",`arrowhead-warning-${r().id??""}`),fe(be,"id",`arrowhead-muted-${r().id??""}`),fe(ye,"id",`arrowhead-inactive-${r().id??""}`),fe($r,"id",`arrowhead-highlighted-${r().id??""}`),fe(Ci,"id",`arrowhead-active-${r().id??""}`)}),ge(nt,bt)};ur(A1,nt=>{S(k)?nt(F1):r().model.nodes.length===0?nt($1,1):nt(E1,-1)})}Fe(fa),ta(fa,nt=>ft(M,nt),()=>S(M));var P1=qe(fa,2);{var I1=nt=>{var bt=NE(),Pt=Ne(bt);T1(Pt,{get states(){return r().states},get currentStateId(){return S(q)},onStateChange:ic}),Fe(bt),ge(nt,bt)};ur(P1,nt=>{!S(k)&&r().model.nodes.length>0&&r().states&&r().states.length>0&&nt(I1)})}return Fe(Xi),ta(Xi,nt=>ft(Yt,nt),()=>S(Yt)),or((nt,bt,Pt,Qt,te,Bt,le,ae)=>{bu=ra(Xi,1,"diagram-renderer svelte-10vg205",null,bu,{"has-content":nt,"compact-diagram":S(et),"fitted-diagram":S(v),"stateful-diagram":bt,"camera-stage":S(ut)==="camera",resizing:S(f)}),fe(Xi,"data-diagram-intrinsic-width",S(sr)),Cu=Oo(Xi,`--diagram-edge-label-font-size: ${vi.fontSize}px;
342
- --diagram-edge-label-line-height: ${vi.lineHeight};
343
- --diagram-edge-label-padding-x: ${vi.paddingX}px;
344
- --diagram-edge-label-padding-y: ${vi.paddingY}px;`,Cu,{"--diagram-camera-duration":Pt,"--diagram-camera-easing":K,"--diagram-move-exit-duration":Qt,"--diagram-label-entry-delay":te,"--diagram-label-entry-duration":Bt}),fe(Xi,"data-diagram-settled",S(w)),fe(Xi,"data-diagram-state",S(q)),fe(Xi,"data-diagram-motion-phase",S(ut)),ku=ra(fa,1,"diagram-scroll-container svelte-10vg205",null,ku,{"stepping-viewport":S(I)}),fe(fa,"role",S(z)?"region":void 0),fe(fa,"aria-label",le),fe(fa,"tabindex",S(bi)?0:void 0),Su=Oo(fa,"",Su,{height:ae})},[()=>!!(S(x)&&r().model.nodes.length>0),()=>!!r().states?.length,()=>`${y(V)}ms`,()=>`${y(ct)}ms`,()=>`${y(kt)}ms`,()=>`${y(Xt)}ms`,()=>S(z)?Ye.diagram_controls_walkthrough_ariaLabel():void 0,()=>S(z)?`${Math.min(S(fr),(S(P)??1/0)*.9)}px`:void 0]),$C("innerHeight",nt=>ft(P,nt,!0)),ge(e,Xi),$a(_1)}var zE=er('<header class="diagram-presentation-header svelte-1rsrotk" data-diagram-presentation-header=""><!></header>'),HE=er('<div data-diagram-presentation-actions=""><!> <!></div>'),YE=er('<section data-diagram-presentation=""><!> <!> <div class="diagram-presentation-content svelte-1rsrotk" data-diagram-presentation-content=""><!></div></section>');function XE(e,t){if(new.target)return _a({component:XE,...e});Fa(t,!0);let r=ze(t,"kind",7),i=ze(t,"children",7),a=ze(t,"header",7),o=ze(t,"actions",7),s=ze(t,"actionsInTopMargin",7,!1),n=ze(t,"rendererOwnsActions",7,!1),l=ze(t,"selected",7,!1),c=ze(t,"exportable",7,!0),h=ze(t,"fileName",7),d=ce(void 0),u=ce(void 0),f=ce(void 0),p=ce(!1),g=ce(!1);Gh(()=>{const B=S(d)?.closest(".node-mermaidBlock, .node-diagram_block"),$=B?.parentElement;if(!B||!$?.matches(".tiptap-editor.ProseMirror")||!S(d)){ft(p,!0);return}const P=S(d);ft(g,!0);let I=0,_=0,E=!1,L,q;const W=()=>{L=void 0;const j=_,z=P.querySelector("[data-diagram-intrinsic-width]"),Q=P.querySelector(".mermaid-svg > svg");z?.dataset.diagramSettled==="true"?I=Number(z.dataset.diagramIntrinsicWidth):Q?.dataset.layoutSettled==="true"?I=Q.viewBox.baseVal.width+16:!z&&!Q&&(I=0);const et=B.clientWidth,rt=$.clientWidth,J=Math.min(et,Math.max(rt,I)),at=Math.min(et,rt),xt=z?z.dataset.diagramSettled==="true":Q?Q.dataset.layoutSettled==="true":!P.querySelector('[data-render-settled="false"]');q=TC(()=>{if(E||_!==j)return;q=void 0;const H=S(u)!==J;ft(u,J,!0),ft(f,at,!0),ft(p,xt,!0),S(g)&&xt&&et>0&&rt>0&&(H?L??=$u(W):ft(g,!1))})},R=()=>{_+=1,ft(p,!1),q?.(),q=void 0,L??=$u(W)},D=new ResizeObserver(R);D.observe(B),D.observe($);const G=new MutationObserver(R);return G.observe(P,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-diagram-settled","data-diagram-intrinsic-width","data-layout-settled","data-render-settled"]}),R(),()=>{E=!0,D.disconnect(),G.disconnect(),L?.(),q?.()}});var m={get kind(){return r()},set kind(B){r(B),Te()},get children(){return i()},set children(B){i(B),Te()},get header(){return a()},set header(B){a(B),Te()},get actions(){return o()},set actions(B){o(B),Te()},get actionsInTopMargin(){return s()},set actionsInTopMargin(B=!1){s(B),Te()},get rendererOwnsActions(){return n()},set rendererOwnsActions(B=!1){n(B),Te()},get selected(){return l()},set selected(B=!1){l(B),Te()},get exportable(){return c()},set exportable(B=!0){c(B),Te()},get fileName(){return h()},set fileName(B){h(B),Te()},$set:La,$on:(B,$)=>Aa(t,B,$)},y=YE();let x,C;var k=Ne(y);{var v=B=>{var $=zE(),P=Ne($);Hn(P,a),Fe($),ge(B,$)};ur(k,B=>{a()&&B(v)})}var T=qe(k,2);{var F=B=>{var $=HE();let P;var I=Ne($);Hn(I,()=>o()??U1);var _=qe(I,2);{var E=L=>{hu(L,{get container(){return S(d)},get fileName(){return h()},get compactTrigger(){return s()}})};ur(_,L=>{c()&&L(E)})}Fe($),or(()=>P=ra($,1,"diagram-presentation-actions svelte-1rsrotk",null,P,{"actions-in-top-margin":s()})),ge(B,$)};ur(T,B=>{!n()&&(o()||c())&&B(F)})}var A=qe(T,2),M=Ne(A);return Hn(M,i),Fe(A),ta(A,B=>ft(d,B),()=>S(d)),Fe(y),or(()=>{x=ra(y,1,"diagram-presentation svelte-1rsrotk",null,x,{selected:l(),initializing:S(g),"renderer-owns-actions":n()}),y.inert=S(g),fe(y,"data-diagram-presentation-settled",S(p)),fe(y,"data-diagram-presentation-initializing",S(g)),fe(y,"data-diagram-kind",r()),C=Oo(y,S(f)===void 0?void 0:`--diagram-controls-width: ${S(f)}px`,C,{width:S(u)===void 0?void 0:`${S(u)}px`,"min-width":S(u)===void 0?void 0:"0"})}),ge(e,y),$a(m)}export{O4 as $,VM as A,Gp as B,ZM as C,XE as D,mi as E,WS as F,Vs as G,mt as H,kv as I,OC as J,mv as K,zC as L,b$ as M,E4 as N,ud as O,Ww as P,Al as Q,Av as R,Fv as S,Zv as T,nw as U,ow as V,Tr as W,Xe as X,cw as Y,zv as Z,EC as _,WE as a,$4 as a$,So as a0,rP as a1,LB as a2,oy as a3,bn as a4,_d as a5,o2 as a6,X2 as a7,A4 as a8,tP as a9,vy as aA,qr as aB,Lg as aC,U_ as aD,Zm as aE,wv as aF,Iy as aG,Wl as aH,cf as aI,I4 as aJ,g_ as aK,Z4 as aL,Kv as aM,gv as aN,Kp as aO,eP as aP,jp as aQ,f_ as aR,Qi as aS,Ha as aT,j4 as aU,Ti as aV,He as aW,J_ as aX,iP as aY,sw as aZ,aw as a_,Js as aa,Ud as ab,NS as ac,BB as ad,C_ as ae,u_ as af,DC as ag,O0 as ah,_v as ai,Lv as aj,Bv as ak,Ht as al,JM as am,hi as an,Vp as ao,Ad as ap,iu as aq,Vn as ar,gB as as,he as at,gt as au,rv as av,cn as aw,RC as ax,Tt as ay,yv as az,b,lw as b0,U4 as b1,xv as b2,J2 as b3,dw as b4,I0 as b5,Li as b6,Vm as b7,Gt as b8,pv as b9,Xr as ba,Mv as bb,Tv as bc,Sv as bd,vv as be,Rw as bf,ee as bg,pi as bh,tM as bi,$p as c,P4 as d,Qm as e,Cv as f,bv as g,Ir as h,Vt as i,$C as j,Km as k,F4 as l,Id as m,ny as n,Ta as o,GC as p,Rd as q,iw as r,V4 as s,J4 as t,Q4 as u,K4 as v,Rl as w,G4 as x,Up as y,hn as z};