@layers-app/editor 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/layers.-OFHX18B.js +1 -0
  4. package/dist/{layers.B88Tq9fq.js → layers.0SH7L8mO.js} +1 -1
  5. package/dist/{layers.BrwveTp_.js → layers.3GwrPaZO.js} +18 -19
  6. package/dist/{layers.BT47r9lw.js → layers.3a-Q5eGZ.js} +1 -1
  7. package/dist/{layers.DhVu4iGF.js → layers.48I9suCn.js} +6525 -6523
  8. package/dist/{layers.DEj_-Grg.js → layers.7VVd4tP6.js} +1 -1
  9. package/dist/{layers.D-ai8yBe.js → layers.9Yn7opmg.js} +8 -9
  10. package/dist/{layers.DGBJxH-i.js → layers.9Yq4SYpr.js} +1 -1
  11. package/dist/{layers.BXcxE02s.js → layers.9qBnCDzZ.js} +1 -1
  12. package/dist/{layers.2sOFsgpt.js → layers.B-6ntVZv.js} +33 -33
  13. package/dist/{layers.DzLp1nNI.js → layers.B-_EI2NU.js} +1 -1
  14. package/dist/{layers.D_7_4U6H.js → layers.B0CIcvyl.js} +1 -1
  15. package/dist/{layers.9tX9hjoM.js → layers.B2AGu32C.js} +61 -61
  16. package/dist/{layers.xuA-KjdM.js → layers.B2iZKl7a.js} +9 -10
  17. package/dist/{layers.rXaivo1G.js → layers.B3mWbsYz.js} +10 -11
  18. package/dist/{layers.Dc17KGUJ.js → layers.B3oab57P.js} +1 -1
  19. package/dist/{layers.BfgAhPID.js → layers.B4edIPhh.js} +1 -1
  20. package/dist/{layers.D_duxQPK.js → layers.B5HfO3V6.js} +1 -1
  21. package/dist/{layers.Dz3X0MlG.js → layers.B5JSV7em.js} +57 -57
  22. package/dist/{layers.DuEB1Y-T.js → layers.B6NJ6ccg.js} +1 -1
  23. package/dist/{layers.CmjlfzqR.js → layers.B7SdSCSK.js} +1 -1
  24. package/dist/{layers.CXh6lA3a.js → layers.BAzHt1-K.js} +3 -3
  25. package/dist/{layers.CJEJ4X7s.js → layers.BDSdHwxq.js} +1 -1
  26. package/dist/{layers.CIkLs05n.js → layers.BEjPybmC.js} +1 -1
  27. package/dist/{layers.BuJcmKuG.js → layers.BH5Zo2E5.js} +1 -1
  28. package/dist/{layers.CPtyJjDZ.js → layers.BHQ_DVN2.js} +1 -1
  29. package/dist/{layers.7tkYogen.js → layers.BJ55htmW.js} +1 -1
  30. package/dist/{layers._mYyPoAM.js → layers.BKbwal2S.js} +1 -1
  31. package/dist/{layers.CxGQnE2E.js → layers.BKzpK190.js} +1 -1
  32. package/dist/{layers.D0mYhnD_.js → layers.BLA49Uxv.js} +1 -1
  33. package/dist/layers.BLmU0KXd.js +10 -0
  34. package/dist/{layers.iSI2Ixu0.js → layers.BOhRJ2O7.js} +1 -1
  35. package/dist/{layers.DclYra1-.js → layers.BPS0vWZM.js} +1 -1
  36. package/dist/{layers.CLAkkTQF.js → layers.BQQthCA6.js} +1 -1
  37. package/dist/{layers.BRg8Z6Fg.js → layers.BRKlq7jj.js} +2 -2
  38. package/dist/layers.BRhQ1w-K.js +96 -0
  39. package/dist/{layers.CkEhdEMJ.js → layers.BS2w4lr6.js} +1 -1
  40. package/dist/{layers.C__5h4aS.js → layers.BS9nCPMs.js} +1 -1
  41. package/dist/{layers.BFT6OtgR.js → layers.BXmhh7b0.js} +1 -1
  42. package/dist/{layers.C-JonM7I.js → layers.BXz0HxFb.js} +1 -1
  43. package/dist/{layers.CPJF7wyf.js → layers.B_fwh454.js} +1 -1
  44. package/dist/{layers.5Fc-eDz_.js → layers.BaICHlB8.js} +1 -1
  45. package/dist/{layers.Btw6v4iY.js → layers.BaLCIMM8.js} +1 -1
  46. package/dist/layers.BcE-rdq0.js +1 -0
  47. package/dist/{layers.BnB_ZCKf.js → layers.BcLslZVY.js} +1 -1
  48. package/dist/{layers.xrnbA0Hx.js → layers.Be1IMgFf.js} +1 -1
  49. package/dist/{layers.KB-lMlC4.js → layers.BeSH60au.js} +1 -1
  50. package/dist/{layers.CMsdH6MZ.js → layers.Bel31pZo.js} +1 -1
  51. package/dist/{layers.DJ29FJsN.js → layers.Bgh_aa4B.js} +1 -1
  52. package/dist/{layers.XPl1C4Xv.js → layers.BhFwDmEi.js} +1 -1
  53. package/dist/{layers.BZKrOb4j.js → layers.BhyRsUUP.js} +1 -1
  54. package/dist/{layers.Bs80VeaG.js → layers.BiQxhxnG.js} +38 -38
  55. package/dist/{layers.BYJgHe0j.js → layers.BkpoZP5j.js} +1 -1
  56. package/dist/{layers.BAAAIQgL.js → layers.BkzTxi7n.js} +54 -55
  57. package/dist/{layers.BudVqxFc.js → layers.Blb1SJbF.js} +1 -1
  58. package/dist/{layers.DMfyflRv.js → layers.BlpEVEZQ.js} +307 -312
  59. package/dist/{layers.D48A_dlx.js → layers.BmKXu2hq.js} +37 -38
  60. package/dist/{layers.CpcqVX72.js → layers.Buk0Fw_r.js} +1 -1
  61. package/dist/{layers.BEKEkSeG.js → layers.Bygo74zU.js} +8541 -8843
  62. package/dist/layers.Bzjuw56r.js +4 -0
  63. package/dist/{layers.BoWIpGHq.js → layers.C-dzC33p.js} +1 -1
  64. package/dist/layers.C-gj1rq0.js +64 -0
  65. package/dist/{layers.DWjc_eMo.js → layers.C0-A7eRM.js} +1 -1
  66. package/dist/{layers.NWZBwKEK.js → layers.C2J-9t4F.js} +1 -1
  67. package/dist/{layers.BlFR1qtc.js → layers.C2lCyyCZ.js} +1 -1
  68. package/dist/{layers.Biiuyvk3.js → layers.C3WQ9FB9.js} +1 -1
  69. package/dist/{layers.Dngs5OpP.js → layers.C5JGtTwP.js} +1 -1
  70. package/dist/{layers.62fLihH9.js → layers.C6rX4i15.js} +1 -1
  71. package/dist/{layers.BD5cjyof.js → layers.C7xf3nZE.js} +1 -1
  72. package/dist/{layers.R_5lXX8D.js → layers.C9Wj3En2.js} +1 -1
  73. package/dist/{layers.C07EEzls.js → layers.C9n_72fo.js} +1 -1
  74. package/dist/{layers.Dcv9yczD.js → layers.CA4DyArn.js} +1 -1
  75. package/dist/{layers.C1VtSMXU.js → layers.CAqeoIhq.js} +240 -243
  76. package/dist/{layers.Cwwx9dqL.js → layers.CBwJFvR2.js} +1 -1
  77. package/dist/{layers.rD_yeisW.js → layers.CCKbbpP_.js} +1 -1
  78. package/dist/{layers.Bipv0RrA.js → layers.CEhLVWVr.js} +1 -1
  79. package/dist/layers.CHCM_M7u.js +1 -0
  80. package/dist/{layers.BwSoDZk1.js → layers.CJ2wXM1J.js} +1 -1
  81. package/dist/{layers.CDdlABmL.js → layers.CKwrGZha.js} +1 -1
  82. package/dist/{layers.DzOX-fH0.js → layers.CLq_gjkT.js} +1 -1
  83. package/dist/{layers.DGE3E7fO.js → layers.CLrT_kEd.js} +1 -1
  84. package/dist/{layers.DS9XrncL.js → layers.CM09dSjO.js} +1 -1
  85. package/dist/{layers.CAf30VQc.js → layers.CNSM6wNt.js} +1 -1
  86. package/dist/{layers.CWSqO_Rm.js → layers.CNi2XH-e.js} +1 -1
  87. package/dist/{layers.Cy9Nv6Fr.js → layers.CQ9mG0cW.js} +1 -1
  88. package/dist/{layers.CIBcP2_G.js → layers.CSdBXHWj.js} +1 -1
  89. package/dist/{layers.pL-8PKFv.js → layers.CVpWQln7.js} +2 -2
  90. package/dist/{layers.C23xliFJ.js → layers.CWSgM_kw.js} +1 -1
  91. package/dist/{layers.DPJYTRtA.js → layers.CWkN7sKt.js} +1 -1
  92. package/dist/{layers.DdJlEJId.js → layers.CXTZloQF.js} +1 -1
  93. package/dist/{layers.B9QOa-CF.js → layers.CYDe1VkW.js} +1 -1
  94. package/dist/{layers.oTwVbcUa.js → layers.CZ4FZo4I.js} +2 -2
  95. package/dist/{layers.BnRpAAlF.js → layers.C_AfKjTB.js} +1 -1
  96. package/dist/{layers.D6a0mAc6.js → layers.CaTJnQ9u.js} +1 -1
  97. package/dist/{layers.CuVGCSqO.js → layers.CakuyGCQ.js} +1 -1
  98. package/dist/{layers.5h2RcPii.js → layers.CbmxJEUV.js} +130 -130
  99. package/dist/{layers.BwDZF6jP.js → layers.CcsWrdTv.js} +1 -1
  100. package/dist/{layers.u7Ns5vGH.js → layers.CczDjU9N.js} +56 -56
  101. package/dist/layers.CdbF8xYj.js +8 -0
  102. package/dist/layers.ChFAeZ6n.js +2 -0
  103. package/dist/{layers.DIinupg_.js → layers.ChyiO7W2.js} +89 -90
  104. package/dist/{layers.XcKE2JQ1.js → layers.Ci0fy6mm.js} +1 -1
  105. package/dist/{layers.UJU8qQAn.js → layers.CinKDuBS.js} +1 -1
  106. package/dist/{layers.BM0PIwPm.js → layers.CjfXghGO.js} +1 -1
  107. package/dist/{layers.BaHA4Shj.js → layers.CkHkzjP7.js} +1 -1
  108. package/dist/{layers.BXD95e_q.js → layers.ClovUFct.js} +14 -15
  109. package/dist/{layers.ijvnT6-f.js → layers.Cmzu43i4.js} +34 -34
  110. package/dist/{layers.DUt_7Rf9.js → layers.Cs24L6er.js} +6 -6
  111. package/dist/{layers.D12qRcsu.js → layers.CtE1xXZh.js} +1 -1
  112. package/dist/{layers.sDmQeN5H.js → layers.CtUY0ri3.js} +590 -591
  113. package/dist/{layers.Bzzte71n.js → layers.CuC5nLW8.js} +1 -1
  114. package/dist/{layers.BkDTMrUN.js → layers.CuDNx9A1.js} +1 -1
  115. package/dist/{layers.BE9kQeZe.js → layers.CugRvVGY.js} +1 -1
  116. package/dist/{layers.Dql9KEZr.js → layers.CwFOQcrb.js} +4 -5
  117. package/dist/{layers.DuiJZjBm.js → layers.CyH2JHOr.js} +1 -1
  118. package/dist/{layers.dFLqx2yF.js → layers.CzEbMWGx.js} +1 -1
  119. package/dist/{layers.DYKoL1v7.js → layers.D0W9WciE.js} +40 -41
  120. package/dist/{layers.CYBOlxgn.js → layers.D1j5HCgS.js} +7 -8
  121. package/dist/{layers.BD0kudED.js → layers.D29gtt0H.js} +1 -1
  122. package/dist/{layers._VwDTgZW.js → layers.D2Kx1511.js} +1 -1
  123. package/dist/{layers.CG8R0qJB.js → layers.D3U9SdgE.js} +1 -1
  124. package/dist/{layers.CKILpQg6.js → layers.D3aDob9Z.js} +1 -1
  125. package/dist/{layers.Y_OQ_zog.js → layers.D4A3yxw0.js} +1 -1
  126. package/dist/{layers.hXK5MQUI.js → layers.D4XVPZpA.js} +1 -1
  127. package/dist/{layers.DQAUau8M.js → layers.D7APxkZ4.js} +1 -1
  128. package/dist/{layers.C8YnAQyz.js → layers.D7yG1HEx.js} +1 -1
  129. package/dist/{layers.B1WO8gEK.js → layers.D9vlbJdq.js} +80 -81
  130. package/dist/{layers.AZC4YUu_.js → layers.DBbMzX3L.js} +1 -1
  131. package/dist/{layers.B3eNZiVS.js → layers.DBd1ZxHp.js} +1 -1
  132. package/dist/{layers.COzBijJ2.js → layers.DDbaPvpM.js} +1 -1
  133. package/dist/{layers.CC0Hhj9e.js → layers.DDwqLeSC.js} +1 -1
  134. package/dist/{layers.DooAEuei.js → layers.DEJLw5pD.js} +1 -1
  135. package/dist/{layers.BjA5a3oW.js → layers.DFUTFOcc.js} +1 -1
  136. package/dist/{layers.CmU-4IOd.js → layers.DGNpEhCF.js} +1 -1
  137. package/dist/layers.DGt5eZsp.js +2 -0
  138. package/dist/{layers.Bne778y0.js → layers.DI85re_s.js} +1 -1
  139. package/dist/{layers.CEF0QmMB.js → layers.DJUAT4C2.js} +1 -1
  140. package/dist/{layers.x9pj1ZgJ.js → layers.DK9jGMtC.js} +1 -1
  141. package/dist/{layers.CzRAqMwS.js → layers.DLCTcxL1.js} +1 -1
  142. package/dist/{layers.BNkMUXgY.js → layers.DNpJjBUJ.js} +1 -1
  143. package/dist/{layers.8HVSVFE-.js → layers.DOWkTN19.js} +4 -4
  144. package/dist/{layers.Cy6OFGbS.js → layers.DOsKyasI.js} +1 -1
  145. package/dist/{layers.CyEIletN.js → layers.DP03vw0i.js} +1 -1
  146. package/dist/{layers.Bs3nM_3m.js → layers.DP62iSBu.js} +1 -1
  147. package/dist/{layers.Be-cU_ws.js → layers.DQtWLaX5.js} +1 -1
  148. package/dist/{layers.D4T2Soqk.js → layers.DRx6fpU-.js} +1 -1
  149. package/dist/{layers.K2uXkFD_.js → layers.DVASDwnU.js} +1 -1
  150. package/dist/{layers.F84K5xXI.js → layers.DW88x7MD.js} +1 -1
  151. package/dist/{layers.Bx1ePve8.js → layers.DY33k0DK.js} +1 -1
  152. package/dist/{layers.BSij2zBh.js → layers.DYEd0u9z.js} +31 -32
  153. package/dist/{layers.aZknhRkQ.js → layers.DZ3T1MOr.js} +1 -1
  154. package/dist/{layers.CeEElame.js → layers.D_ERA5Eg.js} +1 -1
  155. package/dist/{layers.B4pYlpG5.js → layers.DazxntKQ.js} +6 -7
  156. package/dist/layers.DcLjb1VI.js +6 -0
  157. package/dist/{layers.C1mH2Dk9.js → layers.DdZQdfst.js} +1 -1
  158. package/dist/{layers.D0snKWX1.js → layers.Df9wCGO4.js} +1 -1
  159. package/dist/{layers.kb3mM5t_.js → layers.DgHnZEoL.js} +1 -1
  160. package/dist/layers.Dl7BTVgv.js +1 -0
  161. package/dist/{layers.DQDnK58Z.js → layers.DpVMkxT_.js} +1 -1
  162. package/dist/{layers.BIj1UrA0.js → layers.DqJ4YLRH.js} +1 -1
  163. package/dist/layers.DrdNodqe.js +282 -0
  164. package/dist/{layers.CzAXXTsc.js → layers.DunslCYq.js} +1 -1
  165. package/dist/{layers.Brjl1KT8.js → layers.DuqCxozN.js} +1 -1
  166. package/dist/{layers.By1Q71yL.js → layers.DvFoHZK-.js} +1 -1
  167. package/dist/{layers.BL-Apcgs.js → layers.Dvrki03a.js} +37 -38
  168. package/dist/{layers.BxzIRQ9I.js → layers.DwGsA97C.js} +1 -1
  169. package/dist/{layers.BfBuL2KB.js → layers.Dz9flu9L.js} +1 -1
  170. package/dist/{layers.5VVP7KN3.js → layers.EEZOfKqy.js} +11 -12
  171. package/dist/{layers.CsJaFpQS.js → layers.F7xHDD6v.js} +1 -1
  172. package/dist/{layers.C7hSyuhy.js → layers.IF5vNpDk.js} +1 -1
  173. package/dist/{layers.DzrKg1RQ.js → layers.KlMi93Ei.js} +1 -1
  174. package/dist/layers.Km1Ud22C.js +257 -0
  175. package/dist/{layers.DWkisZo-.js → layers.MTRKGDa2.js} +1 -1
  176. package/dist/{layers.tAblKoS0.js → layers.MV17d6Mx.js} +1 -1
  177. package/dist/{layers.Cct8dVnE.js → layers.MoTyg_20.js} +16 -16
  178. package/dist/{layers.CLf-0Sch.js → layers.Otjc68EQ.js} +1 -1
  179. package/dist/layers.P3AQhXRL.js +8 -0
  180. package/dist/{layers.DqNkUvmt.js → layers.PGw1DVB5.js} +1 -1
  181. package/dist/{layers.46Oaqi6S.js → layers.TnYc2d7k.js} +1 -1
  182. package/dist/{layers.Bh65sv3c.js → layers.UAUOxFCw.js} +1 -1
  183. package/dist/{layers.BH4W4xK9.js → layers.UFaXcVX-.js} +1 -1
  184. package/dist/{layers.D-Q4XxS7.js → layers.UFuuJbTe.js} +2520 -2502
  185. package/dist/{layers.dk1FdSQs.js → layers.VYHrW5HF.js} +1 -1
  186. package/dist/layers.XuOcZ2YD.js +1 -0
  187. package/dist/{layers.MOxoSbw2.js → layers.XzjaNKF4.js} +1 -1
  188. package/dist/{layers.DDZEzjTB.js → layers.YIcMqcyp.js} +1 -1
  189. package/dist/layers._Qb0PjpM.js +1 -0
  190. package/dist/layers._d3cgXev.js +1 -0
  191. package/dist/{layers.n7qcjq92.js → layers._rLtEprV.js} +1 -1
  192. package/dist/layers.b-LTJte2.js +59 -0
  193. package/dist/layers.binJQZ6L.js +122 -0
  194. package/dist/{layers.BUQI8TYR.js → layers.gEwF8vUu.js} +20 -23
  195. package/dist/{layers.DONU4DiH.js → layers.iCxIdCf4.js} +13 -14
  196. package/dist/{layers.CI3uwpYk.js → layers.j2m1V3h_.js} +1 -1
  197. package/dist/{layers.4wMwkbzz.js → layers.o15MC5m1.js} +5 -5
  198. package/dist/layers.oPCvx-2P.js +1 -0
  199. package/dist/{layers.B6FBBhIq.js → layers.pWLA6ZDi.js} +20 -21
  200. package/dist/{layers.DPj1fZP9.js → layers.sd-cXx8M.js} +18 -19
  201. package/dist/{layers.iuKQqbaH.js → layers.w-DSpxnL.js} +7 -8
  202. package/dist/{layers.BZyLsPlK.js → layers.wMGES0RI.js} +7 -8
  203. package/dist/{layers.DAwYVZQ2.js → layers.wfJtLKCx.js} +1 -1
  204. package/dist/{layers.5Tm9dPWa.js → layers.xVBO5Ikf.js} +1 -1
  205. package/dist/{layers.lmIdYb5_.js → layers.z4rFqQ1E.js} +1 -1
  206. package/dist/{layers.DJw4J3iL.js → layers.zR0cTXnd.js} +1 -1
  207. package/package.json +1 -1
  208. package/dist/layers.B2tTj5km.js +0 -8
  209. package/dist/layers.B9ZnHHGd.js +0 -244
  210. package/dist/layers.BDUl16pn.js +0 -1
  211. package/dist/layers.BKytuiiB.js +0 -65
  212. package/dist/layers.BZsELoBg.js +0 -2
  213. package/dist/layers.BehKr7r4.js +0 -1
  214. package/dist/layers.BubVFU4w.js +0 -1
  215. package/dist/layers.C6an3iNY.js +0 -8
  216. package/dist/layers.CXeLnAYi.js +0 -1
  217. package/dist/layers.DPJY4HYM.js +0 -1
  218. package/dist/layers.DWJeFUzg.js +0 -4
  219. package/dist/layers.DjOFnT8v.js +0 -1
  220. package/dist/layers.DzVuFvx3.js +0 -2
  221. package/dist/layers.LQullGbk.js +0 -1
  222. package/dist/layers.O0NSmzEc.js +0 -73
  223. package/dist/layers.YXQx_NJy.js +0 -122
  224. package/dist/layers.Z4o2OOf5.js +0 -10
  225. package/dist/layers.mwHjQPRu.js +0 -257
  226. package/dist/layers.s7jiwsxb.js +0 -96
  227. package/dist/layers.xKmy9hl8.js +0 -6
  228. package/dist/layers.xSKkAVrl.js +0 -1
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./layers.s7jiwsxb.js");require("./layers.u7Ns5vGH.js");const pt=require("./layers.B19hGmey.js"),mt=require("./layers.BIeVwYKL.js");function rt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function ft(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function Z(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function kt(t){return t.target.depth}function _t(t){return t.depth}function xt(t,n){return n-1-t.height}function yt(t,n){return t.sourceLinks.length?t.depth:n-1}function vt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?ft(t.sourceLinks,kt)-1:0}function G(t){return function(){return t}}function ot(t,n){return Y(t.source,n.source)||t.index-n.index}function lt(t,n){return Y(t.target,n.target)||t.index-n.index}function Y(t,n){return t.y0-n.y0}function J(t){return t.value}function bt(t){return t.index}function wt(t){return t.nodes}function St(t){return t.links}function at(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function ct({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Lt(){let t=0,n=0,s=1,a=1,u=24,_=8,g,p=bt,i=yt,o,c,m=wt,b=St,y=6;function x(){const e={nodes:m.apply(null,arguments),links:b.apply(null,arguments)};return A(e),E(e),T(e),C(e),S(e),ct(e),e}x.update=function(e){return ct(e),e},x.nodeId=function(e){return arguments.length?(p=typeof e=="function"?e:G(e),x):p},x.nodeAlign=function(e){return arguments.length?(i=typeof e=="function"?e:G(e),x):i},x.nodeSort=function(e){return arguments.length?(o=e,x):o},x.nodeWidth=function(e){return arguments.length?(u=+e,x):u},x.nodePadding=function(e){return arguments.length?(_=g=+e,x):_},x.nodes=function(e){return arguments.length?(m=typeof e=="function"?e:G(e),x):m},x.links=function(e){return arguments.length?(b=typeof e=="function"?e:G(e),x):b},x.linkSort=function(e){return arguments.length?(c=e,x):c},x.size=function(e){return arguments.length?(t=n=0,s=+e[0],a=+e[1],x):[s-t,a-n]},x.extent=function(e){return arguments.length?(t=+e[0][0],s=+e[1][0],n=+e[0][1],a=+e[1][1],x):[[t,n],[s,a]]},x.iterations=function(e){return arguments.length?(y=+e,x):y};function A({nodes:e,links:f}){for(const[h,r]of e.entries())r.index=h,r.sourceLinks=[],r.targetLinks=[];const l=new Map(e.map((h,r)=>[p(h,r,e),h]));for(const[h,r]of f.entries()){r.index=h;let{source:k,target:v}=r;typeof k!="object"&&(k=r.source=at(l,k)),typeof v!="object"&&(v=r.target=at(l,v)),k.sourceLinks.push(r),v.targetLinks.push(r)}if(c!=null)for(const{sourceLinks:h,targetLinks:r}of e)h.sort(c),r.sort(c)}function E({nodes:e}){for(const f of e)f.value=f.fixedValue===void 0?Math.max(Z(f.sourceLinks,J),Z(f.targetLinks,J)):f.fixedValue}function T({nodes:e}){const f=e.length;let l=new Set(e),h=new Set,r=0;for(;l.size;){for(const k of l){k.depth=r;for(const{target:v}of k.sourceLinks)h.add(v)}if(++r>f)throw new Error("circular link");l=h,h=new Set}}function C({nodes:e}){const f=e.length;let l=new Set(e),h=new Set,r=0;for(;l.size;){for(const k of l){k.height=r;for(const{source:v}of k.targetLinks)h.add(v)}if(++r>f)throw new Error("circular link");l=h,h=new Set}}function O({nodes:e}){const f=rt(e,r=>r.depth)+1,l=(s-t-u)/(f-1),h=new Array(f);for(const r of e){const k=Math.max(0,Math.min(f-1,Math.floor(i.call(null,r,f))));r.layer=k,r.x0=t+k*l,r.x1=r.x0+u,h[k]?h[k].push(r):h[k]=[r]}if(o)for(const r of h)r.sort(o);return h}function j(e){const f=ft(e,l=>(a-n-(l.length-1)*g)/Z(l,J));for(const l of e){let h=n;for(const r of l){r.y0=h,r.y1=h+r.value*f,h=r.y1+g;for(const k of r.sourceLinks)k.width=k.value*f}h=(a-h+g)/(l.length+1);for(let r=0;r<l.length;++r){const k=l[r];k.y0+=h*(r+1),k.y1+=h*(r+1)}$(l)}}function S(e){const f=O(e);g=Math.min(_,(a-n)/(rt(f,l=>l.length)-1)),j(f);for(let l=0;l<y;++l){const h=Math.pow(.99,l),r=Math.max(1-h,(l+1)/y);D(f,h,r),N(f,h,r)}}function N(e,f,l){for(let h=1,r=e.length;h<r;++h){const k=e[h];for(const v of k){let U=0,z=0;for(const{source:F,value:K}of v.targetLinks){let q=K*(v.layer-F.layer);U+=M(F,v)*q,z+=q}if(!(z>0))continue;let W=(U/z-v.y0)*f;v.y0+=W,v.y1+=W,w(v)}o===void 0&&k.sort(Y),P(k,l)}}function D(e,f,l){for(let h=e.length,r=h-2;r>=0;--r){const k=e[r];for(const v of k){let U=0,z=0;for(const{target:F,value:K}of v.sourceLinks){let q=K*(F.layer-v.layer);U+=R(v,F)*q,z+=q}if(!(z>0))continue;let W=(U/z-v.y0)*f;v.y0+=W,v.y1+=W,w(v)}o===void 0&&k.sort(Y),P(k,l)}}function P(e,f){const l=e.length>>1,h=e[l];d(e,h.y0-g,l-1,f),I(e,h.y1+g,l+1,f),d(e,a,e.length-1,f),I(e,n,0,f)}function I(e,f,l,h){for(;l<e.length;++l){const r=e[l],k=(f-r.y0)*h;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+g}}function d(e,f,l,h){for(;l>=0;--l){const r=e[l],k=(r.y1-f)*h;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-g}}function w({sourceLinks:e,targetLinks:f}){if(c===void 0){for(const{source:{sourceLinks:l}}of f)l.sort(lt);for(const{target:{targetLinks:l}}of e)l.sort(ot)}}function $(e){if(c===void 0)for(const{sourceLinks:f,targetLinks:l}of e)f.sort(lt),l.sort(ot)}function M(e,f){let l=e.y0-(e.sourceLinks.length-1)*g/2;for(const{target:h,width:r}of e.sourceLinks){if(h===f)break;l+=r+g}for(const{source:h,width:r}of f.targetLinks){if(h===e)break;l-=r}return l}function R(e,f){let l=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:h,width:r}of f.targetLinks){if(h===e)break;l+=r+g}for(const{target:h,width:r}of e.sourceLinks){if(h===f)break;l-=r}return l}return x}var tt=Math.PI,et=2*tt,B=1e-6,Et=et-B;function nt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function dt(){return new nt}nt.prototype=dt.prototype={constructor:nt,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,_){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+_)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var _=this._x1,g=this._y1,p=s-t,i=a-n,o=_-t,c=g-n,m=o*o+c*c;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(m>B)if(!(Math.abs(c*p-i*o)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var b=s-_,y=a-g,x=p*p+i*i,A=b*b+y*y,E=Math.sqrt(x),T=Math.sqrt(m),C=u*Math.tan((tt-Math.acos((x+m-A)/(2*E*T)))/2),O=C/T,j=C/E;Math.abs(O-1)>B&&(this._+="L"+(t+O*o)+","+(n+O*c)),this._+="A"+u+","+u+",0,0,"+ +(c*b>o*y)+","+(this._x1=t+j*p)+","+(this._y1=n+j*i)}},arc:function(t,n,s,a,u,_){t=+t,n=+n,s=+s,_=!!_;var g=s*Math.cos(a),p=s*Math.sin(a),i=t+g,o=n+p,c=1^_,m=_?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+i+","+o:(Math.abs(this._x1-i)>B||Math.abs(this._y1-o)>B)&&(this._+="L"+i+","+o),s&&(m<0&&(m=m%et+et),m>Et?this._+="A"+s+","+s+",0,1,"+c+","+(t-g)+","+(n-p)+"A"+s+","+s+",0,1,"+c+","+(this._x1=i)+","+(this._y1=o):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=tt)+","+c+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function ut(t){return function(){return t}}function At(t){return t[0]}function Tt(t){return t[1]}var Mt=Array.prototype.slice;function Nt(t){return t.source}function Ct(t){return t.target}function Pt(t){var n=Nt,s=Ct,a=At,u=Tt,_=null;function g(){var p,i=Mt.call(arguments),o=n.apply(this,i),c=s.apply(this,i);if(_||(_=p=dt()),t(_,+a.apply(this,(i[0]=o,i)),+u.apply(this,i),+a.apply(this,(i[0]=c,i)),+u.apply(this,i)),p)return _=null,p+""||null}return g.source=function(p){return arguments.length?(n=p,g):n},g.target=function(p){return arguments.length?(s=p,g):s},g.x=function(p){return arguments.length?(a=typeof p=="function"?p:ut(+p),g):a},g.y=function(p){return arguments.length?(u=typeof p=="function"?p:ut(+p),g):u},g.context=function(p){return arguments.length?(_=p??null,g):_},g}function It(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Ot(){return Pt(It)}function $t(t){return[t.source.x1,t.y0]}function Dt(t){return[t.target.x0,t.y1]}function jt(){return Ot().source($t).target(Dt)}var it=(function(){var t=function(p,i,o,c){for(o=o||{},c=p.length;c--;o[p[c]]=i);return o},n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:function(){},yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:function(i,o,c,m,b,y,x){var A=y.length-1;switch(b){case 7:const E=m.findOrCreateNode(y[A-4].trim().replaceAll('""','"')),T=m.findOrCreateNode(y[A-2].trim().replaceAll('""','"')),C=parseFloat(y[A].trim());m.addLink(E,T,C);break;case 8:case 9:case 11:this.$=y[A];break;case 10:this.$=y[A-1];break}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:function(i,o){if(o.recoverable)this.trace(i);else{var c=new Error(i);throw c.hash=o,c}},parse:function(i){var o=this,c=[0],m=[],b=[null],y=[],x=this.table,A="",E=0,T=0,C=2,O=1,j=y.slice.call(arguments,1),S=Object.create(this.lexer),N={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(N.yy[D]=this.yy[D]);S.setInput(i,N.yy),N.yy.lexer=S,N.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var P=S.yylloc;y.push(P);var I=S.options&&S.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(){var v;return v=m.pop()||S.lex()||O,typeof v!="number"&&(v instanceof Array&&(m=v,v=m.pop()),v=o.symbols_[v]||v),v}for(var w,$,M,R,e={},f,l,h,r;;){if($=c[c.length-1],this.defaultActions[$]?M=this.defaultActions[$]:((w===null||typeof w>"u")&&(w=d()),M=x[$]&&x[$][w]),typeof M>"u"||!M.length||!M[0]){var k="";r=[];for(f in x[$])this.terminals_[f]&&f>C&&r.push("'"+this.terminals_[f]+"'");S.showPosition?k="Parse error on line "+(E+1)+`:
2
- `+S.showPosition()+`
3
- Expecting `+r.join(", ")+", got '"+(this.terminals_[w]||w)+"'":k="Parse error on line "+(E+1)+": Unexpected "+(w==O?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(k,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:P,expected:r})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+w);switch(M[0]){case 1:c.push(w),b.push(S.yytext),y.push(S.yylloc),c.push(M[1]),w=null,T=S.yyleng,A=S.yytext,E=S.yylineno,P=S.yylloc;break;case 2:if(l=this.productions_[M[1]][1],e.$=b[b.length-l],e._$={first_line:y[y.length-(l||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(l||1)].first_column,last_column:y[y.length-1].last_column},I&&(e._$.range=[y[y.length-(l||1)].range[0],y[y.length-1].range[1]]),R=this.performAction.apply(e,[A,T,E,N.yy,M[1],b,y].concat(j)),typeof R<"u")return R;l&&(c=c.slice(0,-1*l*2),b=b.slice(0,-1*l),y=y.slice(0,-1*l)),c.push(this.productions_[M[1]][0]),b.push(e.$),y.push(e._$),h=x[c[c.length-2]][c[c.length-1]],c.push(h);break;case 3:return!0}}return!0}},_=(function(){var p={EOF:1,parseError:function(o,c){if(this.yy.parser)this.yy.parser.parseError(o,c);else throw new Error(o)},setInput:function(i,o){return this.yy=o||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var o=i.length,c=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var b=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===m.length?this.yylloc.first_column:0)+m[m.length-c.length].length-c[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
- `+o+"^"},test_match:function(i,o){var c,m,b;if(this.options.backtrack_lexer&&(b={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(b.yylloc.range=this.yylloc.range.slice(0))),m=i[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],c=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var y in b)this[y]=b[y];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,c,m;this._more||(this.yytext="",this.match="");for(var b=this._currentRules(),y=0;y<b.length;y++)if(c=this._input.match(this.rules[b[y]]),c&&(!o||c[0].length>o[0].length)){if(o=c,m=y,this.options.backtrack_lexer){if(i=this.test_match(c,b[y]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,b[m]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var o=this.next();return o||this.lex()},begin:function(o){this.conditionStack.push(o)},popState:function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},pushState:function(o){this.begin(o)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(o,c,m,b){switch(m){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return p})();u.lexer=_;function g(){this.yy={}}return g.prototype=u,u.Parser=g,new g})();it.parser=it;const H=it;let X=[],Q=[],V={};const zt=()=>{X=[],Q=[],V={},L.clear()};class Bt{constructor(n,s,a=0){this.source=n,this.target=s,this.value=a}}const Vt=(t,n,s)=>{X.push(new Bt(t,n,s))};class Rt{constructor(n){this.ID=n}}const Ut=t=>(t=L.common$1.sanitizeText(t,L.getConfig()),V[t]||(V[t]=new Rt(t),Q.push(V[t])),V[t]),Wt=()=>Q,Ft=()=>X,qt=()=>({nodes:Q.map(t=>({id:t.ID})),links:X.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),Gt={nodesMap:V,getConfig:()=>L.getConfig().sankey,getNodes:Wt,getLinks:Ft,getGraph:qt,addLink:Vt,findOrCreateNode:Ut,getAccTitle:L.getAccTitle,setAccTitle:L.setAccTitle,getAccDescription:L.getAccDescription,setAccDescription:L.setAccDescription,getDiagramTitle:L.getDiagramTitle,setDiagramTitle:L.setDiagramTitle,clear:zt},gt=class st{static next(n){return new st(n+ ++st.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}};gt.count=0;let ht=gt;const Yt={left:_t,right:xt,center:vt,justify:yt},Ht=function(t,n,s,a){const{securityLevel:u,sankey:_}=L.getConfig(),g=L.defaultConfig.sankey;let p;u==="sandbox"&&(p=L.select("#i"+n));const i=u==="sandbox"?L.select(p.nodes()[0].contentDocument.body):L.select("body"),o=u==="sandbox"?i.select(`[id="${n}"]`):L.select(`[id="${n}"]`),c=(_==null?void 0:_.width)??g.width,m=(_==null?void 0:_.height)??g.width,b=(_==null?void 0:_.useMaxWidth)??g.useMaxWidth,y=(_==null?void 0:_.nodeAlignment)??g.nodeAlignment,x=(_==null?void 0:_.prefix)??g.prefix,A=(_==null?void 0:_.suffix)??g.suffix,E=(_==null?void 0:_.showValues)??g.showValues,T=a.db.getGraph(),C=Yt[y];Lt().nodeId(d=>d.id).nodeWidth(10).nodePadding(10+(E?15:0)).nodeAlign(C).extent([[0,0],[c,m]])(T);const S=pt.ordinal(mt.schemeTableau10);o.append("g").attr("class","nodes").selectAll(".node").data(T.nodes).join("g").attr("class","node").attr("id",d=>(d.uid=ht.next("node-")).id).attr("transform",function(d){return"translate("+d.x0+","+d.y0+")"}).attr("x",d=>d.x0).attr("y",d=>d.y0).append("rect").attr("height",d=>d.y1-d.y0).attr("width",d=>d.x1-d.x0).attr("fill",d=>S(d.id));const N=({id:d,value:w})=>E?`${d}
7
- ${x}${Math.round(w*100)/100}${A}`:d;o.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(T.nodes).join("text").attr("x",d=>d.x0<c/2?d.x1+6:d.x0-6).attr("y",d=>(d.y1+d.y0)/2).attr("dy",`${E?"0":"0.35"}em`).attr("text-anchor",d=>d.x0<c/2?"start":"end").text(N);const D=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(T.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),P=(_==null?void 0:_.linkColor)||"gradient";if(P==="gradient"){const d=D.append("linearGradient").attr("id",w=>(w.uid=ht.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",w=>w.source.x1).attr("x2",w=>w.target.x0);d.append("stop").attr("offset","0%").attr("stop-color",w=>S(w.source.id)),d.append("stop").attr("offset","100%").attr("stop-color",w=>S(w.target.id))}let I;switch(P){case"gradient":I=d=>d.uid;break;case"source":I=d=>S(d.source.id);break;case"target":I=d=>S(d.target.id);break;default:I=P}D.append("path").attr("d",jt()).attr("stroke",I).attr("stroke-width",d=>Math.max(1,d.width)),L.setupGraphViewbox$1(void 0,o,0,b)},Xt={draw:Ht},Qt=t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
- `).trim(),Kt=H.parse.bind(H);H.parse=t=>Kt(Qt(t));const Zt={parser:H,db:Gt,renderer:Xt};exports.diagram=Zt;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./layers.BIj1UrA0.js"),z=require("./layers.9QK1wiQj.js"),i=require("./layers.s7jiwsxb.js"),j=require("./layers.dFLqx2yF.js");require("./layers.u7Ns5vGH.js");require("lodash-es");require("./layers.COAF7f8g.js");const h="rect",C="rectWithTitle",K="start",F="end",J="divider",Q="roundedWithTitle",X="note",Z="noteGroup",b="statediagram",m="state",I=`${b}-${m}`,k="transition",tt="note",et="note-edge",ot=`${k} ${et}`,st=`${b}-${tt}`,nt="cluster",ct=`${b}-${nt}`,it="cluster-alt",rt=`${b}-${it}`,M="parent",B="note",lt="state",w="----",at=`${w}${B}`,v=`${w}${M}`,H="fill:none",U="fill: #333",q="c",V="text",Y="normal";let y={},S=0;const dt=function(t){const n=Object.keys(t);for(const e of n)t[e]},Et=function(t,n){return n.db.extract(n.db.getRootDocV2()),n.db.getClasses()};function St(t){return t==null?"":t.classes?t.classes.join(" "):""}function x(t="",n=0,e="",c=w){const r=e!==null&&e.length>0?`${c}${e}`:"";return`${lt}-${t}${r}-${n}`}const p=(t,n,e,c,r,l)=>{const o=e.id,g=St(c[o]);if(o!=="root"){let u=h;e.start===!0&&(u=K),e.start===!1&&(u=F),e.type!==a.DEFAULT_STATE_TYPE&&(u=e.type),y[o]||(y[o]={id:o,shape:u,description:i.common$1.sanitizeText(o,i.getConfig()),classes:`${g} ${I}`});const s=y[o];e.description&&(Array.isArray(s.description)?(s.shape=C,s.description.push(e.description)):s.description.length>0?(s.shape=C,s.description===o?s.description=[e.description]:s.description=[s.description,e.description]):(s.shape=h,s.description=e.description),s.description=i.common$1.sanitizeTextOrArray(s.description,i.getConfig())),s.description.length===1&&s.shape===C&&(s.shape=h),!s.type&&e.doc&&(i.log$1.info("Setting cluster for ",o,R(e)),s.type="group",s.dir=R(e),s.shape=e.type===a.DIVIDER_TYPE?J:Q,s.classes=s.classes+" "+ct+" "+(l?rt:""));const _={labelStyle:"",shape:s.shape,labelText:s.description,classes:s.classes,style:"",id:o,dir:s.dir,domId:x(o,S),type:s.type,padding:15};if(_.centerLabel=!0,e.note){const d={labelStyle:"",shape:X,labelText:e.note.text,classes:st,style:"",id:o+at+"-"+S,domId:x(o,S,B),type:s.type,padding:15},E={labelStyle:"",shape:Z,labelText:e.note.text,classes:s.classes,style:"",id:o+v,domId:x(o,S,M),type:"group",padding:0};S++;const f=o+v;t.setNode(f,E),t.setNode(d.id,d),t.setNode(o,_),t.setParent(o,f),t.setParent(d.id,f);let T=o,A=d.id;e.note.position==="left of"&&(T=d.id,A=o),t.setEdge(T,A,{arrowhead:"none",arrowType:"",style:H,labelStyle:"",classes:ot,arrowheadStyle:U,labelpos:q,labelType:V,thickness:Y})}else t.setNode(o,_)}n&&n.id!=="root"&&(i.log$1.trace("Setting node ",o," to be child of its parent ",n.id),t.setParent(o,n.id)),e.doc&&(i.log$1.trace("Adding nodes children "),Tt(t,e,e.doc,c,r,!l))},Tt=(t,n,e,c,r,l)=>{i.log$1.trace("items",e),e.forEach(o=>{switch(o.stmt){case a.STMT_STATE:p(t,n,o,c,r,l);break;case a.DEFAULT_STATE_TYPE:p(t,n,o,c,r,l);break;case a.STMT_RELATION:{p(t,n,o.state1,c,r,l),p(t,n,o.state2,c,r,l);const g={id:"edge"+S,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:H,labelStyle:"",label:i.common$1.sanitizeText(o.description,i.getConfig()),arrowheadStyle:U,labelpos:q,labelType:V,thickness:Y,classes:k};t.setEdge(o.state1.id,o.state2.id,g,S),S++}break}})},R=(t,n=a.DEFAULT_NESTED_DOC_DIR)=>{let e=n;if(t.doc)for(let c=0;c<t.doc.length;c++){const r=t.doc[c];r.stmt==="dir"&&(e=r.value)}return e},ut=async function(t,n,e,c){i.log$1.info("Drawing state diagram (v2)",n),y={},c.db.getDirection();const{securityLevel:r,state:l}=i.getConfig(),o=l.nodeSpacing||50,g=l.rankSpacing||50;i.log$1.info(c.db.getRootDocV2()),c.db.extract(c.db.getRootDocV2()),i.log$1.info(c.db.getRootDocV2());const u=c.db.getStates(),s=new z.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:R(c.db.getRootDocV2()),nodesep:o,ranksep:g,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p(s,void 0,c.db.getRootDocV2(),u,c.db,!0);let _;r==="sandbox"&&(_=i.select("#i"+n));const d=r==="sandbox"?i.select(_.nodes()[0].contentDocument.body):i.select("body"),E=d.select(`[id="${n}"]`),f=d.select("#"+n+" g");await j.render(f,s,["barb"],b,n);const T=8;i.utils.insertTitle(E,"statediagramTitleText",l.titleTopMargin,c.db.getDiagramTitle());const A=E.node().getBBox(),G=A.width+T*2,N=A.height+T*2;E.attr("class",b);const L=E.node().getBBox();i.configureSvgSize(E,N,G,l.useMaxWidth);const P=`${L.x-T} ${L.y-T} ${G} ${N}`;i.log$1.debug(`viewBox ${P}`),E.attr("viewBox",P);const W=document.querySelectorAll('[id="'+n+'"] .edgeLabel .label');for(const $ of W){const O=$.getBBox(),D=document.createElementNS("http://www.w3.org/2000/svg",h);D.setAttribute("rx",0),D.setAttribute("ry",0),D.setAttribute("width",O.width),D.setAttribute("height",O.height),$.insertBefore(D,$.firstChild)}},_t={setConf:dt,getClasses:Et,draw:ut},bt={parser:a.parser$1,db:a.db,renderer:_t,styles:a.styles,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,a.db.clear()}};exports.diagram=bt;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.BkDTMrUN.js");require("./layers.u7Ns5vGH.js");exports.Commands=e.CB;exports.subsetToBase64=e.QB;exports.subsetToBinary=e.NQ;exports.toBase64=e.AI;
@@ -1,4 +0,0 @@
1
- "use strict";const h=require("./layers.s7jiwsxb.js"),K=require("./layers.4wMwkbzz.js"),it=require("./layers.Bs3nM_3m.js"),nt=(a,t,e,i)=>{t.forEach(l=>{dt[l](a,e,i)})},lt=(a,t,e)=>{h.log$1.trace("Making markers for ",e),a.append("defs").append("marker").attr("id",e+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},ct=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},ot=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},ht=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),a.append("defs").append("marker").attr("id",e+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},ft=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),a.append("defs").append("marker").attr("id",e+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},yt=(a,t,e)=>{a.append("marker").attr("id",e+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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"),a.append("marker").attr("id",e+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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")},gt=(a,t,e)=>{a.append("marker").attr("id",e+"_"+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"),a.append("marker").attr("id",e+"_"+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")},pt=(a,t,e)=>{a.append("marker").attr("id",e+"_"+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"),a.append("marker").attr("id",e+"_"+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")},xt=(a,t,e)=>{a.append("defs").append("marker").attr("id",e+"_"+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 L9,13 L14,7 L9,1 Z")},dt={extension:lt,composition:ct,aggregation:ot,dependency:ht,lollipop:ft,point:yt,circle:gt,cross:pt,barb:xt},ut=nt;function bt(a,t){t&&a.attr("style",t)}function wt(a,t){const e=h.select(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=e.append("xhtml:div"),l=a.label,r=a.isNode?"nodeLabel":"edgeLabel";return i.html(h.sanitizeText$2('<span class="'+r+'" '+(a.labelStyle?'style="'+a.labelStyle+'"':"")+">"+l+"</span>",t)),bt(i,a.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}const mt=(a,t,e,i)=>{let l=a||"";typeof l=="object"&&(l=l[0]);const r=h.getConfig();if(h.evaluate(r.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),h.log$1.debug("vertexText"+l);const s={isNode:i,label:h.decodeEntities(l).replace(/fa[blrs]?:fa-[\w-]+/g,c=>`<i class='${c.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return wt(s,r)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?n=l:n=[];for(const c of n){const f=document.createElementNS("http://www.w3.org/2000/svg","tspan");f.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),f.setAttribute("dy","1em"),f.setAttribute("x","0"),e?f.setAttribute("class","title-row"):f.setAttribute("class","row"),f.textContent=c.trim(),s.appendChild(f)}return s}},B=mt,L=async(a,t,e,i)=>{let l;const r=t.useHtmlLabels||h.evaluate(h.getConfig().flowchart.htmlLabels);e?l=e:l="node default";const s=a.insert("g").attr("class",l).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",t.labelStyle);let c;t.labelText===void 0?c="":c=typeof t.labelText=="string"?t.labelText:t.labelText[0];const f=n.node();let o;t.labelType==="markdown"?o=K.createText(n,h.sanitizeText$2(h.decodeEntities(c),h.getConfig()),{useHtmlLabels:r,width:t.width||h.getConfig().flowchart.wrappingWidth,classes:"markdown-node-label"}):o=f.appendChild(B(h.sanitizeText$2(h.decodeEntities(c),h.getConfig()),t.labelStyle,!1,i));let y=o.getBBox();const p=t.padding/2;if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const g=o.children[0],d=h.select(o),m=g.getElementsByTagName("img");if(m){const x=c.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...m].map(u=>new Promise(S=>{function C(){if(u.style.display="flex",u.style.flexDirection="column",x){const M=h.getConfig().fontSize?h.getConfig().fontSize:window.getComputedStyle(document.body).fontSize,W=parseInt(M,10)*5+"px";u.style.minWidth=W,u.style.maxWidth=W}else u.style.width="100%";S(u)}setTimeout(()=>{u.complete&&C()}),u.addEventListener("error",C),u.addEventListener("load",C)})))}y=g.getBoundingClientRect(),d.attr("width",y.width),d.attr("height",y.height)}return r?n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):n.attr("transform","translate(0, "+-y.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:y,halfPadding:p,label:n}},w=(a,t)=>{const e=t.node().getBBox();a.width=e.width,a.height=e.height};function _(a,t,e,i){return a.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+e/2+")")}function kt(a,t){return a.intersect(t)}function P(a,t,e,i){var l=a.x,r=a.y,s=l-i.x,n=r-i.y,c=Math.sqrt(t*t*n*n+e*e*s*s),f=Math.abs(t*e*s/c);i.x<l&&(f=-f);var o=Math.abs(t*e*n/c);return i.y<r&&(o=-o),{x:l+f,y:r+o}}function vt(a,t,e){return P(a,t,t,e)}function Lt(a,t,e,i){var l,r,s,n,c,f,o,y,p,g,d,m,x,u,S;if(l=t.y-a.y,s=a.x-t.x,c=t.x*a.y-a.x*t.y,p=l*e.x+s*e.y+c,g=l*i.x+s*i.y+c,!(p!==0&&g!==0&&G(p,g))&&(r=i.y-e.y,n=e.x-i.x,f=i.x*e.y-e.x*i.y,o=r*a.x+n*a.y+f,y=r*t.x+n*t.y+f,!(o!==0&&y!==0&&G(o,y))&&(d=l*n-r*s,d!==0)))return m=Math.abs(d/2),x=s*f-n*c,u=x<0?(x-m)/d:(x+m)/d,x=r*c-l*f,S=x<0?(x-m)/d:(x+m)/d,{x:u,y:S}}function G(a,t){return a*t>0}function St(a,t,e){var i=a.x,l=a.y,r=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){s=Math.min(s,d.x),n=Math.min(n,d.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));for(var c=i-a.width/2-s,f=l-a.height/2-n,o=0;o<t.length;o++){var y=t[o],p=t[o<t.length-1?o+1:0],g=Lt(a,e,{x:c+y.x,y:f+y.y},{x:c+p.x,y:f+p.y});g&&r.push(g)}return r.length?(r.length>1&&r.sort(function(d,m){var x=d.x-e.x,u=d.y-e.y,S=Math.sqrt(x*x+u*u),C=m.x-e.x,M=m.y-e.y,I=Math.sqrt(C*C+M*M);return S<I?-1:S===I?0:1}),r[0]):a}const $t=(a,t)=>{var e=a.x,i=a.y,l=t.x-e,r=t.y-i,s=a.width/2,n=a.height/2,c,f;return Math.abs(r)*s>Math.abs(l)*n?(r<0&&(n=-n),c=r===0?0:n*l/r,f=n):(l<0&&(s=-s),c=s,f=l===0?0:s*r/l),{x:e+c,y:i+f}},tt=$t,b={node:kt,circle:vt,ellipse:P,polygon:St,rect:tt},Ct=async(a,t)=>{t.useHtmlLabels||h.getConfig().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:r}=await L(a,t,"node "+t.classes,!0);h.log$1.info("Classes = ",t.classes);const s=i.insert("rect",":first-child");return s.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-r).attr("y",-l.height/2-r).attr("width",l.width+t.padding).attr("height",l.height+t.padding),w(t,s),t.intersect=function(n){return b.rect(t,n)},i},Mt=Ct,Tt=a=>{const t=new Set;for(const e of a)switch(e){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(e);break}return t},Bt=(a,t,e)=>{const i=Tt(a),l=2,r=t.height+2*e.padding,s=r/l,n=t.width+2*s+e.padding,c=e.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:n/2,y:2*c},{x:n-s,y:0},{x:n,y:0},{x:n,y:-r/3},{x:n+2*c,y:-r/2},{x:n,y:-2*r/3},{x:n,y:-r},{x:n-s,y:-r},{x:n/2,y:-r-2*c},{x:s,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*c,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-r},{x:n-s,y:-r},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-s},{x:n,y:-r+s},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-s},{x:0,y:-r+s},{x:n,y:-r}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-s},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-s},{x:n,y:-r}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-r}]:i.has("right")?[{x:s,y:-c},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r+c}]:i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},Z=a=>a?" "+a:"",E=(a,t)=>`node default${Z(a.classes)} ${Z(a.class)}`,F=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=l+r,n=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];h.log$1.info("Question main (Circle)");const c=_(e,s,s,n);return c.attr("style",t.style),w(t,c),t.intersect=function(f){return h.log$1.warn("Intersect called"),b.polygon(t,n,f)},e},Et=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return e.insert("polygon",":first-child").attr("points",l.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(s){return b.circle(t,14,s)},e},_t=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=4,r=i.height+t.padding,s=r/l,n=i.width+2*s+t.padding,c=[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}],f=_(e,n,r,c);return f.attr("style",t.style),w(t,f),t.intersect=function(o){return b.polygon(t,c,o)},e},Nt=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,void 0,!0),l=2,r=i.height+2*t.padding,s=r/l,n=i.width+2*s+t.padding,c=Bt(t.directions,i,t),f=_(e,n,r,c);return f.attr("style",t.style),w(t,f),t.intersect=function(o){return b.polygon(t,c,o)},e},Rt=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return _(e,l,r,s).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(c){return b.polygon(t,s,c)},e},Ht=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],n=_(e,l,r,s);return n.attr("style",t.style),w(t,n),t.intersect=function(c){return b.polygon(t,s,c)},e},It=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],n=_(e,l,r,s);return n.attr("style",t.style),w(t,n),t.intersect=function(c){return b.polygon(t,s,c)},e},Ot=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],n=_(e,l,r,s);return n.attr("style",t.style),w(t,n),t.intersect=function(c){return b.polygon(t,s,c)},e},Wt=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],n=_(e,l,r,s);return n.attr("style",t.style),w(t,n),t.intersect=function(c){return b.polygon(t,s,c)},e},Xt=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],n=_(e,l,r,s);return n.attr("style",t.style),w(t,n),t.intersect=function(c){return b.polygon(t,s,c)},e},Yt=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=l/2,s=r/(2.5+l/50),n=i.height+s+t.padding,c="M 0,"+s+" a "+r+","+s+" 0,0,0 "+l+" 0 a "+r+","+s+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+r+","+s+" 0,0,0 "+l+" 0 l 0,"+-n,f=e.attr("label-offset-y",s).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+s)+")");return w(t,f),t.intersect=function(o){const y=b.rect(t,o),p=y.x-t.x;if(r!=0&&(Math.abs(p)<t.width/2||Math.abs(p)==t.width/2&&Math.abs(y.y-t.y)>t.height/2-s)){let g=s*s*(1-p*p/(r*r));g!=0&&(g=Math.sqrt(g)),g=s-g,o.y-t.y>0&&(g=-g),y.y+=g}return y},e},Dt=async(a,t)=>{const{shapeSvg:e,bbox:i,halfPadding:l}=await L(a,t,"node "+t.classes+" "+t.class,!0),r=e.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,f=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",f).attr("width",s).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(z(r,t.props.borders,s,n),o.delete("borders")),o.forEach(y=>{h.log$1.warn(`Unknown node property ${y}`)})}return w(t,r),t.intersect=function(o){return b.rect(t,o)},e},At=async(a,t)=>{const{shapeSvg:e,bbox:i,halfPadding:l}=await L(a,t,"node "+t.classes,!0),r=e.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,f=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",f).attr("width",s).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(z(r,t.props.borders,s,n),o.delete("borders")),o.forEach(y=>{h.log$1.warn(`Unknown node property ${y}`)})}return w(t,r),t.intersect=function(o){return b.rect(t,o)},e},jt=async(a,t)=>{const{shapeSvg:e}=await L(a,t,"label",!0);h.log$1.trace("Classes = ",t.class);const i=e.insert("rect",":first-child"),l=0,r=0;if(i.attr("width",l).attr("height",r),e.attr("class","label edgeLabel"),t.props){const s=new Set(Object.keys(t.props));t.props.borders&&(z(i,t.props.borders,l,r),s.delete("borders")),s.forEach(n=>{h.log$1.warn(`Unknown node property ${n}`)})}return w(t,i),t.intersect=function(s){return b.rect(t,s)},e};function z(a,t,e,i){const l=[],r=n=>{l.push(n,0)},s=n=>{l.push(0,n)};t.includes("t")?(h.log$1.debug("add top border"),r(e)):s(e),t.includes("r")?(h.log$1.debug("add right border"),r(i)):s(i),t.includes("b")?(h.log$1.debug("add bottom border"),r(e)):s(e),t.includes("l")?(h.log$1.debug("add left border"),r(i)):s(i),a.attr("stroke-dasharray",l.join(" "))}const Ut=(a,t)=>{let e;t.classes?e="node "+t.classes:e="node default";const i=a.insert("g").attr("class",e).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),r=i.insert("line"),s=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,h.log$1.info("Label text abc79",c,n,typeof n=="object");const f=s.node().appendChild(B(c,t.labelStyle,!0,!0));let o={width:0,height:0};if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const m=f.children[0],x=h.select(f);o=m.getBoundingClientRect(),x.attr("width",o.width),x.attr("height",o.height)}h.log$1.info("Text 2",n);const y=n.slice(1,n.length);let p=f.getBBox();const g=s.node().appendChild(B(y.join?y.join("<br/>"):y,t.labelStyle,!0,!0));if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const m=g.children[0],x=h.select(g);o=m.getBoundingClientRect(),x.attr("width",o.width),x.attr("height",o.height)}const d=t.padding/2;return h.select(g).attr("transform","translate( "+(o.width>p.width?0:(p.width-o.width)/2)+", "+(p.height+d+5)+")"),h.select(f).attr("transform","translate( "+(o.width<p.width?0:-(p.width-o.width)/2)+", 0)"),o=s.node().getBBox(),s.attr("transform","translate("+-o.width/2+", "+(-o.height/2-d+3)+")"),l.attr("class","outer title-state").attr("x",-o.width/2-d).attr("y",-o.height/2-d).attr("width",o.width+t.padding).attr("height",o.height+t.padding),r.attr("class","divider").attr("x1",-o.width/2-d).attr("x2",o.width/2+d).attr("y1",-o.height/2-d+p.height+d).attr("y2",-o.height/2-d+p.height+d),w(t,l),t.intersect=function(m){return b.rect(t,m)},i},zt=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.height+t.padding,r=i.width+l/4+t.padding,s=e.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return w(t,s),t.intersect=function(n){return b.rect(t,n)},e},Gt=async(a,t)=>{const{shapeSvg:e,bbox:i,halfPadding:l}=await L(a,t,E(t),!0),r=e.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),h.log$1.info("Circle main"),w(t,r),t.intersect=function(s){return h.log$1.info("Circle intersect",t,i.width/2+l,s),b.circle(t,i.width/2+l,s)},e},Zt=async(a,t)=>{const{shapeSvg:e,bbox:i,halfPadding:l}=await L(a,t,E(t),!0),r=5,s=e.insert("g",":first-child"),n=s.insert("circle"),c=s.insert("circle");return s.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+r).attr("width",i.width+t.padding+r*2).attr("height",i.height+t.padding+r*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),h.log$1.info("DoubleCircle main"),w(t,n),t.intersect=function(f){return h.log$1.info("DoubleCircle intersect",t,i.width/2+l+r,f),b.circle(t,i.width/2+l+r,f)},e},Ft=async(a,t)=>{const{shapeSvg:e,bbox:i}=await L(a,t,E(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],n=_(e,l,r,s);return n.attr("style",t.style),w(t,n),t.intersect=function(c){return b.polygon(t,s,c)},e},qt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=e.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),w(t,i),t.intersect=function(l){return b.circle(t,7,l)},e},q=(a,t,e)=>{const i=a.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,r=10;e==="LR"&&(l=10,r=70);const s=i.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return w(t,s),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return b.rect(t,n)},i},Qt=(a,t)=>{const e=a.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=e.insert("circle",":first-child"),l=e.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),w(t,l),t.intersect=function(r){return b.circle(t,7,r)},e},Vt=(a,t)=>{const e=t.padding/2,i=4,l=8;let r;t.classes?r="node "+t.classes:r="node default";const s=a.insert("g").attr("class",r).attr("id",t.domId||t.id),n=s.insert("rect",":first-child"),c=s.insert("line"),f=s.insert("line");let o=0,y=i;const p=s.insert("g").attr("class","label");let g=0;const d=t.classData.annotations&&t.classData.annotations[0],m=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",x=p.node().appendChild(B(m,t.labelStyle,!0,!0));let u=x.getBBox();if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const k=x.children[0],v=h.select(x);u=k.getBoundingClientRect(),v.attr("width",u.width),v.attr("height",u.height)}t.classData.annotations[0]&&(y+=u.height+i,o+=u.width);let S=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(h.getConfig().flowchart.htmlLabels?S+="&lt;"+t.classData.type+"&gt;":S+="<"+t.classData.type+">");const C=p.node().appendChild(B(S,t.labelStyle,!0,!0));h.select(C).attr("class","classTitle");let M=C.getBBox();if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const k=C.children[0],v=h.select(C);M=k.getBoundingClientRect(),v.attr("width",M.width),v.attr("height",M.height)}y+=M.height+i,M.width>o&&(o=M.width);const I=[];t.classData.members.forEach(k=>{const v=k.getDisplayDetails();let H=v.displayText;h.getConfig().flowchart.htmlLabels&&(H=H.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const N=p.node().appendChild(B(H,v.cssStyle?v.cssStyle:t.labelStyle,!0,!0));let T=N.getBBox();if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const U=N.children[0],X=h.select(N);T=U.getBoundingClientRect(),X.attr("width",T.width),X.attr("height",T.height)}T.width>o&&(o=T.width),y+=T.height+i,I.push(N)}),y+=l;const W=[];if(t.classData.methods.forEach(k=>{const v=k.getDisplayDetails();let H=v.displayText;h.getConfig().flowchart.htmlLabels&&(H=H.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const N=p.node().appendChild(B(H,v.cssStyle?v.cssStyle:t.labelStyle,!0,!0));let T=N.getBBox();if(h.evaluate(h.getConfig().flowchart.htmlLabels)){const U=N.children[0],X=h.select(N);T=U.getBoundingClientRect(),X.attr("width",T.width),X.attr("height",T.height)}T.width>o&&(o=T.width),y+=T.height+i,W.push(N)}),y+=l,d){let k=(o-u.width)/2;h.select(x).attr("transform","translate( "+(-1*o/2+k)+", "+-1*y/2+")"),g=u.height+i}let st=(o-M.width)/2;return h.select(C).attr("transform","translate( "+(-1*o/2+st)+", "+(-1*y/2+g)+")"),g+=M.height+i,c.attr("class","divider").attr("x1",-o/2-e).attr("x2",o/2+e).attr("y1",-y/2-e+l+g).attr("y2",-y/2-e+l+g),g+=l,I.forEach(k=>{h.select(k).attr("transform","translate( "+-o/2+", "+(-1*y/2+g+l/2)+")");const v=k==null?void 0:k.getBBox();g+=((v==null?void 0:v.height)??0)+i}),g+=l,f.attr("class","divider").attr("x1",-o/2-e).attr("x2",o/2+e).attr("y1",-y/2-e+l+g).attr("y2",-y/2-e+l+g),g+=l,W.forEach(k=>{h.select(k).attr("transform","translate( "+-o/2+", "+(-1*y/2+g)+")");const v=k==null?void 0:k.getBBox();g+=((v==null?void 0:v.height)??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-e).attr("y",-(y/2)-e).attr("width",o+t.padding).attr("height",y+t.padding),w(t,n),t.intersect=function(k){return b.rect(t,k)},s},Q={rhombus:F,composite:At,question:F,rect:Dt,labelRect:jt,rectWithTitle:Ut,choice:Et,circle:Gt,doublecircle:Zt,stadium:zt,hexagon:_t,block_arrow:Nt,rect_left_inv_arrow:Rt,lean_right:Ht,lean_left:It,trapezoid:Ot,inv_trapezoid:Wt,rect_right_inv_arrow:Xt,cylinder:Yt,start:qt,end:Qt,note:Mt,subroutine:Ft,fork:q,join:q,class_box:Vt};let O={};const Jt=async(a,t,e)=>{let i,l;if(t.link){let r;h.getConfig().securityLevel==="sandbox"?r="_top":t.linkTarget&&(r=t.linkTarget||"_blank"),i=a.insert("svg:a").attr("xlink:href",t.link).attr("target",r),l=await Q[t.shape](i,t,e)}else l=await Q[t.shape](a,t,e),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),i.attr("data-node","true"),i.attr("data-id",t.id),O[t.id]=i,t.haveCallback&&O[t.id].attr("class",O[t.id].attr("class")+" clickable"),i},Kt=(a,t)=>{O[t.id]=a},Pt=()=>{O={}},tr=a=>{const t=O[a.id];h.log$1.trace("Transforming node",a.diff,a,"translate("+(a.x-a.width/2-5)+", "+a.width/2+")");const e=8,i=a.diff||0;return a.clusterNode?t.attr("transform","translate("+(a.x+i-a.width/2)+", "+(a.y-a.height/2-e)+")"):t.attr("transform","translate("+a.x+", "+a.y+")"),i},rt=({flowchart:a})=>{var t,e;const i=((t=a==null?void 0:a.subGraphTitleMargin)==null?void 0:t.top)??0,l=((e=a==null?void 0:a.subGraphTitleMargin)==null?void 0:e.bottom)??0,r=i+l;return{subGraphTitleTopMargin:i,subGraphTitleBottomMargin:l,subGraphTitleTotalMargin:r}},R={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:5.3};function Y(a,t){if(a===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};a=A(a),t=A(t);const[e,i]=[a.x,a.y],[l,r]=[t.x,t.y],s=l-e,n=r-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}const A=a=>Array.isArray(a)?{x:a[0],y:a[1]}:a,at=a=>({x:function(t,e,i){let l=0;if(e===0&&Object.hasOwn(R,a.arrowTypeStart)){const{angle:r,deltaX:s}=Y(i[0],i[1]);l=R[a.arrowTypeStart]*Math.cos(r)*(s>=0?1:-1)}else if(e===i.length-1&&Object.hasOwn(R,a.arrowTypeEnd)){const{angle:r,deltaX:s}=Y(i[i.length-1],i[i.length-2]);l=R[a.arrowTypeEnd]*Math.cos(r)*(s>=0?1:-1)}return A(t).x+l},y:function(t,e,i){let l=0;if(e===0&&Object.hasOwn(R,a.arrowTypeStart)){const{angle:r,deltaY:s}=Y(i[0],i[1]);l=R[a.arrowTypeStart]*Math.abs(Math.sin(r))*(s>=0?1:-1)}else if(e===i.length-1&&Object.hasOwn(R,a.arrowTypeEnd)){const{angle:r,deltaY:s}=Y(i[i.length-1],i[i.length-2]);l=R[a.arrowTypeEnd]*Math.abs(Math.sin(r))*(s>=0?1:-1)}return A(t).y+l}}),et=(a,t,e,i,l)=>{t.arrowTypeStart&&V(a,"start",t.arrowTypeStart,e,i,l),t.arrowTypeEnd&&V(a,"end",t.arrowTypeEnd,e,i,l)},rr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},V=(a,t,e,i,l,r)=>{const s=rr[e];if(!s){h.log$1.warn(`Unknown arrow type: ${e}`);return}const n=t==="start"?"Start":"End";a.attr(`marker-${t}`,`url(${i}#${l}_${r}-${s}${n})`)};let j={},$={};const ar=()=>{j={},$={}},er=(a,t)=>{const e=h.evaluate(h.getConfig().flowchart.htmlLabels),i=t.labelType==="markdown"?K.createText(a,t.label,{style:t.labelStyle,useHtmlLabels:e,addSvgBackground:!0}):B(t.label,t.labelStyle),l=a.insert("g").attr("class","edgeLabel"),r=l.insert("g").attr("class","label");r.node().appendChild(i);let s=i.getBBox();if(e){const c=i.children[0],f=h.select(i);s=c.getBoundingClientRect(),f.attr("width",s.width),f.attr("height",s.height)}r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),j[t.id]=l,t.width=s.width,t.height=s.height;let n;if(t.startLabelLeft){const c=B(t.startLabelLeft,t.labelStyle),f=a.insert("g").attr("class","edgeTerminals"),o=f.insert("g").attr("class","inner");n=o.node().appendChild(c);const y=c.getBBox();o.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),$[t.id]||($[t.id]={}),$[t.id].startLeft=f,D(n,t.startLabelLeft)}if(t.startLabelRight){const c=B(t.startLabelRight,t.labelStyle),f=a.insert("g").attr("class","edgeTerminals"),o=f.insert("g").attr("class","inner");n=f.node().appendChild(c),o.node().appendChild(c);const y=c.getBBox();o.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),$[t.id]||($[t.id]={}),$[t.id].startRight=f,D(n,t.startLabelRight)}if(t.endLabelLeft){const c=B(t.endLabelLeft,t.labelStyle),f=a.insert("g").attr("class","edgeTerminals"),o=f.insert("g").attr("class","inner");n=o.node().appendChild(c);const y=c.getBBox();o.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),f.node().appendChild(c),$[t.id]||($[t.id]={}),$[t.id].endLeft=f,D(n,t.endLabelLeft)}if(t.endLabelRight){const c=B(t.endLabelRight,t.labelStyle),f=a.insert("g").attr("class","edgeTerminals"),o=f.insert("g").attr("class","inner");n=o.node().appendChild(c);const y=c.getBBox();o.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),f.node().appendChild(c),$[t.id]||($[t.id]={}),$[t.id].endRight=f,D(n,t.endLabelRight)}return i};function D(a,t){h.getConfig().flowchart.htmlLabels&&a&&(a.style.width=t.length*9+"px",a.style.height="12px")}const sr=(a,t)=>{h.log$1.debug("Moving label abc88 ",a.id,a.label,j[a.id],t);let e=t.updatedPath?t.updatedPath:t.originalPath;const i=h.getConfig(),{subGraphTitleTotalMargin:l}=rt(i);if(a.label){const r=j[a.id];let s=a.x,n=a.y;if(e){const c=h.utils.calcLabelPosition(e);h.log$1.debug("Moving label "+a.label+" from (",s,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(s=c.x,n=c.y)}r.attr("transform",`translate(${s}, ${n+l/2})`)}if(a.startLabelLeft){const r=$[a.id].startLeft;let s=a.x,n=a.y;if(e){const c=h.utils.calcTerminalLabelPosition(a.arrowTypeStart?10:0,"start_left",e);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(a.startLabelRight){const r=$[a.id].startRight;let s=a.x,n=a.y;if(e){const c=h.utils.calcTerminalLabelPosition(a.arrowTypeStart?10:0,"start_right",e);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(a.endLabelLeft){const r=$[a.id].endLeft;let s=a.x,n=a.y;if(e){const c=h.utils.calcTerminalLabelPosition(a.arrowTypeEnd?10:0,"end_left",e);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(a.endLabelRight){const r=$[a.id].endRight;let s=a.x,n=a.y;if(e){const c=h.utils.calcTerminalLabelPosition(a.arrowTypeEnd?10:0,"end_right",e);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}},ir=(a,t)=>{const e=a.x,i=a.y,l=Math.abs(t.x-e),r=Math.abs(t.y-i),s=a.width/2,n=a.height/2;return l>=s||r>=n},nr=(a,t,e)=>{h.log$1.debug(`intersection calc abc89:
2
- outsidePoint: ${JSON.stringify(t)}
3
- insidePoint : ${JSON.stringify(e)}
4
- node : x:${a.x} y:${a.y} w:${a.width} h:${a.height}`);const i=a.x,l=a.y,r=Math.abs(i-e.x),s=a.width/2;let n=e.x<t.x?s-r:s+r;const c=a.height/2,f=Math.abs(t.y-e.y),o=Math.abs(t.x-e.x);if(Math.abs(l-t.y)*s>Math.abs(i-t.x)*c){let y=e.y<t.y?t.y-c-l:l-c-t.y;n=o*y/f;const p={x:e.x<t.x?e.x+n:e.x-o+n,y:e.y<t.y?e.y+f-y:e.y-f+y};return n===0&&(p.x=t.x,p.y=t.y),o===0&&(p.x=t.x),f===0&&(p.y=t.y),h.log$1.debug(`abc89 topp/bott calc, Q ${f}, q ${y}, R ${o}, r ${n}`,p),p}else{e.x<t.x?n=t.x-s-i:n=i-s-t.x;let y=f*n/o,p=e.x<t.x?e.x+o-n:e.x-o+n,g=e.y<t.y?e.y+y:e.y-y;return h.log$1.debug(`sides calc abc89, Q ${f}, q ${y}, R ${o}, r ${n}`,{_x:p,_y:g}),n===0&&(p=t.x,g=t.y),o===0&&(p=t.x),f===0&&(g=t.y),{x:p,y:g}}},J=(a,t)=>{h.log$1.debug("abc88 cutPathAtIntersect",a,t);let e=[],i=a[0],l=!1;return a.forEach(r=>{if(!ir(t,r)&&!l){const s=nr(t,i,r);let n=!1;e.forEach(c=>{n=n||c.x===s.x&&c.y===s.y}),e.some(c=>c.x===s.x&&c.y===s.y)||e.push(s),l=!0}else i=r,l||e.push(r)}),e},lr=function(a,t,e,i,l,r,s){let n=e.points;h.log$1.debug("abc88 InsertEdge: edge=",e,"e=",t);let c=!1;const f=r.node(t.v);var o=r.node(t.w);o!=null&&o.intersect&&(f!=null&&f.intersect)&&(n=n.slice(1,e.points.length-1),n.unshift(f.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),e.toCluster&&(h.log$1.debug("to cluster abc88",i[e.toCluster]),n=J(e.points,i[e.toCluster].node),c=!0),e.fromCluster&&(h.log$1.debug("from cluster abc88",i[e.fromCluster]),n=J(n.reverse(),i[e.fromCluster].node).reverse(),c=!0);const y=n.filter(M=>!Number.isNaN(M.y));let p=h.curveBasis;e.curve&&(l==="graph"||l==="flowchart")&&(p=e.curve);const{x:g,y:d}=at(e),m=it.line().x(g).y(d).curve(p);let x;switch(e.thickness){case"normal":x="edge-thickness-normal";break;case"thick":x="edge-thickness-thick";break;case"invisible":x="edge-thickness-thick";break;default:x=""}switch(e.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed";break}const u=a.append("path").attr("d",m(y)).attr("id",e.id).attr("class"," "+x+(e.classes?" "+e.classes:"")).attr("style",e.style);let S="";(h.getConfig().flowchart.arrowMarkerAbsolute||h.getConfig().state.arrowMarkerAbsolute)&&(S=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,S=S.replace(/\(/g,"\\("),S=S.replace(/\)/g,"\\)")),et(u,e,S,s,l);let C={};return c&&(C.updatedPath=n),C.originalPath=e.points,C};exports.addEdgeMarkers=et;exports.clear=ar;exports.clear$1=Pt;exports.createLabel$1=B;exports.getLineFunctionsWithOffset=at;exports.getSubGraphTitleMargins=rt;exports.insertEdge=lr;exports.insertEdgeLabel=er;exports.insertMarkers$1=ut;exports.insertNode=Jt;exports.intersectRect$1=tt;exports.labelHelper=L;exports.positionEdgeLabel=sr;exports.positionNode=tr;exports.setNodeElem=Kt;exports.updateNodeBounds=w;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./layers.BIj1UrA0.js"),t=require("./layers.s7jiwsxb.js");require("lodash-es");const z=require("./layers.COAF7f8g.js"),T=require("./layers.9QK1wiQj.js");require("./layers.u7Ns5vGH.js");const L=require("./layers.Bs3nM_3m.js"),P=e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig().state.sizeUnit).attr("cx",t.getConfig().state.padding+t.getConfig().state.sizeUnit).attr("cy",t.getConfig().state.padding+t.getConfig().state.sizeUnit),A=e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig().state.textHeight).attr("class","divider").attr("x2",t.getConfig().state.textHeight*2).attr("y1",0).attr("y2",0),G=(e,n)=>{const r=e.append("text").attr("x",2*t.getConfig().state.padding).attr("y",t.getConfig().state.textHeight+2*t.getConfig().state.padding).attr("font-size",t.getConfig().state.fontSize).attr("class","state-title").text(n.id),g=r.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig().state.padding).attr("y",t.getConfig().state.padding).attr("width",g.width+2*t.getConfig().state.padding).attr("height",g.height+2*t.getConfig().state.padding).attr("rx",t.getConfig().state.radius),r},W=(e,n)=>{const r=function(c,w,y){const S=c.append("tspan").attr("x",2*t.getConfig().state.padding).text(w);y||S.attr("dy",t.getConfig().state.textHeight)},a=e.append("text").attr("x",2*t.getConfig().state.padding).attr("y",t.getConfig().state.textHeight+1.3*t.getConfig().state.padding).attr("font-size",t.getConfig().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=a.height,f=e.append("text").attr("x",t.getConfig().state.padding).attr("y",l+t.getConfig().state.padding*.4+t.getConfig().state.dividerMargin+t.getConfig().state.textHeight).attr("class","state-description");let i=!0,s=!0;n.descriptions.forEach(function(c){i||(r(f,c,s),s=!1),i=!1});const C=e.append("line").attr("x1",t.getConfig().state.padding).attr("y1",t.getConfig().state.padding+l+t.getConfig().state.dividerMargin/2).attr("y2",t.getConfig().state.padding+l+t.getConfig().state.dividerMargin/2).attr("class","descr-divider"),p=f.node().getBBox(),d=Math.max(p.width,a.width);return C.attr("x2",d+3*t.getConfig().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig().state.padding).attr("y",t.getConfig().state.padding).attr("width",d+2*t.getConfig().state.padding).attr("height",p.height+l+2*t.getConfig().state.padding).attr("rx",t.getConfig().state.radius),e},v=(e,n,r)=>{const g=t.getConfig().state.padding,a=2*t.getConfig().state.padding,l=e.node().getBBox(),f=l.width,i=l.x,s=e.append("text").attr("x",0).attr("y",t.getConfig().state.titleShift).attr("font-size",t.getConfig().state.fontSize).attr("class","state-title").text(n.id),p=s.node().getBBox().width+a;let d=Math.max(p,f);d===f&&(d=d+a);let c;const w=e.node().getBBox();n.doc,c=i-g,p>f&&(c=(f-d)/2+g),Math.abs(i-w.x)<g&&p>f&&(c=i-(p-f)/2);const y=1-t.getConfig().state.textHeight;return e.insert("rect",":first-child").attr("x",c).attr("y",y).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",w.height+t.getConfig().state.textHeight+t.getConfig().state.titleShift+1).attr("rx","0"),s.attr("x",c+g),p<=f&&s.attr("x",i+(d-a)/2-p/2+g),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig().state.titleShift-t.getConfig().state.textHeight-t.getConfig().state.padding).attr("width",d).attr("height",t.getConfig().state.textHeight*3).attr("rx",t.getConfig().state.radius),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig().state.titleShift-t.getConfig().state.textHeight-t.getConfig().state.padding).attr("width",d).attr("height",w.height+3+2*t.getConfig().state.textHeight).attr("rx",t.getConfig().state.radius),e},R=e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig().state.sizeUnit+t.getConfig().state.miniPadding).attr("cx",t.getConfig().state.padding+t.getConfig().state.sizeUnit+t.getConfig().state.miniPadding).attr("cy",t.getConfig().state.padding+t.getConfig().state.sizeUnit+t.getConfig().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig().state.sizeUnit).attr("cx",t.getConfig().state.padding+t.getConfig().state.sizeUnit+2).attr("cy",t.getConfig().state.padding+t.getConfig().state.sizeUnit+2)),U=(e,n)=>{let r=t.getConfig().state.forkWidth,g=t.getConfig().state.forkHeight;if(n.parentId){let a=r;r=g,g=a}return e.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",g).attr("x",t.getConfig().state.padding).attr("y",t.getConfig().state.padding)},q=(e,n,r,g)=>{let a=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let f=e.replace(/\r\n/g,"<br/>");f=f.replace(/\n/g,"<br/>");const i=f.split(t.common$1.lineBreakRegex);let s=1.25*t.getConfig().state.noteMargin;for(const C of i){const p=C.trim();if(p.length>0){const d=l.append("tspan");if(d.text(p),s===0){const c=d.node().getBBox();s+=c.height}a+=s,d.attr("x",n+t.getConfig().state.noteMargin),d.attr("y",r+a+1.25*t.getConfig().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:a}},F=(e,n)=>{n.attr("class","state-note");const r=n.append("rect").attr("x",0).attr("y",t.getConfig().state.padding),g=n.append("g"),{textWidth:a,textHeight:l}=q(e,0,0,g);return r.attr("height",l+2*t.getConfig().state.noteMargin),r.attr("width",a+t.getConfig().state.noteMargin*2),r},M=function(e,n){const r=n.id,g={id:r,label:n.id,width:0,height:0},a=e.append("g").attr("id",r).attr("class","stateGroup");n.type==="start"&&P(a),n.type==="end"&&R(a),(n.type==="fork"||n.type==="join")&&U(a,n),n.type==="note"&&F(n.note.text,a),n.type==="divider"&&A(a),n.type==="default"&&n.descriptions.length===0&&G(a,n),n.type==="default"&&n.descriptions.length>0&&W(a,n);const l=a.node().getBBox();return g.width=l.width+2*t.getConfig().state.padding,g.height=l.height+2*t.getConfig().state.padding,g};let H=0;const O=function(e,n,r){const g=function(s){switch(s){case m.db.relationType.AGGREGATION:return"aggregation";case m.db.relationType.EXTENSION:return"extension";case m.db.relationType.COMPOSITION:return"composition";case m.db.relationType.DEPENDENCY:return"dependency"}};n.points=n.points.filter(s=>!Number.isNaN(s.y));const a=n.points,l=L.line().x(function(s){return s.x}).y(function(s){return s.y}).curve(t.curveBasis),f=e.append("path").attr("d",l(a)).attr("id","edge"+H).attr("class","transition");let i="";if(t.getConfig().state.arrowMarkerAbsolute&&(i=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,i=i.replace(/\(/g,"\\("),i=i.replace(/\)/g,"\\)")),f.attr("marker-end","url("+i+"#"+g(m.db.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:C,y:p}=t.utils.calcLabelPosition(n.points),d=t.common$1.getRows(r.title);let c=0;const w=[];let y=0,S=0;for(let x=0;x<=d.length;x++){const h=s.append("text").attr("text-anchor","middle").text(d[x]).attr("x",C).attr("y",p+c),u=h.node().getBBox();y=Math.max(y,u.width),S=Math.min(S,u.x),t.log$1.info(u.x,C,p+c),c===0&&(c=h.node().getBBox().height,t.log$1.info("Title height",c,p)),w.push(h)}let E=c*d.length;if(d.length>1){const x=(d.length-1)*c*.5;w.forEach((h,u)=>h.attr("y",p+u*c-x)),E=c*d.length}const o=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",C-y/2-t.getConfig().state.padding/2).attr("y",p-E/2-t.getConfig().state.padding/2-3.5).attr("width",y+t.getConfig().state.padding).attr("height",E+t.getConfig().state.padding),t.log$1.info(o)}H++};let b;const N={},X=function(){},J=function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},Y=function(e,n,r,g){b=t.getConfig().state;const a=t.getConfig().securityLevel;let l;a==="sandbox"&&(l=t.select("#i"+n));const f=a==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=a==="sandbox"?l.nodes()[0].contentDocument:document;t.log$1.debug("Rendering diagram "+e);const s=f.select(`[id='${n}']`);J(s);const C=g.db.getRootDoc();$(C,s,void 0,!1,f,i,g);const p=b.padding,d=s.node().getBBox(),c=d.width+p*2,w=d.height+p*2,y=c*1.75;t.configureSvgSize(s,w,y,b.useMaxWidth),s.attr("viewBox",`${d.x-b.padding} ${d.y-b.padding} `+c+" "+w)},I=e=>e?e.length*b.fontSizeFactor:1,$=(e,n,r,g,a,l,f)=>{const i=new T.Graph({compound:!0,multigraph:!0});let s,C=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){C=!1;break}r?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:C?1:b.edgeLengthFactor,nodeSep:C?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:C?1:b.edgeLengthFactor,nodeSep:C?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}}),f.db.extract(e);const p=f.db.getStates(),d=f.db.getRelations(),c=Object.keys(p);for(const o of c){const x=p[o];r&&(x.parentId=r);let h;if(x.doc){let u=n.append("g").attr("id",x.id).attr("class","stateGroup");h=$(x.doc,u,x.id,!g,a,l,f);{u=v(u,x,g);let B=u.node().getBBox();h.width=B.width,h.height=B.height+b.padding/2,N[x.id]={y:b.compositTitleSize}}}else h=M(n,x);if(x.note){const u={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},B=M(n,u);x.note.position==="left of"?(i.setNode(h.id+"-note",B),i.setNode(h.id,h)):(i.setNode(h.id,h),i.setNode(h.id+"-note",B)),i.setParent(h.id,h.id+"-group"),i.setParent(h.id+"-note",h.id+"-group")}else i.setNode(h.id,h)}t.log$1.debug("Count=",i.nodeCount(),i);let w=0;d.forEach(function(o){w++,t.log$1.debug("Setting edge",o),i.setEdge(o.id1,o.id2,{relation:o,width:I(o.title),height:b.labelHeight*t.common$1.getRows(o.title).length,labelpos:"c"},"id"+w)}),z.layout(i),t.log$1.debug("Graph after layout",i.nodes());const y=n.node();i.nodes().forEach(function(o){o!==void 0&&i.node(o)!==void 0?(t.log$1.warn("Node "+o+": "+JSON.stringify(i.node(o))),a.select("#"+y.id+" #"+o).attr("transform","translate("+(i.node(o).x-i.node(o).width/2)+","+(i.node(o).y+(N[o]?N[o].y:0)-i.node(o).height/2)+" )"),a.select("#"+y.id+" #"+o).attr("data-x-shift",i.node(o).x-i.node(o).width/2),l.querySelectorAll("#"+y.id+" #"+o+" .divider").forEach(h=>{const u=h.parentElement;let B=0,k=0;u&&(u.parentElement&&(B=u.parentElement.getBBox().width),k=parseInt(u.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),h.setAttribute("x1",0-k+8),h.setAttribute("x2",B-k-8)})):t.log$1.debug("No Node "+o+": "+JSON.stringify(i.node(o)))});let S=y.getBBox();i.edges().forEach(function(o){o!==void 0&&i.edge(o)!==void 0&&(t.log$1.debug("Edge "+o.v+" -> "+o.w+": "+JSON.stringify(i.edge(o))),O(n,i.edge(o),i.edge(o).relation))}),S=y.getBBox();const E={id:r||"root",label:r||"root",width:0,height:0};return E.width=S.width+2*b.padding,E.height=S.height+2*b.padding,t.log$1.debug("Doc rendered",E,i),E},_={setConf:X,draw:Y},Z={parser:m.parser$1,db:m.db,renderer:_,styles:m.styles,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,m.db.clear()}};exports.diagram=Z;
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./layers.BoWIpGHq.js"),d=require("./layers.s7jiwsxb.js");require("lodash-es");const $=require("./layers.COAF7f8g.js"),H=require("./layers.9QK1wiQj.js");require("./layers.u7Ns5vGH.js");const _=require("./layers.Bs3nM_3m.js");let S=0;const C=function(i,r,t,l,p){const c=function(e){switch(e){case p.db.relationType.AGGREGATION:return"aggregation";case p.db.relationType.EXTENSION:return"extension";case p.db.relationType.COMPOSITION:return"composition";case p.db.relationType.DEPENDENCY:return"dependency";case p.db.relationType.LOLLIPOP:return"lollipop"}};r.points=r.points.filter(e=>!Number.isNaN(e.y));const o=r.points,h=_.line().x(function(e){return e.x}).y(function(e){return e.y}).curve(d.curveBasis),n=i.append("path").attr("d",h(o)).attr("id","edge"+S).attr("class","relation");let a="";l.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),t.relation.lineType==1&&n.attr("class","relation dashed-line"),t.relation.lineType==10&&n.attr("class","relation dotted-line"),t.relation.type1!=="none"&&n.attr("marker-start","url("+a+"#"+c(t.relation.type1)+"Start)"),t.relation.type2!=="none"&&n.attr("marker-end","url("+a+"#"+c(t.relation.type2)+"End)");let f,u;const x=r.points.length;let w=d.utils.calcLabelPosition(r.points);f=w.x,u=w.y;let y,b,m,k;if(x%2!==0&&x>1){let e=d.utils.calcCardinalityPosition(t.relation.type1!=="none",r.points,r.points[0]),s=d.utils.calcCardinalityPosition(t.relation.type2!=="none",r.points,r.points[x-1]);d.log$1.debug("cardinality_1_point "+JSON.stringify(e)),d.log$1.debug("cardinality_2_point "+JSON.stringify(s)),y=e.x,b=e.y,m=s.x,k=s.y}if(t.title!==void 0){const e=i.append("g").attr("class","classLabel"),s=e.append("text").attr("class","label").attr("x",f).attr("y",u).attr("fill","red").attr("text-anchor","middle").text(t.title);window.label=s;const g=s.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",g.x-l.padding/2).attr("y",g.y-l.padding/2).attr("width",g.width+l.padding).attr("height",g.height+l.padding)}d.log$1.info("Rendering relation "+JSON.stringify(t)),t.relationTitle1!==void 0&&t.relationTitle1!=="none"&&i.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",y).attr("y",b).attr("fill","black").attr("font-size","6").text(t.relationTitle1),t.relationTitle2!==void 0&&t.relationTitle2!=="none"&&i.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",m).attr("y",k).attr("fill","black").attr("font-size","6").text(t.relationTitle2),S++},A=function(i,r,t,l){d.log$1.debug("Rendering class ",r,t);const p=r.id,c={id:p,label:r.id,width:0,height:0},o=i.append("g").attr("id",l.db.lookUpDomId(p)).attr("class","classGroup");let h;r.link?h=o.append("svg:a").attr("xlink:href",r.link).attr("target",r.linkTarget).append("text").attr("y",t.textHeight+t.padding).attr("x",0):h=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);let n=!0;r.annotations.forEach(function(s){const g=h.append("tspan").text("«"+s+"»");n||g.attr("dy",t.textHeight),n=!1});let a=v(r);const f=h.append("tspan").text(a).attr("class","title");n||f.attr("dy",t.textHeight);const u=h.node().getBBox().height;let x,w,y;if(r.members.length>0){x=o.append("line").attr("x1",0).attr("y1",t.padding+u+t.dividerMargin/2).attr("y2",t.padding+u+t.dividerMargin/2);const s=o.append("text").attr("x",t.padding).attr("y",u+t.dividerMargin+t.textHeight).attr("fill","white").attr("class","classText");n=!0,r.members.forEach(function(g){N(s,g,n,t),n=!1}),w=s.node().getBBox()}if(r.methods.length>0){y=o.append("line").attr("x1",0).attr("y1",t.padding+u+t.dividerMargin+w.height).attr("y2",t.padding+u+t.dividerMargin+w.height);const s=o.append("text").attr("x",t.padding).attr("y",u+2*t.dividerMargin+w.height+t.textHeight).attr("fill","white").attr("class","classText");n=!0,r.methods.forEach(function(g){N(s,g,n,t),n=!1})}const b=o.node().getBBox();var m=" ";r.cssClasses.length>0&&(m=m+r.cssClasses.join(" "));const e=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",b.width+2*t.padding).attr("height",b.height+t.padding+.5*t.dividerMargin).attr("class",m).node().getBBox().width;return h.node().childNodes.forEach(function(s){s.setAttribute("x",(e-s.getBBox().width)/2)}),r.tooltip&&h.insert("title").text(r.tooltip),x&&x.attr("x2",e),y&&y.attr("x2",e),c.width=e,c.height=b.height+t.padding+.5*t.dividerMargin,c},v=function(i){let r=i.id;return i.type&&(r+="<"+d.parseGenericTypes(i.type)+">"),r},W=function(i,r,t,l){d.log$1.debug("Rendering note ",r,t);const p=r.id,c={id:p,text:r.text,width:0,height:0},o=i.append("g").attr("id",p).attr("class","classGroup");let h=o.append("text").attr("y",t.textHeight+t.padding).attr("x",0);const n=JSON.parse(`"${r.text}"`).split(`
2
- `);n.forEach(function(x){d.log$1.debug(`Adding line: ${x}`),h.append("tspan").text(x).attr("class","title").attr("dy",t.textHeight)});const a=o.node().getBBox(),u=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",a.width+2*t.padding).attr("height",a.height+n.length*t.textHeight+t.padding+.5*t.dividerMargin).node().getBBox().width;return h.node().childNodes.forEach(function(x){x.setAttribute("x",(u-x.getBBox().width)/2)}),c.width=u,c.height=a.height+n.length*t.textHeight+t.padding+.5*t.dividerMargin,c},N=function(i,r,t,l){const{displayText:p,cssStyle:c}=r.getDisplayDetails(),o=i.append("tspan").attr("x",l.padding).text(p);c!==""&&o.attr("style",r.cssStyle),t||o.attr("dy",l.textHeight)},M={getClassTitleString:v,drawClass:A,drawEdge:C,drawNote:W};let B={};const E=20,L=function(i){const r=Object.entries(B).find(t=>t[1].label===i);if(r)return r[0]},G=function(i){i.append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),i.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),i.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},I=function(i,r,t,l){const p=d.getConfig().class;B={},d.log$1.info("Rendering diagram "+i);const c=d.getConfig().securityLevel;let o;c==="sandbox"&&(o=d.select("#i"+r));const h=c==="sandbox"?d.select(o.nodes()[0].contentDocument.body):d.select("body"),n=h.select(`[id='${r}']`);G(n);const a=new H.Graph({multigraph:!0});a.setGraph({isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const f=l.db.getClasses(),u=Object.keys(f);for(const e of u){const s=f[e],g=M.drawClass(n,s,p,l);B[g.id]=g,a.setNode(g.id,g),d.log$1.info("Org height: "+g.height)}l.db.getRelations().forEach(function(e){d.log$1.info("tjoho"+L(e.id1)+L(e.id2)+JSON.stringify(e)),a.setEdge(L(e.id1),L(e.id2),{relation:e},e.title||"DEFAULT")}),l.db.getNotes().forEach(function(e){d.log$1.debug(`Adding note: ${JSON.stringify(e)}`);const s=M.drawNote(n,e,p,l);B[s.id]=s,a.setNode(s.id,s),e.class&&e.class in f&&a.setEdge(e.id,L(e.class),{relation:{id1:e.id,id2:e.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),$.layout(a),a.nodes().forEach(function(e){e!==void 0&&a.node(e)!==void 0&&(d.log$1.debug("Node "+e+": "+JSON.stringify(a.node(e))),h.select("#"+(l.db.lookUpDomId(e)||e)).attr("transform","translate("+(a.node(e).x-a.node(e).width/2)+","+(a.node(e).y-a.node(e).height/2)+" )"))}),a.edges().forEach(function(e){e!==void 0&&a.edge(e)!==void 0&&(d.log$1.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(a.edge(e))),M.drawEdge(n,a.edge(e),a.edge(e).relation,p,l))});const y=n.node().getBBox(),b=y.width+E*2,m=y.height+E*2;d.configureSvgSize(n,m,b,p.useMaxWidth);const k=`${y.x-E} ${y.y-E} ${b} ${m}`;d.log$1.debug(`viewBox ${k}`),n.attr("viewBox",k)},O={draw:I},P={parser:T.parser$1,db:T.db,renderer:O,styles:T.styles,init:i=>{i.class||(i.class={}),i.class.arrowMarkerAbsolute=i.arrowMarkerAbsolute,T.db.clear()}};exports.diagram=P;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),e=require("react"),t=require("./layers.Dz3X0MlG.js"),u=require("./layers.u7Ns5vGH.js"),f=t.oe("INSERT_EXCALIDRAW_COMMAND");function g(){const[a]=t.o(),[C,l]=e.useState(!1),[s,E]=e.useState(null),[M,o]=e.useState(!1),r=e.useRef(null);e.useEffect(()=>{if(!a.hasNodes([t.ExcalidrawNode]))throw new Error("ExcalidrawPlugin: ExcalidrawNode not registered on editor");return a.registerCommand(f,()=>{l(!0);const i=t.getCurrentElement();return E(i),!0},t.Li)},[a]);const c=e.useCallback(()=>{l(!1),o(!1),r.current=!1},[]),x=e.useCallback(()=>{r.current?o(!0):c()},[]),N=()=>{l(!1)},S=(i,w,O)=>{a.update(()=>{const d=t.$createExcalidrawNode();d.setData(JSON.stringify({appState:w,elements:i,files:O})),s&&s.getParent()&&(s==null||s.replace(d))}),l(!1)};return n.jsxs(n.Fragment,{children:[n.jsx(u.ConfirmModal,{isCloseModal:M,confirmClose:c,setCloseModalOpen:o}),n.jsx(u.ExcalidrawModal,{initialElements:[],initialAppState:{},initialFiles:{},isShown:C,onDelete:N,onClose:x,onSave:S,closeOnClickOutside:!1,isEdited:r})]})}exports.INSERT_EXCALIDRAW_COMMAND=f;exports.default=g;
@@ -1,73 +0,0 @@
1
- import { jsxs as M, Fragment as w, jsx as c } from "react/jsx-runtime";
2
- import { useState as n, useRef as x, useEffect as N, useCallback as d } from "react";
3
- import { o as g, a as O, E as S, g as A, L as D, $ as R } from "./layers.DhVu4iGF.js";
4
- import { H as h, J as I } from "./layers.BEKEkSeG.js";
5
- const L = g(
6
- "INSERT_EXCALIDRAW_COMMAND"
7
- );
8
- function J() {
9
- const [a] = O(), [f, s] = n(!1), [e, u] = n(
10
- null
11
- ), [E, o] = n(!1), t = x(null);
12
- N(() => {
13
- if (!a.hasNodes([S]))
14
- throw new Error(
15
- "ExcalidrawPlugin: ExcalidrawNode not registered on editor"
16
- );
17
- return a.registerCommand(
18
- L,
19
- () => {
20
- s(!0);
21
- const l = A();
22
- return u(l), !0;
23
- },
24
- D
25
- );
26
- }, [a]);
27
- const r = d(() => {
28
- s(!1), o(!1), t.current = !1;
29
- }, []), m = d(() => {
30
- t.current ? o(!0) : r();
31
- }, []);
32
- return /* @__PURE__ */ M(w, { children: [
33
- /* @__PURE__ */ c(
34
- h,
35
- {
36
- isCloseModal: E,
37
- confirmClose: r,
38
- setCloseModalOpen: o
39
- }
40
- ),
41
- /* @__PURE__ */ c(
42
- I,
43
- {
44
- initialElements: [],
45
- initialAppState: {},
46
- initialFiles: {},
47
- isShown: f,
48
- onDelete: () => {
49
- s(!1);
50
- },
51
- onClose: m,
52
- onSave: (l, C, p) => {
53
- a.update(() => {
54
- const i = R();
55
- i.setData(
56
- JSON.stringify({
57
- appState: C,
58
- elements: l,
59
- files: p
60
- })
61
- ), e && e.getParent() && (e == null || e.replace(i));
62
- }), s(!1);
63
- },
64
- closeOnClickOutside: !1,
65
- isEdited: t
66
- }
67
- )
68
- ] });
69
- }
70
- export {
71
- L as INSERT_EXCALIDRAW_COMMAND,
72
- J as default
73
- };