@datalayer/agent-runtimes 1.5.70 → 1.5.73

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 (810) hide show
  1. package/dist-embed/chunks/{DeckComponent-DAnUabRV.js → DeckComponent-Cd1sbs9L.js} +1 -1
  2. package/dist-embed/chunks/{DocumentView-BKFitqiB.js → DocumentView-ssQ835Wa.js} +1 -1
  3. package/dist-embed/chunks/{EphemeralDocument-BRzYMd8Z.js → EphemeralDocument-DNziilOG.js} +1 -1
  4. package/dist-embed/chunks/{ExcalidrawComponent-VnKcai35.js → ExcalidrawComponent-CQ4BeoQt.js} +1 -1
  5. package/dist-embed/chunks/{ExcalidrawModal-DrntFjbe.js → ExcalidrawModal-8W-b1OmA.js} +1 -1
  6. package/dist-embed/chunks/{JupyterLexicalExtension-BBivQZvX.js → JupyterLexicalExtension-BLYM-DTn.js} +4 -4
  7. package/dist-embed/chunks/{YouTubePlugin-C209681s.js → YouTubePlugin-BgZG6fCA.js} +1 -1
  8. package/dist-embed/chunks/abnfDiagram-VCTEODGH-BdOOK2nG.js +1 -0
  9. package/dist-embed/chunks/abnfDiagram-VCTEODGH-CHerLzZ0.js +1 -0
  10. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Dypu3IcK.js → ar-SA-G6X2FPQ2-Bcy9b6jn.js} +1 -1
  11. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-C22xzf-o.js → architectureDiagram-5GKGNRK7-C8jjE2mY.js} +2 -2
  12. package/dist-embed/chunks/architectureDiagram-5GKGNRK7-GukKr_g1.js +36 -0
  13. package/dist-embed/chunks/{az-AZ-76LH7QW2-D8CzfKb1.js → az-AZ-76LH7QW2-Bzy5rt95.js} +1 -1
  14. package/dist-embed/chunks/{bg-BG-XCXSNQG7-_NVFEM1_.js → bg-BG-XCXSNQG7-C3mQkAoD.js} +1 -1
  15. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-CHicgYkf.js → blockDiagram-I7D4REHJ-DH6ta7S_.js} +2 -2
  16. package/dist-embed/chunks/blockDiagram-I7D4REHJ-edfypROz.js +129 -0
  17. package/dist-embed/chunks/{bn-BD-2XOGV67Q-DMgdNi-k.js → bn-BD-2XOGV67Q-DHwDUFeg.js} +1 -1
  18. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-auJZQjpw.js → c4Diagram-7LVT6UL2-B6NHHf7w.js} +2 -2
  19. package/dist-embed/chunks/c4Diagram-7LVT6UL2-BD3Ld97M.js +38 -0
  20. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-DpOQhzr4.js → ca-ES-6MX7JW3Y-CWMZCfjI.js} +1 -1
  21. package/dist-embed/chunks/{chunk-2Q5K7J3B-DpFWUcsT.js → chunk-2Q5K7J3B-9xCosPaH.js} +1 -1
  22. package/dist-embed/chunks/chunk-2Q5K7J3B-ZWnuQ6M2.js +1 -0
  23. package/dist-embed/chunks/{chunk-5VM5RSS4-CaowF8Al.js → chunk-5VM5RSS4-7q2jPq-I.js} +1 -1
  24. package/dist-embed/chunks/chunk-5VM5RSS4-C2EZUNrH.js +15 -0
  25. package/dist-embed/chunks/{chunk-F27PBJKO-D7PuEggc.js → chunk-F27PBJKO-hasZYXJc.js} +1 -1
  26. package/dist-embed/chunks/chunk-F27PBJKO-iAw_9Xtd.js +1 -0
  27. package/dist-embed/chunks/{chunk-IMKFNOWR-jZNuNkCa.js → chunk-IMKFNOWR-CR2LIHPi.js} +1 -1
  28. package/dist-embed/chunks/chunk-IMKFNOWR-CU661Hle.js +231 -0
  29. package/dist-embed/chunks/{chunk-JWPE2WC7-BIShIUcJ.js → chunk-JWPE2WC7-B40RAhYQ.js} +1 -1
  30. package/dist-embed/chunks/chunk-JWPE2WC7-D4pNFsZF.js +1 -0
  31. package/dist-embed/chunks/{chunk-POPQ4Y6H-DG5Q2OKT.js → chunk-POPQ4Y6H-CNc-_UkX.js} +1 -1
  32. package/dist-embed/chunks/chunk-POPQ4Y6H-PC7NS4ab.js +1 -0
  33. package/dist-embed/chunks/{chunk-SVP7TREG-ERRaAh-x.js → chunk-SVP7TREG-B-LR0OEY.js} +1 -1
  34. package/dist-embed/chunks/chunk-SVP7TREG-BgVpHjUA.js +88 -0
  35. package/dist-embed/chunks/{chunk-TICWLB2K-B91fA6Jd.js → chunk-TICWLB2K-BKUWUi4x.js} +1 -1
  36. package/dist-embed/chunks/chunk-TICWLB2K-D0mlrZUj.js +206 -0
  37. package/dist-embed/chunks/{chunk-XXDRQBXY-BAy0lBJk.js → chunk-XXDRQBXY-CFD4Agg8.js} +1 -1
  38. package/dist-embed/chunks/chunk-XXDRQBXY-DF8wFPCi.js +1 -0
  39. package/dist-embed/chunks/classDiagram-ZZMXUADV-B2RPE1Bl.js +1 -0
  40. package/dist-embed/chunks/classDiagram-ZZMXUADV-BSdRgwsr.js +1 -0
  41. package/dist-embed/chunks/classDiagram-v2-VYDZK3BY-B2RPE1Bl.js +1 -0
  42. package/dist-embed/chunks/classDiagram-v2-VYDZK3BY-BSdRgwsr.js +1 -0
  43. package/dist-embed/chunks/cose-bilkent-JH36ORCC-CGF9N16A.js +1 -0
  44. package/dist-embed/chunks/cose-bilkent-JH36ORCC-D976z1sp.js +1 -0
  45. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-Fr-SpqHD.js → cs-CZ-2BRQDIVT-B_pe2qj9.js} +1 -1
  46. package/dist-embed/chunks/cynefin-OW5HDTMX-BBLugbYz.js +166 -0
  47. package/dist-embed/chunks/cynefinDiagram-5FMLGOSQ-Cil4cm66.js +62 -0
  48. package/dist-embed/chunks/cynefinDiagram-5FMLGOSQ-D7ioXav_.js +62 -0
  49. package/dist-embed/chunks/{da-DK-5WZEPLOC-DO_sAXvt.js → da-DK-5WZEPLOC-CGWCNcJj.js} +1 -1
  50. package/dist-embed/chunks/{dagre-GXQ25YYZ-BgrGEY09.js → dagre-GXQ25YYZ-Cp78_L9l.js} +2 -2
  51. package/dist-embed/chunks/dagre-GXQ25YYZ-DauBFK-x.js +4 -0
  52. package/dist-embed/chunks/{de-DE-XR44H4JA-4JnXB_iM.js → de-DE-XR44H4JA-DTdq2h_G.js} +1 -1
  53. package/dist-embed/chunks/{diagram-S7CK7UJ4-hQvZziAN.js → diagram-S7CK7UJ4-LsSU5PzE.js} +2 -2
  54. package/dist-embed/chunks/diagram-S7CK7UJ4-cLOCifii.js +30 -0
  55. package/dist-embed/chunks/diagram-UQ7AKVKN-BK4qe_eB.js +41 -0
  56. package/dist-embed/chunks/diagram-UQ7AKVKN-CoIPlGw-.js +41 -0
  57. package/dist-embed/chunks/diagram-VSXAHHWV-CIhWkrRX.js +3 -0
  58. package/dist-embed/chunks/{diagram-VSXAHHWV-WVuzjdxU.js → diagram-VSXAHHWV-DWWQ-Ga9.js} +2 -2
  59. package/dist-embed/chunks/diagram-VX7I27RA-43SwkivD.js +24 -0
  60. package/dist-embed/chunks/diagram-VX7I27RA-CQM8aGRO.js +24 -0
  61. package/dist-embed/chunks/diagram-Z3DM3KII-Da75Rc5Q.js +24 -0
  62. package/dist-embed/chunks/diagram-Z3DM3KII-DrILxydN.js +24 -0
  63. package/dist-embed/chunks/ebnfDiagram-PWID7BFC-CwBVaHP2.js +1 -0
  64. package/dist-embed/chunks/ebnfDiagram-PWID7BFC-Klx1dPe6.js +1 -0
  65. package/dist-embed/chunks/{el-GR-BZB4AONW-MydAlwHl.js → el-GR-BZB4AONW-qdInZt55.js} +1 -1
  66. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-zwXEFcAp.js → erDiagram-RLTQ6QDP-6YXMuidI.js} +2 -2
  67. package/dist-embed/chunks/erDiagram-RLTQ6QDP-DmlOR1VA.js +99 -0
  68. package/dist-embed/chunks/{es-ES-U4NZUMDT-rQmnr_uu.js → es-ES-U4NZUMDT-CbVgghD5.js} +1 -1
  69. package/dist-embed/chunks/{eu-ES-A7QVB2H4-j5Hf8ngk.js → eu-ES-A7QVB2H4-Cfyi4-QV.js} +1 -1
  70. package/dist-embed/chunks/{fa-IR-HGAKTJCU-DMJRRSBp.js → fa-IR-HGAKTJCU-Bpz9Yk2c.js} +1 -1
  71. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-BFLC0BFd.js → fi-FI-Z5N7JZ37-CnNP_ASI.js} +1 -1
  72. package/dist-embed/chunks/{flowDiagram-HODETNUW-BrbR1EkW.js → flowDiagram-HODETNUW-DpJLPDJS.js} +1 -1
  73. package/dist-embed/chunks/flowDiagram-HODETNUW-_PPo6xx4.js +168 -0
  74. package/dist-embed/chunks/{fr-FR-RHASNOE6-CxjhSJC1.js → fr-FR-RHASNOE6-CXIU81zC.js} +1 -1
  75. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DfJDZVnm.js → ganttDiagram-EL5Y4UJY-B3ddBLm-.js} +2 -2
  76. package/dist-embed/chunks/ganttDiagram-EL5Y4UJY-DnJUq63S.js +292 -0
  77. package/dist-embed/chunks/gitGraphDiagram-WWUBYQGX-CKVR9Ajq.js +106 -0
  78. package/dist-embed/chunks/gitGraphDiagram-WWUBYQGX-u7eHxrMk.js +106 -0
  79. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BuuMpTaX.js → gl-ES-HMX3MZ6V-Do1RdVfG.js} +1 -1
  80. package/dist-embed/chunks/{he-IL-6SHJWFNN-Cv3Nrcgu.js → he-IL-6SHJWFNN-NcTscmv6.js} +1 -1
  81. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-Sddst60F.js → hi-IN-IWLTKZ5I-CyNpoQ12.js} +1 -1
  82. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-ehrXVpD0.js → hu-HU-A5ZG7DT2-Bzge2Fdz.js} +1 -1
  83. package/dist-embed/chunks/{id-ID-SAP4L64H-Gfb1UYxZ.js → id-ID-SAP4L64H-DaNcoDhl.js} +1 -1
  84. package/dist-embed/chunks/{index-BaBNw6X5.js → index-BQdtKMKk.js} +56 -61
  85. package/dist-embed/chunks/index-CJys1M3A.js +6 -0
  86. package/dist-embed/chunks/{index-hxIHgkzg.js → index-CLdL3h_Z.js} +1 -1
  87. package/dist-embed/chunks/{index-DmpLE1d4.js → index-Cx_cIRez.js} +1 -1
  88. package/dist-embed/chunks/index-lOJZWhTu.js +337 -0
  89. package/dist-embed/chunks/infoDiagram-27XIBGKW-C3YByzAX.js +2 -0
  90. package/dist-embed/chunks/infoDiagram-27XIBGKW-CrHEoNfn.js +2 -0
  91. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-DrEzfSK9.js → ishikawaDiagram-5VMMS53U-B87JmQRn.js} +6 -6
  92. package/dist-embed/chunks/ishikawaDiagram-5VMMS53U-DkW3YLz9.js +70 -0
  93. package/dist-embed/chunks/{it-IT-JPQ66NNP-BehLHkar.js → it-IT-JPQ66NNP-6fWP-4Pk.js} +1 -1
  94. package/dist-embed/chunks/{ja-JP-DBVTYXUO-BZvqIigI.js → ja-JP-DBVTYXUO-TOPcUfq8.js} +1 -1
  95. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DpWKIFIN.js → journeyDiagram-3NMN7TZE-BcfZXfHF.js} +2 -2
  96. package/dist-embed/chunks/journeyDiagram-3NMN7TZE-BjO5pIr-.js +139 -0
  97. package/dist-embed/chunks/{kaa-6HZHGXH3-DgAIF6rN.js → kaa-6HZHGXH3-WPmptgZr.js} +1 -1
  98. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-DW4thPSJ.js → kab-KAB-ZGHBKWFO-CMOAXrZA.js} +1 -1
  99. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-DxbTprYr.js → kanban-definition-UXKFOSKX-D9d45rsU.js} +2 -2
  100. package/dist-embed/chunks/kanban-definition-UXKFOSKX-DKCJ8_n0.js +89 -0
  101. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-CCy_nSJ7.js → kk-KZ-P5N5QNE5-B6ezOPzr.js} +1 -1
  102. package/dist-embed/chunks/{km-KH-HSX4SM5Z-kpXyoxjS.js → km-KH-HSX4SM5Z-C84QUPbc.js} +1 -1
  103. package/dist-embed/chunks/{ko-KR-MTYHY66A-CFm6WtQG.js → ko-KR-MTYHY66A-cuBEuTL_.js} +1 -1
  104. package/dist-embed/chunks/{ku-TR-6OUDTVRD-CKF85mOv.js → ku-TR-6OUDTVRD-B9KdlCAR.js} +1 -1
  105. package/dist-embed/chunks/{layout-DYytgC9r.js → layout-C6Twj1mW.js} +1 -1
  106. package/dist-embed/chunks/layout-Do3wJC1j.js +1 -0
  107. package/dist-embed/chunks/{lt-LT-XHIRWOB4-CO9Bo5qJ.js → lt-LT-XHIRWOB4-B39JwBGi.js} +1 -1
  108. package/dist-embed/chunks/{lv-LV-5QDEKY6T-CvZszc5p.js → lv-LV-5QDEKY6T-8WReOaa7.js} +1 -1
  109. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-_1SBIPav.js → mindmap-definition-YA3MSWOX-5wZuXgB8.js} +2 -2
  110. package/dist-embed/chunks/mindmap-definition-YA3MSWOX-BURkGTKI.js +96 -0
  111. package/dist-embed/chunks/{mr-IN-CRQNXWMA-Cio_dB9M.js → mr-IN-CRQNXWMA-DUaS8VWx.js} +1 -1
  112. package/dist-embed/chunks/{my-MM-5M5IBNSE-Z0RQ5Vbz.js → my-MM-5M5IBNSE-BdJYwQXg.js} +1 -1
  113. package/dist-embed/chunks/{nb-NO-T6EIAALU-BEQ0YP9J.js → nb-NO-T6EIAALU-C_p5yu1z.js} +1 -1
  114. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-YtkJnS_J.js → nl-NL-IS3SIHDZ-DM5qgcCp.js} +1 -1
  115. package/dist-embed/chunks/{nn-NO-6E72VCQL-C1j2s3qO.js → nn-NO-6E72VCQL-BuX1DqI5.js} +1 -1
  116. package/dist-embed/chunks/{oc-FR-POXYY2M6-CinnjccW.js → oc-FR-POXYY2M6-BAWljcaf.js} +1 -1
  117. package/dist-embed/chunks/{pa-IN-N4M65BXN-c_6OtC6L.js → pa-IN-N4M65BXN-2iyq8qxX.js} +1 -1
  118. package/dist-embed/chunks/pegDiagram-XKGWAZYB-BjrOX_Ki.js +1 -0
  119. package/dist-embed/chunks/pegDiagram-XKGWAZYB-CyuSADYr.js +1 -0
  120. package/dist-embed/chunks/{percentages-BXMCSKIN-VqMxh8LK.js → percentages-BXMCSKIN-C9b5dzpq.js} +5 -5
  121. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-EvMxJb2S.js → pieDiagram-E7YTZNPT-GvxNnk0x.js} +2 -2
  122. package/dist-embed/chunks/pieDiagram-E7YTZNPT-ni9UMEzV.js +39 -0
  123. package/dist-embed/chunks/{pl-PL-T2D74RX3-Cn_9xZgM.js → pl-PL-T2D74RX3-C6nLJHhB.js} +1 -1
  124. package/dist-embed/chunks/{pt-BR-5N22H2LF-Da6r-Pp1.js → pt-BR-5N22H2LF-B1adz-DU.js} +1 -1
  125. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-D6lhcuX9.js → pt-PT-UZXXM6DQ-BCZpI4LV.js} +1 -1
  126. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-rFaTvNlk.js → quadrantDiagram-AXDQQJYC-CufBEqrC.js} +4 -4
  127. package/dist-embed/chunks/quadrantDiagram-AXDQQJYC-Yg2WGHWh.js +7 -0
  128. package/dist-embed/chunks/railroadDiagram-O6MQD6OU-6tStysfX.js +1 -0
  129. package/dist-embed/chunks/railroadDiagram-O6MQD6OU-Df7m1mT4.js +1 -0
  130. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-DHLQ_9Lw.js → requirementDiagram-BXWQKSXE-0AqPqv7a.js} +2 -2
  131. package/dist-embed/chunks/requirementDiagram-BXWQKSXE-CmXBYo40.js +84 -0
  132. package/dist-embed/chunks/{ro-RO-JPDTUUEW-BFss9e8X.js → ro-RO-JPDTUUEW-BPM7y_F2.js} +1 -1
  133. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-DIruW2gS.js → ru-RU-B4JR7IUQ-UViKo8dy.js} +1 -1
  134. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-Nk71fRsK.js → sankeyDiagram-P5KCCOFB-CqcWOAyy.js} +2 -2
  135. package/dist-embed/chunks/sankeyDiagram-P5KCCOFB-rQsp_j9w.js +40 -0
  136. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-Dm3QM01Z.js → sequenceDiagram-WJ2MYXX4-Br4F1sd7.js} +2 -2
  137. package/dist-embed/chunks/sequenceDiagram-WJ2MYXX4-GMFparx1.js +162 -0
  138. package/dist-embed/chunks/{si-LK-N5RQ5JYF-Dom-aTTE.js → si-LK-N5RQ5JYF-D7TIYEDr.js} +1 -1
  139. package/dist-embed/chunks/sizeCapture-INFHLROL-8qFOiWrK.js +1 -0
  140. package/dist-embed/chunks/sizeCapture-INFHLROL-C_M5Nl06.js +1 -0
  141. package/dist-embed/chunks/{sk-SK-C5VTKIMK-CLRU9TNq.js → sk-SK-C5VTKIMK-CQedcNlJ.js} +1 -1
  142. package/dist-embed/chunks/{sl-SI-NN7IZMDC-BKLCNVXA.js → sl-SI-NN7IZMDC-BX1W51zJ.js} +1 -1
  143. package/dist-embed/chunks/stateDiagram-D77RDMKH-CWrs6KzY.js +1 -0
  144. package/dist-embed/chunks/stateDiagram-D77RDMKH-XK76naDS.js +1 -0
  145. package/dist-embed/chunks/stateDiagram-v2-MP3YSRHH-D3ZN_IoS.js +1 -0
  146. package/dist-embed/chunks/stateDiagram-v2-MP3YSRHH-lpluVNfO.js +1 -0
  147. package/dist-embed/chunks/{subset-shared.chunk-zIH7OLsP.js → subset-shared.chunk-PVguOYyR.js} +1 -1
  148. package/dist-embed/chunks/{subset-worker.chunk-b9j7PKPe.js → subset-worker.chunk-iWGyr_E5.js} +1 -1
  149. package/dist-embed/chunks/{sv-SE-XGPEYMSR-D0UV0HV7.js → sv-SE-XGPEYMSR-DI7YcqUR.js} +1 -1
  150. package/dist-embed/chunks/swimlanes-42K2YHIH-B9qJ99nD.js +1 -0
  151. package/dist-embed/chunks/swimlanes-42K2YHIH-Ca0PhRmf.js +1 -0
  152. package/dist-embed/chunks/swimlanesDiagram-VR7AAH4N-BEQKTD21.js +8 -0
  153. package/dist-embed/chunks/swimlanesDiagram-VR7AAH4N-D-2e4UFJ.js +8 -0
  154. package/dist-embed/chunks/{ta-IN-2NMHFXQM-C-EJ3jDE.js → ta-IN-2NMHFXQM-OZH5xroe.js} +1 -1
  155. package/dist-embed/chunks/{th-TH-HPSO5L25-CfQh62Qa.js → th-TH-HPSO5L25-gAuWhBpT.js} +1 -1
  156. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CKtubk73.js → timeline-definition-24CTP7MA-B8lxEouP.js} +2 -2
  157. package/dist-embed/chunks/timeline-definition-24CTP7MA-CtZZro9U.js +120 -0
  158. package/dist-embed/chunks/{tr-TR-DEFEU3FU-Lz7Ka2Zr.js → tr-TR-DEFEU3FU-DQ0SDuS6.js} +1 -1
  159. package/dist-embed/chunks/{uk-UA-QMV73CPH-DU0hsGUJ.js → uk-UA-QMV73CPH-7J4e2jng.js} +1 -1
  160. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-Bq0xMhnH.js → vennDiagram-4TSXK5OY-Ca7szyFH.js} +2 -2
  161. package/dist-embed/chunks/vennDiagram-4TSXK5OY-zaNGkt8b.js +28 -0
  162. package/dist-embed/chunks/{vi-VN-M7AON7JQ-CDvS0SiL.js → vi-VN-M7AON7JQ-dNpZ5DZ5.js} +1 -1
  163. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-DL5LgQWr.js → wardleyDiagram-VM6X3IG4-D_Q6gtp2.js} +2 -2
  164. package/dist-embed/chunks/wardleyDiagram-VM6X3IG4-Dh0UOrRp.js +78 -0
  165. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-BXkM4beH.js → xychartDiagram-S5SC5T6Z-4OhI4XQl.js} +2 -2
  166. package/dist-embed/chunks/xychartDiagram-S5SC5T6Z-D_TaZM0k.js +7 -0
  167. package/dist-embed/chunks/{zh-CN-LNUGB5OW-CWE-bF0d.js → zh-CN-LNUGB5OW-CZSp2g8b.js} +1 -1
  168. package/dist-embed/chunks/{zh-HK-E62DVLB3-pEfL2bds.js → zh-HK-E62DVLB3-DUqVOyB_.js} +1 -1
  169. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-Cp6UFUuD.js → zh-TW-RAJ6MFWO-U-TalxxN.js} +1 -1
  170. package/dist-embed/datalayer-app-main.js +3 -3
  171. package/lib/Agent.js +2 -2
  172. package/lib/AgentDocument.js +6 -6
  173. package/lib/AgentNode.js +4 -4
  174. package/lib/AgentNotebook.js +3 -3
  175. package/lib/App.js +2 -2
  176. package/lib/AppExamples2.js +3 -4
  177. package/lib/agent-document-main.js +1 -1
  178. package/lib/agent-main.js +1 -1
  179. package/lib/agent-node-main.js +1 -1
  180. package/lib/agent-notebook-main.js +1 -1
  181. package/lib/agents/AgentDetails.js +5 -5
  182. package/lib/agents/AgentRuntimeChat.js +3 -3
  183. package/lib/api/index.js +5 -5
  184. package/lib/api/scheduler/index.js +1 -1
  185. package/lib/apps/apps/AppBrowserSandbox.js +3 -3
  186. package/lib/apps/apps/AppComposer.js +6 -6
  187. package/lib/apps/apps/AppFeedback.js +3 -3
  188. package/lib/apps/apps/AppKept.js +3 -3
  189. package/lib/apps/apps/AppRenderer.js +26 -26
  190. package/lib/apps/apps/AppRuntimePlugins.js +3 -3
  191. package/lib/apps/apps/agent.js +2 -2
  192. package/lib/apps/apps/appspec.js +5 -5
  193. package/lib/apps/apps/browserSandbox.js +1 -1
  194. package/lib/apps/apps/checks.js +24 -24
  195. package/lib/apps/apps/customComponents.js +1 -1
  196. package/lib/apps/apps/index.js +18 -18
  197. package/lib/apps/apps/language.js +1 -1
  198. package/lib/apps/apps/records.js +3 -3
  199. package/lib/apps/apps/rules.js +1 -1
  200. package/lib/apps/apps/sceneChecks.js +6 -6
  201. package/lib/apps/apps/sceneShape.js +2 -2
  202. package/lib/apps/apps/sceneYaml.js +2 -2
  203. package/lib/apps/apps/yaml.js +1 -1
  204. package/lib/apps/core/index.js +7 -7
  205. package/lib/apps/embed/AppEmbed.d.ts +1 -1
  206. package/lib/apps/embed/AppEmbed.js +11 -11
  207. package/lib/apps/embed/LoopEmbed.js +4 -4
  208. package/lib/apps/embed/datalayer-app.js +1 -1
  209. package/lib/apps/embed/element.js +7 -7
  210. package/lib/apps/embed/embedConfig.js +2 -2
  211. package/lib/apps/embed/embedSession.js +2 -2
  212. package/lib/apps/embed/hostBridge.js +3 -3
  213. package/lib/apps/embed/visitorApp.js +3 -3
  214. package/lib/apps/extensions.js +4 -4
  215. package/lib/apps/index.js +70 -70
  216. package/lib/apps/plugins/a2a-sidebar/A2ASidebar.js +6 -6
  217. package/lib/apps/plugins/a2a-sidebar/index.js +3 -3
  218. package/lib/apps/plugins/a2ui/A2uiView.js +2 -2
  219. package/lib/apps/plugins/a2ui/index.js +3 -3
  220. package/lib/apps/plugins/a2ui-scene/index.js +1 -1
  221. package/lib/apps/plugins/a2ui-surface/AnswerShows.js +3 -3
  222. package/lib/apps/plugins/a2ui-surface/InlineSurface.js +1 -1
  223. package/lib/apps/plugins/a2ui-surface/SurfaceToolResult.js +4 -4
  224. package/lib/apps/plugins/a2ui-surface/index.js +7 -7
  225. package/lib/apps/plugins/a2ui-surface/ownComponents.js +2 -2
  226. package/lib/apps/plugins/agent-a2a/index.js +1 -1
  227. package/lib/apps/plugins/agent-a2ui/index.js +1 -1
  228. package/lib/apps/plugins/agent-a2ui-jupyter-output/index.js +1 -1
  229. package/lib/apps/plugins/agent-capacity/index.js +1 -1
  230. package/lib/apps/plugins/agent-checkpoints/index.js +1 -1
  231. package/lib/apps/plugins/agent-code-sandbox/index.js +1 -1
  232. package/lib/apps/plugins/agent-code-sandboxes/index.js +1 -1
  233. package/lib/apps/plugins/agent-codemode/index.js +1 -1
  234. package/lib/apps/plugins/agent-compaction/index.js +1 -1
  235. package/lib/apps/plugins/agent-evals/index.js +1 -1
  236. package/lib/apps/plugins/agent-guardrails/index.js +1 -1
  237. package/lib/apps/plugins/agent-hooks/index.js +1 -1
  238. package/lib/apps/plugins/agent-inference/index.js +1 -1
  239. package/lib/apps/plugins/agent-mcp/index.js +1 -1
  240. package/lib/apps/plugins/agent-memory/index.js +1 -1
  241. package/lib/apps/plugins/agent-monitoring/index.js +1 -1
  242. package/lib/apps/plugins/agent-notifications/index.js +1 -1
  243. package/lib/apps/plugins/agent-otel/index.js +1 -1
  244. package/lib/apps/plugins/agent-outputs/index.js +1 -1
  245. package/lib/apps/plugins/agent-parameters/index.js +1 -1
  246. package/lib/apps/plugins/agent-skills/index.js +1 -1
  247. package/lib/apps/plugins/agent-subagents/index.js +1 -1
  248. package/lib/apps/plugins/agent-tool-approvals/index.js +1 -1
  249. package/lib/apps/plugins/agent-triggers/index.js +1 -1
  250. package/lib/apps/plugins/agents/AgentSummaryPanel.js +5 -5
  251. package/lib/apps/plugins/agents/AnonymousKeyBadge.js +2 -2
  252. package/lib/apps/plugins/agents/DatalayerAgentBridge.js +7 -7
  253. package/lib/apps/plugins/agents/DatalayerAgentMount.js +1 -1
  254. package/lib/apps/plugins/agents/SandboxSelector.js +3 -3
  255. package/lib/apps/plugins/agents/SandboxStatusBridge.js +2 -2
  256. package/lib/apps/plugins/agents/SandboxView.js +1 -1
  257. package/lib/apps/plugins/agents/TeamMemberPicker.js +2 -2
  258. package/lib/apps/plugins/agents/index.js +8 -8
  259. package/lib/apps/plugins/agents/plugin.js +10 -10
  260. package/lib/apps/plugins/agents/specSubagents.js +1 -1
  261. package/lib/apps/plugins/agents/switchable.js +3 -3
  262. package/lib/apps/plugins/agents/team.js +2 -2
  263. package/lib/apps/plugins/agents/useSandboxService.js +1 -1
  264. package/lib/apps/plugins/agents/useTeamSelection.js +1 -1
  265. package/lib/apps/plugins/agentspecs/AgentspecPicker.js +1 -1
  266. package/lib/apps/plugins/agentspecs/index.js +2 -2
  267. package/lib/apps/plugins/app-activity/AppActivity.js +2 -2
  268. package/lib/apps/plugins/app-activity/index.js +3 -3
  269. package/lib/apps/plugins/app-components/index.js +4 -4
  270. package/lib/apps/plugins/app-computer/AppComputer.js +3 -3
  271. package/lib/apps/plugins/app-computer/index.js +4 -4
  272. package/lib/apps/plugins/app-elements/AppElements.js +2 -2
  273. package/lib/apps/plugins/app-elements/QuestionView.js +1 -1
  274. package/lib/apps/plugins/app-elements/index.js +6 -6
  275. package/lib/apps/plugins/app-page/AppPage.js +7 -7
  276. package/lib/apps/plugins/app-page/appPageModel.js +1 -1
  277. package/lib/apps/plugins/app-page/index.js +6 -6
  278. package/lib/apps/plugins/app-rules/AppRulesCard.js +5 -5
  279. package/lib/apps/plugins/app-rules/index.js +4 -4
  280. package/lib/apps/plugins/assistant/index.js +12 -12
  281. package/lib/apps/plugins/assistant-characters/index.d.ts +1 -1
  282. package/lib/apps/plugins/assistant-characters/index.js +3 -3
  283. package/lib/apps/plugins/canvas-blocks/index.js +2 -2
  284. package/lib/apps/plugins/canvas-parts/index.js +10 -10
  285. package/lib/apps/plugins/chat/ChatView.js +43 -43
  286. package/lib/apps/plugins/chat/SessionActionsMenu.js +2 -2
  287. package/lib/apps/plugins/chat/index.js +4 -4
  288. package/lib/apps/plugins/chat/sessionActions.js +2 -2
  289. package/lib/apps/plugins/chat-extras/index.js +1 -1
  290. package/lib/apps/plugins/chat-header/HeaderView.js +1 -1
  291. package/lib/apps/plugins/chat-header/index.js +2 -2
  292. package/lib/apps/plugins/chat-view/index.js +2 -2
  293. package/lib/apps/plugins/checkpoints-sidebar/CheckpointsSidebar.js +2 -2
  294. package/lib/apps/plugins/checkpoints-sidebar/index.js +3 -3
  295. package/lib/apps/plugins/commands/index.js +1 -1
  296. package/lib/apps/plugins/decks/DecksMenu.js +2 -2
  297. package/lib/apps/plugins/decks/index.js +8 -8
  298. package/lib/apps/plugins/document/DocumentView.js +5 -5
  299. package/lib/apps/plugins/document/index.js +4 -4
  300. package/lib/apps/plugins/document/openingDocument.js +1 -1
  301. package/lib/apps/plugins/document-toolbar/SandboxStatusItem.js +2 -2
  302. package/lib/apps/plugins/document-toolbar/index.js +3 -3
  303. package/lib/apps/plugins/document-toolbar/plugin.js +3 -3
  304. package/lib/apps/plugins/document-view/index.js +1 -1
  305. package/lib/apps/plugins/graph/GraphToggle.js +1 -1
  306. package/lib/apps/plugins/graph/index.js +5 -5
  307. package/lib/apps/plugins/input-prompt/ComposerView.js +2 -2
  308. package/lib/apps/plugins/input-prompt/index.js +2 -2
  309. package/lib/apps/plugins/models/index.js +1 -1
  310. package/lib/apps/plugins/notebook/NotebookView.js +5 -5
  311. package/lib/apps/plugins/notebook/index.js +4 -4
  312. package/lib/apps/plugins/notebook-toolbar/index.js +3 -3
  313. package/lib/apps/plugins/notebook-toolbar/plugin.js +3 -3
  314. package/lib/apps/plugins/notebook-view/index.js +1 -1
  315. package/lib/apps/plugins/page-layout/SplitLayout.js +1 -1
  316. package/lib/apps/plugins/page-layout/TurnPanel.js +5 -5
  317. package/lib/apps/plugins/page-layout/index.js +5 -5
  318. package/lib/apps/plugins/pap-example/index.js +1 -1
  319. package/lib/apps/plugins/pap-sign-in/PapSignInCard.js +1 -1
  320. package/lib/apps/plugins/pap-sign-in/index.js +5 -5
  321. package/lib/apps/plugins/pap-sign-in/signIn.js +1 -1
  322. package/lib/apps/plugins/plugins-panel/index.js +1 -1
  323. package/lib/apps/plugins/prompt/index.js +3 -3
  324. package/lib/apps/plugins/shell/editorChoice.js +1 -1
  325. package/lib/apps/plugins/shell/index.js +4 -4
  326. package/lib/apps/plugins/shell/useEditorPreviews.js +1 -1
  327. package/lib/apps/plugins/shield-displays/DiffCard.js +1 -1
  328. package/lib/apps/plugins/shield-displays/TerminalCard.js +1 -1
  329. package/lib/apps/plugins/shield-displays/index.js +5 -5
  330. package/lib/apps/plugins/subagent-activity/SubagentPulse.js +3 -3
  331. package/lib/apps/plugins/subagent-activity/index.js +4 -4
  332. package/lib/apps/plugins/view-switch/index.js +3 -3
  333. package/lib/apps/plugins/window-frame/WindowFrame.js +1 -1
  334. package/lib/apps/plugins/window-frame/index.js +5 -5
  335. package/lib/apps/presets.js +21 -21
  336. package/lib/apps/shell/LoopWorkspace.js +4 -4
  337. package/lib/apps/shell/SidebarRail.js +1 -1
  338. package/lib/apps/shell/ViewSwitcher.js +1 -1
  339. package/lib/apps/shell/WorkspaceFullScreenAction.js +2 -2
  340. package/lib/apps/shell/index.js +7 -7
  341. package/lib/chat/Chat.js +7 -7
  342. package/lib/chat/ChatFloating.d.ts +1 -1
  343. package/lib/chat/ChatFloating.js +23 -23
  344. package/lib/chat/ChatInline.js +4 -4
  345. package/lib/chat/ChatLanguage.js +2 -2
  346. package/lib/chat/ChatPopupStandalone.js +4 -4
  347. package/lib/chat/ChatSidebar.js +2 -2
  348. package/lib/chat/ChatStandalone.js +3 -3
  349. package/lib/chat/assistant/AgentDetailsDialog.js +1 -1
  350. package/lib/chat/assistant/AssistantStage.d.ts +1 -1
  351. package/lib/chat/assistant/AssistantStage.js +16 -16
  352. package/lib/chat/assistant/Avatar3D.d.ts +1 -1
  353. package/lib/chat/assistant/Avatar3D.js +1 -1
  354. package/lib/chat/assistant/BalloonParts.js +8 -8
  355. package/lib/chat/assistant/BalloonVisual.js +1 -1
  356. package/lib/chat/assistant/ConversationBalloon.js +1 -1
  357. package/lib/chat/assistant/DecisionAsk.js +1 -1
  358. package/lib/chat/assistant/SandboxDetailsDialog.js +1 -1
  359. package/lib/chat/assistant/SpeechBalloon.js +5 -5
  360. package/lib/chat/assistant/SpriteCharacter.js +2 -2
  361. package/lib/chat/assistant/{avatar3d.d.ts → avatar3dModel.d.ts} +1 -1
  362. package/lib/chat/assistant/formats/acf.js +3 -3
  363. package/lib/chat/assistant/formats/acs.js +3 -3
  364. package/lib/chat/assistant/formats/agentCompression.js +1 -1
  365. package/lib/chat/assistant/formats/blobs.js +1 -1
  366. package/lib/chat/assistant/formats/clippy.js +3 -3
  367. package/lib/chat/assistant/formats/files.js +4 -4
  368. package/lib/chat/assistant/formats/index.js +7 -7
  369. package/lib/chat/assistant/formats/objectLiteral.js +1 -1
  370. package/lib/chat/assistant/toolLine.js +2 -2
  371. package/lib/chat/base/ChatBase.js +45 -45
  372. package/lib/chat/base/fullContextMessages.js +1 -1
  373. package/lib/chat/base/uiOps.js +3 -3
  374. package/lib/chat/display/EmptyState.js +3 -3
  375. package/lib/chat/document/EphemeralDocument.js +4 -4
  376. package/lib/chat/header/ChatHeaderBase.js +2 -2
  377. package/lib/chat/header/ChatViewModeToggle.js +1 -1
  378. package/lib/chat/index.js +24 -24
  379. package/lib/chat/indicators/McpStatusIndicator.js +1 -1
  380. package/lib/chat/indicators/SandboxStatusIndicator.js +1 -1
  381. package/lib/chat/indicators/index.js +3 -3
  382. package/lib/chat/marks/SpecMark.js +1 -1
  383. package/lib/chat/marks/index.js +3 -3
  384. package/lib/chat/marks/toolMarks.js +4 -4
  385. package/lib/chat/messages/ChatMarkdown.js +3 -3
  386. package/lib/chat/messages/ChatMessageList.js +13 -13
  387. package/lib/chat/messages/ChatMessages.js +2 -2
  388. package/lib/chat/messages/FormSubmissionMessage.js +1 -1
  389. package/lib/chat/messages/TurnFooter.js +2 -2
  390. package/lib/chat/notebook/EphemeralNotebook.js +4 -4
  391. package/lib/chat/parts/MessagePart.js +4 -4
  392. package/lib/chat/parts/ReasoningPart.js +2 -2
  393. package/lib/chat/parts/TextPart.js +2 -2
  394. package/lib/chat/parts/ToolPart.js +1 -1
  395. package/lib/chat/parts/index.js +5 -5
  396. package/lib/chat/presence/Presence.js +1 -1
  397. package/lib/chat/presence/presenceStatus.js +1 -1
  398. package/lib/chat/prompt/InputPrompt.js +9 -9
  399. package/lib/chat/prompt/InputPromptBase.js +6 -6
  400. package/lib/chat/prompt/InputPromptLexical.js +4 -4
  401. package/lib/chat/prompt/footer/BelowPromptFooter.js +1 -1
  402. package/lib/chat/prompt/footer/InPromptFooter.js +2 -2
  403. package/lib/chat/prompt/footer/index.js +2 -2
  404. package/lib/chat/prompt/header/BelowPromptHeader.js +1 -1
  405. package/lib/chat/prompt/header/InPromptHeader.js +1 -1
  406. package/lib/chat/prompt/header/index.js +2 -2
  407. package/lib/chat/prompt/index.js +10 -10
  408. package/lib/chat/prompt/menus/SkillsMenu.js +1 -1
  409. package/lib/chat/prompt/menus/SuggestionsMenu.js +1 -1
  410. package/lib/chat/prompt/menus/ToolsMenu.js +1 -1
  411. package/lib/chat/prompt/menus/index.js +6 -6
  412. package/lib/chat/prompt/plugins/AgentMentionPlugin.js +1 -1
  413. package/lib/chat/prompt/plugins/MentionNode.js +1 -1
  414. package/lib/chat/prompt/stack.js +1 -1
  415. package/lib/chat/tools/SubagentActivity.js +1 -1
  416. package/lib/chat/tools/ToolApprovalBanner.js +1 -1
  417. package/lib/chat/tools/ToolApprovalDialog.js +1 -1
  418. package/lib/chat/tools/ToolCallDisplay.js +2 -2
  419. package/lib/chat/tools/index.js +5 -5
  420. package/lib/chat/usage/ContextPie.js +1 -1
  421. package/lib/chat/words.js +1 -1
  422. package/lib/client/AgentRuntimesClient.js +2 -2
  423. package/lib/client/AgentsMixin.js +8 -8
  424. package/lib/client/index.js +3 -3
  425. package/lib/client/mixins/RuntimesMixin.js +6 -6
  426. package/lib/client/mixins/SpacerMixin.js +11 -11
  427. package/lib/client/utils/spacerUtils.js +2 -2
  428. package/lib/collaboration/DatalayerCollaborationProvider.js +1 -1
  429. package/lib/collaboration/index.js +2 -2
  430. package/lib/components/a2ui/custom/index.js +6 -6
  431. package/lib/components/a2ui/datalayer/Chart.js +2 -2
  432. package/lib/components/a2ui/datalayer/Chat.js +5 -5
  433. package/lib/components/a2ui/datalayer/Download.js +2 -2
  434. package/lib/components/a2ui/datalayer/Evidence.js +2 -2
  435. package/lib/components/a2ui/datalayer/FileUpload.js +3 -3
  436. package/lib/components/a2ui/datalayer/Form.js +3 -3
  437. package/lib/components/a2ui/datalayer/SchemaForm.js +1 -1
  438. package/lib/components/a2ui/datalayer/Table.js +2 -2
  439. package/lib/components/a2ui/datalayer/implementation.js +1 -1
  440. package/lib/components/a2ui/datalayer/index.js +17 -17
  441. package/lib/components/a2ui/datalayer/schema.js +1 -1
  442. package/lib/components/a2ui/index.js +7 -7
  443. package/lib/components/a2ui/visibleWhen.js +2 -2
  444. package/lib/components/agents/AgentSummary.js +1 -1
  445. package/lib/components/agents/index.js +1 -1
  446. package/lib/components/cards/NotificationEventCard.js +2 -2
  447. package/lib/components/cards/OutputCard.js +2 -2
  448. package/lib/components/cards/index.js +3 -3
  449. package/lib/components/code-sandboxes/CodeSandboxCellVariablesDialog.js +3 -3
  450. package/lib/components/code-sandboxes/CodeSandboxLauncher.js +9 -9
  451. package/lib/components/code-sandboxes/CodeSandboxPicker.js +9 -9
  452. package/lib/components/code-sandboxes/CodeSandboxPickerCell.js +7 -7
  453. package/lib/components/code-sandboxes/CodeSandboxUtils.js +3 -3
  454. package/lib/components/code-sandboxes/CodeSandboxVariables.js +1 -1
  455. package/lib/components/code-sandboxes/NewCodeSandboxControls.js +3 -3
  456. package/lib/components/code-sandboxes/index.js +14 -14
  457. package/lib/components/context/SpaceSelect.js +1 -1
  458. package/lib/components/flashes/FlashDisclaimer.js +1 -1
  459. package/lib/components/icons/index.js +1 -1
  460. package/lib/components/index.js +6 -6
  461. package/lib/components/inspector/AgentInspector.js +2 -2
  462. package/lib/components/inspector/AgentInspectorDialog.js +1 -1
  463. package/lib/components/inspector/a2aSpans.js +1 -1
  464. package/lib/components/inspector/chatSpans.js +2 -2
  465. package/lib/components/inspector/classify.js +1 -1
  466. package/lib/components/inspector/index.js +6 -6
  467. package/lib/components/nbgrader/index.js +1 -1
  468. package/lib/components/progress/index.js +1 -1
  469. package/lib/components/scheduler/ScheduleMenu.js +1 -1
  470. package/lib/components/scheduler/index.js +1 -1
  471. package/lib/components/snapshots/SandboxSnapshotMenu.js +2 -2
  472. package/lib/components/snapshots/index.js +1 -1
  473. package/lib/components/teams/A2ATeamGraph.d.ts +1 -1
  474. package/lib/components/teams/A2ATeamGraph.js +8 -8
  475. package/lib/components/teams/AnswerSurfaces.js +1 -1
  476. package/lib/components/teams/AnswerSurfacesView.js +4 -4
  477. package/lib/components/teams/NotebookPreview.js +2 -2
  478. package/lib/components/teams/NotebookPreviewView.js +1 -1
  479. package/lib/components/teams/SceneTranscript.d.ts +1 -1
  480. package/lib/components/teams/SceneTranscript.js +2 -2
  481. package/lib/components/teams/SceneView.d.ts +1 -1
  482. package/lib/components/teams/SceneView.js +1 -1
  483. package/lib/components/teams/TeamNotebook.js +1 -1
  484. package/lib/components/teams/TeamNotebookView.js +3 -3
  485. package/lib/components/teams/index.d.ts +1 -1
  486. package/lib/components/teams/index.js +13 -13
  487. package/lib/components/teams/sceneStage.js +2 -2
  488. package/lib/components/teams/{sceneTranscript.d.ts → sceneTranscriptRules.d.ts} +1 -1
  489. package/lib/components/teams/{sceneTranscript.js → sceneTranscriptRules.js} +1 -1
  490. package/lib/components/teams/teamConnections.js +3 -3
  491. package/lib/components/teams/useA2ATeam.js +6 -6
  492. package/lib/components/teams/usePeerSandbox.js +1 -1
  493. package/lib/components/tokens/index.js +1 -1
  494. package/lib/config/AgentConfiguration.js +2 -2
  495. package/lib/config/index.js +2 -2
  496. package/lib/context/CostUsageChart.js +4 -4
  497. package/lib/context/MessageHistory.js +1 -1
  498. package/lib/context/TokenUsageChart.js +4 -4
  499. package/lib/examples/A2UiAgentExample.js +9 -9
  500. package/lib/examples/A2UiComponentsGalleryExample.js +4 -4
  501. package/lib/examples/A2UiContactCardExample.js +4 -4
  502. package/lib/examples/A2UiJupyterOutputExample.js +11 -11
  503. package/lib/examples/A2UiRestaurantExample.js +4 -4
  504. package/lib/examples/A2UiViewerExample.js +6 -6
  505. package/lib/examples/AgUiAgenticExample.js +4 -4
  506. package/lib/examples/AgUiBackendToolRenderingExample.js +6 -6
  507. package/lib/examples/AgUiHaikuGenUiExample.js +6 -6
  508. package/lib/examples/AgUiHumanInTheLoopExample.js +5 -5
  509. package/lib/examples/AgUiSharedStateExample.js +4 -4
  510. package/lib/examples/AgUiToolsBasedGenUiExample.js +4 -4
  511. package/lib/examples/AgentA2AExample.js +7 -7
  512. package/lib/examples/AgentA2ATeamExample.js +10 -10
  513. package/lib/examples/AgentCheckpointsExample.js +14 -14
  514. package/lib/examples/AgentCodeSandboxExample.js +6 -6
  515. package/lib/examples/AgentCodeSandboxesExample.js +5 -5
  516. package/lib/examples/AgentCodemodeExample.js +12 -12
  517. package/lib/examples/AgentCompactionExample.js +8 -8
  518. package/lib/examples/AgentDecideExample.js +6 -6
  519. package/lib/examples/AgentEvalsExample.js +11 -11
  520. package/lib/examples/AgentGuardrailsExample.js +17 -17
  521. package/lib/examples/AgentHooksExample.js +5 -5
  522. package/lib/examples/AgentInferenceProviderExample.js +6 -6
  523. package/lib/examples/AgentMCPExample.js +14 -14
  524. package/lib/examples/AgentMemoryExample.js +11 -11
  525. package/lib/examples/AgentMonitoringExample.js +19 -19
  526. package/lib/examples/AgentNotificationsExample.js +9 -9
  527. package/lib/examples/AgentOtelExample.js +6 -6
  528. package/lib/examples/AgentOutputsExample.js +8 -8
  529. package/lib/examples/AgentParametersExample.js +6 -6
  530. package/lib/examples/AgentSkillsExample.js +9 -9
  531. package/lib/examples/AgentSubagentsExample.js +8 -8
  532. package/lib/examples/AgentToolApprovalsExample.js +10 -10
  533. package/lib/examples/AgentTriggersExample.js +14 -14
  534. package/lib/examples/AgentspecsExample.js +11 -11
  535. package/lib/examples/AvatarExample.js +8 -8
  536. package/lib/examples/AvatarGalleryExample.js +8 -8
  537. package/lib/examples/CellExample.js +2 -2
  538. package/lib/examples/ChatCustomExample.js +4 -4
  539. package/lib/examples/ChatExample.js +8 -8
  540. package/lib/examples/ChatStandaloneExample.js +2 -2
  541. package/lib/examples/CopilotKitLexicalExample.js +4 -4
  542. package/lib/examples/CopilotKitNotebookExample.js +4 -4
  543. package/lib/examples/DecksAgent.js +4 -4
  544. package/lib/examples/DocumentPageAgent.js +2 -2
  545. package/lib/examples/Lexical2Example.js +9 -9
  546. package/lib/examples/LexicalAgentExample.js +7 -7
  547. package/lib/examples/LexicalAgentSidebarExample.js +8 -8
  548. package/lib/examples/LoopAppComputerExample.js +4 -4
  549. package/lib/examples/LoopShellExample.js +6 -6
  550. package/lib/examples/LoopStrategyExample.js +6 -6
  551. package/lib/examples/LoopWorkspaceEmbed.js +1 -1
  552. package/lib/examples/LoopWorkspaceExample.js +11 -11
  553. package/lib/examples/NotebookAgentExample.js +5 -5
  554. package/lib/examples/NotebookAgentSidebarExample.js +5 -5
  555. package/lib/examples/NotebookCollaborationExample.js +6 -6
  556. package/lib/examples/NotebookExample.js +2 -2
  557. package/lib/examples/NotebookPageAgent.js +2 -2
  558. package/lib/examples/PapAccountTokensExample.js +4 -4
  559. package/lib/examples/PapAgentIdentityExample.js +4 -4
  560. package/lib/examples/PapAuthorizationBoundaryExample.js +4 -4
  561. package/lib/examples/PapCompanyDiscoveryExample.js +4 -4
  562. package/lib/examples/PapConversationControlExample.js +4 -4
  563. package/lib/examples/PapConversationStreamingExample.js +4 -4
  564. package/lib/examples/PapDpopProofExample.js +4 -4
  565. package/lib/examples/PapGuidedJourneyExample.js +4 -4
  566. package/lib/examples/PapMediatedSignInExample.js +4 -4
  567. package/lib/examples/PapOperationsExample.js +4 -4
  568. package/lib/examples/PapSessionLifecycleExample.js +4 -4
  569. package/lib/examples/PapSignInDisplayExample.js +4 -4
  570. package/lib/examples/PapTwoCompaniesExample.js +4 -4
  571. package/lib/examples/PapUserWithACompanyExample.js +4 -4
  572. package/lib/examples/ProtocolSignedRequestsExample.js +2 -2
  573. package/lib/examples/ProtocolUcpCheckoutExample.js +2 -2
  574. package/lib/examples/ScenesExample.js +8 -8
  575. package/lib/examples/ShieldHarnessExample.js +5 -5
  576. package/lib/examples/ShieldPolicyExample.js +2 -2
  577. package/lib/examples/VoiceChatExample.js +4 -4
  578. package/lib/examples/components/AuthRequiredView.js +1 -1
  579. package/lib/examples/components/ExampleWrapper.js +3 -3
  580. package/lib/examples/components/Header.js +2 -2
  581. package/lib/examples/components/LexicalEditor.js +1 -1
  582. package/lib/examples/components/MainContent.js +1 -1
  583. package/lib/examples/components/haiku/HaikuDisplay.js +1 -1
  584. package/lib/examples/components/haiku/index.js +2 -2
  585. package/lib/examples/components/index.js +13 -13
  586. package/lib/examples/components/weather/index.js +1 -1
  587. package/lib/examples/example-selector.js +78 -78
  588. package/lib/examples/hooks/useExampleAgentProtocol.js +2 -2
  589. package/lib/examples/hooks/useExampleAgentRuntime.js +4 -4
  590. package/lib/examples/hooks/useExampleAgentRuntimes.js +4 -4
  591. package/lib/examples/hooks/useExampleJupyterAgent.js +8 -8
  592. package/lib/examples/hooks/useToolRenderers.js +1 -1
  593. package/lib/examples/index.js +66 -66
  594. package/lib/examples/lexical/editorConfig.js +1 -1
  595. package/lib/examples/main.js +21 -21
  596. package/lib/examples/pap/PapAccountTokensView.js +1 -1
  597. package/lib/examples/pap/PapAgentIdentityView.js +2 -2
  598. package/lib/examples/pap/PapAuthorizationBoundaryView.js +1 -1
  599. package/lib/examples/pap/PapCompanyDiscoveryView.js +2 -2
  600. package/lib/examples/pap/PapConversationControlView.js +1 -1
  601. package/lib/examples/pap/PapConversationStreamingView.js +1 -1
  602. package/lib/examples/pap/PapDpopProofView.js +1 -1
  603. package/lib/examples/pap/PapGuidedJourneyView.js +2 -2
  604. package/lib/examples/pap/PapMediatedSignInView.js +1 -1
  605. package/lib/examples/pap/PapOperationsView.js +1 -1
  606. package/lib/examples/pap/PapSessionLifecycleView.js +1 -1
  607. package/lib/examples/pap/PapSignInDisplayView.js +2 -2
  608. package/lib/examples/pap/PapTraceView.js +1 -1
  609. package/lib/examples/pap/PapTwoCompaniesView.js +1 -1
  610. package/lib/examples/pap/PapUserWithACompanyView.js +1 -1
  611. package/lib/examples/pap/papSignInCases.js +1 -1
  612. package/lib/examples/protocols/signedRequestsDemo.js +1 -1
  613. package/lib/examples/protocols/ucpCheckoutDemo.js +3 -3
  614. package/lib/examples/scenes/A2UiComponentsGalleryScene.js +4 -4
  615. package/lib/examples/scenes/A2UiContactCardScene.js +3 -3
  616. package/lib/examples/scenes/A2UiRestaurantScene.js +5 -5
  617. package/lib/examples/scenes/A2UiViewerScene.js +3 -3
  618. package/lib/examples/utils/AvatarGalleryGrid.d.ts +1 -1
  619. package/lib/examples/utils/AvatarGalleryGrid.js +8 -8
  620. package/lib/examples/utils/a2ui.js +1 -1
  621. package/lib/examples/utils/a2uiMarkdownProvider.js +1 -1
  622. package/lib/examples/utils/avatarGallery.js +2 -2
  623. package/lib/examples/utils/clippyJsCharacters.js +1 -1
  624. package/lib/examples/utils/examplesStore.js +1 -1
  625. package/lib/examples/utils/notebookToolbarItems.js +1 -1
  626. package/lib/examples/utils/owlCharacterPlugin.js +1 -1
  627. package/lib/examples/utils/teardownAgents.js +1 -1
  628. package/lib/examples/utils/testSpriteCharacter.js +1 -1
  629. package/lib/examples/utils/themedProvider.js +1 -1
  630. package/lib/examples/utils/useExampleAgentRuntimesUrl.js +3 -3
  631. package/lib/examples2/DatalayerNotebookExample.js +3 -3
  632. package/lib/examples2/NativeNavigationExample.js +1 -1
  633. package/lib/examples2/NotebookMutationsKernel.js +2 -2
  634. package/lib/examples2/NotebookMutationsServiceManager.js +2 -2
  635. package/lib/examples2/ReactRouterExample.js +1 -1
  636. package/lib/examples2/example-selector.js +7 -7
  637. package/lib/examples2/index.js +2 -2
  638. package/lib/examples2/main.js +5 -5
  639. package/lib/hooks/index.js +26 -26
  640. package/lib/hooks/useAgUi.js +1 -1
  641. package/lib/hooks/useAgentRuntimes.js +9 -9
  642. package/lib/hooks/useAgentsCatalog.js +1 -1
  643. package/lib/hooks/useAgentsService.js +1 -1
  644. package/lib/hooks/useBrowserAgent.js +1 -1
  645. package/lib/hooks/useBrowserInference.js +2 -2
  646. package/lib/hooks/useCellOutputshot.js +1 -1
  647. package/lib/hooks/useChat.js +6 -6
  648. package/lib/hooks/useCheckpoints.js +10 -10
  649. package/lib/hooks/useConfig.js +1 -1
  650. package/lib/hooks/useContextSnapshot.js +1 -1
  651. package/lib/hooks/useNotifications.js +1 -1
  652. package/lib/hooks/useProgressTask.js +1 -1
  653. package/lib/hooks/useSandbox.js +1 -1
  654. package/lib/hooks/useSkills.js +1 -1
  655. package/lib/hooks/useToolApprovals.js +2 -2
  656. package/lib/hooks/useTools.js +1 -1
  657. package/lib/identity/AgentIdentity.js +3 -3
  658. package/lib/identity/IdentityConnect.js +2 -2
  659. package/lib/identity/OAuthCallback.js +1 -1
  660. package/lib/identity/identityStore.js +2 -2
  661. package/lib/identity/index.js +8 -8
  662. package/lib/identity/useIdentity.js +1 -1
  663. package/lib/index.js +11 -11
  664. package/lib/inference/DatalayerInferenceProvider.js +2 -2
  665. package/lib/inference/SelfHostedInferenceProvider.js +2 -2
  666. package/lib/inference/index.js +3 -3
  667. package/lib/jupyter/exec/Snippets.js +1 -1
  668. package/lib/jupyter/exec/index.js +2 -2
  669. package/lib/jupyter/index.js +3 -3
  670. package/lib/jupyter/useResumeServerExecutions.js +1 -1
  671. package/lib/lexical/ChatInlinePlugin.js +1 -1
  672. package/lib/lexical/index.js +2 -2
  673. package/lib/loop-example-main.js +2 -2
  674. package/lib/loop-main.js +9 -9
  675. package/lib/main.js +1 -1
  676. package/lib/mcp/index.js +1 -1
  677. package/lib/middleware/index.js +1 -1
  678. package/lib/mocks/models/CourseMock.js +1 -1
  679. package/lib/models/CodeSandboxSnapshotDTO.js +1 -1
  680. package/lib/models/ItemDTO.js +1 -1
  681. package/lib/models/LexicalDTO.js +2 -2
  682. package/lib/models/NotebookDTO.js +2 -2
  683. package/lib/models/Page.js +1 -1
  684. package/lib/models/RuntimeDTO.js +1 -1
  685. package/lib/models/SpaceDTO.js +7 -7
  686. package/lib/models/index.js +32 -32
  687. package/lib/portable/activity.js +1 -1
  688. package/lib/portable/approvalCard.js +1 -1
  689. package/lib/portable/attention.d.ts +204 -0
  690. package/lib/portable/attention.js +352 -0
  691. package/lib/portable/conversation.js +4 -4
  692. package/lib/portable/displays.js +1 -1
  693. package/lib/portable/fixtures.js +2 -2
  694. package/lib/portable/hosts/agentClient.js +4 -4
  695. package/lib/portable/hosts/client.js +1 -1
  696. package/lib/portable/hosts/deadLetters.js +3 -3
  697. package/lib/portable/hosts/deliveries.js +1 -1
  698. package/lib/portable/hosts/index.js +21 -21
  699. package/lib/portable/hosts/postgresQueue.js +1 -1
  700. package/lib/portable/hosts/quotas.js +1 -1
  701. package/lib/portable/hosts/schema.js +1 -1
  702. package/lib/portable/index.js +24 -24
  703. package/lib/portable/localApprovals.d.ts +72 -0
  704. package/lib/portable/localApprovals.js +125 -0
  705. package/lib/portable/localRuntime.d.ts +365 -0
  706. package/lib/portable/localRuntime.js +555 -0
  707. package/lib/portable/runMeasures.js +2 -2
  708. package/lib/portable/sessionList.d.ts +426 -0
  709. package/lib/portable/sessionList.js +618 -0
  710. package/lib/portable/sessions.js +4 -4
  711. package/lib/portable/thread.js +2 -2
  712. package/lib/portable/views.js +1 -1
  713. package/lib/protocols/A2AAdapter.js +3 -3
  714. package/lib/protocols/ACPAdapter.js +2 -2
  715. package/lib/protocols/AGUIAdapter.js +4 -4
  716. package/lib/protocols/BrowserAgentAdapter.js +3 -3
  717. package/lib/protocols/VercelAIAdapter.js +2 -2
  718. package/lib/protocols/a2a/index.js +1 -1
  719. package/lib/protocols/agentProtocols.js +8 -8
  720. package/lib/protocols/agentic-commerce/index.js +3 -3
  721. package/lib/protocols/commerce.js +1 -1
  722. package/lib/protocols/index.js +6 -6
  723. package/lib/protocols/mcp/index.js +2 -2
  724. package/lib/protocols/pact/index.js +1 -1
  725. package/lib/protocols/pap/index.js +1 -1
  726. package/lib/protocols/ucp/index.js +3 -3
  727. package/lib/protocols/ucp/merchant.js +1 -1
  728. package/lib/protocols/web-bot-auth/index.js +1 -1
  729. package/lib/protocols/web-bot-auth/tap.js +1 -1
  730. package/lib/runtimes/actions.js +3 -3
  731. package/lib/runtimes/browser/agent.js +2 -2
  732. package/lib/runtimes/browser/frontendTools.js +1 -1
  733. package/lib/runtimes/browser/index.js +6 -6
  734. package/lib/runtimes/browser/subagents.js +2 -2
  735. package/lib/runtimes/index.js +8 -8
  736. package/lib/runtimes/variants.js +1 -1
  737. package/lib/services/DatalayerServiceManager.js +1 -1
  738. package/lib/specs/agents/agents.js +4 -4
  739. package/lib/specs/agents/index.js +1 -1
  740. package/lib/specs/cogs.js +4 -4
  741. package/lib/specs/index.js +32 -32
  742. package/lib/specs/teams/index.js +1 -1
  743. package/lib/state/index.js +1 -1
  744. package/lib/state/substates/RuntimesState.js +1 -1
  745. package/lib/state/substates/index.js +7 -7
  746. package/lib/stores/agentRuntimeStore.js +3 -3
  747. package/lib/stores/index.js +3 -3
  748. package/lib/stories/Button.stories.js +1 -1
  749. package/lib/stories/Header.js +1 -1
  750. package/lib/stories/Header.stories.js +1 -1
  751. package/lib/stories/Page.js +1 -1
  752. package/lib/stories/Page.stories.js +1 -1
  753. package/lib/stories/loop/LoopReference.stories.js +1 -1
  754. package/lib/stories/loop/ReferenceScreens.js +11 -11
  755. package/lib/stories/loop/pictures-main.js +2 -2
  756. package/lib/tools/ToolExecutor.js +1 -1
  757. package/lib/tools/adapters/agent-runtimes/index.js +3 -3
  758. package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +1 -1
  759. package/lib/tools/adapters/agent-runtimes/notebookHooks.js +1 -1
  760. package/lib/tools/adapters/commands/index.js +1 -1
  761. package/lib/tools/adapters/copilotkit/index.js +3 -3
  762. package/lib/tools/adapters/copilotkit/lexicalHooks.js +1 -1
  763. package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -1
  764. package/lib/tools/index.js +3 -3
  765. package/lib/types/index.js +40 -40
  766. package/lib/ui-plugins/index.js +3 -3
  767. package/lib/utils/index.js +1 -1
  768. package/lib/utils/utils.js +2 -2
  769. package/lib/voice/ComposerVoice.js +5 -5
  770. package/lib/voice/HandsFree.js +5 -5
  771. package/lib/voice/ReadAloud.js +1 -1
  772. package/lib/voice/VoiceInput.js +3 -3
  773. package/lib/voice/VoiceMenu.js +3 -3
  774. package/lib/voice/captions.js +2 -2
  775. package/lib/voice/chatVoice.js +3 -3
  776. package/lib/voice/choices.js +1 -1
  777. package/lib/voice/{handsFree.d.ts → handsFreeRules.d.ts} +1 -1
  778. package/lib/voice/hearing.js +3 -3
  779. package/lib/voice/index.d.ts +1 -1
  780. package/lib/voice/index.js +22 -22
  781. package/lib/voice/keptSound.js +1 -1
  782. package/lib/voice/pinned.js +1 -1
  783. package/lib/voice/serverHearing.js +2 -2
  784. package/lib/voice/useSpokenAnswers.js +1 -1
  785. package/lib/voice/useVoiceSettings.js +1 -1
  786. package/lib/voice/useVoiceSpeaker.js +2 -2
  787. package/package.json +4 -3
  788. package/scripts/check-npm-pack.mjs +77 -0
  789. package/scripts/esm-specifiers.mjs +76 -0
  790. package/scripts/fully-specify-lib.mjs +61 -0
  791. package/dist-embed/chunks/abnfDiagram-VCTEODGH-m7LJLYga.js +0 -1
  792. package/dist-embed/chunks/classDiagram-ZZMXUADV-CGdcKCOI.js +0 -1
  793. package/dist-embed/chunks/classDiagram-v2-VYDZK3BY-CGdcKCOI.js +0 -1
  794. package/dist-embed/chunks/cose-bilkent-JH36ORCC-BsK2pWDL.js +0 -1
  795. package/dist-embed/chunks/cynefinDiagram-5FMLGOSQ-vmheD_S2.js +0 -62
  796. package/dist-embed/chunks/diagram-UQ7AKVKN-BFkOO3Wu.js +0 -41
  797. package/dist-embed/chunks/diagram-VX7I27RA-_LUOsaBb.js +0 -24
  798. package/dist-embed/chunks/diagram-Z3DM3KII-CY856Sry.js +0 -24
  799. package/dist-embed/chunks/ebnfDiagram-PWID7BFC-kqD9RLAA.js +0 -1
  800. package/dist-embed/chunks/gitGraphDiagram-WWUBYQGX-BujqTwbf.js +0 -106
  801. package/dist-embed/chunks/infoDiagram-27XIBGKW-C18Zz25F.js +0 -2
  802. package/dist-embed/chunks/pegDiagram-XKGWAZYB-BBVcHZ8T.js +0 -1
  803. package/dist-embed/chunks/railroadDiagram-O6MQD6OU-bR7xXZGS.js +0 -1
  804. package/dist-embed/chunks/sizeCapture-INFHLROL-BW7unDBA.js +0 -1
  805. package/dist-embed/chunks/stateDiagram-D77RDMKH-mLSMGpPQ.js +0 -1
  806. package/dist-embed/chunks/stateDiagram-v2-MP3YSRHH-C6TftAzE.js +0 -1
  807. package/dist-embed/chunks/swimlanes-42K2YHIH-BQTDK2Ta.js +0 -1
  808. package/dist-embed/chunks/swimlanesDiagram-VR7AAH4N-BV8Vb5g2.js +0 -8
  809. /package/lib/chat/assistant/{avatar3d.js → avatar3dModel.js} +0 -0
  810. /package/lib/voice/{handsFree.js → handsFreeRules.js} +0 -0
@@ -1,19 +1,14 @@
1
- import{au as Sr,_ as bt}from"../datalayer-app-main.js";import{d as $g,P as k,Q as E,q as $,o as O,n as fe,r as Ve,s as yt,v as zl,w as Hl,x as Yl,y as jl,z as Xl,A as Ul,B as Dg,D as Ii,E as Gl,F as Pg,G as Rg,H as Vl,I as qg,J as Ng,K as Wg,L as Kl,M as Zl,N as zg,O as Hg,l as os,u as Ql}from"./index-MIxQaicl.js";import{z as Yg,A as jg,B as Xg,C as Ug,D as Gg,F as Ps,E as Vg,G as Kg,H as Zg,I as Ga}from"./fastdom-promised-BMVBoXkp.js";import{l as Qg}from"./line-DUjWPDRX.js";import{c as xi,a as Va,i as Ka}from"./_baseRest-BmxuuM4H.js";import{k as gr,f as He,u as Jg,r as tp}from"./forEach-hknrtmxV.js";import{f as bi,i as yr,v as Co}from"./isUndefined-wBqHC1Hw.js";const ui=20,ep={rect:"rectangle",circle:"ellipse"},ki={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:`${ui}px`},maxEdges:500,maxTextSize:5e4};class Fr{constructor({converter:t}){this.convert=(r,i)=>this.converter(r,{...i,fontSize:i.fontSize||ui}),this.converter=t}}var Pe;(function(e){e.ROUND="round",e.STADIUM="stadium",e.DOUBLECIRCLE="doublecircle",e.CIRCLE="circle",e.DIAMOND="diamond",e.CYLINDER="cylinder"})(Pe||(Pe={}));var Qt;(function(e){e.COLOR="color"})(Qt||(Qt={}));var At;(function(e){e.FILL="fill",e.STROKE="stroke",e.STROKE_WIDTH="stroke-width",e.STROKE_DASHARRAY="stroke-dasharray"})(At||(At={}));var zr={},Za;function rp(){if(Za)return zr;Za=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.removeMarkdown=void 0;var e=function(t,r){r===void 0&&(r={listUnicodeChar:""}),r=r||{},r.listUnicodeChar=r.hasOwnProperty("listUnicodeChar")?r.listUnicodeChar:!1,r.stripListLeaders=r.hasOwnProperty("stripListLeaders")?r.stripListLeaders:!0,r.gfm=r.hasOwnProperty("gfm")?r.gfm:!0,r.useImgAltText=r.hasOwnProperty("useImgAltText")?r.useImgAltText:!0,r.preserveLinks=r.hasOwnProperty("preserveLinks")?r.preserveLinks:!1;var i=t||"";i=i.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{r.stripListLeaders&&(r.listUnicodeChar?i=i.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,r.listUnicodeChar+" $1"):i=i.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),r.gfm&&(i=i.replace(/\n={2,}/g,`
2
- `).replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),r.preserveLinks&&(i=i.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),i=i.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,r.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,`
3
-
4
- `).replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,`
5
-
6
- `)}catch(o){return console.error(o),t}return i};return zr.removeMarkdown=e,zr}var ip=rp();const op={arrow_circle:{endArrowhead:"circle"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"circle",startArrowhead:"circle"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},sp=e=>op[e],xo=e=>{let t=e.text;return e.labelType==="markdown"&&(t=ip.removeMarkdown(e.text)),ap(t)},ap=e=>{const t=/\s?(fa|fab):[a-zA-Z0-9-]+/g;return e.replace(t,"")},ai=e=>{const t={};return Object.keys(e).forEach(r=>{switch(r){case At.FILL:{t.backgroundColor=e[r],t.fillStyle="solid";break}case At.STROKE:{t.strokeColor=e[r];break}case At.STROKE_WIDTH:{t.strokeWidth=Number(e[r]?.split("px")[0]);break}case At.STROKE_DASHARRAY:{t.strokeStyle="dashed";break}}}),t},ss=e=>{const t={};return Object.keys(e).forEach(r=>{r===Qt.COLOR&&(t.strokeColor=e[r])}),t},np=(e,t)=>[e,t],lp=32,Jl=.62,hp=12,cp=12,th=(e,t)=>Math.max(20,Math.ceil(e.length*t*Jl)),dp=(e,t,r,i)=>{const o=i||ui;if(e!==Pe.CYLINDER||!t||t.includes(`
7
- `))return o;const s=Math.max(20,r-hp);return th(t,o)<=s?o:Math.max(cp,Math.floor(s/(t.length*Jl)))},up=e=>{const t={};e.subGraphs.map(i=>{i.nodeIds.forEach(o=>{t[i.id]={id:i.id,parent:null,isLeaf:!1},t[o]={id:o,parent:i.id,isLeaf:e.vertices[o]!==void 0}})});const r={};return[...Object.keys(e.vertices),...e.subGraphs.map(i=>i.id)].forEach(i=>{if(!t[i])return;let o=t[i];const s=[];for(o.isLeaf||s.push(`subgraph_group_${o.id}`);o.parent;)s.push(`subgraph_group_${o.parent}`),o=t[o.parent];r[i]=s}),{getGroupIds:i=>r[i]||[],getParentId:i=>t[i]?t[i].parent:null}},gp=new Fr({converter:(e,t)=>{const r=[],i=t.fontSize,{getGroupIds:o,getParentId:s}=up(e);return e.subGraphs.reverse().forEach(a=>{const n=o(a.id),h=xo(a),d=th(h,i||16)+lp*2,u=Math.max(a.width,d),f=a.x-(u-a.width)/2,m=ai(a.containerStyle),y=ss(a.labelStyle),x={id:a.id,type:"rectangle",groupIds:n,x:f,y:a.y,width:u,height:a.height,label:{groupIds:n,text:h,fontSize:i,verticalAlign:"top",...y},...m};r.push(x)}),Object.values(e.vertices).forEach(a=>{if(!a)return;const n=o(a.id),h=xo(a),c=dp(a.type,h,a.width,i),l=ai(a.containerStyle),d=ss(a.labelStyle);let u={id:a.id,type:"rectangle",groupIds:n,x:a.x,y:a.y,width:a.width,height:a.height,strokeWidth:2,label:{groupIds:n,text:h,fontSize:c,...d},link:a.link||null,...l};switch(a.type){case Pe.STADIUM:{u={...u,roundness:{type:3}};break}case Pe.ROUND:{u={...u,roundness:{type:3}};break}case Pe.DOUBLECIRCLE:{n.push(`doublecircle_${a.id}}`);const m={type:"ellipse",groupIds:n,x:a.x+5,y:a.y+5,width:a.width-10,height:a.height-10,strokeWidth:2,roundness:{type:3},label:{groupIds:n,text:h,fontSize:c,...d}};u={...u,groupIds:n,type:"ellipse"},r.push(m);break}case Pe.CIRCLE:{u.type="ellipse";break}case Pe.DIAMOND:{u.type="diamond";break}}r.push(u)}),e.edges.forEach(a=>{let n=[];const h=s(a.start),c=s(a.end);h&&h===c&&(n=o(h));const{startX:l,startY:d,reflectionPoints:u}=a,f=u.map(T=>np(T.x-u[0].x,T.y-u[0].y)),m=sp(a.type||"arrow_point"),y=r.find(T=>T.id===a.start),x=r.find(T=>T.id===a.end);if(!y||!x)return;const b={id:`${a.start}_${a.end}`,type:"arrow",groupIds:n,x:l,y:d,strokeWidth:a.stroke==="thick"?4:2,strokeStyle:a.stroke==="dotted"?"dashed":void 0,points:f,...a.text?{label:{text:xo(a),fontSize:i,groupIds:n}}:{},roundness:{type:2},...m,start:{id:y.id||""},end:{id:x.id||""}};r.push(b)}),{elements:r}}});let se=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const pp=new Fr({converter:e=>{const t=se(),{width:r,height:i}=e,o={type:"image",x:0,y:0,width:r,height:i,status:"saved",fileId:t};return{files:{[t]:{id:t,mimeType:e.mimeType,dataURL:e.dataURL}},elements:[o]}}}),ei=(e,t)=>[e,t],Rs=e=>e.replace(/\\n/g,`
8
- `),Ke=e=>{const t={type:"line",x:e.startX,y:e.startY,points:[ei(0,0),ei(e.endX-e.startX,e.endY-e.startY)],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e.strokeStyle||"solid",strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},Ze=e=>{const t={type:"text",x:e.x,y:e.y,width:e.width,height:e.height,text:Rs(e.text)||"",fontSize:e.fontSize,verticalAlign:"top",strokeColor:e.color};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},br=e=>{const t={text:Rs(e?.label?.text||""),fontSize:e?.label?.fontSize,textAlign:e.label?.textAlign,verticalAlign:e.label?.verticalAlign||"middle",strokeColor:e.label?.color||"#000",...e.groupId?{groupIds:[e.groupId]}:{}};let r={};e.type==="rectangle"&&e.subtype==="activation"&&(r={backgroundColor:"#e9ecef",fillStyle:"solid"});const i={id:e.id,type:e.type,x:e.x,y:e.y,width:e.width,height:e.height,label:t,strokeStyle:e?.strokeStyle,strokeWidth:e?.strokeWidth,strokeColor:e?.strokeColor,backgroundColor:e?.bgColor,fillStyle:"solid",...r};return e.groupId&&Object.assign(i,{groupIds:[e.groupId]}),i},qs=e=>{const t={type:"arrow",x:e.startX,y:e.startY,points:e.points?.map(([r,i])=>ei(r,i))||[ei(0,0),ei(e.endX-e.startX,e.endY-e.startY)],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e?.strokeStyle||"solid",endArrowhead:e?.endArrowhead||null,startArrowhead:e?.startArrowhead||null,label:{text:Rs(e?.label?.text||""),fontSize:16,textAlign:e?.label?.textAlign,verticalAlign:e?.label?.verticalAlign},roundness:{type:2},start:e.start,end:e.end};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),t},Si=10,bo=16,fp=24,mp=4,yp=e=>{if(!e)return!0;const t=e.trim().toLowerCase();return t==="transparent"||t==="none"||t==="rgba(0,0,0,0)"||t==="rgba(0, 0, 0, 0)"},Cp=(e,t)=>Math.max(20,Math.round(e.length*t*.6)),Qa=(e,t,r=!0)=>{const i=e,o=i.groupIds??[];if(o.includes(t)||(i.groupIds=[...o,t]),!r||!i.label)return;const s=i.label.groupIds??[];s.includes(t)||(i.label.groupIds=[...s,t])},xp=new Fr({converter:e=>{const t=[],r=[];if(Object.values(e.nodes).forEach(i=>{!i||!i.length||i.forEach(o=>{let s;switch(o.type){case"line":s=Ke(o);break;case"rectangle":case"ellipse":s=br(o);break;case"text":s=Ze(o);break;default:throw`unknown type ${o.type}`}o.type==="rectangle"&&o?.subtype==="activation"?r.push(s):t.push(s)})}),Object.values(e.lines).forEach(i=>{i&&t.push(Ke(i))}),Object.values(e.arrows).forEach(i=>{i&&(t.push(qs(i)),i.sequenceNumber&&t.push(br(i.sequenceNumber)))}),t.push(...r),e.loops){const{lines:i,texts:o,nodes:s}=e.loops;i.forEach(a=>{t.push(Ke(a))}),o.forEach(a=>{t.push(Ze(a))}),s.forEach(a=>{t.push(br(a))})}return e.groups&&e.groups.forEach(i=>{const{actorKeys:o,name:s}=i;let a=1/0,n=1/0,h=0,c=0;if(!o.length)return;const l=t.filter(b=>{if(b.id){const T=b.id.indexOf("-"),w=b.id.substring(0,T);return o.includes(w)}return!1});if(!l.length||(l.forEach(b=>{b.x===void 0||b.y===void 0||b.width===void 0||b.height===void 0||(a=Math.min(a,b.x),n=Math.min(n,b.y),h=Math.max(h,b.x+b.width),c=Math.max(c,b.y+b.height))}),!Number.isFinite(a)||!Number.isFinite(n)||!Number.isFinite(h)||!Number.isFinite(c)))return;const d=a-Si,u=n-Si,f=h-a+Si*2,m=c-n+Si*2,y=se(),x=se(),C=br({type:"rectangle",x:d,y:u,width:f,height:m,bgColor:yp(i.fill)?void 0:i.fill,strokeColor:"#1f1f1f",strokeWidth:1,id:y,groupId:x});if(t.unshift(C),t.forEach(b=>{b.id!==y&&(b.x===void 0||b.y===void 0||b.width===void 0||b.height===void 0||b.x>=a&&b.x+b.width<=h&&b.y>=n&&b.y+b.height<=c&&Qa(b,x))}),s){const b=Ze({id:se(),text:s,x:d+mp,y:u-fp,width:Cp(s,bo),height:bo+8,fontSize:bo,color:"#1f1f1f",groupId:x});Qa(b,x,!1),t.push(b)}}),{elements:t}}}),bp=new Fr({converter:e=>{const t=[];return e.nodes.forEach(r=>{!r||!r.length||r.forEach(i=>{let o;switch(i.type){case"line":o=Ke(i);break;case"rectangle":case"ellipse":o=br(i);break;case"text":o=Ze(i);break;default:throw`unknown type ${i.type}`}t.push(o)})}),Object.values(e.lines).forEach(r=>{r&&t.push(Ke(r))}),Object.values(e.arrows).forEach(r=>{if(!r)return;const i=qs(r);t.push(i)}),Object.values(e.text).forEach(r=>{const i=Ze(r);t.push(i)}),Object.values(e.namespaces).forEach(r=>{const i=Object.keys(r.classes),o=[...i],s=[...e.lines,...e.arrows,...e.text];i.forEach(n=>{const h=s.filter(c=>c.metadata&&c.metadata.classId===n).map(c=>c.id);h.length&&o.push(...h)});const a={type:"frame",id:se(),name:r.id,children:o};t.push(a)}),{elements:t}}}),kp=new Fr({converter:e=>{const t=[];return e.nodes.forEach(r=>{!r||!r.length||r.forEach(i=>{let o;switch(i.type){case"line":o=Ke(i);break;case"rectangle":case"ellipse":o=br(i);break;case"text":o=Ze(i);break;default:throw`unknown type ${i.type}`}t.push(o)})}),e.lines.forEach(r=>{t.push(Ke(r))}),e.arrows.forEach(r=>{t.push(qs(r))}),e.text.forEach(r=>{t.push(Ze(r))}),{elements:t}}}),qi=(e,t)=>[e,t],Vr=16,eh=14,Sp=1,as="#000000",rh=5,Tp=rh*2,wp=rh*2,Bp=1.25,ih=new Set(["choice","fork","join","stateStart","stateEnd","divider"]),ns=e=>e.shape==="stateEnd"?[`state_end_group_${e.id}`]:void 0,oh=e=>e.shape==="rectWithTitle"&&e.description.length?[e.text,...e.description].join(`
9
- `):e.text;let Ye;const vp=()=>{if(Ye!==void 0)return Ye;if(typeof document>"u")return Ye=null,Ye;try{Ye=document.createElement("canvas").getContext("2d")}catch{Ye=null}return Ye},Tr=(e,t)=>{const r=vp();return r?(r.font=`${t}px Excalifont, sans-serif`,r.measureText(e).width):e.length*t*.6},Lp=(e,t,r)=>{if(Tr(e,t)<=r)return[e];const i=[];let o="";for(const s of e){const a=`${o}${s}`;if(o&&Tr(a,t)>r){i.push(o),o=s;continue}o=a}return o&&i.push(o),i},Fp=(e,t,r)=>{if(!e.trim()||Tr(e,t)<=r)return e;const i=e.split(/\s+/).filter(Boolean),o=[];let s="";for(const a of i){const n=Lp(a,t,r);for(const[h,c]of n.entries()){const d=s?`${s}${s&&h===0?" ":""}${c}`:c;if(Tr(d,t)<=r){s=d;continue}s&&o.push(s),s=c}n.length>1}return o.push(s),o.join(`
10
- `)},Ep=(e,t,r)=>{const o=e.map(n=>Fp(n,t,r)).join(`
1
+ import{d as Ig}from"./index-CJys1M3A.js";import{au as Sr,_ as bt}from"../datalayer-app-main.js";import{d as Og,P as k,Q as E,q as $,o as O,n as fe,r as Ve,s as yt,v as Nl,w as Wl,x as zl,y as Hl,z as Yl,A as jl,B as $g,D as Mi,E as Xl,F as Dg,G as Pg,H as Ul,I as Rg,J as qg,K as Ng,L as Gl,M as Vl,N as Wg,O as zg,l as is,u as Kl}from"./index-MIxQaicl.js";import{z as Hg,A as Yg,B as jg,C as Xg,D as Ug,F as Ds,E as Gg,G as Vg,H as Kg,I as Ua}from"./fastdom-promised-BMVBoXkp.js";import{l as Zg}from"./line-DUjWPDRX.js";import{c as Ci,a as Ga,i as Va}from"./_baseRest-BmxuuM4H.js";import{k as gr,f as He,u as Qg,r as Jg}from"./forEach-hknrtmxV.js";import{f as xi,i as yr,v as yo}from"./isUndefined-wBqHC1Hw.js";const di=20,tp={rect:"rectangle",circle:"ellipse"},bi={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:`${di}px`},maxEdges:500,maxTextSize:5e4};class Fr{constructor({converter:t}){this.convert=(r,i)=>this.converter(r,{...i,fontSize:i.fontSize||di}),this.converter=t}}var Pe;(function(e){e.ROUND="round",e.STADIUM="stadium",e.DOUBLECIRCLE="doublecircle",e.CIRCLE="circle",e.DIAMOND="diamond",e.CYLINDER="cylinder"})(Pe||(Pe={}));var Qt;(function(e){e.COLOR="color"})(Qt||(Qt={}));var At;(function(e){e.FILL="fill",e.STROKE="stroke",e.STROKE_WIDTH="stroke-width",e.STROKE_DASHARRAY="stroke-dasharray"})(At||(At={}));const ep={arrow_circle:{endArrowhead:"circle"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"circle",startArrowhead:"circle"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},rp=e=>ep[e],Co=e=>{let t=e.text;return e.labelType==="markdown"&&(t=Ig.removeMarkdown(e.text)),ip(t)},ip=e=>{const t=/\s?(fa|fab):[a-zA-Z0-9-]+/g;return e.replace(t,"")},si=e=>{const t={};return Object.keys(e).forEach(r=>{switch(r){case At.FILL:{t.backgroundColor=e[r],t.fillStyle="solid";break}case At.STROKE:{t.strokeColor=e[r];break}case At.STROKE_WIDTH:{t.strokeWidth=Number(e[r]?.split("px")[0]);break}case At.STROKE_DASHARRAY:{t.strokeStyle="dashed";break}}}),t},os=e=>{const t={};return Object.keys(e).forEach(r=>{r===Qt.COLOR&&(t.strokeColor=e[r])}),t},op=(e,t)=>[e,t],sp=32,Zl=.62,ap=12,np=12,Ql=(e,t)=>Math.max(20,Math.ceil(e.length*t*Zl)),lp=(e,t,r,i)=>{const o=i||di;if(e!==Pe.CYLINDER||!t||t.includes(`
2
+ `))return o;const s=Math.max(20,r-ap);return Ql(t,o)<=s?o:Math.max(np,Math.floor(s/(t.length*Zl)))},hp=e=>{const t={};e.subGraphs.map(i=>{i.nodeIds.forEach(o=>{t[i.id]={id:i.id,parent:null,isLeaf:!1},t[o]={id:o,parent:i.id,isLeaf:e.vertices[o]!==void 0}})});const r={};return[...Object.keys(e.vertices),...e.subGraphs.map(i=>i.id)].forEach(i=>{if(!t[i])return;let o=t[i];const s=[];for(o.isLeaf||s.push(`subgraph_group_${o.id}`);o.parent;)s.push(`subgraph_group_${o.parent}`),o=t[o.parent];r[i]=s}),{getGroupIds:i=>r[i]||[],getParentId:i=>t[i]?t[i].parent:null}},cp=new Fr({converter:(e,t)=>{const r=[],i=t.fontSize,{getGroupIds:o,getParentId:s}=hp(e);return e.subGraphs.reverse().forEach(a=>{const n=o(a.id),h=Co(a),d=Ql(h,i||16)+sp*2,u=Math.max(a.width,d),f=a.x-(u-a.width)/2,m=si(a.containerStyle),y=os(a.labelStyle),x={id:a.id,type:"rectangle",groupIds:n,x:f,y:a.y,width:u,height:a.height,label:{groupIds:n,text:h,fontSize:i,verticalAlign:"top",...y},...m};r.push(x)}),Object.values(e.vertices).forEach(a=>{if(!a)return;const n=o(a.id),h=Co(a),c=lp(a.type,h,a.width,i),l=si(a.containerStyle),d=os(a.labelStyle);let u={id:a.id,type:"rectangle",groupIds:n,x:a.x,y:a.y,width:a.width,height:a.height,strokeWidth:2,label:{groupIds:n,text:h,fontSize:c,...d},link:a.link||null,...l};switch(a.type){case Pe.STADIUM:{u={...u,roundness:{type:3}};break}case Pe.ROUND:{u={...u,roundness:{type:3}};break}case Pe.DOUBLECIRCLE:{n.push(`doublecircle_${a.id}}`);const m={type:"ellipse",groupIds:n,x:a.x+5,y:a.y+5,width:a.width-10,height:a.height-10,strokeWidth:2,roundness:{type:3},label:{groupIds:n,text:h,fontSize:c,...d}};u={...u,groupIds:n,type:"ellipse"},r.push(m);break}case Pe.CIRCLE:{u.type="ellipse";break}case Pe.DIAMOND:{u.type="diamond";break}}r.push(u)}),e.edges.forEach(a=>{let n=[];const h=s(a.start),c=s(a.end);h&&h===c&&(n=o(h));const{startX:l,startY:d,reflectionPoints:u}=a,f=u.map(T=>op(T.x-u[0].x,T.y-u[0].y)),m=rp(a.type||"arrow_point"),y=r.find(T=>T.id===a.start),x=r.find(T=>T.id===a.end);if(!y||!x)return;const b={id:`${a.start}_${a.end}`,type:"arrow",groupIds:n,x:l,y:d,strokeWidth:a.stroke==="thick"?4:2,strokeStyle:a.stroke==="dotted"?"dashed":void 0,points:f,...a.text?{label:{text:Co(a),fontSize:i,groupIds:n}}:{},roundness:{type:2},...m,start:{id:y.id||""},end:{id:x.id||""}};r.push(b)}),{elements:r}}});let se=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const dp=new Fr({converter:e=>{const t=se(),{width:r,height:i}=e,o={type:"image",x:0,y:0,width:r,height:i,status:"saved",fileId:t};return{files:{[t]:{id:t,mimeType:e.mimeType,dataURL:e.dataURL}},elements:[o]}}}),ti=(e,t)=>[e,t],Ps=e=>e.replace(/\\n/g,`
3
+ `),Ke=e=>{const t={type:"line",x:e.startX,y:e.startY,points:[ti(0,0),ti(e.endX-e.startX,e.endY-e.startY)],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e.strokeStyle||"solid",strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},Ze=e=>{const t={type:"text",x:e.x,y:e.y,width:e.width,height:e.height,text:Ps(e.text)||"",fontSize:e.fontSize,verticalAlign:"top",strokeColor:e.color};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),e.id&&Object.assign(t,{id:e.id}),t},br=e=>{const t={text:Ps(e?.label?.text||""),fontSize:e?.label?.fontSize,textAlign:e.label?.textAlign,verticalAlign:e.label?.verticalAlign||"middle",strokeColor:e.label?.color||"#000",...e.groupId?{groupIds:[e.groupId]}:{}};let r={};e.type==="rectangle"&&e.subtype==="activation"&&(r={backgroundColor:"#e9ecef",fillStyle:"solid"});const i={id:e.id,type:e.type,x:e.x,y:e.y,width:e.width,height:e.height,label:t,strokeStyle:e?.strokeStyle,strokeWidth:e?.strokeWidth,strokeColor:e?.strokeColor,backgroundColor:e?.bgColor,fillStyle:"solid",...r};return e.groupId&&Object.assign(i,{groupIds:[e.groupId]}),i},Rs=e=>{const t={type:"arrow",x:e.startX,y:e.startY,points:e.points?.map(([r,i])=>ti(r,i))||[ti(0,0),ti(e.endX-e.startX,e.endY-e.startY)],width:e.endX-e.startX,height:e.endY-e.startY,strokeStyle:e?.strokeStyle||"solid",endArrowhead:e?.endArrowhead||null,startArrowhead:e?.startArrowhead||null,label:{text:Ps(e?.label?.text||""),fontSize:16,textAlign:e?.label?.textAlign,verticalAlign:e?.label?.verticalAlign},roundness:{type:2},start:e.start,end:e.end};return e.groupId&&Object.assign(t,{groupIds:[e.groupId]}),t},ki=10,xo=16,up=24,gp=4,pp=e=>{if(!e)return!0;const t=e.trim().toLowerCase();return t==="transparent"||t==="none"||t==="rgba(0,0,0,0)"||t==="rgba(0, 0, 0, 0)"},fp=(e,t)=>Math.max(20,Math.round(e.length*t*.6)),Ka=(e,t,r=!0)=>{const i=e,o=i.groupIds??[];if(o.includes(t)||(i.groupIds=[...o,t]),!r||!i.label)return;const s=i.label.groupIds??[];s.includes(t)||(i.label.groupIds=[...s,t])},mp=new Fr({converter:e=>{const t=[],r=[];if(Object.values(e.nodes).forEach(i=>{!i||!i.length||i.forEach(o=>{let s;switch(o.type){case"line":s=Ke(o);break;case"rectangle":case"ellipse":s=br(o);break;case"text":s=Ze(o);break;default:throw`unknown type ${o.type}`}o.type==="rectangle"&&o?.subtype==="activation"?r.push(s):t.push(s)})}),Object.values(e.lines).forEach(i=>{i&&t.push(Ke(i))}),Object.values(e.arrows).forEach(i=>{i&&(t.push(Rs(i)),i.sequenceNumber&&t.push(br(i.sequenceNumber)))}),t.push(...r),e.loops){const{lines:i,texts:o,nodes:s}=e.loops;i.forEach(a=>{t.push(Ke(a))}),o.forEach(a=>{t.push(Ze(a))}),s.forEach(a=>{t.push(br(a))})}return e.groups&&e.groups.forEach(i=>{const{actorKeys:o,name:s}=i;let a=1/0,n=1/0,h=0,c=0;if(!o.length)return;const l=t.filter(b=>{if(b.id){const T=b.id.indexOf("-"),w=b.id.substring(0,T);return o.includes(w)}return!1});if(!l.length||(l.forEach(b=>{b.x===void 0||b.y===void 0||b.width===void 0||b.height===void 0||(a=Math.min(a,b.x),n=Math.min(n,b.y),h=Math.max(h,b.x+b.width),c=Math.max(c,b.y+b.height))}),!Number.isFinite(a)||!Number.isFinite(n)||!Number.isFinite(h)||!Number.isFinite(c)))return;const d=a-ki,u=n-ki,f=h-a+ki*2,m=c-n+ki*2,y=se(),x=se(),C=br({type:"rectangle",x:d,y:u,width:f,height:m,bgColor:pp(i.fill)?void 0:i.fill,strokeColor:"#1f1f1f",strokeWidth:1,id:y,groupId:x});if(t.unshift(C),t.forEach(b=>{b.id!==y&&(b.x===void 0||b.y===void 0||b.width===void 0||b.height===void 0||b.x>=a&&b.x+b.width<=h&&b.y>=n&&b.y+b.height<=c&&Ka(b,x))}),s){const b=Ze({id:se(),text:s,x:d+gp,y:u-up,width:fp(s,xo),height:xo+8,fontSize:xo,color:"#1f1f1f",groupId:x});Ka(b,x,!1),t.push(b)}}),{elements:t}}}),yp=new Fr({converter:e=>{const t=[];return e.nodes.forEach(r=>{!r||!r.length||r.forEach(i=>{let o;switch(i.type){case"line":o=Ke(i);break;case"rectangle":case"ellipse":o=br(i);break;case"text":o=Ze(i);break;default:throw`unknown type ${i.type}`}t.push(o)})}),Object.values(e.lines).forEach(r=>{r&&t.push(Ke(r))}),Object.values(e.arrows).forEach(r=>{if(!r)return;const i=Rs(r);t.push(i)}),Object.values(e.text).forEach(r=>{const i=Ze(r);t.push(i)}),Object.values(e.namespaces).forEach(r=>{const i=Object.keys(r.classes),o=[...i],s=[...e.lines,...e.arrows,...e.text];i.forEach(n=>{const h=s.filter(c=>c.metadata&&c.metadata.classId===n).map(c=>c.id);h.length&&o.push(...h)});const a={type:"frame",id:se(),name:r.id,children:o};t.push(a)}),{elements:t}}}),Cp=new Fr({converter:e=>{const t=[];return e.nodes.forEach(r=>{!r||!r.length||r.forEach(i=>{let o;switch(i.type){case"line":o=Ke(i);break;case"rectangle":case"ellipse":o=br(i);break;case"text":o=Ze(i);break;default:throw`unknown type ${i.type}`}t.push(o)})}),e.lines.forEach(r=>{t.push(Ke(r))}),e.arrows.forEach(r=>{t.push(Rs(r))}),e.text.forEach(r=>{t.push(Ze(r))}),{elements:t}}}),Ri=(e,t)=>[e,t],Gr=16,Jl=14,xp=1,ss="#000000",th=5,bp=th*2,kp=th*2,Sp=1.25,eh=new Set(["choice","fork","join","stateStart","stateEnd","divider"]),as=e=>e.shape==="stateEnd"?[`state_end_group_${e.id}`]:void 0,rh=e=>e.shape==="rectWithTitle"&&e.description.length?[e.text,...e.description].join(`
4
+ `):e.text;let Ye;const Tp=()=>{if(Ye!==void 0)return Ye;if(typeof document>"u")return Ye=null,Ye;try{Ye=document.createElement("canvas").getContext("2d")}catch{Ye=null}return Ye},Tr=(e,t)=>{const r=Tp();return r?(r.font=`${t}px Excalifont, sans-serif`,r.measureText(e).width):e.length*t*.6},wp=(e,t,r)=>{if(Tr(e,t)<=r)return[e];const i=[];let o="";for(const s of e){const a=`${o}${s}`;if(o&&Tr(a,t)>r){i.push(o),o=s;continue}o=a}return o&&i.push(o),i},Bp=(e,t,r)=>{if(!e.trim()||Tr(e,t)<=r)return e;const i=e.split(/\s+/).filter(Boolean),o=[];let s="";for(const a of i){const n=wp(a,t,r);for(const[h,c]of n.entries()){const d=s?`${s}${s&&h===0?" ":""}${c}`:c;if(Tr(d,t)<=r){s=d;continue}s&&o.push(s),s=c}n.length>1}return o.push(s),o.join(`
5
+ `)},vp=(e,t,r)=>{const o=e.map(n=>Bp(n,t,r)).join(`
11
6
  `).split(`
12
- `),s=Math.max(...o.map(n=>Tr(n,t))),a=o.length*t*Bp;return{width:s,height:a}},Ap=(e,t,r,i)=>{const o=e.split(`
13
- `);for(let s=Vr;s>=eh;s-=Sp){const{height:a}=Ep(o,s,t);if(a<=r)return s}return i},_p=e=>{const t=oh(e);if(!t||ih.has(e.shape))return Vr;const r=Math.max(1,e.width-Tp),i=Math.max(1,e.height-wp),o=t.split(`
14
- `);return o.length>1&&Math.max(...o.map(a=>Tr(a,Vr)))<=r?Vr:Ap(t,r,i,o.length===1?Vr:eh)},Mp=e=>{if(ih.has(e.shape))return;const t=oh(e);if(t)return{text:t,fontSize:_p(e),verticalAlign:e.shape==="rectWithTitle"||e.shape==="roundedWithTitle"?"top":"middle",...ss(e.labelStyle)}},Ip=e=>{const t=ai(e.containerStyle),r=Mp(e),i=e.shape==="choice"?"diamond":e.shape==="stateStart"||e.shape==="stateEnd"?"ellipse":"rectangle",o=e.shape==="rect"||e.shape==="rectWithTitle"||e.shape==="roundedWithTitle",s=e.shape==="stateStart"||e.shape==="fork"||e.shape==="join",a=t.backgroundColor||t.strokeColor||as,n=t.strokeColor||t.backgroundColor||as;return{id:e.id,type:i,...ns(e)?{groupIds:ns(e)}:{},x:e.x,y:e.y,width:e.width,height:e.height,...r?{label:r}:{},...t,...o?{roundness:{type:3}}:{},...s?{backgroundColor:a,strokeColor:n,fillStyle:"solid"}:{}}},Op=e=>{if(!e.dividerLine)return null;const t=ai(e.containerStyle);return{id:`${e.id}__divider`,type:"line",x:e.dividerLine.startX,y:e.dividerLine.startY,width:e.dividerLine.endX-e.dividerLine.startX,height:e.dividerLine.endY-e.dividerLine.startY,points:[qi(0,0),qi(e.dividerLine.endX-e.dividerLine.startX,e.dividerLine.endY-e.dividerLine.startY)],strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||1}},$p=e=>{const t=ai(e.containerStyle),r=Math.max(2,Math.min(e.width,e.height)*.32),i=e.endInnerColor||t.strokeColor||t.backgroundColor||as;return{id:`${e.id}__inner`,type:"ellipse",groupIds:ns(e),x:e.x+r,y:e.y+r,width:Math.max(1,e.width-r*2),height:Math.max(1,e.height-r*2),backgroundColor:i,strokeColor:i,fillStyle:"solid",strokeWidth:1}},Dp=e=>{const t=e.reflectionPoints.map((r,i,o)=>{const s=o[0];return i===0?qi(0,0):qi(r.x-s.x,r.y-s.y)});return{id:e.id,type:"arrow",x:e.startX,y:e.startY,width:e.endX-e.startX,height:e.endY-e.startY,points:t,strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||2,strokeStyle:e.strokeStyle||"solid",endArrowhead:e.isNoteEdge?null:"triangle",roundness:{type:2},start:{id:e.start},end:{id:e.end},...e.text?{label:{text:e.text,fontSize:16}}:{}}},Pp=new Fr({converter:e=>{const t=[];return e.nodes.forEach(r=>{if(!r.isRenderable)return;const i=Ip(r);t.push(i);const o=Op(r);o&&t.push(o),r.shape==="stateEnd"&&t.push($p(r))}),e.edges.forEach(r=>{t.push(Dp(r))}),{elements:t}}}),re=e=>{e=qp(e);const t=e.replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),r=document.createElement("textarea");return r.innerHTML=t,r.value},Qe=e=>{const r=e.getAttribute("transform")?.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let i=0,o=0;return r&&(i=Number(r[1]),o=Number(r[2])),{transformX:i,transformY:o}},Rp=e=>{let t=e;return t=t.replace(/style.*:\S*#.*;/g,r=>r.substring(0,r.length-1)),t=t.replace(/classDef.*:\S*#.*;/g,r=>r.substring(0,r.length-1)),t=t.replace(/#\w+;/g,r=>{const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?`fl°°${i}¶ß`:`fl°${i}¶ß`}),t},qp=function(e){return e.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},Np=.5,Ns=(e,t=Np)=>{const r=[];return e.forEach(i=>{const o=r[r.length-1];if(!o){r.push(i);return}Math.hypot(i[0]-o[0],i[1]-o[1])<=t||r.push(i)}),r},Ws=e=>{const t=e.getAttribute("d");if(!t)return null;const r=Array.from(t.matchAll(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi),i=>Number(i[0]));return r.length<4?null:{startX:r[0],startY:r[1],endX:r[r.length-2],endY:r[r.length-1]}},sh=e=>{const t=e.getAttribute("data-points");if(!t){const r=Ws(e);return r?[{x:r.startX,y:r.startY},{x:r.endX,y:r.endY}]:[]}try{const r=atob(t),i=JSON.parse(r);return Array.isArray(i)?i.filter(o=>o&&typeof o.x=="number"&&typeof o.y=="number"&&Number.isFinite(o.x)&&Number.isFinite(o.y)):[]}catch{return[]}},ah=(e,t={x:0,y:0},r="LM")=>{if(e.tagName.toLowerCase()!=="path")throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${e.tagName}`);const i=e.getAttribute("d");if(!i)throw new Error('Path element does not contain a "d" attribute');const o=i.split(new RegExp(`(?=[${r}])`)),s=o[0].substring(1).split(",").map(h=>parseFloat(h)),a=o[o.length-1].substring(1).split(",").map(h=>parseFloat(h)),n=o.map(h=>{const c=h[0],l=h.substring(1).split(",").map(d=>parseFloat(d));return c==="C"?{x:l[4],y:l[5],command:c}:{x:l[0],y:l[1],command:c}}).filter((h,c,l)=>{if(c===0||c===l.length-1)return!0;if(h.x===l[c-1].x&&h.y===l[c-1].y||c===l.length-2&&h.command==="C")return!1;if(c===l.length-2&&(l[c-1].x===h.x||l[c-1].y===h.y)){const d=l[l.length-1];return Math.hypot(d.x-h.x,d.y-h.y)>20}return h.x!==l[c-1].x||h.y!==l[c-1].y}).map(h=>({x:h.x+t.x,y:h.y+t.y}));return{startX:s[0]+t.x,startY:s[1]+t.y,endX:a[0]+t.x,endY:a[1]+t.y,reflectionPoints:n}},Wp=e=>({...e,elements:e.elements.map(t=>{if(!("points"in t)||!Array.isArray(t.points))return t;const r=t.points;if(r.length<2)return t;const i=Ns(r);return i.length===r.length?t:{...t,points:i}})}),zp=(e,t={})=>{const r=(()=>{switch(e.type){case"graphImage":return pp.convert(e,t);case"flowchart":return gp.convert(e,t);case"sequence":return xp.convert(e,t);case"class":return bp.convert(e,t);case"erd":return kp.convert(e,t);case"state":return Pp.convert(e,t);default:throw new Error(`graphToExcalidraw: unknown graph type "${e.type}, only flowcharts are supported!"`)}})();return Wp(r)};var nh=Object.defineProperty,g=(e,t)=>nh(e,"name",{value:t,configurable:!0}),Hp=(e,t)=>{for(var r in t)nh(e,r,{get:t[r],enumerable:!0})},Ee={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},M={trace:g((...e)=>{},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},zs=g(function(e="fatal"){let t=Ee.fatal;typeof e=="string"?e.toLowerCase()in Ee&&(t=Ee[e]):typeof e=="number"&&(t=e),M.trace=()=>{},M.debug=()=>{},M.info=()=>{},M.warn=()=>{},M.error=()=>{},M.fatal=()=>{},t<=Ee.fatal&&(M.fatal=console.error?console.error.bind(console,oe("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",oe("FATAL"))),t<=Ee.error&&(M.error=console.error?console.error.bind(console,oe("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",oe("ERROR"))),t<=Ee.warn&&(M.warn=console.warn?console.warn.bind(console,oe("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",oe("WARN"))),t<=Ee.info&&(M.info=console.info?console.info.bind(console,oe("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",oe("INFO"))),t<=Ee.debug&&(M.debug=console.debug?console.debug.bind(console,oe("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",oe("DEBUG"))),t<=Ee.trace&&(M.trace=console.debug?console.debug.bind(console,oe("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",oe("TRACE")))},"setLogLevel"),oe=g(e=>`%c${$g().format("ss.SSS")} : ${e} : `,"format"),ls=g((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>ls(e,o,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(o=>{e.includes(o)||e.push(o)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const o=e;Object.entries(t).forEach(([s,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,s)||Object.defineProperty(e,s,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[s]===void 0&&(o[s]=Array.isArray(a)?[]:{}),typeof o[s]=="object"&&(o[s]=ls(o[s],a,{depth:r-1}))}else typeof o[s]!="object"&&(Object.hasOwn(e,s)?o[s]=a:Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ht=ls,we="#ffffff",Be="#f2f2f2",ft=g((e,t)=>t?k(e,{s:-40,l:10}):k(e,{s:-40,l:-10}),"mkBorder"),Yp=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||$(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||$(this.mainBkg,10)):(this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??k(this.primaryColor,{l:-30}),this.venn2=this.venn2??k(this.secondaryColor,{l:-30}),this.venn3=this.venn3??k(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??k(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??k(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??k(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??k(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??k(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},jp=g(e=>{const t=new Yp;return t.calculate(e),t},"getThemeVariables"),Xp=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=$("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=$(this.sectionBkgColor,10),this.taskBorderColor=Ve(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ve(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||O(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||$(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=O(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=O(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=O(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=E(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||E(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScalePeer"+e]=this["cScalePeer"+e]||O(this["cScale"+e],10);for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{h:30,s:-30,l:-(-10+e*4)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{h:30,s:-30,l:-(-7+e*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["pie"+e]=this["cScale"+e];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let e=0;e<8;e++)this["venn"+(e+1)]=this["venn"+(e+1)]??O(this["cScale"+e],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=O(this.secondaryColor,20),this.git1=O(this.pie2||this.secondaryColor,20),this.git2=O(this.pie3||this.tertiaryColor,20),this.git3=O(this.pie4||k(this.primaryColor,{h:-30}),20),this.git4=O(this.pie5||k(this.primaryColor,{h:-60}),20),this.git5=O(this.pie6||k(this.primaryColor,{h:-90}),10),this.git6=O(this.pie7||k(this.primaryColor,{h:60}),10),this.git7=O(this.pie8||k(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||E(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||E(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||O("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||O("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||O("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||O("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||O(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||O(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||O(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||O(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Up=g(e=>{const t=new Xp;return t.calculate(e),t},"getThemeVariables"),Gp=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=k(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ve(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||$(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||$(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=$(this["cScale"+e],10),this["cScalePeer"+e]=this["cScalePeer"+e]||$(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||k(this["cScale"+e],{h:180});for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{h:30,l:-(5+e*5)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{h:30,l:-(7+e*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||E(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||E(this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||O(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||O(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||k(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-30}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||k(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??k(this.primaryColor,{l:-30}),this.venn2=this.venn2??k(this.secondaryColor,{l:-30}),this.venn3=this.venn3??k(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??k(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??k(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??k(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??k(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??k(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||$(E(this.git0),25),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||E(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||E(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(Object.keys(this).forEach(r=>{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Vp=g(e=>{const t=new Gp;return t.calculate(e),t},"getThemeVariables"),Kp=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=O("#cde498",10),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.primaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=$(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||$(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||$(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=$(this["cScale"+e],10),this["cScalePeer"+e]=this["cScalePeer"+e]||$(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||k(this["cScale"+e],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{h:30,s:-30,l:-(5+e*5)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{h:30,s:-30,l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-30}),this.pie5=this.pie5||k(this.secondaryColor,{l:-30}),this.pie6=this.pie6||k(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??k(this.primaryColor,{l:-30}),this.venn2=this.venn2??k(this.secondaryColor,{l:-30}),this.venn3=this.venn3??k(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??k(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??k(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??k(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??k(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??k(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||E(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||E(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Zp=g(e=>{const t=new Kp;return t.calculate(e),t},"getThemeVariables"),Qp=class{static{g(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=O(this.contrast,55),this.background="#ffffff",this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=O(this.contrast,55),this.border2=this.contrast,this.actorBorder=O(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||E(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||O(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||$(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{l:-(5+e*5)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=O(this.contrast,30),this.sectionBkgColor2=O(this.contrast,30),this.taskBorderColor=$(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=O(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=$(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["pie"+e]=this["cScale"+e];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let e=0;e<8;e++)this["venn"+(e+1)]=this["venn"+(e+1)]??this["cScale"+e];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=$(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||k(this.primaryColor,{h:-30}),this.git4=this.pie5||k(this.primaryColor,{h:-60}),this.git5=this.pie6||k(this.primaryColor,{h:-90}),this.git6=this.pie7||k(this.primaryColor,{h:60}),this.git7=this.pie8||k(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Jp=g(e=>{const t=new Qp;return t.calculate(e),t},"getThemeVariables"),tf=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=k(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||k(e,{h:30}),this.cScale4=this.cScale4||k(e,{h:60}),this.cScale5=this.cScale5||k(e,{h:90}),this.cScale6=this.cScale6||k(e,{h:120}),this.cScale7=this.cScale7||k(e,{h:150}),this.cScale8=this.cScale8||k(e,{h:210,l:150}),this.cScale9=this.cScale9||k(e,{h:270}),this.cScale10=this.cScale10||k(e,{h:300}),this.cScale11=this.cScale11||k(e,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||E(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||O(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||$(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||k(e,{h:64}),this.fillType3=this.fillType3||k(t,{h:64}),this.fillType4=this.fillType4||k(e,{h:-64}),this.fillType5=this.fillType5||k(t,{h:-64}),this.fillType6=this.fillType6||k(e,{h:128}),this.fillType7=this.fillType7||k(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||r,this.pie4=this.pie4||k(e,{l:-10}),this.pie5=this.pie5||k(t,{l:-10}),this.pie6=this.pie6||k(r,{l:-10}),this.pie7=this.pie7||k(e,{h:60,l:-10}),this.pie8=this.pie8||k(e,{h:-60,l:-10}),this.pie9=this.pie9||k(e,{h:120,l:0}),this.pie10=this.pie10||k(e,{h:60,l:-20}),this.pie11=this.pie11||k(e,{h:-60,l:-20}),this.pie12=this.pie12||k(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||k(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||r,this.git3=this.git3||k(e,{h:-30}),this.git4=this.git4||k(e,{h:-60}),this.git5=this.git5||k(e,{h:-90}),this.git6=this.git6||k(e,{h:60}),this.git7=this.git7||k(e,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},ef=g(e=>{const t=new tf;return t.calculate(e),t},"getThemeVariables"),rf=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor=E(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},of=g(e=>{const t=new rf;return t.calculate(e),t},"getThemeVariables"),sf=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ft("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=k(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||E(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||O(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||$(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||k(e,{h:64}),this.fillType3=this.fillType3||k(t,{h:64}),this.fillType4=this.fillType4||k(e,{h:-64}),this.fillType5=this.fillType5||k(t,{h:-64}),this.fillType6=this.fillType6||k(e,{h:128}),this.fillType7=this.fillType7||k(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||r,this.pie4=this.pie4||k(e,{l:-10}),this.pie5=this.pie5||k(t,{l:-10}),this.pie6=this.pie6||k(r,{l:-10}),this.pie7=this.pie7||k(e,{h:60,l:-10}),this.pie8=this.pie8||k(e,{h:-60,l:-10}),this.pie9=this.pie9||k(e,{h:120,l:0}),this.pie10=this.pie10||k(e,{h:60,l:-20}),this.pie11=this.pie11||k(e,{h:-60,l:-20}),this.pie12=this.pie12||k(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||k(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||r,this.git3=this.git3||k(e,{h:-30}),this.git4=this.git4||k(e,{h:-60}),this.git5=this.git5||k(e,{h:-90}),this.git6=this.git6||k(e,{h:60}),this.git7=this.git7||k(e,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},af=g(e=>{const t=new sf;return t.calculate(e),t},"getThemeVariables"),nf=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor=E(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},lf=g(e=>{const t=new nf;return t.calculate(e),t},"getThemeVariables"),hf=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=k(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||E(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||O(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||$(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||k(e,{h:64}),this.fillType3=this.fillType3||k(t,{h:64}),this.fillType4=this.fillType4||k(e,{h:-64}),this.fillType5=this.fillType5||k(t,{h:-64}),this.fillType6=this.fillType6||k(e,{h:128}),this.fillType7=this.fillType7||k(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||r,this.pie4=this.pie4||k(e,{l:-10}),this.pie5=this.pie5||k(t,{l:-10}),this.pie6=this.pie6||k(r,{l:-10}),this.pie7=this.pie7||k(e,{h:60,l:-10}),this.pie8=this.pie8||k(e,{h:-60,l:-10}),this.pie9=this.pie9||k(e,{h:120,l:0}),this.pie10=this.pie10||k(e,{h:60,l:-20}),this.pie11=this.pie11||k(e,{h:-60,l:-20}),this.pie12=this.pie12||k(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||k(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||r,this.git3=this.git3||k(e,{h:-30}),this.git4=this.git4||k(e,{h:-60}),this.git5=this.git5||k(e,{h:-90}),this.git6=this.git6||k(e,{h:60}),this.git7=this.git7||k(e,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},cf=g(e=>{const t=new hf;return t.calculate(e),t},"getThemeVariables"),df=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor=E(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=$(this["cScale"+t],75);const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},uf=g(e=>{const t=new df;return t.calculate(e),t},"getThemeVariables"),Me={base:{getThemeVariables:jp},dark:{getThemeVariables:Up},default:{getThemeVariables:Vp},forest:{getThemeVariables:Zp},neutral:{getThemeVariables:Jp},neo:{getThemeVariables:ef},"neo-dark":{getThemeVariables:of},redux:{getThemeVariables:af},"redux-dark":{getThemeVariables:lf},"redux-color":{getThemeVariables:cf},"redux-dark-color":{getThemeVariables:uf}},Yt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},lh={...Yt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:Me.default.getThemeVariables(),sequence:{...Yt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Yt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Yt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Yt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Yt.pie,useWidth:984},xyChart:{...Yt.xyChart,useWidth:void 0},requirement:{...Yt.requirement,useWidth:void 0},packet:{...Yt.packet},eventmodeling:{...Yt.eventmodeling},treeView:{...Yt.treeView,useWidth:void 0},radar:{...Yt.radar},railroad:{...Yt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Yt.ishikawa},sankey:{...Yt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Yt.venn},cynefin:{...Yt.cynefin}},hh=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...hh(e[i],"")]:[...r,t+i],[]),"keyify"),gf=new Set(hh(lh,"")),ch=lh,pf={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},ff=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(M.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Ni=g(e=>{if(M.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Ni(t));return}for(const t of Object.keys(e)){if(M.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!gf.has(t)||e[t]==null){M.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=pf[t];i?ff(e[t],i):(M.debug("sanitizing object",t),Ni(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(M.debug("sanitizing css option",t),e[t]=dh(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}M.debug("After sanitization",e)}},"sanitizeDirective"),dh=g(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),wr=Object.freeze(ch),ve=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ee=Ht({},wr),Wi,Je=[],ri=Ht({},wr),gi=g((e,t)=>{let r=Ht({},e),i={};for(const o of t)ph(o),i=Ht(i,o);if(r=Ht(r,i),i.theme&&i.theme in Me){const o=Ht({},Wi),s=Ht(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in Me&&(r.themeVariables=Me[r.theme].getThemeVariables(s))}return ri=r,kf(ri),ri},"updateCurrentConfig"),mf=g(e=>(ee=Ht({},wr),ee=Ht(ee,e),e.theme&&Me[e.theme]&&(ee.themeVariables=Me[e.theme].getThemeVariables(e.themeVariables)),gi(ee,Je),ee),"setSiteConfig"),yf=g(e=>{Wi=Ht({},e)},"saveConfigFromInitialize"),Cf=g(e=>(ee=Ht(ee,e),gi(ee,Je),ee),"updateSiteConfig"),uh=g(()=>Ht({},ee),"getSiteConfig"),gh=g(e=>(gi(ri,[e]),Dt()),"setConfig"),Dt=g(()=>Ht({},ri),"getConfig"),ph=g(e=>{e&&(["secure",...ee.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(M.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&ph(e[t])}))},"sanitize"),xf=g(e=>{Ni(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Je.push(e),gi(ee,Je)},"addDirective"),zi=g((e=ee)=>{Je=[],gi(e,Je)},"reset"),bf={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Ja={},fh=g(e=>{Ja[e]||(M.warn(bf[e]),Ja[e]=!0)},"issueWarning"),kf=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&fh("LAZY_LOAD_DEPRECATED")},"checkConfig"),g2=g(()=>{let e={};Wi&&(e=Ht(e,Wi));for(const t of Je)e=Ht(e,t);return e},"getUserDefinedConfig"),Kt=g(e=>(e.flowchart?.htmlLabels!=null&&fh("FLOWCHART_HTML_LABELS_DEPRECATED"),ve(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),mh=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,ii=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Sf=/\s*%%.*\n/gm,yh=class extends Error{static{g(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},tr={},Hs=g(function(e,t){e=e.replace(mh,"").replace(ii,"").replace(Sf,`
15
- `);for(const[r,{detector:i}]of Object.entries(tr))if(i(e,t))return r;throw new yh(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),hs=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)Ch(t,r,i)},"registerLazyLoadedDiagrams"),Ch=g((e,t,r)=>{tr[e]&&M.warn(`Detector with key ${e} already exists. Overwriting.`),tr[e]={detector:t,loader:r},M.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),Tf=g(e=>tr[e].loader,"getDiagramLoader"),pi=/<br\s*\/?>/gi,wf=g(e=>e?kh(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Bf=(()=>{let e=!1;return()=>{e||(xh(),e=!0)}})();function xh(){const e="data-temp-href-target";Sr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Sr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}g(xh,"setupDompurifyHooks");var bh=g(e=>(Bf(),Sr.sanitize(e)),"removeScript"),tn=g((e,t)=>{if(Kt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=bh(e):r!=="loose"&&(e=kh(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=Ef(e))}return e},"sanitizeMore"),ae=g((e,t)=>e&&(t.dompurifyConfig?e=Sr.sanitize(tn(e,t),t.dompurifyConfig).toString():e=Sr.sanitize(tn(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),vf=g((e,t)=>typeof e=="string"?ae(e,t):e.flat().map(r=>ae(r,t)),"sanitizeTextOrArray"),Lf=g(e=>pi.test(e),"hasBreaks"),Ff=g(e=>e.split(pi),"splitBreaks"),Ef=g(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),kh=g(e=>e.replace(pi,"#br#"),"breakToPlaceholder"),Af=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),_f=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),Mf=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),en=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];If(s,a)&&(o=s+","+a,i++,r.pop())}r.push(Of(o))}return r.join("")},"parseGenericTypes"),cs=g((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),If=g((e,t)=>{const r=cs(e,"~"),i=cs(t,"~");return r===1&&i===1},"shouldCombineSets"),Of=g(e=>{const t=cs(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),rn=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),ds=/\$\$(.*?)\$\$/g,ni=g(e=>(e.match(ds)?.length??0)>0,"hasKatex"),p2=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Sh(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),$f=g(async(e,t)=>{if(!ni(e))return e;if(!(rn()||t.legacyMathML||t.forceLegacyMathML))return e.replace(ds,"MathML is unsupported in this environment.");{const{default:r}=await bt(async()=>{const{default:o}=await import("../datalayer-app-main.js").then(s=>s.u0);return{default:o}},[],import.meta.url),i=t.forceLegacyMathML||!rn()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(pi).map(o=>ni(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(ds,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Sh=g(async(e,t)=>ae(await $f(e,t),t),"renderKatexSanitized"),fi={getRows:wf,sanitizeText:ae,sanitizeTextOrArray:vf,hasBreaks:Lf,splitBreaks:Ff,lineBreakRegex:pi,removeScript:bh,getUrl:Af,evaluate:ve,getMax:_f,getMin:Mf},Df=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Pf=g(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),Th=g(function(e,t,r,i){const o=Pf(t,r,i);Df(e,o)},"configureSvgSize"),Rf=g(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;M.info(`SVG bounds: ${s}x${a}`,o);let n=0,h=0;M.info(`Graph bounds: ${n}x${h}`,e),n=s+r*2,h=a+r*2,M.info(`Calculated bounds: ${n}x${h}`),Th(t,h,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Oi={};function us(e){return[...e.cssRules].map(t=>t.cssText).join(`
16
- `)}g(us,"cssStyleSheetToString");var qf=g((e,t,r,i)=>{let o="";return e in Oi&&Oi[e]?o=Oi[e]({...r,svgId:i}):M.warn(`No theme found for ${e}`),`& {
7
+ `),s=Math.max(...o.map(n=>Tr(n,t))),a=o.length*t*Sp;return{width:s,height:a}},Lp=(e,t,r,i)=>{const o=e.split(`
8
+ `);for(let s=Gr;s>=Jl;s-=xp){const{height:a}=vp(o,s,t);if(a<=r)return s}return i},Fp=e=>{const t=rh(e);if(!t||eh.has(e.shape))return Gr;const r=Math.max(1,e.width-bp),i=Math.max(1,e.height-kp),o=t.split(`
9
+ `);return o.length>1&&Math.max(...o.map(a=>Tr(a,Gr)))<=r?Gr:Lp(t,r,i,o.length===1?Gr:Jl)},Ep=e=>{if(eh.has(e.shape))return;const t=rh(e);if(t)return{text:t,fontSize:Fp(e),verticalAlign:e.shape==="rectWithTitle"||e.shape==="roundedWithTitle"?"top":"middle",...os(e.labelStyle)}},Ap=e=>{const t=si(e.containerStyle),r=Ep(e),i=e.shape==="choice"?"diamond":e.shape==="stateStart"||e.shape==="stateEnd"?"ellipse":"rectangle",o=e.shape==="rect"||e.shape==="rectWithTitle"||e.shape==="roundedWithTitle",s=e.shape==="stateStart"||e.shape==="fork"||e.shape==="join",a=t.backgroundColor||t.strokeColor||ss,n=t.strokeColor||t.backgroundColor||ss;return{id:e.id,type:i,...as(e)?{groupIds:as(e)}:{},x:e.x,y:e.y,width:e.width,height:e.height,...r?{label:r}:{},...t,...o?{roundness:{type:3}}:{},...s?{backgroundColor:a,strokeColor:n,fillStyle:"solid"}:{}}},_p=e=>{if(!e.dividerLine)return null;const t=si(e.containerStyle);return{id:`${e.id}__divider`,type:"line",x:e.dividerLine.startX,y:e.dividerLine.startY,width:e.dividerLine.endX-e.dividerLine.startX,height:e.dividerLine.endY-e.dividerLine.startY,points:[Ri(0,0),Ri(e.dividerLine.endX-e.dividerLine.startX,e.dividerLine.endY-e.dividerLine.startY)],strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||1}},Mp=e=>{const t=si(e.containerStyle),r=Math.max(2,Math.min(e.width,e.height)*.32),i=e.endInnerColor||t.strokeColor||t.backgroundColor||ss;return{id:`${e.id}__inner`,type:"ellipse",groupIds:as(e),x:e.x+r,y:e.y+r,width:Math.max(1,e.width-r*2),height:Math.max(1,e.height-r*2),backgroundColor:i,strokeColor:i,fillStyle:"solid",strokeWidth:1}},Ip=e=>{const t=e.reflectionPoints.map((r,i,o)=>{const s=o[0];return i===0?Ri(0,0):Ri(r.x-s.x,r.y-s.y)});return{id:e.id,type:"arrow",x:e.startX,y:e.startY,width:e.endX-e.startX,height:e.endY-e.startY,points:t,strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||2,strokeStyle:e.strokeStyle||"solid",endArrowhead:e.isNoteEdge?null:"triangle",roundness:{type:2},start:{id:e.start},end:{id:e.end},...e.text?{label:{text:e.text,fontSize:16}}:{}}},Op=new Fr({converter:e=>{const t=[];return e.nodes.forEach(r=>{if(!r.isRenderable)return;const i=Ap(r);t.push(i);const o=_p(r);o&&t.push(o),r.shape==="stateEnd"&&t.push(Mp(r))}),e.edges.forEach(r=>{t.push(Ip(r))}),{elements:t}}}),re=e=>{e=Dp(e);const t=e.replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),r=document.createElement("textarea");return r.innerHTML=t,r.value},Qe=e=>{const r=e.getAttribute("transform")?.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let i=0,o=0;return r&&(i=Number(r[1]),o=Number(r[2])),{transformX:i,transformY:o}},$p=e=>{let t=e;return t=t.replace(/style.*:\S*#.*;/g,r=>r.substring(0,r.length-1)),t=t.replace(/classDef.*:\S*#.*;/g,r=>r.substring(0,r.length-1)),t=t.replace(/#\w+;/g,r=>{const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?`fl°°${i}¶ß`:`fl°${i}¶ß`}),t},Dp=function(e){return e.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},Pp=.5,qs=(e,t=Pp)=>{const r=[];return e.forEach(i=>{const o=r[r.length-1];if(!o){r.push(i);return}Math.hypot(i[0]-o[0],i[1]-o[1])<=t||r.push(i)}),r},Ns=e=>{const t=e.getAttribute("d");if(!t)return null;const r=Array.from(t.matchAll(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi),i=>Number(i[0]));return r.length<4?null:{startX:r[0],startY:r[1],endX:r[r.length-2],endY:r[r.length-1]}},ih=e=>{const t=e.getAttribute("data-points");if(!t){const r=Ns(e);return r?[{x:r.startX,y:r.startY},{x:r.endX,y:r.endY}]:[]}try{const r=atob(t),i=JSON.parse(r);return Array.isArray(i)?i.filter(o=>o&&typeof o.x=="number"&&typeof o.y=="number"&&Number.isFinite(o.x)&&Number.isFinite(o.y)):[]}catch{return[]}},oh=(e,t={x:0,y:0},r="LM")=>{if(e.tagName.toLowerCase()!=="path")throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${e.tagName}`);const i=e.getAttribute("d");if(!i)throw new Error('Path element does not contain a "d" attribute');const o=i.split(new RegExp(`(?=[${r}])`)),s=o[0].substring(1).split(",").map(h=>parseFloat(h)),a=o[o.length-1].substring(1).split(",").map(h=>parseFloat(h)),n=o.map(h=>{const c=h[0],l=h.substring(1).split(",").map(d=>parseFloat(d));return c==="C"?{x:l[4],y:l[5],command:c}:{x:l[0],y:l[1],command:c}}).filter((h,c,l)=>{if(c===0||c===l.length-1)return!0;if(h.x===l[c-1].x&&h.y===l[c-1].y||c===l.length-2&&h.command==="C")return!1;if(c===l.length-2&&(l[c-1].x===h.x||l[c-1].y===h.y)){const d=l[l.length-1];return Math.hypot(d.x-h.x,d.y-h.y)>20}return h.x!==l[c-1].x||h.y!==l[c-1].y}).map(h=>({x:h.x+t.x,y:h.y+t.y}));return{startX:s[0]+t.x,startY:s[1]+t.y,endX:a[0]+t.x,endY:a[1]+t.y,reflectionPoints:n}},Rp=e=>({...e,elements:e.elements.map(t=>{if(!("points"in t)||!Array.isArray(t.points))return t;const r=t.points;if(r.length<2)return t;const i=qs(r);return i.length===r.length?t:{...t,points:i}})}),qp=(e,t={})=>{const r=(()=>{switch(e.type){case"graphImage":return dp.convert(e,t);case"flowchart":return cp.convert(e,t);case"sequence":return mp.convert(e,t);case"class":return yp.convert(e,t);case"erd":return Cp.convert(e,t);case"state":return Op.convert(e,t);default:throw new Error(`graphToExcalidraw: unknown graph type "${e.type}, only flowcharts are supported!"`)}})();return Rp(r)};var sh=Object.defineProperty,g=(e,t)=>sh(e,"name",{value:t,configurable:!0}),Np=(e,t)=>{for(var r in t)sh(e,r,{get:t[r],enumerable:!0})},Ee={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},M={trace:g((...e)=>{},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},Ws=g(function(e="fatal"){let t=Ee.fatal;typeof e=="string"?e.toLowerCase()in Ee&&(t=Ee[e]):typeof e=="number"&&(t=e),M.trace=()=>{},M.debug=()=>{},M.info=()=>{},M.warn=()=>{},M.error=()=>{},M.fatal=()=>{},t<=Ee.fatal&&(M.fatal=console.error?console.error.bind(console,oe("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",oe("FATAL"))),t<=Ee.error&&(M.error=console.error?console.error.bind(console,oe("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",oe("ERROR"))),t<=Ee.warn&&(M.warn=console.warn?console.warn.bind(console,oe("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",oe("WARN"))),t<=Ee.info&&(M.info=console.info?console.info.bind(console,oe("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",oe("INFO"))),t<=Ee.debug&&(M.debug=console.debug?console.debug.bind(console,oe("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",oe("DEBUG"))),t<=Ee.trace&&(M.trace=console.debug?console.debug.bind(console,oe("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",oe("TRACE")))},"setLogLevel"),oe=g(e=>`%c${Og().format("ss.SSS")} : ${e} : `,"format"),ns=g((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>ns(e,o,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(o=>{e.includes(o)||e.push(o)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const o=e;Object.entries(t).forEach(([s,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,s)||Object.defineProperty(e,s,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[s]===void 0&&(o[s]=Array.isArray(a)?[]:{}),typeof o[s]=="object"&&(o[s]=ns(o[s],a,{depth:r-1}))}else typeof o[s]!="object"&&(Object.hasOwn(e,s)?o[s]=a:Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Ht=ns,we="#ffffff",Be="#f2f2f2",ft=g((e,t)=>t?k(e,{s:-40,l:10}):k(e,{s:-40,l:-10}),"mkBorder"),Wp=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||$(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||$(this.mainBkg,10)):(this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??k(this.primaryColor,{l:-30}),this.venn2=this.venn2??k(this.secondaryColor,{l:-30}),this.venn3=this.venn3??k(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??k(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??k(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??k(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??k(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??k(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},zp=g(e=>{const t=new Wp;return t.calculate(e),t},"getThemeVariables"),Hp=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=$("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=$(this.sectionBkgColor,10),this.taskBorderColor=Ve(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ve(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||O(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||$(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=O(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=O(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=O(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=E(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||E(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScalePeer"+e]=this["cScalePeer"+e]||O(this["cScale"+e],10);for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{h:30,s:-30,l:-(-10+e*4)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{h:30,s:-30,l:-(-7+e*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["pie"+e]=this["cScale"+e];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let e=0;e<8;e++)this["venn"+(e+1)]=this["venn"+(e+1)]??O(this["cScale"+e],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=O(this.secondaryColor,20),this.git1=O(this.pie2||this.secondaryColor,20),this.git2=O(this.pie3||this.tertiaryColor,20),this.git3=O(this.pie4||k(this.primaryColor,{h:-30}),20),this.git4=O(this.pie5||k(this.primaryColor,{h:-60}),20),this.git5=O(this.pie6||k(this.primaryColor,{h:-90}),10),this.git6=O(this.pie7||k(this.primaryColor,{h:60}),10),this.git7=O(this.pie8||k(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||E(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||E(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||O("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||O("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||O("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||O("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||O(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||O(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||O(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||O(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Yp=g(e=>{const t=new Hp;return t.calculate(e),t},"getThemeVariables"),jp=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=k(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ve(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||$(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||$(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=$(this["cScale"+e],10),this["cScalePeer"+e]=this["cScalePeer"+e]||$(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||k(this["cScale"+e],{h:180});for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{h:30,l:-(5+e*5)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{h:30,l:-(7+e*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||E(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||E(this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||O(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||O(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||k(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-30}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||k(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??k(this.primaryColor,{l:-30}),this.venn2=this.venn2??k(this.secondaryColor,{l:-30}),this.venn3=this.venn3??k(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??k(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??k(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??k(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??k(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??k(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||$(E(this.git0),25),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||E(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||E(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(Object.keys(this).forEach(r=>{this[r]==="calculated"&&(this[r]=void 0)}),typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Xp=g(e=>{const t=new jp;return t.calculate(e),t},"getThemeVariables"),Up=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=O("#cde498",10),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.primaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=$(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||$(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||$(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=$(this["cScale"+e],10),this["cScalePeer"+e]=this["cScalePeer"+e]||$(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||k(this["cScale"+e],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{h:30,s:-30,l:-(5+e*5)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{h:30,s:-30,l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||O(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-30}),this.pie5=this.pie5||k(this.secondaryColor,{l:-30}),this.pie6=this.pie6||k(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??k(this.primaryColor,{l:-30}),this.venn2=this.venn2??k(this.secondaryColor,{l:-30}),this.venn3=this.venn3??k(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??k(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??k(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??k(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??k(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??k(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||E(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||E(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Gp=g(e=>{const t=new Up;return t.calculate(e),t},"getThemeVariables"),Vp=class{static{g(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=O(this.contrast,55),this.background="#ffffff",this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.lineColor=E(this.background),this.textColor=E(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||O(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=O(this.contrast,55),this.border2=this.contrast,this.actorBorder=O(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||E(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||O(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||$(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||k(this.mainBkg,{l:-(5+e*5)}),this["surfacePeer"+e]=this["surfacePeer"+e]||k(this.mainBkg,{l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=O(this.contrast,30),this.sectionBkgColor2=O(this.contrast,30),this.taskBorderColor=$(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=O(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=$(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=k(this.primaryColor,{h:64}),this.fillType3=k(this.secondaryColor,{h:64}),this.fillType4=k(this.primaryColor,{h:-64}),this.fillType5=k(this.secondaryColor,{h:-64}),this.fillType6=k(this.primaryColor,{h:128}),this.fillType7=k(this.secondaryColor,{h:128});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["pie"+e]=this["cScale"+e];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let e=0;e<8;e++)this["venn"+(e+1)]=this["venn"+(e+1)]??this["cScale"+e];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=$(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||k(this.primaryColor,{h:-30}),this.git4=this.pie5||k(this.primaryColor,{h:-60}),this.git5=this.pie6||k(this.primaryColor,{h:-90}),this.git6=this.pie7||k(this.primaryColor,{h:60}),this.git7=this.pie8||k(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Kp=g(e=>{const t=new Vp;return t.calculate(e),t},"getThemeVariables"),Zp=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=k(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||k(e,{h:30}),this.cScale4=this.cScale4||k(e,{h:60}),this.cScale5=this.cScale5||k(e,{h:90}),this.cScale6=this.cScale6||k(e,{h:120}),this.cScale7=this.cScale7||k(e,{h:150}),this.cScale8=this.cScale8||k(e,{h:210,l:150}),this.cScale9=this.cScale9||k(e,{h:270}),this.cScale10=this.cScale10||k(e,{h:300}),this.cScale11=this.cScale11||k(e,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||E(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||O(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||$(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||k(e,{h:64}),this.fillType3=this.fillType3||k(t,{h:64}),this.fillType4=this.fillType4||k(e,{h:-64}),this.fillType5=this.fillType5||k(t,{h:-64}),this.fillType6=this.fillType6||k(e,{h:128}),this.fillType7=this.fillType7||k(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||r,this.pie4=this.pie4||k(e,{l:-10}),this.pie5=this.pie5||k(t,{l:-10}),this.pie6=this.pie6||k(r,{l:-10}),this.pie7=this.pie7||k(e,{h:60,l:-10}),this.pie8=this.pie8||k(e,{h:-60,l:-10}),this.pie9=this.pie9||k(e,{h:120,l:0}),this.pie10=this.pie10||k(e,{h:60,l:-20}),this.pie11=this.pie11||k(e,{h:-60,l:-20}),this.pie12=this.pie12||k(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||k(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||r,this.git3=this.git3||k(e,{h:-30}),this.git4=this.git4||k(e,{h:-60}),this.git5=this.git5||k(e,{h:-90}),this.git6=this.git6||k(e,{h:60}),this.git7=this.git7||k(e,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},Qp=g(e=>{const t=new Zp;return t.calculate(e),t},"getThemeVariables"),Jp=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor=E(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},tf=g(e=>{const t=new Jp;return t.calculate(e),t},"getThemeVariables"),ef=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ft("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=k(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=$(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||E(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||O(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||$(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||k(e,{h:64}),this.fillType3=this.fillType3||k(t,{h:64}),this.fillType4=this.fillType4||k(e,{h:-64}),this.fillType5=this.fillType5||k(t,{h:-64}),this.fillType6=this.fillType6||k(e,{h:128}),this.fillType7=this.fillType7||k(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||r,this.pie4=this.pie4||k(e,{l:-10}),this.pie5=this.pie5||k(t,{l:-10}),this.pie6=this.pie6||k(r,{l:-10}),this.pie7=this.pie7||k(e,{h:60,l:-10}),this.pie8=this.pie8||k(e,{h:-60,l:-10}),this.pie9=this.pie9||k(e,{h:120,l:0}),this.pie10=this.pie10||k(e,{h:60,l:-20}),this.pie11=this.pie11||k(e,{h:-60,l:-20}),this.pie12=this.pie12||k(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||k(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||r,this.git3=this.git3||k(e,{h:-30}),this.git4=this.git4||k(e,{h:-60}),this.git5=this.git5||k(e,{h:-90}),this.git6=this.git6||k(e,{h:60}),this.git7=this.git7||k(e,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},rf=g(e=>{const t=new ef;return t.calculate(e),t},"getThemeVariables"),of=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor=E(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||k(this.primaryColor,{h:30}),this.cScale4=this.cScale4||k(this.primaryColor,{h:60}),this.cScale5=this.cScale5||k(this.primaryColor,{h:90}),this.cScale6=this.cScale6||k(this.primaryColor,{h:120}),this.cScale7=this.cScale7||k(this.primaryColor,{h:150}),this.cScale8=this.cScale8||k(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||k(this.primaryColor,{h:270}),this.cScale10=this.cScale10||k(this.primaryColor,{h:300}),this.cScale11=this.cScale11||k(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=$(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},sf=g(e=>{const t=new of;return t.calculate(e),t},"getThemeVariables"),af=class{static{g(this,"Theme")}constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ft(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",t="#E9E9F1",r=k(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||O(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||E(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||O(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||$(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||k(this.mainBkg,{h:180,s:-15,l:i*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||k(e,{h:64}),this.fillType3=this.fillType3||k(t,{h:64}),this.fillType4=this.fillType4||k(e,{h:-64}),this.fillType5=this.fillType5||k(t,{h:-64}),this.fillType6=this.fillType6||k(e,{h:128}),this.fillType7=this.fillType7||k(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||r,this.pie4=this.pie4||k(e,{l:-10}),this.pie5=this.pie5||k(t,{l:-10}),this.pie6=this.pie6||k(r,{l:-10}),this.pie7=this.pie7||k(e,{h:60,l:-10}),this.pie8=this.pie8||k(e,{h:-60,l:-10}),this.pie9=this.pie9||k(e,{h:120,l:0}),this.pie10=this.pie10||k(e,{h:60,l:-20}),this.pie11=this.pie11||k(e,{h:-60,l:-20}),this.pie12=this.pie12||k(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||k(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||r,this.git3=this.git3||k(e,{h:-30}),this.git4=this.git4||k(e,{h:-60}),this.git5=this.git5||k(e,{h:-90}),this.git6=this.git6||k(e,{h:60}),this.git7=this.git7||k(e,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},nf=g(e=>{const t=new af;return t.calculate(e),t},"getThemeVariables"),lf=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=O(this.primaryColor,16),this.tertiaryColor=k(this.primaryColor,{h:-160}),this.primaryBorderColor=E(this.background),this.secondaryBorderColor=ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ft(this.tertiaryColor,this.darkMode),this.primaryTextColor=E(this.primaryColor),this.secondaryTextColor=E(this.secondaryColor),this.tertiaryTextColor=E(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=O(E("#323D47"),10),this.border1="#ccc",this.border2=Ve(255,255,255,.25),this.arrowheadColor=E(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||k(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||k(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ft(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ft(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ft(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ft(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||E(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||E(this.tertiaryColor),this.lineColor=this.lineColor||E(this.background),this.arrowheadColor=this.arrowheadColor||E(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||E(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||O(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||E(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||O(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||$(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=$(this["cScale"+t],75);const e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this["surfacePeer"+t]=this["surfacePeer"+t]||k(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||k(this.primaryColor,{h:64}),this.fillType3=this.fillType3||k(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||k(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||k(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||k(this.primaryColor,{h:128}),this.fillType7=this.fillType7||k(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||k(this.primaryColor,{l:-10}),this.pie5=this.pie5||k(this.secondaryColor,{l:-10}),this.pie6=this.pie6||k(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||k(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||k(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||k(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||k(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||k(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||k(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||k(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||k(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||k(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||k(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||k(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||k(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||fe(this.quadrant1Fill)?O(this.quadrant1Fill):$(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?$(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||k(this.primaryColor,{h:-30}),this.git4=this.git4||k(this.primaryColor,{h:-60}),this.git5=this.git5||k(this.primaryColor,{h:-90}),this.git6=this.git6||k(this.primaryColor,{h:60}),this.git7=this.git7||k(this.primaryColor,{h:120}),this.darkMode?(this.git0=O(this.git0,25),this.git1=O(this.git1,25),this.git2=O(this.git2,25),this.git3=O(this.git3,25),this.git4=O(this.git4,25),this.git5=O(this.git5,25),this.git6=O(this.git6,25),this.git7=O(this.git7,25)):(this.git0=$(this.git0,25),this.git1=$(this.git1,25),this.git2=$(this.git2,25),this.git3=$(this.git3,25),this.git4=$(this.git4,25),this.git5=$(this.git5,25),this.git6=$(this.git6,25),this.git7=$(this.git7,25)),this.gitInv0=this.gitInv0||E(this.git0),this.gitInv1=this.gitInv1||E(this.git1),this.gitInv2=this.gitInv2||E(this.git2),this.gitInv3=this.gitInv3||E(this.git3),this.gitInv4=this.gitInv4||E(this.git4),this.gitInv5=this.gitInv5||E(this.git5),this.gitInv6=this.gitInv6||E(this.git6),this.gitInv7=this.gitInv7||E(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||we,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Be}calculate(e){if(typeof e!="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(r=>{this[r]=e[r]}),this.updateColors(),t.forEach(r=>{this[r]=e[r]})}},hf=g(e=>{const t=new lf;return t.calculate(e),t},"getThemeVariables"),Me={base:{getThemeVariables:zp},dark:{getThemeVariables:Yp},default:{getThemeVariables:Xp},forest:{getThemeVariables:Gp},neutral:{getThemeVariables:Kp},neo:{getThemeVariables:Qp},"neo-dark":{getThemeVariables:tf},redux:{getThemeVariables:rf},"redux-dark":{getThemeVariables:sf},"redux-color":{getThemeVariables:nf},"redux-dark-color":{getThemeVariables:hf}},Yt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},ah={...Yt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:Me.default.getThemeVariables(),sequence:{...Yt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Yt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Yt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Yt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Yt.pie,useWidth:984},xyChart:{...Yt.xyChart,useWidth:void 0},requirement:{...Yt.requirement,useWidth:void 0},packet:{...Yt.packet},eventmodeling:{...Yt.eventmodeling},treeView:{...Yt.treeView,useWidth:void 0},radar:{...Yt.radar},railroad:{...Yt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Yt.ishikawa},sankey:{...Yt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Yt.venn},cynefin:{...Yt.cynefin}},nh=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...nh(e[i],"")]:[...r,t+i],[]),"keyify"),cf=new Set(nh(ah,"")),lh=ah,df={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},uf=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(M.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),qi=g(e=>{if(M.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>qi(t));return}for(const t of Object.keys(e)){if(M.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!cf.has(t)||e[t]==null){M.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=df[t];i?uf(e[t],i):(M.debug("sanitizing object",t),qi(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(M.debug("sanitizing css option",t),e[t]=hh(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}M.debug("After sanitization",e)}},"sanitizeDirective"),hh=g(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),wr=Object.freeze(lh),ve=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ee=Ht({},wr),Ni,Je=[],ei=Ht({},wr),ui=g((e,t)=>{let r=Ht({},e),i={};for(const o of t)uh(o),i=Ht(i,o);if(r=Ht(r,i),i.theme&&i.theme in Me){const o=Ht({},Ni),s=Ht(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in Me&&(r.themeVariables=Me[r.theme].getThemeVariables(s))}return ei=r,Cf(ei),ei},"updateCurrentConfig"),gf=g(e=>(ee=Ht({},wr),ee=Ht(ee,e),e.theme&&Me[e.theme]&&(ee.themeVariables=Me[e.theme].getThemeVariables(e.themeVariables)),ui(ee,Je),ee),"setSiteConfig"),pf=g(e=>{Ni=Ht({},e)},"saveConfigFromInitialize"),ff=g(e=>(ee=Ht(ee,e),ui(ee,Je),ee),"updateSiteConfig"),ch=g(()=>Ht({},ee),"getSiteConfig"),dh=g(e=>(ui(ei,[e]),Dt()),"setConfig"),Dt=g(()=>Ht({},ei),"getConfig"),uh=g(e=>{e&&(["secure",...ee.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(M.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&uh(e[t])}))},"sanitize"),mf=g(e=>{qi(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Je.push(e),ui(ee,Je)},"addDirective"),Wi=g((e=ee)=>{Je=[],ui(e,Je)},"reset"),yf={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Za={},gh=g(e=>{Za[e]||(M.warn(yf[e]),Za[e]=!0)},"issueWarning"),Cf=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&gh("LAZY_LOAD_DEPRECATED")},"checkConfig"),d2=g(()=>{let e={};Ni&&(e=Ht(e,Ni));for(const t of Je)e=Ht(e,t);return e},"getUserDefinedConfig"),Kt=g(e=>(e.flowchart?.htmlLabels!=null&&gh("FLOWCHART_HTML_LABELS_DEPRECATED"),ve(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),ph=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,ri=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,xf=/\s*%%.*\n/gm,fh=class extends Error{static{g(this,"UnknownDiagramError")}constructor(e){super(e),this.name="UnknownDiagramError"}},tr={},zs=g(function(e,t){e=e.replace(ph,"").replace(ri,"").replace(xf,`
10
+ `);for(const[r,{detector:i}]of Object.entries(tr))if(i(e,t))return r;throw new fh(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),ls=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)mh(t,r,i)},"registerLazyLoadedDiagrams"),mh=g((e,t,r)=>{tr[e]&&M.warn(`Detector with key ${e} already exists. Overwriting.`),tr[e]={detector:t,loader:r},M.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),bf=g(e=>tr[e].loader,"getDiagramLoader"),gi=/<br\s*\/?>/gi,kf=g(e=>e?xh(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Sf=(()=>{let e=!1;return()=>{e||(yh(),e=!0)}})();function yh(){const e="data-temp-href-target";Sr.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Sr.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}g(yh,"setupDompurifyHooks");var Ch=g(e=>(Sf(),Sr.sanitize(e)),"removeScript"),Qa=g((e,t)=>{if(Kt(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Ch(e):r!=="loose"&&(e=xh(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=vf(e))}return e},"sanitizeMore"),ae=g((e,t)=>e&&(t.dompurifyConfig?e=Sr.sanitize(Qa(e,t),t.dompurifyConfig).toString():e=Sr.sanitize(Qa(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),Tf=g((e,t)=>typeof e=="string"?ae(e,t):e.flat().map(r=>ae(r,t)),"sanitizeTextOrArray"),wf=g(e=>gi.test(e),"hasBreaks"),Bf=g(e=>e.split(gi),"splitBreaks"),vf=g(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),xh=g(e=>e.replace(gi,"#br#"),"breakToPlaceholder"),Lf=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Ff=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),Ef=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Ja=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];Af(s,a)&&(o=s+","+a,i++,r.pop())}r.push(_f(o))}return r.join("")},"parseGenericTypes"),hs=g((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),Af=g((e,t)=>{const r=hs(e,"~"),i=hs(t,"~");return r===1&&i===1},"shouldCombineSets"),_f=g(e=>{const t=hs(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),tn=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),cs=/\$\$(.*?)\$\$/g,ai=g(e=>(e.match(cs)?.length??0)>0,"hasKatex"),u2=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await bh(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),Mf=g(async(e,t)=>{if(!ai(e))return e;if(!(tn()||t.legacyMathML||t.forceLegacyMathML))return e.replace(cs,"MathML is unsupported in this environment.");{const{default:r}=await bt(async()=>{const{default:o}=await import("../datalayer-app-main.js").then(s=>s.u0);return{default:o}},[],import.meta.url),i=t.forceLegacyMathML||!tn()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(gi).map(o=>ai(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(cs,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),bh=g(async(e,t)=>ae(await Mf(e,t),t),"renderKatexSanitized"),pi={getRows:kf,sanitizeText:ae,sanitizeTextOrArray:Tf,hasBreaks:wf,splitBreaks:Bf,lineBreakRegex:gi,removeScript:Ch,getUrl:Lf,evaluate:ve,getMax:Ff,getMin:Ef},If=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Of=g(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),kh=g(function(e,t,r,i){const o=Of(t,r,i);If(e,o)},"configureSvgSize"),$f=g(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;M.info(`SVG bounds: ${s}x${a}`,o);let n=0,h=0;M.info(`Graph bounds: ${n}x${h}`,e),n=s+r*2,h=a+r*2,M.info(`Calculated bounds: ${n}x${h}`),kh(t,h,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Ii={};function ds(e){return[...e.cssRules].map(t=>t.cssText).join(`
11
+ `)}g(ds,"cssStyleSheetToString");var Df=g((e,t,r,i)=>{let o="";return e in Ii&&Ii[e]?o=Ii[e]({...r,svgId:i}):M.warn(`No theme found for ${e}`),`& {
17
12
  font-family: ${r.fontFamily};
18
13
  font-size: ${r.fontSize};
19
14
  fill: ${r.textColor}
@@ -134,14 +129,14 @@ import{au as Sr,_ as bt}from"../datalayer-app-main.js";import{d as $g,P as k,Q a
134
129
  }
135
130
 
136
131
  ${t}
137
- `},"getStyles"),Nf=g((e,t)=>{t!==void 0&&(Oi[e]=t)},"addStylesForDiagram"),Wf=qf,wh={};Hp(wh,{clear:()=>zf,getAccDescription:()=>Xf,getAccTitle:()=>Yf,getDiagramTitle:()=>Gf,setAccDescription:()=>jf,setAccTitle:()=>Hf,setDiagramTitle:()=>Uf});var Ys="",js="",Xs="",Us=g(e=>ae(e,Dt()),"sanitizeText"),zf=g(()=>{Ys="",Xs="",js=""},"clear"),Hf=g(e=>{Ys=Us(e).replace(/^\s+/g,"")},"setAccTitle"),Yf=g(()=>Ys,"getAccTitle"),jf=g(e=>{Xs=Us(e).replace(/\n\s+/g,`
138
- `)},"setAccDescription"),Xf=g(()=>Xs,"getAccDescription"),Uf=g(e=>{js=Us(e)},"setDiagramTitle"),Gf=g(()=>js,"getDiagramTitle"),on=M,Vf=zs,Bt=Dt,f2=gh,m2=wr,Gs=g(e=>ae(e,Bt()),"sanitizeText"),Kf=Rf,Zf=g(()=>wh,"getCommonDb"),Hi={},Yi=g((e,t,r)=>{Hi[e]&&on.warn(`Diagram with id ${e} already registered. Overwriting.`),Hi[e]=t,r&&Ch(e,r),Nf(e,t.styles),t.injectUtils?.(on,Vf,Bt,Gs,Kf,Zf(),()=>{})},"registerDiagram"),gs=g(e=>{if(e in Hi)return Hi[e];throw new Qf(e)},"getDiagram"),Qf=class extends Error{static{g(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}},Jf=g(e=>{const{securityLevel:t}=Bt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement"),tm=g(e=>{const{handDrawnSeed:t}=Bt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),em=g(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),Er=g(e=>{const t=rm([...e.cssCompiledStyles||[],...e.cssStyles||[],...em(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),rm=g(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Bh=g(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),st=g(e=>{const{stylesArray:t}=Er(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];Bh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Bt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Er(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:im(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),im=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),om={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},ps=new Map,vh=new Map,sm=g(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(M.debug("Registering icon pack:",t.name),"loader"in t)vh.set(t.name,t.loader);else if("icons"in t)ps.set(t.name,t.icons);else throw M.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Lh=g(async(e,t)=>{const r=Ug(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=ps.get(i);if(!o){const a=vh.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},ps.set(i,o)}catch(n){throw M.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=Gg(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),am=g(async e=>{try{return await Lh(e),!0}catch{return!1}},"isIconAvailable"),mi=g(async(e,t,r)=>{let i;try{i=await Lh(e,t?.fallbackPrefix)}catch(a){M.error(a),i=om}const o=Yg(i,t),s=jg(Xg(o.body),{...o.attributes,...r});return ae(s,Dt())},"getIconSVG"),Ti={},zt={},sn;function nm(){return sn||(sn=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.BLANK_URL=zt.relativeFirstCharacters=zt.whitespaceEscapeCharsRegex=zt.urlSchemeRegex=zt.ctrlCharactersRegex=zt.htmlCtrlEntityRegex=zt.htmlEntitiesRegex=zt.invalidProtocolRegex=void 0,zt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,zt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,zt.htmlCtrlEntityRegex=/&(newline|tab);/gi,zt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,zt.urlSchemeRegex=/^.+(:|&colon;)/gim,zt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,zt.relativeFirstCharacters=[".","/"],zt.BLANK_URL="about:blank"),zt}var an;function lm(){if(an)return Ti;an=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.sanitizeUrl=s;var e=nm();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(h,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,h=o(a.trim());do h=r(h).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),h=o(h),n=h.match(e.ctrlCharactersRegex)||h.match(e.htmlEntitiesRegex)||h.match(e.htmlCtrlEntityRegex)||h.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=h;if(!c)return e.BLANK_URL;if(t(c))return c;var l=c.trimStart(),d=l.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=l.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var m=new URL(f);return m.protocol=m.protocol.toLowerCase(),m.hostname=m.hostname.toLowerCase(),m.toString()}return f}return Ti}var hm=lm(),cm="​",dm={curveBasis:os,curveBasisClosed:Hg,curveBasisOpen:zg,curveBumpX:Zl,curveBumpY:Kl,curveBundle:Wg,curveCardinalClosed:Ng,curveCardinalOpen:qg,curveCardinal:Vl,curveCatmullRomClosed:Rg,curveCatmullRomOpen:Pg,curveCatmullRom:Gl,curveLinear:Ii,curveLinearClosed:Dg,curveMonotoneX:Ul,curveMonotoneY:Xl,curveNatural:jl,curveStep:Yl,curveStepAfter:Hl,curveStepBefore:zl},um=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,gm=g(function(e,t){const r=Fh(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);Ni(a),i=Ht(i,[...a])}else i=r.args;if(!i)return;let o=Hs(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),Fh=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${um.source})(?=[}][%]{2}).*
139
- `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),M.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=ii.exec(e))!==null;)if(i.index===ii.lastIndex&&ii.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return M.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),pm=g(function(e){return e.replace(ii,"")},"removeDirectives"),fm=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Vs(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return dm[r]??t}g(Vs,"interpolateToCurve");function Eh(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?hm.sanitizeUrl(r):r}g(Eh,"formatUrl");var mm=g((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){M.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function Ks(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(Ks,"distance");function Ah(e){let t,r=0;e.forEach(o=>{r+=Ks(o,t),t=o});const i=r/2;return Zs(e,i)}g(Ah,"traverseEdge");function _h(e){return e.length===1?e[0]:Ah(e)}g(_h,"calcLabelPosition");var nn=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Zs=g((e,t)=>{let r,i=t;for(const o of e){if(r){const s=Ks(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:nn((1-a)*r.x+a*o.x,5),y:nn((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),ym=g((e,t,r)=>{M.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Zs(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Mh(e,t,r){const i=structuredClone(r);M.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=Zs(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),h={x:0,y:0};return t==="start_left"?(h.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,h.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(h.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,h.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(h.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,h.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(h.x=Math.sin(n)*a+(i[0].x+s.x)/2,h.y=-Math.cos(n)*a+(i[0].y+s.y)/2),h}g(Mh,"calcTerminalLabelPosition");function Ih(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}g(Ih,"getStylesFromArray");var ln=0,Cm=g(()=>(ln++,"id-"+Math.random().toString(36).substr(2,12)+"-"+ln),"generateId");function Oh(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Oh,"makeRandomHex");var xm=g(e=>Oh(e.length),"random"),bm=g(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),km=g(function(e,t){const r=t.text.replace(fi.lineBreakRegex," "),[,i]=oo(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),Sm=Ps((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),fi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const h=Ie(`${a} `,r),c=Ie(s,r);if(h>t){const{hyphenatedStrings:u,remainingWord:f}=Tm(a,t,"-",r);o.push(s,...u),s=f}else c+h>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Tm=Ps((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,h)=>{const c=`${a}${n}`;if(Ie(c,i)>=t){const d=h+1,u=o.length===d,f=`${c}${r}`;s.push(u?c:f),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function $h(e,t){return Qs(e,t).height}g($h,"calculateTextHeight");function Ie(e,t){return Qs(e,t).width}g(Ie,"calculateTextWidth");var Qs=Ps((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=oo(r),a=["sans-serif",i],n=e.split(fi.lineBreakRegex),h=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const l=c.append("svg");for(const u of a){let f=0;const m={width:0,height:0,lineHeight:0};for(const y of n){const x=bm();x.text=y||cm;const C=km(l,x).style("font-size",s).style("font-weight",o).style("font-family",u),b=(C._groups||C)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");m.width=Math.round(Math.max(m.width,b.width)),f=Math.round(b.height),m.height+=f,m.lineHeight=Math.round(Math.max(m.lineHeight,f))}h.push(m)}l.remove();const d=isNaN(h[1].height)||isNaN(h[1].width)||isNaN(h[1].lineHeight)||h[0].height>h[1].height&&h[0].width>h[1].width&&h[0].lineHeight>h[1].lineHeight?0:1;return h[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),wm=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{g(this,"InitIDGenerator")}},wi,Bm=g(function(e){return wi=wi||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),wi.innerHTML=e,unescape(wi.textContent)},"entityDecode");function Js(e){return"str"in e}g(Js,"isDetailedError");var vm=g((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),oo=g(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function ta(e,t){return Vg({},e,t)}g(ta,"cleanAndMerge");var Vt={assignWithDepth:Ht,wrapLabel:Sm,calculateTextHeight:$h,calculateTextWidth:Ie,calculateTextDimensions:Qs,cleanAndMerge:ta,detectInit:gm,detectDirective:Fh,isSubstringInArray:fm,interpolateToCurve:Vs,calcLabelPosition:_h,calcCardinalityPosition:ym,calcTerminalLabelPosition:Mh,formatUrl:Eh,getStylesFromArray:Ih,generateId:Cm,random:xm,runFunc:mm,entityDecode:Bm,insertTitle:vm,isLabelCoordinateInPath:Dh,parseFontSize:oo,InitIDGenerator:wm},Lm=g(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Ne=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),y2=g((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Wt(e){return e??null}g(Wt,"handleUndefinedAttr");function Dh(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}g(Dh,"isLabelCoordinateInPath");function ea(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var sr=ea();function Ph(e){sr=e}var oi={exec:()=>null};function _t(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Jt.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var Fm=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Jt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Em=/^(?:[ \t]*(?:\n|$))+/,Am=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_m=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ra=/(?:[*+-]|\d{1,9}[.)])/,Rh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qh=_t(Rh).replace(/bull/g,ra).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Im=_t(Rh).replace(/bull/g,ra).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ia=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Om=/^[^\n]+/,oa=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$m=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",oa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Dm=_t(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ra).getRegex(),so="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",sa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pm=_t("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",sa).replace("tag",so).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nh=_t(ia).replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",so).getRegex(),Rm=_t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nh).getRegex(),aa={blockquote:Rm,code:Am,def:$m,fences:_m,heading:Mm,hr:yi,html:Pm,lheading:qh,list:Dm,newline:Em,paragraph:Nh,table:oi,text:Om},hn=_t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",so).getRegex(),qm={...aa,lheading:Im,table:hn,paragraph:_t(ia).replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",so).getRegex()},Nm={...aa,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sa).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:oi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(ia).replace("hr",yi).replace("heading",` *#{1,6} *[^
140
- ]`).replace("lheading",qh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Wm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,zm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wh=/^( {2,}|\\)\n(?!\s*$)/,Hm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ao=/[\p{P}\p{S}]/u,na=/[\s\p{P}\p{S}]/u,zh=/[^\s\p{P}\p{S}]/u,Ym=_t(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,na).getRegex(),Hh=/(?!~)[\p{P}\p{S}]/u,jm=/(?!~)[\s\p{P}\p{S}]/u,Xm=/(?:[^\s\p{P}\p{S}]|~)/u,Um=_t(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Fm?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Yh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Gm=_t(Yh,"u").replace(/punct/g,ao).getRegex(),Vm=_t(Yh,"u").replace(/punct/g,Hh).getRegex(),jh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Km=_t(jh,"gu").replace(/notPunctSpace/g,zh).replace(/punctSpace/g,na).replace(/punct/g,ao).getRegex(),Zm=_t(jh,"gu").replace(/notPunctSpace/g,Xm).replace(/punctSpace/g,jm).replace(/punct/g,Hh).getRegex(),Qm=_t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zh).replace(/punctSpace/g,na).replace(/punct/g,ao).getRegex(),Jm=_t(/\\(punct)/,"gu").replace(/punct/g,ao).getRegex(),ty=_t(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ey=_t(sa).replace("(?:-->|$)","-->").getRegex(),ry=_t("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ey).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ji=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,iy=_t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ji).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xh=_t(/^!?\[(label)\]\[(ref)\]/).replace("label",ji).replace("ref",oa).getRegex(),Uh=_t(/^!?\[(ref)\](?:\[\])?/).replace("ref",oa).getRegex(),oy=_t("reflink|nolink(?!\\()","g").replace("reflink",Xh).replace("nolink",Uh).getRegex(),cn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,la={_backpedal:oi,anyPunctuation:Jm,autolink:ty,blockSkip:Um,br:Wh,code:zm,del:oi,emStrongLDelim:Gm,emStrongRDelimAst:Km,emStrongRDelimUnd:Qm,escape:Wm,link:iy,nolink:Uh,punctuation:Ym,reflink:Xh,reflinkSearch:oy,tag:ry,text:Hm,url:oi},sy={...la,link:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",ji).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ji).getRegex()},fs={...la,emStrongRDelimAst:Zm,emStrongLDelim:Vm,url:_t(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_t(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cn).getRegex()},ay={...fs,br:_t(Wh).replace("{2,}","*").getRegex(),text:_t(fs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bi={normal:aa,gfm:qm,pedantic:Nm},Hr={normal:la,gfm:fs,breaks:ay,pedantic:sy},ny={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dn=e=>ny[e];function xe(e,t){if(t){if(Jt.escapeTest.test(e))return e.replace(Jt.escapeReplace,dn)}else if(Jt.escapeTestNoEncode.test(e))return e.replace(Jt.escapeReplaceNoEncode,dn);return e}function un(e){try{e=encodeURI(e).replace(Jt.percentDecode,"%")}catch{return null}return e}function gn(e,t){let r=e.replace(Jt.findPipe,(s,a,n)=>{let h=!1,c=a;for(;--c>=0&&n[c]==="\\";)h=!h;return h?"|":" |"}),i=r.split(Jt.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(Jt.slashPipe,"|");return i}function Yr(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function ly(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function pn(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let h={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,h}function hy(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
132
+ `},"getStyles"),Pf=g((e,t)=>{t!==void 0&&(Ii[e]=t)},"addStylesForDiagram"),Rf=Df,Sh={};Np(Sh,{clear:()=>qf,getAccDescription:()=>Hf,getAccTitle:()=>Wf,getDiagramTitle:()=>jf,setAccDescription:()=>zf,setAccTitle:()=>Nf,setDiagramTitle:()=>Yf});var Hs="",Ys="",js="",Xs=g(e=>ae(e,Dt()),"sanitizeText"),qf=g(()=>{Hs="",js="",Ys=""},"clear"),Nf=g(e=>{Hs=Xs(e).replace(/^\s+/g,"")},"setAccTitle"),Wf=g(()=>Hs,"getAccTitle"),zf=g(e=>{js=Xs(e).replace(/\n\s+/g,`
133
+ `)},"setAccDescription"),Hf=g(()=>js,"getAccDescription"),Yf=g(e=>{Ys=Xs(e)},"setDiagramTitle"),jf=g(()=>Ys,"getDiagramTitle"),en=M,Xf=Ws,Bt=Dt,g2=dh,p2=wr,Us=g(e=>ae(e,Bt()),"sanitizeText"),Uf=$f,Gf=g(()=>Sh,"getCommonDb"),zi={},Hi=g((e,t,r)=>{zi[e]&&en.warn(`Diagram with id ${e} already registered. Overwriting.`),zi[e]=t,r&&mh(e,r),Pf(e,t.styles),t.injectUtils?.(en,Xf,Bt,Us,Uf,Gf(),()=>{})},"registerDiagram"),us=g(e=>{if(e in zi)return zi[e];throw new Vf(e)},"getDiagram"),Vf=class extends Error{static{g(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}},Kf=g(e=>{const{securityLevel:t}=Bt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement"),Zf=g(e=>{const{handDrawnSeed:t}=Bt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Qf=g(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),Er=g(e=>{const t=Jf([...e.cssCompiledStyles||[],...e.cssStyles||[],...Qf(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Jf=g(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Th=g(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),st=g(e=>{const{stylesArray:t}=Er(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];Th(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Bt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Er(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:tm(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),tm=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),em={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},gs=new Map,wh=new Map,rm=g(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(M.debug("Registering icon pack:",t.name),"loader"in t)wh.set(t.name,t.loader);else if("icons"in t)gs.set(t.name,t.icons);else throw M.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Bh=g(async(e,t)=>{const r=Xg(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=gs.get(i);if(!o){const a=wh.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},gs.set(i,o)}catch(n){throw M.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=Ug(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),im=g(async e=>{try{return await Bh(e),!0}catch{return!1}},"isIconAvailable"),fi=g(async(e,t,r)=>{let i;try{i=await Bh(e,t?.fallbackPrefix)}catch(a){M.error(a),i=em}const o=Hg(i,t),s=Yg(jg(o.body),{...o.attributes,...r});return ae(s,Dt())},"getIconSVG"),Si={},zt={},rn;function om(){return rn||(rn=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.BLANK_URL=zt.relativeFirstCharacters=zt.whitespaceEscapeCharsRegex=zt.urlSchemeRegex=zt.ctrlCharactersRegex=zt.htmlCtrlEntityRegex=zt.htmlEntitiesRegex=zt.invalidProtocolRegex=void 0,zt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,zt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,zt.htmlCtrlEntityRegex=/&(newline|tab);/gi,zt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,zt.urlSchemeRegex=/^.+(:|&colon;)/gim,zt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,zt.relativeFirstCharacters=[".","/"],zt.BLANK_URL="about:blank"),zt}var on;function sm(){if(on)return Si;on=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.sanitizeUrl=s;var e=om();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(h,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,h=o(a.trim());do h=r(h).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),h=o(h),n=h.match(e.ctrlCharactersRegex)||h.match(e.htmlEntitiesRegex)||h.match(e.htmlCtrlEntityRegex)||h.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=h;if(!c)return e.BLANK_URL;if(t(c))return c;var l=c.trimStart(),d=l.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=l.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var m=new URL(f);return m.protocol=m.protocol.toLowerCase(),m.hostname=m.hostname.toLowerCase(),m.toString()}return f}return Si}var am=sm(),nm="​",lm={curveBasis:is,curveBasisClosed:zg,curveBasisOpen:Wg,curveBumpX:Vl,curveBumpY:Gl,curveBundle:Ng,curveCardinalClosed:qg,curveCardinalOpen:Rg,curveCardinal:Ul,curveCatmullRomClosed:Pg,curveCatmullRomOpen:Dg,curveCatmullRom:Xl,curveLinear:Mi,curveLinearClosed:$g,curveMonotoneX:jl,curveMonotoneY:Yl,curveNatural:Hl,curveStep:zl,curveStepAfter:Wl,curveStepBefore:Nl},hm=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,cm=g(function(e,t){const r=vh(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);qi(a),i=Ht(i,[...a])}else i=r.args;if(!i)return;let o=zs(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),vh=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${hm.source})(?=[}][%]{2}).*
134
+ `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),M.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=ri.exec(e))!==null;)if(i.index===ri.lastIndex&&ri.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return M.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),dm=g(function(e){return e.replace(ri,"")},"removeDirectives"),um=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Gs(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return lm[r]??t}g(Gs,"interpolateToCurve");function Lh(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?am.sanitizeUrl(r):r}g(Lh,"formatUrl");var gm=g((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){M.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function Vs(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(Vs,"distance");function Fh(e){let t,r=0;e.forEach(o=>{r+=Vs(o,t),t=o});const i=r/2;return Ks(e,i)}g(Fh,"traverseEdge");function Eh(e){return e.length===1?e[0]:Fh(e)}g(Eh,"calcLabelPosition");var sn=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Ks=g((e,t)=>{let r,i=t;for(const o of e){if(r){const s=Vs(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:sn((1-a)*r.x+a*o.x,5),y:sn((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),pm=g((e,t,r)=>{M.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Ks(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Ah(e,t,r){const i=structuredClone(r);M.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=Ks(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),h={x:0,y:0};return t==="start_left"?(h.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,h.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(h.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,h.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(h.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,h.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(h.x=Math.sin(n)*a+(i[0].x+s.x)/2,h.y=-Math.cos(n)*a+(i[0].y+s.y)/2),h}g(Ah,"calcTerminalLabelPosition");function _h(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}g(_h,"getStylesFromArray");var an=0,fm=g(()=>(an++,"id-"+Math.random().toString(36).substr(2,12)+"-"+an),"generateId");function Mh(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Mh,"makeRandomHex");var mm=g(e=>Mh(e.length),"random"),ym=g(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Cm=g(function(e,t){const r=t.text.replace(pi.lineBreakRegex," "),[,i]=io(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),xm=Ds((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),pi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const h=Ie(`${a} `,r),c=Ie(s,r);if(h>t){const{hyphenatedStrings:u,remainingWord:f}=bm(a,t,"-",r);o.push(s,...u),s=f}else c+h>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),bm=Ds((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,h)=>{const c=`${a}${n}`;if(Ie(c,i)>=t){const d=h+1,u=o.length===d,f=`${c}${r}`;s.push(u?c:f),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Ih(e,t){return Zs(e,t).height}g(Ih,"calculateTextHeight");function Ie(e,t){return Zs(e,t).width}g(Ie,"calculateTextWidth");var Zs=Ds((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=io(r),a=["sans-serif",i],n=e.split(pi.lineBreakRegex),h=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const l=c.append("svg");for(const u of a){let f=0;const m={width:0,height:0,lineHeight:0};for(const y of n){const x=ym();x.text=y||nm;const C=Cm(l,x).style("font-size",s).style("font-weight",o).style("font-family",u),b=(C._groups||C)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");m.width=Math.round(Math.max(m.width,b.width)),f=Math.round(b.height),m.height+=f,m.lineHeight=Math.round(Math.max(m.lineHeight,f))}h.push(m)}l.remove();const d=isNaN(h[1].height)||isNaN(h[1].width)||isNaN(h[1].lineHeight)||h[0].height>h[1].height&&h[0].width>h[1].width&&h[0].lineHeight>h[1].lineHeight?0:1;return h[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),km=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{g(this,"InitIDGenerator")}},Ti,Sm=g(function(e){return Ti=Ti||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ti.innerHTML=e,unescape(Ti.textContent)},"entityDecode");function Qs(e){return"str"in e}g(Qs,"isDetailedError");var Tm=g((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),io=g(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Js(e,t){return Gg({},e,t)}g(Js,"cleanAndMerge");var Vt={assignWithDepth:Ht,wrapLabel:xm,calculateTextHeight:Ih,calculateTextWidth:Ie,calculateTextDimensions:Zs,cleanAndMerge:Js,detectInit:cm,detectDirective:vh,isSubstringInArray:um,interpolateToCurve:Gs,calcLabelPosition:Eh,calcCardinalityPosition:pm,calcTerminalLabelPosition:Ah,formatUrl:Lh,getStylesFromArray:_h,generateId:fm,random:mm,runFunc:gm,entityDecode:Sm,insertTitle:Tm,isLabelCoordinateInPath:Oh,parseFontSize:io,InitIDGenerator:km},wm=g(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Ne=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),f2=g((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Wt(e){return e??null}g(Wt,"handleUndefinedAttr");function Oh(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}g(Oh,"isLabelCoordinateInPath");function ta(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var sr=ta();function $h(e){sr=e}var ii={exec:()=>null};function _t(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Jt.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var Bm=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Jt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},vm=/^(?:[ \t]*(?:\n|$))+/,Lm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Em=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ea=/(?:[*+-]|\d{1,9}[.)])/,Dh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ph=_t(Dh).replace(/bull/g,ea).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Am=_t(Dh).replace(/bull/g,ea).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ra=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_m=/^[^\n]+/,ia=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Mm=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ia).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Im=_t(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ea).getRegex(),oo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",oa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Om=_t("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",oa).replace("tag",oo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rh=_t(ra).replace("hr",mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oo).getRegex(),$m=_t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rh).getRegex(),sa={blockquote:$m,code:Lm,def:Mm,fences:Fm,heading:Em,hr:mi,html:Om,lheading:Ph,list:Im,newline:vm,paragraph:Rh,table:ii,text:_m},nn=_t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oo).getRegex(),Dm={...sa,lheading:Am,table:nn,paragraph:_t(ra).replace("hr",mi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",nn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oo).getRegex()},Pm={...sa,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oa).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ii,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(ra).replace("hr",mi).replace("heading",` *#{1,6} *[^
135
+ ]`).replace("lheading",Ph).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qh=/^( {2,}|\\)\n(?!\s*$)/,Nm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,so=/[\p{P}\p{S}]/u,aa=/[\s\p{P}\p{S}]/u,Nh=/[^\s\p{P}\p{S}]/u,Wm=_t(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,aa).getRegex(),Wh=/(?!~)[\p{P}\p{S}]/u,zm=/(?!~)[\s\p{P}\p{S}]/u,Hm=/(?:[^\s\p{P}\p{S}]|~)/u,Ym=_t(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Bm?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),zh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,jm=_t(zh,"u").replace(/punct/g,so).getRegex(),Xm=_t(zh,"u").replace(/punct/g,Wh).getRegex(),Hh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Um=_t(Hh,"gu").replace(/notPunctSpace/g,Nh).replace(/punctSpace/g,aa).replace(/punct/g,so).getRegex(),Gm=_t(Hh,"gu").replace(/notPunctSpace/g,Hm).replace(/punctSpace/g,zm).replace(/punct/g,Wh).getRegex(),Vm=_t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Nh).replace(/punctSpace/g,aa).replace(/punct/g,so).getRegex(),Km=_t(/\\(punct)/,"gu").replace(/punct/g,so).getRegex(),Zm=_t(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qm=_t(oa).replace("(?:-->|$)","-->").getRegex(),Jm=_t("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yi=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,ty=_t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Yi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yh=_t(/^!?\[(label)\]\[(ref)\]/).replace("label",Yi).replace("ref",ia).getRegex(),jh=_t(/^!?\[(ref)\](?:\[\])?/).replace("ref",ia).getRegex(),ey=_t("reflink|nolink(?!\\()","g").replace("reflink",Yh).replace("nolink",jh).getRegex(),ln=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,na={_backpedal:ii,anyPunctuation:Km,autolink:Zm,blockSkip:Ym,br:qh,code:qm,del:ii,emStrongLDelim:jm,emStrongRDelimAst:Um,emStrongRDelimUnd:Vm,escape:Rm,link:ty,nolink:jh,punctuation:Wm,reflink:Yh,reflinkSearch:ey,tag:Jm,text:Nm,url:ii},ry={...na,link:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",Yi).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yi).getRegex()},ps={...na,emStrongRDelimAst:Gm,emStrongLDelim:Xm,url:_t(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ln).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:_t(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ln).getRegex()},iy={...ps,br:_t(qh).replace("{2,}","*").getRegex(),text:_t(ps.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wi={normal:sa,gfm:Dm,pedantic:Pm},zr={normal:na,gfm:ps,breaks:iy,pedantic:ry},oy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},hn=e=>oy[e];function xe(e,t){if(t){if(Jt.escapeTest.test(e))return e.replace(Jt.escapeReplace,hn)}else if(Jt.escapeTestNoEncode.test(e))return e.replace(Jt.escapeReplaceNoEncode,hn);return e}function cn(e){try{e=encodeURI(e).replace(Jt.percentDecode,"%")}catch{return null}return e}function dn(e,t){let r=e.replace(Jt.findPipe,(s,a,n)=>{let h=!1,c=a;for(;--c>=0&&n[c]==="\\";)h=!h;return h?"|":" |"}),i=r.split(Jt.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(Jt.slashPipe,"|");return i}function Hr(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function sy(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function un(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let h={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,h}function ay(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
141
136
  `).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(`
142
- `)}var Xi=class{options;rules;lexer;constructor(t){this.options=t||sr}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Yr(i,`
143
- `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=hy(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=Yr(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Yr(r[0],`
144
- `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Yr(r[0],`
137
+ `)}var ji=class{options;rules;lexer;constructor(t){this.options=t||sr}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Hr(i,`
138
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=ay(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=Hr(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Hr(r[0],`
139
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Hr(r[0],`
145
140
  `).split(`
146
141
  `),o="",s="",a=[];for(;i.length>0;){let n=!1,h=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))h.push(i[c]),n=!0;else if(!n)h.push(i[c]);else break;i=i.slice(c);let l=h.join(`
147
142
  `),d=l.replace(this.rules.other.blockquoteSetextReplace,`
@@ -159,9 +154,9 @@ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
159
154
  `,1)[0],v;if(f=L,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),v=f):v=f.replace(this.rules.other.tabCharGlobal," "),w.test(f)||B.test(f)||F.test(f)||b.test(f)||T.test(f))break;if(v.search(this.rules.other.nonSpaceChar)>=y||!f.trim())d+=`
160
155
  `+v.slice(y);else{if(m||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(u)||B.test(u)||T.test(u))break;d+=`
161
156
  `+f}!m&&!f.trim()&&(m=!0),l+=L+`
162
- `,t=t.substring(L.length+1),u=v.slice(y)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(n=!0));let x=null,C;this.options.gfm&&(x=this.rules.other.listIsTask.exec(d),x&&(C=x[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:l,task:!!x,checked:C,loose:!1,text:d,tokens:[]}),s.raw+=l}let h=s.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let l=s.items[c].tokens.filter(u=>u.type==="space"),d=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=gn(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
163
- `):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of s)a.rows.push(gn(n,a.header.length).map((h,c)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
164
- `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Yr(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=ly(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),pn(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return pn(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,h=s,c=0,l=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,r=r.slice(-1*t.length+s);(o=l.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){h+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(h-=n,h>0)continue;n=Math.min(n,n+h+c);let d=[...o[0]][0].length,u=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let m=u.slice(1,-1);return{type:"em",raw:u,text:m,tokens:this.lexer.inlineTokens(m)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},ue=class ms{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||sr,this.options.tokenizer=this.options.tokenizer||new Xi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Jt,block:Bi.normal,inline:Hr.normal};this.options.pedantic?(r.block=Bi.pedantic,r.inline=Hr.pedantic):this.options.gfm&&(r.block=Bi.gfm,this.options.breaks?r.inline=Hr.breaks:r.inline=Hr.gfm),this.tokenizer.rules=r}static get rules(){return{block:Bi,inline:Hr}}static lex(t,r){return new ms(r).lex(t)}static lexInline(t,r){return new ms(r).inlineTokens(t)}lex(t){t=t.replace(Jt.carriageReturn,`
157
+ `,t=t.substring(L.length+1),u=v.slice(y)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(n=!0));let x=null,C;this.options.gfm&&(x=this.rules.other.listIsTask.exec(d),x&&(C=x[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:l,task:!!x,checked:C,loose:!1,text:d,tokens:[]}),s.raw+=l}let h=s.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let l=s.items[c].tokens.filter(u=>u.type==="space"),d=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=dn(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
158
+ `):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of s)a.rows.push(dn(n,a.header.length).map((h,c)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
159
+ `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Hr(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=sy(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),un(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return un(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,h=s,c=0,l=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,r=r.slice(-1*t.length+s);(o=l.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){h+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(h-=n,h>0)continue;n=Math.min(n,n+h+c);let d=[...o[0]][0].length,u=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let m=u.slice(1,-1);return{type:"em",raw:u,text:m,tokens:this.lexer.inlineTokens(m)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},ue=class fs{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||sr,this.options.tokenizer=this.options.tokenizer||new ji,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Jt,block:wi.normal,inline:zr.normal};this.options.pedantic?(r.block=wi.pedantic,r.inline=zr.pedantic):this.options.gfm&&(r.block=wi.gfm,this.options.breaks?r.inline=zr.breaks:r.inline=zr.gfm),this.tokenizer.rules=r}static get rules(){return{block:wi,inline:zr}}static lex(t,r){return new fs(r).lex(t)}static lexInline(t,r){return new fs(r).inlineTokens(t)}lex(t){t=t.replace(Jt.carriageReturn,`
165
160
  `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(Jt.tabCharGlobal," ").replace(Jt.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
166
161
  `:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
167
162
  `)?"":`
@@ -175,7 +170,7 @@ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
175
170
  `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
176
171
  `)?"":`
177
172
  `)+o.raw,a.text+=`
178
- `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)h.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let h;if(this.options.extensions?.inline?.some(l=>(h=l.call({lexer:this},t,r))?(t=t.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(h.raw.length);let l=r.at(-1);h.type==="text"&&l?.type==="text"?(l.raw+=h.raw,l.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(t,i,n)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(t)){t=t.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(t))){t=t.substring(h.raw.length),r.push(h);continue}let c=t;if(this.options.extensions?.startInline){let l=1/0,d=t.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=t.substring(0,l+1))}if(h=this.tokenizer.inlineText(c)){t=t.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(n=h.raw.slice(-1)),a=!0;let l=r.at(-1);l?.type==="text"?(l.raw+=h.raw,l.text+=h.text):r.push(h);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return r}},Ui=class{options;parser;constructor(t){this.options=t||sr}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(Jt.notSpaceStart)?.[0],s=t.replace(Jt.endingNewline,"")+`
173
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)h.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let h;if(this.options.extensions?.inline?.some(l=>(h=l.call({lexer:this},t,r))?(t=t.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(h.raw.length);let l=r.at(-1);h.type==="text"&&l?.type==="text"?(l.raw+=h.raw,l.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(t,i,n)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(t)){t=t.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(t)){t=t.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(t))){t=t.substring(h.raw.length),r.push(h);continue}let c=t;if(this.options.extensions?.startInline){let l=1/0,d=t.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=t.substring(0,l+1))}if(h=this.tokenizer.inlineText(c)){t=t.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(n=h.raw.slice(-1)),a=!0;let l=r.at(-1);l?.type==="text"?(l.raw+=h.raw,l.text+=h.text):r.push(h);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return r}},Xi=class{options;parser;constructor(t){this.options=t||sr}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(Jt.notSpaceStart)?.[0],s=t.replace(Jt.endingNewline,"")+`
179
174
  `;return o?'<pre><code class="language-'+xe(o)+'">'+(i?s:xe(s,!0))+`</code></pre>
180
175
  `:"<pre><code>"+(i?s:xe(s,!0))+`</code></pre>
181
176
  `}blockquote({tokens:t}){return`<blockquote>
@@ -193,25 +188,25 @@ ${this.parser.parse(t)}</blockquote>
193
188
  `}tablerow({text:t}){return`<tr>
194
189
  ${t}</tr>
195
190
  `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
196
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${xe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=un(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+xe(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=un(t);if(s===null)return xe(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${xe(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:xe(t.text)}},ha=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ge=class ys{options;renderer;textRenderer;constructor(t){this.options=t||sr,this.options.renderer=this.options.renderer||new Ui,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ha}static parse(t,r){return new ys(r).parse(t)}static parseInline(t,r){return new ys(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=s,h=this.options.extensions.renderers[n.type].call({parser:this},n);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=h||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,h=this.renderer.text(n);for(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],h+=`
197
- `+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):i+=h;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},Kr=class{options;block;constructor(t){this.options=t||sr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?ue.lex:ue.lexInline}provideParser(){return this.block?ge.parse:ge.parseInline}},cy=class{defaults=ea();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ge;Renderer=Ui;TextRenderer=ha;Lexer=ue;Tokenizer=Xi;Hooks=Kr;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let h=s.renderer.apply(this,n);return h===!1&&(h=a.apply(this,n)),h}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new Ui(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,h=i.renderer[n],c=s[n];s[n]=(...l)=>{let d=h.apply(s,l);return d===!1&&(d=c.apply(s,l)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new Xi(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,h=i.tokenizer[n],c=s[n];s[n]=(...l)=>{let d=h.apply(s,l);return d===!1&&(d=c.apply(s,l)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Kr;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,h=i.hooks[n],c=s[n];Kr.passThroughHooks.has(a)?s[n]=l=>{if(this.defaults.async&&Kr.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await h.call(s,l);return c.call(s,u)})();let d=h.call(s,l);return c.call(s,d)}:s[n]=(...l)=>{if(this.defaults.async)return(async()=>{let u=await h.apply(s,l);return u===!1&&(u=await c.apply(s,l)),u})();let d=h.apply(s,l);return d===!1&&(d=c.apply(s,l)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let h=[];return h.push(a.call(this,n)),s&&(h=h.concat(s.call(this,n))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return ue.lex(t,r??this.defaults)}parser(t,r){return ge.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,h=await(s.hooks?await s.hooks.provideLexer():t?ue.lex:ue.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(h):h;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let l=await(s.hooks?await s.hooks.provideParser():t?ge.parse:ge.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(l):l})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?ue.lex:ue.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let h=(s.hooks?s.hooks.provideParser():t?ge.parse:ge.parseInline)(n,s);return s.hooks&&(h=s.hooks.postprocess(h)),h}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
198
- Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+xe(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},er=new cy;function It(e,t){return er.parse(e,t)}It.options=It.setOptions=function(e){return er.setOptions(e),It.defaults=er.defaults,Ph(It.defaults),It};It.getDefaults=ea;It.defaults=sr;It.use=function(...e){return er.use(...e),It.defaults=er.defaults,Ph(It.defaults),It};It.walkTokens=function(e,t){return er.walkTokens(e,t)};It.parseInline=er.parseInline;It.Parser=ge;It.parser=ge.parse;It.Renderer=Ui;It.TextRenderer=ha;It.Lexer=ue;It.lexer=ue.lex;It.Tokenizer=Xi;It.Hooks=Kr;It.parse=It;It.options;It.setOptions;It.use;It.walkTokens;It.parseInline;ge.parse;ue.lex;var Cs=typeof performance<"u"&&typeof performance.now=="function",pr=g(()=>Cs?performance.now():0,"now"),ko="🧜 ",dy="Mermaid render",uy="Mermaid",gy={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"};(class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}static{g(this,"Profiler")}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(e){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(e))}tickSync(e,t){if(!this.enabled)return t();const r=pr();try{return t()}finally{this.buckets[e]=(this.buckets[e]??0)+(pr()-r)}}async tick(e,t){if(!this.enabled)return t();const r=pr();try{return await t()}finally{this.buckets[e]=(this.buckets[e]??0)+(pr()-r)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const e=this.roots.at(-1),t=this.runLabel??e?.name;return e&&(this.records.push({label:t??e.name,tree:e,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(e,t)),this.runLabel=void 0,e}begin(e){if(!this.enabled)return;const t={name:e,start:pr(),duration:-1,children:[]},r=this.stack.at(-1);if(r?r.children.push(t):this.roots.push(t),this.stack.push(t),Cs&&typeof performance.mark=="function")try{performance.mark(`${ko}${e} ▶`)}catch{}}end(){if(!this.enabled)return;const e=this.stack.pop();if(!e)return;const t=pr();if(e.duration=t-e.start,Cs&&typeof performance.measure=="function")try{performance.measure(`${ko}${e.name}`,{start:e.start,end:t,detail:{devtools:{dataType:"track-entry",track:dy,trackGroup:uy,color:gy[e.name]??"primary",tooltipText:`${e.name} — ${e.duration.toFixed(1)} ms`}}})}catch{}}async span(e,t){if(!this.enabled)return t();this.begin(e);try{return await t()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(e=this.report(),t){if(!e)return;const r=e.duration,i=t&&t!==e.name?`${e.name} [${t}]`:e.name,o=["ms % phase"],s=g((n,h)=>{const c=" ".repeat(h),l=n.duration.toFixed(1).padStart(8),d=r>0?`${(n.duration/r*100).toFixed(0).padStart(3)}%`:" -";o.push(`${l} ${d} ${c}${n.name}`);for(const u of n.children)s(u,h+1);if(n.children.length>0){const u=n.children.reduce((m,y)=>m+y.duration,0),f=n.duration-u;if(f>.5){const m=f.toFixed(1).padStart(8);o.push(`${m} ${c} (self)`)}}},"walk");s(e,0);const a=Object.keys(this.buckets);if(a.length>0){o.push("—— buckets (summed) ——");for(const n of a)o.push(`${this.buckets[n].toFixed(1).padStart(8)} ${n}`)}console.log(`${ko}mermaid render profile · ${i}
191
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${xe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=cn(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+xe(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=cn(t);if(s===null)return xe(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${xe(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:xe(t.text)}},la=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ge=class ms{options;renderer;textRenderer;constructor(t){this.options=t||sr,this.options.renderer=this.options.renderer||new Xi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new la}static parse(t,r){return new ms(r).parse(t)}static parseInline(t,r){return new ms(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=s,h=this.options.extensions.renderers[n.type].call({parser:this},n);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=h||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,h=this.renderer.text(n);for(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],h+=`
192
+ `+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):i+=h;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},Vr=class{options;block;constructor(t){this.options=t||sr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?ue.lex:ue.lexInline}provideParser(){return this.block?ge.parse:ge.parseInline}},ny=class{defaults=ta();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ge;Renderer=Xi;TextRenderer=la;Lexer=ue;Tokenizer=ji;Hooks=Vr;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let h=s.renderer.apply(this,n);return h===!1&&(h=a.apply(this,n)),h}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new Xi(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,h=i.renderer[n],c=s[n];s[n]=(...l)=>{let d=h.apply(s,l);return d===!1&&(d=c.apply(s,l)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new ji(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,h=i.tokenizer[n],c=s[n];s[n]=(...l)=>{let d=h.apply(s,l);return d===!1&&(d=c.apply(s,l)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Vr;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,h=i.hooks[n],c=s[n];Vr.passThroughHooks.has(a)?s[n]=l=>{if(this.defaults.async&&Vr.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await h.call(s,l);return c.call(s,u)})();let d=h.call(s,l);return c.call(s,d)}:s[n]=(...l)=>{if(this.defaults.async)return(async()=>{let u=await h.apply(s,l);return u===!1&&(u=await c.apply(s,l)),u})();let d=h.apply(s,l);return d===!1&&(d=c.apply(s,l)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let h=[];return h.push(a.call(this,n)),s&&(h=h.concat(s.call(this,n))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return ue.lex(t,r??this.defaults)}parser(t,r){return ge.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,h=await(s.hooks?await s.hooks.provideLexer():t?ue.lex:ue.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(h):h;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let l=await(s.hooks?await s.hooks.provideParser():t?ge.parse:ge.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(l):l})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?ue.lex:ue.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let h=(s.hooks?s.hooks.provideParser():t?ge.parse:ge.parseInline)(n,s);return s.hooks&&(h=s.hooks.postprocess(h)),h}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
193
+ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+xe(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},er=new ny;function It(e,t){return er.parse(e,t)}It.options=It.setOptions=function(e){return er.setOptions(e),It.defaults=er.defaults,$h(It.defaults),It};It.getDefaults=ta;It.defaults=sr;It.use=function(...e){return er.use(...e),It.defaults=er.defaults,$h(It.defaults),It};It.walkTokens=function(e,t){return er.walkTokens(e,t)};It.parseInline=er.parseInline;It.Parser=ge;It.parser=ge.parse;It.Renderer=Xi;It.TextRenderer=la;It.Lexer=ue;It.lexer=ue.lex;It.Tokenizer=ji;It.Hooks=Vr;It.parse=It;It.options;It.setOptions;It.use;It.walkTokens;It.parseInline;ge.parse;ue.lex;var ys=typeof performance<"u"&&typeof performance.now=="function",pr=g(()=>ys?performance.now():0,"now"),bo="🧜 ",ly="Mermaid render",hy="Mermaid",cy={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"};(class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}static{g(this,"Profiler")}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(e){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(e))}tickSync(e,t){if(!this.enabled)return t();const r=pr();try{return t()}finally{this.buckets[e]=(this.buckets[e]??0)+(pr()-r)}}async tick(e,t){if(!this.enabled)return t();const r=pr();try{return await t()}finally{this.buckets[e]=(this.buckets[e]??0)+(pr()-r)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const e=this.roots.at(-1),t=this.runLabel??e?.name;return e&&(this.records.push({label:t??e.name,tree:e,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(e,t)),this.runLabel=void 0,e}begin(e){if(!this.enabled)return;const t={name:e,start:pr(),duration:-1,children:[]},r=this.stack.at(-1);if(r?r.children.push(t):this.roots.push(t),this.stack.push(t),ys&&typeof performance.mark=="function")try{performance.mark(`${bo}${e} ▶`)}catch{}}end(){if(!this.enabled)return;const e=this.stack.pop();if(!e)return;const t=pr();if(e.duration=t-e.start,ys&&typeof performance.measure=="function")try{performance.measure(`${bo}${e.name}`,{start:e.start,end:t,detail:{devtools:{dataType:"track-entry",track:ly,trackGroup:hy,color:cy[e.name]??"primary",tooltipText:`${e.name} — ${e.duration.toFixed(1)} ms`}}})}catch{}}async span(e,t){if(!this.enabled)return t();this.begin(e);try{return await t()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(e=this.report(),t){if(!e)return;const r=e.duration,i=t&&t!==e.name?`${e.name} [${t}]`:e.name,o=["ms % phase"],s=g((n,h)=>{const c=" ".repeat(h),l=n.duration.toFixed(1).padStart(8),d=r>0?`${(n.duration/r*100).toFixed(0).padStart(3)}%`:" -";o.push(`${l} ${d} ${c}${n.name}`);for(const u of n.children)s(u,h+1);if(n.children.length>0){const u=n.children.reduce((m,y)=>m+y.duration,0),f=n.duration-u;if(f>.5){const m=f.toFixed(1).padStart(8);o.push(`${m} ${c} (self)`)}}},"walk");s(e,0);const a=Object.keys(this.buckets);if(a.length>0){o.push("—— buckets (summed) ——");for(const n of a)o.push(`${this.buckets[n].toFixed(1).padStart(8)} ${n}`)}console.log(`${bo}mermaid render profile · ${i}
199
194
  ${o.join(`
200
- `)}`)}});globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};var py=Kg.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(Zg),rr=py;function Gh(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
195
+ `)}`)}});globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};var dy=Vg.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(Kg),rr=dy;function Xh(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
201
196
  `).replace(/\n{2,}/g,`
202
- `);return Ql(i)}g(Gh,"preprocessMarkdown");function Vh(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}g(Vh,"nonMarkdownToLines");function Kh(e,t={}){const r=Gh(e,t),i=It.lexer(r),o=[[]];let s=0;function a(n,h="normal"){n.type==="text"?n.text.split(`
203
- `).forEach((l,d)=>{d!==0&&(s++,o.push([])),l.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&o[s].push({content:u,type:h})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return g(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(h=>{a(h)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}g(Kh,"markdownToLines");function Zh(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}g(Zh,"nonMarkdownToHTML");function Qh(e,{markdownAutoWrap:t}={}){const r=It.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(M.warn(`Unsupported markdown: ${o.type}`),o.raw)}return g(i,"output"),r.map(i).join("")}g(Qh,"markdownToHTML");function Jh(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(Jh,"splitTextToChars");function tc(e,t){const r=Jh(t.content);return ca(e,[],r,t.type)}g(tc,"splitWordToFitWidth");function ca(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?ca(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(ca,"splitWordToFitWidthRecursion");function ec(e,t){if(e.some(({content:r})=>r.includes(`
204
- `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Gi(e,t)}g(ec,"splitLineToFitWidth");function Gi(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Gi(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,h]=tc(t,s);r.push([n]),h.content&&e.unshift(h)}return Gi(e,t,r)}g(Gi,"splitLineToFitWidthRecursion");function xs(e,t){t&&e.attr("style",t)}g(xs,"applyStyle");var fn=16384;async function rc(e,t,r,i,o=!1,s=Dt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,fn)}px`),a.attr("height",`${Math.min(10*r,fn)}px`);const n=a.append("xhtml:div"),h=ni(t.label)?await Sh(t.label.replace(fi.lineBreakRegex,`
205
- `),s):ae(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",l=n.append("span");return l.html(h),xs(l,t.labelStyle),l.attr("class",`${c} ${i}`),xs(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg"),(await rr.measure(()=>n.node().getBoundingClientRect())).width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px")),a.node()}g(rc,"addHtmlSpan");function no(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}g(no,"createTspan");function ic(e,t,r){const i=e.append("text"),o=no(i,1,t);lo(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}g(ic,"computeWidthOfText");function fy(e,t,r){const i=e.append("text"),o=no(i,1,t);lo(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}g(fy,"computeDimensionOfText");function oc(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),h=a.append("text").attr("y","-10.1");o&&h.attr("text-anchor","middle");let c=0;for(const l of r){const d=g(f=>ic(a,1.1,f)<=e,"checkWidth"),u=d(l)?[l]:ec(l,d);for(const f of u){const m=no(h,c,1.1,o);lo(m,f),c++}}if(i){const l=h.node().getBBox(),d=2;return n.attr("x",l.x-d).attr("y",l.y-d).attr("width",l.width+2*d).attr("height",l.height+2*d),a.node()}else return h.node()}g(oc,"createFormattedText");function bs(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}g(bs,"decodeHTMLEntities");function lo(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(bs(r.content)):o.text(" "+bs(r.content))})}g(lo,"updateTextContentAndStyles");async function sc(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await am(n)?await mi(n,void 0,{class:"label-icon"}):`<i class='${ae(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(sc,"replaceIconSubstring");var me=g(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:h=200,addSvgBackground:c=!1}={},l)=>{if(M.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Qh(t,l):Zh(t),u=await sc(Ne(d),l),f=t.replace(/\\\\/g,"\\"),m={isNode:n,label:ni(t)?f:u,labelStyle:r.replace("fill:","color:")};return await rc(e,m,h,o,c,l)}else{const d=Ne(t.replace(/<br\s*\/?>/g,"<br/>")),u=a?Kh(d.replace("<br>","<br/>"),l):Vh(d),f=oc(h,e,u,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(f).attr("style",m)}else{const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(f).select("rect").attr("style",m.replace(/background:/g,"fill:"));const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(f).select("text").attr("style",y)}return i?yt(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function So(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const h of e){const[c,l]=h;h[0]=(c-i)*a-(l-o)*n+i,h[1]=(c-i)*n+(l-o)*a+o}}}function my(e,t){return e[0]===t[0]&&e[1]===t[1]}function yy(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)So(c,n,o);const h=(function(c,l,d){const u=[];for(const b of c){const T=[...b];my(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&u.push(T)}const f=[];l=Math.max(l,.1);const m=[];for(const b of u)for(let T=0;T<b.length-1;T++){const w=b[T],B=b[T+1];if(w[1]!==B[1]){const F=Math.min(w[1],B[1]);m.push({ymin:F,ymax:Math.max(w[1],B[1]),x:F===w[1]?w[0]:B[0],islope:(B[0]-w[0])/(B[1]-w[1])})}}if(m.sort(((b,T)=>b.ymin<T.ymin?-1:b.ymin>T.ymin?1:b.x<T.x?-1:b.x>T.x?1:b.ymax===T.ymax?0:(b.ymax-T.ymax)/Math.abs(b.ymax-T.ymax))),!m.length)return f;let y=[],x=m[0].ymin,C=0;for(;y.length||m.length;){if(m.length){let b=-1;for(let T=0;T<m.length&&!(m[T].ymin>x);T++)b=T;m.splice(0,b+1).forEach((T=>{y.push({s:x,edge:T})}))}if(y=y.filter((b=>!(b.edge.ymax<=x))),y.sort(((b,T)=>b.edge.x===T.edge.x?0:(b.edge.x-T.edge.x)/Math.abs(b.edge.x-T.edge.x))),(d!==1||C%l==0)&&y.length>1)for(let b=0;b<y.length;b+=2){const T=b+1;if(T>=y.length)break;const w=y[b].edge,B=y[T].edge;f.push([[Math.round(w.x),x],[Math.round(B.x),x]])}x+=d,y.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),C++}return f})(a,s,i);if(o){for(const c of a)So(c,n,-o);(function(c,l,d){const u=[];c.forEach((f=>u.push(...f))),So(u,l,d)})(h,n,-o)}return h}function Ci(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),yy(e,o,i,s||1)}class da{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Ci(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function ho(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class Cy extends da{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Ci(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),h=.5*i*Math.sin(s);for(const[c,l]of o)ho([c,l])&&a.push([[c[0]-n,c[1]+h],[...l]],[[c[0]+n,c[1]-h],[...l]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class xy extends da{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class by{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ci(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const h=ho(n),c=h/o,l=Math.ceil(c)-1,d=h-l*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let m=0;m<l;m++){const y=f+d+m*o,x=u-a+2*Math.random()*a,C=y-a+2*Math.random()*a,b=this.helper.ellipse(x,C,s,s,r);i.push(...b.ops)}}return{type:"fillSketch",ops:i}}}class ky{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ci(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=ho(a),h=Math.floor(n/(i+o)),c=(n+o-h*(i+o))/2;let l=a[0],d=a[1];l[0]>d[0]&&(l=a[1],d=a[0]);const u=Math.atan((d[1]-l[1])/(d[0]-l[0]));for(let f=0;f<h;f++){const m=f*(i+o),y=m+i,x=[l[0]+m*Math.cos(u)+c*Math.cos(u),l[1]+m*Math.sin(u)+c*Math.sin(u)],C=[l[0]+y*Math.cos(u)+c*Math.cos(u),l[1]+y*Math.sin(u)+c*Math.sin(u)];s.push(...this.helper.doubleLineOps(x[0],x[1],C[0],C[1],r))}})),s}}class Sy{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=Ci(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=ho(s),n=Math.round(a/(2*r));let h=s[0],c=s[1];h[0]>c[0]&&(h=s[1],c=s[0]);const l=Math.atan((c[1]-h[1])/(c[0]-h[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,m=Math.sqrt(2*Math.pow(r,2)),y=[h[0]+u*Math.cos(l),h[1]+u*Math.sin(l)],x=[h[0]+f*Math.cos(l),h[1]+f*Math.sin(l)],C=[y[0]+m*Math.cos(l+Math.PI/4),y[1]+m*Math.sin(l+Math.PI/4)];o.push(...this.helper.doubleLineOps(y[0],y[1],C[0],C[1],i),...this.helper.doubleLineOps(C[0],C[1],x[0],x[1],i))}})),o}}const te={};class Ty{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const wy=0,To=1,mn=2,vi={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function wo(e,t){return e.type===t}function ua(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:wy,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:To,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:mn,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!wo(s,mn);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return ua("M0,0"+e);o++,a=vi[s.text],i=s.text}else wo(s,To)?a=vi[i]:(o++,a=vi[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let h=o;h<o+a;h++){const c=r[h];if(!wo(c,To))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof vi[i]!="number")throw new Error("Bad segment: "+i);{const h={key:i,data:n};t.push(h),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function ac(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const h=n.map(((c,l)=>l%2?c+r:c+t));s.push({key:"C",data:h}),t=h[4],r=h[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const h=n.map(((c,l)=>l%2?c+r:c+t));s.push({key:"Q",data:h}),t=h[2],r=h[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const h=n.map(((c,l)=>l%2?c+r:c+t));s.push({key:"S",data:h}),t=h[2],r=h[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function nc(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,h=0;for(const{key:c,data:l}of e){switch(c){case"M":t.push({key:"M",data:[...l]}),[i,o]=l,[s,a]=l;break;case"C":t.push({key:"C",data:[...l]}),i=l[4],o=l[5],n=l[2],h=l[3];break;case"L":t.push({key:"L",data:[...l]}),[i,o]=l;break;case"H":i=l[0],t.push({key:"L",data:[i,o]});break;case"V":o=l[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-h)):(d=i,u=o),t.push({key:"C",data:[d,u,...l]}),n=l[0],h=l[1],i=l[2],o=l[3];break}case"T":{const[d,u]=l;let f=0,m=0;r==="Q"||r==="T"?(f=i+(i-n),m=o+(o-h)):(f=i,m=o);const y=i+2*(f-i)/3,x=o+2*(m-o)/3,C=d+2*(f-d)/3,b=u+2*(m-u)/3;t.push({key:"C",data:[y,x,C,b,d,u]}),n=f,h=m,i=d,o=u;break}case"Q":{const[d,u,f,m]=l,y=i+2*(d-i)/3,x=o+2*(u-o)/3,C=f+2*(d-f)/3,b=m+2*(u-m)/3;t.push({key:"C",data:[y,x,C,b,f,m]}),n=d,h=u,i=f,o=m;break}case"A":{const d=Math.abs(l[0]),u=Math.abs(l[1]),f=l[2],m=l[3],y=l[4],x=l[5],C=l[6];d===0||u===0?(t.push({key:"C",data:[i,o,x,C,x,C]}),i=x,o=C):(i!==x||o!==C)&&(lc(i,o,x,C,d,u,f,m,y).forEach((function(b){t.push({key:"C",data:b})})),i=x,o=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function jr(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function lc(e,t,r,i,o,s,a,n,h,c){const l=(d=a,Math.PI*d/180);var d;let u=[],f=0,m=0,y=0,x=0;if(c)[f,m,y,x]=c;else{[e,t]=jr(e,t,-l),[r,i]=jr(r,i,-l);const W=(e-r)/2,z=(t-i)/2;let V=W*W/(o*o)+z*z/(s*s);V>1&&(V=Math.sqrt(V),o*=V,s*=V);const I=o*o,P=s*s,Y=I*P-I*z*z-P*W*W,lt=I*z*z+P*W*W,at=(n===h?-1:1)*Math.sqrt(Math.abs(Y/lt));y=at*o*z/s+(e+r)/2,x=at*-s*W/o+(t+i)/2,f=Math.asin(parseFloat(((t-x)/s).toFixed(9))),m=Math.asin(parseFloat(((i-x)/s).toFixed(9))),e<y&&(f=Math.PI-f),r<y&&(m=Math.PI-m),f<0&&(f=2*Math.PI+f),m<0&&(m=2*Math.PI+m),h&&f>m&&(f-=2*Math.PI),!h&&m>f&&(m-=2*Math.PI)}let C=m-f;if(Math.abs(C)>120*Math.PI/180){const W=m,z=r,V=i;m=h&&m>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=lc(r=y+o*Math.cos(m),i=x+s*Math.sin(m),z,V,o,s,a,0,h,[m,W,y,x])}C=m-f;const b=Math.cos(f),T=Math.sin(f),w=Math.cos(m),B=Math.sin(m),F=Math.tan(C/4),L=4/3*o*F,v=4/3*s*F,R=[e,t],N=[e+L*T,t-v*b],q=[r+L*B,i-v*w],J=[r,i];if(N[0]=2*R[0]-N[0],N[1]=2*R[1]-N[1],c)return[N,q,J].concat(u);{u=[N,q,J].concat(u);const W=[];for(let z=0;z<u.length;z+=3){const V=jr(u[z][0],u[z][1],l),I=jr(u[z+1][0],u[z+1][1],l),P=jr(u[z+2][0],u[z+2][1],l);W.push([V[0],V[1],I[0],I[1],P[0],P[1]])}return W}}const By={randOffset:function(e,t){return pt(e,t)},randOffsetWithRange:function(e,t,r){return Vi(e,t,r)},ellipse:function(e,t,r,i,o){const s=cc(r,i,o);return ks(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return We(e,t,r,i,o,!0)}};function hc(e,t,r,i,o){return{type:"path",ops:We(e,t,r,i,o)}}function $i(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...We(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...We(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?hc(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function vy(e,t,r,i,o){return(function(s,a){return $i(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function yn(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Li(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Li(r[0],1.5*(1+.22*t.roughness),bn(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=Li(a,1*(1+.2*t.roughness),t),h=t.disableMultiStroke?[]:Li(a,1.5*(1+.22*t.roughness),bn(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of h)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function cc(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const h=1-r.curveFitting;return a+=pt(a*h,r),n+=pt(n*h,r),{increment:s,rx:a,ry:n}}function ks(e,t,r,i){const[o,s]=kn(i.increment,e,t,i.rx,i.ry,1,i.increment*Vi(.1,Vi(.4,1,r),r),r);let a=Ki(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=kn(i.increment,e,t,i.rx,i.ry,1.5,0,r),h=Ki(n,null,r);a=a.concat(h)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function Cn(e,t,r,i,o,s,a,n,h){const c=e,l=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=pt(.01*d,h),u+=pt(.01*u,h);let f=o,m=s;for(;f<0;)f+=2*Math.PI,m+=2*Math.PI;m-f>2*Math.PI&&(f=0,m=2*Math.PI);const y=2*Math.PI/h.curveStepCount,x=Math.min(y/2,(m-f)/2),C=Sn(x,c,l,d,u,f,m,1,h);if(!h.disableMultiStroke){const b=Sn(x,c,l,d,u,f,m,1.5,h);C.push(...b)}return a&&(n?C.push(...We(c,l,c+d*Math.cos(f),l+u*Math.sin(f),h),...We(c,l,c+d*Math.cos(m),l+u*Math.sin(m),h)):C.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+d*Math.cos(f),l+u*Math.sin(f)]})),{type:"path",ops:C}}function xn(e,t){const r=nc(ac(ua(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...We(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[h,c,l,d,u,f]=n;i.push(...Ly(h,c,l,d,u,f,s,t)),s=[u,f];break}case"Z":i.push(...We(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Bo(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+pt(o,t),i[0][1]+pt(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+pt(o,t),i[a][1]+pt(o,t)]})}}return{type:"fillPath",ops:r}}function fr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!te[o])switch(o){case"zigzag":te[o]||(te[o]=new Cy(i));break;case"cross-hatch":te[o]||(te[o]=new xy(i));break;case"dots":te[o]||(te[o]=new by(i));break;case"dashed":te[o]||(te[o]=new ky(i));break;case"zigzag-line":te[o]||(te[o]=new Sy(i));break;default:o="hachure",te[o]||(te[o]=new da(i))}return te[o]})(t,By).fillPolygons(e,t)}function bn(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function dc(e){return e.randomizer||(e.randomizer=new Ty(e.seed||0)),e.randomizer.next()}function Vi(e,t,r,i=1){return r.roughness*i*(dc(r)*(t-e)+e)}function pt(e,t,r=1){return Vi(-e,e,t,r)}function We(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=Ss(e,t,r,i,o,!0,!1);if(a)return n;const h=Ss(e,t,r,i,o,!0,!0);return n.concat(h)}function Ss(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),h=Math.sqrt(n);let c=1;c=h<200?1:h>500?.4:-.0016668*h+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>n&&(l=h/10);const d=l/2,u=.2+.2*dc(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,m=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=pt(f,o,c),m=pt(m,o,c);const y=[],x=()=>pt(d,o,c),C=()=>pt(l,o,c),b=o.preserveVertices;return a?y.push({op:"move",data:[e+(b?0:x()),t+(b?0:x())]}):y.push({op:"move",data:[e+(b?0:pt(l,o,c)),t+(b?0:pt(l,o,c))]}),a?y.push({op:"bcurveTo",data:[f+e+(r-e)*u+x(),m+t+(i-t)*u+x(),f+e+2*(r-e)*u+x(),m+t+2*(i-t)*u+x(),r+(b?0:x()),i+(b?0:x())]}):y.push({op:"bcurveTo",data:[f+e+(r-e)*u+C(),m+t+(i-t)*u+C(),f+e+2*(r-e)*u+C(),m+t+2*(i-t)*u+C(),r+(b?0:C()),i+(b?0:C())]}),y}function Li(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+pt(t,r),e[0][1]+pt(t,r)]),i.push([e[0][0]+pt(t,r),e[0][1]+pt(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+pt(t,r),e[o][1]+pt(t,r)]),o===e.length-1&&i.push([e[o][0]+pt(t,r),e[o][1]+pt(t,r)]);return Ki(i,null,r)}function Ki(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const h=e[n];s[0]=[h[0],h[1]],s[1]=[h[0]+(a*e[n+1][0]-a*e[n-1][0])/6,h[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...Ss(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function kn(e,t,r,i,o,s,a,n){const h=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let l=0;l<=2*Math.PI;l+=e){const d=[t+i*Math.cos(l),r+o*Math.sin(l)];h.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const l=pt(.5,n)-Math.PI/2;c.push([pt(s,n)+t+.9*i*Math.cos(l-e),pt(s,n)+r+.9*o*Math.sin(l-e)]);const d=2*Math.PI+l-.01;for(let u=l;u<d;u+=e){const f=[pt(s,n)+t+i*Math.cos(u),pt(s,n)+r+o*Math.sin(u)];h.push(f),c.push(f)}c.push([pt(s,n)+t+i*Math.cos(l+2*Math.PI+.5*a),pt(s,n)+r+o*Math.sin(l+2*Math.PI+.5*a)]),c.push([pt(s,n)+t+.98*i*Math.cos(l+a),pt(s,n)+r+.98*o*Math.sin(l+a)]),c.push([pt(s,n)+t+.9*i*Math.cos(l+.5*a),pt(s,n)+r+.9*o*Math.sin(l+.5*a)])}return[c,h]}function Sn(e,t,r,i,o,s,a,n,h){const c=s+pt(.1,h),l=[];l.push([pt(n,h)+t+.9*i*Math.cos(c-e),pt(n,h)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)l.push([pt(n,h)+t+i*Math.cos(d),pt(n,h)+r+o*Math.sin(d)]);return l.push([t+i*Math.cos(a),r+o*Math.sin(a)]),l.push([t+i*Math.cos(a),r+o*Math.sin(a)]),Ki(l,null,h)}function Ly(e,t,r,i,o,s,a,n){const h=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let l=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?h.push({op:"move",data:[a[0],a[1]]}):h.push({op:"move",data:[a[0]+(u?0:pt(c[0],n)),a[1]+(u?0:pt(c[0],n))]}),l=u?[o,s]:[o+pt(c[f],n),s+pt(c[f],n)],h.push({op:"bcurveTo",data:[e+pt(c[f],n),t+pt(c[f],n),r+pt(c[f],n),i+pt(c[f],n),l[0],l[1]]});return h}function Xr(e){return[...e]}function Tn(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Xr(e[0]),Xr(e[1]),Xr(e[2]),Xr(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(Xr(o[0]));for(let n=1;n+2<o.length;n++){const h=o[n];s[0]=[h[0],h[1]],s[1]=[h[0]+(a*o[n+1][0]-a*o[n-1][0])/6,h[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function Di(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Fy(e,t,r){const i=Di(t,r);if(i===0)return Di(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),Di(e,Ue(t,r,o))}function Ue(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Ts(e,t,r,i){const o=i||[];if((function(n,h){const c=n[h+0],l=n[h+1],d=n[h+2],u=n[h+3];let f=3*l[0]-2*c[0]-u[0];f*=f;let m=3*l[1]-2*c[1]-u[1];m*=m;let y=3*d[0]-2*u[0]-c[0];y*=y;let x=3*d[1]-2*u[1]-c[1];return x*=x,f<y&&(f=y),m<x&&(m=x),f+m})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(Di(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const h=e[t+0],c=e[t+1],l=e[t+2],d=e[t+3],u=Ue(h,c,.5),f=Ue(c,l,.5),m=Ue(l,d,.5),y=Ue(u,f,.5),x=Ue(f,m,.5),C=Ue(y,x,.5);Ts([h,u,y,C],0,r,o),Ts([C,x,m,d],0,r,o)}var s,a;return o}function Ey(e,t){return Zi(e,0,e.length,t)}function Zi(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let h=0,c=1;for(let l=t+1;l<r-1;++l){const d=Fy(e[l],a,n);d>h&&(h=d,c=l)}return Math.sqrt(h)>i?(Zi(e,t,c+1,i,s),Zi(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function vo(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)Ts(e,3*s,t,i);return r&&r>0?Zi(i,0,i.length,r):i}const ie="none";class Qi{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[hc(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],h=vy(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(Bo([c],a)):n.push(fr([c],a))}return a.stroke!==ie&&n.push(h),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],h=cc(i,o,a),c=ks(t,r,a,h);if(a.fill)if(a.fillStyle==="solid"){const l=ks(t,r,a,h).opset;l.type="fillPath",n.push(l)}else n.push(fr([c.estimatedPoints],a));return a.stroke!==ie&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[$i(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,h){const c=this._o(h),l=[],d=Cn(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=Cn(t,r,i,o,s,a,!0,!1,u);f.type="fillPath",l.push(f)}else l.push((function(u,f,m,y,x,C,b){const T=u,w=f;let B=Math.abs(m/2),F=Math.abs(y/2);B+=pt(.01*B,b),F+=pt(.01*F,b);let L=x,v=C;for(;L<0;)L+=2*Math.PI,v+=2*Math.PI;v-L>2*Math.PI&&(L=0,v=2*Math.PI);const R=(v-L)/b.curveStepCount,N=[];for(let q=L;q<=v;q+=R)N.push([T+B*Math.cos(q),w+F*Math.sin(q)]);return N.push([T+B*Math.cos(v),w+F*Math.sin(v)]),N.push([T,w]),fr([N],b)})(t,r,i,o,s,a,c));return c.stroke!==ie&&l.push(d),this._d("arc",l,c)}curve(t,r){const i=this._o(r),o=[],s=yn(t,i);if(i.fill&&i.fill!==ie)if(i.fillStyle==="solid"){const a=yn(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const h=typeof n[0][0]=="number"?[n]:n;for(const c of h)c.length<3?a.push(...c):c.length===3?a.push(...vo(Tn([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...vo(Tn(c),10,(1+i.roughness)/2))}a.length&&o.push(fr([a],i))}return i.stroke!==ie&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=$i(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Bo([t],i)):o.push(fr([t],i))),i.stroke!==ie&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ie,a=i.stroke!==ie,n=!!(i.simplification&&i.simplification<1),h=(function(l,d,u){const f=nc(ac(ua(l))),m=[];let y=[],x=[0,0],C=[];const b=()=>{C.length>=4&&y.push(...vo(C,d)),C=[]},T=()=>{b(),y.length&&(m.push(y),y=[])};for(const{key:B,data:F}of f)switch(B){case"M":T(),x=[F[0],F[1]],y.push(x);break;case"L":b(),y.push([F[0],F[1]]);break;case"C":if(!C.length){const L=y.length?y[y.length-1]:x;C.push([L[0],L[1]])}C.push([F[0],F[1]]),C.push([F[2],F[3]]),C.push([F[4],F[5]]);break;case"Z":b(),y.push([x[0],x[1]])}if(T(),!u)return m;const w=[];for(const B of m){const F=Ey(B,u);F.length&&w.push(F)}return w})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=xn(t,i);if(s)if(i.fillStyle==="solid")if(h.length===1){const l=xn(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(l.ops)})}else o.push(Bo(h,i));else o.push(fr(h,i));return a&&(n?h.forEach((l=>{o.push($i(l,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ie};break;case"fillPath":a={d:this.opsToPath(s),stroke:ie,strokeWidth:0,fill:i.fill||ie};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ie,strokeWidth:i,fill:ie}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class Ay{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Qi(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,h){const c=this.gen.arc(t,r,i,o,s,a,n,h);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Fi="http://www.w3.org/2000/svg";class _y{constructor(t,r){this.svg=t,this.gen=new Qi(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(Fi,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let h=null;switch(n.type){case"path":h=o.createElementNS(Fi,"path"),h.setAttribute("d",this.opsToPath(n,a)),h.setAttribute("stroke",i.stroke),h.setAttribute("stroke-width",i.strokeWidth+""),h.setAttribute("fill","none"),i.strokeLineDash&&h.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&h.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":h=o.createElementNS(Fi,"path"),h.setAttribute("d",this.opsToPath(n,a)),h.setAttribute("stroke","none"),h.setAttribute("stroke-width","0"),h.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||h.setAttribute("fill-rule","evenodd");break;case"fillSketch":h=this.fillSketch(o,n,i)}h&&s.appendChild(h)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(Fi,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,h){const c=this.gen.arc(t,r,i,o,s,a,n,h);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new Ay(e,t),svg:(e,t)=>new _y(e,t),generator:e=>new Qi(e),newSeed:()=>Qi.newSeed()},My=1,Iy=3;async function ga(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!pa(e);await Promise.all([...t].map(i=>new Promise(o=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",r){const a=Bt().fontSize?Bt().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[h=ch.fontSize]=oo(a),c=h*n+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";o(i)}g(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}g(ga,"configureLabelImages");function pa(e){return e.nodeType===Iy?e.textContent?.trim()!=="":e.nodeType!==My||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(pa)}g(pa,"hasTextBesidesImages");var wn=3,Oy=32,$y=g(async(e,t,r)=>{const i=Bt(),o=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),s=o.insert("g").attr("class","label").attr("style",Wt(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(C=>({text:C,cssClass:"c4-descr"}))].filter(C=>C.text),h=t.width?Math.max(t.width-2*(t.padding??0),Oy):Bt().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async C=>{const b=s.append("g").attr("class",C.cssClass),T=await me(b,ae(Ne(C.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return yt(T).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),yt(T).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:b,box:b.node().getBBox()}})),u=Math.max(...d.map(({box:C})=>C.width),0);let f=0;for(const{el:C,box:b}of d)C.attr("transform",`translate(${u/2-b.x-b.width/2}, ${f-b.y})`),f+=b.height+wn;const m=d.length>0?f-wn:0;s.insert("rect",":first-child"),s.attr("transform",`translate(${-u/2}, ${-m/2})`);const y=s.node().getBBox(),x=(t.padding??0)/2;return{shapeSvg:o,bbox:y,halfPadding:x,label:s}},"c4LabelHelper"),ct=g(async(e,t,r)=>{if(t.stereotype!==void 0)return $y(e,t,r);let i;const o=t.useHtmlLabels||ve(Bt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Wt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const h=!!t.icon||!!t.img,c=t.labelType==="markdown",l=await me(a,ae(Ne(n),Bt()),{useHtmlLabels:o,width:t.width||t.wrappingWidth||Bt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:h,markdown:c},Bt()),d=(t?.padding??0)/2;let u;if(o){const f=l.children[0],m=yt(l);await ga(f),u=await rr.measure(()=>f.getBoundingClientRect()),m.attr("width",u.width),m.attr("height",u.height)}else u=await rr.measure(()=>l.getBBox());return o?a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):a.attr("transform","translate(0, "+-u.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:u,halfPadding:d,label:a}},"labelHelper"),Lo=g(async(e,t,r)=>{const i=r.useHtmlLabels??Kt(Bt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await me(o,ae(Ne(t),Bt()),{useHtmlLabels:i,width:r.width||Bt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),a=r.padding/2;let n;if(Kt(Bt())){const h=s.children[0],c=yt(s);n=await rr.measure(()=>h.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await rr.measure(()=>s.getBBox());return i?o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):o.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:a,label:o}},"insertLabel"),ot=g((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}const i=t.node().getBBox();e.width=i.width,e.height=i.height},"updateNodeBounds"),dt=g((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Ft(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}g(Ft,"createPathFromPoints");function ze(e,t,r,i,o,s){const a=[],h=r-e,c=i-t,l=h/s,d=2*Math.PI/l,u=t+c/2;for(let f=0;f<=50;f++){const m=f/50,y=e+m*h,x=u+o*Math.sin(d*(y-e));a.push({x:y,y:x})}return a}g(ze,"generateFullSineWavePoints");function Te(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:-f,y:-m})}return a}g(Te,"generateCirclePoints");function ws(e){const t=Array.from(e.childNodes).filter(h=>h.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");r.setAttribute("d",i);const o=t.find(h=>h.getAttribute("fill")!=="none"),s=t.find(h=>h.getAttribute("stroke")!=="none"),a=g((h,c)=>h?.getAttribute(c)??void 0,"getAttr");if(o){const h={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(h).forEach(([c,l])=>{l&&r.setAttribute(c,l)})}if(s){const h={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(h).forEach(([c,l])=>{l&&r.setAttribute(c,l)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}g(ws,"mergePaths");var Dy=g((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,h,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),h=s===0?0:n*o/s,c=n):(o<0&&(a=-a),h=a,c=o===0?0:a*s/o),{x:r+h,y:i+c}},"intersectRect"),ar=Dy,ce=g((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),Py=g(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=Bt(),n=Kt(a);return await me(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Re=Py;function uc(e,t){return e.intersect(t)}g(uc,"intersectNode");var Ry=uc;function gc(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,h=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/h);i.x<o&&(c=-c);var l=Math.abs(t*r*n/h);return i.y<s&&(l=-l),{x:o+c,y:s+l}}g(gc,"intersectEllipse");var pc=gc;function fc(e,t,r){return pc(e,t,t,r)}g(fc,"intersectCircle");var qy=fc;function mc(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,h=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&h!==0&&Bs(n,h))return;const l=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=l*e.x+d*e.y+u,m=l*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(m)<c&&Bs(f,m))return;const y=o*d-l*s;if(y===0)return;const x=Math.abs(y/2);let C=s*u-d*a;const b=C<0?(C-x)/y:(C+x)/y;C=l*a-o*u;const T=C<0?(C-x)/y:(C+x)/y;return{x:b,y:T}}}g(mc,"intersectLine");function Bs(e,t){return e*t>0}g(Bs,"sameSign");var Ny=mc;function yc(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(l){a=Math.min(a,l.x),n=Math.min(n,l.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let h=i-e.width/2-a,c=o-e.height/2-n;for(let l=0;l<t.length;l++){let d=t[l],u=t[l<t.length-1?l+1:0],f=Ny(e,r,{x:h+d.x,y:c+d.y},{x:h+u.x,y:c+u.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(l,d){let u=l.x-r.x,f=l.y-r.y,m=Math.sqrt(u*u+f*f),y=d.x-r.x,x=d.y-r.y,C=Math.sqrt(y*y+x*x);return m<C?-1:m===C?0:1}),s[0]):e}g(yc,"intersectPolygon");var Wy=yc,tt={node:Ry,circle:qy,ellipse:pc,polygon:Wy,rect:ar};function Cc(e,t){const{labelStyles:r}=st(t);t.labelStyle=r;const i=dt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,h=rt.svg(s),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const l=h.circle(0,0,a*2,c),d=s.insert(()=>l,":first-child");return d.attr("class","anchor").attr("style",Wt(n)),ot(t,d),t.intersect=function(u){return M.info("Circle intersect",t,a,u),tt.circle(t,a,u)},s}g(Cc,"anchor");function vs(e,t,r,i,o,s,a){const h=(e+r)/2,c=(t+i)/2,l=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,m=u/s,y=Math.sqrt(f**2+m**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");const x=Math.sqrt(1-y**2),C=h+x*s*Math.sin(l)*(a?-1:1),b=c-x*o*Math.cos(l)*(a?-1:1),T=Math.atan2((t-b)/s,(e-C)/o);let B=Math.atan2((i-b)/s,(r-C)/o)-T;a&&B<0&&(B+=2*Math.PI),!a&&B>0&&(B-=2*Math.PI);const F=[];for(let L=0;L<20;L++){const v=L/19,R=T+v*B,N=C+o*Math.cos(R),q=b+s*Math.sin(R);F.push({x:N,y:q})}return F}g(vs,"generateArcPoints");function xc(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}g(xc,"calculateArcSagitta");async function bc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=g(R=>R+a,"calcTotalHeight"),h=g(R=>{const N=R/2;return[N/(2.5+R/50),N]},"calcEllipseRadius"),{shapeSvg:c,bbox:l}=await ct(e,t,dt(t)),d=n(t?.height?t?.height:l.height),[u,f]=h(d),m=xc(d,u,f),x=(t?.width?t?.width:l.width)+s*2+m-m,C=d,{cssStyles:b}=t,T=[{x:x/2,y:-C/2},{x:-x/2,y:-C/2},...vs(-x/2,-C/2,-x/2,C/2,u,f,!1),{x:x/2,y:C/2},...vs(x/2,C/2,x/2,-C/2,u,f,!0)],w=rt.svg(c),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const F=Ft(T),L=w.path(F,B),v=c.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${u/2}, 0)`),ot(t,v),t.intersect=function(R){return tt.polygon(t,T,R)},c}g(bc,"bowTieRect");async function kc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,label:n}=await ct(e,t,dt(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,l=Math.max(a.width+c*2,t.width??0,80),d=Math.max(Math.min(l*.08,12),5),u=Math.max(a.height+c*2+d,t.height??0),f=-u/2+d,m=u/2,y=l*.72,x=[`M${-l/2},${f}`,`L${-y/2},${m}`,`A${y/2},${d} 0 0 0 ${y/2},${m}`,`L${l/2},${f}`,`A${l/2},${d} 0 0 0 ${-l/2},${f}`,"Z"].join(" "),{cssStyles:C}=t,b=s.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const v=rt.svg(s).path(x,et(t,{}));b.node()?.appendChild(v),C&&b.attr("style",C)}else b.append("path").attr("d",x).attr("style",o);b.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",l/2).attr("ry",d).attr("style",`fill:none;stroke:${h};stroke-width:1px`),ot(t,b);const T=f+(m-f)/2;n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${T-a.height/2-(a.y-(a.top??0))})`);const w=12,B=g((L,v,R)=>Array.from({length:w+1},(N,q)=>{const J=Math.PI-q*Math.PI/w;return{x:L*Math.cos(J),y:v+R*d*Math.sin(J)}}),"arc"),F=[...B(l/2,f,-1),...B(y/2,m,1).reverse()];return t.intersect=function(L){return tt.polygon(t,F,L)},s}g(kc,"bucket");var Bn=20,vn=8,zy=80,Fo=8;async function Sc(e,t){const{themeVariables:r}=Bt(),i=r.clusterBkg,o=r.clusterBorder,{nodeStyles:s}=st(t),{shapeSvg:a,bbox:n}=await ct(e,t,dt(t)),h=t.padding??8,c=n.height,l=Math.max(n.width+h*2,zy,t?.width??0),d=Math.max(c+vn+Bn+h*2,t?.height??0),u=-l/2,f=-d/2,m=-28/2,y=a.select(".label");y&&(t.useHtmlLabels??Kt(Bt())?y.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):y.attr("transform",`translate(0, ${-n.height/2+m})`));let x;if(t.look==="handDrawn"){const B=rt.svg(a),F=et(t,{fill:i,stroke:o,fillStyle:"solid"}),L=B.path(ce(u,f,l,d,Fo),F);x=a.insert(()=>L,":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",Wt(t.cssStyles))}else x=a.insert("rect",":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",s).attr("rx",Fo).attr("ry",Fo).attr("x",u).attr("y",f).attr("width",l).attr("height",d).attr("fill",i).attr("stroke",o);const C=f+h+c+vn;a.append("line").attr("class","collapsed-separator").attr("x1",u+8).attr("y1",C).attr("x2",u+l-8).attr("y2",C).attr("stroke",o).attr("stroke-dasharray","3, 3");const b=C+Bn/2,T=2.5,w=10;for(let B=-1;B<=1;B++)a.append("circle").attr("class","collapsed-indicator").attr("cx",B*w).attr("cy",b).attr("r",T).attr("fill",o);return ot(t,x),t.calcIntersect=function(B,F){return tt.rect(B,F)},t.intersect=function(B){return tt.rect(t,B)},a}g(Sc,"collapsedGroup");function Le(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(Le,"insertPolygonShape");var Hy=["right","left","up","down"],fa="point",Yy=g(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),jy=g(e=>Hy.filter(t=>e.has(t)).join("|")||fa,"getDirectionKey"),Ln={"right|left|up|down":g(({height:e,midpoint:t,padding:r,width:i})=>[{x:0,y:0},{x:t,y:0},{x:i/2,y:2*r},{x:i-t,y:0},{x:i,y:0},{x:i,y:-e/3},{x:i+2*r,y:-e/2},{x:i,y:-2*e/3},{x:i,y:-e},{x:i-t,y:-e},{x:i/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":g(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":g(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":g(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":g(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":g(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"up|down"),"right|up":g(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":g(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":g(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":g(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r}],"up"),down:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"down"),[fa]:()=>[{x:0,y:0}]},Xy=g((e,t,r,i)=>{const o=Yy(e),s=(r.padding??0)/2,a=t.height+4*s,n=a/2,h=i??t.width+2*n+2*s,c=jy(o);return(Ln[c]??Ln[fa])({height:a,midpoint:n,padding:s,width:h})},"getArrowPoints");async function Tc(e,t){const r=t,{shapeSvg:i,bbox:o}=await ct(e,r,dt(r)),s=r.padding??0,a=o.height+2*s,n=a/2,h=o.width+2*n+s,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>h?c:h,u=Xy(r.directions??[],o,r,d),f=Le(i,d,a,u);return f.attr("style",r.style??null),ot(r,f),r.intersect=function(m){return tt.polygon(r,u,m)},i}g(Tc,"block_arrow");async function wc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,label:n}=await ct(e,t,dt(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,l=18,d=12,u=Math.max(a.width+c*2,t.width??0,90),f=Math.max(a.height+c*2+l,t.height??0),m=-f/2,{cssStyles:y}=t,x=s.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const T=rt.svg(s).path(ce(-u/2,m,u,f,d),et(t,{}));x.node()?.appendChild(T),y&&x.attr("style",y)}else x.append("rect").attr("x",-u/2).attr("y",m).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);x.append("line").attr("x1",-u/2).attr("y1",m+l).attr("x2",u/2).attr("y2",m+l).attr("style",`stroke:${h};stroke-width:1px`);for(let b=0;b<3;b++)x.append("circle").attr("cx",-u/2+12+b*9).attr("cy",m+l/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);x.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",m+4).attr("width",Math.max(u-56,10)).attr("height",l-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),ot(t,x);const C=m+l+(f-l)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(b){return tt.rect(t,b)},s}g(wc,"browser");var Ei=12;async function Bc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.width??h.width)+(t.look==="neo"?s*2:s+Ei),l=(t?.height??h.height)+(t.look==="neo"?a*2:a),d=0,u=c,f=-l,m=0,y=[{x:d+Ei,y:f},{x:u,y:f},{x:u,y:m},{x:d,y:m},{x:d,y:f+Ei},{x:d+Ei,y:f}];let x;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=rt.svg(n),T=et(t,{}),w=Ft(y),B=b.path(w,T);x=n.insert(()=>B,":first-child").attr("transform",`translate(${-c/2}, ${l/2})`),C&&x.attr("style",C)}else x=Le(n,c,l,y);return i&&x.attr("style",i),ot(t,x),t.intersect=function(b){return tt.polygon(t,y,b)},n}g(Bc,"card");function vc(e,t){const{nodeStyles:r}=st(t);t.label="";const i=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=rt.svg(i),h=et(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const c=Ft(a),l=n.path(c,h),d=i.insert(()=>l,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return tt.polygon(t,a,u)},i}g(vc,"choice");async function ma(e,t,r){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await ct(e,t,dt(t)),h=16,c=r?.padding??n,l=t.look==="neo"?a.width/2+h*2:a.width/2+c;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(s),m=et(t,{}),y=f.circle(0,0,l*2,m);d=s.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Wt(u))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",l).attr("cx",0).attr("cy",0);return ot(t,d),t.calcIntersect=function(f,m){const y=f.width/2;return tt.circle(f,y,m)},t.intersect=function(f){return M.info("Circle intersect",t,l,f),tt.circle(t,l,f)},s}g(ma,"circle");async function Lc(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:s,halfPadding:a}=await ct(e,r,i),n=o.insert("rect",":first-child"),h=r.padding??0,c=r.positioned?r.width??0:s.width+h,l=r.positioned?r.height??0:s.height+h,d=r.positioned?-c/2:-s.width/2-a,u=r.positioned?-l/2:-s.height/2-a;return n.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",l),ot(r,n),r.intersect=function(f){return tt.rect(r,f)},o}g(Lc,"composite");async function Fc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,label:n}=await ct(e,t,dt(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,l=20,d=12,u=Math.max(a.width+c*2,t.width??0,90),f=Math.max(a.height+c*2+l,t.height??0),m=-f/2,{cssStyles:y}=t,x=s.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const T=rt.svg(s).path(ce(-u/2,m,u,f,d),et(t,{}));x.node()?.appendChild(T),y&&x.attr("style",y)}else x.append("rect").attr("x",-u/2).attr("y",m).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);x.append("text").attr("x",-u/2+12).attr("y",m+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),ot(t,x);const C=m+l+(f-l)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(b){return tt.rect(t,b)},s}g(Fc,"consoleWindow");function Ec(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
206
- M ${o.x},${o.y} L ${a.x},${a.y}`}g(Ec,"createLine");function Ac(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),h=et(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const c=n.circle(0,0,s*2,h),l=Ec(s),d=n.path(l,h),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),ot(t,u),t.intersect=function(f){return M.info("crossedCircle intersect",t,{radius:s,point:f}),tt.circle(t,s,f)},o}g(Ac,"crossedCircle");function Ae(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:-f,y:-m})}return a}g(Ae,"generateCirclePoints");async function _c(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,c=s.width+n,l=s.height+h,d=Math.max(5,l*.1),{cssStyles:u}=t,f=[...Ae(c/2,-l/2,d,30,-90,0),{x:-c/2-d,y:d},...Ae(c/2+d*2,-d,d,20,-180,-270),...Ae(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-l/2},...Ae(c/2,l/2,d,20,0,90)],m=[{x:c/2,y:-l/2-d},{x:-c/2,y:-l/2-d},...Ae(c/2,-l/2,d,20,-90,0),{x:-c/2-d,y:-d},...Ae(c/2+c*.1,-d,d,20,-180,-270),...Ae(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:l/2},...Ae(c/2,l/2,d,20,0,90),{x:-c/2,y:l/2+d},{x:c/2,y:l/2+d}],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Ft(f).replace("Z",""),T=y.path(b,x),w=Ft(m),B=y.path(w,{...x}),F=o.insert("g",":first-child");return F.insert(()=>B,":first-child").attr("stroke-opacity",0),F.insert(()=>T,":first-child"),F.attr("class","text"),u&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,F),t.intersect=function(L){return tt.polygon(t,m,L)},o}g(_c,"curlyBraceLeft");function _e(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:f,y:m})}return a}g(_e,"generateCirclePoints");async function Mc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),l=s.height+(t.look==="neo"?h*2:h),d=Math.max(5,l*.1),{cssStyles:u}=t,f=[..._e(c/2,-l/2,d,20,-90,0),{x:c/2+d,y:-d},..._e(c/2+d*2,-d,d,20,-180,-270),..._e(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:l/2},..._e(c/2,l/2,d,20,0,90)],m=[{x:-c/2,y:-l/2-d},{x:c/2,y:-l/2-d},..._e(c/2,-l/2,d,20,-90,0),{x:c/2+d,y:-d},..._e(c/2+d*2,-d,d,20,-180,-270),..._e(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:l/2},..._e(c/2,l/2,d,20,0,90),{x:c/2,y:l/2+d},{x:-c/2,y:l/2+d}],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Ft(f).replace("Z",""),T=y.path(b,x),w=Ft(m),B=y.path(w,{...x}),F=o.insert("g",":first-child");return F.insert(()=>B,":first-child").attr("stroke-opacity",0),F.insert(()=>T,":first-child"),F.attr("class","text"),u&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,F),t.intersect=function(L){return tt.polygon(t,m,L)},o}g(Mc,"curlyBraceRight");function jt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:-f,y:-m})}return a}g(jt,"generateCirclePoints");async function Ic(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),l=s.height+(t.look==="neo"?h*2:h),d=Math.max(5,l*.1),{cssStyles:u}=t,f=[...jt(c/2,-l/2,d,30,-90,0),{x:-c/2-d,y:d},...jt(c/2+d*2,-d,d,20,-180,-270),...jt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-l/2},...jt(c/2,l/2,d,20,0,90)],m=[...jt(-c/2+d+d/2,-l/2,d,20,-90,-180),{x:c/2-d/2,y:d},...jt(-c/2-d/2,-d,d,20,0,90),...jt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...jt(-c/2+d+d/2,l/2,d,30,-180,-270)],y=[{x:c/2,y:-l/2-d},{x:-c/2,y:-l/2-d},...jt(c/2,-l/2,d,20,-90,0),{x:-c/2-d,y:-d},...jt(c/2+d*2,-d,d,20,-180,-270),...jt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:l/2},...jt(c/2,l/2,d,20,0,90),{x:-c/2,y:l/2+d},{x:c/2-d-d/2,y:l/2+d},...jt(-c/2+d+d/2,-l/2,d,20,-90,-180),{x:c/2-d/2,y:d},...jt(-c/2-d/2,-d,d,20,0,90),...jt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...jt(-c/2+d+d/2,l/2,d,30,-180,-270)],x=rt.svg(o),C=et(t,{fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=Ft(f).replace("Z",""),w=x.path(T,C),F=Ft(m).replace("Z",""),L=x.path(F,C),v=Ft(y),R=x.path(v,{...C}),N=o.insert("g",":first-child");return N.insert(()=>R,":first-child").attr("stroke-opacity",0),N.insert(()=>w,":first-child"),N.insert(()=>L,":first-child"),N.attr("class","text"),u&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,N),t.intersect=function(q){return tt.polygon(t,y,q)},o}g(Ic,"curlyBraces");async function Oc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,h=5,{shapeSvg:c,bbox:l}=await ct(e,t,dt(t)),d=Math.max(n,(l.width+s*2)*1.25,t?.width??0),u=Math.max(h,l.height+a*2,t?.height??0),f=u/2,{cssStyles:m}=t,y=rt.svg(c),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=d,b=u,T=C-f,w=b/4,B=[{x:T,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:T,y:b},...Te(-T,-b/2,f,50,270,90)],F=Ft(B),L=y.path(F,x),v=c.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",i),v.attr("transform",`translate(${-d/2}, ${-u/2})`),ot(t,v),t.intersect=function(R){return tt.polygon(t,B,R)},c}g(Oc,"curvedTrapezoid");async function $c(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.padding??20,h=Math.max(s.width+n*2,t.width??0,100),c=Math.min(Math.max(h*.23,16),56),l=c*.27,d=Math.max(s.height+n*2,t.height?t.height-(2*c-l):0),u=Math.min(h*.177,d*.45),f=d+2*c-l,m=-f/2,y=m+2*c-l,x=o.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:C}=t;if(t.look==="handDrawn"){const v=rt.svg(o),R=et(t,{}),N=v.path(ce(-h/2,y,h,d,u),R),q=v.circle(0,m+c,c*2,R);x.insert(()=>q,":first-child"),x.insert(()=>N,":first-child"),C&&x.attr("style",C)}else x.append("rect").attr("x",-h/2).attr("y",y).attr("width",h).attr("height",d).attr("rx",u).attr("ry",u).attr("style",i),x.append("circle").attr("cx",0).attr("cy",m+c).attr("r",c).attr("style",i);ot(t,x);const b=y+d/2;a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);const T=m+c,w=Math.asin(Math.min(1,(y-T)/c))*180/Math.PI,L=[...Te(0,-T,c,24,180+w,-w),...Te(-(-h/2+u),-(y+u),u,12,90,0),...Te(-(-h/2+u),-(f/2-u),u,12,360,270),...Te(-(h/2-u),-(f/2-u),u,12,270,180),...Te(-(h/2-u),-(y+u),u,12,180,90)];return t.intersect=function(v){return tt.polygon(t,L,v)},o}g($c,"person");var Uy=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),Gy=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),Vy=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Fn=8,En=8;async function Dc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o,n=t.width??0;if(t.width&&(t.width=t.width-a,t.width<En&&(t.width=En)),t.height){const b=n/2/(2.5+n/50);t.height=t.height-s-b*3,t.height<Fn&&(t.height=Fn)}const{shapeSvg:h,bbox:c,label:l}=await ct(e,t,dt(t)),d=Math.max(t.width??0,c.width)+a,u=d/2,f=u/(2.5+d/50),m=Math.max(t.height??0,c.height)+s+f;let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),b=Gy(0,0,d,m,u,f),T=Vy(0,f,d,m,u,f),w=et(t,{}),B=C.path(b,w),F=C.path(T,et(t,{fill:"none"}));y=h.insert(()=>F,":first-child"),y=h.insert(()=>B,":first-child"),y.attr("class","basic label-container"),x&&y.attr("style",x)}else{const C=Uy(0,0,d,m,u,f);y=h.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",Wt(x)).attr("style",i)}return y.attr("label-offset-y",f),y.attr("transform",`translate(${-d/2}, ${-(m/2+f)})`),ot(t,y),l.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(C){const b=tt.rect(t,C),T=b.x-(t.x??0);if(u!=0&&(Math.abs(T)<(t.width??0)/2||Math.abs(T)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let w=f*f*(1-T*T/(u*u));w>0&&(w=Math.sqrt(w)),w=f-w,C.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},h}g(Dc,"cylinder");async function Ar(e,t,r){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await ct(e,t,dt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),h=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,l=-h/2;let d,{rx:u,ry:f}=t;const{cssStyles:m}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const y=rt.svg(s),x=et(t,{}),C=u||f?y.path(ce(c,l,n,h,u||0),x):y.rectangle(c,l,n,h,x);d=s.insert(()=>C,":first-child"),d.attr("class","basic label-container").attr("style",Wt(m))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Wt(u)).attr("ry",Wt(f)).attr("x",c).attr("y",l).attr("width",n).attr("height",h);return ot(t,d,t.look==="handDrawn"?void 0:{width:n,height:h}),t.calcIntersect=function(y,x){return tt.rect(y,x)},t.intersect=function(y){return tt.rect(t,y)},s}g(Ar,"drawRect");async function Pc(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,h={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await Ar(e,t,h);if(t.look==="handDrawn"){const f=rt.svg(c),m=et(t,{}),y=c.select(".basic.label-container > path:nth-child(2)"),x=y.node();if(!x)return c;let C=null;if(x instanceof SVGGraphicsElement)C=x.getBBox();else return c;return c.insert(()=>f.line(C.x,C.y,C.x+C.width,C.y,m),".basic.label-container g.label"),c.insert(()=>f.line(C.x,C.y+C.height,C.x+C.width,C.y+C.height,m),".basic.label-container g.label"),y.remove(),c}const l=c.select(".basic.label-container"),d=(Number(l.attr("width"))||a)??0,u=(Number(l.attr("height"))||n)??0;return d>0&&u>0&&l.attr("stroke-dasharray",`${d} ${u}`),c}g(Pc,"datastore");async function Rc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=n.width+o,l=n.height+s,d=l*.2,u=-c/2,f=-l/2-d/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],b=y.polygon(C.map(w=>[w.x,w.y]),x),T=a.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),h.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ot(t,T),t.intersect=function(w){return tt.rect(t,w)},a}g(Rc,"dividedRectangle");async function qc(e,t){const{labelStyles:r,nodeStyles:i}=st(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width/2:h.width/2)+(a??0),l=c-o;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(n),m=et(t,{roughness:.2,strokeWidth:2.5}),y=et(t,{roughness:.2,strokeWidth:1.5}),x=f.circle(0,0,c*2,m),C=f.circle(0,0,l*2,y);d=n.insert("g",":first-child"),d.attr("class",Wt(t.cssClasses)).attr("style",Wt(u)),d.node()?.appendChild(x),d.node()?.appendChild(C)}else{d=n.insert("g",":first-child");const f=d.insert("circle",":first-child"),m=d.insert("circle");d.attr("class","basic label-container").attr("style",i),f.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0)}return ot(t,d),t.intersect=function(f){return M.info("DoubleCircle intersect",t,c,f),tt.circle(t,c,f)},n}g(qc,"doublecircle");function Nc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,h=rt.svg(s),{nodeBorder:c}=r,l=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(l.roughness=0);const d=h.circle(0,0,a*2,l),u=s.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),ot(t,u),t.intersect=function(f){return M.info("filledCircle intersect",t,{radius:a,point:f}),tt.circle(t,a,f)},s}g(Nc,"filledCircle");var An=10,_n=10;async function Wc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<An&&(t.height=An),t.width=(t?.width??0)-s-s/2,t.width<_n&&(t.width=_n));const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width:n.width)+(s??0),l=t?.height?t?.height:c+n.height,d=l,u=[{x:0,y:-l},{x:d,y:-l},{x:d/2,y:0}],{cssStyles:f}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Ft(u),C=m.path(x,y),b=a.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=c,t.height=l,ot(t,b),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-l/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(T){return M.info("Triangle intersect",t,u,T),tt.polygon(t,u,T)},a}g(Wc,"flippedTriangle");async function zc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.padding??12,h=Math.max(s.width+n*2,t.width??0,90),c=s.height+n*2,l=Math.max(Math.min(c*.16,14),8),d=Math.max(c+l,t.height??0),u=d-l,f=Math.max(h*.38,28),m=-d/2,y=[{x:-h/2,y:m},{x:-h/2+f,y:m},{x:-h/2+f,y:m+l},{x:h/2,y:m+l},{x:h/2,y:d/2},{x:-h/2,y:d/2}],x=[`M${y[0].x},${y[0].y}`,...y.slice(1).map(w=>`L${w.x},${w.y}`),"Z"].join(" "),{cssStyles:C}=t;let b;if(t.look==="handDrawn"){const B=rt.svg(o).path(x,et(t,{}));b=o.insert(()=>B,":first-child").attr("class","basic label-container"),C&&b.attr("style",C)}else b=o.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",i);t.look==="handDrawn"?ot(t,b):ot(t,b,{width:h,height:d});const T=m+l+u/2;return a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${T-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(w){return tt.polygon(t,y,w)},o}g(zc,"folder");function Hc(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=st(t);t.label="";const a=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let h=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(h=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const l=-1*h/2,d=-1*c/2,u=rt.svg(a),f=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const m=u.rectangle(l,d,h,c,f),y=a.insert(()=>m,":first-child");n&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",s),ot(t,y);const x=i?.padding??0;return t.width&&t.height&&(t.width+=x/2||0,t.height+=x/2||0),t.intersect=function(C){return tt.rect(t,C)},a}g(Hc,"forkJoin");async function Yc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:h,bbox:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,u=d/2,{cssStyles:f}=t,m=rt.svg(h),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-l/2,y:-d/2},{x:l/2-u,y:-d/2},...Te(-l/2+u,0,u,50,90,270),{x:l/2-u,y:d/2},{x:-l/2,y:d/2}],C=Ft(x),b=m.path(C,y),T=h.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ot(t,T),t.intersect=function(w){return M.info("Pill intersect",t,{radius:u,point:w}),tt.polygon(t,x,w)},h}g(Yc,"halfRoundedRectangle");var Ky=g((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function jc(e,t){const{labelStyles:r,nodeStyles:i}=st(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,h=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const T=(t.height??0)/o;t.width=(t?.width??0)-2*T-c,t.height=(t.height??0)-h}const{shapeSvg:l,bbox:d}=await ct(e,t,dt(t)),u=(t?.height?t?.height:d.height)+h,f=u/o,m=(t?.width?t?.width:d.width)+2*f+c,y=[{x:f,y:0},{x:m-f,y:0},{x:m,y:-u/2},{x:m-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let x;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=rt.svg(l),T=et(t,{}),w=Ky(0,0,m,u,f),B=b.path(w,T);x=l.insert(()=>B,":first-child").attr("transform",`translate(${-m/2}, ${u/2})`),C&&x.attr("style",C)}else x=Le(l,m,u,y);return i&&x.attr("style",i),t.width=m,t.height=u,ot(t,x),t.intersect=function(b){return tt.polygon(t,y,b)},l}g(jc,"hexagon");async function Xc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await ct(e,t,dt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,h=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const l=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Ft(l),u=h.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-s/2}, ${-a/2})`),ot(t,f),t.intersect=function(m){return M.info("Pill intersect",t,{points:l}),tt.polygon(t,l,m)},o}g(Xc,"hourglass");async function Uc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,label:d}=await ct(e,t,"icon-shape default"),u=t.pos==="t",f=n,m=n,{nodeBorder:y}=r,{stylesMap:x}=Er(t),C=-m/2,b=-f/2,T=t.label?8:0,w=rt.svg(c),B=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const F=w.rectangle(C,b,m,f,B),L=Math.max(m,l.width),v=f+l.height+T,R=w.rectangle(-L/2,-v/2,L,v,{...B,fill:"transparent",stroke:"none"}),N=c.insert(()=>F,":first-child"),q=c.insert(()=>R);if(t.icon){const J=c.append("g");J.html(`<g>${await mi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const W=J.node().getBBox(),z=W.width,V=W.height,I=W.x,P=W.y;J.attr("transform",`translate(${-z/2-I},${u?l.height/2+T/2-V/2-P:-l.height/2-T/2-V/2-P})`),J.attr("style",`color: ${x.get("stroke")??y};`)}return d.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${u?-v/2:v/2-l.height})`),N.attr("transform",`translate(0,${u?l.height/2+T/2:-l.height/2-T/2})`),ot(t,q),t.intersect=function(J){if(M.info("iconSquare intersect",t,J),!t.label)return tt.rect(t,J);const W=t.x??0,z=t.y??0,V=t.height??0;let I=[];return u?I=[{x:W-l.width/2,y:z-V/2},{x:W+l.width/2,y:z-V/2},{x:W+l.width/2,y:z-V/2+l.height+T},{x:W+m/2,y:z-V/2+l.height+T},{x:W+m/2,y:z+V/2},{x:W-m/2,y:z+V/2},{x:W-m/2,y:z-V/2+l.height+T},{x:W-l.width/2,y:z-V/2+l.height+T}]:I=[{x:W-m/2,y:z-V/2},{x:W+m/2,y:z-V/2},{x:W+m/2,y:z-V/2+f},{x:W+l.width/2,y:z-V/2+f},{x:W+l.width/2/2,y:z+V/2},{x:W-l.width/2,y:z+V/2},{x:W-l.width/2,y:z-V/2+f},{x:W-m/2,y:z-V/2+f}],tt.polygon(t,I,J)},c}g(Uc,"icon");async function Gc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,label:d}=await ct(e,t,"icon-shape default"),u=20,f=t.label?8:0,m=t.pos==="t",{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Er(t),b=rt.svg(c),T=et(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const w=C.get("fill");T.stroke=w??x;const B=c.append("g");t.icon&&B.html(`<g>${await mi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=B.node().getBBox(),L=F.width,v=F.height,R=F.x,N=F.y,q=Math.max(L,v)*Math.SQRT2+u*2,J=b.circle(0,0,q,T),W=Math.max(q,l.width),z=q+l.height+f,V=b.rectangle(-W/2,-z/2,W,z,{...T,fill:"transparent",stroke:"none"}),I=c.insert(()=>J,":first-child"),P=c.insert(()=>V);return B.attr("transform",`translate(${-L/2-R},${m?l.height/2+f/2-v/2-N:-l.height/2-f/2-v/2-N})`),B.attr("style",`color: ${C.get("stroke")??y};`),d.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${m?-z/2:z/2-l.height})`),I.attr("transform",`translate(0,${m?l.height/2+f/2:-l.height/2-f/2})`),ot(t,P),t.intersect=function(Y){return M.info("iconSquare intersect",t,Y),tt.rect(t,Y)},c}g(Gc,"iconCircle");async function Vc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,halfPadding:d,label:u}=await ct(e,t,"icon-shape default"),f=t.pos==="t",m=n+d*2,y=n+d*2,{nodeBorder:x,mainBkg:C}=r,{stylesMap:b}=Er(t),T=-y/2,w=-m/2,B=t.label?8:0,F=rt.svg(c),L=et(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=b.get("fill");L.stroke=v??C;const R=F.path(ce(T,w,y,m,5),L),N=Math.max(y,l.width),q=m+l.height+B,J=F.rectangle(-N/2,-q/2,N,q,{...L,fill:"transparent",stroke:"none"}),W=c.insert(()=>R,":first-child").attr("class","icon-shape2"),z=c.insert(()=>J);if(t.icon){const V=c.append("g");V.html(`<g>${await mi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const I=V.node().getBBox(),P=I.width,Y=I.height,lt=I.x,at=I.y;V.attr("transform",`translate(${-P/2-lt},${f?l.height/2+B/2-Y/2-at:-l.height/2-B/2-Y/2-at})`),V.attr("style",`color: ${b.get("stroke")??x};`)}return u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${f?-q/2:q/2-l.height})`),W.attr("transform",`translate(0,${f?l.height/2+B/2:-l.height/2-B/2})`),ot(t,z),t.intersect=function(V){if(M.info("iconSquare intersect",t,V),!t.label)return tt.rect(t,V);const I=t.x??0,P=t.y??0,Y=t.height??0;let lt=[];return f?lt=[{x:I-l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P+Y/2},{x:I-y/2,y:P+Y/2},{x:I-y/2,y:P-Y/2+l.height+B},{x:I-l.width/2,y:P-Y/2+l.height+B}]:lt=[{x:I-y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2+m},{x:I+l.width/2,y:P-Y/2+m},{x:I+l.width/2/2,y:P+Y/2},{x:I-l.width/2,y:P+Y/2},{x:I-l.width/2,y:P-Y/2+m},{x:I-y/2,y:P-Y/2+m}],tt.polygon(t,lt,V)},c}g(Vc,"iconRounded");async function Kc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,halfPadding:d,label:u}=await ct(e,t,"icon-shape default"),f=t.pos==="t",m=n+d*2,y=n+d*2,{nodeBorder:x,mainBkg:C}=r,{stylesMap:b}=Er(t),T=-y/2,w=-m/2,B=t.label?8:0,F=rt.svg(c),L=et(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=b.get("fill");L.stroke=v??C;const R=F.path(ce(T,w,y,m,.1),L),N=Math.max(y,l.width),q=m+l.height+B,J=F.rectangle(-N/2,-q/2,N,q,{...L,fill:"transparent",stroke:"none"}),W=c.insert(()=>R,":first-child"),z=c.insert(()=>J);if(t.icon){const V=c.append("g");V.html(`<g>${await mi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const I=V.node().getBBox(),P=I.width,Y=I.height,lt=I.x,at=I.y;V.attr("transform",`translate(${-P/2-lt},${f?l.height/2+B/2-Y/2-at:-l.height/2-B/2-Y/2-at})`),V.attr("style",`color: ${b.get("stroke")??x};`)}return u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${f?-q/2:q/2-l.height})`),W.attr("transform",`translate(0,${f?l.height/2+B/2:-l.height/2-B/2})`),ot(t,z),t.intersect=function(V){if(M.info("iconSquare intersect",t,V),!t.label)return tt.rect(t,V);const I=t.x??0,P=t.y??0,Y=t.height??0;let lt=[];return f?lt=[{x:I-l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P+Y/2},{x:I-y/2,y:P+Y/2},{x:I-y/2,y:P-Y/2+l.height+B},{x:I-l.width/2,y:P-Y/2+l.height+B}]:lt=[{x:I-y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2+m},{x:I+l.width/2,y:P-Y/2+m},{x:I+l.width/2/2,y:P+Y/2},{x:I-l.width/2,y:P+Y/2},{x:I-l.width/2,y:P-Y/2+m},{x:I-y/2,y:P-Y/2+m}],tt.polygon(t,lt,V)},c}g(Kc,"iconSquare");async function Zc(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=st(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const h=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:h,l=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await ct(e,t,"image-shape default"),m=t.pos==="t",y=-c/2,x=-l/2,C=t.label?8:0,b=rt.svg(d),T=et(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const w=b.rectangle(y,x,c,l,T),B=Math.max(c,u.width),F=l+u.height+C,L=b.rectangle(-B/2,-F/2,B,F,{...T,fill:"none",stroke:"none"}),v=d.insert(()=>w,":first-child"),R=d.insert(()=>L);if(t.img){const N=d.append("image");N.attr("href",t.img),N.attr("width",c),N.attr("height",l),N.attr("preserveAspectRatio","none"),N.attr("transform",`translate(${-c/2},${m?F/2-l:-F/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${m?-l/2-u.height/2-C/2:l/2-u.height/2+C/2})`),v.attr("transform",`translate(0,${m?u.height/2+C/2:-u.height/2-C/2})`),ot(t,R),t.intersect=function(N){if(M.info("iconSquare intersect",t,N),!t.label)return tt.rect(t,N);const q=t.x??0,J=t.y??0,W=t.height??0;let z=[];return m?z=[{x:q-u.width/2,y:J-W/2},{x:q+u.width/2,y:J-W/2},{x:q+u.width/2,y:J-W/2+u.height+C},{x:q+c/2,y:J-W/2+u.height+C},{x:q+c/2,y:J+W/2},{x:q-c/2,y:J+W/2},{x:q-c/2,y:J-W/2+u.height+C},{x:q-u.width/2,y:J-W/2+u.height+C}]:z=[{x:q-c/2,y:J-W/2},{x:q+c/2,y:J-W/2},{x:q+c/2,y:J-W/2+l},{x:q+u.width/2,y:J-W/2+l},{x:q+u.width/2/2,y:J+W/2},{x:q-u.width/2,y:J+W/2},{x:q-u.width/2,y:J-W/2+l},{x:q-c/2,y:J-W/2+l}],tt.polygon(t,z,N)},d}g(Zc,"imageSquare");async function Qc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s*2,t.height??0),l=Math.max(h.width+a*2,(t.width??0)-c),d=[{x:0,y:0},{x:l,y:0},{x:l+3*c/6,y:-c},{x:-3*c/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(Qc,"inv_trapezoid");async function Jc(e,t){const{shapeSvg:r,bbox:i,label:o}=await ct(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ot(t,s),t.intersect=function(h){return tt.rect(t,h)},r}g(Jc,"labelRect");async function td(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s,t.height??0),l=Math.max(h.width+a,(t.width??0)-c),d=[{x:0,y:0},{x:l+3*c/6,y:0},{x:l,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(td,"lean_left");async function ed(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s,t.height??0),l=Math.max(h.width+a,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:l,y:0},{x:l+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(ed,"lean_right");function rd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),h=7,c=[{x:a,y:0},{x:0,y:n+h/2},{x:a-2*h,y:n+h/2},{x:0,y:2*n},{x:a,y:n-h/2},{x:2*h,y:n-h/2}],l=rt.svg(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=Ft(c),f=l.path(u,d),m=o.insert(()=>f,":first-child");return m.attr("class","outer-path"),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(-${a/2},${-n})`),ot(t,m),t.intersect=function(y){return M.info("lightningBolt intersect",t,y),tt.polygon(t,c,y)},o}g(rd,"lightningBolt");var Zy=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Qy=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Jy=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Mn=10,In=10;async function id(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const C=t.width??0;t.width=(t.width??0)-s,t.width<In&&(t.width=In);const T=C/2/(2.5+C/50);t.height=(t.height??0)-a-T*3,t.height<Mn&&(t.height=Mn)}const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:h.width)+s*2,d=l/2,u=d/(2.5+l/50),f=(t?.height?t?.height:h.height)+u+a*2,m=f*.1;let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),b=Qy(0,0,l,f,d,u,m),T=Jy(0,u,l,f,d,u),w=et(t,{}),B=C.path(b,w),F=C.path(T,w);n.insert(()=>F,":first-child").attr("class","line"),y=n.insert(()=>B,":first-child"),y.attr("class","basic label-container"),x&&y.attr("style",x)}else{const C=Zy(0,0,l,f,d,u,m);y=n.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",Wt(x)).attr("style",i)}return y.attr("label-offset-y",u),y.attr("transform",`translate(${-l/2}, ${-(f/2+u)})`),ot(t,y),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+u-(h.y-(h.top??0))})`),t.intersect=function(C){const b=tt.rect(t,C),T=b.x-(t.x??0);if(d!=0&&(Math.abs(T)<(t.width??0)/2||Math.abs(T)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-u)){let w=u*u*(1-T*T/(d*d));w>0&&(w=Math.sqrt(w)),w=u-w,C.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},n}g(id,"linedCylinder");async function od(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const w=t.width;t.width=(w??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:h.width)+(s??0)*2,d=(t?.height?t?.height:h.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:m}=t,y=rt.svg(n),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:-l/2-l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:f/2},...ze(-l/2-l/2*.1,f/2,l/2+l/2*.1,f/2,u,.8),{x:l/2+l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:-f/2},{x:-l/2,y:-f/2},{x:-l/2,y:f/2*1.1},{x:-l/2,y:-f/2}],b=y.polygon(C.map(w=>[w.x,w.y]),x),T=n.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-l/2+(t.padding??0)+l/2*.1/2-(h.x-(h.left??0))},${-d/2+(t.padding??0)-u/2-(h.y-(h.top??0))})`),ot(t,T),t.intersect=function(w){return tt.polygon(t,C,w)},n}g(od,"linedWaveEdgedRect");async function sd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:h,bbox:c,label:l}=await ct(e,t,dt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,u=(t?.height?t?.height:c.height)+a*2+2*n,f=d-2*n,m=u-2*n,y=-f/2,x=-m/2,{cssStyles:C}=t,b=rt.svg(h),T=et(t,{}),w=[{x:y-n,y:x+n},{x:y-n,y:x+m+n},{x:y+f-n,y:x+m+n},{x:y+f-n,y:x+m},{x:y+f,y:x+m},{x:y+f,y:x+m-n},{x:y+f+n,y:x+m-n},{x:y+f+n,y:x-n},{x:y+n,y:x-n},{x:y+n,y:x},{x:y,y:x},{x:y,y:x+n}],B=[{x:y,y:x+n},{x:y+f-n,y:x+n},{x:y+f-n,y:x+m},{x:y+f,y:x+m},{x:y+f,y:x},{x:y,y:x}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const F=Ft(w);let L=b.path(F,T);const v=Ft(B);let R=b.path(v,T);t.look!=="handDrawn"&&(L=ws(L),R=ws(R));const N=h.insert("g",":first-child");return N.insert(()=>L),N.insert(()=>R),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ot(t,N),t.intersect=function(q){return tt.polygon(t,w,q)},h}g(sd,"multiRect");async function ad(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.padding??0,h=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let l=!0;(t.width||t.height)&&(l=!1,t.width=(t?.width??0)-h*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+h*2,u=Math.max(s.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,m=u+(l?f/2:-f/2),y=-d/2,x=-m/2,C=10,{cssStyles:b}=t,T=ze(y-C,x+m+C,y+d-C,x+m+C,f,.8),w=T?.[T.length-1],B=[{x:y-C,y:x+C},{x:y-C,y:x+m+C},...T,{x:y+d-C,y:w.y-C},{x:y+d,y:w.y-C},{x:y+d,y:w.y-2*C},{x:y+d+C,y:w.y-2*C},{x:y+d+C,y:x-C},{x:y+C,y:x-C},{x:y+C,y:x},{x:y,y:x},{x:y,y:x+C}],F=[{x:y,y:x+C},{x:y+d-C,y:x+C},{x:y+d-C,y:w.y-C},{x:y+d,y:w.y-C},{x:y+d,y:x},{x:y,y:x}],L=rt.svg(o),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const R=Ft(B),N=L.path(R,v),q=Ft(F),J=L.path(q,v),W=o.insert(()=>N,":first-child");return W.insert(()=>J),W.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",i),W.attr("transform",`translate(0,${-f/2})`),a.attr("transform",`translate(${-(s.width/2)-C-(s.x-(s.left??0))}, ${-(s.height/2)+C-f/2-(s.y-(s.top??0))})`),ot(t,W),t.intersect=function(z){return tt.polygon(t,B,z)},o}g(ad,"multiWaveEdgedRectangle");async function nd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i,t.useHtmlLabels||Kt(Dt())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-l/2,{cssStyles:f}=t,m=rt.svg(a),y=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=m.rectangle(d,u,c,l,y),C=a.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,C),t.intersect=function(b){return tt.rect(t,b)},a}g(nd,"note");var tC=g((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function ld(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ct(e,t,dt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),h=a+n,c=.5,l=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(o),m=et(t,{}),y=tC(0,0,h),x=f.path(y,m);d=o.insert(()=>x,":first-child").attr("transform",`translate(${-h/2+c}, ${h/2})`),u&&d.attr("style",u)}else d=Le(o,h,h,l),d.attr("transform",`translate(${-h/2+c}, ${h/2})`);return i&&d.attr("style",i),ot(t,d),t.calcIntersect=function(f,m){const y=f.width,x=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],C=tt.polygon(f,x,m);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},o}g(ld,"question");async function hd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=h.width+(t.look==="neo"?s*2:s),d=Math.max(h.height+(t.look==="neo"?a*2:a),t.height??0),u=d/4,m=-Math.max(l,(t.width??0)-u)/2,y=-d/2,x=y/2,C=[{x:m+x,y},{x:m,y:0},{x:m+x,y:-y},{x:-m,y:-y},{x:-m,y}],{cssStyles:b}=t,T=rt.svg(n),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const B=Ft(C),F=T.path(B,w),L=n.insert(()=>F,":first-child");return L.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${-x/2},0)`),c.attr("transform",`translate(${-x/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),ot(t,L),t.intersect=function(v){return tt.polygon(t,C,v)},n}g(hd,"rect_left_inv_arrow");async function cd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),h=t.description,c=t.label,l=await Re(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(Kt(Bt())){const v=l.children[0],R=yt(l);d=v.getBoundingClientRect(),R.attr("width",d.width),R.attr("height",d.height)}M.info("Text 2",h);const u=h||[],f=l.getBBox(),m=await Re(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),y=m.children[0],x=yt(m);d=y.getBoundingClientRect(),x.attr("width",d.width),x.attr("height",d.height);const C=(t.padding||0)/2;yt(m).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+C+5)+")"),yt(l).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-C+3)+")");const b=d.width+(t.padding||0),T=d.height+(t.padding||0),w=-d.width/2-C,B=-d.height/2-C;let F,L;if(t.look==="handDrawn"){const v=rt.svg(s),R=et(t,{}),N=v.path(ce(w,B,b,T,t.rx||0),R),q=v.line(-d.width/2-C,-d.height/2-C+f.height+C,d.width/2+C,-d.height/2-C+f.height+C,R);L=s.insert(()=>(M.debug("Rough node insert CXC",N),q),":first-child"),F=s.insert(()=>(M.debug("Rough node insert CXC",N),N),":first-child")}else F=a.insert("rect",":first-child"),L=a.insert("line"),F.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-C).attr("y",-d.height/2-C).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),L.attr("class","divider").attr("x1",-d.width/2-C).attr("x2",d.width/2+C).attr("y1",-d.height/2-C+f.height+C).attr("y2",-d.height/2-C+f.height+C);return ot(t,F),t.intersect=function(v){return tt.rect(t,v)},s}g(cd,"rectWithTitle");async function dd(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Ar(e,t,o)}g(dd,"roundedRect");var je=8;async function ud(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?je:je*2),l=(t?.height??n.height)+s*2,d=c-je,u=l,f=je-c/2,m=-l/2,{cssStyles:y}=t,x=rt.svg(a),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const b=[{x:f,y:m},{x:f+d,y:m},{x:f+d,y:m+u},{x:f-je,y:m+u},{x:f-je,y:m},{x:f,y:m},{x:f,y:m+u}],T=x.polygon(b.map(B=>[B.x,B.y]),C),w=a.insert(()=>T,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Wt(y)),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),y&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),h.attr("transform",`translate(${je/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,w),t.intersect=function(B){return tt.rect(t,B)},a}g(ud,"shadedProcess");async function gd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:h.width)+s*2,d=((t?.height?t?.height:h.height)+a*2)*1.5,u=l,f=d/1.5,m=-u/2,y=-f/2,{cssStyles:x}=t,C=rt.svg(n),b=et(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=[{x:m,y},{x:m,y:y+f},{x:m+u,y:y+f},{x:m+u,y:y-f/2}],w=Ft(T),B=C.path(w,b),F=n.insert(()=>B,":first-child");return F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectChildren("path").attr("style",x),i&&t.look!=="handDrawn"&&F.selectChildren("path").attr("style",i),F.attr("transform",`translate(0, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(h.x-(h.left??0))}, ${-f/4+(t.padding??0)-(h.y-(h.top??0))})`),ot(t,F),t.intersect=function(L){return tt.polygon(t,T,L)},n}g(gd,"slopedRect");async function pd(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return Ar(e,t,s)}g(pd,"squareRect");async function fd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=h.height+(t.look==="neo"?a*2:a),l=h.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:u}=t,f=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-l/2+d,y:-c/2},{x:l/2-d,y:-c/2},...Te(-l/2+d,0,d,50,90,270),{x:l/2-d,y:c/2},...Te(l/2-d,0,d,50,270,450)],x=Ft(y),C=f.path(x,m),b=n.insert(()=>C,":first-child");return b.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),ot(t,b),t.intersect=function(T){return tt.polygon(t,y,T)},n}g(fd,"stadium");async function md(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Ar(e,t,r)}g(md,"state");function yd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:h,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const l=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(l),u=et(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),m=n??h,y=(t.width??0)*5/14,x=d.circle(0,0,y,{...u,fill:m,stroke:m,strokeWidth:2,fillStyle:"solid"}),C=l.insert(()=>f,":first-child");if(C.insert(()=>x),t.look!=="handDrawn"&&C.attr("class","outer-path"),s&&C.selectAll("path").attr("style",s),o&&C.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const b=e.node()?.ownerSVGElement?.id??"",T=b?`${b}-drop-shadow-small`:"drop-shadow-small";C.attr("style",`filter:url(#${T})`)}return ot(t,C),t.intersect=function(b){return tt.circle(t,(t.width??0)/2,b)},l}g(yd,"stateEnd");function Cd(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const h=rt.svg(s).circle(0,0,t.width,tm(i));a=s.insert(()=>h),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",h=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${h})`)}return ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}g(Cd,"stateStart");var mr=8;async function xd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.width+2*mr+s,t.width??0),l=Math.max(h.height+a,t.height??0),d=c-2*mr,u=l,f=-c/2,m=-l/2,y=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const x=rt.svg(n),C=et(t,{}),b=x.rectangle(f,m,d+16,u,C),T=x.line(f+mr,m,f+mr,m+u,C),w=x.line(f+mr+d,m,f+mr+d,m+u,C);n.insert(()=>T,":first-child"),n.insert(()=>w,":first-child");const B=n.insert(()=>b,":first-child"),{cssStyles:F}=t;B.attr("class","basic label-container").attr("style",Wt(F)),ot(t,B)}else{const x=Le(n,d,u,y);i&&x.attr("style",i),ot(t,x)}return t.intersect=function(x){return tt.polygon(t,y,x)},n}g(xd,"subroutine");var Eo=.2;async function bd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-Eo*(t.height+a*2),10));const{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.height?t?.height:h.height)+a*2,l=Eo*c,d=Eo*c,f=(t?.width?t?.width:h.width)+s*2+l-l,m=c,y=-f/2,x=-m/2,{cssStyles:C}=t,b=rt.svg(n),T=et(t,{}),w=[{x:y-l/2,y:x},{x:y+f+l/2,y:x},{x:y+f+l/2,y:x+m},{x:y-l/2,y:x+m}],B=[{x:y+f-l/2,y:x+m},{x:y+f+l/2,y:x+m},{x:y+f+l/2,y:x+m-d}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const F=Ft(w),L=b.path(F,T),v=Ft(B),R=b.path(v,{...T,fillStyle:"solid"}),N=n.insert(()=>R,":first-child");return N.insert(()=>L,":first-child"),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),ot(t,N),t.intersect=function(q){return tt.polygon(t,w,q)},n}g(bd,"taggedRect");async function kd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),h=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=h/8,l=.2*n,d=.2*h,u=h+c,{cssStyles:f}=t,m=rt.svg(o),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-n/2-n/2*.1,y:u/2},...ze(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],C=-n/2+n/2*.1,b=-u/2-d*.4,T=[{x:C+n-l,y:(b+h)*1.3},{x:C+n,y:b+h-d},{x:C+n,y:(b+h)*.9},...ze(C+n,(b+h)*1.25,C+n-l,(b+h)*1.3,-h*.02,.5)],w=Ft(x),B=m.path(w,y),F=Ft(T),L=m.path(F,{...y,fillStyle:"solid"}),v=o.insert(()=>L,":first-child");return v.insert(()=>B,":first-child"),v.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-h/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),ot(t,v),t.intersect=function(R){return tt.polygon(t,x,R)},o}g(kd,"taggedWaveEdgedRectangle");async function Sd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ct(e,t,dt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),h=-a/2,c=-n/2,l=o.insert("rect",":first-child");return l.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",h).attr("y",c).attr("width",a).attr("height",n),ot(t,l),t.intersect=function(d){return tt.rect(t,d)},o}g(Sd,"text");var eC=g((e,t,r,i,o,s)=>`M${e},${t}
197
+ `);return Kl(i)}g(Xh,"preprocessMarkdown");function Uh(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}g(Uh,"nonMarkdownToLines");function Gh(e,t={}){const r=Xh(e,t),i=It.lexer(r),o=[[]];let s=0;function a(n,h="normal"){n.type==="text"?n.text.split(`
198
+ `).forEach((l,d)=>{d!==0&&(s++,o.push([])),l.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&o[s].push({content:u,type:h})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return g(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(h=>{a(h)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}g(Gh,"markdownToLines");function Vh(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}g(Vh,"nonMarkdownToHTML");function Kh(e,{markdownAutoWrap:t}={}){const r=It.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(M.warn(`Unsupported markdown: ${o.type}`),o.raw)}return g(i,"output"),r.map(i).join("")}g(Kh,"markdownToHTML");function Zh(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(Zh,"splitTextToChars");function Qh(e,t){const r=Zh(t.content);return ha(e,[],r,t.type)}g(Qh,"splitWordToFitWidth");function ha(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?ha(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(ha,"splitWordToFitWidthRecursion");function Jh(e,t){if(e.some(({content:r})=>r.includes(`
199
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Ui(e,t)}g(Jh,"splitLineToFitWidth");function Ui(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Ui(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,h]=Qh(t,s);r.push([n]),h.content&&e.unshift(h)}return Ui(e,t,r)}g(Ui,"splitLineToFitWidthRecursion");function Cs(e,t){t&&e.attr("style",t)}g(Cs,"applyStyle");var gn=16384;async function tc(e,t,r,i,o=!1,s=Dt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,gn)}px`),a.attr("height",`${Math.min(10*r,gn)}px`);const n=a.append("xhtml:div"),h=ai(t.label)?await bh(t.label.replace(pi.lineBreakRegex,`
200
+ `),s):ae(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",l=n.append("span");return l.html(h),Cs(l,t.labelStyle),l.attr("class",`${c} ${i}`),Cs(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg"),(await rr.measure(()=>n.node().getBoundingClientRect())).width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px")),a.node()}g(tc,"addHtmlSpan");function ao(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}g(ao,"createTspan");function ec(e,t,r){const i=e.append("text"),o=ao(i,1,t);no(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}g(ec,"computeWidthOfText");function uy(e,t,r){const i=e.append("text"),o=ao(i,1,t);no(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}g(uy,"computeDimensionOfText");function rc(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),h=a.append("text").attr("y","-10.1");o&&h.attr("text-anchor","middle");let c=0;for(const l of r){const d=g(f=>ec(a,1.1,f)<=e,"checkWidth"),u=d(l)?[l]:Jh(l,d);for(const f of u){const m=ao(h,c,1.1,o);no(m,f),c++}}if(i){const l=h.node().getBBox(),d=2;return n.attr("x",l.x-d).attr("y",l.y-d).attr("width",l.width+2*d).attr("height",l.height+2*d),a.node()}else return h.node()}g(rc,"createFormattedText");function xs(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}g(xs,"decodeHTMLEntities");function no(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(xs(r.content)):o.text(" "+xs(r.content))})}g(no,"updateTextContentAndStyles");async function ic(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await im(n)?await fi(n,void 0,{class:"label-icon"}):`<i class='${ae(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(ic,"replaceIconSubstring");var me=g(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:h=200,addSvgBackground:c=!1}={},l)=>{if(M.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Kh(t,l):Vh(t),u=await ic(Ne(d),l),f=t.replace(/\\\\/g,"\\"),m={isNode:n,label:ai(t)?f:u,labelStyle:r.replace("fill:","color:")};return await tc(e,m,h,o,c,l)}else{const d=Ne(t.replace(/<br\s*\/?>/g,"<br/>")),u=a?Gh(d.replace("<br>","<br/>"),l):Uh(d),f=rc(h,e,u,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(f).attr("style",m)}else{const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(f).select("rect").attr("style",m.replace(/background:/g,"fill:"));const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(f).select("text").attr("style",y)}return i?yt(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function ko(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const h of e){const[c,l]=h;h[0]=(c-i)*a-(l-o)*n+i,h[1]=(c-i)*n+(l-o)*a+o}}}function gy(e,t){return e[0]===t[0]&&e[1]===t[1]}function py(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)ko(c,n,o);const h=(function(c,l,d){const u=[];for(const b of c){const T=[...b];gy(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&u.push(T)}const f=[];l=Math.max(l,.1);const m=[];for(const b of u)for(let T=0;T<b.length-1;T++){const w=b[T],B=b[T+1];if(w[1]!==B[1]){const F=Math.min(w[1],B[1]);m.push({ymin:F,ymax:Math.max(w[1],B[1]),x:F===w[1]?w[0]:B[0],islope:(B[0]-w[0])/(B[1]-w[1])})}}if(m.sort(((b,T)=>b.ymin<T.ymin?-1:b.ymin>T.ymin?1:b.x<T.x?-1:b.x>T.x?1:b.ymax===T.ymax?0:(b.ymax-T.ymax)/Math.abs(b.ymax-T.ymax))),!m.length)return f;let y=[],x=m[0].ymin,C=0;for(;y.length||m.length;){if(m.length){let b=-1;for(let T=0;T<m.length&&!(m[T].ymin>x);T++)b=T;m.splice(0,b+1).forEach((T=>{y.push({s:x,edge:T})}))}if(y=y.filter((b=>!(b.edge.ymax<=x))),y.sort(((b,T)=>b.edge.x===T.edge.x?0:(b.edge.x-T.edge.x)/Math.abs(b.edge.x-T.edge.x))),(d!==1||C%l==0)&&y.length>1)for(let b=0;b<y.length;b+=2){const T=b+1;if(T>=y.length)break;const w=y[b].edge,B=y[T].edge;f.push([[Math.round(w.x),x],[Math.round(B.x),x]])}x+=d,y.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),C++}return f})(a,s,i);if(o){for(const c of a)ko(c,n,-o);(function(c,l,d){const u=[];c.forEach((f=>u.push(...f))),ko(u,l,d)})(h,n,-o)}return h}function yi(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),py(e,o,i,s||1)}class ca{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=yi(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function lo(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class fy extends ca{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=yi(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),h=.5*i*Math.sin(s);for(const[c,l]of o)lo([c,l])&&a.push([[c[0]-n,c[1]+h],[...l]],[[c[0]+n,c[1]-h],[...l]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class my extends ca{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class yy{constructor(t){this.helper=t}fillPolygons(t,r){const i=yi(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const h=lo(n),c=h/o,l=Math.ceil(c)-1,d=h-l*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let m=0;m<l;m++){const y=f+d+m*o,x=u-a+2*Math.random()*a,C=y-a+2*Math.random()*a,b=this.helper.ellipse(x,C,s,s,r);i.push(...b.ops)}}return{type:"fillSketch",ops:i}}}class Cy{constructor(t){this.helper=t}fillPolygons(t,r){const i=yi(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=lo(a),h=Math.floor(n/(i+o)),c=(n+o-h*(i+o))/2;let l=a[0],d=a[1];l[0]>d[0]&&(l=a[1],d=a[0]);const u=Math.atan((d[1]-l[1])/(d[0]-l[0]));for(let f=0;f<h;f++){const m=f*(i+o),y=m+i,x=[l[0]+m*Math.cos(u)+c*Math.cos(u),l[1]+m*Math.sin(u)+c*Math.sin(u)],C=[l[0]+y*Math.cos(u)+c*Math.cos(u),l[1]+y*Math.sin(u)+c*Math.sin(u)];s.push(...this.helper.doubleLineOps(x[0],x[1],C[0],C[1],r))}})),s}}class xy{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=yi(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=lo(s),n=Math.round(a/(2*r));let h=s[0],c=s[1];h[0]>c[0]&&(h=s[1],c=s[0]);const l=Math.atan((c[1]-h[1])/(c[0]-h[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,m=Math.sqrt(2*Math.pow(r,2)),y=[h[0]+u*Math.cos(l),h[1]+u*Math.sin(l)],x=[h[0]+f*Math.cos(l),h[1]+f*Math.sin(l)],C=[y[0]+m*Math.cos(l+Math.PI/4),y[1]+m*Math.sin(l+Math.PI/4)];o.push(...this.helper.doubleLineOps(y[0],y[1],C[0],C[1],i),...this.helper.doubleLineOps(C[0],C[1],x[0],x[1],i))}})),o}}const te={};class by{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const ky=0,So=1,pn=2,Bi={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function To(e,t){return e.type===t}function da(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:ky,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:So,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:pn,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!To(s,pn);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return da("M0,0"+e);o++,a=Bi[s.text],i=s.text}else To(s,So)?a=Bi[i]:(o++,a=Bi[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let h=o;h<o+a;h++){const c=r[h];if(!To(c,So))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Bi[i]!="number")throw new Error("Bad segment: "+i);{const h={key:i,data:n};t.push(h),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function oc(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const h=n.map(((c,l)=>l%2?c+r:c+t));s.push({key:"C",data:h}),t=h[4],r=h[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const h=n.map(((c,l)=>l%2?c+r:c+t));s.push({key:"Q",data:h}),t=h[2],r=h[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const h=n.map(((c,l)=>l%2?c+r:c+t));s.push({key:"S",data:h}),t=h[2],r=h[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function sc(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,h=0;for(const{key:c,data:l}of e){switch(c){case"M":t.push({key:"M",data:[...l]}),[i,o]=l,[s,a]=l;break;case"C":t.push({key:"C",data:[...l]}),i=l[4],o=l[5],n=l[2],h=l[3];break;case"L":t.push({key:"L",data:[...l]}),[i,o]=l;break;case"H":i=l[0],t.push({key:"L",data:[i,o]});break;case"V":o=l[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-h)):(d=i,u=o),t.push({key:"C",data:[d,u,...l]}),n=l[0],h=l[1],i=l[2],o=l[3];break}case"T":{const[d,u]=l;let f=0,m=0;r==="Q"||r==="T"?(f=i+(i-n),m=o+(o-h)):(f=i,m=o);const y=i+2*(f-i)/3,x=o+2*(m-o)/3,C=d+2*(f-d)/3,b=u+2*(m-u)/3;t.push({key:"C",data:[y,x,C,b,d,u]}),n=f,h=m,i=d,o=u;break}case"Q":{const[d,u,f,m]=l,y=i+2*(d-i)/3,x=o+2*(u-o)/3,C=f+2*(d-f)/3,b=m+2*(u-m)/3;t.push({key:"C",data:[y,x,C,b,f,m]}),n=d,h=u,i=f,o=m;break}case"A":{const d=Math.abs(l[0]),u=Math.abs(l[1]),f=l[2],m=l[3],y=l[4],x=l[5],C=l[6];d===0||u===0?(t.push({key:"C",data:[i,o,x,C,x,C]}),i=x,o=C):(i!==x||o!==C)&&(ac(i,o,x,C,d,u,f,m,y).forEach((function(b){t.push({key:"C",data:b})})),i=x,o=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Yr(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function ac(e,t,r,i,o,s,a,n,h,c){const l=(d=a,Math.PI*d/180);var d;let u=[],f=0,m=0,y=0,x=0;if(c)[f,m,y,x]=c;else{[e,t]=Yr(e,t,-l),[r,i]=Yr(r,i,-l);const W=(e-r)/2,z=(t-i)/2;let V=W*W/(o*o)+z*z/(s*s);V>1&&(V=Math.sqrt(V),o*=V,s*=V);const I=o*o,P=s*s,Y=I*P-I*z*z-P*W*W,lt=I*z*z+P*W*W,at=(n===h?-1:1)*Math.sqrt(Math.abs(Y/lt));y=at*o*z/s+(e+r)/2,x=at*-s*W/o+(t+i)/2,f=Math.asin(parseFloat(((t-x)/s).toFixed(9))),m=Math.asin(parseFloat(((i-x)/s).toFixed(9))),e<y&&(f=Math.PI-f),r<y&&(m=Math.PI-m),f<0&&(f=2*Math.PI+f),m<0&&(m=2*Math.PI+m),h&&f>m&&(f-=2*Math.PI),!h&&m>f&&(m-=2*Math.PI)}let C=m-f;if(Math.abs(C)>120*Math.PI/180){const W=m,z=r,V=i;m=h&&m>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=ac(r=y+o*Math.cos(m),i=x+s*Math.sin(m),z,V,o,s,a,0,h,[m,W,y,x])}C=m-f;const b=Math.cos(f),T=Math.sin(f),w=Math.cos(m),B=Math.sin(m),F=Math.tan(C/4),L=4/3*o*F,v=4/3*s*F,R=[e,t],N=[e+L*T,t-v*b],q=[r+L*B,i-v*w],J=[r,i];if(N[0]=2*R[0]-N[0],N[1]=2*R[1]-N[1],c)return[N,q,J].concat(u);{u=[N,q,J].concat(u);const W=[];for(let z=0;z<u.length;z+=3){const V=Yr(u[z][0],u[z][1],l),I=Yr(u[z+1][0],u[z+1][1],l),P=Yr(u[z+2][0],u[z+2][1],l);W.push([V[0],V[1],I[0],I[1],P[0],P[1]])}return W}}const Sy={randOffset:function(e,t){return pt(e,t)},randOffsetWithRange:function(e,t,r){return Gi(e,t,r)},ellipse:function(e,t,r,i,o){const s=lc(r,i,o);return bs(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return We(e,t,r,i,o,!0)}};function nc(e,t,r,i,o){return{type:"path",ops:We(e,t,r,i,o)}}function Oi(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...We(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...We(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?nc(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function Ty(e,t,r,i,o){return(function(s,a){return Oi(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function fn(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=vi(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:vi(r[0],1.5*(1+.22*t.roughness),Cn(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=vi(a,1*(1+.2*t.roughness),t),h=t.disableMultiStroke?[]:vi(a,1.5*(1+.22*t.roughness),Cn(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of h)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function lc(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const h=1-r.curveFitting;return a+=pt(a*h,r),n+=pt(n*h,r),{increment:s,rx:a,ry:n}}function bs(e,t,r,i){const[o,s]=xn(i.increment,e,t,i.rx,i.ry,1,i.increment*Gi(.1,Gi(.4,1,r),r),r);let a=Vi(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=xn(i.increment,e,t,i.rx,i.ry,1.5,0,r),h=Vi(n,null,r);a=a.concat(h)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function mn(e,t,r,i,o,s,a,n,h){const c=e,l=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=pt(.01*d,h),u+=pt(.01*u,h);let f=o,m=s;for(;f<0;)f+=2*Math.PI,m+=2*Math.PI;m-f>2*Math.PI&&(f=0,m=2*Math.PI);const y=2*Math.PI/h.curveStepCount,x=Math.min(y/2,(m-f)/2),C=bn(x,c,l,d,u,f,m,1,h);if(!h.disableMultiStroke){const b=bn(x,c,l,d,u,f,m,1.5,h);C.push(...b)}return a&&(n?C.push(...We(c,l,c+d*Math.cos(f),l+u*Math.sin(f),h),...We(c,l,c+d*Math.cos(m),l+u*Math.sin(m),h)):C.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+d*Math.cos(f),l+u*Math.sin(f)]})),{type:"path",ops:C}}function yn(e,t){const r=sc(oc(da(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...We(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[h,c,l,d,u,f]=n;i.push(...wy(h,c,l,d,u,f,s,t)),s=[u,f];break}case"Z":i.push(...We(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function wo(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+pt(o,t),i[0][1]+pt(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+pt(o,t),i[a][1]+pt(o,t)]})}}return{type:"fillPath",ops:r}}function fr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!te[o])switch(o){case"zigzag":te[o]||(te[o]=new fy(i));break;case"cross-hatch":te[o]||(te[o]=new my(i));break;case"dots":te[o]||(te[o]=new yy(i));break;case"dashed":te[o]||(te[o]=new Cy(i));break;case"zigzag-line":te[o]||(te[o]=new xy(i));break;default:o="hachure",te[o]||(te[o]=new ca(i))}return te[o]})(t,Sy).fillPolygons(e,t)}function Cn(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function hc(e){return e.randomizer||(e.randomizer=new by(e.seed||0)),e.randomizer.next()}function Gi(e,t,r,i=1){return r.roughness*i*(hc(r)*(t-e)+e)}function pt(e,t,r=1){return Gi(-e,e,t,r)}function We(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=ks(e,t,r,i,o,!0,!1);if(a)return n;const h=ks(e,t,r,i,o,!0,!0);return n.concat(h)}function ks(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),h=Math.sqrt(n);let c=1;c=h<200?1:h>500?.4:-.0016668*h+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>n&&(l=h/10);const d=l/2,u=.2+.2*hc(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,m=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=pt(f,o,c),m=pt(m,o,c);const y=[],x=()=>pt(d,o,c),C=()=>pt(l,o,c),b=o.preserveVertices;return a?y.push({op:"move",data:[e+(b?0:x()),t+(b?0:x())]}):y.push({op:"move",data:[e+(b?0:pt(l,o,c)),t+(b?0:pt(l,o,c))]}),a?y.push({op:"bcurveTo",data:[f+e+(r-e)*u+x(),m+t+(i-t)*u+x(),f+e+2*(r-e)*u+x(),m+t+2*(i-t)*u+x(),r+(b?0:x()),i+(b?0:x())]}):y.push({op:"bcurveTo",data:[f+e+(r-e)*u+C(),m+t+(i-t)*u+C(),f+e+2*(r-e)*u+C(),m+t+2*(i-t)*u+C(),r+(b?0:C()),i+(b?0:C())]}),y}function vi(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+pt(t,r),e[0][1]+pt(t,r)]),i.push([e[0][0]+pt(t,r),e[0][1]+pt(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+pt(t,r),e[o][1]+pt(t,r)]),o===e.length-1&&i.push([e[o][0]+pt(t,r),e[o][1]+pt(t,r)]);return Vi(i,null,r)}function Vi(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const h=e[n];s[0]=[h[0],h[1]],s[1]=[h[0]+(a*e[n+1][0]-a*e[n-1][0])/6,h[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...ks(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function xn(e,t,r,i,o,s,a,n){const h=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let l=0;l<=2*Math.PI;l+=e){const d=[t+i*Math.cos(l),r+o*Math.sin(l)];h.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const l=pt(.5,n)-Math.PI/2;c.push([pt(s,n)+t+.9*i*Math.cos(l-e),pt(s,n)+r+.9*o*Math.sin(l-e)]);const d=2*Math.PI+l-.01;for(let u=l;u<d;u+=e){const f=[pt(s,n)+t+i*Math.cos(u),pt(s,n)+r+o*Math.sin(u)];h.push(f),c.push(f)}c.push([pt(s,n)+t+i*Math.cos(l+2*Math.PI+.5*a),pt(s,n)+r+o*Math.sin(l+2*Math.PI+.5*a)]),c.push([pt(s,n)+t+.98*i*Math.cos(l+a),pt(s,n)+r+.98*o*Math.sin(l+a)]),c.push([pt(s,n)+t+.9*i*Math.cos(l+.5*a),pt(s,n)+r+.9*o*Math.sin(l+.5*a)])}return[c,h]}function bn(e,t,r,i,o,s,a,n,h){const c=s+pt(.1,h),l=[];l.push([pt(n,h)+t+.9*i*Math.cos(c-e),pt(n,h)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)l.push([pt(n,h)+t+i*Math.cos(d),pt(n,h)+r+o*Math.sin(d)]);return l.push([t+i*Math.cos(a),r+o*Math.sin(a)]),l.push([t+i*Math.cos(a),r+o*Math.sin(a)]),Vi(l,null,h)}function wy(e,t,r,i,o,s,a,n){const h=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let l=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?h.push({op:"move",data:[a[0],a[1]]}):h.push({op:"move",data:[a[0]+(u?0:pt(c[0],n)),a[1]+(u?0:pt(c[0],n))]}),l=u?[o,s]:[o+pt(c[f],n),s+pt(c[f],n)],h.push({op:"bcurveTo",data:[e+pt(c[f],n),t+pt(c[f],n),r+pt(c[f],n),i+pt(c[f],n),l[0],l[1]]});return h}function jr(e){return[...e]}function kn(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(jr(e[0]),jr(e[1]),jr(e[2]),jr(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(jr(o[0]));for(let n=1;n+2<o.length;n++){const h=o[n];s[0]=[h[0],h[1]],s[1]=[h[0]+(a*o[n+1][0]-a*o[n-1][0])/6,h[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function $i(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function By(e,t,r){const i=$i(t,r);if(i===0)return $i(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),$i(e,Ue(t,r,o))}function Ue(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Ss(e,t,r,i){const o=i||[];if((function(n,h){const c=n[h+0],l=n[h+1],d=n[h+2],u=n[h+3];let f=3*l[0]-2*c[0]-u[0];f*=f;let m=3*l[1]-2*c[1]-u[1];m*=m;let y=3*d[0]-2*u[0]-c[0];y*=y;let x=3*d[1]-2*u[1]-c[1];return x*=x,f<y&&(f=y),m<x&&(m=x),f+m})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt($i(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const h=e[t+0],c=e[t+1],l=e[t+2],d=e[t+3],u=Ue(h,c,.5),f=Ue(c,l,.5),m=Ue(l,d,.5),y=Ue(u,f,.5),x=Ue(f,m,.5),C=Ue(y,x,.5);Ss([h,u,y,C],0,r,o),Ss([C,x,m,d],0,r,o)}var s,a;return o}function vy(e,t){return Ki(e,0,e.length,t)}function Ki(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let h=0,c=1;for(let l=t+1;l<r-1;++l){const d=By(e[l],a,n);d>h&&(h=d,c=l)}return Math.sqrt(h)>i?(Ki(e,t,c+1,i,s),Ki(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Bo(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)Ss(e,3*s,t,i);return r&&r>0?Ki(i,0,i.length,r):i}const ie="none";class Zi{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[nc(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],h=Ty(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(wo([c],a)):n.push(fr([c],a))}return a.stroke!==ie&&n.push(h),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],h=lc(i,o,a),c=bs(t,r,a,h);if(a.fill)if(a.fillStyle==="solid"){const l=bs(t,r,a,h).opset;l.type="fillPath",n.push(l)}else n.push(fr([c.estimatedPoints],a));return a.stroke!==ie&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Oi(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,h){const c=this._o(h),l=[],d=mn(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=mn(t,r,i,o,s,a,!0,!1,u);f.type="fillPath",l.push(f)}else l.push((function(u,f,m,y,x,C,b){const T=u,w=f;let B=Math.abs(m/2),F=Math.abs(y/2);B+=pt(.01*B,b),F+=pt(.01*F,b);let L=x,v=C;for(;L<0;)L+=2*Math.PI,v+=2*Math.PI;v-L>2*Math.PI&&(L=0,v=2*Math.PI);const R=(v-L)/b.curveStepCount,N=[];for(let q=L;q<=v;q+=R)N.push([T+B*Math.cos(q),w+F*Math.sin(q)]);return N.push([T+B*Math.cos(v),w+F*Math.sin(v)]),N.push([T,w]),fr([N],b)})(t,r,i,o,s,a,c));return c.stroke!==ie&&l.push(d),this._d("arc",l,c)}curve(t,r){const i=this._o(r),o=[],s=fn(t,i);if(i.fill&&i.fill!==ie)if(i.fillStyle==="solid"){const a=fn(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const h=typeof n[0][0]=="number"?[n]:n;for(const c of h)c.length<3?a.push(...c):c.length===3?a.push(...Bo(kn([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Bo(kn(c),10,(1+i.roughness)/2))}a.length&&o.push(fr([a],i))}return i.stroke!==ie&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=Oi(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(wo([t],i)):o.push(fr([t],i))),i.stroke!==ie&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ie,a=i.stroke!==ie,n=!!(i.simplification&&i.simplification<1),h=(function(l,d,u){const f=sc(oc(da(l))),m=[];let y=[],x=[0,0],C=[];const b=()=>{C.length>=4&&y.push(...Bo(C,d)),C=[]},T=()=>{b(),y.length&&(m.push(y),y=[])};for(const{key:B,data:F}of f)switch(B){case"M":T(),x=[F[0],F[1]],y.push(x);break;case"L":b(),y.push([F[0],F[1]]);break;case"C":if(!C.length){const L=y.length?y[y.length-1]:x;C.push([L[0],L[1]])}C.push([F[0],F[1]]),C.push([F[2],F[3]]),C.push([F[4],F[5]]);break;case"Z":b(),y.push([x[0],x[1]])}if(T(),!u)return m;const w=[];for(const B of m){const F=vy(B,u);F.length&&w.push(F)}return w})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=yn(t,i);if(s)if(i.fillStyle==="solid")if(h.length===1){const l=yn(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(l.ops)})}else o.push(wo(h,i));else o.push(fr(h,i));return a&&(n?h.forEach((l=>{o.push(Oi(l,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ie};break;case"fillPath":a={d:this.opsToPath(s),stroke:ie,strokeWidth:0,fill:i.fill||ie};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ie,strokeWidth:i,fill:ie}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class Ly{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Zi(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,h){const c=this.gen.arc(t,r,i,o,s,a,n,h);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Li="http://www.w3.org/2000/svg";class Fy{constructor(t,r){this.svg=t,this.gen=new Zi(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(Li,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let h=null;switch(n.type){case"path":h=o.createElementNS(Li,"path"),h.setAttribute("d",this.opsToPath(n,a)),h.setAttribute("stroke",i.stroke),h.setAttribute("stroke-width",i.strokeWidth+""),h.setAttribute("fill","none"),i.strokeLineDash&&h.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&h.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":h=o.createElementNS(Li,"path"),h.setAttribute("d",this.opsToPath(n,a)),h.setAttribute("stroke","none"),h.setAttribute("stroke-width","0"),h.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||h.setAttribute("fill-rule","evenodd");break;case"fillSketch":h=this.fillSketch(o,n,i)}h&&s.appendChild(h)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(Li,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,h){const c=this.gen.arc(t,r,i,o,s,a,n,h);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new Ly(e,t),svg:(e,t)=>new Fy(e,t),generator:e=>new Zi(e),newSeed:()=>Zi.newSeed()},Ey=1,Ay=3;async function ua(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!ga(e);await Promise.all([...t].map(i=>new Promise(o=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",r){const a=Bt().fontSize?Bt().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[h=lh.fontSize]=io(a),c=h*n+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";o(i)}g(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}g(ua,"configureLabelImages");function ga(e){return e.nodeType===Ay?e.textContent?.trim()!=="":e.nodeType!==Ey||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(ga)}g(ga,"hasTextBesidesImages");var Sn=3,_y=32,My=g(async(e,t,r)=>{const i=Bt(),o=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),s=o.insert("g").attr("class","label").attr("style",Wt(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(C=>({text:C,cssClass:"c4-descr"}))].filter(C=>C.text),h=t.width?Math.max(t.width-2*(t.padding??0),_y):Bt().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async C=>{const b=s.append("g").attr("class",C.cssClass),T=await me(b,ae(Ne(C.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return yt(T).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),yt(T).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:b,box:b.node().getBBox()}})),u=Math.max(...d.map(({box:C})=>C.width),0);let f=0;for(const{el:C,box:b}of d)C.attr("transform",`translate(${u/2-b.x-b.width/2}, ${f-b.y})`),f+=b.height+Sn;const m=d.length>0?f-Sn:0;s.insert("rect",":first-child"),s.attr("transform",`translate(${-u/2}, ${-m/2})`);const y=s.node().getBBox(),x=(t.padding??0)/2;return{shapeSvg:o,bbox:y,halfPadding:x,label:s}},"c4LabelHelper"),ct=g(async(e,t,r)=>{if(t.stereotype!==void 0)return My(e,t,r);let i;const o=t.useHtmlLabels||ve(Bt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Wt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const h=!!t.icon||!!t.img,c=t.labelType==="markdown",l=await me(a,ae(Ne(n),Bt()),{useHtmlLabels:o,width:t.width||t.wrappingWidth||Bt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:h,markdown:c},Bt()),d=(t?.padding??0)/2;let u;if(o){const f=l.children[0],m=yt(l);await ua(f),u=await rr.measure(()=>f.getBoundingClientRect()),m.attr("width",u.width),m.attr("height",u.height)}else u=await rr.measure(()=>l.getBBox());return o?a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):a.attr("transform","translate(0, "+-u.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:u,halfPadding:d,label:a}},"labelHelper"),vo=g(async(e,t,r)=>{const i=r.useHtmlLabels??Kt(Bt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await me(o,ae(Ne(t),Bt()),{useHtmlLabels:i,width:r.width||Bt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),a=r.padding/2;let n;if(Kt(Bt())){const h=s.children[0],c=yt(s);n=await rr.measure(()=>h.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await rr.measure(()=>s.getBBox());return i?o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):o.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:a,label:o}},"insertLabel"),ot=g((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}const i=t.node().getBBox();e.width=i.width,e.height=i.height},"updateNodeBounds"),dt=g((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Ft(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}g(Ft,"createPathFromPoints");function ze(e,t,r,i,o,s){const a=[],h=r-e,c=i-t,l=h/s,d=2*Math.PI/l,u=t+c/2;for(let f=0;f<=50;f++){const m=f/50,y=e+m*h,x=u+o*Math.sin(d*(y-e));a.push({x:y,y:x})}return a}g(ze,"generateFullSineWavePoints");function Te(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:-f,y:-m})}return a}g(Te,"generateCirclePoints");function Ts(e){const t=Array.from(e.childNodes).filter(h=>h.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");r.setAttribute("d",i);const o=t.find(h=>h.getAttribute("fill")!=="none"),s=t.find(h=>h.getAttribute("stroke")!=="none"),a=g((h,c)=>h?.getAttribute(c)??void 0,"getAttr");if(o){const h={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(h).forEach(([c,l])=>{l&&r.setAttribute(c,l)})}if(s){const h={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(h).forEach(([c,l])=>{l&&r.setAttribute(c,l)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}g(Ts,"mergePaths");var Iy=g((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,h,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),h=s===0?0:n*o/s,c=n):(o<0&&(a=-a),h=a,c=o===0?0:a*s/o),{x:r+h,y:i+c}},"intersectRect"),ar=Iy,ce=g((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),Oy=g(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=Bt(),n=Kt(a);return await me(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Re=Oy;function cc(e,t){return e.intersect(t)}g(cc,"intersectNode");var $y=cc;function dc(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,h=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/h);i.x<o&&(c=-c);var l=Math.abs(t*r*n/h);return i.y<s&&(l=-l),{x:o+c,y:s+l}}g(dc,"intersectEllipse");var uc=dc;function gc(e,t,r){return uc(e,t,t,r)}g(gc,"intersectCircle");var Dy=gc;function pc(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,h=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&h!==0&&ws(n,h))return;const l=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=l*e.x+d*e.y+u,m=l*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(m)<c&&ws(f,m))return;const y=o*d-l*s;if(y===0)return;const x=Math.abs(y/2);let C=s*u-d*a;const b=C<0?(C-x)/y:(C+x)/y;C=l*a-o*u;const T=C<0?(C-x)/y:(C+x)/y;return{x:b,y:T}}}g(pc,"intersectLine");function ws(e,t){return e*t>0}g(ws,"sameSign");var Py=pc;function fc(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(l){a=Math.min(a,l.x),n=Math.min(n,l.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let h=i-e.width/2-a,c=o-e.height/2-n;for(let l=0;l<t.length;l++){let d=t[l],u=t[l<t.length-1?l+1:0],f=Py(e,r,{x:h+d.x,y:c+d.y},{x:h+u.x,y:c+u.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(l,d){let u=l.x-r.x,f=l.y-r.y,m=Math.sqrt(u*u+f*f),y=d.x-r.x,x=d.y-r.y,C=Math.sqrt(y*y+x*x);return m<C?-1:m===C?0:1}),s[0]):e}g(fc,"intersectPolygon");var Ry=fc,tt={node:$y,circle:Dy,ellipse:uc,polygon:Ry,rect:ar};function mc(e,t){const{labelStyles:r}=st(t);t.labelStyle=r;const i=dt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,h=rt.svg(s),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const l=h.circle(0,0,a*2,c),d=s.insert(()=>l,":first-child");return d.attr("class","anchor").attr("style",Wt(n)),ot(t,d),t.intersect=function(u){return M.info("Circle intersect",t,a,u),tt.circle(t,a,u)},s}g(mc,"anchor");function Bs(e,t,r,i,o,s,a){const h=(e+r)/2,c=(t+i)/2,l=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,m=u/s,y=Math.sqrt(f**2+m**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");const x=Math.sqrt(1-y**2),C=h+x*s*Math.sin(l)*(a?-1:1),b=c-x*o*Math.cos(l)*(a?-1:1),T=Math.atan2((t-b)/s,(e-C)/o);let B=Math.atan2((i-b)/s,(r-C)/o)-T;a&&B<0&&(B+=2*Math.PI),!a&&B>0&&(B-=2*Math.PI);const F=[];for(let L=0;L<20;L++){const v=L/19,R=T+v*B,N=C+o*Math.cos(R),q=b+s*Math.sin(R);F.push({x:N,y:q})}return F}g(Bs,"generateArcPoints");function yc(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}g(yc,"calculateArcSagitta");async function Cc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=g(R=>R+a,"calcTotalHeight"),h=g(R=>{const N=R/2;return[N/(2.5+R/50),N]},"calcEllipseRadius"),{shapeSvg:c,bbox:l}=await ct(e,t,dt(t)),d=n(t?.height?t?.height:l.height),[u,f]=h(d),m=yc(d,u,f),x=(t?.width?t?.width:l.width)+s*2+m-m,C=d,{cssStyles:b}=t,T=[{x:x/2,y:-C/2},{x:-x/2,y:-C/2},...Bs(-x/2,-C/2,-x/2,C/2,u,f,!1),{x:x/2,y:C/2},...Bs(x/2,C/2,x/2,-C/2,u,f,!0)],w=rt.svg(c),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const F=Ft(T),L=w.path(F,B),v=c.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${u/2}, 0)`),ot(t,v),t.intersect=function(R){return tt.polygon(t,T,R)},c}g(Cc,"bowTieRect");async function xc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,label:n}=await ct(e,t,dt(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,l=Math.max(a.width+c*2,t.width??0,80),d=Math.max(Math.min(l*.08,12),5),u=Math.max(a.height+c*2+d,t.height??0),f=-u/2+d,m=u/2,y=l*.72,x=[`M${-l/2},${f}`,`L${-y/2},${m}`,`A${y/2},${d} 0 0 0 ${y/2},${m}`,`L${l/2},${f}`,`A${l/2},${d} 0 0 0 ${-l/2},${f}`,"Z"].join(" "),{cssStyles:C}=t,b=s.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const v=rt.svg(s).path(x,et(t,{}));b.node()?.appendChild(v),C&&b.attr("style",C)}else b.append("path").attr("d",x).attr("style",o);b.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",l/2).attr("ry",d).attr("style",`fill:none;stroke:${h};stroke-width:1px`),ot(t,b);const T=f+(m-f)/2;n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${T-a.height/2-(a.y-(a.top??0))})`);const w=12,B=g((L,v,R)=>Array.from({length:w+1},(N,q)=>{const J=Math.PI-q*Math.PI/w;return{x:L*Math.cos(J),y:v+R*d*Math.sin(J)}}),"arc"),F=[...B(l/2,f,-1),...B(y/2,m,1).reverse()];return t.intersect=function(L){return tt.polygon(t,F,L)},s}g(xc,"bucket");var Tn=20,wn=8,qy=80,Lo=8;async function bc(e,t){const{themeVariables:r}=Bt(),i=r.clusterBkg,o=r.clusterBorder,{nodeStyles:s}=st(t),{shapeSvg:a,bbox:n}=await ct(e,t,dt(t)),h=t.padding??8,c=n.height,l=Math.max(n.width+h*2,qy,t?.width??0),d=Math.max(c+wn+Tn+h*2,t?.height??0),u=-l/2,f=-d/2,m=-28/2,y=a.select(".label");y&&(t.useHtmlLabels??Kt(Bt())?y.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):y.attr("transform",`translate(0, ${-n.height/2+m})`));let x;if(t.look==="handDrawn"){const B=rt.svg(a),F=et(t,{fill:i,stroke:o,fillStyle:"solid"}),L=B.path(ce(u,f,l,d,Lo),F);x=a.insert(()=>L,":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",Wt(t.cssStyles))}else x=a.insert("rect",":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",s).attr("rx",Lo).attr("ry",Lo).attr("x",u).attr("y",f).attr("width",l).attr("height",d).attr("fill",i).attr("stroke",o);const C=f+h+c+wn;a.append("line").attr("class","collapsed-separator").attr("x1",u+8).attr("y1",C).attr("x2",u+l-8).attr("y2",C).attr("stroke",o).attr("stroke-dasharray","3, 3");const b=C+Tn/2,T=2.5,w=10;for(let B=-1;B<=1;B++)a.append("circle").attr("class","collapsed-indicator").attr("cx",B*w).attr("cy",b).attr("r",T).attr("fill",o);return ot(t,x),t.calcIntersect=function(B,F){return tt.rect(B,F)},t.intersect=function(B){return tt.rect(t,B)},a}g(bc,"collapsedGroup");function Le(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(Le,"insertPolygonShape");var Ny=["right","left","up","down"],pa="point",Wy=g(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),zy=g(e=>Ny.filter(t=>e.has(t)).join("|")||pa,"getDirectionKey"),Bn={"right|left|up|down":g(({height:e,midpoint:t,padding:r,width:i})=>[{x:0,y:0},{x:t,y:0},{x:i/2,y:2*r},{x:i-t,y:0},{x:i,y:0},{x:i,y:-e/3},{x:i+2*r,y:-e/2},{x:i,y:-2*e/3},{x:i,y:-e},{x:i-t,y:-e},{x:i/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":g(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":g(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":g(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":g(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":g(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"up|down"),"right|up":g(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":g(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":g(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":g(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r}],"up"),down:g(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"down"),[pa]:()=>[{x:0,y:0}]},Hy=g((e,t,r,i)=>{const o=Wy(e),s=(r.padding??0)/2,a=t.height+4*s,n=a/2,h=i??t.width+2*n+2*s,c=zy(o);return(Bn[c]??Bn[pa])({height:a,midpoint:n,padding:s,width:h})},"getArrowPoints");async function kc(e,t){const r=t,{shapeSvg:i,bbox:o}=await ct(e,r,dt(r)),s=r.padding??0,a=o.height+2*s,n=a/2,h=o.width+2*n+s,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>h?c:h,u=Hy(r.directions??[],o,r,d),f=Le(i,d,a,u);return f.attr("style",r.style??null),ot(r,f),r.intersect=function(m){return tt.polygon(r,u,m)},i}g(kc,"block_arrow");async function Sc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,label:n}=await ct(e,t,dt(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,l=18,d=12,u=Math.max(a.width+c*2,t.width??0,90),f=Math.max(a.height+c*2+l,t.height??0),m=-f/2,{cssStyles:y}=t,x=s.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const T=rt.svg(s).path(ce(-u/2,m,u,f,d),et(t,{}));x.node()?.appendChild(T),y&&x.attr("style",y)}else x.append("rect").attr("x",-u/2).attr("y",m).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);x.append("line").attr("x1",-u/2).attr("y1",m+l).attr("x2",u/2).attr("y2",m+l).attr("style",`stroke:${h};stroke-width:1px`);for(let b=0;b<3;b++)x.append("circle").attr("cx",-u/2+12+b*9).attr("cy",m+l/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);x.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",m+4).attr("width",Math.max(u-56,10)).attr("height",l-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),ot(t,x);const C=m+l+(f-l)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(b){return tt.rect(t,b)},s}g(Sc,"browser");var Fi=12;async function Tc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.width??h.width)+(t.look==="neo"?s*2:s+Fi),l=(t?.height??h.height)+(t.look==="neo"?a*2:a),d=0,u=c,f=-l,m=0,y=[{x:d+Fi,y:f},{x:u,y:f},{x:u,y:m},{x:d,y:m},{x:d,y:f+Fi},{x:d+Fi,y:f}];let x;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=rt.svg(n),T=et(t,{}),w=Ft(y),B=b.path(w,T);x=n.insert(()=>B,":first-child").attr("transform",`translate(${-c/2}, ${l/2})`),C&&x.attr("style",C)}else x=Le(n,c,l,y);return i&&x.attr("style",i),ot(t,x),t.intersect=function(b){return tt.polygon(t,y,b)},n}g(Tc,"card");function wc(e,t){const{nodeStyles:r}=st(t);t.label="";const i=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=rt.svg(i),h=et(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const c=Ft(a),l=n.path(c,h),d=i.insert(()=>l,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return tt.polygon(t,a,u)},i}g(wc,"choice");async function fa(e,t,r){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await ct(e,t,dt(t)),h=16,c=r?.padding??n,l=t.look==="neo"?a.width/2+h*2:a.width/2+c;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(s),m=et(t,{}),y=f.circle(0,0,l*2,m);d=s.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Wt(u))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",l).attr("cx",0).attr("cy",0);return ot(t,d),t.calcIntersect=function(f,m){const y=f.width/2;return tt.circle(f,y,m)},t.intersect=function(f){return M.info("Circle intersect",t,l,f),tt.circle(t,l,f)},s}g(fa,"circle");async function Bc(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:s,halfPadding:a}=await ct(e,r,i),n=o.insert("rect",":first-child"),h=r.padding??0,c=r.positioned?r.width??0:s.width+h,l=r.positioned?r.height??0:s.height+h,d=r.positioned?-c/2:-s.width/2-a,u=r.positioned?-l/2:-s.height/2-a;return n.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",l),ot(r,n),r.intersect=function(f){return tt.rect(r,f)},o}g(Bc,"composite");async function vc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,label:n}=await ct(e,t,dt(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,l=20,d=12,u=Math.max(a.width+c*2,t.width??0,90),f=Math.max(a.height+c*2+l,t.height??0),m=-f/2,{cssStyles:y}=t,x=s.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const T=rt.svg(s).path(ce(-u/2,m,u,f,d),et(t,{}));x.node()?.appendChild(T),y&&x.attr("style",y)}else x.append("rect").attr("x",-u/2).attr("y",m).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);x.append("text").attr("x",-u/2+12).attr("y",m+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),ot(t,x);const C=m+l+(f-l)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(b){return tt.rect(t,b)},s}g(vc,"consoleWindow");function Lc(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
201
+ M ${o.x},${o.y} L ${a.x},${a.y}`}g(Lc,"createLine");function Fc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),h=et(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const c=n.circle(0,0,s*2,h),l=Lc(s),d=n.path(l,h),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),ot(t,u),t.intersect=function(f){return M.info("crossedCircle intersect",t,{radius:s,point:f}),tt.circle(t,s,f)},o}g(Fc,"crossedCircle");function Ae(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:-f,y:-m})}return a}g(Ae,"generateCirclePoints");async function Ec(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,c=s.width+n,l=s.height+h,d=Math.max(5,l*.1),{cssStyles:u}=t,f=[...Ae(c/2,-l/2,d,30,-90,0),{x:-c/2-d,y:d},...Ae(c/2+d*2,-d,d,20,-180,-270),...Ae(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-l/2},...Ae(c/2,l/2,d,20,0,90)],m=[{x:c/2,y:-l/2-d},{x:-c/2,y:-l/2-d},...Ae(c/2,-l/2,d,20,-90,0),{x:-c/2-d,y:-d},...Ae(c/2+c*.1,-d,d,20,-180,-270),...Ae(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:l/2},...Ae(c/2,l/2,d,20,0,90),{x:-c/2,y:l/2+d},{x:c/2,y:l/2+d}],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Ft(f).replace("Z",""),T=y.path(b,x),w=Ft(m),B=y.path(w,{...x}),F=o.insert("g",":first-child");return F.insert(()=>B,":first-child").attr("stroke-opacity",0),F.insert(()=>T,":first-child"),F.attr("class","text"),u&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,F),t.intersect=function(L){return tt.polygon(t,m,L)},o}g(Ec,"curlyBraceLeft");function _e(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:f,y:m})}return a}g(_e,"generateCirclePoints");async function Ac(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),l=s.height+(t.look==="neo"?h*2:h),d=Math.max(5,l*.1),{cssStyles:u}=t,f=[..._e(c/2,-l/2,d,20,-90,0),{x:c/2+d,y:-d},..._e(c/2+d*2,-d,d,20,-180,-270),..._e(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:l/2},..._e(c/2,l/2,d,20,0,90)],m=[{x:-c/2,y:-l/2-d},{x:c/2,y:-l/2-d},..._e(c/2,-l/2,d,20,-90,0),{x:c/2+d,y:-d},..._e(c/2+d*2,-d,d,20,-180,-270),..._e(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:l/2},..._e(c/2,l/2,d,20,0,90),{x:c/2,y:l/2+d},{x:-c/2,y:l/2+d}],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=Ft(f).replace("Z",""),T=y.path(b,x),w=Ft(m),B=y.path(w,{...x}),F=o.insert("g",":first-child");return F.insert(()=>B,":first-child").attr("stroke-opacity",0),F.insert(()=>T,":first-child"),F.attr("class","text"),u&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",i),F.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,F),t.intersect=function(L){return tt.polygon(t,m,L)},o}g(Ac,"curlyBraceRight");function jt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,l=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*l,f=e+r*Math.cos(u),m=t+r*Math.sin(u);a.push({x:-f,y:-m})}return a}g(jt,"generateCirclePoints");async function _c(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),l=s.height+(t.look==="neo"?h*2:h),d=Math.max(5,l*.1),{cssStyles:u}=t,f=[...jt(c/2,-l/2,d,30,-90,0),{x:-c/2-d,y:d},...jt(c/2+d*2,-d,d,20,-180,-270),...jt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-l/2},...jt(c/2,l/2,d,20,0,90)],m=[...jt(-c/2+d+d/2,-l/2,d,20,-90,-180),{x:c/2-d/2,y:d},...jt(-c/2-d/2,-d,d,20,0,90),...jt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...jt(-c/2+d+d/2,l/2,d,30,-180,-270)],y=[{x:c/2,y:-l/2-d},{x:-c/2,y:-l/2-d},...jt(c/2,-l/2,d,20,-90,0),{x:-c/2-d,y:-d},...jt(c/2+d*2,-d,d,20,-180,-270),...jt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:l/2},...jt(c/2,l/2,d,20,0,90),{x:-c/2,y:l/2+d},{x:c/2-d-d/2,y:l/2+d},...jt(-c/2+d+d/2,-l/2,d,20,-90,-180),{x:c/2-d/2,y:d},...jt(-c/2-d/2,-d,d,20,0,90),...jt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...jt(-c/2+d+d/2,l/2,d,30,-180,-270)],x=rt.svg(o),C=et(t,{fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=Ft(f).replace("Z",""),w=x.path(T,C),F=Ft(m).replace("Z",""),L=x.path(F,C),v=Ft(y),R=x.path(v,{...C}),N=o.insert("g",":first-child");return N.insert(()=>R,":first-child").attr("stroke-opacity",0),N.insert(()=>w,":first-child"),N.insert(()=>L,":first-child"),N.attr("class","text"),u&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-l/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,N),t.intersect=function(q){return tt.polygon(t,y,q)},o}g(_c,"curlyBraces");async function Mc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,h=5,{shapeSvg:c,bbox:l}=await ct(e,t,dt(t)),d=Math.max(n,(l.width+s*2)*1.25,t?.width??0),u=Math.max(h,l.height+a*2,t?.height??0),f=u/2,{cssStyles:m}=t,y=rt.svg(c),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=d,b=u,T=C-f,w=b/4,B=[{x:T,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:T,y:b},...Te(-T,-b/2,f,50,270,90)],F=Ft(B),L=y.path(F,x),v=c.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",i),v.attr("transform",`translate(${-d/2}, ${-u/2})`),ot(t,v),t.intersect=function(R){return tt.polygon(t,B,R)},c}g(Mc,"curvedTrapezoid");async function Ic(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.padding??20,h=Math.max(s.width+n*2,t.width??0,100),c=Math.min(Math.max(h*.23,16),56),l=c*.27,d=Math.max(s.height+n*2,t.height?t.height-(2*c-l):0),u=Math.min(h*.177,d*.45),f=d+2*c-l,m=-f/2,y=m+2*c-l,x=o.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:C}=t;if(t.look==="handDrawn"){const v=rt.svg(o),R=et(t,{}),N=v.path(ce(-h/2,y,h,d,u),R),q=v.circle(0,m+c,c*2,R);x.insert(()=>q,":first-child"),x.insert(()=>N,":first-child"),C&&x.attr("style",C)}else x.append("rect").attr("x",-h/2).attr("y",y).attr("width",h).attr("height",d).attr("rx",u).attr("ry",u).attr("style",i),x.append("circle").attr("cx",0).attr("cy",m+c).attr("r",c).attr("style",i);ot(t,x);const b=y+d/2;a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);const T=m+c,w=Math.asin(Math.min(1,(y-T)/c))*180/Math.PI,L=[...Te(0,-T,c,24,180+w,-w),...Te(-(-h/2+u),-(y+u),u,12,90,0),...Te(-(-h/2+u),-(f/2-u),u,12,360,270),...Te(-(h/2-u),-(f/2-u),u,12,270,180),...Te(-(h/2-u),-(y+u),u,12,180,90)];return t.intersect=function(v){return tt.polygon(t,L,v)},o}g(Ic,"person");var Yy=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),jy=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),Xy=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),vn=8,Ln=8;async function Oc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o,n=t.width??0;if(t.width&&(t.width=t.width-a,t.width<Ln&&(t.width=Ln)),t.height){const b=n/2/(2.5+n/50);t.height=t.height-s-b*3,t.height<vn&&(t.height=vn)}const{shapeSvg:h,bbox:c,label:l}=await ct(e,t,dt(t)),d=Math.max(t.width??0,c.width)+a,u=d/2,f=u/(2.5+d/50),m=Math.max(t.height??0,c.height)+s+f;let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),b=jy(0,0,d,m,u,f),T=Xy(0,f,d,m,u,f),w=et(t,{}),B=C.path(b,w),F=C.path(T,et(t,{fill:"none"}));y=h.insert(()=>F,":first-child"),y=h.insert(()=>B,":first-child"),y.attr("class","basic label-container"),x&&y.attr("style",x)}else{const C=Yy(0,0,d,m,u,f);y=h.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",Wt(x)).attr("style",i)}return y.attr("label-offset-y",f),y.attr("transform",`translate(${-d/2}, ${-(m/2+f)})`),ot(t,y),l.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(C){const b=tt.rect(t,C),T=b.x-(t.x??0);if(u!=0&&(Math.abs(T)<(t.width??0)/2||Math.abs(T)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let w=f*f*(1-T*T/(u*u));w>0&&(w=Math.sqrt(w)),w=f-w,C.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},h}g(Oc,"cylinder");async function Ar(e,t,r){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await ct(e,t,dt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),h=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,l=-h/2;let d,{rx:u,ry:f}=t;const{cssStyles:m}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const y=rt.svg(s),x=et(t,{}),C=u||f?y.path(ce(c,l,n,h,u||0),x):y.rectangle(c,l,n,h,x);d=s.insert(()=>C,":first-child"),d.attr("class","basic label-container").attr("style",Wt(m))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Wt(u)).attr("ry",Wt(f)).attr("x",c).attr("y",l).attr("width",n).attr("height",h);return ot(t,d,t.look==="handDrawn"?void 0:{width:n,height:h}),t.calcIntersect=function(y,x){return tt.rect(y,x)},t.intersect=function(y){return tt.rect(t,y)},s}g(Ar,"drawRect");async function $c(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,h={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await Ar(e,t,h);if(t.look==="handDrawn"){const f=rt.svg(c),m=et(t,{}),y=c.select(".basic.label-container > path:nth-child(2)"),x=y.node();if(!x)return c;let C=null;if(x instanceof SVGGraphicsElement)C=x.getBBox();else return c;return c.insert(()=>f.line(C.x,C.y,C.x+C.width,C.y,m),".basic.label-container g.label"),c.insert(()=>f.line(C.x,C.y+C.height,C.x+C.width,C.y+C.height,m),".basic.label-container g.label"),y.remove(),c}const l=c.select(".basic.label-container"),d=(Number(l.attr("width"))||a)??0,u=(Number(l.attr("height"))||n)??0;return d>0&&u>0&&l.attr("stroke-dasharray",`${d} ${u}`),c}g($c,"datastore");async function Dc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=n.width+o,l=n.height+s,d=l*.2,u=-c/2,f=-l/2-d/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],b=y.polygon(C.map(w=>[w.x,w.y]),x),T=a.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),h.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ot(t,T),t.intersect=function(w){return tt.rect(t,w)},a}g(Dc,"dividedRectangle");async function Pc(e,t){const{labelStyles:r,nodeStyles:i}=st(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width/2:h.width/2)+(a??0),l=c-o;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(n),m=et(t,{roughness:.2,strokeWidth:2.5}),y=et(t,{roughness:.2,strokeWidth:1.5}),x=f.circle(0,0,c*2,m),C=f.circle(0,0,l*2,y);d=n.insert("g",":first-child"),d.attr("class",Wt(t.cssClasses)).attr("style",Wt(u)),d.node()?.appendChild(x),d.node()?.appendChild(C)}else{d=n.insert("g",":first-child");const f=d.insert("circle",":first-child"),m=d.insert("circle");d.attr("class","basic label-container").attr("style",i),f.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0)}return ot(t,d),t.intersect=function(f){return M.info("DoubleCircle intersect",t,c,f),tt.circle(t,c,f)},n}g(Pc,"doublecircle");function Rc(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,h=rt.svg(s),{nodeBorder:c}=r,l=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(l.roughness=0);const d=h.circle(0,0,a*2,l),u=s.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),ot(t,u),t.intersect=function(f){return M.info("filledCircle intersect",t,{radius:a,point:f}),tt.circle(t,a,f)},s}g(Rc,"filledCircle");var Fn=10,En=10;async function qc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<Fn&&(t.height=Fn),t.width=(t?.width??0)-s-s/2,t.width<En&&(t.width=En));const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width:n.width)+(s??0),l=t?.height?t?.height:c+n.height,d=l,u=[{x:0,y:-l},{x:d,y:-l},{x:d/2,y:0}],{cssStyles:f}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Ft(u),C=m.path(x,y),b=a.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=c,t.height=l,ot(t,b),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-l/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(T){return M.info("Triangle intersect",t,u,T),tt.polygon(t,u,T)},a}g(qc,"flippedTriangle");async function Nc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.padding??12,h=Math.max(s.width+n*2,t.width??0,90),c=s.height+n*2,l=Math.max(Math.min(c*.16,14),8),d=Math.max(c+l,t.height??0),u=d-l,f=Math.max(h*.38,28),m=-d/2,y=[{x:-h/2,y:m},{x:-h/2+f,y:m},{x:-h/2+f,y:m+l},{x:h/2,y:m+l},{x:h/2,y:d/2},{x:-h/2,y:d/2}],x=[`M${y[0].x},${y[0].y}`,...y.slice(1).map(w=>`L${w.x},${w.y}`),"Z"].join(" "),{cssStyles:C}=t;let b;if(t.look==="handDrawn"){const B=rt.svg(o).path(x,et(t,{}));b=o.insert(()=>B,":first-child").attr("class","basic label-container"),C&&b.attr("style",C)}else b=o.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",i);t.look==="handDrawn"?ot(t,b):ot(t,b,{width:h,height:d});const T=m+l+u/2;return a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${T-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(w){return tt.polygon(t,y,w)},o}g(Nc,"folder");function Wc(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=st(t);t.label="";const a=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let h=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(h=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const l=-1*h/2,d=-1*c/2,u=rt.svg(a),f=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const m=u.rectangle(l,d,h,c,f),y=a.insert(()=>m,":first-child");n&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",s),ot(t,y);const x=i?.padding??0;return t.width&&t.height&&(t.width+=x/2||0,t.height+=x/2||0),t.intersect=function(C){return tt.rect(t,C)},a}g(Wc,"forkJoin");async function zc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:h,bbox:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,u=d/2,{cssStyles:f}=t,m=rt.svg(h),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-l/2,y:-d/2},{x:l/2-u,y:-d/2},...Te(-l/2+u,0,u,50,90,270),{x:l/2-u,y:d/2},{x:-l/2,y:d/2}],C=Ft(x),b=m.path(C,y),T=h.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ot(t,T),t.intersect=function(w){return M.info("Pill intersect",t,{radius:u,point:w}),tt.polygon(t,x,w)},h}g(zc,"halfRoundedRectangle");var Uy=g((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Hc(e,t){const{labelStyles:r,nodeStyles:i}=st(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,h=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const T=(t.height??0)/o;t.width=(t?.width??0)-2*T-c,t.height=(t.height??0)-h}const{shapeSvg:l,bbox:d}=await ct(e,t,dt(t)),u=(t?.height?t?.height:d.height)+h,f=u/o,m=(t?.width?t?.width:d.width)+2*f+c,y=[{x:f,y:0},{x:m-f,y:0},{x:m,y:-u/2},{x:m-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let x;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=rt.svg(l),T=et(t,{}),w=Uy(0,0,m,u,f),B=b.path(w,T);x=l.insert(()=>B,":first-child").attr("transform",`translate(${-m/2}, ${u/2})`),C&&x.attr("style",C)}else x=Le(l,m,u,y);return i&&x.attr("style",i),t.width=m,t.height=u,ot(t,x),t.intersect=function(b){return tt.polygon(t,y,b)},l}g(Hc,"hexagon");async function Yc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await ct(e,t,dt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,h=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const l=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Ft(l),u=h.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-s/2}, ${-a/2})`),ot(t,f),t.intersect=function(m){return M.info("Pill intersect",t,{points:l}),tt.polygon(t,l,m)},o}g(Yc,"hourglass");async function jc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,label:d}=await ct(e,t,"icon-shape default"),u=t.pos==="t",f=n,m=n,{nodeBorder:y}=r,{stylesMap:x}=Er(t),C=-m/2,b=-f/2,T=t.label?8:0,w=rt.svg(c),B=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const F=w.rectangle(C,b,m,f,B),L=Math.max(m,l.width),v=f+l.height+T,R=w.rectangle(-L/2,-v/2,L,v,{...B,fill:"transparent",stroke:"none"}),N=c.insert(()=>F,":first-child"),q=c.insert(()=>R);if(t.icon){const J=c.append("g");J.html(`<g>${await fi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const W=J.node().getBBox(),z=W.width,V=W.height,I=W.x,P=W.y;J.attr("transform",`translate(${-z/2-I},${u?l.height/2+T/2-V/2-P:-l.height/2-T/2-V/2-P})`),J.attr("style",`color: ${x.get("stroke")??y};`)}return d.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${u?-v/2:v/2-l.height})`),N.attr("transform",`translate(0,${u?l.height/2+T/2:-l.height/2-T/2})`),ot(t,q),t.intersect=function(J){if(M.info("iconSquare intersect",t,J),!t.label)return tt.rect(t,J);const W=t.x??0,z=t.y??0,V=t.height??0;let I=[];return u?I=[{x:W-l.width/2,y:z-V/2},{x:W+l.width/2,y:z-V/2},{x:W+l.width/2,y:z-V/2+l.height+T},{x:W+m/2,y:z-V/2+l.height+T},{x:W+m/2,y:z+V/2},{x:W-m/2,y:z+V/2},{x:W-m/2,y:z-V/2+l.height+T},{x:W-l.width/2,y:z-V/2+l.height+T}]:I=[{x:W-m/2,y:z-V/2},{x:W+m/2,y:z-V/2},{x:W+m/2,y:z-V/2+f},{x:W+l.width/2,y:z-V/2+f},{x:W+l.width/2/2,y:z+V/2},{x:W-l.width/2,y:z+V/2},{x:W-l.width/2,y:z-V/2+f},{x:W-m/2,y:z-V/2+f}],tt.polygon(t,I,J)},c}g(jc,"icon");async function Xc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,label:d}=await ct(e,t,"icon-shape default"),u=20,f=t.label?8:0,m=t.pos==="t",{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Er(t),b=rt.svg(c),T=et(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const w=C.get("fill");T.stroke=w??x;const B=c.append("g");t.icon&&B.html(`<g>${await fi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=B.node().getBBox(),L=F.width,v=F.height,R=F.x,N=F.y,q=Math.max(L,v)*Math.SQRT2+u*2,J=b.circle(0,0,q,T),W=Math.max(q,l.width),z=q+l.height+f,V=b.rectangle(-W/2,-z/2,W,z,{...T,fill:"transparent",stroke:"none"}),I=c.insert(()=>J,":first-child"),P=c.insert(()=>V);return B.attr("transform",`translate(${-L/2-R},${m?l.height/2+f/2-v/2-N:-l.height/2-f/2-v/2-N})`),B.attr("style",`color: ${C.get("stroke")??y};`),d.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${m?-z/2:z/2-l.height})`),I.attr("transform",`translate(0,${m?l.height/2+f/2:-l.height/2-f/2})`),ot(t,P),t.intersect=function(Y){return M.info("iconSquare intersect",t,Y),tt.rect(t,Y)},c}g(Xc,"iconCircle");async function Uc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,halfPadding:d,label:u}=await ct(e,t,"icon-shape default"),f=t.pos==="t",m=n+d*2,y=n+d*2,{nodeBorder:x,mainBkg:C}=r,{stylesMap:b}=Er(t),T=-y/2,w=-m/2,B=t.label?8:0,F=rt.svg(c),L=et(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=b.get("fill");L.stroke=v??C;const R=F.path(ce(T,w,y,m,5),L),N=Math.max(y,l.width),q=m+l.height+B,J=F.rectangle(-N/2,-q/2,N,q,{...L,fill:"transparent",stroke:"none"}),W=c.insert(()=>R,":first-child").attr("class","icon-shape2"),z=c.insert(()=>J);if(t.icon){const V=c.append("g");V.html(`<g>${await fi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const I=V.node().getBBox(),P=I.width,Y=I.height,lt=I.x,at=I.y;V.attr("transform",`translate(${-P/2-lt},${f?l.height/2+B/2-Y/2-at:-l.height/2-B/2-Y/2-at})`),V.attr("style",`color: ${b.get("stroke")??x};`)}return u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${f?-q/2:q/2-l.height})`),W.attr("transform",`translate(0,${f?l.height/2+B/2:-l.height/2-B/2})`),ot(t,z),t.intersect=function(V){if(M.info("iconSquare intersect",t,V),!t.label)return tt.rect(t,V);const I=t.x??0,P=t.y??0,Y=t.height??0;let lt=[];return f?lt=[{x:I-l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P+Y/2},{x:I-y/2,y:P+Y/2},{x:I-y/2,y:P-Y/2+l.height+B},{x:I-l.width/2,y:P-Y/2+l.height+B}]:lt=[{x:I-y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2+m},{x:I+l.width/2,y:P-Y/2+m},{x:I+l.width/2/2,y:P+Y/2},{x:I-l.width/2,y:P+Y/2},{x:I-l.width/2,y:P-Y/2+m},{x:I-y/2,y:P-Y/2+m}],tt.polygon(t,lt,V)},c}g(Uc,"iconRounded");async function Gc(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=st(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),h=i?.wrappingWidth;t.width=Math.max(n,h??0);const{shapeSvg:c,bbox:l,halfPadding:d,label:u}=await ct(e,t,"icon-shape default"),f=t.pos==="t",m=n+d*2,y=n+d*2,{nodeBorder:x,mainBkg:C}=r,{stylesMap:b}=Er(t),T=-y/2,w=-m/2,B=t.label?8:0,F=rt.svg(c),L=et(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=b.get("fill");L.stroke=v??C;const R=F.path(ce(T,w,y,m,.1),L),N=Math.max(y,l.width),q=m+l.height+B,J=F.rectangle(-N/2,-q/2,N,q,{...L,fill:"transparent",stroke:"none"}),W=c.insert(()=>R,":first-child"),z=c.insert(()=>J);if(t.icon){const V=c.append("g");V.html(`<g>${await fi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const I=V.node().getBBox(),P=I.width,Y=I.height,lt=I.x,at=I.y;V.attr("transform",`translate(${-P/2-lt},${f?l.height/2+B/2-Y/2-at:-l.height/2-B/2-Y/2-at})`),V.attr("style",`color: ${b.get("stroke")??x};`)}return u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${f?-q/2:q/2-l.height})`),W.attr("transform",`translate(0,${f?l.height/2+B/2:-l.height/2-B/2})`),ot(t,z),t.intersect=function(V){if(M.info("iconSquare intersect",t,V),!t.label)return tt.rect(t,V);const I=t.x??0,P=t.y??0,Y=t.height??0;let lt=[];return f?lt=[{x:I-l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2},{x:I+l.width/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P-Y/2+l.height+B},{x:I+y/2,y:P+Y/2},{x:I-y/2,y:P+Y/2},{x:I-y/2,y:P-Y/2+l.height+B},{x:I-l.width/2,y:P-Y/2+l.height+B}]:lt=[{x:I-y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2},{x:I+y/2,y:P-Y/2+m},{x:I+l.width/2,y:P-Y/2+m},{x:I+l.width/2/2,y:P+Y/2},{x:I-l.width/2,y:P+Y/2},{x:I-l.width/2,y:P-Y/2+m},{x:I-y/2,y:P-Y/2+m}],tt.polygon(t,lt,V)},c}g(Gc,"iconSquare");async function Vc(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=st(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const h=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:h,l=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await ct(e,t,"image-shape default"),m=t.pos==="t",y=-c/2,x=-l/2,C=t.label?8:0,b=rt.svg(d),T=et(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const w=b.rectangle(y,x,c,l,T),B=Math.max(c,u.width),F=l+u.height+C,L=b.rectangle(-B/2,-F/2,B,F,{...T,fill:"none",stroke:"none"}),v=d.insert(()=>w,":first-child"),R=d.insert(()=>L);if(t.img){const N=d.append("image");N.attr("href",t.img),N.attr("width",c),N.attr("height",l),N.attr("preserveAspectRatio","none"),N.attr("transform",`translate(${-c/2},${m?F/2-l:-F/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${m?-l/2-u.height/2-C/2:l/2-u.height/2+C/2})`),v.attr("transform",`translate(0,${m?u.height/2+C/2:-u.height/2-C/2})`),ot(t,R),t.intersect=function(N){if(M.info("iconSquare intersect",t,N),!t.label)return tt.rect(t,N);const q=t.x??0,J=t.y??0,W=t.height??0;let z=[];return m?z=[{x:q-u.width/2,y:J-W/2},{x:q+u.width/2,y:J-W/2},{x:q+u.width/2,y:J-W/2+u.height+C},{x:q+c/2,y:J-W/2+u.height+C},{x:q+c/2,y:J+W/2},{x:q-c/2,y:J+W/2},{x:q-c/2,y:J-W/2+u.height+C},{x:q-u.width/2,y:J-W/2+u.height+C}]:z=[{x:q-c/2,y:J-W/2},{x:q+c/2,y:J-W/2},{x:q+c/2,y:J-W/2+l},{x:q+u.width/2,y:J-W/2+l},{x:q+u.width/2/2,y:J+W/2},{x:q-u.width/2,y:J+W/2},{x:q-u.width/2,y:J-W/2+l},{x:q-c/2,y:J-W/2+l}],tt.polygon(t,z,N)},d}g(Vc,"imageSquare");async function Kc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s*2,t.height??0),l=Math.max(h.width+a*2,(t.width??0)-c),d=[{x:0,y:0},{x:l,y:0},{x:l+3*c/6,y:-c},{x:-3*c/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(Kc,"inv_trapezoid");async function Zc(e,t){const{shapeSvg:r,bbox:i,label:o}=await ct(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ot(t,s),t.intersect=function(h){return tt.rect(t,h)},r}g(Zc,"labelRect");async function Qc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s,t.height??0),l=Math.max(h.width+a,(t.width??0)-c),d=[{x:0,y:0},{x:l+3*c/6,y:0},{x:l,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(Qc,"lean_left");async function Jc(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s,t.height??0),l=Math.max(h.width+a,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:l,y:0},{x:l+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(Jc,"lean_right");function td(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",dt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),h=7,c=[{x:a,y:0},{x:0,y:n+h/2},{x:a-2*h,y:n+h/2},{x:0,y:2*n},{x:a,y:n-h/2},{x:2*h,y:n-h/2}],l=rt.svg(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=Ft(c),f=l.path(u,d),m=o.insert(()=>f,":first-child");return m.attr("class","outer-path"),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(-${a/2},${-n})`),ot(t,m),t.intersect=function(y){return M.info("lightningBolt intersect",t,y),tt.polygon(t,c,y)},o}g(td,"lightningBolt");var Gy=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Vy=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Ky=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),An=10,_n=10;async function ed(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const C=t.width??0;t.width=(t.width??0)-s,t.width<_n&&(t.width=_n);const T=C/2/(2.5+C/50);t.height=(t.height??0)-a-T*3,t.height<An&&(t.height=An)}const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:h.width)+s*2,d=l/2,u=d/(2.5+l/50),f=(t?.height?t?.height:h.height)+u+a*2,m=f*.1;let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),b=Vy(0,0,l,f,d,u,m),T=Ky(0,u,l,f,d,u),w=et(t,{}),B=C.path(b,w),F=C.path(T,w);n.insert(()=>F,":first-child").attr("class","line"),y=n.insert(()=>B,":first-child"),y.attr("class","basic label-container"),x&&y.attr("style",x)}else{const C=Gy(0,0,l,f,d,u,m);y=n.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",Wt(x)).attr("style",i)}return y.attr("label-offset-y",u),y.attr("transform",`translate(${-l/2}, ${-(f/2+u)})`),ot(t,y),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+u-(h.y-(h.top??0))})`),t.intersect=function(C){const b=tt.rect(t,C),T=b.x-(t.x??0);if(d!=0&&(Math.abs(T)<(t.width??0)/2||Math.abs(T)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-u)){let w=u*u*(1-T*T/(d*d));w>0&&(w=Math.sqrt(w)),w=u-w,C.y-(t.y??0)>0&&(w=-w),b.y+=w}return b},n}g(ed,"linedCylinder");async function rd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const w=t.width;t.width=(w??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:h.width)+(s??0)*2,d=(t?.height?t?.height:h.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:m}=t,y=rt.svg(n),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:-l/2-l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:f/2},...ze(-l/2-l/2*.1,f/2,l/2+l/2*.1,f/2,u,.8),{x:l/2+l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:-f/2},{x:-l/2,y:-f/2},{x:-l/2,y:f/2*1.1},{x:-l/2,y:-f/2}],b=y.polygon(C.map(w=>[w.x,w.y]),x),T=n.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-l/2+(t.padding??0)+l/2*.1/2-(h.x-(h.left??0))},${-d/2+(t.padding??0)-u/2-(h.y-(h.top??0))})`),ot(t,T),t.intersect=function(w){return tt.polygon(t,C,w)},n}g(rd,"linedWaveEdgedRect");async function id(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:h,bbox:c,label:l}=await ct(e,t,dt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,u=(t?.height?t?.height:c.height)+a*2+2*n,f=d-2*n,m=u-2*n,y=-f/2,x=-m/2,{cssStyles:C}=t,b=rt.svg(h),T=et(t,{}),w=[{x:y-n,y:x+n},{x:y-n,y:x+m+n},{x:y+f-n,y:x+m+n},{x:y+f-n,y:x+m},{x:y+f,y:x+m},{x:y+f,y:x+m-n},{x:y+f+n,y:x+m-n},{x:y+f+n,y:x-n},{x:y+n,y:x-n},{x:y+n,y:x},{x:y,y:x},{x:y,y:x+n}],B=[{x:y,y:x+n},{x:y+f-n,y:x+n},{x:y+f-n,y:x+m},{x:y+f,y:x+m},{x:y+f,y:x},{x:y,y:x}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const F=Ft(w);let L=b.path(F,T);const v=Ft(B);let R=b.path(v,T);t.look!=="handDrawn"&&(L=Ts(L),R=Ts(R));const N=h.insert("g",":first-child");return N.insert(()=>L),N.insert(()=>R),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ot(t,N),t.intersect=function(q){return tt.polygon(t,w,q)},h}g(id,"multiRect");async function od(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=t.padding??0,h=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let l=!0;(t.width||t.height)&&(l=!1,t.width=(t?.width??0)-h*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+h*2,u=Math.max(s.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,m=u+(l?f/2:-f/2),y=-d/2,x=-m/2,C=10,{cssStyles:b}=t,T=ze(y-C,x+m+C,y+d-C,x+m+C,f,.8),w=T?.[T.length-1],B=[{x:y-C,y:x+C},{x:y-C,y:x+m+C},...T,{x:y+d-C,y:w.y-C},{x:y+d,y:w.y-C},{x:y+d,y:w.y-2*C},{x:y+d+C,y:w.y-2*C},{x:y+d+C,y:x-C},{x:y+C,y:x-C},{x:y+C,y:x},{x:y,y:x},{x:y,y:x+C}],F=[{x:y,y:x+C},{x:y+d-C,y:x+C},{x:y+d-C,y:w.y-C},{x:y+d,y:w.y-C},{x:y+d,y:x},{x:y,y:x}],L=rt.svg(o),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const R=Ft(B),N=L.path(R,v),q=Ft(F),J=L.path(q,v),W=o.insert(()=>N,":first-child");return W.insert(()=>J),W.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",i),W.attr("transform",`translate(0,${-f/2})`),a.attr("transform",`translate(${-(s.width/2)-C-(s.x-(s.left??0))}, ${-(s.height/2)+C-f/2-(s.y-(s.top??0))})`),ot(t,W),t.intersect=function(z){return tt.polygon(t,B,z)},o}g(od,"multiWaveEdgedRectangle");async function sd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i,t.useHtmlLabels||Kt(Dt())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-l/2,{cssStyles:f}=t,m=rt.svg(a),y=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=m.rectangle(d,u,c,l,y),C=a.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,C),t.intersect=function(b){return tt.rect(t,b)},a}g(sd,"note");var Zy=g((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function ad(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ct(e,t,dt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),h=a+n,c=.5,l=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(o),m=et(t,{}),y=Zy(0,0,h),x=f.path(y,m);d=o.insert(()=>x,":first-child").attr("transform",`translate(${-h/2+c}, ${h/2})`),u&&d.attr("style",u)}else d=Le(o,h,h,l),d.attr("transform",`translate(${-h/2+c}, ${h/2})`);return i&&d.attr("style",i),ot(t,d),t.calcIntersect=function(f,m){const y=f.width,x=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],C=tt.polygon(f,x,m);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},o}g(ad,"question");async function nd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=h.width+(t.look==="neo"?s*2:s),d=Math.max(h.height+(t.look==="neo"?a*2:a),t.height??0),u=d/4,m=-Math.max(l,(t.width??0)-u)/2,y=-d/2,x=y/2,C=[{x:m+x,y},{x:m,y:0},{x:m+x,y:-y},{x:-m,y:-y},{x:-m,y}],{cssStyles:b}=t,T=rt.svg(n),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const B=Ft(C),F=T.path(B,w),L=n.insert(()=>F,":first-child");return L.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${-x/2},0)`),c.attr("transform",`translate(${-x/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),ot(t,L),t.intersect=function(v){return tt.polygon(t,C,v)},n}g(nd,"rect_left_inv_arrow");async function ld(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),h=t.description,c=t.label,l=await Re(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(Kt(Bt())){const v=l.children[0],R=yt(l);d=v.getBoundingClientRect(),R.attr("width",d.width),R.attr("height",d.height)}M.info("Text 2",h);const u=h||[],f=l.getBBox(),m=await Re(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),y=m.children[0],x=yt(m);d=y.getBoundingClientRect(),x.attr("width",d.width),x.attr("height",d.height);const C=(t.padding||0)/2;yt(m).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+C+5)+")"),yt(l).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-C+3)+")");const b=d.width+(t.padding||0),T=d.height+(t.padding||0),w=-d.width/2-C,B=-d.height/2-C;let F,L;if(t.look==="handDrawn"){const v=rt.svg(s),R=et(t,{}),N=v.path(ce(w,B,b,T,t.rx||0),R),q=v.line(-d.width/2-C,-d.height/2-C+f.height+C,d.width/2+C,-d.height/2-C+f.height+C,R);L=s.insert(()=>(M.debug("Rough node insert CXC",N),q),":first-child"),F=s.insert(()=>(M.debug("Rough node insert CXC",N),N),":first-child")}else F=a.insert("rect",":first-child"),L=a.insert("line"),F.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-C).attr("y",-d.height/2-C).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),L.attr("class","divider").attr("x1",-d.width/2-C).attr("x2",d.width/2+C).attr("y1",-d.height/2-C+f.height+C).attr("y2",-d.height/2-C+f.height+C);return ot(t,F),t.intersect=function(v){return tt.rect(t,v)},s}g(ld,"rectWithTitle");async function hd(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Ar(e,t,o)}g(hd,"roundedRect");var je=8;async function cd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?je:je*2),l=(t?.height??n.height)+s*2,d=c-je,u=l,f=je-c/2,m=-l/2,{cssStyles:y}=t,x=rt.svg(a),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const b=[{x:f,y:m},{x:f+d,y:m},{x:f+d,y:m+u},{x:f-je,y:m+u},{x:f-je,y:m},{x:f,y:m},{x:f,y:m+u}],T=x.polygon(b.map(B=>[B.x,B.y]),C),w=a.insert(()=>T,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Wt(y)),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),y&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),h.attr("transform",`translate(${je/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,w),t.intersect=function(B){return tt.rect(t,B)},a}g(cd,"shadedProcess");async function dd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=(t?.width?t?.width:h.width)+s*2,d=((t?.height?t?.height:h.height)+a*2)*1.5,u=l,f=d/1.5,m=-u/2,y=-f/2,{cssStyles:x}=t,C=rt.svg(n),b=et(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=[{x:m,y},{x:m,y:y+f},{x:m+u,y:y+f},{x:m+u,y:y-f/2}],w=Ft(T),B=C.path(w,b),F=n.insert(()=>B,":first-child");return F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectChildren("path").attr("style",x),i&&t.look!=="handDrawn"&&F.selectChildren("path").attr("style",i),F.attr("transform",`translate(0, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(h.x-(h.left??0))}, ${-f/4+(t.padding??0)-(h.y-(h.top??0))})`),ot(t,F),t.intersect=function(L){return tt.polygon(t,T,L)},n}g(dd,"slopedRect");async function ud(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return Ar(e,t,s)}g(ud,"squareRect");async function gd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=h.height+(t.look==="neo"?a*2:a),l=h.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:u}=t,f=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-l/2+d,y:-c/2},{x:l/2-d,y:-c/2},...Te(-l/2+d,0,d,50,90,270),{x:l/2-d,y:c/2},...Te(l/2-d,0,d,50,270,450)],x=Ft(y),C=f.path(x,m),b=n.insert(()=>C,":first-child");return b.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),ot(t,b),t.intersect=function(T){return tt.polygon(t,y,T)},n}g(gd,"stadium");async function pd(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Ar(e,t,r)}g(pd,"state");function fd(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:h,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const l=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(l),u=et(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),m=n??h,y=(t.width??0)*5/14,x=d.circle(0,0,y,{...u,fill:m,stroke:m,strokeWidth:2,fillStyle:"solid"}),C=l.insert(()=>f,":first-child");if(C.insert(()=>x),t.look!=="handDrawn"&&C.attr("class","outer-path"),s&&C.selectAll("path").attr("style",s),o&&C.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const b=e.node()?.ownerSVGElement?.id??"",T=b?`${b}-drop-shadow-small`:"drop-shadow-small";C.attr("style",`filter:url(#${T})`)}return ot(t,C),t.intersect=function(b){return tt.circle(t,(t.width??0)/2,b)},l}g(fd,"stateEnd");function md(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const h=rt.svg(s).circle(0,0,t.width,Zf(i));a=s.insert(()=>h),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",h=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${h})`)}return ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}g(md,"stateStart");var mr=8;async function yd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.width+2*mr+s,t.width??0),l=Math.max(h.height+a,t.height??0),d=c-2*mr,u=l,f=-c/2,m=-l/2,y=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const x=rt.svg(n),C=et(t,{}),b=x.rectangle(f,m,d+16,u,C),T=x.line(f+mr,m,f+mr,m+u,C),w=x.line(f+mr+d,m,f+mr+d,m+u,C);n.insert(()=>T,":first-child"),n.insert(()=>w,":first-child");const B=n.insert(()=>b,":first-child"),{cssStyles:F}=t;B.attr("class","basic label-container").attr("style",Wt(F)),ot(t,B)}else{const x=Le(n,d,u,y);i&&x.attr("style",i),ot(t,x)}return t.intersect=function(x){return tt.polygon(t,y,x)},n}g(yd,"subroutine");var Fo=.2;async function Cd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-Fo*(t.height+a*2),10));const{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.height?t?.height:h.height)+a*2,l=Fo*c,d=Fo*c,f=(t?.width?t?.width:h.width)+s*2+l-l,m=c,y=-f/2,x=-m/2,{cssStyles:C}=t,b=rt.svg(n),T=et(t,{}),w=[{x:y-l/2,y:x},{x:y+f+l/2,y:x},{x:y+f+l/2,y:x+m},{x:y-l/2,y:x+m}],B=[{x:y+f-l/2,y:x+m},{x:y+f+l/2,y:x+m},{x:y+f+l/2,y:x+m-d}];t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const F=Ft(w),L=b.path(F,T),v=Ft(B),R=b.path(v,{...T,fillStyle:"solid"}),N=n.insert(()=>R,":first-child");return N.insert(()=>L,":first-child"),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),ot(t,N),t.intersect=function(q){return tt.polygon(t,w,q)},n}g(Cd,"taggedRect");async function xd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ct(e,t,dt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),h=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=h/8,l=.2*n,d=.2*h,u=h+c,{cssStyles:f}=t,m=rt.svg(o),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-n/2-n/2*.1,y:u/2},...ze(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],C=-n/2+n/2*.1,b=-u/2-d*.4,T=[{x:C+n-l,y:(b+h)*1.3},{x:C+n,y:b+h-d},{x:C+n,y:(b+h)*.9},...ze(C+n,(b+h)*1.25,C+n-l,(b+h)*1.3,-h*.02,.5)],w=Ft(x),B=m.path(w,y),F=Ft(T),L=m.path(F,{...y,fillStyle:"solid"}),v=o.insert(()=>L,":first-child");return v.insert(()=>B,":first-child"),v.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-h/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),ot(t,v),t.intersect=function(R){return tt.polygon(t,x,R)},o}g(xd,"taggedWaveEdgedRectangle");async function bd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ct(e,t,dt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),h=-a/2,c=-n/2,l=o.insert("rect",":first-child");return l.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",h).attr("y",c).attr("width",a).attr("height",n),ot(t,l),t.intersect=function(d){return tt.rect(t,d)},o}g(bd,"text");var Qy=g((e,t,r,i,o,s)=>`M${e},${t}
207
202
  a${o},${s} 0,0,1 0,${-i}
208
203
  l${r},0
209
204
  a${o},${s} 0,0,1 0,${i}
210
205
  M${r},${-i}
211
206
  a${o},${s} 0,0,0 0,${i}
212
- l${-r},0`,"createCylinderPathD"),rC=g((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),iC=g((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),On=5,$n=10;async function Td(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2,a=t.height??0;if(t.height&&(t.height=t.height-s,t.height<On&&(t.height=On)),t.width){const C=a/2/(2.5+a/50);t.width=t.width-s-C*3,t.width<$n&&(t.width=$n)}const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=Math.max(t.height??0,h.height)+s,d=l/2,u=d/(2.5+l/50),f=Math.max(t.width??0,h.width)+u+s,{cssStyles:m}=t;let y;if(t.look==="handDrawn"){const x=rt.svg(n),C=rC(0,0,f,l,u,d),b=iC(0,0,f,l,u,d),T=x.path(C,et(t,{})),w=x.path(b,et(t,{fill:"none"}));y=n.insert(()=>w,":first-child"),y=n.insert(()=>T,":first-child"),y.attr("class","basic label-container"),m&&y.attr("style",m)}else{const x=eC(0,0,f,l,u,d);y=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",Wt(m)).attr("style",i),y.attr("class","basic label-container outer-path"),m&&y.selectAll("path").attr("style",m),i&&y.selectAll("path").attr("style",i)}return y.attr("label-offset-x",u),y.attr("transform",`translate(${-f/2}, ${l/2} )`),c.attr("transform",`translate(${-(h.width/2)-u-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),ot(t,y),t.intersect=function(x){const C=tt.rect(t,x),b=C.y-(t.y??0);if(d!=0&&(Math.abs(b)<(t.height??0)/2||Math.abs(b)==(t.height??0)/2&&Math.abs(C.x-(t.x??0))>(t.width??0)/2-u)){let T=u*u*(1-b*b/(d*d));T!=0&&(T=Math.sqrt(Math.abs(T))),T=u-T,x.x-(t.x??0)>0&&(T=-T),C.x+=T}return C},n}g(Td,"tiltedCylinder");async function wd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s,t.height??0),l=Math.max(h.width+a,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:l+3*c/6,y:0},{x:l,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(wd,"trapezoid");async function Bd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,h=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<h&&(t.height=h),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:l}=await ct(e,t,dt(t)),d=(t?.width?t?.width:l.width)+s*2,u=(t?.height?t?.height:l.height)+a*2,{cssStyles:f}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-d/2*.8,y:-u/2},{x:d/2*.8,y:-u/2},{x:d/2,y:-u/2*.6},{x:d/2,y:u/2},{x:-d/2,y:u/2},{x:-d/2,y:-u/2*.6}],C=Ft(x),b=m.path(C,y),T=c.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ot(t,T),t.intersect=function(w){return tt.polygon(t,x,w)},c}g(Bd,"trapezoidalPentagon");var Dn=10,Pn=10;async function vd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<Pn&&(t.width=Pn),t.height=t?.height??0,t.height<Dn&&(t.height=Dn));const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=ve(Bt().flowchart?.htmlLabels),l=(t?.width?t?.width:n.width)+s,d=t?.height?t?.height:l+n.height,u=d,f=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-d}],{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Ft(f),b=y.path(C,x),T=a.insert(()=>b,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),t.width=l,t.height=d,ot(t,T),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(w){return M.info("Triangle intersect",t,f,w),tt.polygon(t,f,w)},a}g(vd,"triangle");async function Ld(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:h,bbox:c,label:l}=await ct(e,t,dt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,u=(t?.height?t?.height:c.height)+(a??0)*2,f=t.look==="neo"?u/4:u/8,m=u+(n?f:-f),{cssStyles:y}=t,C=14-d,b=C>0?C/2:0,T=rt.svg(h),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const B=[{x:-d/2-b,y:m/2},...ze(-d/2-b,m/2,d/2+b,m/2,f,.8),{x:d/2+b,y:-m/2},{x:-d/2-b,y:-m/2}],F=Ft(B),L=T.path(F,w),v=h.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-f/2})`),l.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-u/2+(t.padding??0)-f-(c.y-(c.top??0))})`),ot(t,v),t.intersect=function(R){return tt.polygon(t,B,R)},h}g(Ld,"waveEdgedRectangle");async function Fd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-w*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width:h.width)+s*2,l=(t?.height?t?.height:h.height)+a,d=l/8,u=l+d*2,{cssStyles:f}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-c/2,y:u/2},...ze(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...ze(c/2,-u/2,-c/2,-u/2,d,-1)],C=Ft(x),b=m.path(C,y),T=n.insert(()=>b,":first-child");return T.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),ot(t,T),t.intersect=function(w){return tt.polygon(t,x,w)},n}g(Fd,"waveRectangle");var Pt=10;async function Ed(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Pt,10),t.height=Math.max((t?.height??0)-s*2-Pt,10));const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width:n.width)+o*2+Pt,l=(t?.height?t?.height:n.height)+s*2+Pt,d=c-Pt,u=l-Pt,f=-d/2,m=-u/2,{cssStyles:y}=t,x=rt.svg(a),C=et(t,{}),b=[{x:f-Pt,y:m-Pt},{x:f-Pt,y:m+u},{x:f+d,y:m+u},{x:f+d,y:m-Pt}],T=`M${f-Pt},${m-Pt} L${f+d},${m-Pt} L${f+d},${m+u} L${f-Pt},${m+u} L${f-Pt},${m-Pt}
207
+ l${-r},0`,"createCylinderPathD"),Jy=g((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),tC=g((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Mn=5,In=10;async function kd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2,a=t.height??0;if(t.height&&(t.height=t.height-s,t.height<Mn&&(t.height=Mn)),t.width){const C=a/2/(2.5+a/50);t.width=t.width-s-C*3,t.width<In&&(t.width=In)}const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=Math.max(t.height??0,h.height)+s,d=l/2,u=d/(2.5+l/50),f=Math.max(t.width??0,h.width)+u+s,{cssStyles:m}=t;let y;if(t.look==="handDrawn"){const x=rt.svg(n),C=Jy(0,0,f,l,u,d),b=tC(0,0,f,l,u,d),T=x.path(C,et(t,{})),w=x.path(b,et(t,{fill:"none"}));y=n.insert(()=>w,":first-child"),y=n.insert(()=>T,":first-child"),y.attr("class","basic label-container"),m&&y.attr("style",m)}else{const x=Qy(0,0,f,l,u,d);y=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",Wt(m)).attr("style",i),y.attr("class","basic label-container outer-path"),m&&y.selectAll("path").attr("style",m),i&&y.selectAll("path").attr("style",i)}return y.attr("label-offset-x",u),y.attr("transform",`translate(${-f/2}, ${l/2} )`),c.attr("transform",`translate(${-(h.width/2)-u-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),ot(t,y),t.intersect=function(x){const C=tt.rect(t,x),b=C.y-(t.y??0);if(d!=0&&(Math.abs(b)<(t.height??0)/2||Math.abs(b)==(t.height??0)/2&&Math.abs(C.x-(t.x??0))>(t.width??0)/2-u)){let T=u*u*(1-b*b/(d*d));T!=0&&(T=Math.sqrt(Math.abs(T))),T=u-T,x.x-(t.x??0)>0&&(T=-T),C.x+=T}return C},n}g(kd,"tiltedCylinder");async function Sd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=Math.max(h.height+s,t.height??0),l=Math.max(h.width+a,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:l+3*c/6,y:0},{x:l,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=rt.svg(n),y=et(t,{}),x=Ft(d),C=m.path(x,y);u=n.insert(()=>C,":first-child").attr("transform",`translate(${-l/2}, ${c/2})`),f&&u.attr("style",f)}else u=Le(n,l,c,d);return i&&u.attr("style",i),t.width=l,t.height=c,ot(t,u),t.intersect=function(m){return tt.polygon(t,d,m)},n}g(Sd,"trapezoid");async function Td(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,h=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<h&&(t.height=h),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:l}=await ct(e,t,dt(t)),d=(t?.width?t?.width:l.width)+s*2,u=(t?.height?t?.height:l.height)+a*2,{cssStyles:f}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-d/2*.8,y:-u/2},{x:d/2*.8,y:-u/2},{x:d/2,y:-u/2*.6},{x:d/2,y:u/2},{x:-d/2,y:u/2},{x:-d/2,y:-u/2*.6}],C=Ft(x),b=m.path(C,y),T=c.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ot(t,T),t.intersect=function(w){return tt.polygon(t,x,w)},c}g(Td,"trapezoidalPentagon");var On=10,$n=10;async function wd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<$n&&(t.width=$n),t.height=t?.height??0,t.height<On&&(t.height=On));const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=ve(Bt().flowchart?.htmlLabels),l=(t?.width?t?.width:n.width)+s,d=t?.height?t?.height:l+n.height,u=d,f=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-d}],{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Ft(f),b=y.path(C,x),T=a.insert(()=>b,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),t.width=l,t.height=d,ot(t,T),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(w){return M.info("Triangle intersect",t,f,w),tt.polygon(t,f,w)},a}g(wd,"triangle");async function Bd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:h,bbox:c,label:l}=await ct(e,t,dt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,u=(t?.height?t?.height:c.height)+(a??0)*2,f=t.look==="neo"?u/4:u/8,m=u+(n?f:-f),{cssStyles:y}=t,C=14-d,b=C>0?C/2:0,T=rt.svg(h),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const B=[{x:-d/2-b,y:m/2},...ze(-d/2-b,m/2,d/2+b,m/2,f,.8),{x:d/2+b,y:-m/2},{x:-d/2-b,y:-m/2}],F=Ft(B),L=T.path(F,w),v=h.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-f/2})`),l.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-u/2+(t.padding??0)-f-(c.y-(c.top??0))})`),ot(t,v),t.intersect=function(R){return tt.polygon(t,B,R)},h}g(Bd,"waveEdgedRectangle");async function vd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-w*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width:h.width)+s*2,l=(t?.height?t?.height:h.height)+a,d=l/8,u=l+d*2,{cssStyles:f}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-c/2,y:u/2},...ze(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...ze(c/2,-u/2,-c/2,-u/2,d,-1)],C=Ft(x),b=m.path(C,y),T=n.insert(()=>b,":first-child");return T.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),ot(t,T),t.intersect=function(w){return tt.polygon(t,x,w)},n}g(vd,"waveRectangle");var Pt=10;async function Ld(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Pt,10),t.height=Math.max((t?.height??0)-s*2-Pt,10));const{shapeSvg:a,bbox:n,label:h}=await ct(e,t,dt(t)),c=(t?.width?t?.width:n.width)+o*2+Pt,l=(t?.height?t?.height:n.height)+s*2+Pt,d=c-Pt,u=l-Pt,f=-d/2,m=-u/2,{cssStyles:y}=t,x=rt.svg(a),C=et(t,{}),b=[{x:f-Pt,y:m-Pt},{x:f-Pt,y:m+u},{x:f+d,y:m+u},{x:f+d,y:m-Pt}],T=`M${f-Pt},${m-Pt} L${f+d},${m-Pt} L${f+d},${m+u} L${f-Pt},${m+u} L${f-Pt},${m-Pt}
213
208
  M${f-Pt},${m} L${f+d},${m}
214
- M${f},${m-Pt} L${f},${m+u}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=x.path(T,C),B=a.insert(()=>w,":first-child");return B.attr("transform",`translate(${Pt/2}, ${Pt/2})`),B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(n.width/2)+Pt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Pt/2-(n.y-(n.top??0))})`),ot(t,B),t.intersect=function(F){return tt.polygon(t,b,F)},a}g(Ed,"windowPane");var Rn=new Set(["redux-color","redux-dark-color"]),oC=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function ya(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Dt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:h}=o;if(t.look==="handDrawn"){const{themeVariables:ht}=Dt(),{background:kt}=ht,Mt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${kt}`]};await ya(e,Mt)}const c=Dt();t.useHtmlLabels=c.htmlLabels;let l=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:m}=st(t);if(r.attributes.length===0&&t.label){const ht={rx:0,ry:0,labelPaddingX:l,labelPaddingY:l*1.5};Ie(t.label,c)+ht.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const kt=await Ar(e,t,ht);if(i!=null&&Rn.has(i)){const Mt=r.colorIndex??0;kt.attr("data-color-id",`color-${Mt%h.length}`)}if(!ve(c.htmlLabels)){const Mt=kt.select("text"),wt=Mt.node()?.getBBox();Mt.attr("transform",`translate(${-wt.width/2}, 0)`)}return kt}c.htmlLabels||(l*=1.25,d*=1.25);let y=dt(t);y||(y="node default");const x=e.insert("g").attr("class",y).attr("id",t.domId||t.id),C=await Cr(x,t.label??"",c,0,0,["name"],f);C.height+=d;let b=0;const T=[],w=[];let B=0,F=0,L=0,v=0,R=!0,N=!0;for(const ht of r.attributes){const kt=await Cr(x,ht.type,c,0,b,["attribute-type"],f);B=Math.max(B,kt.width+l);const Mt=await Cr(x,ht.name,c,0,b,["attribute-name"],f);F=Math.max(F,Mt.width+l);const wt=await Cr(x,ht.keys.join(),c,0,b,["attribute-keys"],f);L=Math.max(L,wt.width+l);const Xt=await Cr(x,ht.comment,c,0,b,["attribute-comment"],f);v=Math.max(v,Xt.width+l);const qt=Math.max(kt.height,Mt.height,wt.height,Xt.height)+d;w.push({yOffset:b,rowHeight:qt}),b+=qt}let q=4;L<=l&&(R=!1,L=0,q--),v<=l&&(N=!1,v=0,q--);const J=x.node().getBBox();if(C.width+l*2-(B+F+L+v)>0){const ht=C.width+l*2-(B+F+L+v);B+=ht/q,F+=ht/q,L>0&&(L+=ht/q),v>0&&(v+=ht/q)}const W=B+F+L+v,z=rt.svg(x),V=et(t,{});t.look!=="handDrawn"&&(V.roughness=0,V.fillStyle="solid");let I=0;w.length>0&&(I=w.reduce((ht,kt)=>ht+(kt?.rowHeight??0),0));const P=Math.max(J.width+l*2,t?.width||0,W),Y=Math.max((I??0)+C.height,t?.height||0),lt=-P/2,at=-Y/2;if(x.selectAll("g:not(:first-child)").each((ht,kt,Mt)=>{const wt=yt(Mt[kt]),Xt=wt.attr("transform");let qt=0,Fe=0;if(Xt){const ye=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Xt);ye&&(qt=parseFloat(ye[1]),Fe=parseFloat(ye[2]),wt.attr("class").includes("attribute-name")?qt+=B:wt.attr("class").includes("attribute-keys")?qt+=B+F:wt.attr("class").includes("attribute-comment")&&(qt+=B+F+L))}wt.attr("transform",`translate(${lt+l/2+qt}, ${Fe+at+C.height+d/2})`)}),x.select(".name").attr("transform","translate("+-C.width/2+", "+(at+d/2)+")"),i!=null&&Rn.has(i)){const ht=r.colorIndex??0;x.attr("data-color-id",`color-${ht%h.length}`)}const Ct=z.rectangle(lt,at,P,Y,V),Et=x.insert(()=>Ct,":first-child").attr("class","outer-path").attr("style",u.join(""));T.push(0);for(const[ht,kt]of w.entries()){const wt=(ht+1)%2===0&&kt.yOffset!==0,Xt=z.rectangle(lt,C.height+at+kt?.yOffset,P,kt?.rowHeight,{...V,fill:wt?s:a,stroke:n});x.insert(()=>Xt,"g.label").attr("style",u.join("")).attr("class",`row-rect-${wt?"even":"odd"}`)}const mt=1e-4;let Tt=xr(lt,C.height+at,P+lt,C.height+at,mt),xt=z.polygon(Tt.map(ht=>[ht.x,ht.y]),V);if(x.insert(()=>xt).attr("class","divider"),Tt=xr(B+lt,C.height+at,B+lt,Y+at,mt),xt=z.polygon(Tt.map(ht=>[ht.x,ht.y]),V),x.insert(()=>xt).attr("class","divider"),R){const ht=B+F+lt;Tt=xr(ht,C.height+at,ht,Y+at,mt),xt=z.polygon(Tt.map(kt=>[kt.x,kt.y]),V),x.insert(()=>xt).attr("class","divider")}if(N){const ht=B+F+L+lt;Tt=xr(ht,C.height+at,ht,Y+at,mt),xt=z.polygon(Tt.map(kt=>[kt.x,kt.y]),V),x.insert(()=>xt).attr("class","divider")}for(const ht of T){const kt=C.height+at+ht;Tt=xr(lt,kt,P+lt,kt,mt),xt=z.polygon(Tt.map(Mt=>[Mt.x,Mt.y]),V),x.insert(()=>xt).attr("class","divider")}if(ot(t,Et),m&&t.look!=="handDrawn")if(i!=null&&oC.has(i))x.selectAll("path").attr("style",m);else{const kt=m.split(";")?.filter(Mt=>Mt.includes("stroke"))?.map(Mt=>`${Mt}`).join("; ");x.selectAll("path").attr("style",kt??""),x.selectAll(".row-rect-even path").attr("style",m)}return t.intersect=function(ht){return tt.rect(t,ht)},x}g(ya,"erBox");async function Cr(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==en(t)&&(t=en(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const h=n.node().appendChild(await me(n,t,{width:Ie(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let l=h.children[0];for(l.textContent=l.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");l.childNodes[0];)l=l.childNodes[0],l.textContent=l.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=h.getBBox();if(ve(r.htmlLabels)){const l=h.children[0];l.style.textAlign="start";const d=yt(h);c=l.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(Cr,"addText");function xr(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}g(xr,"lineToPolygon");async function Ad(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",dt(t)).attr("id",t.domId||t.id);let n=null,h=null,c=null,l=null,d=0,u=0,f=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await Zr(n,{text:`«${b}»`},0),d=n.node().getBBox().height}h=a.insert("g").attr("class","label-group text"),await Zr(h,t,0,["font-weight: bolder"]);const m=h.node().getBBox();u=m.height,c=a.insert("g").attr("class","members-group text");let y=0;for(const b of t.members){const T=await Zr(c,b,y,[b.parseClassifier()]);y+=T+s}f=c.node().getBBox().height,f<=0&&(f=o/2),l=a.insert("g").attr("class","methods-group text");let x=0;for(const b of t.methods){const T=await Zr(l,b,x,[b.parseClassifier()]);x+=T+s}let C=a.node().getBBox();if(n!==null){const b=n.node().getBBox();n.attr("transform",`translate(${-b.width/2})`)}return h.attr("transform",`translate(${-m.width/2}, ${d})`),C=a.node().getBBox(),c.attr("transform",`translate(0, ${d+u+o*2})`),C=a.node().getBBox(),l.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}g(Ad,"textHelper");async function Zr(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Dt();let a="useHtmlLabels"in t?t.useHtmlLabels:ve(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),ni(n)&&(a=!0);const h=await me(o,Gs(Ne(n)),{width:Ie(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,l=1;if(a){const d=h.children[0],u=yt(h);l=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(l+=d.innerHTML.split("<mrow>").length-1),await ga(d),c=d.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(h).selectAll("tspan").attr("font-weight",""),l=h.children.length;const d=h.children[0];(h.textContent===""||h.textContent.includes("&gt"))&&(d.textContent=n[0]+n.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=h.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*l)+r)+")"),c.height}g(Zr,"addText");async function _d(e,t){const r=Bt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??ve(r.htmlLabels)??!0,h=t;h.annotations=h.annotations??[],h.members=h.members??[],h.methods=h.methods??[];const{shapeSvg:c,bbox:l}=await Ad(e,t,r,n,a),{labelStyles:d,nodeStyles:u}=st(t);t.labelStyle=d,t.cssStyles=h.styles||"";const f=h.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=f.replaceAll("!important","").split(";"));const m=h.members.length===0&&h.methods.length===0&&!r.class?.hideEmptyMembersBox,y=rt.svg(c),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Math.max(t.width??0,l.width);let b=Math.max(t.height??0,l.height);const T=(t.height??0)>l.height;h.members.length===0&&h.methods.length===0?b+=a:h.members.length>0&&h.methods.length===0&&(b+=a*2);const w=-C/2,B=-b/2;let F=m?s*2:h.members.length===0&&h.methods.length===0?-s:0;T&&(F=s*2);const L=y.rectangle(w-s,B-s-(m?s:h.members.length===0&&h.methods.length===0?-s/2:0),C+2*s,b+2*s+F,x),v=c.insert(()=>L,":first-child");v.attr("class","basic label-container outer-path");const R=v.node().getBBox(),N=c.select(".annotation-group").node().getBBox().height-(m?s/2:0)||0,q=c.select(".label-group").node().getBBox().height-(m?s/2:0)||0,J=c.select(".members-group").node().getBBox().height-(m?s/2:0)||0,W=(N+q+B+s-(B-s-(m?s:h.members.length===0&&h.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((z,V,I)=>{const P=yt(I[V]),Y=P.attr("transform");let lt=0;if(Y){const mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);mt&&(lt=parseFloat(mt[2]))}let at=lt+B+s-(m?s:h.members.length===0&&h.methods.length===0?-s/2:0);if(P.attr("class").includes("methods-group")){const Et=Math.max(J,a/2);T?at=Math.max(W,N+q+Et+B+a*2+s)+a*2:at=N+q+Et+B+a*4+s}h.members.length===0&&h.methods.length===0&&r.class?.hideEmptyMembersBox&&(h.annotations.length>0?at=lt-a:at=lt),n||(at-=4);let Ct=w;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(Ct=-P.node()?.getBBox().width/2||0,c.selectAll("text").each(function(Et,mt,Tt){window.getComputedStyle(Tt[mt]).textAnchor==="middle"&&(Ct=0)})),P.attr("transform",`translate(${Ct}, ${at})`)}),h.members.length>0||h.methods.length>0||m){const z=N+q+B+s,V=y.line(R.x,z,R.x+R.width,z+.001,x);c.insert(()=>V).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(m||h.members.length>0||h.methods.length>0){const z=N+q+J+B+a*2+s,V=y.line(R.x,T?Math.max(W,z):z,R.x+R.width,(T?Math.max(W,z):z)+.001,x);c.insert(()=>V).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(h.look!=="handDrawn"&&c.selectAll("path").attr("style",f),v.select(":nth-child(2)").attr("style",f),c.selectAll(".divider").select("path").attr("style",f),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",f),!n){const z=RegExp(/color\s*:\s*([^;]*)/),V=z.exec(f);if(V){const I=V[0].replace("color","fill");c.selectAll("tspan").attr("style",I)}else if(d){const I=z.exec(d);if(I){const P=I[0].replace("color","fill");c.selectAll("tspan").attr("style",P)}}}return ot(t,v),t.intersect=function(z){return tt.rect(t,z)},c}g(_d,"classBox");async function Md(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,h="verifyMethod"in t,c=dt(t),l=Bt(),{themeVariables:d}=l,{borderColorArray:u,requirementEdgeLabelBackground:f}=d,m=l.layout==="elk"?"start":"center",y=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let x;h?x=await be(y,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):x=await be(y,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let C=x;const b=await be(y,o.name,C,t.labelStyle+"; font-weight: bold;");if(C+=b+n,h){const q=await be(y,`${o.requirementId?`ID: ${o.requirementId}`:""}`,C,t.labelStyle,m);C+=q;const J=await be(y,`${o.text?`Text: ${o.text}`:""}`,C,t.labelStyle,m);C+=J;const W=await be(y,`${o.risk?`Risk: ${o.risk}`:""}`,C,t.labelStyle,m);C+=W,await be(y,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,C,t.labelStyle,m)}else{const q=await be(y,`${s.type?`Type: ${s.type}`:""}`,C,t.labelStyle,m);C+=q,await be(y,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,C,t.labelStyle,m)}const T=(y.node()?.getBBox().width??200)+a,w=(y.node()?.getBBox().height??200)+a,B=-T/2,F=-w/2,L=rt.svg(y),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const R=L.rectangle(B,F,T,w,v),N=y.insert(()=>R,":first-child");if(N.attr("class","basic label-container outer-path").attr("style",i),u?.length){const q=t.colorIndex??0;y.attr("data-color-id",`color-${q%u.length}`)}if(y.selectAll(".label").each((q,J,W)=>{const z=yt(W[J]),V=z.attr("transform");let I=0,P=0;if(V){const Ct=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(V);Ct&&(I=parseFloat(Ct[1]),P=parseFloat(Ct[2]))}const Y=P-w/2;let lt=B+a/2;(J===0||J===1)&&(lt=I),z.attr("transform",`translate(${lt}, ${Y+a})`)}),C>x+b+n){const q=F+x+b+n;let J;if(t.look==="neo"){const V=[[B,q],[B+T,q],[B+T,q+.001],[B,q+.001]];J=L.polygon(V,v)}else J=L.line(B,q,B+T,q,v);y.insert(()=>J).attr("class","divider")}return ot(t,N),t.intersect=function(q){return tt.rect(t,q)},i&&t.look!=="handDrawn"&&(f||u?.length)&&y.selectAll("path").attr("style",i),y}g(Md,"requirementBox");async function be(e,t,r,i="",o="center"){if(t==="")return 0;const s=e.insert("g").attr("class","label").attr("style",i),a=Bt(),n=a.htmlLabels??!0,h=await me(s,Gs(Ne(t)),{width:Ie(t,a)+50,classes:"markdown-node-label",useHtmlLabels:n,style:i},a);let c;if(n){const l=h.children[0],d=yt(h);o==="start"&&yt(l).style("text-align","left"),c=l.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}else{const l=h.children[0];for(const d of l.children)i&&d.setAttribute("style",i);if(o==="start"){l.setAttribute("text-anchor","start");for(const d of l.children)d.setAttribute("text-anchor","start")}c=h.getBBox(),c.height+=6}return s.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}g(be,"addText");var sC=g(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Id(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let m,y;u?{label:m,bbox:y}=await Lo(u,"ticket"in t&&t.ticket||"",f):{label:m,bbox:y}=await Lo(n,"ticket"in t&&t.ticket||"",f);const{label:x,bbox:C}=await Lo(n,"assigned"in t&&t.assigned||"",f);t.width=a;const b=10,T=t?.width||0,w=Math.max(y.height,C.height)/2,B=Math.max(h.height+b*2,t?.height||0)+w,F=-T/2,L=-B/2;c.attr("transform","translate("+(l-T/2)+", "+(-w-h.height/2)+")"),m.attr("transform","translate("+(l-T/2)+", "+(-w+h.height/2)+")"),x.attr("transform","translate("+(l+T/2-C.width-2*s)+", "+(-w+h.height/2)+")");let v;const{rx:R,ry:N}=t,{cssStyles:q}=t;if(t.look==="handDrawn"){const J=rt.svg(n),W=et(t,{}),z=R||N?J.path(ce(F,L,T,B,R||0),W):J.rectangle(F,L,T,B,W);v=n.insert(()=>z,":first-child"),v.attr("class","basic label-container").attr("style",q||null)}else{v=n.insert("rect",":first-child"),v.attr("class","basic label-container __APA__").attr("style",o).attr("rx",R??5).attr("ry",N??5).attr("x",F).attr("y",L).attr("width",T).attr("height",B);const J="priority"in t&&t.priority;if(J){const W=n.append("line"),z=F+2,V=L+Math.floor((R??0)/2),I=L+B-Math.floor((R??0)/2);W.attr("x1",z).attr("y1",V).attr("x2",z).attr("y2",I).attr("stroke-width","4").attr("stroke",sC(J))}}return ot(t,v),t.height=B,t.intersect=function(J){return tt.rect(t,J)},n}g(Id,"kanbanItem");async function Od(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ct(e,t,dt(t)),h=s.width+10*a,c=s.height+8*a,l=.15*h,{cssStyles:d}=t,u=s.width+20,f=s.height+20,m=Math.max(h,u),y=Math.max(c,f);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let x;const C=`M0 0
209
+ M${f},${m-Pt} L${f},${m+u}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=x.path(T,C),B=a.insert(()=>w,":first-child");return B.attr("transform",`translate(${Pt/2}, ${Pt/2})`),B.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(n.width/2)+Pt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Pt/2-(n.y-(n.top??0))})`),ot(t,B),t.intersect=function(F){return tt.polygon(t,b,F)},a}g(Ld,"windowPane");var Dn=new Set(["redux-color","redux-dark-color"]),eC=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function ma(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Dt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:h}=o;if(t.look==="handDrawn"){const{themeVariables:ht}=Dt(),{background:kt}=ht,Mt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${kt}`]};await ma(e,Mt)}const c=Dt();t.useHtmlLabels=c.htmlLabels;let l=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:m}=st(t);if(r.attributes.length===0&&t.label){const ht={rx:0,ry:0,labelPaddingX:l,labelPaddingY:l*1.5};Ie(t.label,c)+ht.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const kt=await Ar(e,t,ht);if(i!=null&&Dn.has(i)){const Mt=r.colorIndex??0;kt.attr("data-color-id",`color-${Mt%h.length}`)}if(!ve(c.htmlLabels)){const Mt=kt.select("text"),wt=Mt.node()?.getBBox();Mt.attr("transform",`translate(${-wt.width/2}, 0)`)}return kt}c.htmlLabels||(l*=1.25,d*=1.25);let y=dt(t);y||(y="node default");const x=e.insert("g").attr("class",y).attr("id",t.domId||t.id),C=await Cr(x,t.label??"",c,0,0,["name"],f);C.height+=d;let b=0;const T=[],w=[];let B=0,F=0,L=0,v=0,R=!0,N=!0;for(const ht of r.attributes){const kt=await Cr(x,ht.type,c,0,b,["attribute-type"],f);B=Math.max(B,kt.width+l);const Mt=await Cr(x,ht.name,c,0,b,["attribute-name"],f);F=Math.max(F,Mt.width+l);const wt=await Cr(x,ht.keys.join(),c,0,b,["attribute-keys"],f);L=Math.max(L,wt.width+l);const Xt=await Cr(x,ht.comment,c,0,b,["attribute-comment"],f);v=Math.max(v,Xt.width+l);const qt=Math.max(kt.height,Mt.height,wt.height,Xt.height)+d;w.push({yOffset:b,rowHeight:qt}),b+=qt}let q=4;L<=l&&(R=!1,L=0,q--),v<=l&&(N=!1,v=0,q--);const J=x.node().getBBox();if(C.width+l*2-(B+F+L+v)>0){const ht=C.width+l*2-(B+F+L+v);B+=ht/q,F+=ht/q,L>0&&(L+=ht/q),v>0&&(v+=ht/q)}const W=B+F+L+v,z=rt.svg(x),V=et(t,{});t.look!=="handDrawn"&&(V.roughness=0,V.fillStyle="solid");let I=0;w.length>0&&(I=w.reduce((ht,kt)=>ht+(kt?.rowHeight??0),0));const P=Math.max(J.width+l*2,t?.width||0,W),Y=Math.max((I??0)+C.height,t?.height||0),lt=-P/2,at=-Y/2;if(x.selectAll("g:not(:first-child)").each((ht,kt,Mt)=>{const wt=yt(Mt[kt]),Xt=wt.attr("transform");let qt=0,Fe=0;if(Xt){const ye=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Xt);ye&&(qt=parseFloat(ye[1]),Fe=parseFloat(ye[2]),wt.attr("class").includes("attribute-name")?qt+=B:wt.attr("class").includes("attribute-keys")?qt+=B+F:wt.attr("class").includes("attribute-comment")&&(qt+=B+F+L))}wt.attr("transform",`translate(${lt+l/2+qt}, ${Fe+at+C.height+d/2})`)}),x.select(".name").attr("transform","translate("+-C.width/2+", "+(at+d/2)+")"),i!=null&&Dn.has(i)){const ht=r.colorIndex??0;x.attr("data-color-id",`color-${ht%h.length}`)}const Ct=z.rectangle(lt,at,P,Y,V),Et=x.insert(()=>Ct,":first-child").attr("class","outer-path").attr("style",u.join(""));T.push(0);for(const[ht,kt]of w.entries()){const wt=(ht+1)%2===0&&kt.yOffset!==0,Xt=z.rectangle(lt,C.height+at+kt?.yOffset,P,kt?.rowHeight,{...V,fill:wt?s:a,stroke:n});x.insert(()=>Xt,"g.label").attr("style",u.join("")).attr("class",`row-rect-${wt?"even":"odd"}`)}const mt=1e-4;let Tt=xr(lt,C.height+at,P+lt,C.height+at,mt),xt=z.polygon(Tt.map(ht=>[ht.x,ht.y]),V);if(x.insert(()=>xt).attr("class","divider"),Tt=xr(B+lt,C.height+at,B+lt,Y+at,mt),xt=z.polygon(Tt.map(ht=>[ht.x,ht.y]),V),x.insert(()=>xt).attr("class","divider"),R){const ht=B+F+lt;Tt=xr(ht,C.height+at,ht,Y+at,mt),xt=z.polygon(Tt.map(kt=>[kt.x,kt.y]),V),x.insert(()=>xt).attr("class","divider")}if(N){const ht=B+F+L+lt;Tt=xr(ht,C.height+at,ht,Y+at,mt),xt=z.polygon(Tt.map(kt=>[kt.x,kt.y]),V),x.insert(()=>xt).attr("class","divider")}for(const ht of T){const kt=C.height+at+ht;Tt=xr(lt,kt,P+lt,kt,mt),xt=z.polygon(Tt.map(Mt=>[Mt.x,Mt.y]),V),x.insert(()=>xt).attr("class","divider")}if(ot(t,Et),m&&t.look!=="handDrawn")if(i!=null&&eC.has(i))x.selectAll("path").attr("style",m);else{const kt=m.split(";")?.filter(Mt=>Mt.includes("stroke"))?.map(Mt=>`${Mt}`).join("; ");x.selectAll("path").attr("style",kt??""),x.selectAll(".row-rect-even path").attr("style",m)}return t.intersect=function(ht){return tt.rect(t,ht)},x}g(ma,"erBox");async function Cr(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Ja(t)&&(t=Ja(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const h=n.node().appendChild(await me(n,t,{width:Ie(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let l=h.children[0];for(l.textContent=l.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");l.childNodes[0];)l=l.childNodes[0],l.textContent=l.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=h.getBBox();if(ve(r.htmlLabels)){const l=h.children[0];l.style.textAlign="start";const d=yt(h);c=l.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(Cr,"addText");function xr(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}g(xr,"lineToPolygon");async function Fd(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",dt(t)).attr("id",t.domId||t.id);let n=null,h=null,c=null,l=null,d=0,u=0,f=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await Kr(n,{text:`«${b}»`},0),d=n.node().getBBox().height}h=a.insert("g").attr("class","label-group text"),await Kr(h,t,0,["font-weight: bolder"]);const m=h.node().getBBox();u=m.height,c=a.insert("g").attr("class","members-group text");let y=0;for(const b of t.members){const T=await Kr(c,b,y,[b.parseClassifier()]);y+=T+s}f=c.node().getBBox().height,f<=0&&(f=o/2),l=a.insert("g").attr("class","methods-group text");let x=0;for(const b of t.methods){const T=await Kr(l,b,x,[b.parseClassifier()]);x+=T+s}let C=a.node().getBBox();if(n!==null){const b=n.node().getBBox();n.attr("transform",`translate(${-b.width/2})`)}return h.attr("transform",`translate(${-m.width/2}, ${d})`),C=a.node().getBBox(),c.attr("transform",`translate(0, ${d+u+o*2})`),C=a.node().getBBox(),l.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}g(Fd,"textHelper");async function Kr(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Dt();let a="useHtmlLabels"in t?t.useHtmlLabels:ve(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),ai(n)&&(a=!0);const h=await me(o,Us(Ne(n)),{width:Ie(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,l=1;if(a){const d=h.children[0],u=yt(h);l=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(l+=d.innerHTML.split("<mrow>").length-1),await ua(d),c=d.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(h).selectAll("tspan").attr("font-weight",""),l=h.children.length;const d=h.children[0];(h.textContent===""||h.textContent.includes("&gt"))&&(d.textContent=n[0]+n.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=h.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*l)+r)+")"),c.height}g(Kr,"addText");async function Ed(e,t){const r=Bt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??ve(r.htmlLabels)??!0,h=t;h.annotations=h.annotations??[],h.members=h.members??[],h.methods=h.methods??[];const{shapeSvg:c,bbox:l}=await Fd(e,t,r,n,a),{labelStyles:d,nodeStyles:u}=st(t);t.labelStyle=d,t.cssStyles=h.styles||"";const f=h.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=f.replaceAll("!important","").split(";"));const m=h.members.length===0&&h.methods.length===0&&!r.class?.hideEmptyMembersBox,y=rt.svg(c),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Math.max(t.width??0,l.width);let b=Math.max(t.height??0,l.height);const T=(t.height??0)>l.height;h.members.length===0&&h.methods.length===0?b+=a:h.members.length>0&&h.methods.length===0&&(b+=a*2);const w=-C/2,B=-b/2;let F=m?s*2:h.members.length===0&&h.methods.length===0?-s:0;T&&(F=s*2);const L=y.rectangle(w-s,B-s-(m?s:h.members.length===0&&h.methods.length===0?-s/2:0),C+2*s,b+2*s+F,x),v=c.insert(()=>L,":first-child");v.attr("class","basic label-container outer-path");const R=v.node().getBBox(),N=c.select(".annotation-group").node().getBBox().height-(m?s/2:0)||0,q=c.select(".label-group").node().getBBox().height-(m?s/2:0)||0,J=c.select(".members-group").node().getBBox().height-(m?s/2:0)||0,W=(N+q+B+s-(B-s-(m?s:h.members.length===0&&h.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((z,V,I)=>{const P=yt(I[V]),Y=P.attr("transform");let lt=0;if(Y){const mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);mt&&(lt=parseFloat(mt[2]))}let at=lt+B+s-(m?s:h.members.length===0&&h.methods.length===0?-s/2:0);if(P.attr("class").includes("methods-group")){const Et=Math.max(J,a/2);T?at=Math.max(W,N+q+Et+B+a*2+s)+a*2:at=N+q+Et+B+a*4+s}h.members.length===0&&h.methods.length===0&&r.class?.hideEmptyMembersBox&&(h.annotations.length>0?at=lt-a:at=lt),n||(at-=4);let Ct=w;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(Ct=-P.node()?.getBBox().width/2||0,c.selectAll("text").each(function(Et,mt,Tt){window.getComputedStyle(Tt[mt]).textAnchor==="middle"&&(Ct=0)})),P.attr("transform",`translate(${Ct}, ${at})`)}),h.members.length>0||h.methods.length>0||m){const z=N+q+B+s,V=y.line(R.x,z,R.x+R.width,z+.001,x);c.insert(()=>V).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(m||h.members.length>0||h.methods.length>0){const z=N+q+J+B+a*2+s,V=y.line(R.x,T?Math.max(W,z):z,R.x+R.width,(T?Math.max(W,z):z)+.001,x);c.insert(()=>V).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(h.look!=="handDrawn"&&c.selectAll("path").attr("style",f),v.select(":nth-child(2)").attr("style",f),c.selectAll(".divider").select("path").attr("style",f),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",f),!n){const z=RegExp(/color\s*:\s*([^;]*)/),V=z.exec(f);if(V){const I=V[0].replace("color","fill");c.selectAll("tspan").attr("style",I)}else if(d){const I=z.exec(d);if(I){const P=I[0].replace("color","fill");c.selectAll("tspan").attr("style",P)}}}return ot(t,v),t.intersect=function(z){return tt.rect(t,z)},c}g(Ed,"classBox");async function Ad(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,h="verifyMethod"in t,c=dt(t),l=Bt(),{themeVariables:d}=l,{borderColorArray:u,requirementEdgeLabelBackground:f}=d,m=l.layout==="elk"?"start":"center",y=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let x;h?x=await be(y,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):x=await be(y,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let C=x;const b=await be(y,o.name,C,t.labelStyle+"; font-weight: bold;");if(C+=b+n,h){const q=await be(y,`${o.requirementId?`ID: ${o.requirementId}`:""}`,C,t.labelStyle,m);C+=q;const J=await be(y,`${o.text?`Text: ${o.text}`:""}`,C,t.labelStyle,m);C+=J;const W=await be(y,`${o.risk?`Risk: ${o.risk}`:""}`,C,t.labelStyle,m);C+=W,await be(y,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,C,t.labelStyle,m)}else{const q=await be(y,`${s.type?`Type: ${s.type}`:""}`,C,t.labelStyle,m);C+=q,await be(y,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,C,t.labelStyle,m)}const T=(y.node()?.getBBox().width??200)+a,w=(y.node()?.getBBox().height??200)+a,B=-T/2,F=-w/2,L=rt.svg(y),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const R=L.rectangle(B,F,T,w,v),N=y.insert(()=>R,":first-child");if(N.attr("class","basic label-container outer-path").attr("style",i),u?.length){const q=t.colorIndex??0;y.attr("data-color-id",`color-${q%u.length}`)}if(y.selectAll(".label").each((q,J,W)=>{const z=yt(W[J]),V=z.attr("transform");let I=0,P=0;if(V){const Ct=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(V);Ct&&(I=parseFloat(Ct[1]),P=parseFloat(Ct[2]))}const Y=P-w/2;let lt=B+a/2;(J===0||J===1)&&(lt=I),z.attr("transform",`translate(${lt}, ${Y+a})`)}),C>x+b+n){const q=F+x+b+n;let J;if(t.look==="neo"){const V=[[B,q],[B+T,q],[B+T,q+.001],[B,q+.001]];J=L.polygon(V,v)}else J=L.line(B,q,B+T,q,v);y.insert(()=>J).attr("class","divider")}return ot(t,N),t.intersect=function(q){return tt.rect(t,q)},i&&t.look!=="handDrawn"&&(f||u?.length)&&y.selectAll("path").attr("style",i),y}g(Ad,"requirementBox");async function be(e,t,r,i="",o="center"){if(t==="")return 0;const s=e.insert("g").attr("class","label").attr("style",i),a=Bt(),n=a.htmlLabels??!0,h=await me(s,Us(Ne(t)),{width:Ie(t,a)+50,classes:"markdown-node-label",useHtmlLabels:n,style:i},a);let c;if(n){const l=h.children[0],d=yt(h);o==="start"&&yt(l).style("text-align","left"),c=l.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}else{const l=h.children[0];for(const d of l.children)i&&d.setAttribute("style",i);if(o==="start"){l.setAttribute("text-anchor","start");for(const d of l.children)d.setAttribute("text-anchor","start")}c=h.getBBox(),c.height+=6}return s.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}g(be,"addText");var rC=g(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function _d(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=st(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:h,label:c}=await ct(e,t,dt(t)),l=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let m,y;u?{label:m,bbox:y}=await vo(u,"ticket"in t&&t.ticket||"",f):{label:m,bbox:y}=await vo(n,"ticket"in t&&t.ticket||"",f);const{label:x,bbox:C}=await vo(n,"assigned"in t&&t.assigned||"",f);t.width=a;const b=10,T=t?.width||0,w=Math.max(y.height,C.height)/2,B=Math.max(h.height+b*2,t?.height||0)+w,F=-T/2,L=-B/2;c.attr("transform","translate("+(l-T/2)+", "+(-w-h.height/2)+")"),m.attr("transform","translate("+(l-T/2)+", "+(-w+h.height/2)+")"),x.attr("transform","translate("+(l+T/2-C.width-2*s)+", "+(-w+h.height/2)+")");let v;const{rx:R,ry:N}=t,{cssStyles:q}=t;if(t.look==="handDrawn"){const J=rt.svg(n),W=et(t,{}),z=R||N?J.path(ce(F,L,T,B,R||0),W):J.rectangle(F,L,T,B,W);v=n.insert(()=>z,":first-child"),v.attr("class","basic label-container").attr("style",q||null)}else{v=n.insert("rect",":first-child"),v.attr("class","basic label-container __APA__").attr("style",o).attr("rx",R??5).attr("ry",N??5).attr("x",F).attr("y",L).attr("width",T).attr("height",B);const J="priority"in t&&t.priority;if(J){const W=n.append("line"),z=F+2,V=L+Math.floor((R??0)/2),I=L+B-Math.floor((R??0)/2);W.attr("x1",z).attr("y1",V).attr("x2",z).attr("y2",I).attr("stroke-width","4").attr("stroke",rC(J))}}return ot(t,v),t.height=B,t.intersect=function(J){return tt.rect(t,J)},n}g(_d,"kanbanItem");async function Md(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ct(e,t,dt(t)),h=s.width+10*a,c=s.height+8*a,l=.15*h,{cssStyles:d}=t,u=s.width+20,f=s.height+20,m=Math.max(h,u),y=Math.max(c,f);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let x;const C=`M0 0
215
210
  a${l},${l} 1 0,0 ${m*.25},${-1*y*.1}
216
211
  a${l},${l} 1 0,0 ${m*.25},0
217
212
  a${l},${l} 1 0,0 ${m*.25},0
@@ -229,7 +224,7 @@ ${o.join(`
229
224
  a${l},${l} 1 0,0 ${-1*m*.1},${-1*y*.33}
230
225
  a${l*.8},${l*.8} 1 0,0 0,${-1*y*.34}
231
226
  a${l},${l} 1 0,0 ${m*.1},${-1*y*.33}
232
- H0 V0 Z`;if(t.look==="handDrawn"){const b=rt.svg(o),T=et(t,{}),w=b.path(C,T);x=o.insert(()=>w,":first-child"),x.attr("class","basic label-container").attr("style",Wt(d))}else x=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return x.attr("transform",`translate(${-m/2}, ${-y/2})`),ot(t,x),t.calcIntersect=function(b,T){return tt.rect(b,T)},t.intersect=function(b){return M.info("Bang intersect",t,b),tt.rect(t,b)},o}g(Od,"bang");async function $d(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ct(e,t,dt(t)),h=s.width+2*a,c=s.height+2*a,l=.15*h,d=.25*h,u=.35*h,f=.2*h,{cssStyles:m}=t;let y;const x=`M0 0
227
+ H0 V0 Z`;if(t.look==="handDrawn"){const b=rt.svg(o),T=et(t,{}),w=b.path(C,T);x=o.insert(()=>w,":first-child"),x.attr("class","basic label-container").attr("style",Wt(d))}else x=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return x.attr("transform",`translate(${-m/2}, ${-y/2})`),ot(t,x),t.calcIntersect=function(b,T){return tt.rect(b,T)},t.intersect=function(b){return M.info("Bang intersect",t,b),tt.rect(t,b)},o}g(Md,"bang");async function Id(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ct(e,t,dt(t)),h=s.width+2*a,c=s.height+2*a,l=.15*h,d=.25*h,u=.35*h,f=.2*h,{cssStyles:m}=t;let y;const x=`M0 0
233
228
  a${l},${l} 0 0,1 ${h*.25},${-1*h*.1}
234
229
  a${u},${u} 1 0,1 ${h*.4},${-1*h*.1}
235
230
  a${d},${d} 1 0,1 ${h*.35},${h*.2}
@@ -243,7 +238,7 @@ ${o.join(`
243
238
 
244
239
  a${l},${l} 1 0,1 ${-1*h*.1},${-1*c*.35}
245
240
  a${f},${f} 1 0,1 ${h*.1},${-1*c*.65}
246
- H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),b=et(t,{}),T=C.path(x,b);y=o.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Wt(m))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),y.attr("transform",`translate(${-h/2}, ${-c/2})`),ot(t,y),t.calcIntersect=function(C,b){return tt.rect(C,b)},t.intersect=function(C){return M.info("Cloud intersect",t,C),tt.rect(t,C)},o}g($d,"cloud");async function Dd(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ct(e,t,dt(t)),h=s.width+8*a,c=s.height+2*a,l=5,d=t.look==="neo"?`
241
+ H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),b=et(t,{}),T=C.path(x,b);y=o.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Wt(m))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),y.attr("transform",`translate(${-h/2}, ${-c/2})`),ot(t,y),t.calcIntersect=function(C,b){return tt.rect(C,b)},t.intersect=function(C){return M.info("Cloud intersect",t,C),tt.rect(t,C)},o}g(Id,"cloud");async function Od(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ct(e,t,dt(t)),h=s.width+8*a,c=s.height+2*a,l=5,d=t.look==="neo"?`
247
242
  M${-h/2} ${c/2-l}
248
243
  v${-c+2*l}
249
244
  q0,-${l} ${l},-${l}
@@ -263,23 +258,23 @@ ${o.join(`
263
258
  h${-(h-2*l)}
264
259
  q${-l},0 ${-l},${-l}
265
260
  Z
266
- `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",c/2).attr("x2",h/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),ot(t,u),t.calcIntersect=function(f,m){return tt.rect(f,m)},t.intersect=function(f){return tt.rect(t,f)},o}g(Dd,"defaultMindmapNode");async function Pd(e,t){const r={padding:t.padding??0};return ma(e,t,r)}g(Pd,"mindmapCircle");var aC=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:pd},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:dd},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:fd},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:xd},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Dc},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Pc},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:zc},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:kc},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Fc},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:wc},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:$c},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:ma},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Od},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:$d},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ld},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:jc},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ed},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:td},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:wd},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Qc},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:qc},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Sd},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Bc},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ud},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Cd},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:yd},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Hc},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Xc},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:_c},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Mc},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Ic},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:rd},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Ld},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Yc},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Td},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:id},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Oc},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Rc},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:vd},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ed},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Nc},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Bd},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Wc},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:gd},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ad},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:sd},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:bc},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Ac},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:kd},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:bd},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Fd},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:hd},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:od}],nC=g(()=>{const t=[...Object.entries({state:md,choice:vc,note:nd,composite:Lc,rectWithTitle:cd,labelRect:Jc,block_arrow:Tc,collapsedGroup:Sc,iconSquare:Kc,iconCircle:Gc,icon:Uc,iconRounded:Vc,imageSquare:Zc,anchor:Cc,kanbanItem:Id,mindmapCircle:Pd,defaultMindmapNode:Dd,classBox:_d,erBox:ya,requirementBox:Md}),...aC.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Rd=nC();function lC(e){return e in Rd}g(lC,"isValidShape");var co=g(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),uo=new Map;async function Ca(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Rd[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Wt(t.look)),t.tooltip&&o.attr("title",t.tooltip),uo.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(Ca,"insertNode");var T2=g((e,t)=>{uo.set(t.id,e)},"setNodeElem"),hC=g(()=>{uo.clear()},"clear"),qn=g(e=>{const t=uo.get(e.id);M.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),cC=g(async(e,t)=>{const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:h,nodeStyles:c,borderStyles:l,backgroundStyles:d}=st(t),u=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),f=ve(r.flowchart.htmlLabels),m=t.direction==="LR",y=u.insert("g").attr("class","cluster-label swimlane-label"),x=await me(y,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let C=x.getBBox();if(f){const W=x.children[0],z=yt(x);C=W.getBoundingClientRect(),z.attr("width",C.width),z.attr("height",C.height)}const b=t.padding??0,T=t.width<=C.width+b?C.width+b:t.width;t.width<=C.width+b?t.diff=(T-t.width)/2-b:t.diff=-b;const w=t.height,B=t.y-w/2,F=t.y+w/2,L=t.x-T/2,v=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:B+w/3,R=m?4:0,N=C.height+2*R;let q,J;if(m){const W=Math.max(N,C.height+2*R),z=L+W,V=Math.max(0,T-W);if(t.look==="handDrawn"){const Y=rt.svg(u),lt=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),at=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),Ct=Y.rectangle(L,B,W,w,lt);q=u.insert(()=>Ct,":first-child");const Et=Y.rectangle(z,B,V,w,at);J=u.insert(()=>Et,":first-child"),q.select("path:nth-child(2)").attr("style",l.join(";")),q.select("path").attr("style",d.join(";").replace("fill","stroke"))}else q=u.insert("rect",":first-child"),J=u.insert("rect",":first-child"),q.attr("class","swimlane-title").attr("style",c).attr("x",L).attr("y",B).attr("width",W).attr("height",w).attr("fill",s).attr("stroke",n),J.attr("class","swimlane-body").attr("style",c).attr("x",z).attr("y",B).attr("width",V).attr("height",w).attr("fill","none").attr("stroke",n);const I=L+W/2,P=t.y;y.attr("transform",`translate(${I}, ${P}) rotate(-90) translate(${-C.width/2}, ${-C.height/2})`)}else{const W=Math.max(0,v-B),z=Math.min(N,W),V=B+z,I=Math.max(0,F-V),P=t.x-T/2;if(t.look==="handDrawn"){const at=rt.svg(u),Ct=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),Et=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),mt=at.rectangle(P,B,T,z,Ct);q=u.insert(()=>mt,":first-child");const Tt=at.rectangle(P,V,T,I,Et);J=u.insert(()=>Tt,":first-child"),q.select("path:nth-child(2)").attr("style",l.join(";")),q.select("path").attr("style",d.join(";").replace("fill","stroke"))}else q=u.insert("rect",":first-child"),J=u.insert("rect",":first-child"),q.attr("class","swimlane-title").attr("style",c).attr("x",P).attr("y",B).attr("width",T).attr("height",z).attr("fill",s).attr("stroke",n),J.attr("class","swimlane-body").attr("style",c).attr("x",P).attr("y",V).attr("width",T).attr("height",I).attr("fill","none").attr("stroke",n);const Y=t.x-C.width/2,lt=B+(z-C.height)/2;y.attr("transform",`translate(${Y}, ${lt})`)}if(M.trace("Swimlane data ",t,JSON.stringify(t)),h){const W=y.select("span");W&&W.attr("style",h)}return t.offsetX=0,t.width=T,t.height=w,t.offsetY=C.height-b/2,t.intersect=function(W){return ar(t,W)},{cluster:u,labelBBox:C}},"swimlane"),qd=g(async(e,t)=>{M.info("Creating subgraph rect for ",t.id,t);const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:h,borderStyles:c,backgroundStyles:l}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Kt(r),f=d.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await me(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width}):m=await Re(f,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(Kt(r)){const L=m.children[0],v=yt(m);y=L.getBoundingClientRect(),v.attr("width",y.width),v.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-x/2,T=t.y-C/2;M.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){const L=rt.svg(d),v=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),R=L.path(ce(b,T,x,C,0),v);w=d.insert(()=>(M.debug("Rough node insert CXC",R),R),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",l.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",x).attr("height",C);const{subGraphTitleTopMargin:B}=co(r);if(f.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+B})`),n){const L=f.select("span");L&&L.attr("style",n)}const F=w.node().getBBox();return t.offsetX=0,t.width=F.width,t.height=F.height,t.offsetY=y.height-t.padding/2,t.intersect=function(L){return ar(t,L)},{cluster:d,labelBBox:y}},"rect"),dC=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return ar(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),uC=g(async(e,t)=>{const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:h}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),l=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let u=c.append("rect");const f=await Re(d,t.label,t.labelStyle,void 0,!0);let m=f.getBBox();if(Kt(r)){const R=f.children[0],N=yt(f);m=R.getBoundingClientRect(),N.attr("width",m.width),N.attr("height",m.height)}const y=0*t.padding,x=y/2,C=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+y,T=t.height+y-m.height-6,w=t.x-C/2,B=t.y-b/2;t.width=C;const F=t.y-t.height/2-x+m.height+2;let L;if(t.look==="handDrawn"){const R=t.cssClasses.includes("statediagram-cluster-alt"),N=rt.svg(c),q=t.rx||t.ry?N.path(ce(w,B,C,b,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:h,seed:o}):N.rectangle(w,B,C,b,{seed:o});L=c.insert(()=>q,":first-child");const J=N.rectangle(w,F,C,T,{fill:R?s:a,fillStyle:R?"hachure":"solid",stroke:h,seed:o});L=c.insert(()=>q,":first-child"),u=c.insert(()=>J)}else L=l.insert("rect",":first-child"),L.attr("class","outer").attr("x",w).attr("y",B).attr("width",C).attr("height",b).attr("data-look",t.look),u.attr("class","inner").attr("x",w).attr("y",F).attr("width",C).attr("height",T);d.attr("transform",`translate(${t.x-m.width/2}, ${B+1-(Kt(r)?0:3)})`);const v=L.node().getBBox();return t.height=v.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(R){return ar(t,R)},{cluster:c,labelBBox:m}},"roundedWithTitle"),gC=g(async(e,t)=>{M.info("Creating subgraph rect for ",t.id,t);const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:h,borderStyles:c,backgroundStyles:l}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Kt(r),f=d.insert("g").attr("class","cluster-label "),m=await me(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let y=m.getBBox();if(Kt(r)){const L=m.children[0],v=yt(m);y=L.getBoundingClientRect(),v.attr("width",y.width),v.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-x/2,T=t.y-C/2;M.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){const L=rt.svg(d),v=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),R=L.path(ce(b,T,x,C,t.rx),v);w=d.insert(()=>(M.debug("Rough node insert CXC",R),R),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",l.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",x).attr("height",C);const{subGraphTitleTopMargin:B}=co(r);if(f.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+B})`),n){const L=f.select("span");L&&L.attr("style",n)}const F=w.node().getBBox();return t.offsetX=0,t.width=F.width,t.height=F.height,t.offsetY=y.height-t.padding/2,t.intersect=function(L){return ar(t,L)},{cluster:d,labelBBox:y}},"kanbanSection"),pC=g((e,t)=>{const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),h=0*t.padding,c=t.width+h;t.diff=-t.padding;const l=t.height+h,d=t.x-c/2,u=t.y-l/2;t.width=c;let f;if(t.look==="handDrawn"){const x=rt.svg(a).rectangle(d,u,c,l,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});f=a.insert(()=>x,":first-child")}else{f=n.insert("rect",":first-child");let y="outer";t.look,y="divider",f.attr("class",y).attr("x",d).attr("y",u).attr("width",c).attr("height",l).attr("data-look",t.look)}const m=f.node().getBBox();return t.height=m.height,t.offsetX=0,t.offsetY=0,t.intersect=function(y){return ar(t,y)},{cluster:a,labelBBox:{}}},"divider"),fC=qd,mC={rect:qd,squareRect:fC,roundedWithTitle:uC,noteGroup:dC,divider:pC,kanbanSection:gC,swimlane:cC},Nd=new Map,Wd=g(async(e,t)=>{const r=t.shape||"rect",i=await mC[r](e,t);return Nd.set(t.id,i),i},"insertCluster"),yC=g(()=>{Nd=new Map},"clear"),Ur=g((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Gt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Nn={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Qr(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(Qr,"calculateDeltaAndAngle");var $t=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),CC=g(e=>({x:g(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Gt,e.arrowTypeStart)){const{angle:f,deltaX:m}=Qr(i[0],i[1]);o=Gt[e.arrowTypeStart]*Math.cos(f)*(m>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Gt,e.arrowTypeEnd)){const{angle:f,deltaX:m}=Qr(i[i.length-1],i[i.length-2]);o=Gt[e.arrowTypeEnd]*Math.cos(f)*(m>=0?1:-1)}const a=Math.abs($t(t).x-$t(i[i.length-1]).x),n=Math.abs($t(t).y-$t(i[i.length-1]).y),h=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),l=Gt[e.arrowTypeStart],d=Gt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="right"?-1:1,o-=f}if(h<l&&h>0&&c<l){let f=l+u-h;f*=s==="right"?-1:1,o+=f}return $t(t).x+o},"x"),y:g(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Gt,e.arrowTypeStart)){const{angle:f,deltaY:m}=Qr(i[0],i[1]);o=Gt[e.arrowTypeStart]*Math.abs(Math.sin(f))*(m>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Gt,e.arrowTypeEnd)){const{angle:f,deltaY:m}=Qr(i[i.length-1],i[i.length-2]);o=Gt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(m>=0?1:-1)}const a=Math.abs($t(t).y-$t(i[i.length-1]).y),n=Math.abs($t(t).x-$t(i[i.length-1]).x),h=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),l=Gt[e.arrowTypeStart],d=Gt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="up"?-1:1,o-=f}if(h<l&&h>0&&c<l){let f=l+u-h;f*=s==="up"?-1:1,o+=f}return $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),xC=g((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&Wn(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&Wn(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),bC={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},kC=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Wn=g((e,t,r,i,o,s,a=!1,n)=>{if(!r||r==="none")return;const h=bC[r],c=h&&kC.includes(h.type);if(!h){M.warn(`Unknown arrow type: ${r}`);return}const l=h.type,f=`${o}_${s}-${l}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const m=n.replace(/[^\dA-Za-z]/g,"_"),y=`${f}_${m}`;if(!document.getElementById(y)){const x=document.getElementById(f);if(x){const C=x.cloneNode(!0);C.id=y,C.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",n),h.fill&&T.setAttribute("fill",n)}),x.parentNode?.appendChild(C)}}e.attr(`marker-${t}`,`url(${i}#${y})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),SC=g(e=>typeof e=="string"?e:Bt()?.flowchart?.curve,"resolveEdgeCurveType"),Br=new Map,Rt=new Map,TC=g(()=>{Br.clear(),Rt.clear()},"clear"),zd=g(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),Gr=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),xa=g(async(e,t)=>{const r=Bt();let i=Kt(r);const{labelStyles:o}=st(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await me(e,t.label,{style:Gr(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),M.info("abc82",t,t.labelType);let l,d;if(i){const f=c.children[0],m=yt(c);l=await rr.measure(()=>f.getBoundingClientRect()),d=l,m.attr("width",l.width),m.attr("height",l.height)}else{const f=yt(c).select("text").node();await rr.measure(()=>{l=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=l})}a.attr("transform",Ur(d,i)),Br.set(t.id,s),t.width=l.width,t.height=l.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(m,t.startLabelLeft,Gr(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Ur(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).startLeft=f,Jr(u,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(m,t.startLabelRight,Gr(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Ur(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).startRight=f,Jr(u,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(f,t.endLabelLeft,Gr(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Ur(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).endLeft=f,Jr(u,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(f,t.endLabelRight,Gr(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Ur(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).endRight=f,Jr(u,t.endLabelRight)}return c},"insertEdgeLabel");function Jr(e,t){Kt(Bt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(Jr,"setTerminalWidth");var wC=g((e,t)=>{M.debug("Moving label abc88 ",e.id,e.label,Br.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=Bt(),{subGraphTitleTotalMargin:o}=co(i);if(e.label){const s=Br.get(e.id);let a=e.x,n=e.y;if(r){const h=Vt.calcLabelPosition(r);M.debug("Moving label "+e.label+" from (",a,",",n,") to (",h.x,",",h.y,") abc88"),t.updatedPath&&(a=h.x,n=h.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Rt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Rt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Rt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Rt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),BC=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),vC=g((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),LC=g((e,t,r)=>{M.debug(`intersection calc abc89:
261
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",c/2).attr("x2",h/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),ot(t,u),t.calcIntersect=function(f,m){return tt.rect(f,m)},t.intersect=function(f){return tt.rect(t,f)},o}g(Od,"defaultMindmapNode");async function $d(e,t){const r={padding:t.padding??0};return fa(e,t,r)}g($d,"mindmapCircle");var iC=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ud},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hd},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:gd},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:yd},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Oc},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:$c},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Nc},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:xc},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:vc},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:Sc},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Ic},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:fa},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Md},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Id},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ad},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Hc},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Jc},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Qc},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Sd},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Kc},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Pc},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:bd},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Tc},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:cd},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:md},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:fd},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Wc},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Yc},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Ec},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ac},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:_c},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:td},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Bd},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:zc},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:kd},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ed},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Mc},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Dc},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:wd},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ld},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Rc},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Td},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:qc},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:dd},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:od},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:id},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Cc},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Fc},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:xd},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Cd},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:vd},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:nd},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:rd}],oC=g(()=>{const t=[...Object.entries({state:pd,choice:wc,note:sd,composite:Bc,rectWithTitle:ld,labelRect:Zc,block_arrow:kc,collapsedGroup:bc,iconSquare:Gc,iconCircle:Xc,icon:jc,iconRounded:Uc,imageSquare:Vc,anchor:mc,kanbanItem:_d,mindmapCircle:$d,defaultMindmapNode:Od,classBox:Ed,erBox:ma,requirementBox:Ad}),...iC.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Dd=oC();function sC(e){return e in Dd}g(sC,"isValidShape");var ho=g(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),co=new Map;async function ya(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?Dd[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Wt(t.look)),t.tooltip&&o.attr("title",t.tooltip),co.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(ya,"insertNode");var k2=g((e,t)=>{co.set(t.id,e)},"setNodeElem"),aC=g(()=>{co.clear()},"clear"),Pn=g(e=>{const t=co.get(e.id);M.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),nC=g(async(e,t)=>{const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:h,nodeStyles:c,borderStyles:l,backgroundStyles:d}=st(t),u=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),f=ve(r.flowchart.htmlLabels),m=t.direction==="LR",y=u.insert("g").attr("class","cluster-label swimlane-label"),x=await me(y,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let C=x.getBBox();if(f){const W=x.children[0],z=yt(x);C=W.getBoundingClientRect(),z.attr("width",C.width),z.attr("height",C.height)}const b=t.padding??0,T=t.width<=C.width+b?C.width+b:t.width;t.width<=C.width+b?t.diff=(T-t.width)/2-b:t.diff=-b;const w=t.height,B=t.y-w/2,F=t.y+w/2,L=t.x-T/2,v=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:B+w/3,R=m?4:0,N=C.height+2*R;let q,J;if(m){const W=Math.max(N,C.height+2*R),z=L+W,V=Math.max(0,T-W);if(t.look==="handDrawn"){const Y=rt.svg(u),lt=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),at=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),Ct=Y.rectangle(L,B,W,w,lt);q=u.insert(()=>Ct,":first-child");const Et=Y.rectangle(z,B,V,w,at);J=u.insert(()=>Et,":first-child"),q.select("path:nth-child(2)").attr("style",l.join(";")),q.select("path").attr("style",d.join(";").replace("fill","stroke"))}else q=u.insert("rect",":first-child"),J=u.insert("rect",":first-child"),q.attr("class","swimlane-title").attr("style",c).attr("x",L).attr("y",B).attr("width",W).attr("height",w).attr("fill",s).attr("stroke",n),J.attr("class","swimlane-body").attr("style",c).attr("x",z).attr("y",B).attr("width",V).attr("height",w).attr("fill","none").attr("stroke",n);const I=L+W/2,P=t.y;y.attr("transform",`translate(${I}, ${P}) rotate(-90) translate(${-C.width/2}, ${-C.height/2})`)}else{const W=Math.max(0,v-B),z=Math.min(N,W),V=B+z,I=Math.max(0,F-V),P=t.x-T/2;if(t.look==="handDrawn"){const at=rt.svg(u),Ct=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),Et=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),mt=at.rectangle(P,B,T,z,Ct);q=u.insert(()=>mt,":first-child");const Tt=at.rectangle(P,V,T,I,Et);J=u.insert(()=>Tt,":first-child"),q.select("path:nth-child(2)").attr("style",l.join(";")),q.select("path").attr("style",d.join(";").replace("fill","stroke"))}else q=u.insert("rect",":first-child"),J=u.insert("rect",":first-child"),q.attr("class","swimlane-title").attr("style",c).attr("x",P).attr("y",B).attr("width",T).attr("height",z).attr("fill",s).attr("stroke",n),J.attr("class","swimlane-body").attr("style",c).attr("x",P).attr("y",V).attr("width",T).attr("height",I).attr("fill","none").attr("stroke",n);const Y=t.x-C.width/2,lt=B+(z-C.height)/2;y.attr("transform",`translate(${Y}, ${lt})`)}if(M.trace("Swimlane data ",t,JSON.stringify(t)),h){const W=y.select("span");W&&W.attr("style",h)}return t.offsetX=0,t.width=T,t.height=w,t.offsetY=C.height-b/2,t.intersect=function(W){return ar(t,W)},{cluster:u,labelBBox:C}},"swimlane"),Pd=g(async(e,t)=>{M.info("Creating subgraph rect for ",t.id,t);const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:h,borderStyles:c,backgroundStyles:l}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Kt(r),f=d.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await me(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width}):m=await Re(f,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(Kt(r)){const L=m.children[0],v=yt(m);y=L.getBoundingClientRect(),v.attr("width",y.width),v.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-x/2,T=t.y-C/2;M.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){const L=rt.svg(d),v=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),R=L.path(ce(b,T,x,C,0),v);w=d.insert(()=>(M.debug("Rough node insert CXC",R),R),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",l.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",x).attr("height",C);const{subGraphTitleTopMargin:B}=ho(r);if(f.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+B})`),n){const L=f.select("span");L&&L.attr("style",n)}const F=w.node().getBBox();return t.offsetX=0,t.width=F.width,t.height=F.height,t.offsetY=y.height-t.padding/2,t.intersect=function(L){return ar(t,L)},{cluster:d,labelBBox:y}},"rect"),lC=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return ar(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),hC=g(async(e,t)=>{const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:h}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),l=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let u=c.append("rect");const f=await Re(d,t.label,t.labelStyle,void 0,!0);let m=f.getBBox();if(Kt(r)){const R=f.children[0],N=yt(f);m=R.getBoundingClientRect(),N.attr("width",m.width),N.attr("height",m.height)}const y=0*t.padding,x=y/2,C=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+y,T=t.height+y-m.height-6,w=t.x-C/2,B=t.y-b/2;t.width=C;const F=t.y-t.height/2-x+m.height+2;let L;if(t.look==="handDrawn"){const R=t.cssClasses.includes("statediagram-cluster-alt"),N=rt.svg(c),q=t.rx||t.ry?N.path(ce(w,B,C,b,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:h,seed:o}):N.rectangle(w,B,C,b,{seed:o});L=c.insert(()=>q,":first-child");const J=N.rectangle(w,F,C,T,{fill:R?s:a,fillStyle:R?"hachure":"solid",stroke:h,seed:o});L=c.insert(()=>q,":first-child"),u=c.insert(()=>J)}else L=l.insert("rect",":first-child"),L.attr("class","outer").attr("x",w).attr("y",B).attr("width",C).attr("height",b).attr("data-look",t.look),u.attr("class","inner").attr("x",w).attr("y",F).attr("width",C).attr("height",T);d.attr("transform",`translate(${t.x-m.width/2}, ${B+1-(Kt(r)?0:3)})`);const v=L.node().getBBox();return t.height=v.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(R){return ar(t,R)},{cluster:c,labelBBox:m}},"roundedWithTitle"),cC=g(async(e,t)=>{M.info("Creating subgraph rect for ",t.id,t);const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:h,borderStyles:c,backgroundStyles:l}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Kt(r),f=d.insert("g").attr("class","cluster-label "),m=await me(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let y=m.getBBox();if(Kt(r)){const L=m.children[0],v=yt(m);y=L.getBoundingClientRect(),v.attr("width",y.width),v.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-x/2,T=t.y-C/2;M.trace("Data ",t,JSON.stringify(t));let w;if(t.look==="handDrawn"){const L=rt.svg(d),v=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),R=L.path(ce(b,T,x,C,t.rx),v);w=d.insert(()=>(M.debug("Rough node insert CXC",R),R),":first-child"),w.select("path:nth-child(2)").attr("style",c.join(";")),w.select("path").attr("style",l.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",T).attr("width",x).attr("height",C);const{subGraphTitleTopMargin:B}=ho(r);if(f.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+B})`),n){const L=f.select("span");L&&L.attr("style",n)}const F=w.node().getBBox();return t.offsetX=0,t.width=F.width,t.height=F.height,t.offsetY=y.height-t.padding/2,t.intersect=function(L){return ar(t,L)},{cluster:d,labelBBox:y}},"kanbanSection"),dC=g((e,t)=>{const r=Bt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),h=0*t.padding,c=t.width+h;t.diff=-t.padding;const l=t.height+h,d=t.x-c/2,u=t.y-l/2;t.width=c;let f;if(t.look==="handDrawn"){const x=rt.svg(a).rectangle(d,u,c,l,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});f=a.insert(()=>x,":first-child")}else{f=n.insert("rect",":first-child");let y="outer";t.look,y="divider",f.attr("class",y).attr("x",d).attr("y",u).attr("width",c).attr("height",l).attr("data-look",t.look)}const m=f.node().getBBox();return t.height=m.height,t.offsetX=0,t.offsetY=0,t.intersect=function(y){return ar(t,y)},{cluster:a,labelBBox:{}}},"divider"),uC=Pd,gC={rect:Pd,squareRect:uC,roundedWithTitle:hC,noteGroup:lC,divider:dC,kanbanSection:cC,swimlane:nC},Rd=new Map,qd=g(async(e,t)=>{const r=t.shape||"rect",i=await gC[r](e,t);return Rd.set(t.id,i),i},"insertCluster"),pC=g(()=>{Rd=new Map},"clear"),Xr=g((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Gt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Rn={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Zr(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(Zr,"calculateDeltaAndAngle");var $t=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),fC=g(e=>({x:g(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Gt,e.arrowTypeStart)){const{angle:f,deltaX:m}=Zr(i[0],i[1]);o=Gt[e.arrowTypeStart]*Math.cos(f)*(m>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Gt,e.arrowTypeEnd)){const{angle:f,deltaX:m}=Zr(i[i.length-1],i[i.length-2]);o=Gt[e.arrowTypeEnd]*Math.cos(f)*(m>=0?1:-1)}const a=Math.abs($t(t).x-$t(i[i.length-1]).x),n=Math.abs($t(t).y-$t(i[i.length-1]).y),h=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),l=Gt[e.arrowTypeStart],d=Gt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="right"?-1:1,o-=f}if(h<l&&h>0&&c<l){let f=l+u-h;f*=s==="right"?-1:1,o+=f}return $t(t).x+o},"x"),y:g(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Gt,e.arrowTypeStart)){const{angle:f,deltaY:m}=Zr(i[0],i[1]);o=Gt[e.arrowTypeStart]*Math.abs(Math.sin(f))*(m>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Gt,e.arrowTypeEnd)){const{angle:f,deltaY:m}=Zr(i[i.length-1],i[i.length-2]);o=Gt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(m>=0?1:-1)}const a=Math.abs($t(t).y-$t(i[i.length-1]).y),n=Math.abs($t(t).x-$t(i[i.length-1]).x),h=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),l=Gt[e.arrowTypeStart],d=Gt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="up"?-1:1,o-=f}if(h<l&&h>0&&c<l){let f=l+u-h;f*=s==="up"?-1:1,o+=f}return $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),mC=g((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&qn(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&qn(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),yC={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},CC=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],qn=g((e,t,r,i,o,s,a=!1,n)=>{if(!r||r==="none")return;const h=yC[r],c=h&&CC.includes(h.type);if(!h){M.warn(`Unknown arrow type: ${r}`);return}const l=h.type,f=`${o}_${s}-${l}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const m=n.replace(/[^\dA-Za-z]/g,"_"),y=`${f}_${m}`;if(!document.getElementById(y)){const x=document.getElementById(f);if(x){const C=x.cloneNode(!0);C.id=y,C.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",n),h.fill&&T.setAttribute("fill",n)}),x.parentNode?.appendChild(C)}}e.attr(`marker-${t}`,`url(${i}#${y})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),xC=g(e=>typeof e=="string"?e:Bt()?.flowchart?.curve,"resolveEdgeCurveType"),Br=new Map,Rt=new Map,bC=g(()=>{Br.clear(),Rt.clear()},"clear"),Nd=g(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),Ur=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),Ca=g(async(e,t)=>{const r=Bt();let i=Kt(r);const{labelStyles:o}=st(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await me(e,t.label,{style:Ur(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),M.info("abc82",t,t.labelType);let l,d;if(i){const f=c.children[0],m=yt(c);l=await rr.measure(()=>f.getBoundingClientRect()),d=l,m.attr("width",l.width),m.attr("height",l.height)}else{const f=yt(c).select("text").node();await rr.measure(()=>{l=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=l})}a.attr("transform",Xr(d,i)),Br.set(t.id,s),t.width=l.width,t.height=l.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(m,t.startLabelLeft,Ur(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Xr(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).startLeft=f,Qr(u,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(m,t.startLabelRight,Ur(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Xr(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).startRight=f,Qr(u,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(f,t.endLabelLeft,Ur(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Xr(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).endLeft=f,Qr(u,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),m=f.insert("g").attr("class","inner"),y=await Re(f,t.endLabelRight,Ur(t.labelStyle)||"",!1,!1);u=y;let x=y.getBBox();if(i){const C=y.children[0],b=yt(y);x=C.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}m.attr("transform",Xr(x,i)),Rt.get(t.id)||Rt.set(t.id,{}),Rt.get(t.id).endRight=f,Qr(u,t.endLabelRight)}return c},"insertEdgeLabel");function Qr(e,t){Kt(Bt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(Qr,"setTerminalWidth");var kC=g((e,t)=>{M.debug("Moving label abc88 ",e.id,e.label,Br.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=Bt(),{subGraphTitleTotalMargin:o}=ho(i);if(e.label){const s=Br.get(e.id);let a=e.x,n=e.y;if(r){const h=Vt.calcLabelPosition(r);M.debug("Moving label "+e.label+" from (",a,",",n,") to (",h.x,",",h.y,") abc88"),t.updatedPath&&(a=h.x,n=h.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Rt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Rt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Rt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Rt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),SC=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),TC=g((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),wC=g((e,t,r)=>{M.debug(`intersection calc abc89:
267
262
  outsidePoint: ${JSON.stringify(t)}
268
263
  insidePoint : ${JSON.stringify(r)}
269
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const h=e.height/2,c=Math.abs(t.y-r.y),l=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*h){let d=r.y<t.y?t.y-h-o:o-h-t.y;n=l*d/c;const u={x:r.x<t.x?r.x+n:r.x-l+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),l===0&&(u.x=t.x),c===0&&(u.y=t.y),M.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${l}, r ${n}`,u),u}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/l,u=r.x<t.x?r.x+l-n:r.x-l+n,f=r.y<t.y?r.y+d:r.y-d;return M.debug(`sides calc abc89, Q ${c}, q ${d}, R ${l}, r ${n}`,{_x:u,_y:f}),n===0&&(u=t.x,f=t.y),l===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),zn=g((e,t)=>{M.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(M.info("abc88 checking point",s,t),!vC(t,s)&&!o){const a=LC(t,i,s);M.debug("abc88 inside",s,i,a),M.debug("abc88 intersection",a,t);let n=!1;r.forEach(h=>{n=n||h.x===a.x&&h.y===a.y}),r.some(h=>h.x===a.x&&h.y===a.y)?M.warn("abc88 no intersect",a,r):r.push(a),o=!0}else M.warn("abc88 outside",s,i),i=s,o||r.push(s)}),M.debug("returning points",r),r},"cutPathAtIntersect");function Hd(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(Hd,"extractCornerPoints");var Hn=g(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),FC=g(function(e){const{cornerPointPositions:t}=Hd(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=Hn(o,a,5),h=Hn(s,a,5),c=h.x-n.x,l=h.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){M.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const f=5;a.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:l<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:l<0?n.y-f+d:n.y+f-d}}else M.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(u,h)}else r.push(e[i]);return r},"fixCorners"),EC=g((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),h=Number.isFinite(n)?Math.max(0,n):0,c=Array(h).fill(`${o} ${s}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),Yd=g(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:h,layout:c}=Bt();let l=t.points,d=!1;const u=o;var f=s;const m=[];for(const Y in t.cssCompiledStyles)Bh(Y)||m.push(t.cssCompiledStyles[Y]);if(c==="swimlane"){if(f.intersect&&u.intersect&&Array.isArray(l)&&l.length>=2)if(l.length===2)l=[u.intersect(l[0]),f.intersect(l[1])];else{const Y=l.slice(1,-1),lt=Y[0],at=Y[Y.length-1],Ct=.5,Et=Math.abs(l[l.length-1].x-at.x)<Ct&&Math.abs(l[l.length-1].y-at.y)<Ct,mt=u.intersect(lt),Tt=Et?at:f.intersect(at),xt=Math.abs(Tt.x-at.x)<Ct&&Math.abs(Tt.y-at.y)<Ct,kt=Math.abs(mt.x-lt.x)<Ct&&Math.abs(mt.y-lt.y)<Ct?[]:[mt],Mt=xt?[]:[Tt];l=[...kt,...Y,...Mt]}l=BC(t,l)}else f.intersect&&u.intersect&&!n&&(l=l.slice(1,t.points.length-1),l.unshift(u.intersect(l[0])),l.push(f.intersect(l[l.length-1])));const y=btoa(JSON.stringify(l));t.toCluster&&(M.info("to cluster abc88",r.get(t.toCluster)),l=zn(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(M.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(l,null,2)),l=zn(l.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let x=l.filter(Y=>!Number.isNaN(Y.y));const C=SC(t.curve);C!=="rounded"&&(x=FC(x));let b=Ii;switch(C){case"linear":b=Ii;break;case"basis":b=os;break;case"cardinal":b=Vl;break;case"bumpX":b=Zl;break;case"bumpY":b=Kl;break;case"catmullRom":b=Gl;break;case"monotoneX":b=Ul;break;case"monotoneY":b=Xl;break;case"natural":b=jl;break;case"step":b=Yl;break;case"stepAfter":b=Hl;break;case"stepBefore":b=zl;break;case"rounded":b=Ii;break;default:b=os}const{x:T,y:w}=CC(t),B=Qg().x(T).y(w).curve(b);let F;switch(t.thickness){case"normal":F="edge-thickness-normal";break;case"thick":F="edge-thickness-thick";break;case"invisible":F="edge-thickness-invisible";break;default:F="edge-thickness-normal"}switch(t.pattern){case"solid":F+=" edge-pattern-solid";break;case"dotted":F+=" edge-pattern-dotted";break;case"dashed":F+=" edge-pattern-dashed";break;default:F+=" edge-pattern-solid"}let L,v=C==="rounded"?jd(Xd(x,t),5):B(x);const R=Array.isArray(t.style)?t.style:[t.style];let N=R.find(Y=>Y?.startsWith("stroke:")),q="";t.animate&&(q="edge-animation-fast"),t.animation&&(q="edge-animation-"+t.animation);let J=!1;if(t.look==="handDrawn"){const Y=rt.svg(e);Object.assign([],x);const lt=Y.path(v,{roughness:.3,seed:h});F+=" transition",L=yt(lt).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+F+(t.classes?" "+t.classes:"")+(q?" "+q:"")).attr("style",R?R.reduce((Ct,Et)=>Ct+";"+Et,""):"");let at=L.attr("d");L.attr("d",at),e.node().appendChild(L.node())}else{const Y=m.join(";"),lt=R?R.reduce((xt,ht)=>xt+ht+";",""):"",at=(Y?Y+";"+lt+";":lt)+";"+(R?R.reduce((xt,ht)=>xt+";"+ht,""):"");L=e.append("path").attr("d",v).attr("id",`${a}-${t.id}`).attr("class"," "+F+(t.classes?" "+t.classes:"")+(q?" "+q:"")).attr("style",at),N=at.match(/stroke:([^;]+)/)?.[1],J=t.animate===!0||!!t.animation||Y.includes("animation");const Ct=L.node(),Et=typeof Ct.getTotalLength=="function"?Ct.getTotalLength():0,mt=Nn[t.arrowTypeStart]||0,Tt=Nn[t.arrowTypeEnd]||0;if(t.look==="neo"&&!J){const ht=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?EC(Et,mt,Tt):`0 ${mt} ${Et-mt-Tt} ${Tt}`}; stroke-dashoffset: 0;`;L.attr("style",ht+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",y),L.attr("data-look",Wt(t.look)),t.showPoints&&x.forEach(Y=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",Y.x).attr("cy",Y.y)});let W="";(Bt().flowchart.arrowMarkerAbsolute||Bt().state.arrowMarkerAbsolute)&&(W=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,W=W.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),M.info("arrowTypeStart",t.arrowTypeStart),M.info("arrowTypeEnd",t.arrowTypeEnd);const z=!J&&t?.look==="neo";xC(L,t,W,a,i,z,N);const V=Math.floor(l.length/2),I=l[V];Vt.isLabelCoordinateInPath(I,L.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=l),P.originalPath=t.points,P},"insertEdge");function jd(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],h=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,l=a.y-n.y,d=h.x-a.x,u=h.y-a.y,f=Math.hypot(c,l),m=Math.hypot(d,u);if(f<o||m<o){r+=`L${a.x},${a.y}`;continue}const y=c/f,x=l/f,C=d/m,b=u/m,T=y*C+x*b,w=Math.max(-1,Math.min(1,T)),B=Math.acos(w);if(B<o||Math.abs(Math.PI-B)<o){r+=`L${a.x},${a.y}`;continue}const F=Math.min(t/Math.sin(B/2),f/2,m/2),L=a.x-y*F,v=a.y-x*F,R=a.x+C*F,N=a.y+b*F;r+=`L${L},${v}`,r+=`Q${a.x},${a.y} ${R},${N}`}}return r}g(jd,"generateRoundedPath");function Ls(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}g(Ls,"calculateDeltaAndAngle");function Xd(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Gt[t.arrowTypeStart]){const o=Gt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=Ls(s,a),h=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+h,r[0].y=s.y+c}const i=e.length;if(i>=2&&Gt[t.arrowTypeEnd]){const o=Gt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=Ls(a,s),h=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-h,r[i-1].y=s.y-c}return r}g(Xd,"applyMarkerOffsetsToPoints");var AC=g((e,t,r,i)=>{t.forEach(o=>{JC[o](e,r,i)})},"insertMarkers"),_C=g((e,t,r)=>{M.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),MC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),IC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),OC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),$C=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),DC=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),PC=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),RC=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),qC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),NC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),WC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),zC=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),HC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),YC=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),jC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),XC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const h=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");h.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),h.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),UC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),GC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const h=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");h.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),h.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),VC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
264
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const h=e.height/2,c=Math.abs(t.y-r.y),l=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*h){let d=r.y<t.y?t.y-h-o:o-h-t.y;n=l*d/c;const u={x:r.x<t.x?r.x+n:r.x-l+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),l===0&&(u.x=t.x),c===0&&(u.y=t.y),M.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${l}, r ${n}`,u),u}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/l,u=r.x<t.x?r.x+l-n:r.x-l+n,f=r.y<t.y?r.y+d:r.y-d;return M.debug(`sides calc abc89, Q ${c}, q ${d}, R ${l}, r ${n}`,{_x:u,_y:f}),n===0&&(u=t.x,f=t.y),l===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),Nn=g((e,t)=>{M.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(M.info("abc88 checking point",s,t),!TC(t,s)&&!o){const a=wC(t,i,s);M.debug("abc88 inside",s,i,a),M.debug("abc88 intersection",a,t);let n=!1;r.forEach(h=>{n=n||h.x===a.x&&h.y===a.y}),r.some(h=>h.x===a.x&&h.y===a.y)?M.warn("abc88 no intersect",a,r):r.push(a),o=!0}else M.warn("abc88 outside",s,i),i=s,o||r.push(s)}),M.debug("returning points",r),r},"cutPathAtIntersect");function Wd(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(Wd,"extractCornerPoints");var Wn=g(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),BC=g(function(e){const{cornerPointPositions:t}=Wd(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=Wn(o,a,5),h=Wn(s,a,5),c=h.x-n.x,l=h.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){M.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const f=5;a.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:l<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:l<0?n.y-f+d:n.y+f-d}}else M.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(u,h)}else r.push(e[i]);return r},"fixCorners"),vC=g((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),h=Number.isFinite(n)?Math.max(0,n):0,c=Array(h).fill(`${o} ${s}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),zd=g(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:h,layout:c}=Bt();let l=t.points,d=!1;const u=o;var f=s;const m=[];for(const Y in t.cssCompiledStyles)Th(Y)||m.push(t.cssCompiledStyles[Y]);if(c==="swimlane"){if(f.intersect&&u.intersect&&Array.isArray(l)&&l.length>=2)if(l.length===2)l=[u.intersect(l[0]),f.intersect(l[1])];else{const Y=l.slice(1,-1),lt=Y[0],at=Y[Y.length-1],Ct=.5,Et=Math.abs(l[l.length-1].x-at.x)<Ct&&Math.abs(l[l.length-1].y-at.y)<Ct,mt=u.intersect(lt),Tt=Et?at:f.intersect(at),xt=Math.abs(Tt.x-at.x)<Ct&&Math.abs(Tt.y-at.y)<Ct,kt=Math.abs(mt.x-lt.x)<Ct&&Math.abs(mt.y-lt.y)<Ct?[]:[mt],Mt=xt?[]:[Tt];l=[...kt,...Y,...Mt]}l=SC(t,l)}else f.intersect&&u.intersect&&!n&&(l=l.slice(1,t.points.length-1),l.unshift(u.intersect(l[0])),l.push(f.intersect(l[l.length-1])));const y=btoa(JSON.stringify(l));t.toCluster&&(M.info("to cluster abc88",r.get(t.toCluster)),l=Nn(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(M.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(l,null,2)),l=Nn(l.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let x=l.filter(Y=>!Number.isNaN(Y.y));const C=xC(t.curve);C!=="rounded"&&(x=BC(x));let b=Mi;switch(C){case"linear":b=Mi;break;case"basis":b=is;break;case"cardinal":b=Ul;break;case"bumpX":b=Vl;break;case"bumpY":b=Gl;break;case"catmullRom":b=Xl;break;case"monotoneX":b=jl;break;case"monotoneY":b=Yl;break;case"natural":b=Hl;break;case"step":b=zl;break;case"stepAfter":b=Wl;break;case"stepBefore":b=Nl;break;case"rounded":b=Mi;break;default:b=is}const{x:T,y:w}=fC(t),B=Zg().x(T).y(w).curve(b);let F;switch(t.thickness){case"normal":F="edge-thickness-normal";break;case"thick":F="edge-thickness-thick";break;case"invisible":F="edge-thickness-invisible";break;default:F="edge-thickness-normal"}switch(t.pattern){case"solid":F+=" edge-pattern-solid";break;case"dotted":F+=" edge-pattern-dotted";break;case"dashed":F+=" edge-pattern-dashed";break;default:F+=" edge-pattern-solid"}let L,v=C==="rounded"?Hd(Yd(x,t),5):B(x);const R=Array.isArray(t.style)?t.style:[t.style];let N=R.find(Y=>Y?.startsWith("stroke:")),q="";t.animate&&(q="edge-animation-fast"),t.animation&&(q="edge-animation-"+t.animation);let J=!1;if(t.look==="handDrawn"){const Y=rt.svg(e);Object.assign([],x);const lt=Y.path(v,{roughness:.3,seed:h});F+=" transition",L=yt(lt).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+F+(t.classes?" "+t.classes:"")+(q?" "+q:"")).attr("style",R?R.reduce((Ct,Et)=>Ct+";"+Et,""):"");let at=L.attr("d");L.attr("d",at),e.node().appendChild(L.node())}else{const Y=m.join(";"),lt=R?R.reduce((xt,ht)=>xt+ht+";",""):"",at=(Y?Y+";"+lt+";":lt)+";"+(R?R.reduce((xt,ht)=>xt+";"+ht,""):"");L=e.append("path").attr("d",v).attr("id",`${a}-${t.id}`).attr("class"," "+F+(t.classes?" "+t.classes:"")+(q?" "+q:"")).attr("style",at),N=at.match(/stroke:([^;]+)/)?.[1],J=t.animate===!0||!!t.animation||Y.includes("animation");const Ct=L.node(),Et=typeof Ct.getTotalLength=="function"?Ct.getTotalLength():0,mt=Rn[t.arrowTypeStart]||0,Tt=Rn[t.arrowTypeEnd]||0;if(t.look==="neo"&&!J){const ht=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?vC(Et,mt,Tt):`0 ${mt} ${Et-mt-Tt} ${Tt}`}; stroke-dashoffset: 0;`;L.attr("style",ht+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",y),L.attr("data-look",Wt(t.look)),t.showPoints&&x.forEach(Y=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",Y.x).attr("cy",Y.y)});let W="";(Bt().flowchart.arrowMarkerAbsolute||Bt().state.arrowMarkerAbsolute)&&(W=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,W=W.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),M.info("arrowTypeStart",t.arrowTypeStart),M.info("arrowTypeEnd",t.arrowTypeEnd);const z=!J&&t?.look==="neo";mC(L,t,W,a,i,z,N);const V=Math.floor(l.length/2),I=l[V];Vt.isLabelCoordinateInPath(I,L.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=l),P.originalPath=t.points,P},"insertEdge");function Hd(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],h=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,l=a.y-n.y,d=h.x-a.x,u=h.y-a.y,f=Math.hypot(c,l),m=Math.hypot(d,u);if(f<o||m<o){r+=`L${a.x},${a.y}`;continue}const y=c/f,x=l/f,C=d/m,b=u/m,T=y*C+x*b,w=Math.max(-1,Math.min(1,T)),B=Math.acos(w);if(B<o||Math.abs(Math.PI-B)<o){r+=`L${a.x},${a.y}`;continue}const F=Math.min(t/Math.sin(B/2),f/2,m/2),L=a.x-y*F,v=a.y-x*F,R=a.x+C*F,N=a.y+b*F;r+=`L${L},${v}`,r+=`Q${a.x},${a.y} ${R},${N}`}}return r}g(Hd,"generateRoundedPath");function vs(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}g(vs,"calculateDeltaAndAngle");function Yd(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Gt[t.arrowTypeStart]){const o=Gt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=vs(s,a),h=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+h,r[0].y=s.y+c}const i=e.length;if(i>=2&&Gt[t.arrowTypeEnd]){const o=Gt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=vs(a,s),h=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-h,r[i-1].y=s.y-c}return r}g(Yd,"applyMarkerOffsetsToPoints");var LC=g((e,t,r,i)=>{t.forEach(o=>{KC[o](e,r,i)})},"insertMarkers"),FC=g((e,t,r)=>{M.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),EC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),AC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),_C=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),MC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),IC=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),OC=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),$C=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),DC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),PC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),RC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),qC=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),NC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),WC=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),zC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),HC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const h=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");h.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),h.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),YC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),jC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const h=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");h.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),h.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),XC=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
270
265
  L20,10
271
266
  M20,10
272
- L0,20`)},"requirement_arrow"),KC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
267
+ L0,20`)},"requirement_arrow"),UC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
273
268
  L20,10
274
269
  M20,10
275
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),ZC=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),QC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),JC={extension:_C,composition:MC,aggregation:IC,dependency:OC,lollipop:$C,point:DC,circle:PC,cross:RC,barb:qC,barbNeo:NC,only_one:WC,zero_or_one:zC,one_or_more:HC,zero_or_more:YC,only_one_neo:jC,zero_or_one_neo:XC,one_or_more_neo:UC,zero_or_more_neo:GC,requirement_arrow:VC,requirement_contains:ZC,requirement_arrow_neo:KC,requirement_contains_neo:QC},Ud=AC,tx="\0",Xe="\0",Yn="";class go{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=xi(void 0),this._defaultEdgeLabelFn=xi(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Xe]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Va(t)||(t=xi(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return gr(this._nodes)}sources(){var t=this;return bi(this.nodes(),function(r){return Ka(t._in[r])})}sinks(){var t=this;return bi(this.nodes(),function(r){return Ka(t._out[r])})}setNodes(t,r){var i=arguments,o=this;return He(t,function(s){i.length>1?o.setNode(s,r):o.setNode(s)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Xe,this._children[t]={},this._children[Xe][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],He(this.children(t),i=>{this.setParent(i)}),delete this._children[t]),He(gr(this._in[t]),r),delete this._in[t],delete this._preds[t],He(gr(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(yr(r))r=Xe;else{r+="";for(var i=r;!yr(i);i=this.parent(i))if(i===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==Xe)return r}}children(t){if(yr(t)&&(t=Xe),this._isCompound){var r=this._children[t];if(r)return gr(r)}else{if(t===Xe)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return gr(r)}successors(t){var r=this._sucs[t];if(r)return gr(r)}neighbors(t){var r=this.predecessors(t);if(r)return Jg(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;He(this._nodes,function(a,n){t(n)&&r.setNode(n,a)}),He(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,i.edge(a))});var o={};function s(a){var n=i.parent(a);return n===void 0||r.hasNode(n)?(o[a]=n,n):n in o?o[n]:s(n)}return this._isCompound&&He(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Va(t)||(t=xi(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Co(this._edgeObjs)}setPath(t,r){var i=this,o=arguments;return tp(t,function(s,a){return o.length>1?i.setEdge(s,a,r):i.setEdge(s,a),a}),this}setEdge(){var t,r,i,o,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,i=a.name,arguments.length===2&&(o=arguments[1],s=!0)):(t=a,r=arguments[1],i=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,r=""+r,yr(i)||(i=""+i);var n=ti(this._isDirected,t,r,i);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n))return s&&(this._edgeLabels[n]=o),this;if(!yr(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[n]=s?o:this._defaultEdgeLabelFn(t,r,i);var h=ex(this._isDirected,t,r,i);return t=h.v,r=h.w,Object.freeze(h),this._edgeObjs[n]=h,jn(this._preds[r],t),jn(this._sucs[t],r),this._in[r][n]=h,this._out[t][n]=h,this._edgeCount++,this}edge(t,r,i){var o=arguments.length===1?Ao(this._isDirected,arguments[0]):ti(this._isDirected,t,r,i);return this._edgeLabels[o]}hasEdge(t,r,i){var o=arguments.length===1?Ao(this._isDirected,arguments[0]):ti(this._isDirected,t,r,i);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,r,i){var o=arguments.length===1?Ao(this._isDirected,arguments[0]):ti(this._isDirected,t,r,i),s=this._edgeObjs[o];return s&&(t=s.v,r=s.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Xn(this._preds[r],t),Xn(this._sucs[t],r),delete this._in[r][o],delete this._out[t][o],this._edgeCount--),this}inEdges(t,r){var i=this._in[t];if(i){var o=Co(i);return r?bi(o,function(s){return s.v===r}):o}}outEdges(t,r){var i=this._out[t];if(i){var o=Co(i);return r?bi(o,function(s){return s.w===r}):o}}nodeEdges(t,r){var i=this.inEdges(t,r);if(i)return i.concat(this.outEdges(t,r))}}go.prototype._nodeCount=0;go.prototype._edgeCount=0;function jn(e,t){e[t]?e[t]++:e[t]=1}function Xn(e,t){--e[t]||delete e[t]}function ti(e,t,r,i){var o=""+t,s=""+r;if(!e&&o>s){var a=o;o=s,s=a}return o+Yn+s+Yn+(yr(i)?tx:i)}function ex(e,t,r,i){var o=""+t,s=""+r;if(!e&&o>s){var a=o;o=s,s=a}var n={v:o,w:s};return i&&(n.name=i),n}function Ao(e,t){return ti(e,t.v,t.w,t.name)}function Gd(e,{edgePathsClass:t="edges edgePaths"}={}){const r=e.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),o=r.insert("g").attr("class",t),s=r.insert("g").attr("class","edgeLabels"),a=r.insert("g").attr("class","nodes");return{clusters:i,edgePaths:o,edgeLabels:s,nodes:a,rootGroups:r}}g(Gd,"createLayoutElementGroups");async function Vd(e,t){if(t.label){const{shapeSvg:r,bbox:i}=await ct(e,t);t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}g(Vd,"measureGroupLabel");async function Kd(e,t,r){const i=await Ca(e,t,r),o=i.node()?.getBBox()??{width:0,height:0};return t.width=o.width,t.height=o.height,i}g(Kd,"insertMeasuredNode");async function Zd(e,t){const r=new go({multigraph:!0,compound:!0}),i=[...t.edges],o=Bt(),s=Gd(e),{edgeLabels:a,nodes:n}=s,h=new Map,c=e.node()!=null;await Promise.all(t.nodes.map(async l=>{if(l.isGroup)c&&await Vd(n,l),r.setNode(l.id,{...l});else{if(c){const d=await Kd(n,l,{config:o,dir:l.dir});h.set(l.id,d)}r.setNode(l.id,{...l})}}));for(const l of i)c&&zd(l)&&await xa(a,l),r.setEdge(l.start,l.end,{...l},l.id),t.edges.some(u=>u.id===l.id)||t.edges.push(l);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:l}=await bt(async()=>{const{captureNodeSizes:d}=await import("./sizeCapture-INFHLROL-BW7unDBA.js");return{captureNodeSizes:d}},[],import.meta.url);l(e,t)}return{graph:r,groups:s,nodeElements:h}}g(Zd,"createGraphWithElements");var Lt=new Map,Ge=new Map,Qd=new Map,rx=g(()=>{Ge.clear(),Qd.clear(),Lt.clear()},"clear"),li=g((e,t)=>{const r=Ge.get(t)||[];return M.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),ix=g((e,t)=>{const r=Ge.get(t)||[];return M.info("Descendants of ",t," is ",r),M.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||li(e.v,t)||li(e.w,t)||r.includes(e.w):(M.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Jd=g((e,t,r,i)=>{M.debug("Copying children of ",e,"root",i,"data",t.node(e),i);const o=t.children(e)||[];e!==i&&o.push(e),M.debug("Copying (nodes) clusterId",e,"nodes",o),o.forEach(s=>{if(t.children(s).length>0)Jd(s,t,r,i);else{const a=t.node(s);M.info("cp ",s," to ",i," with parent ",e),r.setNode(s,a),i!==t.parent(s)&&(M.debug("Setting parent",s,t.parent(s)),r.setParent(s,t.parent(s))),e!==i&&s!==e?(M.debug("Setting parent",s,e),r.setParent(s,e)):(M.info("In copy ",e,"root",i,"data",t.node(e),i),M.debug("Not Setting parent for node=",s,"cluster!==rootId",e!==i,"node!==clusterId",s!==e));const n=t.edges(s);M.debug("Copying Edges",n),n.forEach(h=>{M.info("Edge",h);const c=t.edge(h.v,h.w,h.name);M.info("Edge data",c,i);try{ix(h,i)?(M.info("Copying as ",h.v,h.w,c,h.name),r.setEdge(h.v,h.w,c,h.name),M.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):M.info("Skipping copy of edge ",h.v,"-->",h.w," rootId: ",i," clusterId:",e)}catch(l){M.error(l)}})}M.debug("Removing node",s),t.removeNode(s)})},"copy"),tu=g((e,t)=>{const r=t.children(e);let i=[...r];for(const o of r)Qd.set(o,e),i=[...i,...tu(o,t)];return i},"extractDescendants"),ox=g((e,t,r)=>{const i=e.edges().filter(h=>h.v===t||h.w===t),o=e.edges().filter(h=>h.v===r||h.w===r),s=i.map(h=>({v:h.v===t?r:h.v,w:h.w===t?t:h.w})),a=o.map(h=>({v:h.v,w:h.w}));return s.filter(h=>a.some(c=>h.v===c.v&&h.w===c.w))},"findCommonEdges"),Ji=g((e,t,r)=>{const i=t.children(e);if(M.trace("Searching children of id ",e,i),i.length<1)return e;let o;for(const s of i){const a=Ji(s,t,r),n=ox(t,r,a);if(a)if(n.length>0)o=a;else return a}return o},"findNonClusterChild"),Un=g(e=>!Lt.has(e)||!Lt.get(e).externalConnections?e:Lt.has(e)?Lt.get(e).id:e,"getAnchorId"),w2=g((e,t)=>{if(!e||t>10){M.debug("Opting out, no graph ");return}else M.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(M.debug("Cluster identified",r," Replacement id in edges: ",Ji(r,e,r)),Ge.set(r,tu(r,e)),Lt.set(r,{id:Ji(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const i=e.children(r),o=e.edges();i.length>0?(M.debug("Cluster identified",r,Ge),o.forEach(s=>{const a=li(s.v,r),n=li(s.w,r);a^n&&(M.debug("Edge: ",s," leaves cluster ",r),M.debug("Descendants of XXX ",r,": ",Ge.get(r)),Lt.get(r).externalConnections=!0)})):M.debug("Not a cluster ",r,Ge)});for(let r of Lt.keys()){const i=Lt.get(r).id,o=e.parent(i);o!==r&&Lt.has(o)&&!Lt.get(o).externalConnections&&(Lt.get(r).id=o);const s=e.edges().some(a=>a.v===r);if(i&&Lt.get(r)?.externalConnections&&s&&iu(e,i,r)){const a=sx(e,r,e.parent(i));a&&(Lt.get(r).id=a)}}e.edges().forEach(function(r){const i=e.edge(r);M.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),M.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let o=r.v,s=r.w;if(M.debug("Fix XXX",Lt,"ids:",r.v,r.w,"Translating: ",Lt.get(r.v)," --- ",Lt.get(r.w)),Lt.get(r.v)||Lt.get(r.w)){if(M.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),o=Un(r.v),s=Un(r.w),e.removeEdge(r.v,r.w,r.name),o!==r.v){const a=e.parent(o);Lt.get(a).externalConnections=!0,i.fromCluster=r.v}if(s!==r.w){const a=e.parent(s);Lt.get(a).externalConnections=!0,i.toCluster=r.w}M.debug("Fix Replacing with XXX",o,s,r.name),e.setEdge(o,s,i,r.name)}}),eu(e,0),M.trace(Lt)},"adjustClustersAndEdges"),eu=g((e,t)=>{if(t>10){M.error("Bailing out");return}let r=e.nodes(),i=!1;for(const o of r){const s=e.children(o);i=i||s.length>0}if(!i){M.debug("Done, no node has children",e.nodes());return}M.debug("Nodes = ",r,t);for(const o of r)if(M.debug("Extracting node",o,Lt,Lt.has(o)&&!Lt.get(o).externalConnections,!e.parent(o),e.node(o),e.children("D")," Depth ",t),!Lt.has(o))M.debug("Not a cluster",o,t);else if(!Lt.get(o).externalConnections&&e.children(o)&&e.children(o).length>0){M.debug("Cluster without external connections, without a parent and with children",o,t);let a=e.graph().rankdir==="TB"?"LR":"TB";Lt.get(o)?.clusterData?.dir&&(a=Lt.get(o).clusterData.dir,M.debug("Fixing dir",Lt.get(o).clusterData.dir,a));const n=new go({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Jd(o,e,n,o),e.setNode(o,{clusterNode:!0,id:o,clusterData:Lt.get(o).clusterData,label:Lt.get(o).label,graph:n})}else M.debug("Cluster ** ",o," **not meeting the criteria !externalConnections:",!Lt.get(o).externalConnections," no parent: ",!e.parent(o)," children ",e.children(o)&&e.children(o).length>0,e.children("D"),t),M.debug(Lt);r=e.nodes(),M.debug("New list of nodes",r);for(const o of r){const s=e.node(o);M.debug(" Now next level",o,s),s?.clusterNode&&eu(s.graph,t+1)}},"extractor"),ru=g((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(i=>{const o=e.children(i),s=ru(e,o);r=[...r,...s]}),r},"sorter"),B2=g(e=>ru(e,e.children()),"sortNodesByHierarchy"),iu=g((e,t,r)=>{let i=e.parent(t);for(;i&&i!==r;){const o=Lt.get(i);if(o&&!o.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),sx=g((e,t,r)=>{const i=e.children(t)??[];for(const o of i){if(o===r||li(o,r))continue;const s=Ji(o,e,t);if(s&&!iu(e,s,t))return s}return null},"findSafeAnchorNode");function ax({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:i,afterPaint:o,paintOptions:s}){const a=t??su;return g(async function(h,c,l,d){const u=c.select("g");(l?.insertMarkers??Ud)(u,h.markers,h.type,h.diagramId),ou();const f={element:u,helpers:l,options:d};f.preparedLayout=await e?.(h,f);const m=await a(h,f),y=await r(h,f),x={...f,measure:m};i?await i(h,x,y):await au(h,x,s),await o?.(h,x,y)},"render")}g(ax,"createCommonLayoutRenderer");function ou(){hC(),TC(),yC(),rx()}g(ou,"clearLayoutRenderState");async function su(e,{element:t}){return await Zd(t,e)}g(su,"defaultMeasureLayout");async function au(e,t,r={}){const{measure:i}=t,{groups:o}=i;for(const a of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(a,t)||await nu(o,a,t,r);const s=hu(e.nodes);for(const a of e.edges)cu(a,r)||await du(o,a,s,e,r,t)}g(au,"paintLayoutData");async function nu(e,t,r,i){t.clusterNode?qn(t):lu(t,r,i)?await Wd(e.clusters,t):qn(t)}g(nu,"paintLayoutNode");function lu(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}g(lu,"shouldPaintAsCluster");function hu(e){const t=new Map;for(const r of e)r?.id&&t.set(r.id,r);return t}g(hu,"buildNodeLookup");function cu(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}g(cu,"shouldSkipPaintEdge");async function du(e,t,r,i,o,s){const a=Yd(e.edgePaths,{...t},o.clusterDb??new Map,i.type,Fs(t.start,t,r,s,o),Fs(t.end,t,r,s,o),i.diagramId,uu(t,o));zd(t)&&(Br.has(t.id)||await xa(e.edgeLabels,t),gu(t,a))}g(du,"paintLayoutEdge");function Fs(e,t,r,i,o){return o.getEdgeNode?.(e,t,i)??(e?r.get(e)??{}:{})}g(Fs,"getRenderedNode");function uu(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}g(uu,"shouldSkipIntersect");function gu(e,t){const r=t?.updatedPath??t?.originalPath,i=Dt(),{subGraphTitleTotalMargin:o}=co({flowchart:i.flowchart??{}});if(e.label){const s=Br.get(e.id);let a=e.x,n=e.y;if(r){const h=Vt.calcLabelPosition(r);M.debug("Moving label "+e.label+" from (",a,",",n,") to (",h.x,",",h.y,") abc88"),t?.updatedPath&&(a=h.x,n=h.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e?.startLabelLeft){const s=Rt.get(e.id).startLeft;let a=e?.x,n=e?.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Rt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Rt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Rt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}}g(gu,"positionRenderedEdgeLabel");function pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(pu,"getDefaultExportFromCjs");var Ut={},Ai={},De={},Gn;function _r(){if(Gn)return De;Gn=1;function e(a){return typeof a>"u"||a===null}g(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}g(t,"isObject");function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}g(r,"toArray");function i(a,n){if(n){const h=Object.keys(n);for(let c=0,l=h.length;c<l;c+=1){const d=h[c];a[d]=n[d]}}return a}g(i,"extend");function o(a,n){let h="";for(let c=0;c<n;c+=1)h+=a;return h}g(o,"repeat");function s(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return g(s,"isNegativeZero"),De.isNothing=e,De.isObject=t,De.toArray=r,De.repeat=o,De.isNegativeZero=s,De.extend=i,De}g(_r,"requireCommon");var _o,Vn;function Mr(){if(Vn)return _o;Vn=1;function e(r,i){let o="";const s=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(o+='in "'+r.mark.name+'" '),o+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(o+=`
270
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),GC=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),VC=g((e,t,r)=>{const i=Dt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),KC={extension:FC,composition:EC,aggregation:AC,dependency:_C,lollipop:MC,point:IC,circle:OC,cross:$C,barb:DC,barbNeo:PC,only_one:RC,zero_or_one:qC,one_or_more:NC,zero_or_more:WC,only_one_neo:zC,zero_or_one_neo:HC,one_or_more_neo:YC,zero_or_more_neo:jC,requirement_arrow:XC,requirement_contains:GC,requirement_arrow_neo:UC,requirement_contains_neo:VC},jd=LC,ZC="\0",Xe="\0",zn="";class uo{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Ci(void 0),this._defaultEdgeLabelFn=Ci(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Xe]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Ga(t)||(t=Ci(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return gr(this._nodes)}sources(){var t=this;return xi(this.nodes(),function(r){return Va(t._in[r])})}sinks(){var t=this;return xi(this.nodes(),function(r){return Va(t._out[r])})}setNodes(t,r){var i=arguments,o=this;return He(t,function(s){i.length>1?o.setNode(s,r):o.setNode(s)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Xe,this._children[t]={},this._children[Xe][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],He(this.children(t),i=>{this.setParent(i)}),delete this._children[t]),He(gr(this._in[t]),r),delete this._in[t],delete this._preds[t],He(gr(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(yr(r))r=Xe;else{r+="";for(var i=r;!yr(i);i=this.parent(i))if(i===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==Xe)return r}}children(t){if(yr(t)&&(t=Xe),this._isCompound){var r=this._children[t];if(r)return gr(r)}else{if(t===Xe)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return gr(r)}successors(t){var r=this._sucs[t];if(r)return gr(r)}neighbors(t){var r=this.predecessors(t);if(r)return Qg(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;He(this._nodes,function(a,n){t(n)&&r.setNode(n,a)}),He(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,i.edge(a))});var o={};function s(a){var n=i.parent(a);return n===void 0||r.hasNode(n)?(o[a]=n,n):n in o?o[n]:s(n)}return this._isCompound&&He(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Ga(t)||(t=Ci(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return yo(this._edgeObjs)}setPath(t,r){var i=this,o=arguments;return Jg(t,function(s,a){return o.length>1?i.setEdge(s,a,r):i.setEdge(s,a),a}),this}setEdge(){var t,r,i,o,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,i=a.name,arguments.length===2&&(o=arguments[1],s=!0)):(t=a,r=arguments[1],i=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,r=""+r,yr(i)||(i=""+i);var n=Jr(this._isDirected,t,r,i);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n))return s&&(this._edgeLabels[n]=o),this;if(!yr(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[n]=s?o:this._defaultEdgeLabelFn(t,r,i);var h=QC(this._isDirected,t,r,i);return t=h.v,r=h.w,Object.freeze(h),this._edgeObjs[n]=h,Hn(this._preds[r],t),Hn(this._sucs[t],r),this._in[r][n]=h,this._out[t][n]=h,this._edgeCount++,this}edge(t,r,i){var o=arguments.length===1?Eo(this._isDirected,arguments[0]):Jr(this._isDirected,t,r,i);return this._edgeLabels[o]}hasEdge(t,r,i){var o=arguments.length===1?Eo(this._isDirected,arguments[0]):Jr(this._isDirected,t,r,i);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,r,i){var o=arguments.length===1?Eo(this._isDirected,arguments[0]):Jr(this._isDirected,t,r,i),s=this._edgeObjs[o];return s&&(t=s.v,r=s.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Yn(this._preds[r],t),Yn(this._sucs[t],r),delete this._in[r][o],delete this._out[t][o],this._edgeCount--),this}inEdges(t,r){var i=this._in[t];if(i){var o=yo(i);return r?xi(o,function(s){return s.v===r}):o}}outEdges(t,r){var i=this._out[t];if(i){var o=yo(i);return r?xi(o,function(s){return s.w===r}):o}}nodeEdges(t,r){var i=this.inEdges(t,r);if(i)return i.concat(this.outEdges(t,r))}}uo.prototype._nodeCount=0;uo.prototype._edgeCount=0;function Hn(e,t){e[t]?e[t]++:e[t]=1}function Yn(e,t){--e[t]||delete e[t]}function Jr(e,t,r,i){var o=""+t,s=""+r;if(!e&&o>s){var a=o;o=s,s=a}return o+zn+s+zn+(yr(i)?ZC:i)}function QC(e,t,r,i){var o=""+t,s=""+r;if(!e&&o>s){var a=o;o=s,s=a}var n={v:o,w:s};return i&&(n.name=i),n}function Eo(e,t){return Jr(e,t.v,t.w,t.name)}function Xd(e,{edgePathsClass:t="edges edgePaths"}={}){const r=e.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),o=r.insert("g").attr("class",t),s=r.insert("g").attr("class","edgeLabels"),a=r.insert("g").attr("class","nodes");return{clusters:i,edgePaths:o,edgeLabels:s,nodes:a,rootGroups:r}}g(Xd,"createLayoutElementGroups");async function Ud(e,t){if(t.label){const{shapeSvg:r,bbox:i}=await ct(e,t);t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}g(Ud,"measureGroupLabel");async function Gd(e,t,r){const i=await ya(e,t,r),o=i.node()?.getBBox()??{width:0,height:0};return t.width=o.width,t.height=o.height,i}g(Gd,"insertMeasuredNode");async function Vd(e,t){const r=new uo({multigraph:!0,compound:!0}),i=[...t.edges],o=Bt(),s=Xd(e),{edgeLabels:a,nodes:n}=s,h=new Map,c=e.node()!=null;await Promise.all(t.nodes.map(async l=>{if(l.isGroup)c&&await Ud(n,l),r.setNode(l.id,{...l});else{if(c){const d=await Gd(n,l,{config:o,dir:l.dir});h.set(l.id,d)}r.setNode(l.id,{...l})}}));for(const l of i)c&&Nd(l)&&await Ca(a,l),r.setEdge(l.start,l.end,{...l},l.id),t.edges.some(u=>u.id===l.id)||t.edges.push(l);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:l}=await bt(async()=>{const{captureNodeSizes:d}=await import("./sizeCapture-INFHLROL-C_M5Nl06.js");return{captureNodeSizes:d}},[],import.meta.url);l(e,t)}return{graph:r,groups:s,nodeElements:h}}g(Vd,"createGraphWithElements");var Lt=new Map,Ge=new Map,Kd=new Map,JC=g(()=>{Ge.clear(),Kd.clear(),Lt.clear()},"clear"),ni=g((e,t)=>{const r=Ge.get(t)||[];return M.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),tx=g((e,t)=>{const r=Ge.get(t)||[];return M.info("Descendants of ",t," is ",r),M.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||ni(e.v,t)||ni(e.w,t)||r.includes(e.w):(M.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Zd=g((e,t,r,i)=>{M.debug("Copying children of ",e,"root",i,"data",t.node(e),i);const o=t.children(e)||[];e!==i&&o.push(e),M.debug("Copying (nodes) clusterId",e,"nodes",o),o.forEach(s=>{if(t.children(s).length>0)Zd(s,t,r,i);else{const a=t.node(s);M.info("cp ",s," to ",i," with parent ",e),r.setNode(s,a),i!==t.parent(s)&&(M.debug("Setting parent",s,t.parent(s)),r.setParent(s,t.parent(s))),e!==i&&s!==e?(M.debug("Setting parent",s,e),r.setParent(s,e)):(M.info("In copy ",e,"root",i,"data",t.node(e),i),M.debug("Not Setting parent for node=",s,"cluster!==rootId",e!==i,"node!==clusterId",s!==e));const n=t.edges(s);M.debug("Copying Edges",n),n.forEach(h=>{M.info("Edge",h);const c=t.edge(h.v,h.w,h.name);M.info("Edge data",c,i);try{tx(h,i)?(M.info("Copying as ",h.v,h.w,c,h.name),r.setEdge(h.v,h.w,c,h.name),M.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):M.info("Skipping copy of edge ",h.v,"-->",h.w," rootId: ",i," clusterId:",e)}catch(l){M.error(l)}})}M.debug("Removing node",s),t.removeNode(s)})},"copy"),Qd=g((e,t)=>{const r=t.children(e);let i=[...r];for(const o of r)Kd.set(o,e),i=[...i,...Qd(o,t)];return i},"extractDescendants"),ex=g((e,t,r)=>{const i=e.edges().filter(h=>h.v===t||h.w===t),o=e.edges().filter(h=>h.v===r||h.w===r),s=i.map(h=>({v:h.v===t?r:h.v,w:h.w===t?t:h.w})),a=o.map(h=>({v:h.v,w:h.w}));return s.filter(h=>a.some(c=>h.v===c.v&&h.w===c.w))},"findCommonEdges"),Qi=g((e,t,r)=>{const i=t.children(e);if(M.trace("Searching children of id ",e,i),i.length<1)return e;let o;for(const s of i){const a=Qi(s,t,r),n=ex(t,r,a);if(a)if(n.length>0)o=a;else return a}return o},"findNonClusterChild"),jn=g(e=>!Lt.has(e)||!Lt.get(e).externalConnections?e:Lt.has(e)?Lt.get(e).id:e,"getAnchorId"),S2=g((e,t)=>{if(!e||t>10){M.debug("Opting out, no graph ");return}else M.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(M.debug("Cluster identified",r," Replacement id in edges: ",Qi(r,e,r)),Ge.set(r,Qd(r,e)),Lt.set(r,{id:Qi(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const i=e.children(r),o=e.edges();i.length>0?(M.debug("Cluster identified",r,Ge),o.forEach(s=>{const a=ni(s.v,r),n=ni(s.w,r);a^n&&(M.debug("Edge: ",s," leaves cluster ",r),M.debug("Descendants of XXX ",r,": ",Ge.get(r)),Lt.get(r).externalConnections=!0)})):M.debug("Not a cluster ",r,Ge)});for(let r of Lt.keys()){const i=Lt.get(r).id,o=e.parent(i);o!==r&&Lt.has(o)&&!Lt.get(o).externalConnections&&(Lt.get(r).id=o);const s=e.edges().some(a=>a.v===r);if(i&&Lt.get(r)?.externalConnections&&s&&eu(e,i,r)){const a=rx(e,r,e.parent(i));a&&(Lt.get(r).id=a)}}e.edges().forEach(function(r){const i=e.edge(r);M.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),M.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let o=r.v,s=r.w;if(M.debug("Fix XXX",Lt,"ids:",r.v,r.w,"Translating: ",Lt.get(r.v)," --- ",Lt.get(r.w)),Lt.get(r.v)||Lt.get(r.w)){if(M.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),o=jn(r.v),s=jn(r.w),e.removeEdge(r.v,r.w,r.name),o!==r.v){const a=e.parent(o);Lt.get(a).externalConnections=!0,i.fromCluster=r.v}if(s!==r.w){const a=e.parent(s);Lt.get(a).externalConnections=!0,i.toCluster=r.w}M.debug("Fix Replacing with XXX",o,s,r.name),e.setEdge(o,s,i,r.name)}}),Jd(e,0),M.trace(Lt)},"adjustClustersAndEdges"),Jd=g((e,t)=>{if(t>10){M.error("Bailing out");return}let r=e.nodes(),i=!1;for(const o of r){const s=e.children(o);i=i||s.length>0}if(!i){M.debug("Done, no node has children",e.nodes());return}M.debug("Nodes = ",r,t);for(const o of r)if(M.debug("Extracting node",o,Lt,Lt.has(o)&&!Lt.get(o).externalConnections,!e.parent(o),e.node(o),e.children("D")," Depth ",t),!Lt.has(o))M.debug("Not a cluster",o,t);else if(!Lt.get(o).externalConnections&&e.children(o)&&e.children(o).length>0){M.debug("Cluster without external connections, without a parent and with children",o,t);let a=e.graph().rankdir==="TB"?"LR":"TB";Lt.get(o)?.clusterData?.dir&&(a=Lt.get(o).clusterData.dir,M.debug("Fixing dir",Lt.get(o).clusterData.dir,a));const n=new uo({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Zd(o,e,n,o),e.setNode(o,{clusterNode:!0,id:o,clusterData:Lt.get(o).clusterData,label:Lt.get(o).label,graph:n})}else M.debug("Cluster ** ",o," **not meeting the criteria !externalConnections:",!Lt.get(o).externalConnections," no parent: ",!e.parent(o)," children ",e.children(o)&&e.children(o).length>0,e.children("D"),t),M.debug(Lt);r=e.nodes(),M.debug("New list of nodes",r);for(const o of r){const s=e.node(o);M.debug(" Now next level",o,s),s?.clusterNode&&Jd(s.graph,t+1)}},"extractor"),tu=g((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(i=>{const o=e.children(i),s=tu(e,o);r=[...r,...s]}),r},"sorter"),T2=g(e=>tu(e,e.children()),"sortNodesByHierarchy"),eu=g((e,t,r)=>{let i=e.parent(t);for(;i&&i!==r;){const o=Lt.get(i);if(o&&!o.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),rx=g((e,t,r)=>{const i=e.children(t)??[];for(const o of i){if(o===r||ni(o,r))continue;const s=Qi(o,e,t);if(s&&!eu(e,s,t))return s}return null},"findSafeAnchorNode");function ix({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:i,afterPaint:o,paintOptions:s}){const a=t??iu;return g(async function(h,c,l,d){const u=c.select("g");(l?.insertMarkers??jd)(u,h.markers,h.type,h.diagramId),ru();const f={element:u,helpers:l,options:d};f.preparedLayout=await e?.(h,f);const m=await a(h,f),y=await r(h,f),x={...f,measure:m};i?await i(h,x,y):await ou(h,x,s),await o?.(h,x,y)},"render")}g(ix,"createCommonLayoutRenderer");function ru(){aC(),bC(),pC(),JC()}g(ru,"clearLayoutRenderState");async function iu(e,{element:t}){return await Vd(t,e)}g(iu,"defaultMeasureLayout");async function ou(e,t,r={}){const{measure:i}=t,{groups:o}=i;for(const a of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(a,t)||await su(o,a,t,r);const s=nu(e.nodes);for(const a of e.edges)lu(a,r)||await hu(o,a,s,e,r,t)}g(ou,"paintLayoutData");async function su(e,t,r,i){t.clusterNode?Pn(t):au(t,r,i)?await qd(e.clusters,t):Pn(t)}g(su,"paintLayoutNode");function au(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}g(au,"shouldPaintAsCluster");function nu(e){const t=new Map;for(const r of e)r?.id&&t.set(r.id,r);return t}g(nu,"buildNodeLookup");function lu(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}g(lu,"shouldSkipPaintEdge");async function hu(e,t,r,i,o,s){const a=zd(e.edgePaths,{...t},o.clusterDb??new Map,i.type,Ls(t.start,t,r,s,o),Ls(t.end,t,r,s,o),i.diagramId,cu(t,o));Nd(t)&&(Br.has(t.id)||await Ca(e.edgeLabels,t),du(t,a))}g(hu,"paintLayoutEdge");function Ls(e,t,r,i,o){return o.getEdgeNode?.(e,t,i)??(e?r.get(e)??{}:{})}g(Ls,"getRenderedNode");function cu(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}g(cu,"shouldSkipIntersect");function du(e,t){const r=t?.updatedPath??t?.originalPath,i=Dt(),{subGraphTitleTotalMargin:o}=ho({flowchart:i.flowchart??{}});if(e.label){const s=Br.get(e.id);let a=e.x,n=e.y;if(r){const h=Vt.calcLabelPosition(r);M.debug("Moving label "+e.label+" from (",a,",",n,") to (",h.x,",",h.y,") abc88"),t?.updatedPath&&(a=h.x,n=h.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e?.startLabelLeft){const s=Rt.get(e.id).startLeft;let a=e?.x,n=e?.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Rt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Rt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Rt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const h=Vt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=h.x,n=h.y}s.attr("transform",`translate(${a}, ${n})`)}}g(du,"positionRenderedEdgeLabel");function uu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(uu,"getDefaultExportFromCjs");var Ut={},Ei={},De={},Xn;function _r(){if(Xn)return De;Xn=1;function e(a){return typeof a>"u"||a===null}g(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}g(t,"isObject");function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}g(r,"toArray");function i(a,n){if(n){const h=Object.keys(n);for(let c=0,l=h.length;c<l;c+=1){const d=h[c];a[d]=n[d]}}return a}g(i,"extend");function o(a,n){let h="";for(let c=0;c<n;c+=1)h+=a;return h}g(o,"repeat");function s(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return g(s,"isNegativeZero"),De.isNothing=e,De.isObject=t,De.toArray=r,De.repeat=o,De.isNegativeZero=s,De.extend=i,De}g(_r,"requireCommon");var Ao,Un;function Mr(){if(Un)return Ao;Un=1;function e(r,i){let o="";const s=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(o+='in "'+r.mark.name+'" '),o+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(o+=`
276
271
 
277
- `+r.mark.snippet),s+" "+o):s}g(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return g(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=g(function(i){return this.name+": "+e(this,i)},"toString"),_o=t,_o}g(Mr,"requireException");var Mo,Kn;function fu(){if(Kn)return Mo;Kn=1;const e=_r();function t(o,s,a,n,h){let c="",l="";const d=Math.floor(h/2)-1;return n-s>d&&(c=" ... ",s=n-d+c.length),a-n>d&&(l=" ...",a=n+d-l.length),{str:c+o.slice(s,a).replace(/\t/g,"→")+l,pos:n-s+c.length}}g(t,"getLine");function r(o,s){return e.repeat(" ",s-o.length)+o}g(r,"padStart");function i(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);const a=/\r?\n|\r|\0/g,n=[0],h=[];let c,l=-1;for(;c=a.exec(o.buffer);)h.push(c.index),n.push(c.index+c[0].length),o.position<=c.index&&l<0&&(l=n.length-2);l<0&&(l=n.length-1);let d="";const u=Math.min(o.line+s.linesAfter,h.length).toString().length,f=s.maxLength-(s.indent+u+3);for(let y=1;y<=s.linesBefore&&!(l-y<0);y++){const x=t(o.buffer,n[l-y],h[l-y],o.position-(n[l]-n[l-y]),f);d=e.repeat(" ",s.indent)+r((o.line-y+1).toString(),u)+" | "+x.str+`
272
+ `+r.mark.snippet),s+" "+o):s}g(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return g(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=g(function(i){return this.name+": "+e(this,i)},"toString"),Ao=t,Ao}g(Mr,"requireException");var _o,Gn;function gu(){if(Gn)return _o;Gn=1;const e=_r();function t(o,s,a,n,h){let c="",l="";const d=Math.floor(h/2)-1;return n-s>d&&(c=" ... ",s=n-d+c.length),a-n>d&&(l=" ...",a=n+d-l.length),{str:c+o.slice(s,a).replace(/\t/g,"→")+l,pos:n-s+c.length}}g(t,"getLine");function r(o,s){return e.repeat(" ",s-o.length)+o}g(r,"padStart");function i(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);const a=/\r?\n|\r|\0/g,n=[0],h=[];let c,l=-1;for(;c=a.exec(o.buffer);)h.push(c.index),n.push(c.index+c[0].length),o.position<=c.index&&l<0&&(l=n.length-2);l<0&&(l=n.length-1);let d="";const u=Math.min(o.line+s.linesAfter,h.length).toString().length,f=s.maxLength-(s.indent+u+3);for(let y=1;y<=s.linesBefore&&!(l-y<0);y++){const x=t(o.buffer,n[l-y],h[l-y],o.position-(n[l]-n[l-y]),f);d=e.repeat(" ",s.indent)+r((o.line-y+1).toString(),u)+" | "+x.str+`
278
273
  `+d}const m=t(o.buffer,n[l],h[l],o.position,f);d+=e.repeat(" ",s.indent)+r((o.line+1).toString(),u)+" | "+m.str+`
279
274
  `,d+=e.repeat("-",s.indent+u+3+m.pos)+`^
280
275
  `;for(let y=1;y<=s.linesAfter&&!(l+y>=h.length);y++){const x=t(o.buffer,n[l+y],h[l+y],o.position-(n[l]-n[l+y]),f);d+=e.repeat(" ",s.indent)+r((o.line+y+1).toString(),u)+" | "+x.str+`
281
- `}return d.replace(/\n$/,"")}return g(i,"makeSnippet"),Mo=i,Mo}g(fu,"requireSnippet");var Io,Zn;function Zt(){if(Zn)return Io;Zn=1;const e=Mr(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(s){const a={};return s!==null&&Object.keys(s).forEach(function(n){s[n].forEach(function(h){a[String(h)]=n})}),a}g(i,"compileStyleAliases");function o(s,a){if(a=a||{},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e('Unknown option "'+n+'" is met in definition of "'+s+'" YAML type.')}),this.options=a,this.tag=s,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(n){return n},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=i(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return g(o,"Type2"),Io=o,Io}g(Zt,"requireType");var Oo,Qn;function ba(){if(Qn)return Oo;Qn=1;const e=Mr(),t=Zt();function r(s,a){const n=[];return s[a].forEach(function(h){let c=n.length;n.forEach(function(l,d){l.tag===h.tag&&l.kind===h.kind&&l.multi===h.multi&&(c=d)}),n[c]=h}),n}g(r,"compileList");function i(){const s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(n){n.multi?(s.multi[n.kind].push(n),s.multi.fallback.push(n)):s[n.kind][n.tag]=s.fallback[n.tag]=n}g(a,"collectType");for(let n=0,h=arguments.length;n<h;n+=1)arguments[n].forEach(a);return s}g(i,"compileMap");function o(s){return this.extend(s)}return g(o,"Schema2"),o.prototype.extend=g(function(a){let n=[],h=[];if(a instanceof t)h.push(a);else if(Array.isArray(a))h=h.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(n=n.concat(a.implicit)),a.explicit&&(h=h.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),h.forEach(function(l){if(!(l instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(o.prototype);return c.implicit=(this.implicit||[]).concat(n),c.explicit=(this.explicit||[]).concat(h),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=i(c.compiledImplicit,c.compiledExplicit),c},"extend"),Oo=o,Oo}g(ba,"requireSchema");var $o,Jn;function ka(){if(Jn)return $o;Jn=1;const e=Zt();return $o=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(t){return t!==null?t:""},"construct")}),$o}g(ka,"requireStr");var Do,tl;function Sa(){if(tl)return Do;tl=1;const e=Zt();return Do=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(t){return t!==null?t:[]},"construct")}),Do}g(Sa,"requireSeq");var Po,el;function Ta(){if(el)return Po;el=1;const e=Zt();return Po=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(t){return t!==null?t:{}},"construct")}),Po}g(Ta,"requireMap");var Ro,rl;function wa(){if(rl)return Ro;rl=1;const e=ba();return Ro=new e({explicit:[ka(),Sa(),Ta()]}),Ro}g(wa,"requireFailsafe");var qo,il;function Ba(){if(il)return qo;il=1;const e=Zt();function t(o){if(o===null)return!0;const s=o.length;return s===1&&o==="~"||s===4&&(o==="null"||o==="Null"||o==="NULL")}g(t,"resolveYamlNull");function r(){return null}g(r,"constructYamlNull");function i(o){return o===null}return g(i,"isNull"),qo=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:g(function(){return"~"},"canonical"),lowercase:g(function(){return"null"},"lowercase"),uppercase:g(function(){return"NULL"},"uppercase"),camelcase:g(function(){return"Null"},"camelcase"),empty:g(function(){return""},"empty")},defaultStyle:"lowercase"}),qo}g(Ba,"require_null");var No,ol;function va(){if(ol)return No;ol=1;const e=Zt();function t(o){if(o===null)return!1;const s=o.length;return s===4&&(o==="true"||o==="True"||o==="TRUE")||s===5&&(o==="false"||o==="False"||o==="FALSE")}g(t,"resolveYamlBoolean");function r(o){return o==="true"||o==="True"||o==="TRUE"}g(r,"constructYamlBoolean");function i(o){return Object.prototype.toString.call(o)==="[object Boolean]"}return g(i,"isBoolean"),No=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:g(function(o){return o?"true":"false"},"lowercase"),uppercase:g(function(o){return o?"TRUE":"FALSE"},"uppercase"),camelcase:g(function(o){return o?"True":"False"},"camelcase")},defaultStyle:"lowercase"}),No}g(va,"requireBool");var Wo,sl;function La(){if(sl)return Wo;sl=1;const e=_r(),t=Zt();function r(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}g(r,"isHexCode");function i(c){return c>=48&&c<=55}g(i,"isOctCode");function o(c){return c>=48&&c<=57}g(o,"isDecCode");function s(c){if(c===null)return!1;const l=c.length;let d=0,u=!1;if(!l)return!1;let f=c[d];if((f==="-"||f==="+")&&(f=c[++d]),f==="0"){if(d+1===l)return!0;if(f=c[++d],f==="b"){for(d++;d<l;d++){if(f=c[d],f!=="0"&&f!=="1")return!1;u=!0}return u&&isFinite(a(c))}if(f==="x"){for(d++;d<l;d++){if(!r(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(a(c))}if(f==="o"){for(d++;d<l;d++){if(!i(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(a(c))}}for(;d<l;d++){if(!o(c.charCodeAt(d)))return!1;u=!0}return u?isFinite(a(c)):!1}g(s,"resolveYamlInteger");function a(c){let l=c,d=1,u=l[0];if((u==="-"||u==="+")&&(u==="-"&&(d=-1),l=l.slice(1),u=l[0]),l==="0")return 0;if(u==="0"){if(l[1]==="b")return d*parseInt(l.slice(2),2);if(l[1]==="x")return d*parseInt(l.slice(2),16);if(l[1]==="o")return d*parseInt(l.slice(2),8)}return d*parseInt(l,10)}g(a,"parseYamlInteger");function n(c){return a(c)}g(n,"constructYamlInteger");function h(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!e.isNegativeZero(c)}return g(h,"isInteger"),Wo=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:n,predicate:h,represent:{binary:g(function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},"binary"),octal:g(function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},"octal"),decimal:g(function(c){return c.toString(10)},"decimal"),hexadecimal:g(function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Wo}g(La,"requireInt");var zo,al;function Fa(){if(al)return zo;al=1;const e=_r(),t=Zt(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),i=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(c){return c===null||!r.test(c)?!1:isFinite(parseFloat(c,10))?!0:i.test(c)}g(o,"resolveYamlFloat");function s(c){let l=c.toLowerCase();const d=l[0]==="-"?-1:1;return"+-".indexOf(l[0])>=0&&(l=l.slice(1)),l===".inf"?d===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:l===".nan"?NaN:d*parseFloat(l,10)}g(s,"constructYamlFloat");const a=/^[-+]?[0-9]+e/;function n(c,l){if(isNaN(c))switch(l){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(l){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(l){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(c))return"-0.0";const d=c.toString(10);return a.test(d)?d.replace("e",".e"):d}g(n,"representYamlFloat");function h(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||e.isNegativeZero(c))}return g(h,"isFloat"),zo=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:h,represent:n,defaultStyle:"lowercase"}),zo}g(Fa,"requireFloat");var Ho,nl;function Ea(){return nl||(nl=1,Ho=wa().extend({implicit:[Ba(),va(),La(),Fa()]})),Ho}g(Ea,"requireJson");var Yo,ll;function Aa(){return ll||(ll=1,Yo=Ea()),Yo}g(Aa,"requireCore");var jo,hl;function _a(){if(hl)return jo;hl=1;const e=Zt(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function i(a){return a===null?!1:t.exec(a)!==null||r.exec(a)!==null}g(i,"resolveYamlTimestamp");function o(a){let n=0,h=null,c=t.exec(a);if(c===null&&(c=r.exec(a)),c===null)throw new Error("Date resolve error");const l=+c[1],d=+c[2]-1,u=+c[3];if(!c[4])return new Date(Date.UTC(l,d,u));const f=+c[4],m=+c[5],y=+c[6];if(c[7]){for(n=c[7].slice(0,3);n.length<3;)n+="0";n=+n}if(c[9]){const C=+c[10],b=+(c[11]||0);h=(C*60+b)*6e4,c[9]==="-"&&(h=-h)}const x=new Date(Date.UTC(l,d,u,f,m,y,n));return h&&x.setTime(x.getTime()-h),x}g(o,"constructYamlTimestamp");function s(a){return a.toISOString()}return g(s,"representYamlTimestamp"),jo=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:o,instanceOf:Date,represent:s}),jo}g(_a,"requireTimestamp");var Xo,cl;function Ma(){if(cl)return Xo;cl=1;const e=Zt();function t(r){return r==="<<"||r===null}return g(t,"resolveYamlMerge"),Xo=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),Xo}g(Ma,"requireMerge");var Uo,dl;function Ia(){if(dl)return Uo;dl=1;const e=Zt(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
282
- \r`;function r(a){if(a===null)return!1;let n=0;const h=a.length,c=t;for(let l=0;l<h;l++){const d=c.indexOf(a.charAt(l));if(!(d>64)){if(d<0)return!1;n+=6}}return n%8===0}g(r,"resolveYamlBinary");function i(a){const n=a.replace(/[\r\n=]/g,""),h=n.length,c=t;let l=0;const d=[];for(let f=0;f<h;f++)f%4===0&&f&&(d.push(l>>16&255),d.push(l>>8&255),d.push(l&255)),l=l<<6|c.indexOf(n.charAt(f));const u=h%4*6;return u===0?(d.push(l>>16&255),d.push(l>>8&255),d.push(l&255)):u===18?(d.push(l>>10&255),d.push(l>>2&255)):u===12&&d.push(l>>4&255),new Uint8Array(d)}g(i,"constructYamlBinary");function o(a){let n="",h=0;const c=a.length,l=t;for(let u=0;u<c;u++)u%3===0&&u&&(n+=l[h>>18&63],n+=l[h>>12&63],n+=l[h>>6&63],n+=l[h&63]),h=(h<<8)+a[u];const d=c%3;return d===0?(n+=l[h>>18&63],n+=l[h>>12&63],n+=l[h>>6&63],n+=l[h&63]):d===2?(n+=l[h>>10&63],n+=l[h>>4&63],n+=l[h<<2&63],n+=l[64]):d===1&&(n+=l[h>>2&63],n+=l[h<<4&63],n+=l[64],n+=l[64]),n}g(o,"representYamlBinary");function s(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return g(s,"isBinary"),Uo=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o}),Uo}g(Ia,"requireBinary");var Go,ul;function Oa(){if(ul)return Go;ul=1;const e=Zt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(s){if(s===null)return!0;const a=[],n=s;for(let h=0,c=n.length;h<c;h+=1){const l=n[h];let d=!1;if(r.call(l)!=="[object Object]")return!1;let u;for(u in l)if(t.call(l,u))if(!d)d=!0;else return!1;if(!d)return!1;if(a.indexOf(u)===-1)a.push(u);else return!1}return!0}g(i,"resolveYamlOmap");function o(s){return s!==null?s:[]}return g(o,"constructYamlOmap"),Go=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:o}),Go}g(Oa,"requireOmap");var Vo,gl;function $a(){if(gl)return Vo;gl=1;const e=Zt(),t=Object.prototype.toString;function r(o){if(o===null)return!0;const s=o,a=new Array(s.length);for(let n=0,h=s.length;n<h;n+=1){const c=s[n];if(t.call(c)!=="[object Object]")return!1;const l=Object.keys(c);if(l.length!==1)return!1;a[n]=[l[0],c[l[0]]]}return!0}g(r,"resolveYamlPairs");function i(o){if(o===null)return[];const s=o,a=new Array(s.length);for(let n=0,h=s.length;n<h;n+=1){const c=s[n],l=Object.keys(c);a[n]=[l[0],c[l[0]]]}return a}return g(i,"constructYamlPairs"),Vo=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),Vo}g($a,"requirePairs");var Ko,pl;function Da(){if(pl)return Ko;pl=1;const e=Zt(),t=Object.prototype.hasOwnProperty;function r(o){if(o===null)return!0;const s=o;for(const a in s)if(t.call(s,a)&&s[a]!==null)return!1;return!0}g(r,"resolveYamlSet");function i(o){return o!==null?o:{}}return g(i,"constructYamlSet"),Ko=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),Ko}g(Da,"requireSet");var Zo,fl;function po(){return fl||(fl=1,Zo=Aa().extend({implicit:[_a(),Ma()],explicit:[Ia(),Oa(),$a(),Da()]})),Zo}g(po,"require_default");var ml;function mu(){if(ml)return Ai;ml=1;const e=_r(),t=Mr(),r=fu(),i=po(),o=Object.prototype.hasOwnProperty,s=1,a=2,n=3,h=4,c=1,l=2,d=3,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,m=/[,\[\]{}]/,y=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function C(p){return Object.prototype.toString.call(p)}g(C,"_class");function b(p){return p===10||p===13}g(b,"isEol");function T(p){return p===9||p===32}g(T,"isWhiteSpace");function w(p){return p===9||p===32||p===10||p===13}g(w,"isWsOrEol");function B(p){return p===44||p===91||p===93||p===123||p===125}g(B,"isFlowIndicator");function F(p){if(p>=48&&p<=57)return p-48;const A=p|32;return A>=97&&A<=102?A-97+10:-1}g(F,"fromHexCode");function L(p){return p===120?2:p===117?4:p===85?8:0}g(L,"escapedHexLen");function v(p){return p>=48&&p<=57?p-48:-1}g(v,"fromDecimalCode");function R(p){switch(p){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
276
+ `}return d.replace(/\n$/,"")}return g(i,"makeSnippet"),_o=i,_o}g(gu,"requireSnippet");var Mo,Vn;function Zt(){if(Vn)return Mo;Vn=1;const e=Mr(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(s){const a={};return s!==null&&Object.keys(s).forEach(function(n){s[n].forEach(function(h){a[String(h)]=n})}),a}g(i,"compileStyleAliases");function o(s,a){if(a=a||{},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e('Unknown option "'+n+'" is met in definition of "'+s+'" YAML type.')}),this.options=a,this.tag=s,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(n){return n},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=i(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return g(o,"Type2"),Mo=o,Mo}g(Zt,"requireType");var Io,Kn;function xa(){if(Kn)return Io;Kn=1;const e=Mr(),t=Zt();function r(s,a){const n=[];return s[a].forEach(function(h){let c=n.length;n.forEach(function(l,d){l.tag===h.tag&&l.kind===h.kind&&l.multi===h.multi&&(c=d)}),n[c]=h}),n}g(r,"compileList");function i(){const s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(n){n.multi?(s.multi[n.kind].push(n),s.multi.fallback.push(n)):s[n.kind][n.tag]=s.fallback[n.tag]=n}g(a,"collectType");for(let n=0,h=arguments.length;n<h;n+=1)arguments[n].forEach(a);return s}g(i,"compileMap");function o(s){return this.extend(s)}return g(o,"Schema2"),o.prototype.extend=g(function(a){let n=[],h=[];if(a instanceof t)h.push(a);else if(Array.isArray(a))h=h.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(n=n.concat(a.implicit)),a.explicit&&(h=h.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),h.forEach(function(l){if(!(l instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(o.prototype);return c.implicit=(this.implicit||[]).concat(n),c.explicit=(this.explicit||[]).concat(h),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=i(c.compiledImplicit,c.compiledExplicit),c},"extend"),Io=o,Io}g(xa,"requireSchema");var Oo,Zn;function ba(){if(Zn)return Oo;Zn=1;const e=Zt();return Oo=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(t){return t!==null?t:""},"construct")}),Oo}g(ba,"requireStr");var $o,Qn;function ka(){if(Qn)return $o;Qn=1;const e=Zt();return $o=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(t){return t!==null?t:[]},"construct")}),$o}g(ka,"requireSeq");var Do,Jn;function Sa(){if(Jn)return Do;Jn=1;const e=Zt();return Do=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(t){return t!==null?t:{}},"construct")}),Do}g(Sa,"requireMap");var Po,tl;function Ta(){if(tl)return Po;tl=1;const e=xa();return Po=new e({explicit:[ba(),ka(),Sa()]}),Po}g(Ta,"requireFailsafe");var Ro,el;function wa(){if(el)return Ro;el=1;const e=Zt();function t(o){if(o===null)return!0;const s=o.length;return s===1&&o==="~"||s===4&&(o==="null"||o==="Null"||o==="NULL")}g(t,"resolveYamlNull");function r(){return null}g(r,"constructYamlNull");function i(o){return o===null}return g(i,"isNull"),Ro=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:g(function(){return"~"},"canonical"),lowercase:g(function(){return"null"},"lowercase"),uppercase:g(function(){return"NULL"},"uppercase"),camelcase:g(function(){return"Null"},"camelcase"),empty:g(function(){return""},"empty")},defaultStyle:"lowercase"}),Ro}g(wa,"require_null");var qo,rl;function Ba(){if(rl)return qo;rl=1;const e=Zt();function t(o){if(o===null)return!1;const s=o.length;return s===4&&(o==="true"||o==="True"||o==="TRUE")||s===5&&(o==="false"||o==="False"||o==="FALSE")}g(t,"resolveYamlBoolean");function r(o){return o==="true"||o==="True"||o==="TRUE"}g(r,"constructYamlBoolean");function i(o){return Object.prototype.toString.call(o)==="[object Boolean]"}return g(i,"isBoolean"),qo=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:g(function(o){return o?"true":"false"},"lowercase"),uppercase:g(function(o){return o?"TRUE":"FALSE"},"uppercase"),camelcase:g(function(o){return o?"True":"False"},"camelcase")},defaultStyle:"lowercase"}),qo}g(Ba,"requireBool");var No,il;function va(){if(il)return No;il=1;const e=_r(),t=Zt();function r(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}g(r,"isHexCode");function i(c){return c>=48&&c<=55}g(i,"isOctCode");function o(c){return c>=48&&c<=57}g(o,"isDecCode");function s(c){if(c===null)return!1;const l=c.length;let d=0,u=!1;if(!l)return!1;let f=c[d];if((f==="-"||f==="+")&&(f=c[++d]),f==="0"){if(d+1===l)return!0;if(f=c[++d],f==="b"){for(d++;d<l;d++){if(f=c[d],f!=="0"&&f!=="1")return!1;u=!0}return u&&isFinite(a(c))}if(f==="x"){for(d++;d<l;d++){if(!r(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(a(c))}if(f==="o"){for(d++;d<l;d++){if(!i(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(a(c))}}for(;d<l;d++){if(!o(c.charCodeAt(d)))return!1;u=!0}return u?isFinite(a(c)):!1}g(s,"resolveYamlInteger");function a(c){let l=c,d=1,u=l[0];if((u==="-"||u==="+")&&(u==="-"&&(d=-1),l=l.slice(1),u=l[0]),l==="0")return 0;if(u==="0"){if(l[1]==="b")return d*parseInt(l.slice(2),2);if(l[1]==="x")return d*parseInt(l.slice(2),16);if(l[1]==="o")return d*parseInt(l.slice(2),8)}return d*parseInt(l,10)}g(a,"parseYamlInteger");function n(c){return a(c)}g(n,"constructYamlInteger");function h(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!e.isNegativeZero(c)}return g(h,"isInteger"),No=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:n,predicate:h,represent:{binary:g(function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},"binary"),octal:g(function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},"octal"),decimal:g(function(c){return c.toString(10)},"decimal"),hexadecimal:g(function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),No}g(va,"requireInt");var Wo,ol;function La(){if(ol)return Wo;ol=1;const e=_r(),t=Zt(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),i=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(c){return c===null||!r.test(c)?!1:isFinite(parseFloat(c,10))?!0:i.test(c)}g(o,"resolveYamlFloat");function s(c){let l=c.toLowerCase();const d=l[0]==="-"?-1:1;return"+-".indexOf(l[0])>=0&&(l=l.slice(1)),l===".inf"?d===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:l===".nan"?NaN:d*parseFloat(l,10)}g(s,"constructYamlFloat");const a=/^[-+]?[0-9]+e/;function n(c,l){if(isNaN(c))switch(l){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(l){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(l){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(c))return"-0.0";const d=c.toString(10);return a.test(d)?d.replace("e",".e"):d}g(n,"representYamlFloat");function h(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||e.isNegativeZero(c))}return g(h,"isFloat"),Wo=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:h,represent:n,defaultStyle:"lowercase"}),Wo}g(La,"requireFloat");var zo,sl;function Fa(){return sl||(sl=1,zo=Ta().extend({implicit:[wa(),Ba(),va(),La()]})),zo}g(Fa,"requireJson");var Ho,al;function Ea(){return al||(al=1,Ho=Fa()),Ho}g(Ea,"requireCore");var Yo,nl;function Aa(){if(nl)return Yo;nl=1;const e=Zt(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function i(a){return a===null?!1:t.exec(a)!==null||r.exec(a)!==null}g(i,"resolveYamlTimestamp");function o(a){let n=0,h=null,c=t.exec(a);if(c===null&&(c=r.exec(a)),c===null)throw new Error("Date resolve error");const l=+c[1],d=+c[2]-1,u=+c[3];if(!c[4])return new Date(Date.UTC(l,d,u));const f=+c[4],m=+c[5],y=+c[6];if(c[7]){for(n=c[7].slice(0,3);n.length<3;)n+="0";n=+n}if(c[9]){const C=+c[10],b=+(c[11]||0);h=(C*60+b)*6e4,c[9]==="-"&&(h=-h)}const x=new Date(Date.UTC(l,d,u,f,m,y,n));return h&&x.setTime(x.getTime()-h),x}g(o,"constructYamlTimestamp");function s(a){return a.toISOString()}return g(s,"representYamlTimestamp"),Yo=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:o,instanceOf:Date,represent:s}),Yo}g(Aa,"requireTimestamp");var jo,ll;function _a(){if(ll)return jo;ll=1;const e=Zt();function t(r){return r==="<<"||r===null}return g(t,"resolveYamlMerge"),jo=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),jo}g(_a,"requireMerge");var Xo,hl;function Ma(){if(hl)return Xo;hl=1;const e=Zt(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
277
+ \r`;function r(a){if(a===null)return!1;let n=0;const h=a.length,c=t;for(let l=0;l<h;l++){const d=c.indexOf(a.charAt(l));if(!(d>64)){if(d<0)return!1;n+=6}}return n%8===0}g(r,"resolveYamlBinary");function i(a){const n=a.replace(/[\r\n=]/g,""),h=n.length,c=t;let l=0;const d=[];for(let f=0;f<h;f++)f%4===0&&f&&(d.push(l>>16&255),d.push(l>>8&255),d.push(l&255)),l=l<<6|c.indexOf(n.charAt(f));const u=h%4*6;return u===0?(d.push(l>>16&255),d.push(l>>8&255),d.push(l&255)):u===18?(d.push(l>>10&255),d.push(l>>2&255)):u===12&&d.push(l>>4&255),new Uint8Array(d)}g(i,"constructYamlBinary");function o(a){let n="",h=0;const c=a.length,l=t;for(let u=0;u<c;u++)u%3===0&&u&&(n+=l[h>>18&63],n+=l[h>>12&63],n+=l[h>>6&63],n+=l[h&63]),h=(h<<8)+a[u];const d=c%3;return d===0?(n+=l[h>>18&63],n+=l[h>>12&63],n+=l[h>>6&63],n+=l[h&63]):d===2?(n+=l[h>>10&63],n+=l[h>>4&63],n+=l[h<<2&63],n+=l[64]):d===1&&(n+=l[h>>2&63],n+=l[h<<4&63],n+=l[64],n+=l[64]),n}g(o,"representYamlBinary");function s(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return g(s,"isBinary"),Xo=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o}),Xo}g(Ma,"requireBinary");var Uo,cl;function Ia(){if(cl)return Uo;cl=1;const e=Zt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(s){if(s===null)return!0;const a=[],n=s;for(let h=0,c=n.length;h<c;h+=1){const l=n[h];let d=!1;if(r.call(l)!=="[object Object]")return!1;let u;for(u in l)if(t.call(l,u))if(!d)d=!0;else return!1;if(!d)return!1;if(a.indexOf(u)===-1)a.push(u);else return!1}return!0}g(i,"resolveYamlOmap");function o(s){return s!==null?s:[]}return g(o,"constructYamlOmap"),Uo=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:o}),Uo}g(Ia,"requireOmap");var Go,dl;function Oa(){if(dl)return Go;dl=1;const e=Zt(),t=Object.prototype.toString;function r(o){if(o===null)return!0;const s=o,a=new Array(s.length);for(let n=0,h=s.length;n<h;n+=1){const c=s[n];if(t.call(c)!=="[object Object]")return!1;const l=Object.keys(c);if(l.length!==1)return!1;a[n]=[l[0],c[l[0]]]}return!0}g(r,"resolveYamlPairs");function i(o){if(o===null)return[];const s=o,a=new Array(s.length);for(let n=0,h=s.length;n<h;n+=1){const c=s[n],l=Object.keys(c);a[n]=[l[0],c[l[0]]]}return a}return g(i,"constructYamlPairs"),Go=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),Go}g(Oa,"requirePairs");var Vo,ul;function $a(){if(ul)return Vo;ul=1;const e=Zt(),t=Object.prototype.hasOwnProperty;function r(o){if(o===null)return!0;const s=o;for(const a in s)if(t.call(s,a)&&s[a]!==null)return!1;return!0}g(r,"resolveYamlSet");function i(o){return o!==null?o:{}}return g(i,"constructYamlSet"),Vo=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),Vo}g($a,"requireSet");var Ko,gl;function go(){return gl||(gl=1,Ko=Ea().extend({implicit:[Aa(),_a()],explicit:[Ma(),Ia(),Oa(),$a()]})),Ko}g(go,"require_default");var pl;function pu(){if(pl)return Ei;pl=1;const e=_r(),t=Mr(),r=gu(),i=go(),o=Object.prototype.hasOwnProperty,s=1,a=2,n=3,h=4,c=1,l=2,d=3,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,m=/[,\[\]{}]/,y=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function C(p){return Object.prototype.toString.call(p)}g(C,"_class");function b(p){return p===10||p===13}g(b,"isEol");function T(p){return p===9||p===32}g(T,"isWhiteSpace");function w(p){return p===9||p===32||p===10||p===13}g(w,"isWsOrEol");function B(p){return p===44||p===91||p===93||p===123||p===125}g(B,"isFlowIndicator");function F(p){if(p>=48&&p<=57)return p-48;const A=p|32;return A>=97&&A<=102?A-97+10:-1}g(F,"fromHexCode");function L(p){return p===120?2:p===117?4:p===85?8:0}g(L,"escapedHexLen");function v(p){return p>=48&&p<=57?p-48:-1}g(v,"fromDecimalCode");function R(p){switch(p){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
283
278
  `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}g(R,"simpleEscapeSequence");function N(p){return p<=65535?String.fromCharCode(p):String.fromCharCode((p-65536>>10)+55296,(p-65536&1023)+56320)}g(N,"charFromCodepoint");function q(p,A,H){A==="__proto__"?Object.defineProperty(p,A,{configurable:!0,enumerable:!0,writable:!0,value:H}):p[A]=H}g(q,"setProperty");const J=new Array(256),W=new Array(256);for(let p=0;p<256;p++)J[p]=R(p)?1:0,W[p]=R(p);function z(p,A){this.input=p,this.filename=A.filename||null,this.schema=A.schema||i,this.onWarning=A.onWarning||null,this.legacy=A.legacy||!1,this.json=A.json||!1,this.listener=A.listener||null,this.maxDepth=typeof A.maxDepth=="number"?A.maxDepth:100,this.maxTotalMergeKeys=typeof A.maxTotalMergeKeys=="number"?A.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=p.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}g(z,"State");function V(p,A){const H={name:p.filename,buffer:p.input.slice(0,-1),position:p.position,line:p.line,column:p.position-p.lineStart};return H.snippet=r(H),new t(A,H)}g(V,"generateError");function I(p,A){throw V(p,A)}g(I,"throwError");function P(p,A){p.onWarning&&p.onWarning.call(null,V(p,A))}g(P,"throwWarning");function Y(p,A,H){const U=p.anchorMapTransactions;if(U.length!==0){const D=U[U.length-1];o.call(D,A)||(D[A]={existed:o.call(p.anchorMap,A),value:p.anchorMap[A]})}p.anchorMap[A]=H}g(Y,"storeAnchor");function lt(p){p.anchorMapTransactions.push(Object.create(null))}g(lt,"beginAnchorTransaction");function at(p){const A=p.anchorMapTransactions.pop(),H=p.anchorMapTransactions;if(H.length===0)return;const U=H[H.length-1],D=Object.keys(A);for(let Q=0,S=D.length;Q<S;Q+=1){const _=D[Q];o.call(U,_)||(U[_]=A[_])}}g(at,"commitAnchorTransaction");function Ct(p){const A=p.anchorMapTransactions.pop(),H=Object.keys(A);for(let U=H.length-1;U>=0;U-=1){const D=A[H[U]];D.existed?p.anchorMap[H[U]]=D.value:delete p.anchorMap[H[U]]}}g(Ct,"rollbackAnchorTransaction");function Et(p){return{position:p.position,line:p.line,lineStart:p.lineStart,lineIndent:p.lineIndent,firstTabInLine:p.firstTabInLine,tag:p.tag,anchor:p.anchor,kind:p.kind,result:p.result}}g(Et,"snapshotState");function mt(p,A){p.position=A.position,p.line=A.line,p.lineStart=A.lineStart,p.lineIndent=A.lineIndent,p.firstTabInLine=A.firstTabInLine,p.tag=A.tag,p.anchor=A.anchor,p.kind=A.kind,p.result=A.result}g(mt,"restoreState");const Tt={YAML:g(function(A,H,U){A.version!==null&&I(A,"duplication of %YAML directive"),U.length!==1&&I(A,"YAML directive accepts exactly one argument");const D=/^([0-9]+)\.([0-9]+)$/.exec(U[0]);D===null&&I(A,"ill-formed argument of the YAML directive");const Q=parseInt(D[1],10),S=parseInt(D[2],10);Q!==1&&I(A,"unacceptable YAML version of the document"),A.version=U[0],A.checkLineBreaks=S<2,S!==1&&S!==2&&P(A,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(A,H,U){let D;U.length!==2&&I(A,"TAG directive accepts exactly two arguments");const Q=U[0];D=U[1],y.test(Q)||I(A,"ill-formed tag handle (first argument) of the TAG directive"),o.call(A.tagMap,Q)&&I(A,'there is a previously declared suffix for "'+Q+'" tag handle'),x.test(D)||I(A,"ill-formed tag prefix (second argument) of the TAG directive");try{D=decodeURIComponent(D)}catch{I(A,"tag prefix is malformed: "+D)}A.tagMap[Q]=D},"handleTagDirective")};function xt(p,A,H,U){if(A<H){const D=p.input.slice(A,H);if(U)for(let Q=0,S=D.length;Q<S;Q+=1){const _=D.charCodeAt(Q);_===9||_>=32&&_<=1114111||I(p,"expected valid JSON character")}else u.test(D)&&I(p,"the stream contains non-printable characters");p.result+=D}}g(xt,"captureSegment");function ht(p,A,H,U){e.isObject(H)||I(p,"cannot merge mappings; the provided source object is unacceptable");const D=Object.keys(H);for(let Q=0,S=D.length;Q<S;Q+=1){const _=D[Q];p.maxTotalMergeKeys!==-1&&++p.totalMergeKeys>p.maxTotalMergeKeys&&I(p,"merge keys exceeded maxTotalMergeKeys ("+p.maxTotalMergeKeys+")"),o.call(A,_)||(q(A,_,H[_]),U[_]=!0)}}g(ht,"mergeMappings");function kt(p,A,H,U,D,Q,S,_,K){if(Array.isArray(D)){D=Array.prototype.slice.call(D);for(let j=0,X=D.length;j<X;j+=1)Array.isArray(D[j])&&I(p,"nested arrays are not supported inside keys"),typeof D=="object"&&C(D[j])==="[object Object]"&&(D[j]="[object Object]")}if(typeof D=="object"&&C(D)==="[object Object]"&&(D="[object Object]"),D=String(D),A===null&&(A={}),U==="tag:yaml.org,2002:merge")if(Array.isArray(Q))for(let j=0,X=Q.length;j<X;j+=1)ht(p,A,Q[j],H);else ht(p,A,Q,H);else!p.json&&!o.call(H,D)&&o.call(A,D)&&(p.line=S||p.line,p.lineStart=_||p.lineStart,p.position=K||p.position,I(p,"duplicated mapping key")),q(A,D,Q),delete H[D];return A}g(kt,"storeMappingPair");function Mt(p){const A=p.input.charCodeAt(p.position);A===10?p.position++:A===13?(p.position++,p.input.charCodeAt(p.position)===10&&p.position++):I(p,"a line break is expected"),p.line+=1,p.lineStart=p.position,p.firstTabInLine=-1}g(Mt,"readLineBreak");function wt(p,A,H){let U=0,D=p.input.charCodeAt(p.position);for(;D!==0;){for(;T(D);)D===9&&p.firstTabInLine===-1&&(p.firstTabInLine=p.position),D=p.input.charCodeAt(++p.position);if(A&&D===35)do D=p.input.charCodeAt(++p.position);while(D!==10&&D!==13&&D!==0);if(b(D))for(Mt(p),D=p.input.charCodeAt(p.position),U++,p.lineIndent=0;D===32;)p.lineIndent++,D=p.input.charCodeAt(++p.position);else break}return H!==-1&&U!==0&&p.lineIndent<H&&P(p,"deficient indentation"),U}g(wt,"skipSeparationSpace");function Xt(p){let A=p.position,H=p.input.charCodeAt(A);return!!((H===45||H===46)&&H===p.input.charCodeAt(A+1)&&H===p.input.charCodeAt(A+2)&&(A+=3,H=p.input.charCodeAt(A),H===0||w(H)))}g(Xt,"testDocumentSeparator");function qt(p,A){A===1?p.result+=" ":A>1&&(p.result+=e.repeat(`
284
279
  `,A-1))}g(qt,"writeFoldedLines");function Fe(p,A,H){let U,D,Q,S,_,K;const j=p.kind,X=p.result;let Z=p.input.charCodeAt(p.position);if(w(Z)||B(Z)||Z===35||Z===38||Z===42||Z===33||Z===124||Z===62||Z===39||Z===34||Z===37||Z===64||Z===96)return!1;if(Z===63||Z===45){const G=p.input.charCodeAt(p.position+1);if(w(G)||H&&B(G))return!1}for(p.kind="scalar",p.result="",U=D=p.position,Q=!1;Z!==0;){if(Z===58){const G=p.input.charCodeAt(p.position+1);if(w(G)||H&&B(G))break}else if(Z===35){const G=p.input.charCodeAt(p.position-1);if(w(G))break}else{if(p.position===p.lineStart&&Xt(p)||H&&B(Z))break;if(b(Z))if(S=p.line,_=p.lineStart,K=p.lineIndent,wt(p,!1,-1),p.lineIndent>=A){Q=!0,Z=p.input.charCodeAt(p.position);continue}else{p.position=D,p.line=S,p.lineStart=_,p.lineIndent=K;break}}Q&&(xt(p,U,D,!1),qt(p,p.line-S),U=D=p.position,Q=!1),T(Z)||(D=p.position+1),Z=p.input.charCodeAt(++p.position)}return xt(p,U,D,!1),p.result?!0:(p.kind=j,p.result=X,!1)}g(Fe,"readPlainScalar");function nr(p,A){let H,U,D=p.input.charCodeAt(p.position);if(D!==39)return!1;for(p.kind="scalar",p.result="",p.position++,H=U=p.position;(D=p.input.charCodeAt(p.position))!==0;)if(D===39)if(xt(p,H,p.position,!0),D=p.input.charCodeAt(++p.position),D===39)H=p.position,p.position++,U=p.position;else return!0;else b(D)?(xt(p,H,U,!0),qt(p,wt(p,!1,A)),H=U=p.position):p.position===p.lineStart&&Xt(p)?I(p,"unexpected end of the document within a single quoted scalar"):(p.position++,T(D)||(U=p.position));I(p,"unexpected end of the stream within a single quoted scalar")}g(nr,"readSingleQuotedScalar");function ye(p,A){let H,U,D,Q=p.input.charCodeAt(p.position);if(Q!==34)return!1;for(p.kind="scalar",p.result="",p.position++,H=U=p.position;(Q=p.input.charCodeAt(p.position))!==0;){if(Q===34)return xt(p,H,p.position,!0),p.position++,!0;if(Q===92){if(xt(p,H,p.position,!0),Q=p.input.charCodeAt(++p.position),b(Q))wt(p,!1,A);else if(Q<256&&J[Q])p.result+=W[Q],p.position++;else if((D=L(Q))>0){let S=D,_=0;for(;S>0;S--)Q=p.input.charCodeAt(++p.position),(D=F(Q))>=0?_=(_<<4)+D:I(p,"expected hexadecimal character");p.result+=N(_),p.position++}else I(p,"unknown escape sequence");H=U=p.position}else b(Q)?(xt(p,H,U,!0),qt(p,wt(p,!1,A)),H=U=p.position):p.position===p.lineStart&&Xt(p)?I(p,"unexpected end of the document within a double quoted scalar"):(p.position++,T(Q)||(U=p.position))}I(p,"unexpected end of the stream within a double quoted scalar")}g(ye,"readDoubleQuotedScalar");function Or(p,A){let H=!0,U,D,Q;const S=p.tag;let _;const K=p.anchor;let j,X,Z,G;const nt=Object.create(null);let it,ut,gt,vt=p.input.charCodeAt(p.position);if(vt===91)j=93,G=!1,_=[];else if(vt===123)j=125,G=!0,_={};else return!1;for(p.anchor!==null&&Y(p,p.anchor,_),vt=p.input.charCodeAt(++p.position);vt!==0;){if(wt(p,!0,A),vt=p.input.charCodeAt(p.position),vt===j)return p.position++,p.tag=S,p.anchor=K,p.kind=G?"mapping":"sequence",p.result=_,!0;if(H?vt===44&&I(p,"expected the node content, but found ','"):I(p,"missed comma between flow collection entries"),ut=it=gt=null,X=Z=!1,vt===63){const Ot=p.input.charCodeAt(p.position+1);w(Ot)&&(X=Z=!0,p.position++,wt(p,!0,A))}U=p.line,D=p.lineStart,Q=p.position,de(p,A,s,!1,!0),ut=p.tag,it=p.result,wt(p,!0,A),vt=p.input.charCodeAt(p.position),(Z||p.line===U)&&vt===58&&(X=!0,vt=p.input.charCodeAt(++p.position),wt(p,!0,A),de(p,A,s,!1,!0),gt=p.result),G?kt(p,_,nt,ut,it,gt,U,D,Q):X?_.push(kt(p,null,nt,ut,it,gt,U,D,Q)):_.push(it),wt(p,!0,A),vt=p.input.charCodeAt(p.position),vt===44?(H=!0,vt=p.input.charCodeAt(++p.position)):H=!1}I(p,"unexpected end of the stream within a flow collection")}g(Or,"readFlowCollection");function $r(p,A){let H,U=c,D=!1,Q=!1,S=A,_=0,K=!1,j,X=p.input.charCodeAt(p.position);if(X===124)H=!1;else if(X===62)H=!0;else return!1;for(p.kind="scalar",p.result="";X!==0;)if(X=p.input.charCodeAt(++p.position),X===43||X===45)c===U?U=X===43?d:l:I(p,"repeat of a chomping mode identifier");else if((j=v(X))>=0)j===0?I(p,"bad explicit indentation width of a block scalar; it cannot be less than one"):Q?I(p,"repeat of an indentation width identifier"):(S=A+j-1,Q=!0);else break;if(T(X)){do X=p.input.charCodeAt(++p.position);while(T(X));if(X===35)do X=p.input.charCodeAt(++p.position);while(!b(X)&&X!==0)}for(;X!==0;){for(Mt(p),p.lineIndent=0,X=p.input.charCodeAt(p.position);(!Q||p.lineIndent<S)&&X===32;)p.lineIndent++,X=p.input.charCodeAt(++p.position);if(!Q&&p.lineIndent>S&&(S=p.lineIndent),b(X)){_++;continue}if(!Q&&S===0&&I(p,"missing indentation for block scalar"),p.lineIndent<S){U===d?p.result+=e.repeat(`
285
280
  `,D?1+_:_):U===c&&D&&(p.result+=`
@@ -288,10 +283,10 @@ ${o.join(`
288
283
  `,_+1)):_===0?D&&(p.result+=" "):p.result+=e.repeat(`
289
284
  `,_):p.result+=e.repeat(`
290
285
  `,D?1+_:_),D=!0,Q=!0,_=0;const Z=p.position;for(;!b(X)&&X!==0;)X=p.input.charCodeAt(++p.position);xt(p,Z,p.position,!1)}return!0}g($r,"readBlockScalar");function Ce(p,A){const H=p.tag,U=p.anchor,D=[];let Q=!1;if(p.firstTabInLine!==-1)return!1;p.anchor!==null&&Y(p,p.anchor,D);let S=p.input.charCodeAt(p.position);for(;S!==0&&(p.firstTabInLine!==-1&&(p.position=p.firstTabInLine,I(p,"tab characters must not be used in indentation")),S===45);){const _=p.input.charCodeAt(p.position+1);if(!w(_))break;if(Q=!0,p.position++,wt(p,!0,-1)&&p.lineIndent<=A){D.push(null),S=p.input.charCodeAt(p.position);continue}const K=p.line;if(de(p,A,n,!1,!0),D.push(p.result),wt(p,!0,-1),S=p.input.charCodeAt(p.position),(p.line===K||p.lineIndent>A)&&S!==0)I(p,"bad indentation of a sequence entry");else if(p.lineIndent<A)break}return Q?(p.tag=H,p.anchor=U,p.kind="sequence",p.result=D,!0):!1}g(Ce,"readBlockSequence");function lr(p,A,H){let U,D,Q,S;const _=p.tag,K=p.anchor,j={},X=Object.create(null);let Z=null,G=null,nt=null,it=!1,ut=!1;if(p.firstTabInLine!==-1)return!1;p.anchor!==null&&Y(p,p.anchor,j);let gt=p.input.charCodeAt(p.position);for(;gt!==0;){!it&&p.firstTabInLine!==-1&&(p.position=p.firstTabInLine,I(p,"tab characters must not be used in indentation"));const vt=p.input.charCodeAt(p.position+1),Ot=p.line;if((gt===63||gt===58)&&w(vt))gt===63?(it&&(kt(p,j,X,Z,G,null,D,Q,S),Z=G=nt=null),ut=!0,it=!0,U=!0):it?(it=!1,U=!0):I(p,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),p.position+=1,gt=vt;else{if(D=p.line,Q=p.lineStart,S=p.position,!de(p,H,a,!1,!0))break;if(p.line===Ot){for(gt=p.input.charCodeAt(p.position);T(gt);)gt=p.input.charCodeAt(++p.position);if(gt===58)gt=p.input.charCodeAt(++p.position),w(gt)||I(p,"a whitespace character is expected after the key-value separator within a block mapping"),it&&(kt(p,j,X,Z,G,null,D,Q,S),Z=G=nt=null),ut=!0,it=!1,U=!1,Z=p.tag,G=p.result;else if(ut)I(p,"can not read an implicit mapping pair; a colon is missed");else return p.tag=_,p.anchor=K,!0}else if(ut)I(p,"can not read a block mapping entry; a multiline key may not be an implicit key");else return p.tag=_,p.anchor=K,!0}if((p.line===Ot||p.lineIndent>A)&&(it&&(D=p.line,Q=p.lineStart,S=p.position),de(p,A,h,!0,U)&&(it?G=p.result:nt=p.result),it||(kt(p,j,X,Z,G,nt,D,Q,S),Z=G=nt=null),wt(p,!0,-1),gt=p.input.charCodeAt(p.position)),(p.line===Ot||p.lineIndent>A)&&gt!==0)I(p,"bad indentation of a mapping entry");else if(p.lineIndent<A)break}return it&&kt(p,j,X,Z,G,null,D,Q,S),ut&&(p.tag=_,p.anchor=K,p.kind="mapping",p.result=j),ut}g(lr,"readBlockMapping");function Dr(p){let A=!1,H=!1,U,D,Q=p.input.charCodeAt(p.position);if(Q!==33)return!1;p.tag!==null&&I(p,"duplication of a tag property"),Q=p.input.charCodeAt(++p.position),Q===60?(A=!0,Q=p.input.charCodeAt(++p.position)):Q===33?(H=!0,U="!!",Q=p.input.charCodeAt(++p.position)):U="!";let S=p.position;if(A){do Q=p.input.charCodeAt(++p.position);while(Q!==0&&Q!==62);p.position<p.length?(D=p.input.slice(S,p.position),Q=p.input.charCodeAt(++p.position)):I(p,"unexpected end of the stream within a verbatim tag")}else{for(;Q!==0&&!w(Q);)Q===33&&(H?I(p,"tag suffix cannot contain exclamation marks"):(U=p.input.slice(S-1,p.position+1),y.test(U)||I(p,"named tag handle cannot contain such characters"),H=!0,S=p.position+1)),Q=p.input.charCodeAt(++p.position);D=p.input.slice(S,p.position),m.test(D)&&I(p,"tag suffix cannot contain flow indicator characters")}D&&!x.test(D)&&I(p,"tag name cannot contain such characters: "+D);try{D=decodeURIComponent(D)}catch{I(p,"tag name is malformed: "+D)}return A?p.tag=D:o.call(p.tagMap,U)?p.tag=p.tagMap[U]+D:U==="!"?p.tag="!"+D:U==="!!"?p.tag="tag:yaml.org,2002:"+D:I(p,'undeclared tag handle "'+U+'"'),!0}g(Dr,"readTagProperty");function hr(p){let A=p.input.charCodeAt(p.position);if(A!==38)return!1;p.anchor!==null&&I(p,"duplication of an anchor property"),A=p.input.charCodeAt(++p.position);const H=p.position;for(;A!==0&&!w(A)&&!B(A);)A=p.input.charCodeAt(++p.position);return p.position===H&&I(p,"name of an anchor node must contain at least one character"),p.anchor=p.input.slice(H,p.position),!0}g(hr,"readAnchorProperty");function cr(p){let A=p.input.charCodeAt(p.position);if(A!==42)return!1;A=p.input.charCodeAt(++p.position);const H=p.position;for(;A!==0&&!w(A)&&!B(A);)A=p.input.charCodeAt(++p.position);p.position===H&&I(p,"name of an alias node must contain at least one character");const U=p.input.slice(H,p.position);return o.call(p.anchorMap,U)||I(p,'unidentified alias "'+U+'"'),p.result=p.anchorMap[U],wt(p,!0,-1),!0}g(cr,"readAlias");function Pr(p,A,H,U){const D=Et(p);return lt(p),mt(p,A),p.tag=null,p.anchor=null,p.kind=null,p.result=null,lr(p,H,U)&&p.kind==="mapping"?(at(p),!0):(Ct(p),mt(p,D),!1)}g(Pr,"tryReadBlockMappingFromProperty");function de(p,A,H,U,D){let Q,S,_=1,K=!1,j=!1,X=null,Z,G,nt;p.depth>=p.maxDepth&&I(p,"nesting exceeded maxDepth ("+p.maxDepth+")"),p.depth+=1,p.listener!==null&&p.listener("open",p),p.tag=null,p.anchor=null,p.kind=null,p.result=null;const it=Q=S=h===H||n===H;if(U&&wt(p,!0,-1)&&(K=!0,p.lineIndent>A?_=1:p.lineIndent===A?_=0:p.lineIndent<A&&(_=-1)),_===1)for(;;){const ut=p.input.charCodeAt(p.position),gt=Et(p);if(K&&(ut===33&&p.tag!==null||ut===38&&p.anchor!==null)||!Dr(p)&&!hr(p))break;X===null&&(X=gt),wt(p,!0,-1)?(K=!0,S=it,p.lineIndent>A?_=1:p.lineIndent===A?_=0:p.lineIndent<A&&(_=-1)):S=!1}if(S&&(S=K||D),_===1||h===H)if(s===H||a===H?G=A:G=A+1,nt=p.position-p.lineStart,_===1)if(S&&(Ce(p,nt)||lr(p,nt,G))||Or(p,G))j=!0;else{const ut=p.input.charCodeAt(p.position);X!==null&&it&&!S&&ut!==124&&ut!==62&&Pr(p,X,X.position-X.lineStart,G)||Q&&$r(p,G)||nr(p,G)||ye(p,G)?j=!0:cr(p)?(j=!0,(p.tag!==null||p.anchor!==null)&&I(p,"alias node should not have any properties")):Fe(p,G,s===H)&&(j=!0,p.tag===null&&(p.tag="?")),p.anchor!==null&&Y(p,p.anchor,p.result)}else _===0&&(j=S&&Ce(p,nt));if(p.tag===null)p.anchor!==null&&Y(p,p.anchor,p.result);else if(p.tag==="?"){p.result!==null&&p.kind!=="scalar"&&I(p,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+p.kind+'"');for(let ut=0,gt=p.implicitTypes.length;ut<gt;ut+=1)if(Z=p.implicitTypes[ut],Z.resolve(p.result)){p.result=Z.construct(p.result),p.tag=Z.tag,p.anchor!==null&&Y(p,p.anchor,p.result);break}}else if(p.tag!=="!"){if(o.call(p.typeMap[p.kind||"fallback"],p.tag))Z=p.typeMap[p.kind||"fallback"][p.tag];else{Z=null;const ut=p.typeMap.multi[p.kind||"fallback"];for(let gt=0,vt=ut.length;gt<vt;gt+=1)if(p.tag.slice(0,ut[gt].tag.length)===ut[gt].tag){Z=ut[gt];break}}Z||I(p,"unknown tag !<"+p.tag+">"),p.result!==null&&Z.kind!==p.kind&&I(p,"unacceptable node kind for !<"+p.tag+'> tag; it should be "'+Z.kind+'", not "'+p.kind+'"'),Z.resolve(p.result,p.tag)?(p.result=Z.construct(p.result,p.tag),p.anchor!==null&&Y(p,p.anchor,p.result)):I(p,"cannot resolve a node with !<"+p.tag+"> explicit tag")}return p.listener!==null&&p.listener("close",p),p.depth-=1,p.tag!==null||p.anchor!==null||j}g(de,"composeNode");function Rr(p){const A=p.position;let H=!1,U;for(p.version=null,p.checkLineBreaks=p.legacy,p.tagMap=Object.create(null),p.anchorMap=Object.create(null);(U=p.input.charCodeAt(p.position))!==0&&(wt(p,!0,-1),U=p.input.charCodeAt(p.position),!(p.lineIndent>0||U!==37));){H=!0,U=p.input.charCodeAt(++p.position);let D=p.position;for(;U!==0&&!w(U);)U=p.input.charCodeAt(++p.position);const Q=p.input.slice(D,p.position),S=[];for(Q.length<1&&I(p,"directive name must not be less than one character in length");U!==0;){for(;T(U);)U=p.input.charCodeAt(++p.position);if(U===35){do U=p.input.charCodeAt(++p.position);while(U!==0&&!b(U));break}if(b(U))break;for(D=p.position;U!==0&&!w(U);)U=p.input.charCodeAt(++p.position);S.push(p.input.slice(D,p.position))}U!==0&&Mt(p),o.call(Tt,Q)?Tt[Q](p,Q,S):P(p,'unknown document directive "'+Q+'"')}if(wt(p,!0,-1),p.lineIndent===0&&p.input.charCodeAt(p.position)===45&&p.input.charCodeAt(p.position+1)===45&&p.input.charCodeAt(p.position+2)===45?(p.position+=3,wt(p,!0,-1)):H&&I(p,"directives end mark is expected"),de(p,p.lineIndent-1,h,!1,!0),wt(p,!0,-1),p.checkLineBreaks&&f.test(p.input.slice(A,p.position))&&P(p,"non-ASCII line breaks are interpreted as content"),p.documents.push(p.result),p.position===p.lineStart&&Xt(p)){p.input.charCodeAt(p.position)===46&&(p.position+=3,wt(p,!0,-1));return}p.position<p.length-1&&I(p,"end of the stream or a document separator is expected")}g(Rr,"readDocument");function dr(p,A){p=String(p),A=A||{},p.length!==0&&(p.charCodeAt(p.length-1)!==10&&p.charCodeAt(p.length-1)!==13&&(p+=`
291
- `),p.charCodeAt(0)===65279&&(p=p.slice(1)));const H=new z(p,A),U=p.indexOf("\0");for(U!==-1&&(H.position=U,I(H,"null byte is not allowed in input")),H.input+="\0";H.input.charCodeAt(H.position)===32;)H.lineIndent+=1,H.position+=1;for(;H.position<H.length-1;)Rr(H);return H.documents}g(dr,"loadDocuments");function ur(p,A,H){A!==null&&typeof A=="object"&&typeof H>"u"&&(H=A,A=null);const U=dr(p,H);if(typeof A!="function")return U;for(let D=0,Q=U.length;D<Q;D+=1)A(U[D])}g(ur,"loadAll2");function qr(p,A){const H=dr(p,A);if(H.length!==0){if(H.length===1)return H[0];throw new t("expected a single document in the stream, but found more")}}return g(qr,"load2"),Ai.loadAll=ur,Ai.load=qr,Ai}g(mu,"requireLoader");var Qo={},yl;function yu(){if(yl)return Qo;yl=1;const e=_r(),t=Mr(),r=po(),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=65279,a=9,n=10,h=13,c=32,l=33,d=34,u=35,f=37,m=38,y=39,x=42,C=44,b=45,T=58,w=61,B=62,F=63,L=64,v=91,R=93,N=96,q=123,J=124,W=125,z={};z[0]="\\0",z[7]="\\a",z[8]="\\b",z[9]="\\t",z[10]="\\n",z[11]="\\v",z[12]="\\f",z[13]="\\r",z[27]="\\e",z[34]='\\"',z[92]="\\\\",z[133]="\\N",z[160]="\\_",z[8232]="\\L",z[8233]="\\P";const V=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],I=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function P(S,_){if(_===null)return{};const K={},j=Object.keys(_);for(let X=0,Z=j.length;X<Z;X+=1){let G=j[X],nt=String(_[G]);G.slice(0,2)==="!!"&&(G="tag:yaml.org,2002:"+G.slice(2));const it=S.compiledTypeMap.fallback[G];it&&o.call(it.styleAliases,nt)&&(nt=it.styleAliases[nt]),K[G]=nt}return K}g(P,"compileStyleMap");function Y(S){let _,K;const j=S.toString(16).toUpperCase();if(S<=255)_="x",K=2;else if(S<=65535)_="u",K=4;else if(S<=4294967295)_="U",K=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+_+e.repeat("0",K-j.length)+j}g(Y,"encodeHex");const lt=1,at=2;function Ct(S){this.schema=S.schema||r,this.indent=Math.max(1,S.indent||2),this.noArrayIndent=S.noArrayIndent||!1,this.skipInvalid=S.skipInvalid||!1,this.flowLevel=e.isNothing(S.flowLevel)?-1:S.flowLevel,this.styleMap=P(this.schema,S.styles||null),this.sortKeys=S.sortKeys||!1,this.lineWidth=S.lineWidth||80,this.noRefs=S.noRefs||!1,this.noCompatMode=S.noCompatMode||!1,this.condenseFlow=S.condenseFlow||!1,this.quotingType=S.quotingType==='"'?at:lt,this.forceQuotes=S.forceQuotes||!1,this.replacer=typeof S.replacer=="function"?S.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}g(Ct,"State");function Et(S,_){const K=e.repeat(" ",_);let j=0,X="";const Z=S.length;for(;j<Z;){let G;const nt=S.indexOf(`
286
+ `),p.charCodeAt(0)===65279&&(p=p.slice(1)));const H=new z(p,A),U=p.indexOf("\0");for(U!==-1&&(H.position=U,I(H,"null byte is not allowed in input")),H.input+="\0";H.input.charCodeAt(H.position)===32;)H.lineIndent+=1,H.position+=1;for(;H.position<H.length-1;)Rr(H);return H.documents}g(dr,"loadDocuments");function ur(p,A,H){A!==null&&typeof A=="object"&&typeof H>"u"&&(H=A,A=null);const U=dr(p,H);if(typeof A!="function")return U;for(let D=0,Q=U.length;D<Q;D+=1)A(U[D])}g(ur,"loadAll2");function qr(p,A){const H=dr(p,A);if(H.length!==0){if(H.length===1)return H[0];throw new t("expected a single document in the stream, but found more")}}return g(qr,"load2"),Ei.loadAll=ur,Ei.load=qr,Ei}g(pu,"requireLoader");var Zo={},fl;function fu(){if(fl)return Zo;fl=1;const e=_r(),t=Mr(),r=go(),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=65279,a=9,n=10,h=13,c=32,l=33,d=34,u=35,f=37,m=38,y=39,x=42,C=44,b=45,T=58,w=61,B=62,F=63,L=64,v=91,R=93,N=96,q=123,J=124,W=125,z={};z[0]="\\0",z[7]="\\a",z[8]="\\b",z[9]="\\t",z[10]="\\n",z[11]="\\v",z[12]="\\f",z[13]="\\r",z[27]="\\e",z[34]='\\"',z[92]="\\\\",z[133]="\\N",z[160]="\\_",z[8232]="\\L",z[8233]="\\P";const V=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],I=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function P(S,_){if(_===null)return{};const K={},j=Object.keys(_);for(let X=0,Z=j.length;X<Z;X+=1){let G=j[X],nt=String(_[G]);G.slice(0,2)==="!!"&&(G="tag:yaml.org,2002:"+G.slice(2));const it=S.compiledTypeMap.fallback[G];it&&o.call(it.styleAliases,nt)&&(nt=it.styleAliases[nt]),K[G]=nt}return K}g(P,"compileStyleMap");function Y(S){let _,K;const j=S.toString(16).toUpperCase();if(S<=255)_="x",K=2;else if(S<=65535)_="u",K=4;else if(S<=4294967295)_="U",K=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+_+e.repeat("0",K-j.length)+j}g(Y,"encodeHex");const lt=1,at=2;function Ct(S){this.schema=S.schema||r,this.indent=Math.max(1,S.indent||2),this.noArrayIndent=S.noArrayIndent||!1,this.skipInvalid=S.skipInvalid||!1,this.flowLevel=e.isNothing(S.flowLevel)?-1:S.flowLevel,this.styleMap=P(this.schema,S.styles||null),this.sortKeys=S.sortKeys||!1,this.lineWidth=S.lineWidth||80,this.noRefs=S.noRefs||!1,this.noCompatMode=S.noCompatMode||!1,this.condenseFlow=S.condenseFlow||!1,this.quotingType=S.quotingType==='"'?at:lt,this.forceQuotes=S.forceQuotes||!1,this.replacer=typeof S.replacer=="function"?S.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}g(Ct,"State");function Et(S,_){const K=e.repeat(" ",_);let j=0,X="";const Z=S.length;for(;j<Z;){let G;const nt=S.indexOf(`
292
287
  `,j);nt===-1?(G=S.slice(j),j=Z):(G=S.slice(j,nt+1),j=nt+1),G.length&&G!==`
293
288
  `&&(X+=K),X+=G}return X}g(Et,"indentString");function mt(S,_){return`
294
- `+e.repeat(" ",S.indent*_)}g(mt,"generateNextLine");function Tt(S,_){for(let K=0,j=S.implicitTypes.length;K<j;K+=1)if(S.implicitTypes[K].resolve(_))return!0;return!1}g(Tt,"testImplicitResolving");function xt(S){return S===c||S===a}g(xt,"isWhitespace");function ht(S){return S>=32&&S<=126||S>=161&&S<=55295&&S!==8232&&S!==8233||S>=57344&&S<=65533&&S!==s||S>=65536&&S<=1114111}g(ht,"isPrintable");function kt(S){return ht(S)&&S!==s&&S!==h&&S!==n}g(kt,"isNsCharOrWhitespace");function Mt(S,_,K){const j=kt(S),X=j&&!xt(S);return(K?j:j&&S!==C&&S!==v&&S!==R&&S!==q&&S!==W)&&S!==u&&!(_===T&&!X)||kt(_)&&!xt(_)&&S===u||_===T&&X}g(Mt,"isPlainSafe");function wt(S){return ht(S)&&S!==s&&!xt(S)&&S!==b&&S!==F&&S!==T&&S!==C&&S!==v&&S!==R&&S!==q&&S!==W&&S!==u&&S!==m&&S!==x&&S!==l&&S!==J&&S!==w&&S!==B&&S!==y&&S!==d&&S!==f&&S!==L&&S!==N}g(wt,"isPlainSafeFirst");function Xt(S){return!xt(S)&&S!==T}g(Xt,"isPlainSafeLast");function qt(S,_){const K=S.charCodeAt(_);let j;return K>=55296&&K<=56319&&_+1<S.length&&(j=S.charCodeAt(_+1),j>=56320&&j<=57343)?(K-55296)*1024+j-56320+65536:K}g(qt,"codePointAt");function Fe(S){return/^\n* /.test(S)}g(Fe,"needIndentIndicator");const nr=1,ye=2,Or=3,$r=4,Ce=5;function lr(S,_,K,j,X,Z,G,nt){let it,ut=0,gt=null,vt=!1,Ot=!1;const Ua=j!==-1;let Nr=-1,Wr=wt(qt(S,0))&&Xt(qt(S,S.length-1));if(_||G)for(it=0;it<S.length;ut>=65536?it+=2:it++){if(ut=qt(S,it),!ht(ut))return Ce;Wr=Wr&&Mt(ut,gt,nt),gt=ut}else{for(it=0;it<S.length;ut>=65536?it+=2:it++){if(ut=qt(S,it),ut===n)vt=!0,Ua&&(Ot=Ot||it-Nr-1>j&&S[Nr+1]!==" ",Nr=it);else if(!ht(ut))return Ce;Wr=Wr&&Mt(ut,gt,nt),gt=ut}Ot=Ot||Ua&&it-Nr-1>j&&S[Nr+1]!==" "}return!vt&&!Ot?Wr&&!G&&!X(S)?nr:Z===at?Ce:ye:K>9&&Fe(S)?Ce:G?Z===at?Ce:ye:Ot?$r:Or}g(lr,"chooseScalarStyle");function Dr(S,_,K,j,X){S.dump=(function(){if(_.length===0)return S.quotingType===at?'""':"''";if(!S.noCompatMode&&(V.indexOf(_)!==-1||I.test(_)))return S.quotingType===at?'"'+_+'"':"'"+_+"'";const Z=S.indent*Math.max(1,K),G=S.lineWidth===-1?-1:Math.max(Math.min(S.lineWidth,40),S.lineWidth-Z),nt=j||S.flowLevel>-1&&K>=S.flowLevel;function it(ut){return Tt(S,ut)}switch(g(it,"testAmbiguity"),lr(_,nt,S.indent,G,it,S.quotingType,S.forceQuotes&&!j,X)){case nr:return _;case ye:return"'"+_.replace(/'/g,"''")+"'";case Or:return"|"+hr(_,S.indent)+cr(Et(_,Z));case $r:return">"+hr(_,S.indent)+cr(Et(Pr(_,G),Z));case Ce:return'"'+Rr(_)+'"';default:throw new t("impossible error: invalid scalar style")}})()}g(Dr,"writeScalar");function hr(S,_){const K=Fe(S)?String(_):"",j=S[S.length-1]===`
289
+ `+e.repeat(" ",S.indent*_)}g(mt,"generateNextLine");function Tt(S,_){for(let K=0,j=S.implicitTypes.length;K<j;K+=1)if(S.implicitTypes[K].resolve(_))return!0;return!1}g(Tt,"testImplicitResolving");function xt(S){return S===c||S===a}g(xt,"isWhitespace");function ht(S){return S>=32&&S<=126||S>=161&&S<=55295&&S!==8232&&S!==8233||S>=57344&&S<=65533&&S!==s||S>=65536&&S<=1114111}g(ht,"isPrintable");function kt(S){return ht(S)&&S!==s&&S!==h&&S!==n}g(kt,"isNsCharOrWhitespace");function Mt(S,_,K){const j=kt(S),X=j&&!xt(S);return(K?j:j&&S!==C&&S!==v&&S!==R&&S!==q&&S!==W)&&S!==u&&!(_===T&&!X)||kt(_)&&!xt(_)&&S===u||_===T&&X}g(Mt,"isPlainSafe");function wt(S){return ht(S)&&S!==s&&!xt(S)&&S!==b&&S!==F&&S!==T&&S!==C&&S!==v&&S!==R&&S!==q&&S!==W&&S!==u&&S!==m&&S!==x&&S!==l&&S!==J&&S!==w&&S!==B&&S!==y&&S!==d&&S!==f&&S!==L&&S!==N}g(wt,"isPlainSafeFirst");function Xt(S){return!xt(S)&&S!==T}g(Xt,"isPlainSafeLast");function qt(S,_){const K=S.charCodeAt(_);let j;return K>=55296&&K<=56319&&_+1<S.length&&(j=S.charCodeAt(_+1),j>=56320&&j<=57343)?(K-55296)*1024+j-56320+65536:K}g(qt,"codePointAt");function Fe(S){return/^\n* /.test(S)}g(Fe,"needIndentIndicator");const nr=1,ye=2,Or=3,$r=4,Ce=5;function lr(S,_,K,j,X,Z,G,nt){let it,ut=0,gt=null,vt=!1,Ot=!1;const Xa=j!==-1;let Nr=-1,Wr=wt(qt(S,0))&&Xt(qt(S,S.length-1));if(_||G)for(it=0;it<S.length;ut>=65536?it+=2:it++){if(ut=qt(S,it),!ht(ut))return Ce;Wr=Wr&&Mt(ut,gt,nt),gt=ut}else{for(it=0;it<S.length;ut>=65536?it+=2:it++){if(ut=qt(S,it),ut===n)vt=!0,Xa&&(Ot=Ot||it-Nr-1>j&&S[Nr+1]!==" ",Nr=it);else if(!ht(ut))return Ce;Wr=Wr&&Mt(ut,gt,nt),gt=ut}Ot=Ot||Xa&&it-Nr-1>j&&S[Nr+1]!==" "}return!vt&&!Ot?Wr&&!G&&!X(S)?nr:Z===at?Ce:ye:K>9&&Fe(S)?Ce:G?Z===at?Ce:ye:Ot?$r:Or}g(lr,"chooseScalarStyle");function Dr(S,_,K,j,X){S.dump=(function(){if(_.length===0)return S.quotingType===at?'""':"''";if(!S.noCompatMode&&(V.indexOf(_)!==-1||I.test(_)))return S.quotingType===at?'"'+_+'"':"'"+_+"'";const Z=S.indent*Math.max(1,K),G=S.lineWidth===-1?-1:Math.max(Math.min(S.lineWidth,40),S.lineWidth-Z),nt=j||S.flowLevel>-1&&K>=S.flowLevel;function it(ut){return Tt(S,ut)}switch(g(it,"testAmbiguity"),lr(_,nt,S.indent,G,it,S.quotingType,S.forceQuotes&&!j,X)){case nr:return _;case ye:return"'"+_.replace(/'/g,"''")+"'";case Or:return"|"+hr(_,S.indent)+cr(Et(_,Z));case $r:return">"+hr(_,S.indent)+cr(Et(Pr(_,G),Z));case Ce:return'"'+Rr(_)+'"';default:throw new t("impossible error: invalid scalar style")}})()}g(Dr,"writeScalar");function hr(S,_){const K=Fe(S)?String(_):"",j=S[S.length-1]===`
295
290
  `,Z=j&&(S[S.length-2]===`
296
291
  `||S===`
297
292
  `)?"+":j?"":"-";return K+Z+`
@@ -303,18 +298,18 @@ ${o.join(`
303
298
  `+S.slice(X,Z),X=Z+1),G=nt;return it+=`
304
299
  `,S.length-X>_&&G>X?it+=S.slice(X,G)+`
305
300
  `+S.slice(G+1):it+=S.slice(X),it.slice(1)}g(de,"foldLine");function Rr(S){let _="",K=0;for(let j=0;j<S.length;K>=65536?j+=2:j++){K=qt(S,j);const X=z[K];!X&&ht(K)?(_+=S[j],K>=65536&&(_+=S[j+1])):_+=X||Y(K)}return _}g(Rr,"escapeString");function dr(S,_,K){let j="";const X=S.tag;for(let Z=0,G=K.length;Z<G;Z+=1){let nt=K[Z];S.replacer&&(nt=S.replacer.call(K,String(Z),nt)),(H(S,_,nt,!1,!1)||typeof nt>"u"&&H(S,_,null,!1,!1))&&(j!==""&&(j+=","+(S.condenseFlow?"":" ")),j+=S.dump)}S.tag=X,S.dump="["+j+"]"}g(dr,"writeFlowSequence");function ur(S,_,K,j){let X="";const Z=S.tag;for(let G=0,nt=K.length;G<nt;G+=1){let it=K[G];S.replacer&&(it=S.replacer.call(K,String(G),it)),(H(S,_+1,it,!0,!0,!1,!0)||typeof it>"u"&&H(S,_+1,null,!0,!0,!1,!0))&&((!j||X!=="")&&(X+=mt(S,_)),S.dump&&n===S.dump.charCodeAt(0)?X+="-":X+="- ",X+=S.dump)}S.tag=Z,S.dump=X||"[]"}g(ur,"writeBlockSequence");function qr(S,_,K){let j="";const X=S.tag,Z=Object.keys(K);for(let G=0,nt=Z.length;G<nt;G+=1){let it="";j!==""&&(it+=", "),S.condenseFlow&&(it+='"');const ut=Z[G];let gt=K[ut];S.replacer&&(gt=S.replacer.call(K,ut,gt)),H(S,_,ut,!1,!1)&&(S.dump.length>1024&&(it+="? "),it+=S.dump+(S.condenseFlow?'"':"")+":"+(S.condenseFlow?"":" "),H(S,_,gt,!1,!1)&&(it+=S.dump,j+=it))}S.tag=X,S.dump="{"+j+"}"}g(qr,"writeFlowMapping");function p(S,_,K,j){let X="";const Z=S.tag,G=Object.keys(K);if(S.sortKeys===!0)G.sort();else if(typeof S.sortKeys=="function")G.sort(S.sortKeys);else if(S.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let nt=0,it=G.length;nt<it;nt+=1){let ut="";(!j||X!=="")&&(ut+=mt(S,_));const gt=G[nt];let vt=K[gt];if(S.replacer&&(vt=S.replacer.call(K,gt,vt)),!H(S,_+1,gt,!0,!0,!0))continue;const Ot=S.tag!==null&&S.tag!=="?"||S.dump&&S.dump.length>1024;Ot&&(S.dump&&n===S.dump.charCodeAt(0)?ut+="?":ut+="? "),ut+=S.dump,Ot&&(ut+=mt(S,_)),H(S,_+1,vt,!0,Ot)&&(S.dump&&n===S.dump.charCodeAt(0)?ut+=":":ut+=": ",ut+=S.dump,X+=ut)}S.tag=Z,S.dump=X||"{}"}g(p,"writeBlockMapping");function A(S,_,K){const j=K?S.explicitTypes:S.implicitTypes;for(let X=0,Z=j.length;X<Z;X+=1){const G=j[X];if((G.instanceOf||G.predicate)&&(!G.instanceOf||typeof _=="object"&&_ instanceof G.instanceOf)&&(!G.predicate||G.predicate(_))){if(K?G.multi&&G.representName?S.tag=G.representName(_):S.tag=G.tag:S.tag="?",G.represent){const nt=S.styleMap[G.tag]||G.defaultStyle;let it;if(i.call(G.represent)==="[object Function]")it=G.represent(_,nt);else if(o.call(G.represent,nt))it=G.represent[nt](_,nt);else throw new t("!<"+G.tag+'> tag resolver accepts not "'+nt+'" style');S.dump=it}return!0}}return!1}g(A,"detectType");function H(S,_,K,j,X,Z,G){S.tag=null,S.dump=K,A(S,K,!1)||A(S,K,!0);const nt=i.call(S.dump),it=j;j&&(j=S.flowLevel<0||S.flowLevel>_);const ut=nt==="[object Object]"||nt==="[object Array]";let gt,vt;if(ut&&(gt=S.duplicates.indexOf(K),vt=gt!==-1),(S.tag!==null&&S.tag!=="?"||vt||S.indent!==2&&_>0)&&(X=!1),vt&&S.usedDuplicates[gt])S.dump="*ref_"+gt;else{if(ut&&vt&&!S.usedDuplicates[gt]&&(S.usedDuplicates[gt]=!0),nt==="[object Object]")j&&Object.keys(S.dump).length!==0?(p(S,_,S.dump,X),vt&&(S.dump="&ref_"+gt+S.dump)):(qr(S,_,S.dump),vt&&(S.dump="&ref_"+gt+" "+S.dump));else if(nt==="[object Array]")j&&S.dump.length!==0?(S.noArrayIndent&&!G&&_>0?ur(S,_-1,S.dump,X):ur(S,_,S.dump,X),vt&&(S.dump="&ref_"+gt+S.dump)):(dr(S,_,S.dump),vt&&(S.dump="&ref_"+gt+" "+S.dump));else if(nt==="[object String]")S.tag!=="?"&&Dr(S,S.dump,_,Z,it);else{if(nt==="[object Undefined]")return!1;if(S.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+nt)}if(S.tag!==null&&S.tag!=="?"){let Ot=encodeURI(S.tag[0]==="!"?S.tag.slice(1):S.tag).replace(/!/g,"%21");S.tag[0]==="!"?Ot="!"+Ot:Ot.slice(0,18)==="tag:yaml.org,2002:"?Ot="!!"+Ot.slice(18):Ot="!<"+Ot+">",S.dump=Ot+" "+S.dump}}return!0}g(H,"writeNode");function U(S,_){const K=[],j=[];D(S,K,j);const X=j.length;for(let Z=0;Z<X;Z+=1)_.duplicates.push(K[j[Z]]);_.usedDuplicates=new Array(X)}g(U,"getDuplicateReferences");function D(S,_,K){if(S!==null&&typeof S=="object"){const j=_.indexOf(S);if(j!==-1)K.indexOf(j)===-1&&K.push(j);else if(_.push(S),Array.isArray(S))for(let X=0,Z=S.length;X<Z;X+=1)D(S[X],_,K);else{const X=Object.keys(S);for(let Z=0,G=X.length;Z<G;Z+=1)D(S[X[Z]],_,K)}}}g(D,"inspectNode");function Q(S,_){_=_||{};const K=new Ct(_);K.noRefs||U(S,K);let j=S;return K.replacer&&(j=K.replacer.call({"":j},"",j)),H(K,0,j,!0,!0)?K.dump+`
306
- `:""}return g(Q,"dump2"),Qo.dump=Q,Qo}g(yu,"requireDumper");var Cl;function Cu(){if(Cl)return Ut;Cl=1;const e=mu(),t=yu();function r(i,o){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return g(r,"renamed"),Ut.Type=Zt(),Ut.Schema=ba(),Ut.FAILSAFE_SCHEMA=wa(),Ut.JSON_SCHEMA=Ea(),Ut.CORE_SCHEMA=Aa(),Ut.DEFAULT_SCHEMA=po(),Ut.load=e.load,Ut.loadAll=e.loadAll,Ut.dump=t.dump,Ut.YAMLException=Mr(),Ut.types={binary:Ia(),float:Fa(),map:Ta(),null:Ba(),pairs:$a(),set:Da(),timestamp:_a(),bool:va(),int:La(),merge:Ma(),omap:Oa(),seq:Sa(),str:ka()},Ut.safeLoad=r("safeLoad","load"),Ut.safeLoadAll=r("safeLoadAll","loadAll"),Ut.safeDump=r("safeDump","dump"),Ut}g(Cu,"requireJsYaml");var nx=Cu(),lx=pu(nx),{Type:v2,Schema:L2,FAILSAFE_SCHEMA:F2,JSON_SCHEMA:hx,CORE_SCHEMA:E2,DEFAULT_SCHEMA:A2,load:cx,loadAll:_2,dump:M2,YAMLException:I2,types:O2,safeLoad:$2,safeLoadAll:D2,safeDump:P2}=lx,dx={common:fi,getConfig:Dt,insertCluster:Wd,insertEdge:Yd,insertEdgeLabel:xa,insertMarkers:Ud,insertNode:Ca,interpolateToCurve:Vs,labelHelper:ct,log:M,positionEdgeLabel:wC},hi={},xu=g(e=>{for(const t of e)hi[t.name]=t},"registerLayoutLoaders"),ux=g(()=>{xu([{name:"dagre",loader:g(async()=>await bt(()=>import("./dagre-GXQ25YYZ-BgrGEY09.js"),[],import.meta.url),"loader")},{name:"swimlane",loader:g(async()=>await bt(()=>import("./swimlanes-42K2YHIH-BQTDK2Ta.js"),[],import.meta.url),"loader")},{name:"cose-bilkent",loader:g(async()=>await bt(()=>import("./cose-bilkent-JH36ORCC-BsK2pWDL.js"),[],import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");ux();var R2=g(async(e,t)=>{if(!(e.layoutAlgorithm in hi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const l of e.nodes){const d=l.domId||l.id;l.domId=`${e.diagramId}-${d}`}const r=hi[e.layoutAlgorithm],i=await r.loader(),{theme:o,themeVariables:s}=e.config,{useGradient:a,gradientStart:n,gradientStop:h}=s,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),a){const l=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");l.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),l.append("svg:stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}return i.render(e,t,dx,{algorithm:r.algorithm})},"render"),q2=g((e="",{fallback:t="dagre"}={})=>{if(e in hi)return e;if(t in hi)return M.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Pa="comm",bu="rule",ku="decl",gx="@media",px="@import",fx="@supports",mx="@namespace",Es="@keyframes",Su="@layer",yx="@scope",Cx=Math.abs,si=String.fromCharCode;function Tu(e){return e.trim()}function As(e,t,r){return e.replace(t,r)}function kr(e,t){return e.charCodeAt(t)|0}function vr(e,t,r){return e.slice(t,r)}function Se(e){return e.length}function wu(e){return e.length}function _i(e,t){return t.push(e),e}var fo=1,Lr=1,Bu=0,ne=0,Nt=0,Ir="";function Ra(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:fo,column:Lr,length:a,return:"",siblings:n}}function xx(){return Nt}function bx(){return Nt=ne>0?kr(Ir,--ne):0,Lr--,Nt===10&&(Lr=1,fo--),Nt}function pe(){return Nt=ne<Bu?kr(Ir,ne++):0,Lr++,Nt===10&&(Lr=1,fo++),Nt}function qe(){return kr(Ir,ne)}function Pi(){return ne}function mo(e,t){return vr(Ir,e,t)}function ci(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function kx(e){return fo=Lr=1,Bu=Se(Ir=e),ne=0,[]}function Sx(e){return Ir="",e}function Jo(e){return Tu(mo(ne-1,_s(e===91?e+2:e===40?e+1:e)))}function Tx(e){for(;(Nt=qe())&&Nt<33;)pe();return ci(e)>2||ci(Nt)>3?"":" "}function wx(e,t){for(;--t&&pe()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return mo(e,Pi()+(t<6&&qe()==32&&pe()==32))}function _s(e){for(;pe();)switch(Nt){case e:return ne;case 34:case 39:e!==34&&e!==39&&_s(Nt);break;case 40:e===41&&_s(e);break;case 92:pe();break}return ne}function Bx(e,t){for(;pe()&&e+Nt!==57;)if(e+Nt===84&&qe()===47)break;return"/*"+mo(t,ne-1)+"*"+si(e===47?e:pe())}function vx(e){for(;!ci(qe());)pe();return mo(e,ne)}function Lx(e){return Sx(Ri("",null,null,null,[""],e=kx(e),0,[0],e))}function Ri(e,t,r,i,o,s,a,n,h){for(var c=0,l=0,d=a,u=0,f=0,m=0,y=1,x=1,C=1,b=0,T=0,w="",B=o,F=s,L=i,v=w;x;)switch(m=T,T=pe()){case 40:m!=108&&kr(v,d-1)==58?(b++,v+="("):v+=Jo(T);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=Jo(T);break;case 9:case 10:case 13:case 32:if(b>0){v+=si(T);break}v+=Tx(m);break;case 92:v+=wx(Pi()-1,7);continue;case 47:switch(qe()){case 42:case 47:_i(Fx(Bx(pe(),Pi()),t,r,h),h),(ci(m||1)==5||ci(qe()||1)==5)&&Se(v)&&vr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*y:n[c++]=Se(v)*C;case 125*y:case 59:case 0:if(b>0&&T){v+=si(T);break}switch(T){case 0:case 125:x=0;case 59+l:C==-1&&(v=As(v,/\f/g,"")),f>0&&(Se(v)-d||y===0)&&_i(f>32?bl(v+";",i,r,d-1,h):bl(As(v," ","")+";",i,r,d-2,h),h);break;case 59:v+=";";default:if(_i(L=xl(v,t,r,c,l,o,n,w,B=[],F=[],d,s),s),T===123)if(l===0)Ri(v,t,L,L,B,s,d,n,F);else{switch(u){case 99:if(kr(v,3)===110)break;case 108:if(kr(v,2)===97)break;default:l=0;case 100:case 109:case 115:}l?Ri(e,L,L,i&&_i(xl(e,L,L,0,0,o,n,w,o,B=[],d,F),F),o,F,d,n,i?B:F):Ri(v,L,L,L,[""],F,0,n,F)}}c=l=f=0,y=C=1,w=v="",d=a;break;case 58:d=1+Se(v),f=m;default:if(y<1){if(T==123)--y;else if(T==125&&y++==0&&bx()==125)continue}switch(v+=si(T),T*y){case 38:C=l>0?1:(v+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Se(v)-1)*C,C=1;break;case 64:qe()===45&&(v+=Jo(pe())),u=qe(),l=d=Se(w=v+=vx(Pi())),T++;break;case 45:m===45&&Se(v)==2&&(y=0)}}return s}function xl(e,t,r,i,o,s,a,n,h,c,l,d){for(var u=o-1,f=o===0?s:[""],m=wu(f),y=0,x=0,C=0;y<i;++y)for(var b=0,T=vr(e,u+1,u=Cx(x=a[y])),w=e;b<m;++b)(w=Tu(x>0?f[b]+" "+T:As(T,/&\f/g,f[b])))&&(h[C++]=w);return Ra(e,t,r,o===0?bu:n,h,c,l,d)}function Fx(e,t,r,i){return Ra(e,t,r,Pa,si(xx()),vr(e,2,-2),0,i)}function bl(e,t,r,i,o){return Ra(e,t,r,ku,vr(e,0,i),vr(e,i+1,-1),i,o)}function Ms(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function Ex(e,t,r,i){switch(e.type){case Su:if(e.children.length)break;case px:case mx:case ku:return e.return=e.return||e.value;case Pa:return"";case Es:return e.return=e.value+"{"+Ms(e.children,i)+"}";case bu:if(!Se(e.value=e.props.join(",")))return""}return Se(r=Ms(e.children,i))?e.return=e.value+"{"+r+"}":""}function Ax(e){var t=wu(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var vu="c4",_x=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Mx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./c4Diagram-7LVT6UL2-auJZQjpw.js");return{diagram:t}},[],import.meta.url);return{id:vu,diagram:e}},"loader"),Ix={id:vu,detector:_x,loader:Mx},Ox=Ix,Lu="flowchart",$x=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),Dx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW-BrbR1EkW.js").then(r=>r.f);return{diagram:t}},[],import.meta.url);return{id:Lu,diagram:e}},"loader"),Px={id:Lu,detector:$x,loader:Dx},Rx=Px,Fu="flowchart-v2",qx=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),Nx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW-BrbR1EkW.js").then(r=>r.f);return{diagram:t}},[],import.meta.url);return{id:Fu,diagram:e}},"loader"),Wx={id:Fu,detector:qx,loader:Nx},zx=Wx,Eu="swimlane",Hx=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Yx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./swimlanesDiagram-VR7AAH4N-BV8Vb5g2.js");return{diagram:t}},[],import.meta.url);return{id:Eu,diagram:e}},"loader"),jx={id:Eu,detector:Hx,loader:Yx},Xx=jx,Au="er",Ux=g(e=>/^\s*erDiagram/.test(e),"detector"),Gx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./erDiagram-RLTQ6QDP-zwXEFcAp.js");return{diagram:t}},[],import.meta.url);return{id:Au,diagram:e}},"loader"),Vx={id:Au,detector:Ux,loader:Gx},Kx=Vx,_u="gitGraph",Zx=g(e=>/^\s*gitGraph/.test(e),"detector"),Qx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-WWUBYQGX-BujqTwbf.js");return{diagram:t}},[],import.meta.url);return{id:_u,diagram:e}},"loader"),Jx={id:_u,detector:Zx,loader:Qx},t0=Jx,Mu="gantt",e0=g(e=>/^\s*gantt/.test(e),"detector"),r0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./ganttDiagram-EL5Y4UJY-DfJDZVnm.js");return{diagram:t}},[],import.meta.url);return{id:Mu,diagram:e}},"loader"),i0={id:Mu,detector:e0,loader:r0},o0=i0,Iu="info",s0=g(e=>/^\s*info/.test(e),"detector"),a0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./infoDiagram-27XIBGKW-C18Zz25F.js");return{diagram:t}},[],import.meta.url);return{id:Iu,diagram:e}},"loader"),n0={id:Iu,detector:s0,loader:a0},Ou="pie",l0=g(e=>/^\s*pie/.test(e),"detector"),h0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./pieDiagram-E7YTZNPT-EvMxJb2S.js");return{diagram:t}},[],import.meta.url);return{id:Ou,diagram:e}},"loader"),c0={id:Ou,detector:l0,loader:h0},$u="quadrantChart",d0=g(e=>/^\s*quadrantChart/.test(e),"detector"),u0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./quadrantDiagram-AXDQQJYC-rFaTvNlk.js");return{diagram:t}},[],import.meta.url);return{id:$u,diagram:e}},"loader"),g0={id:$u,detector:d0,loader:u0},p0=g0,Du="xychart",f0=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),m0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./xychartDiagram-S5SC5T6Z-BXkM4beH.js");return{diagram:t}},[],import.meta.url);return{id:Du,diagram:e}},"loader"),y0={id:Du,detector:f0,loader:m0},C0=y0,Pu="requirement",x0=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),b0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./requirementDiagram-BXWQKSXE-DHLQ_9Lw.js");return{diagram:t}},[],import.meta.url);return{id:Pu,diagram:e}},"loader"),k0={id:Pu,detector:x0,loader:b0},S0=k0,Ru="sequence",T0=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),w0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./sequenceDiagram-WJ2MYXX4-Dm3QM01Z.js");return{diagram:t}},[],import.meta.url);return{id:Ru,diagram:e}},"loader"),B0={id:Ru,detector:T0,loader:w0},v0=B0,qu="class",L0=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),F0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./classDiagram-ZZMXUADV-CGdcKCOI.js");return{diagram:t}},[],import.meta.url);return{id:qu,diagram:e}},"loader"),E0={id:qu,detector:L0,loader:F0},A0=E0,Nu="classDiagram",_0=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),M0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./classDiagram-v2-VYDZK3BY-CGdcKCOI.js");return{diagram:t}},[],import.meta.url);return{id:Nu,diagram:e}},"loader"),I0={id:Nu,detector:_0,loader:M0},O0=I0,Wu="state",$0=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),D0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./stateDiagram-D77RDMKH-mLSMGpPQ.js");return{diagram:t}},[],import.meta.url);return{id:Wu,diagram:e}},"loader"),P0={id:Wu,detector:$0,loader:D0},R0=P0,zu="stateDiagram",q0=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),N0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-MP3YSRHH-C6TftAzE.js");return{diagram:t}},[],import.meta.url);return{id:zu,diagram:e}},"loader"),W0={id:zu,detector:q0,loader:N0},z0=W0,Hu="journey",H0=g(e=>/^\s*journey/.test(e),"detector"),Y0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./journeyDiagram-3NMN7TZE-DpWKIFIN.js");return{diagram:t}},[],import.meta.url);return{id:Hu,diagram:e}},"loader"),j0={id:Hu,detector:H0,loader:Y0},X0=j0,U0=g((e,t,r)=>{M.debug(`rendering svg for syntax error
307
- `);const i=Jf(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Th(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Yu={draw:U0},G0=Yu,V0={db:{},renderer:Yu,parser:{parse:g(()=>{},"parse")}},K0=V0,ju="flowchart-elk",Z0=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),Q0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW-BrbR1EkW.js").then(r=>r.f);return{diagram:t}},[],import.meta.url);return{id:ju,diagram:e}},"loader"),J0={id:ju,detector:Z0,loader:Q0},tb=J0,Xu="timeline",eb=g(e=>/^\s*timeline/.test(e),"detector"),rb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./timeline-definition-24CTP7MA-CKtubk73.js");return{diagram:t}},[],import.meta.url);return{id:Xu,diagram:e}},"loader"),ib={id:Xu,detector:eb,loader:rb},ob=ib,Uu="mindmap",sb=g(e=>/^\s*mindmap/.test(e),"detector"),ab=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./mindmap-definition-YA3MSWOX-_1SBIPav.js");return{diagram:t}},[],import.meta.url);return{id:Uu,diagram:e}},"loader"),nb={id:Uu,detector:sb,loader:ab},lb=nb,Gu="kanban",hb=g(e=>/^\s*kanban/.test(e),"detector"),cb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./kanban-definition-UXKFOSKX-DxbTprYr.js");return{diagram:t}},[],import.meta.url);return{id:Gu,diagram:e}},"loader"),db={id:Gu,detector:hb,loader:cb},ub=db,Vu="sankey",gb=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),pb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./sankeyDiagram-P5KCCOFB-Nk71fRsK.js");return{diagram:t}},[],import.meta.url);return{id:Vu,diagram:e}},"loader"),fb={id:Vu,detector:gb,loader:pb},mb=fb,Ku="packet",yb=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),Cb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-Z3DM3KII-CY856Sry.js");return{diagram:t}},[],import.meta.url);return{id:Ku,diagram:e}},"loader"),xb={id:Ku,detector:yb,loader:Cb},Zu="radar",bb=g(e=>/^\s*radar-beta/.test(e),"detector"),kb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-UQ7AKVKN-BFkOO3Wu.js");return{diagram:t}},[],import.meta.url);return{id:Zu,diagram:e}},"loader"),Sb={id:Zu,detector:bb,loader:kb},Qu="block",Tb=g(e=>/^\s*block(-beta)?/.test(e),"detector"),wb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./blockDiagram-I7D4REHJ-CHicgYkf.js");return{diagram:t}},[],import.meta.url);return{id:Qu,diagram:e}},"loader"),Bb={id:Qu,detector:Tb,loader:wb},vb=Bb,Ju="treeView",Lb=g(e=>/^\s*treeView-beta/.test(e),"detector"),Fb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-S7CK7UJ4-hQvZziAN.js");return{diagram:t}},[],import.meta.url);return{id:Ju,diagram:e}},"loader"),Eb={id:Ju,detector:Lb,loader:Fb},Ab=Eb,tg="architecture",_b=g(e=>/^\s*architecture/.test(e),"detector"),Mb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./architectureDiagram-5GKGNRK7-C22xzf-o.js");return{diagram:t}},[],import.meta.url);return{id:tg,diagram:e}},"loader"),Ib={id:tg,detector:_b,loader:Mb},Ob=Ib,eg="eventmodeling",$b=g(e=>/^\s*eventmodeling/.test(e),"detector"),Db=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-VSXAHHWV-WVuzjdxU.js");return{diagram:t}},[],import.meta.url);return{id:eg,diagram:e}},"loader"),Pb={id:eg,detector:$b,loader:Db},Rb=Pb,rg="ishikawa",qb=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Nb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./ishikawaDiagram-5VMMS53U-DrEzfSK9.js");return{diagram:t}},[],import.meta.url);return{id:rg,diagram:e}},"loader"),Wb={id:rg,detector:qb,loader:Nb},ig="venn",zb=g(e=>/^\s*venn-beta/.test(e),"detector"),Hb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./vennDiagram-4TSXK5OY-Bq0xMhnH.js");return{diagram:t}},[],import.meta.url);return{id:ig,diagram:e}},"loader"),Yb={id:ig,detector:zb,loader:Hb},jb=Yb,og="treemap",Xb=g(e=>/^\s*treemap/.test(e),"detector"),Ub=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-VX7I27RA-_LUOsaBb.js");return{diagram:t}},[],import.meta.url);return{id:og,diagram:e}},"loader"),Gb={id:og,detector:Xb,loader:Ub},sg="wardley",Vb=g(e=>/^\s*wardley-beta/i.test(e),"detector"),Kb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./wardleyDiagram-VM6X3IG4-DL5LgQWr.js");return{diagram:t}},[],import.meta.url);return{id:sg,diagram:e}},"loader"),Zb={id:sg,detector:Vb,loader:Kb},Qb=Zb,ag="cynefin",Jb=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),tk=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./cynefinDiagram-5FMLGOSQ-vmheD_S2.js");return{diagram:t}},[],import.meta.url);return{id:ag,diagram:e}},"loader"),ek={id:ag,detector:Jb,loader:tk},ng="railroad",rk=g(e=>/^\s*railroad-beta/i.test(e),"detector"),ik=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./railroadDiagram-O6MQD6OU-bR7xXZGS.js");return{diagram:t}},[],import.meta.url);return{id:ng,diagram:e}},"loader"),ok={id:ng,detector:rk,loader:ik},lg="railroadEbnf",sk=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),ak=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./ebnfDiagram-PWID7BFC-kqD9RLAA.js");return{diagram:t}},[],import.meta.url);return{id:lg,diagram:e}},"loader"),nk={id:lg,detector:sk,loader:ak},hg="railroadAbnf",lk=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),hk=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./abnfDiagram-VCTEODGH-m7LJLYga.js");return{diagram:t}},[],import.meta.url);return{id:hg,diagram:e}},"loader"),ck={id:hg,detector:lk,loader:hk},cg="railroadPeg",dk=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),uk=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./pegDiagram-XKGWAZYB-BBVcHZ8T.js");return{diagram:t}},[],import.meta.url);return{id:cg,diagram:e}},"loader"),gk={id:cg,detector:dk,loader:uk},kl=!1,yo=g(()=>{kl||(kl=!0,Yi("error",K0,e=>e.toLowerCase().trim()==="error"),Yi("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),hs(tb,lb,Ob),hs(Ox,ub,O0,A0,Kx,o0,n0,c0,S0,v0,Xx,zx,Rx,ob,t0,z0,R0,X0,p0,mb,xb,C0,vb,Rb,Ab,Sb,Wb,Gb,ok,nk,ck,gk,jb,Qb,ek))},"addDiagrams"),pk=g(async()=>{M.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(tr).map(async([r,{detector:i,loader:o}])=>{if(o)try{gs(r)}catch{try{const{diagram:s,id:a}=await o();Yi(a,s,i)}catch(s){throw M.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete tr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){M.error(`Failed to load ${t.length} external diagrams`);for(const r of t)M.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),fk="graphics-document document";function dg(e,t){e.attr("role",fk),t!==""&&e.attr("aria-roledescription",t)}g(dg,"setA11yDiagramInfo");function ug(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}g(ug,"addSVGa11yTitleDescription");var Is=class gg{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{g(this,"Diagram")}static async fromText(t,r={}){const i=Dt(),o=Hs(t,i);t=Lm(t)+`
308
- `;try{gs(o)}catch{const c=Tf(o);if(!c)throw new yh(`Diagram ${o} not found.`);const{id:l,diagram:d}=await c();Yi(l,d)}const{db:s,parser:a,renderer:n,init:h}=gs(o);return a.parser&&(a.parser.yy=s),s.clear?.(),h?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new gg(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},Sl=[],mk=g(()=>{Sl.forEach(e=>{e()}),Sl=[]},"attachFunctions"),yk=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function pg(e){const t=e.match(mh);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
301
+ `:""}return g(Q,"dump2"),Zo.dump=Q,Zo}g(fu,"requireDumper");var ml;function mu(){if(ml)return Ut;ml=1;const e=pu(),t=fu();function r(i,o){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return g(r,"renamed"),Ut.Type=Zt(),Ut.Schema=xa(),Ut.FAILSAFE_SCHEMA=Ta(),Ut.JSON_SCHEMA=Fa(),Ut.CORE_SCHEMA=Ea(),Ut.DEFAULT_SCHEMA=go(),Ut.load=e.load,Ut.loadAll=e.loadAll,Ut.dump=t.dump,Ut.YAMLException=Mr(),Ut.types={binary:Ma(),float:La(),map:Sa(),null:wa(),pairs:Oa(),set:$a(),timestamp:Aa(),bool:Ba(),int:va(),merge:_a(),omap:Ia(),seq:ka(),str:ba()},Ut.safeLoad=r("safeLoad","load"),Ut.safeLoadAll=r("safeLoadAll","loadAll"),Ut.safeDump=r("safeDump","dump"),Ut}g(mu,"requireJsYaml");var ox=mu(),sx=uu(ox),{Type:w2,Schema:B2,FAILSAFE_SCHEMA:v2,JSON_SCHEMA:ax,CORE_SCHEMA:L2,DEFAULT_SCHEMA:F2,load:nx,loadAll:E2,dump:A2,YAMLException:_2,types:M2,safeLoad:I2,safeLoadAll:O2,safeDump:$2}=sx,lx={common:pi,getConfig:Dt,insertCluster:qd,insertEdge:zd,insertEdgeLabel:Ca,insertMarkers:jd,insertNode:ya,interpolateToCurve:Gs,labelHelper:ct,log:M,positionEdgeLabel:kC},li={},yu=g(e=>{for(const t of e)li[t.name]=t},"registerLayoutLoaders"),hx=g(()=>{yu([{name:"dagre",loader:g(async()=>await bt(()=>import("./dagre-GXQ25YYZ-Cp78_L9l.js"),[],import.meta.url),"loader")},{name:"swimlane",loader:g(async()=>await bt(()=>import("./swimlanes-42K2YHIH-Ca0PhRmf.js"),[],import.meta.url),"loader")},{name:"cose-bilkent",loader:g(async()=>await bt(()=>import("./cose-bilkent-JH36ORCC-D976z1sp.js"),[],import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");hx();var D2=g(async(e,t)=>{if(!(e.layoutAlgorithm in li))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const l of e.nodes){const d=l.domId||l.id;l.domId=`${e.diagramId}-${d}`}const r=li[e.layoutAlgorithm],i=await r.loader(),{theme:o,themeVariables:s}=e.config,{useGradient:a,gradientStart:n,gradientStop:h}=s,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),a){const l=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");l.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),l.append("svg:stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}return i.render(e,t,lx,{algorithm:r.algorithm})},"render"),P2=g((e="",{fallback:t="dagre"}={})=>{if(e in li)return e;if(t in li)return M.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Da="comm",Cu="rule",xu="decl",cx="@media",dx="@import",ux="@supports",gx="@namespace",Fs="@keyframes",bu="@layer",px="@scope",fx=Math.abs,oi=String.fromCharCode;function ku(e){return e.trim()}function Es(e,t,r){return e.replace(t,r)}function kr(e,t){return e.charCodeAt(t)|0}function vr(e,t,r){return e.slice(t,r)}function Se(e){return e.length}function Su(e){return e.length}function Ai(e,t){return t.push(e),e}var po=1,Lr=1,Tu=0,ne=0,Nt=0,Ir="";function Pa(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:po,column:Lr,length:a,return:"",siblings:n}}function mx(){return Nt}function yx(){return Nt=ne>0?kr(Ir,--ne):0,Lr--,Nt===10&&(Lr=1,po--),Nt}function pe(){return Nt=ne<Tu?kr(Ir,ne++):0,Lr++,Nt===10&&(Lr=1,po++),Nt}function qe(){return kr(Ir,ne)}function Di(){return ne}function fo(e,t){return vr(Ir,e,t)}function hi(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Cx(e){return po=Lr=1,Tu=Se(Ir=e),ne=0,[]}function xx(e){return Ir="",e}function Qo(e){return ku(fo(ne-1,As(e===91?e+2:e===40?e+1:e)))}function bx(e){for(;(Nt=qe())&&Nt<33;)pe();return hi(e)>2||hi(Nt)>3?"":" "}function kx(e,t){for(;--t&&pe()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return fo(e,Di()+(t<6&&qe()==32&&pe()==32))}function As(e){for(;pe();)switch(Nt){case e:return ne;case 34:case 39:e!==34&&e!==39&&As(Nt);break;case 40:e===41&&As(e);break;case 92:pe();break}return ne}function Sx(e,t){for(;pe()&&e+Nt!==57;)if(e+Nt===84&&qe()===47)break;return"/*"+fo(t,ne-1)+"*"+oi(e===47?e:pe())}function Tx(e){for(;!hi(qe());)pe();return fo(e,ne)}function wx(e){return xx(Pi("",null,null,null,[""],e=Cx(e),0,[0],e))}function Pi(e,t,r,i,o,s,a,n,h){for(var c=0,l=0,d=a,u=0,f=0,m=0,y=1,x=1,C=1,b=0,T=0,w="",B=o,F=s,L=i,v=w;x;)switch(m=T,T=pe()){case 40:m!=108&&kr(v,d-1)==58?(b++,v+="("):v+=Qo(T);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=Qo(T);break;case 9:case 10:case 13:case 32:if(b>0){v+=oi(T);break}v+=bx(m);break;case 92:v+=kx(Di()-1,7);continue;case 47:switch(qe()){case 42:case 47:Ai(Bx(Sx(pe(),Di()),t,r,h),h),(hi(m||1)==5||hi(qe()||1)==5)&&Se(v)&&vr(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*y:n[c++]=Se(v)*C;case 125*y:case 59:case 0:if(b>0&&T){v+=oi(T);break}switch(T){case 0:case 125:x=0;case 59+l:C==-1&&(v=Es(v,/\f/g,"")),f>0&&(Se(v)-d||y===0)&&Ai(f>32?Cl(v+";",i,r,d-1,h):Cl(Es(v," ","")+";",i,r,d-2,h),h);break;case 59:v+=";";default:if(Ai(L=yl(v,t,r,c,l,o,n,w,B=[],F=[],d,s),s),T===123)if(l===0)Pi(v,t,L,L,B,s,d,n,F);else{switch(u){case 99:if(kr(v,3)===110)break;case 108:if(kr(v,2)===97)break;default:l=0;case 100:case 109:case 115:}l?Pi(e,L,L,i&&Ai(yl(e,L,L,0,0,o,n,w,o,B=[],d,F),F),o,F,d,n,i?B:F):Pi(v,L,L,L,[""],F,0,n,F)}}c=l=f=0,y=C=1,w=v="",d=a;break;case 58:d=1+Se(v),f=m;default:if(y<1){if(T==123)--y;else if(T==125&&y++==0&&yx()==125)continue}switch(v+=oi(T),T*y){case 38:C=l>0?1:(v+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Se(v)-1)*C,C=1;break;case 64:qe()===45&&(v+=Qo(pe())),u=qe(),l=d=Se(w=v+=Tx(Di())),T++;break;case 45:m===45&&Se(v)==2&&(y=0)}}return s}function yl(e,t,r,i,o,s,a,n,h,c,l,d){for(var u=o-1,f=o===0?s:[""],m=Su(f),y=0,x=0,C=0;y<i;++y)for(var b=0,T=vr(e,u+1,u=fx(x=a[y])),w=e;b<m;++b)(w=ku(x>0?f[b]+" "+T:Es(T,/&\f/g,f[b])))&&(h[C++]=w);return Pa(e,t,r,o===0?Cu:n,h,c,l,d)}function Bx(e,t,r,i){return Pa(e,t,r,Da,oi(mx()),vr(e,2,-2),0,i)}function Cl(e,t,r,i,o){return Pa(e,t,r,xu,vr(e,0,i),vr(e,i+1,-1),i,o)}function _s(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function vx(e,t,r,i){switch(e.type){case bu:if(e.children.length)break;case dx:case gx:case xu:return e.return=e.return||e.value;case Da:return"";case Fs:return e.return=e.value+"{"+_s(e.children,i)+"}";case Cu:if(!Se(e.value=e.props.join(",")))return""}return Se(r=_s(e.children,i))?e.return=e.value+"{"+r+"}":""}function Lx(e){var t=Su(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var wu="c4",Fx=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Ex=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./c4Diagram-7LVT6UL2-BD3Ld97M.js");return{diagram:t}},[],import.meta.url);return{id:wu,diagram:e}},"loader"),Ax={id:wu,detector:Fx,loader:Ex},_x=Ax,Bu="flowchart",Mx=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),Ix=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW-_PPo6xx4.js").then(r=>r.f);return{diagram:t}},[],import.meta.url);return{id:Bu,diagram:e}},"loader"),Ox={id:Bu,detector:Mx,loader:Ix},$x=Ox,vu="flowchart-v2",Dx=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),Px=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW-_PPo6xx4.js").then(r=>r.f);return{diagram:t}},[],import.meta.url);return{id:vu,diagram:e}},"loader"),Rx={id:vu,detector:Dx,loader:Px},qx=Rx,Lu="swimlane",Nx=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),Wx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./swimlanesDiagram-VR7AAH4N-BEQKTD21.js");return{diagram:t}},[],import.meta.url);return{id:Lu,diagram:e}},"loader"),zx={id:Lu,detector:Nx,loader:Wx},Hx=zx,Fu="er",Yx=g(e=>/^\s*erDiagram/.test(e),"detector"),jx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./erDiagram-RLTQ6QDP-DmlOR1VA.js");return{diagram:t}},[],import.meta.url);return{id:Fu,diagram:e}},"loader"),Xx={id:Fu,detector:Yx,loader:jx},Ux=Xx,Eu="gitGraph",Gx=g(e=>/^\s*gitGraph/.test(e),"detector"),Vx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-WWUBYQGX-u7eHxrMk.js");return{diagram:t}},[],import.meta.url);return{id:Eu,diagram:e}},"loader"),Kx={id:Eu,detector:Gx,loader:Vx},Zx=Kx,Au="gantt",Qx=g(e=>/^\s*gantt/.test(e),"detector"),Jx=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./ganttDiagram-EL5Y4UJY-DnJUq63S.js");return{diagram:t}},[],import.meta.url);return{id:Au,diagram:e}},"loader"),t0={id:Au,detector:Qx,loader:Jx},e0=t0,_u="info",r0=g(e=>/^\s*info/.test(e),"detector"),i0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./infoDiagram-27XIBGKW-C3YByzAX.js");return{diagram:t}},[],import.meta.url);return{id:_u,diagram:e}},"loader"),o0={id:_u,detector:r0,loader:i0},Mu="pie",s0=g(e=>/^\s*pie/.test(e),"detector"),a0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./pieDiagram-E7YTZNPT-ni9UMEzV.js");return{diagram:t}},[],import.meta.url);return{id:Mu,diagram:e}},"loader"),n0={id:Mu,detector:s0,loader:a0},Iu="quadrantChart",l0=g(e=>/^\s*quadrantChart/.test(e),"detector"),h0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./quadrantDiagram-AXDQQJYC-CufBEqrC.js");return{diagram:t}},[],import.meta.url);return{id:Iu,diagram:e}},"loader"),c0={id:Iu,detector:l0,loader:h0},d0=c0,Ou="xychart",u0=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),g0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./xychartDiagram-S5SC5T6Z-D_TaZM0k.js");return{diagram:t}},[],import.meta.url);return{id:Ou,diagram:e}},"loader"),p0={id:Ou,detector:u0,loader:g0},f0=p0,$u="requirement",m0=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),y0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./requirementDiagram-BXWQKSXE-CmXBYo40.js");return{diagram:t}},[],import.meta.url);return{id:$u,diagram:e}},"loader"),C0={id:$u,detector:m0,loader:y0},x0=C0,Du="sequence",b0=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),k0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./sequenceDiagram-WJ2MYXX4-GMFparx1.js");return{diagram:t}},[],import.meta.url);return{id:Du,diagram:e}},"loader"),S0={id:Du,detector:b0,loader:k0},T0=S0,Pu="class",w0=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),B0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./classDiagram-ZZMXUADV-B2RPE1Bl.js");return{diagram:t}},[],import.meta.url);return{id:Pu,diagram:e}},"loader"),v0={id:Pu,detector:w0,loader:B0},L0=v0,Ru="classDiagram",F0=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),E0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./classDiagram-v2-VYDZK3BY-B2RPE1Bl.js");return{diagram:t}},[],import.meta.url);return{id:Ru,diagram:e}},"loader"),A0={id:Ru,detector:F0,loader:E0},_0=A0,qu="state",M0=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),I0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./stateDiagram-D77RDMKH-CWrs6KzY.js");return{diagram:t}},[],import.meta.url);return{id:qu,diagram:e}},"loader"),O0={id:qu,detector:M0,loader:I0},$0=O0,Nu="stateDiagram",D0=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),P0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-MP3YSRHH-lpluVNfO.js");return{diagram:t}},[],import.meta.url);return{id:Nu,diagram:e}},"loader"),R0={id:Nu,detector:D0,loader:P0},q0=R0,Wu="journey",N0=g(e=>/^\s*journey/.test(e),"detector"),W0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./journeyDiagram-3NMN7TZE-BjO5pIr-.js");return{diagram:t}},[],import.meta.url);return{id:Wu,diagram:e}},"loader"),z0={id:Wu,detector:N0,loader:W0},H0=z0,Y0=g((e,t,r)=>{M.debug(`rendering svg for syntax error
302
+ `);const i=Kf(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),kh(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),zu={draw:Y0},j0=zu,X0={db:{},renderer:zu,parser:{parse:g(()=>{},"parse")}},U0=X0,Hu="flowchart-elk",G0=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),V0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW-_PPo6xx4.js").then(r=>r.f);return{diagram:t}},[],import.meta.url);return{id:Hu,diagram:e}},"loader"),K0={id:Hu,detector:G0,loader:V0},Z0=K0,Yu="timeline",Q0=g(e=>/^\s*timeline/.test(e),"detector"),J0=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./timeline-definition-24CTP7MA-B8lxEouP.js");return{diagram:t}},[],import.meta.url);return{id:Yu,diagram:e}},"loader"),tb={id:Yu,detector:Q0,loader:J0},eb=tb,ju="mindmap",rb=g(e=>/^\s*mindmap/.test(e),"detector"),ib=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./mindmap-definition-YA3MSWOX-BURkGTKI.js");return{diagram:t}},[],import.meta.url);return{id:ju,diagram:e}},"loader"),ob={id:ju,detector:rb,loader:ib},sb=ob,Xu="kanban",ab=g(e=>/^\s*kanban/.test(e),"detector"),nb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./kanban-definition-UXKFOSKX-DKCJ8_n0.js");return{diagram:t}},[],import.meta.url);return{id:Xu,diagram:e}},"loader"),lb={id:Xu,detector:ab,loader:nb},hb=lb,Uu="sankey",cb=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),db=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./sankeyDiagram-P5KCCOFB-rQsp_j9w.js");return{diagram:t}},[],import.meta.url);return{id:Uu,diagram:e}},"loader"),ub={id:Uu,detector:cb,loader:db},gb=ub,Gu="packet",pb=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),fb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-Z3DM3KII-Da75Rc5Q.js");return{diagram:t}},[],import.meta.url);return{id:Gu,diagram:e}},"loader"),mb={id:Gu,detector:pb,loader:fb},Vu="radar",yb=g(e=>/^\s*radar-beta/.test(e),"detector"),Cb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-UQ7AKVKN-BK4qe_eB.js");return{diagram:t}},[],import.meta.url);return{id:Vu,diagram:e}},"loader"),xb={id:Vu,detector:yb,loader:Cb},Ku="block",bb=g(e=>/^\s*block(-beta)?/.test(e),"detector"),kb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./blockDiagram-I7D4REHJ-edfypROz.js");return{diagram:t}},[],import.meta.url);return{id:Ku,diagram:e}},"loader"),Sb={id:Ku,detector:bb,loader:kb},Tb=Sb,Zu="treeView",wb=g(e=>/^\s*treeView-beta/.test(e),"detector"),Bb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-S7CK7UJ4-LsSU5PzE.js");return{diagram:t}},[],import.meta.url);return{id:Zu,diagram:e}},"loader"),vb={id:Zu,detector:wb,loader:Bb},Lb=vb,Qu="architecture",Fb=g(e=>/^\s*architecture/.test(e),"detector"),Eb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./architectureDiagram-5GKGNRK7-GukKr_g1.js");return{diagram:t}},[],import.meta.url);return{id:Qu,diagram:e}},"loader"),Ab={id:Qu,detector:Fb,loader:Eb},_b=Ab,Ju="eventmodeling",Mb=g(e=>/^\s*eventmodeling/.test(e),"detector"),Ib=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-VSXAHHWV-CIhWkrRX.js");return{diagram:t}},[],import.meta.url);return{id:Ju,diagram:e}},"loader"),Ob={id:Ju,detector:Mb,loader:Ib},$b=Ob,tg="ishikawa",Db=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),Pb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./ishikawaDiagram-5VMMS53U-B87JmQRn.js");return{diagram:t}},[],import.meta.url);return{id:tg,diagram:e}},"loader"),Rb={id:tg,detector:Db,loader:Pb},eg="venn",qb=g(e=>/^\s*venn-beta/.test(e),"detector"),Nb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./vennDiagram-4TSXK5OY-Ca7szyFH.js");return{diagram:t}},[],import.meta.url);return{id:eg,diagram:e}},"loader"),Wb={id:eg,detector:qb,loader:Nb},zb=Wb,rg="treemap",Hb=g(e=>/^\s*treemap/.test(e),"detector"),Yb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./diagram-VX7I27RA-CQM8aGRO.js");return{diagram:t}},[],import.meta.url);return{id:rg,diagram:e}},"loader"),jb={id:rg,detector:Hb,loader:Yb},ig="wardley",Xb=g(e=>/^\s*wardley-beta/i.test(e),"detector"),Ub=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./wardleyDiagram-VM6X3IG4-Dh0UOrRp.js");return{diagram:t}},[],import.meta.url);return{id:ig,diagram:e}},"loader"),Gb={id:ig,detector:Xb,loader:Ub},Vb=Gb,og="cynefin",Kb=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),Zb=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./cynefinDiagram-5FMLGOSQ-D7ioXav_.js");return{diagram:t}},[],import.meta.url);return{id:og,diagram:e}},"loader"),Qb={id:og,detector:Kb,loader:Zb},sg="railroad",Jb=g(e=>/^\s*railroad-beta/i.test(e),"detector"),tk=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./railroadDiagram-O6MQD6OU-6tStysfX.js");return{diagram:t}},[],import.meta.url);return{id:sg,diagram:e}},"loader"),ek={id:sg,detector:Jb,loader:tk},ag="railroadEbnf",rk=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),ik=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./ebnfDiagram-PWID7BFC-Klx1dPe6.js");return{diagram:t}},[],import.meta.url);return{id:ag,diagram:e}},"loader"),ok={id:ag,detector:rk,loader:ik},ng="railroadAbnf",sk=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),ak=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./abnfDiagram-VCTEODGH-BdOOK2nG.js");return{diagram:t}},[],import.meta.url);return{id:ng,diagram:e}},"loader"),nk={id:ng,detector:sk,loader:ak},lg="railroadPeg",lk=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),hk=g(async()=>{const{diagram:e}=await bt(async()=>{const{diagram:t}=await import("./pegDiagram-XKGWAZYB-CyuSADYr.js");return{diagram:t}},[],import.meta.url);return{id:lg,diagram:e}},"loader"),ck={id:lg,detector:lk,loader:hk},xl=!1,mo=g(()=>{xl||(xl=!0,Hi("error",U0,e=>e.toLowerCase().trim()==="error"),Hi("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ls(Z0,sb,_b),ls(_x,hb,_0,L0,Ux,e0,o0,n0,x0,T0,Hx,qx,$x,eb,Zx,q0,$0,H0,d0,gb,mb,f0,Tb,$b,Lb,xb,Rb,jb,ek,ok,nk,ck,zb,Vb,Qb))},"addDiagrams"),dk=g(async()=>{M.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(tr).map(async([r,{detector:i,loader:o}])=>{if(o)try{us(r)}catch{try{const{diagram:s,id:a}=await o();Hi(a,s,i)}catch(s){throw M.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete tr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){M.error(`Failed to load ${t.length} external diagrams`);for(const r of t)M.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),uk="graphics-document document";function hg(e,t){e.attr("role",uk),t!==""&&e.attr("aria-roledescription",t)}g(hg,"setA11yDiagramInfo");function cg(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}g(cg,"addSVGa11yTitleDescription");var Ms=class dg{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{g(this,"Diagram")}static async fromText(t,r={}){const i=Dt(),o=zs(t,i);t=wm(t)+`
303
+ `;try{us(o)}catch{const c=bf(o);if(!c)throw new fh(`Diagram ${o} not found.`);const{id:l,diagram:d}=await c();Hi(l,d)}const{db:s,parser:a,renderer:n,init:h}=us(o);return a.parser&&(a.parser.yy=s),s.clear?.(),h?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new dg(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},bl=[],gk=g(()=>{bl.forEach(e=>{e()}),bl=[]},"attachFunctions"),pk=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function ug(e){const t=e.match(ph);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
309
304
  `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
310
- `):t[2];let o=cx(i,{schema:hx})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}g(pg,"extractFrontMatter");var Ck=g(e=>e.replace(/\r\n?/g,`
311
- `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),xk=g(e=>{const{text:t,metadata:r}=pg(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),bk=g(e=>{const t=Vt.detectInit(e)??{},r=Vt.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:pm(e),directive:t}},"processDirectives");function qa(e){const t=Ck(e),r=xk(t),i=bk(r.text),o=ta(r.config,i.directive);return e=yk(i.text),{code:e,title:r.title,config:o}}g(qa,"preprocessDiagram");function fg(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(fg,"toBase64");var kk=5e4,Sk="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Tk="sandbox",wk="loose",Bk="http://www.w3.org/2000/svg",vk="http://www.w3.org/1999/xlink",Lk="http://www.w3.org/1999/xhtml",Fk="100%",Ek="100%",Ak="border:0;margin:0;",_k="margin:0",Mk="allow-top-navigation-by-user-activation allow-popups",Ik='The "iframe" tag is not supported by your browser.',Ok=["foreignobject"],$k=["dominant-baseline"];function Na(e){const t=qa(e);return zi(),xf(t.config??{}),t}g(Na,"processAndSetConfigs");async function mg(e,t){yo();try{const{code:r,config:i}=Na(e);return{diagramType:(await Cg(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}g(mg,"parse");var Tl=g((e,t,r=[])=>{const i=dh(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),Dk=g((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=Kt(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(h=>{Ga(h.styles)||n.forEach(c=>{r.insertRule(Tl(h.id,c,h.styles),r.cssRules.length)}),Ga(h.textStyles)||r.insertRule(Tl(h.id,"tspan",(h?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=us(o)+`
305
+ `):t[2];let o=nx(i,{schema:ax})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}g(ug,"extractFrontMatter");var fk=g(e=>e.replace(/\r\n?/g,`
306
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),mk=g(e=>{const{text:t,metadata:r}=ug(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),yk=g(e=>{const t=Vt.detectInit(e)??{},r=Vt.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:dm(e),directive:t}},"processDirectives");function Ra(e){const t=fk(e),r=mk(t),i=yk(r.text),o=Js(r.config,i.directive);return e=pk(i.text),{code:e,title:r.title,config:o}}g(Ra,"preprocessDiagram");function gg(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(gg,"toBase64");var Ck=5e4,xk="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",bk="sandbox",kk="loose",Sk="http://www.w3.org/2000/svg",Tk="http://www.w3.org/1999/xlink",wk="http://www.w3.org/1999/xhtml",Bk="100%",vk="100%",Lk="border:0;margin:0;",Fk="margin:0",Ek="allow-top-navigation-by-user-activation allow-popups",Ak='The "iframe" tag is not supported by your browser.',_k=["foreignobject"],Mk=["dominant-baseline"];function qa(e){const t=Ra(e);return Wi(),mf(t.config??{}),t}g(qa,"processAndSetConfigs");async function pg(e,t){mo();try{const{code:r,config:i}=qa(e);return{diagramType:(await mg(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}g(pg,"parse");var kl=g((e,t,r=[])=>{const i=hh(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),Ik=g((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=Kt(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(h=>{Ua(h.styles)||n.forEach(c=>{r.insertRule(kl(h.id,c,h.styles),r.cssRules.length)}),Ua(h.textStyles)||r.insertRule(kl(h.id,"tspan",(h?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=ds(o)+`
312
307
  `}else i+=`${e.themeCSS}
313
- `;return i+us(r)},"createCssStyles"),Pk=g((e,t)=>Ms(Lx(`${e}{${t}}`),Ax([g(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===Es)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[gx,fx,Su,yx,"@container","@starting-style"],Es].includes(i.type)||(M.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Pa))},"addNamespace"),Ex])),"compileCSS"),Rk=g((e,t,r,i)=>{const o=Dk(e,r),s=Wf(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return Pk(i,s)},"createUserStyles"),qk=g((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Ne(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),Nk=g((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":Ek,i=fg(`<body style="${_k}">${e}</body>`);return`<iframe style="width:${Fk};height:${r};${Ak}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${Mk}">
314
- ${Ik}
315
- </iframe>`},"putIntoIFrame"),wl=g((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Bk);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function Os(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(Os,"sandboxedIframe");var Wk=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),zk=g(async function(e,t,r){yo();const i=Na(t);t=i.code;const o=Dt();M.debug(o),t.length>(o?.maxTextSize??kk)&&(t=Sk);const s=`#${e}`,a="i"+e,n="#"+a,h="d"+e,c="#"+h,l=g(()=>{const z=yt(u?n:c).node();z&&"remove"in z&&z.remove()},"removeTempElements");let d=yt(document.body);const u=o.securityLevel===Tk,f=o.securityLevel===wk,m=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const W=Os(yt(r),a);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);wl(d,e,h,`font-family: ${m}`,vk)}else{if(Wk(document,e,h,a),u){const W=Os(yt(document.body),a);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");wl(d,e,h)}let y,x;try{y=await Is.fromText(t,{title:i.title})}catch(W){if(o.suppressErrorRendering)throw l(),W;y=await Is.fromText("error"),x=W}const C=d.select(c).node(),b=y.type,T=C.firstChild,w=T.firstChild,B=y.renderer.getClasses?.(t,y),F=Rk(o,b,B,s),L=document.createElement("style");L.innerHTML=F,T.insertBefore(L,w);try{await y.renderer.draw(t,e,"11.17.2",y)}catch(W){throw o.suppressErrorRendering?l():G0.draw(t,e,"11.17.2"),W}const v=d.select(`${c} svg`),R=y.db.getAccTitle?.(),N=y.db.getAccDescription?.();xg(b,v,R,N);const J=g(()=>{d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Lk);let W=d.select(c).node().innerHTML;if(M.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),W=qk(W,u,ve(o.arrowMarkerAbsolute)),u){const z=d.select(c+" svg").node();W=Nk(W,z)}else f||(W=Sr.sanitize(W,{ADD_TAGS:Ok,ADD_ATTR:$k,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return mk(),W},"serializeSvg")();if(x)throw x;return l(),{diagramType:b,svg:J,bindFunctions:y.db.bindFunctions}},"render");function yg(e={}){const t=Ht({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),yf(t),t?.theme&&t.theme in Me?t.themeVariables=Me[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Me.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?mf(t):uh();zs(r.logLevel),yo()}g(yg,"initialize");var Cg=g((e,t={})=>{const{code:r}=qa(e);return Is.fromText(r,t)},"getDiagramFromText");function xg(e,t,r,i){dg(t,e),ug(t,r,i,t.attr("id"))}g(xg,"addA11yInfo");var ir=Object.freeze({render:zk,parse:mg,getDiagramFromText:Cg,initialize:yg,getConfig:Dt,setConfig:gh,getSiteConfig:uh,updateSiteConfig:Cf,reset:g(()=>{zi()},"reset"),globalReset:g(()=>{zi(wr)},"globalReset"),defaultConfig:wr});zs(Dt().logLevel);zi(Dt());var Hk=g((e,t,r)=>{M.warn(e),Js(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),bg=g(async function(e={querySelector:".mermaid"}){try{await Yk(e)}catch(t){if(Js(t)&&M.error(t.str),Oe.parseError&&Oe.parseError(t),!e.suppressErrors)throw M.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Yk=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=ir.getConfig();M.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");M.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(M.debug("Start On Load: "+i?.startOnLoad),ir.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new Vt.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const h of Array.from(o)){if(M.info("Rendering diagram: "+h.id),h.getAttribute("data-processed"))continue;h.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=h.innerHTML,a=Ql(Vt.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const l=Vt.detectInit(a);l&&M.debug("Detected early reinit: ",l);try{const{svg:d,bindFunctions:u}=await wg(c,a,h);h.innerHTML=d,e&&await e(c),u&&u(h)}catch(d){Hk(d,n,Oe.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),kg=g(function(e){ir.initialize(e)},"initialize"),jk=g(async function(e,t,r){M.warn("mermaid.init is deprecated. Please use run instead."),e&&kg(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await bg(i)},"init"),Xk=g(async(e,{lazyLoad:t=!0}={})=>{yo(),hs(...e),t===!1&&await pk()},"registerExternalDiagrams"),Sg=g(function(){if(Oe.startOnLoad){const{startOnLoad:e}=ir.getConfig();e&&Oe.run().catch(t=>M.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Sg,!1);var Uk=g(function(e){Oe.parseError=e},"setParseErrorHandler"),to=[],ts=!1,Tg=g(async()=>{if(!ts){for(ts=!0;to.length>0;){const e=to.shift();if(e)try{await e()}catch(t){M.error("Error executing queue",t)}}ts=!1}},"executeQueue"),Gk=g(async(e,t)=>new Promise((r,i)=>{const o=g(()=>new Promise((s,a)=>{ir.parse(e,t).then(n=>{s(n),r(n)},n=>{M.error("Error parsing",n),Oe.parseError?.(n),a(n),i(n)})}),"performCall");to.push(o),Tg().catch(i)}),"parse"),wg=g((e,t,r)=>new Promise((i,o)=>{const s=g(()=>new Promise((a,n)=>{ir.render(e,t,r).then(h=>{a(h),i(h)},h=>{M.error("Error parsing",h),Oe.parseError?.(h),n(h),o(h)})}),"performCall");to.push(s),Tg().catch(o)}),"render"),Vk=g(()=>Object.keys(tr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Oe={startOnLoad:!0,mermaidAPI:ir,parse:Gk,render:wg,init:jk,run:bg,registerExternalDiagrams:Xk,registerLayoutLoaders:xu,initialize:kg,parseError:void 0,contentLoaded:Sg,setParseErrorHandler:Uk,detectType:Hs,registerIconPacks:sm,getRegisteredDiagramsMetadata:Vk},es=Oe;const St=e=>e.replace(/\s*!important\s*$/i,"").trim(),Kk=(e,t)=>{let r=t;for(;r<e.length&&/\s/.test(e[r]);)r+=1;const i=r;for(;r<e.length&&/[a-z-]/i.test(e[r]);)r+=1;if(r===i)return!1;for(;r<e.length&&/\s/.test(e[r]);)r+=1;return e[r]===":"},le=e=>{const t=[];let r=0;for(;r<e.length;){for(;r<e.length&&/[\s;,]/.test(e[r]);)r+=1;if(r>=e.length)break;const i=r;for(;r<e.length&&e[r]!==":"&&!(e[r]===";"||e[r]===",");)r+=1;if(r>=e.length||e[r]!==":")break;const o=e.substring(i,r).trim().toLowerCase();r+=1;const s=r;let a=0,n=null;for(;r<e.length;){const c=e[r];if(n){c===n&&e[r-1]!=="\\"&&(n=null),r+=1;continue}if(c==='"'||c==="'"){n=c,r+=1;continue}if(c==="("){a+=1,r+=1;continue}if(c===")"){a=Math.max(0,a-1),r+=1;continue}if(a===0&&(c===";"||c===","||/\s/.test(c)&&Kk(e,r)))break;r+=1}const h=St(e.substring(s,r));o&&h&&t.push({property:o,value:h}),r<e.length&&(e[r]===";"||e[r]===",")&&(r+=1)}return t},he=e=>{const t=St(e);if(!t)return!1;if(typeof CSS<"u"&&typeof CSS.supports=="function")return CSS.supports("color",t);if(typeof document<"u"){const r=document.createElement("div");return r.style.color="",r.style.color=t,r.style.color!==""}return!1},Bl=(e,t)=>{const r=e.getAttribute("style");return r&&le(r).find(i=>i.property===t)?.value||""},rs=(...e)=>{for(const t of e){const r=St(t||"");if(he(r))return r}},Wa=(e,t)=>{const r=e.querySelector("text, foreignObject, div, span, p")||e,i=rs(r.getAttribute?.("fill"),Bl(r,"fill"),r.style?.fill);if(i)return i;const o=rs(r.getAttribute?.("color"),Bl(r,"color"),r.style?.color);if(o)return o;const s=rs(t);if(s)return s},za=(e,t,r)=>{switch(t){case At.FILL:case At.STROKE:he(r)&&(e[t]=r);break;case At.STROKE_WIDTH:case At.STROKE_DASHARRAY:e[t]=r;break}},eo=(e,t,r)=>{t===Qt.COLOR&&he(r)&&(e[Qt.COLOR]=r)},ro=(e,t,r)=>{e&&le(e).forEach(({property:i,value:o})=>{za(t,i,o),eo(r,i,o)})},Bg=(e,t)=>{e&&le(e).forEach(({property:r,value:i})=>{if(r==="fill"&&he(i)){t[Qt.COLOR]=i;return}eo(t,r,i)})},vg=(e,t)=>{if(!e)return;[[At.FILL,e.getAttribute("fill")],[At.STROKE,e.getAttribute("stroke")],[At.STROKE_WIDTH,e.getAttribute("stroke-width")],[At.STROKE_DASHARRAY,e.getAttribute("stroke-dasharray")]].forEach(([i,o])=>{const s=St(o||"");s&&za(t,i,s)})},Lg=(e,t)=>{if(!e)return;const r=e.getAttribute("fill")||e.getAttribute("color"),i=St(r||"");he(i)&&(t[Qt.COLOR]=i)},$s=(e,t,r,i)=>{if(!(t instanceof Map))return;const o=t.get(e);o&&(o.styles?.forEach(s=>{le(s).forEach(({property:a,value:n})=>{za(r,a,n),eo(i,a,n)})}),o.textStyles?.forEach(s=>{le(s).forEach(({property:a,value:n})=>{eo(i,a,n)})}))},Zk=(e,t,r)=>{const i=e.nodes.map(u=>u.startsWith("flowchart-")?u.split("-")[1]:u),o=t.querySelector(`[id='${e.id}']`);if(!o)throw new Error("SubGraph element not found");const s=Ha(o,t),a=o.getBBox(),n={width:a.width,height:a.height},h={},c={},l=o.querySelector(":scope > rect, :scope > path, :scope > polygon, :scope > ellipse")||o.querySelector(".cluster > rect, .cluster > path, .cluster > polygon, .cluster > ellipse")||o.querySelector("rect, path, polygon, ellipse");ro(o.getAttribute("style"),h,c),ro(l?.getAttribute("style"),h,c),vg(l,h);const d=o.querySelector(".cluster-label text, .cluster-label tspan")||o.querySelector("text");return Bg(d?.getAttribute("style"),c),Lg(d,c),$s(e.id,r,h,c),e.classes?.forEach(u=>{$s(u,r,h,c)}),{id:e.id,nodeIds:i,text:re(e.title),labelType:"text",...s,...n,containerStyle:h,labelStyle:c}},vl=(e,t,r)=>{const i=t.querySelector(`[id*="${e.domId}"]`);if(!i)return;let o;i.parentElement?.tagName.toLowerCase()==="a"&&(o=i.parentElement.getAttribute("xlink:href"));const s=Ha(o?i.parentElement:i,t),a=i.getBBox(),n={width:a.width,height:a.height},h={},c={};e.classes&&r instanceof Map&&(Array.isArray(e.classes)?e.classes:[e.classes]).forEach(u=>{$s(u,r,h,c)}),e.styles?.forEach(u=>{ro(u,h,c)});const l=i.querySelector(".label-container");return ro(l?.getAttribute("style"),h,c),vg(l,h),Array.from(i.querySelectorAll(".label, .nodeLabel, .label text, .label tspan, .label span, .label div")).forEach(u=>{Bg(u.getAttribute("style"),c),Lg(u,c)}),{id:e.id,labelType:e.labelType,text:re(e.text||""),type:e.type,link:o||void 0,...s,...n,containerStyle:h,labelStyle:c}},Qk=(e,t,r)=>{const i=r.querySelector(`[id*="${e.id}"]`);if(!i)throw new Error("Edge element not found");const o=Ha(i,r),s=ah(i,o);return e.length=void 0,{...e,...s,text:re(e.text)}},Ha=(e,t)=>{if(!e)throw new Error("Element not found");let r=e.parentElement?.parentElement;const i=e.childNodes[0];let o={x:0,y:0};if(i){const{transformX:h,transformY:c}=Qe(i),l=i.getBBox();o={x:Number(i.getAttribute("x"))||h+l.x||0,y:Number(i.getAttribute("y"))||c+l.y||0}}const{transformX:s,transformY:a}=Qe(e),n={x:s+o.x,y:a+o.y};for(;r&&r.id!==t.id;){if(r.classList.value==="root"&&r.hasAttribute("transform")){const{transformX:h,transformY:c}=Qe(r);n.x+=h,n.y+=c}r=r.parentElement}return n},Jk=(e,t)=>{const r=e.getVertices(),i=e.getEdges(),o=e.getSubGraphs(),s=e.getClasses(),a={},n=s instanceof Map?s:{};r instanceof Map?r.forEach((d,u)=>{a[u]=vl(d,t,n)}):typeof r=="object"&&r!==null&&Object.entries(r).forEach(([d,u])=>{a[d]=vl(u,t,n)});const h=new Map,c=(Array.isArray(i)?i:[]).map(d=>{if(!t.querySelector(`[id*="${d.id}"]`))return null;const u=`${d.start}-${d.end}`,f=h.get(u)||0;return h.set(u,f+1),Qk(d,f,t)}).filter(d=>d!==null&&d.reflectionPoints.length>1);return{type:"flowchart",subGraphs:(Array.isArray(o)?o:[]).map(d=>Zk(d,t,n)),vertices:a,edges:c}},t1=(e,t)=>{const r={};t?.label&&(r.label={text:re(t.label),fontSize:16});const i=e.tagName;if(i==="line")r.startX=Number(e.getAttribute("x1")),r.startY=Number(e.getAttribute("y1")),r.endX=Number(e.getAttribute("x2")),r.endY=Number(e.getAttribute("y2"));else if(i==="path"){const a=e.getAttribute("d");if(!a)throw new Error('Path element does not contain a "d" attribute');const n=a.split(/(?=[LC])/),h=n[0].substring(1).split(",").map(d=>parseFloat(d)),c=[];n.forEach(d=>{const u=d.substring(1).trim().split(" ").map(f=>{const[m,y]=f.split(",");return[parseFloat(m)-h[0],parseFloat(y)-h[1]]});c.push(...u)});const l=c[c.length-1];r.startX=h[0],r.startY=h[1],r.endX=l[0],r.endY=l[1],r.points=c}t?.label&&(r.startY=r.startY-10,r.endY=r.endY-10);const o=e.getAttribute("stroke"),s=(o&&o!=="none"?o:"")||getComputedStyle(e).stroke||"";return r.strokeColor=s?St(s):null,r.strokeWidth=Number(e.getAttribute("stroke-width")),r.type="arrow",r.strokeStyle=t?.strokeStyle||"solid",r.startArrowhead=t?.startArrowhead||null,r.endArrowhead=t?.endArrowhead||null,r},Ya=(e,t,r,i,o)=>{const s={};return s.type="arrow",s.startX=e,s.startY=t,s.endX=r,s.endY=i,Object.assign(s,{...o}),s},io=(e,t,r,i)=>({type:"text",x:e,y:t,text:r,width:i?.width||20,height:i?.height||20,fontSize:i?.fontSize||ui,id:i?.id,color:i?.color,groupId:i?.groupId,metadata:i?.metadata}),Fg=(e,t,r)=>{const i={},o=Number(e.getAttribute("x")),s=Number(e.getAttribute("y"));i.type="text",i.text=re(t),r?.id&&(i.id=r.id),r?.groupId&&(i.groupId=r.groupId);const a=e.getBBox();i.width=a.width,i.height=a.height,i.x=o-a.width/2,i.y=s;const n=parseInt(getComputedStyle(e).fontSize);return i.fontSize=n,i.color=Wa(e),i},$e=(e,t,r={})=>{const i={};i.type=t;const{label:o,subtype:s,id:a,groupId:n}=r;i.id=a,n&&(i.groupId=n),o&&(i.label={text:re(o.text),fontSize:16,textAlign:o?.textAlign,verticalAlign:o?.verticalAlign});const h=e.getBBox();switch(i.x=h.x,i.y=h.y,i.width=h.width,i.height=h.height,i.subtype=s,s){case"highlight":const c=e.getAttribute("fill");c&&(i.bgColor=St(c));break;case"note":i.strokeStyle="dashed";break}return i},di=(e,t,r,i,o,s)=>{const a={};a.startX=t,a.startY=r,a.endX=i,s?.groupId&&(a.groupId=s.groupId),s?.id&&(a.id=s.id),a.endY=o;const n=e.getAttribute("stroke");return a.strokeColor=n?St(n):null,a.strokeWidth=Number(e.getAttribute("stroke-width")),a.type="line",a},Ll={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},ke={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,SOLID_POINT:24,DOTTED_POINT:25,CRITICAL_START:27},e1=e=>{let t;switch(e){case ke.SOLID:case ke.SOLID_CROSS:case ke.SOLID_OPEN:case ke.SOLID_POINT:t="solid";break;case ke.DOTTED:case ke.DOTTED_CROSS:case ke.DOTTED_OPEN:case ke.DOTTED_POINT:t="dotted";break;default:t="solid";break}return t},r1=(e,t)=>{if(!!e.nextElementSibling?.classList.contains("sequenceNumber")){const i=e.nextElementSibling?.textContent;if(!i)throw new Error("sequence number not present");const o=30,s=o/2,n={type:"rectangle",x:t.startX-10,y:t.startY-s,label:{text:i,fontSize:14},bgColor:"#e9ecef",height:o,subtype:"sequence"};Object.assign(t,{sequenceNumber:n})}},Fl=(e,t,r)=>{if(!e)throw"root node not found";const i=se(),o=Array.from(e.children),s=[];return o.forEach((a,n)=>{const h=`${r?.id}-${n}`;let c;switch(a.tagName){case"line":const l=Number(a.getAttribute("x1")),d=Number(a.getAttribute("y1")),u=Number(a.getAttribute("x2")),f=Number(a.getAttribute("y2"));c=di(a,l,d,u,f,{groupId:i,id:h});break;case"text":c=Fg(a,t,{groupId:i,id:h});break;case"circle":c=$e(a,"ellipse",{label:a.textContent?{text:a.textContent}:void 0,groupId:i,id:h});default:c=$e(a,ep[a.tagName],{label:a.textContent?{text:a.textContent}:void 0,groupId:i,id:h})}s.push(c)}),s},El=(e,t)=>{const r=t.getAttribute("fill"),i=t.getAttribute("stroke"),o=t.getAttribute("stroke-width"),s=t.getAttribute("stroke-dasharray");r&&r!=="none"&&(e.bgColor=St(r)),i&&i!=="none"&&(e.strokeColor=St(i)),o&&(e.strokeWidth=Number(o)),s&&s.trim()&&(e.strokeStyle="dashed")},i1=(e,t)=>{const r=Array.from(t.querySelectorAll(".actor-top")),i=Array.from(t.querySelectorAll(".actor-bottom")),o=[],s=[],a={},n=e instanceof Map?Array.from(e.values()):Object.values(e),h=Array.from(t.querySelectorAll(".actor-line")),c=(l,d)=>{const u=l.name,f=h.find(y=>y.getAttribute("name")===u);if(f)return f;const m=l.type==="participant"?d.parentElement?.previousElementSibling:d.previousElementSibling;return m?m.tagName==="line"?m:m.querySelector("line"):null};return n.forEach(l=>{const d=r.find(m=>m.getAttribute("name")===l.name),u=i.find(m=>m.getAttribute("name")===l.name);if(!d||!u)throw"root not found";const f=l.description;if(l.type==="participant"){const m=$e(d,"rectangle",{id:`${l.name}-top`,label:{text:f},subtype:"actor"});if(El(m,d),!m)throw"Top Node element not found!";o.push([m]);const y=$e(u,"rectangle",{id:`${l.name}-bottom`,label:{text:f},subtype:"actor"});a[l.name]={topId:`${l.name}-top`,bottomId:`${l.name}-bottom`,bindType:"rectangle"},El(y,u),o.push([y]);const x=c(l,d);if(x?.tagName!=="line")throw"Line not found";const C=Number(x.getAttribute("x1"));if(!m.height)throw"Top node element height is null";const b=m.y+m.height,T=y.y,w=Number(x.getAttribute("x2")),B=di(x,C,b,w,T);s.push(B)}else if(l.type==="actor"){const m=Fl(d,f,{id:`${l.name}-top`});o.push(m);const y=Fl(u,f,{id:`${l.name}-bottom`});o.push(y);const x=c(l,d);if(x?.tagName!=="line")throw"Line not found";const C=Number(x.getAttribute("x1")),b=Number(x.getAttribute("y1")),T=Number(x.getAttribute("x2")),w=y.find(L=>L.type==="ellipse");if(w){const L=w.y,v=di(x,C,b,T,L);s.push(v)}const B=m.find(L=>L.type==="ellipse"),F=y.find(L=>L.type==="ellipse");B?.id&&F?.id&&(a[l.name]={topId:B.id,bottomId:F.id,bindType:"ellipse"})}}),{nodes:o,lines:s,actorMap:a}},o1=(e,t,r)=>{const i=[],o=Array.from(t.querySelectorAll('[class*="messageLine"]')),s=Object.keys(Ll),a=e.filter(n=>s.includes(n.type.toString()));return o.forEach((n,h)=>{const c=a[h],l=Ll[c.type],d=t1(n,{label:c?.message,strokeStyle:e1(c.type),endArrowhead:l==="SOLID_OPEN"||l==="DOTTED_OPEN"?null:"arrow"}),u=r[c.from],f=r[c.to];u?.topId&&f?.topId&&(d.start={type:u.bindType||"rectangle",id:u.topId},d.end={type:f.bindType||"rectangle",id:f.topId}),r1(n,d),i.push(d)}),i},s1=(e,t)=>{const r=Array.from(t.querySelectorAll(".note")).map(s=>s.parentElement),i=e.filter(s=>s.type===ke.NOTE),o=[];return r.forEach((s,a)=>{if(!s)return;const n=s.firstChild,h=i[a].message,c=$e(n,"rectangle",{label:{text:h},subtype:"note"}),l=n.getAttribute("fill"),d=n.getAttribute("stroke"),u=n.getAttribute("stroke-width"),f=n.getAttribute("stroke-dasharray");l&&l!=="none"&&(c.bgColor=St(l)),d&&d!=="none"&&(c.strokeColor=St(d)),u&&(c.strokeWidth=Number(u)),f&&f.trim()&&(c.strokeStyle="dashed"),o.push(c)}),o},a1=e=>{const t=Array.from(e.querySelectorAll("[class*=activation]")),r=[];return t.forEach(i=>{const o=$e(i,"rectangle",{label:{text:""},subtype:"activation"});(()=>{const a=i.getAttribute("fill"),n=i.getAttribute("stroke"),h=i.getAttribute("stroke-width"),c=i.getAttribute("stroke-dasharray");a&&a!=="none"&&(o.bgColor=St(a)),n&&n!=="none"&&(o.strokeColor=St(n)),h&&(o.strokeWidth=Number(h)),c&&c.trim()&&(o.strokeStyle="dashed")})(),r.push(o)}),r},n1=(e,t)=>{const r=Array.from(t.querySelectorAll(".loopLine")),i=[],o=[],s=[];r.forEach(l=>{const d=Number(l.getAttribute("x1")),u=Number(l.getAttribute("y1")),f=Number(l.getAttribute("x2")),m=Number(l.getAttribute("y2")),y=di(l,d,u,f,m);y.strokeStyle="dotted",y.strokeColor="#adb5bd",y.strokeWidth=2,i.push(y)});const a=Array.from(t.querySelectorAll(".loopText")),n=e.filter(l=>l.type===ke.CRITICAL_START).map(l=>l.message);a.forEach(l=>{const d=l.textContent||"",u=Fg(l,d),f=d.match(/\[(.*?)\]/)?.[1]||"";n.includes(f)&&(u.x+=16),o.push(u)});const h=Array.from(t?.querySelectorAll(".labelBox")),c=Array.from(t?.querySelectorAll(".labelText"));return h.forEach((l,d)=>{const u=c[d]?.textContent||"",f=$e(l,"rectangle",{label:{text:u}});f.strokeColor="#adb5bd",f.bgColor="#e9ecef",f.width=void 0,s.push(f)}),{lines:i,texts:o,nodes:s}},l1=e=>{const t=Array.from(e.querySelectorAll(".rect")).filter(i=>i.parentElement?.tagName!=="g"),r=[];return t.forEach(i=>{const o=$e(i,"rectangle",{label:{text:""},subtype:"highlight"});r.push(o)}),r},h1=(e,t)=>{const r=e.db,i=[],s=r.getBoxes().map(x=>({...x,fill:St(x.fill||"")})),a=l1(t),n=r.getActors(),{nodes:h,lines:c,actorMap:l}=i1(n,t),d=r.getMessages(),u=o1(d,t,l),f=s1(d,t),m=a1(t),y=n1(d,t);return i.push(a),i.push(...h),i.push(f),i.push(m),{type:"sequence",lines:c,arrows:u,nodes:i,loops:y,groups:s}},c1=e=>{const t={};return e&&e.forEach(r=>{le(r).forEach(({property:i,value:o})=>{i&&o&&(t[i]=St(o))})}),t},Mi={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Al={LINE:0,DOTTED_LINE:1},_l=16,d1=e=>{let t;switch(e){case Al.LINE:t="solid";break;case Al.DOTTED_LINE:t="dotted";break;default:t="solid"}return t},Ml=e=>{let t;switch(e){case Mi.AGGREGATION:t="diamond_outline";break;case Mi.COMPOSITION:t="diamond";break;case Mi.EXTENSION:t="triangle_outline";break;case"none":t=null;break;case Mi.DEPENDENCY:default:t="arrow";break}return t},is=(e,t)=>{let r=0,i=0,o=e;for(;o&&o!==t;){const{transformX:s,transformY:a}=Qe(o);r+=s,i+=a,o=o.parentElement}return{tx:r,ty:i}},Il=new Set(["triangle_outline","diamond","diamond_outline"]),Eg=(e,t=.5)=>{if(e.length<=2)return[...e];const r=[e[0]];for(let i=1;i<e.length-1;i++){const o=r[r.length-1],s=e[i],a=e[i+1],n=a.x-o.x,h=a.y-o.y,c=Math.hypot(n,h);if(!c)continue;const d=Math.abs(n*(s.y-o.y)-h*(s.x-o.x))/c,u=((s.x-o.x)*n+(s.y-o.y)*h)/(c*c);d<=t&&u>=-t&&u<=1+t||r.push(s)}return r.push(e[e.length-1]),r},Ag=e=>{const t=Ns(sh(e).map(i=>[i.x,i.y])).map(([i,o])=>({x:i,y:o})),r=Ws(e);return r&&t.length>=2&&(t[0]={x:r.startX,y:r.startY},t[t.length-1]={x:r.endX,y:r.endY}),Eg(t)},Ol=(e,t,r)=>{const i=e.x-t.x,o=e.y-t.y,s=Math.hypot(i,o);return s?{x:e.x+i/s*r,y:e.y+o/s*r}:e},u1=(e,t)=>{const r=Ns(t.map(s=>[s.x,s.y])).map(([s,a])=>({x:s,y:a}));if(r.length<2)throw new Error("Arrow route must contain at least two points");const i=r[0],o=r[r.length-1];e.startX=i.x,e.startY=i.y,e.endX=o.x,e.endY=o.y,e.points=r.map(s=>[s.x-i.x,s.y-i.y])},g1=e=>{const t=e.points?.map(([s,a])=>({x:e.startX+s,y:e.startY+a})).filter(s=>Number.isFinite(s.x)&&Number.isFinite(s.y));if(!t||t.length<2)return e;const r=[...t],i=!!e.startArrowhead&&Il.has(e.startArrowhead),o=!!e.endArrowhead&&Il.has(e.endArrowhead);if(!i&&!o)return e;if(i&&(r[0]=Ol(r[0],r[1],_l)),o){const s=r.length-1;r[s]=Ol(r[s],r[s-1],_l)}return u1(e,r),e},p1=(e,t)=>{const r=St(e.getAttribute("stroke")||getComputedStyle(e).stroke||""),i=parseFloat(e.getAttribute("stroke-width")||getComputedStyle(e).strokeWidth||"1");he(r)&&r!=="none"&&(t.strokeColor=r),Number.isFinite(i)&&i>0&&(t.strokeWidth=i)},f1=e=>{const t=[];return e.forEach(r=>{Ag(r).forEach(i=>{const o=t[t.length-1];o&&o.x===i.x&&o.y===i.y||t.push(i)})}),Eg(t)},_g=(e,t,r)=>{if(e.length<2)throw new Error(`Class diagram edge ${t?.id||"<unknown>"} is missing usable path points`);const i=e[0],o=e[e.length-1],s=Ya(i.x,i.y,o.x,o.y,{id:t?.getAttribute("data-id")||t?.id||void 0,...r,points:e.map(a=>[a.x-i.x,a.y-i.y])});return t&&p1(t,s),g1(s)},Mg=(e,t)=>_g(f1(e),e[0],t),m1=(e,t)=>{const r=Ag(e);return _g([r[0],r[r.length-1]],e,t)},y1=(e,t)=>Mg([e],t),C1=(e,t)=>[`${e}-cyclic-special-1`,`${e}-cyclic-special-mid`,`${e}-cyclic-special-2`].map(i=>t.querySelector(`path[id="${i}"][data-edge="true"]`)).filter(i=>i!==null),x1=e=>e.points?.map(([t,r])=>({x:e.startX+t,y:e.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))||[],$l=(e,t)=>{const r=x1(e);if(r.length<2)return null;const i=t==="start",o=i?r[0]:r[r.length-1],s=i?r[1]:r[r.length-2],a=s.x===o.x?i?-1:1:Math.sign(s.x-o.x),n=s.y===o.y?1:Math.sign(s.y-o.y);return{x:o.x+a*20,y:o.y+(n>=0?12:-28)}},b1=(e,t)=>{let r=e;for(;r&&r!==t;){if(r.classList.contains("annotation-group")||r.classList.contains("label-group"))return"header";if(r.classList.contains("members-group"))return"members";if(r.classList.contains("methods-group"))return"methods";r=r.parentElement}return"other"},k1=(e,t,r)=>{const i=[],o=[],s=[];return Object.values(e).forEach(a=>{const{domId:n,id:h}=a,c=se(),l=c1(a.styles||a.cssStyles);let d;try{d=r?r(h):void 0}catch{d=void 0}const u=P=>{const Y=new RegExp(`^classId-${P}(?:-|$)`);return Array.from(t.querySelectorAll("[id]")).filter(at=>Y.test(at.id))[0]},f=d&&t.querySelector(`#${d}`)||t.querySelector(`#${n}`)||t.querySelector(`[data-id='${h}']`)||u(h);if(!f)throw Error(`DOM Node with id ${n} not found`);const m=f.querySelector("rect")||f,y=m.getBBox(),{tx:x,ty:C}=is(m,t),b={type:"rectangle",id:h,groupId:c,x:y.x+x,y:y.y+C,width:y.width,height:y.height,metadata:{classId:h}},T=m.getAttribute("fill"),w=m.getAttribute("stroke"),B=m.getAttribute("stroke-width"),F=m.getAttribute("stroke-dasharray"),L=getComputedStyle(m),v=St(T||l.fill||(T?L.fill:"")),R=St(w||l.stroke||(w?L.stroke:"")),N=B||l["stroke-width"]||(B?L.strokeWidth:""),q=F||l["stroke-dasharray"]||(F?L.strokeDasharray==="none"?"":L.strokeDasharray:""),J=P=>{if(!P||!he(P))return!1;const Y=P.toLowerCase();return!(Y==="none"||Y==="transparent"||Y==="rgba(0, 0, 0, 0)"||Y==="black"||Y==="#000"||Y==="#000000"||Y==="rgb(0, 0, 0)"||Y==="rgba(0, 0, 0, 1)")};J(v)?b.bgColor=v:b.bgColor=void 0,J(R)?b.strokeColor=R:b.strokeColor=void 0,N?b.strokeWidth=Number(N):b.strokeWidth=void 0,q&&q.trim().length>0?b.strokeStyle="dashed":b.strokeStyle=void 0,i.push(b),[...Array.from(f.querySelectorAll("line")),...Array.from(f.querySelectorAll("g.divider path"))].forEach(P=>{const{tx:Y,ty:lt}=is(P,t);let at,Ct,Et,mt;if(P.tagName.toLowerCase()==="line")at=Number(P.getAttribute("x1"))+Y,Ct=Number(P.getAttribute("y1"))+lt,Et=Number(P.getAttribute("x2"))+Y,mt=Number(P.getAttribute("y2"))+lt;else{const xt=P.getBBox();at=xt.x+Y,Et=xt.x+xt.width+Y;const ht=xt.y+xt.height/2+lt;Ct=ht,mt=ht}if(at===Et&&Ct===mt)return;const Tt=di(P,at,Ct,Et,mt,{groupId:c,id:se()});b.strokeColor?Tt.strokeColor=b.strokeColor:Tt.strokeColor=void 0,b.strokeWidth!==void 0?Tt.strokeWidth=b.strokeWidth:Tt.strokeWidth=void 0,b.strokeStyle?Tt.strokeStyle=b.strokeStyle:Tt.strokeStyle=void 0,Tt.metadata={classId:h},o.push(Tt)});const z=Array.from(f.querySelectorAll("text, foreignObject")),V=[];z.forEach(P=>{const Y=P.tagName.toLowerCase()==="foreignobject",lt=Y?[]:Array.from(P.querySelectorAll("tspan")),at=lt.length?lt.map(xt=>xt.textContent?.trim()).filter(Boolean).join(`
316
- `):P.textContent?.trim()||"";if(!at)return;const Ct=P.getBBox(),{ty:Et}=is(P,t);let mt=parseFloat(getComputedStyle(P).fontSize||"");if(Y&&(!Number.isFinite(mt)||!mt)){const xt=P.querySelector("div, span, p");xt&&(mt=parseFloat(getComputedStyle(xt).fontSize||""))}(!Number.isFinite(mt)||mt<=0)&&(mt=Math.max(12,Ct.height*.6)),mt=mt*.9;const Tt=Wa(P,l.color);V.push({section:b1(P,f),text:re(at),x:Ct.x,y:Ct.y+Et,width:b&&b.width?Math.max(b.width-8,Ct.width):Ct.width,height:Ct.height,fontSize:mt,color:Tt})});const I=V.filter(P=>P.section==="header").sort((P,Y)=>P.y-Y.y||P.x-Y.x);if(!b.label){const P=I.length===0&&V.length===1?V:I;P.length>0&&(b.label={text:P.map(Y=>Y.text).join(`
317
- `),fontSize:Math.max(...P.map(Y=>Y.fontSize)),color:P.find(Y=>Y.color)?.color,verticalAlign:"top"})}V.filter(P=>I.length>0?P.section!=="header":!(b.label&&V.length===1)).forEach(P=>{const Y=io((b?.x||0)+4,P.y,P.text,{width:P.width,height:P.height,fontSize:P.fontSize,color:P.color,id:se(),groupId:c,metadata:{classId:h}});s.push(Y)})}),{nodes:i,lines:o,text:s}},S1=(e,t,r,i)=>{const o=Array.from(r.querySelectorAll('.edgePaths path[data-edge="true"]:not([id^="edgeNote"]):not([id*="-cyclic-special-"])'));if(e.length===0)return{arrows:[],text:[]};const s=[],a=[];let n=0;return e.forEach(h=>{const{id1:c,id2:l,relation:d}=h,u=t.find(N=>N.id===c),f=t.find(N=>N.id===l);if(!u)throw new Error(`parseRelations: Cannot find node with id ${c}`);if(!f)throw new Error(`parseRelations: Cannot find node with id ${l}`);const m=d1(d.lineType),y=Ml(d.type1),x=Ml(d.type2);let C;if(c===l){const N=C1(c,r);if(!N.length)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${c} -> ${l}`);C=Mg(N,{strokeStyle:m,startArrowhead:y,endArrowhead:x,label:h.title?{text:h.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:f.id}})}else{const N=o[n];if(!N)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${c} -> ${l}`);n+=1,C=m1(N,{strokeStyle:m,startArrowhead:y,endArrowhead:x,label:h.title?{text:h.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:f.id}})}s.push(C);const{relationTitle1:b,relationTitle2:T}=h,w=c===l,B=20,F=15,L=15;let v,R;if(b&&b!=="none"){if(w){const q=$l(C,"start");q&&(v=q.x,R=q.y)}else switch(i){case"TB":v=C.startX-B,C.endX<C.startX&&(v-=L),R=C.startY+F;break;case"BT":v=C.startX+B,C.endX>C.startX&&(v+=L),R=C.startY-F;break;case"LR":v=C.startX+B,R=C.startY+F,C.endY>C.startY&&(R+=L);break;case"RL":v=C.startX-B,R=C.startY-F,C.startY>C.endY&&(R-=L);break;default:v=C.startX-B,R=C.startY+F}v??=C.startX-B,R??=C.startY+F;const N=io(v,R,b,{fontSize:16});a.push(N)}if(T&&T!=="none"){if(w){const q=$l(C,"end");q&&(v=q.x,R=q.y)}else switch(i){case"TB":v=C.endX+B,C.endX<C.startX&&(v+=L),R=C.endY-F;break;case"BT":v=C.endX-B,C.endX>C.startX&&(v-=L),R=C.endY+F;break;case"LR":v=C.endX-B,R=C.endY-F,C.endY>C.startY&&(R-=L);break;case"RL":v=C.endX+B,R=C.endY+F,C.startY>C.endY&&(R+=L);break;default:v=C.endX+B,R=C.endY-F}v??=C.endX+B,R??=C.endY+F;const N=io(v,R,T,{fontSize:16});a.push(N)}}),{arrows:s,text:a}},T1=(e,t,r)=>{const i=[],o=[];return e.forEach((s,a)=>{const{id:n,text:h,class:c}=s,l=t.querySelector(`#${n}`);if(!l)throw new Error(`Node with id ${n} not found!`);const{transformX:d,transformY:u}=Qe(l),f=l.firstChild,m=$e(f,"rectangle",{id:n,subtype:"note",label:{text:h}});if(Object.assign(m,{x:m.x+d,y:m.y+u}),i.push(m),c){const y=r.find(F=>F.id===c);if(!y)throw new Error(`class node with id ${c} not found!`);const x=t.querySelector(`path[id="edgeNote${a+1}"][data-edge="true"]`);if(x){o.push(y1(x,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:m.id,type:"rectangle"},end:{id:y.id,type:"rectangle"}}));return}const C=m.x+(m.width||0)/2,b=m.y+(m.height||0),T=C,w=y.y,B=Ya(C,b,T,w,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:m.id,type:"rectangle"},end:{id:y.id,type:"rectangle"}});o.push(B)}}),{notes:i,connectors:o}},w1=(e,t)=>{const r=e.db,i=r.getDirection?.()||"TB",o=[],s=[],a=[],n=[],h=r.getNamespaces?.()||[],c=r.getClasses?.()||{},l=c instanceof Map?Object.fromEntries(c):c;if(l&&Object.keys(l).length){const C=typeof r.lookUpDomId=="function"?r.lookUpDomId.bind(r):void 0,b=k1(l,t,C);o.push(b.nodes),s.push(...b.lines),a.push(...b.text),n.push(...b.nodes)}const d=r.getRelations?.()||[],{arrows:u,text:f}=S1(d,n,t,i),m=r.getNotes?.()||[],{notes:y,connectors:x}=T1(m,t,n);return o.push(y),u.push(...x),a.push(...f),{type:"class",nodes:o,lines:s,arrows:u,text:a,namespaces:h}},Dl=18,B1=e=>{const t={};return e&&e.forEach(r=>{le(r).forEach(({property:i,value:o})=>{i&&o&&(t[i]=St(o))})}),t},v1=e=>{if(e==null||e==="")return;const t=typeof e=="number"?e:parseFloat(St(e));if(!(!Number.isFinite(t)||t<=0))return t},ja=(e,t)=>{let r=0,i=0,o=e;for(;o&&o!==t;){const{transformX:s,transformY:a}=Qe(o);r+=s,i+=a,o=o.parentElement}return{tx:r,ty:i}},L1=e=>{const t=Array.from(e.querySelectorAll("tspan")),r=t.length?t.map(i=>i.textContent?.trim()).filter(Boolean).join(`
318
- `):e.textContent?.trim()||"";return re(r)},F1=e=>{const t=e.querySelector("text, foreignObject, div, span, p")||e;let r=parseFloat(getComputedStyle(t).fontSize||"");return(!Number.isFinite(r)||r<=0)&&(r=Math.max(12,e.getBBox().height*.75)),r},E1=(e,t,r)=>{const i=L1(e);if(!i)return null;const o=e.getBBox(),{tx:s,ty:a}=ja(e,t);return{className:e.getAttribute("class")||"",text:i,x:o.x+s,y:o.y+a,width:o.width,height:o.height,fontSize:F1(e),color:Wa(e,r)}},A1=(e,t,r,i,o,s,a)=>{const{tx:n,ty:h}=ja(e,t);let c=0,l=0,d=0,u=0;if(e.tagName.toLowerCase()==="line")c=Number(e.getAttribute("x1"))+n,l=Number(e.getAttribute("y1"))+h,d=Number(e.getAttribute("x2"))+n,u=Number(e.getAttribute("y2"))+h;else{const m=Ws(e);if(!m)return null;c=m.startX+n,l=m.startY+h,d=m.endX+n,u=m.endY+h}const f={type:"line",id:se(),groupId:r,startX:c,startY:l,endX:d,endY:u,metadata:{entityId:i}};return o&&he(o)&&o!=="none"&&(f.strokeColor=o),s!==void 0&&(f.strokeWidth=s),a&&(f.strokeStyle=a),f},Pl=e=>{switch(e?.toLowerCase()){case"one":return"cardinality_one";case"many":return"cardinality_many";case"only_one":return"cardinality_exactly_one";case"one_or_more":return"cardinality_one_or_many";case"zero_or_one":return"cardinality_zero_or_one";case"zero_or_more":return"cardinality_zero_or_many";default:return null}},_1=e=>{switch(e){case"dotted":return"dotted";case"dashed":return"dashed";default:return"solid"}},M1=(e,t)=>{const r=t.querySelector(`path[id="${e.id}"][data-edge="true"]`);return r?[r]:e.start!==e.end?[]:[`${e.start}-cyclic-special-1`,`${e.start}-cyclic-special-mid`,`${e.start}-cyclic-special-2`].map(o=>t.querySelector(`path[id="${o}"][data-edge="true"]`)).filter(o=>o!==null)},I1=e=>{const t=[];return e.forEach(r=>{sh(r).forEach(i=>{const o=t[t.length-1];o&&o.x===i.x&&o.y===i.y||t.push(i)})}),t},O1=(e,t)=>{const r=t.querySelector(`[id="${e.id}"]`);if(!r)throw new Error(`ER entity ${e.id} not found in rendered SVG`);const i=e.attributes.length?se():void 0,o=r.getBBox(),{tx:s,ty:a}=ja(r,t),n=B1([...e.cssStyles||[],...e.cssCompiledStyles||[]]),h=St(n.fill||""),c=St(n.stroke||""),l=v1(n["stroke-width"]),d=St(n["stroke-dasharray"]||""),u=Array.from(r.querySelectorAll("g.label")).map(T=>E1(T,t,n.color)).filter(T=>T!==null),f=u.find(T=>T.className.includes("name"))||u[0],m=u.filter(T=>T!==f),y=f?.text||re(e.alias||e.label||""),x={type:"rectangle",id:e.id,groupId:i,x:o.x+s,y:o.y+a,width:o.width,height:o.height,label:{text:y,fontSize:e.attributes.length?Dl:f?.fontSize||16,color:f?.color,textAlign:"center",verticalAlign:e.attributes.length?"top":"middle"},metadata:{entityId:e.id,entityLabel:e.label,entityAlias:e.alias}};he(h)&&h!=="none"&&(x.bgColor=h),he(c)&&c!=="none"&&(x.strokeColor=c),l&&Number.isFinite(l)&&l>0&&(x.strokeWidth=l),d&&d!=="none"&&(x.strokeStyle="dashed");const C=Array.from(r.querySelectorAll(".divider path, path.divider, line.divider")).map(T=>A1(T,t,i,e.id,x.strokeColor,x.strokeWidth,x.strokeStyle)).filter(T=>T!==null),b=m.map(T=>io(T.x,T.y,T.text,{id:se(),groupId:i,width:T.width,height:T.height,fontSize:Dl,color:T.color,metadata:{entityId:e.id}}));return{container:x,lines:C,text:b}},$1=(e,t)=>{const r=M1(e,t);if(!r.length)throw new Error(`ER relationship ${e.id} not found in rendered SVG`);const i=I1(r);if(i.length<2)throw new Error(`ER relationship ${e.id} is missing usable path points`);const o=i[0],s=i[i.length-1],a=r[0],n=St(a.getAttribute("stroke")||getComputedStyle(a).stroke||""),h=Number(a.getAttribute("stroke-width")||getComputedStyle(a).strokeWidth||1),c=Ya(o.x,o.y,s.x,s.y,{id:e.id,label:e.label?{text:re(e.label),fontSize:16,textAlign:"center"}:void 0,strokeStyle:_1(e.pattern),startArrowhead:Pl(e.arrowTypeStart),endArrowhead:Pl(e.arrowTypeEnd),start:{type:"rectangle",id:e.start},end:{type:"rectangle",id:e.end},points:i.map(l=>[l.x-o.x,l.y-o.y])});return he(n)&&n!=="none"&&(c.strokeColor=n),Number.isFinite(h)&&h>0&&(c.strokeWidth=h),c},D1=(e,t)=>{const r=e.getData(),i=r.nodes,o=r.edges,s=[],a=[],n=[];i.forEach(c=>{const l=O1(c,t);s.push(l.container),a.push(...l.lines),n.push(...l.text)});const h=o.map(c=>$1(c,t));return{type:"erd",nodes:[s],lines:a,arrows:h,text:n}},or=e=>{const t=St(e||"");return!t||t==="none"||t==="transparent"||t==="rgba(0, 0, 0, 0)"||t==="rgba(0,0,0,0)"?!1:he(t)},Ig=(e,t,r)=>{switch(t){case At.FILL:case At.STROKE:or(r)&&(e[t]=St(r));break;case At.STROKE_WIDTH:case At.STROKE_DASHARRAY:St(r)&&(e[t]=St(r));break}},Og=(e,t,r)=>{t===Qt.COLOR&&or(r)&&(e[Qt.COLOR]=St(r))},P1=(e,t,r)=>{e&&le(e).forEach(({property:i,value:o})=>{Ig(t,i,o),Og(r,i,o)})},R1=(e,t)=>{e&&le(e).forEach(({property:r,value:i})=>{if(r===At.FILL&&or(i)){t[Qt.COLOR]=St(i);return}Og(t,r,i)})},q1=e=>{const t=new Set;return e.filter(Boolean).forEach(r=>{le(r||"").forEach(({property:i})=>{t.add(i)})}),t},N1=(e,t,r)=>{if(!e)return;[[At.FILL,e.getAttribute("fill")],[At.STROKE,e.getAttribute("stroke")],[At.STROKE_WIDTH,e.getAttribute("stroke-width")],[At.STROKE_DASHARRAY,e.getAttribute("stroke-dasharray")]].forEach(([o,s])=>{if(!r.has(o)||t[o])return;const a=St(s||"");a&&Ig(t,o,a)})},W1=(e,t,r)=>{if(!e)return;const i=[e,...Array.from(e.querySelectorAll("text, foreignObject, div, span, p"))];for(const o of i){if(t[Qt.COLOR]||(r.has(Qt.COLOR)||r.has(At.FILL))&&(R1(o.getAttribute("style"),t),t[Qt.COLOR]))break;const s=St(o.getAttribute("fill")||o.getAttribute("color")||"");(r.has(Qt.COLOR)||r.has(At.FILL))&&or(s)&&(t[Qt.COLOR]=s)}},Xa=(e,t)=>{let r=0,i=0,o=e;for(;o&&o!==t;){const{transformX:s,transformY:a}=Qe(o);r+=s,i+=a,o=o.parentElement}return{tx:r,ty:i}},z1=(e,t)=>{const r=e.getBBox(),{tx:i,ty:o}=Xa(e,t);return{x:r.x+i,y:r.y+o,width:r.width,height:r.height}},H1=(e,t)=>{const r=e.querySelector("line.divider");if(!r)return;const{tx:i,ty:o}=Xa(r,t);return{startX:Number(r.getAttribute("x1"))+i,startY:Number(r.getAttribute("y1"))+o,endX:Number(r.getAttribute("x2"))+i,endY:Number(r.getAttribute("y2"))+o}},Y1=e=>{const t=e.getBBox();return Math.abs(t.width*t.height)},Rl=(e,t)=>{const r=e.getAttribute("style");if(!r)return;const i=le(r).find(o=>o.property===t);if(i)return St(i.value)},Ds=(e,t)=>{const r=e.map(o=>({element:o,area:Y1(o)})).filter(({area:o})=>Number.isFinite(o)&&o>0);return r.length===0?null:r.sort((o,s)=>t==="largest"?s.area-o.area:o.area-s.area)[0].element},j1=(e,t)=>{if(!e||!t.has(At.FILL)&&!t.has(At.STROKE))return;const r=St(e.getAttribute("fill")||Rl(e,At.FILL)||""),i=St(e.getAttribute("stroke")||Rl(e,At.STROKE)||"");if(or(r))return r;if(or(i))return i},X1=(e,t)=>{const r=Array.from(e.querySelectorAll("circle, ellipse, path")),i=Ds(r,"smallest");return j1(i,t)},U1=e=>{if(e.length<2)return e;const t=e.slice(1),r=t.filter(i=>i.trim().length>0).reduce((i,o)=>{const s=o.match(/^\s*/)?.[0].length??0;return Math.min(i,s)},Number.POSITIVE_INFINITY);return!Number.isFinite(r)||r<=0?e.map(i=>i.trimEnd()):[e[0].trimEnd(),...t.map(i=>i.replace(new RegExp(`^\\s{0,${r}}`),"").trimEnd())]},G1=e=>{const t=Array.isArray(e.label)?e.label.map(i=>re(i)):re(e.label||"").split(`
319
- `);return U1(t).join(`
320
- `)},V1=e=>e.description?(Array.isArray(e.description)?e.description:[e.description]).map(r=>re(r)).filter(r=>r.length>0):[],K1=e=>{const t=new Set,r=o=>(o&&t.add(o),o),i=o=>{const s=o.find(a=>!t.has(a));return r(s||null)};return o=>{const s=[`[id='${o.domId}']`,`[id='${o.id}']`,`[data-id='${o.id}']`];for(const a of s){const n=e.querySelector(a);if(n)return r(n)}switch(o.shape){case"divider":return i(Array.from(e.querySelectorAll("g.statediagram-cluster-alt")));case"stateStart":return i(Array.from(e.querySelectorAll("g.node.default")).filter(a=>a.querySelector("circle.state-start")));case"stateEnd":return i(Array.from(e.querySelectorAll("g.node.default")).filter(a=>!a.querySelector("circle.state-start")));default:return null}}},Z1=(e,t)=>{switch(t){case"roundedWithTitle":return e.querySelector("rect.outer")||e.querySelector("rect")||e;case"divider":return e.querySelector("rect.divider")||e.querySelector("rect")||e;case"rectWithTitle":return e.querySelector("rect.outer")||e.querySelector("rect")||e;case"stateStart":return Ds(Array.from(e.querySelectorAll("circle, ellipse, path")),"largest")||e;case"stateEnd":return Ds(Array.from(e.querySelectorAll("circle, ellipse, path")),"largest")||e;default:return e.querySelector("rect, path, circle, ellipse, polygon")||e}},Q1=(e,t,r)=>{const i=r(e);if(!i)throw new Error(`State node element not found for "${e.id}"`);const o=Z1(i,e.shape),s={},a={},n=[e.labelStyle,...e.cssCompiledStyles||[],...e.cssStyles||[]],h=q1(n);n.filter(Boolean).forEach(l=>{P1(l,s,a)}),N1(o,s,h),W1(i,a,h);const c=z1(o,t);return{id:e.id,shape:e.shape,text:G1(e),description:V1(e),x:c.x,y:c.y,width:c.width,height:c.height,parentId:e.parentId,position:e.position,containerStyle:s,labelStyle:a,dividerLine:e.shape==="rectWithTitle"?H1(i,t):void 0,endInnerColor:e.shape==="stateEnd"?X1(i,h):void 0,isRenderable:e.shape!=="noteGroup"}},J1=(e,t)=>{const r=t.querySelector(`[id='${e.id}']`);if(!r)return null;const{tx:i,ty:o}=Xa(r,t),s=ah(r,{x:i,y:o},"MCL");if(s.reflectionPoints.length<2)return null;const a={},n=(c,l)=>{switch(c){case At.STROKE:or(l)&&(a.strokeColor=St(l));break;case At.STROKE_WIDTH:{const d=parseFloat(St(l));Number.isFinite(d)&&d>0&&(a.strokeWidth=d);break}case At.STROKE_DASHARRAY:St(l)&&(a.strokeStyle="dashed");break}};[e.style].filter(Boolean).forEach(c=>{le(c||"").forEach(({property:l,value:d})=>{n(l,d)})});const h=e.arrowhead==="none"||e.classes?.includes("note-edge");return{id:e.id,start:e.start,end:e.end,text:re(e.label||""),...s,strokeColor:a.strokeColor,strokeWidth:a.strokeWidth,strokeStyle:h?"dashed":a.strokeStyle,isNoteEdge:h}},t2=(e,t)=>{const{nodes:r,edges:i}=e.getData(),o=K1(t);return{type:"state",nodes:r.map(s=>Q1(s,t,o)),edges:i.map(s=>J1(s,t)).filter(s=>s!==null)}};let ql=Promise.resolve();const e2=e=>{const t=ql.then(e,e);return ql=t.then(()=>{},()=>{}),t};let Nl=null,r2=0;const i2=e=>JSON.stringify(e),Wl=e=>{const t=e.querySelector("svg");if(!t)throw new Error("SVG element not found");const r=t.getBoundingClientRect(),i=r.width,o=r.height;t.setAttribute("width",`${i}`),t.setAttribute("height",`${o}`);const s="image/svg+xml",a=unescape(encodeURIComponent(t.outerHTML)),h=`data:image/svg+xml;base64,${btoa(a)}`;return{type:"graphImage",mimeType:s,dataURL:h,width:i,height:o}},o2=async(e,t=ki)=>e2(async()=>{const r=t.themeVariables?.fontSize??ki.themeVariables.fontSize,i={...ki,...t,fontSize:r,themeVariables:{...ki.themeVariables,...t.themeVariables,fontSize:r}},o=i2(i);o!==Nl&&(es.initialize(i),Nl=o);const s=await es.mermaidAPI.getDiagramFromText(Rp(e)),a=`mermaid-to-excalidraw-${r2++}`,n=document.createElement("div");n.setAttribute("style","opacity: 0; position: fixed; z-index: -1; left: -99999px; top: -99999px;");const h=`${a}-container`;n.id=h,document.getElementById(h)?.remove(),document.body.appendChild(n);try{const{svg:c}=await es.render(a,e,n);n.innerHTML=c;let l;try{switch(s.type){case"flowchart-v2":case"graph":{l=Jk(s.db,n);break}case"sequence":{l=h1(s,n);break}case"class":case"classDiagram":{l=w1(s,n);break}case"er":{l=D1(s.db,n);break}case"state":case"stateDiagram":{l=t2(s.db,n);break}default:l=Wl(n)}}catch(d){console.error("Error processing Mermaid diagram:",d),l=Wl(n)}return l}finally{n.remove()}}),s2=async(e,t)=>{const r=t||{},i=parseInt(r.themeVariables?.fontSize??"")||ui,o=await o2(e,{...r,themeVariables:{...r.themeVariables}});return zp(o,{fontSize:i})},N2=Object.freeze(Object.defineProperty({__proto__:null,parseMermaidToExcalidraw:s2},Symbol.toStringTag,{value:"Module"}));export{Yd as $,ta as A,ch as B,xm as C,Jf as D,oo as E,Vp as F,fy as G,f2 as H,cx as I,hx as J,ni as K,p2 as L,Af as M,Sh as N,en as O,go as P,Cm as Q,Rf as R,wh as S,g2 as T,Wd as U,Ca as V,qn as W,m2 as X,Ud as Y,cm as Z,g as _,Yf as a,xa as a0,wC as a1,Ih as a2,mi as a3,sm as a4,me as a5,om as a6,Qs as a7,rt as a8,st as a9,Bh as aa,B2 as ab,w2 as ac,ax as ad,Lt as ae,Gd as af,ot as ag,T2 as ah,Ji as ai,Kd as aj,co as ak,Gt as al,lC as am,N2 as an,Hf as b,Bt as c,Th as d,Ht as e,Ie as f,Xf as g,Rd as h,ae as i,fi as j,$h as k,M as l,pi as m,hm as n,Uf as o,Gf as p,zf as q,y2 as r,jf as s,Hp as t,q2 as u,R2 as v,Sm as w,Vt as x,Dt as y,Kf as z};
308
+ `;return i+ds(r)},"createCssStyles"),Ok=g((e,t)=>_s(wx(`${e}{${t}}`),Lx([g(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===Fs)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[cx,ux,bu,px,"@container","@starting-style"],Fs].includes(i.type)||(M.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Da))},"addNamespace"),vx])),"compileCSS"),$k=g((e,t,r,i)=>{const o=Ik(e,r),s=Rf(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return Ok(i,s)},"createUserStyles"),Dk=g((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Ne(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),Pk=g((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":vk,i=gg(`<body style="${Fk}">${e}</body>`);return`<iframe style="width:${Bk};height:${r};${Lk}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${Ek}">
309
+ ${Ak}
310
+ </iframe>`},"putIntoIFrame"),Sl=g((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Sk);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function Is(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(Is,"sandboxedIframe");var Rk=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),qk=g(async function(e,t,r){mo();const i=qa(t);t=i.code;const o=Dt();M.debug(o),t.length>(o?.maxTextSize??Ck)&&(t=xk);const s=`#${e}`,a="i"+e,n="#"+a,h="d"+e,c="#"+h,l=g(()=>{const z=yt(u?n:c).node();z&&"remove"in z&&z.remove()},"removeTempElements");let d=yt(document.body);const u=o.securityLevel===bk,f=o.securityLevel===kk,m=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const W=Is(yt(r),a);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);Sl(d,e,h,`font-family: ${m}`,Tk)}else{if(Rk(document,e,h,a),u){const W=Is(yt(document.body),a);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");Sl(d,e,h)}let y,x;try{y=await Ms.fromText(t,{title:i.title})}catch(W){if(o.suppressErrorRendering)throw l(),W;y=await Ms.fromText("error"),x=W}const C=d.select(c).node(),b=y.type,T=C.firstChild,w=T.firstChild,B=y.renderer.getClasses?.(t,y),F=$k(o,b,B,s),L=document.createElement("style");L.innerHTML=F,T.insertBefore(L,w);try{await y.renderer.draw(t,e,"11.17.2",y)}catch(W){throw o.suppressErrorRendering?l():j0.draw(t,e,"11.17.2"),W}const v=d.select(`${c} svg`),R=y.db.getAccTitle?.(),N=y.db.getAccDescription?.();yg(b,v,R,N);const J=g(()=>{d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",wk);let W=d.select(c).node().innerHTML;if(M.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),W=Dk(W,u,ve(o.arrowMarkerAbsolute)),u){const z=d.select(c+" svg").node();W=Pk(W,z)}else f||(W=Sr.sanitize(W,{ADD_TAGS:_k,ADD_ATTR:Mk,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return gk(),W},"serializeSvg")();if(x)throw x;return l(),{diagramType:b,svg:J,bindFunctions:y.db.bindFunctions}},"render");function fg(e={}){const t=Ht({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),pf(t),t?.theme&&t.theme in Me?t.themeVariables=Me[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Me.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?gf(t):ch();Ws(r.logLevel),mo()}g(fg,"initialize");var mg=g((e,t={})=>{const{code:r}=Ra(e);return Ms.fromText(r,t)},"getDiagramFromText");function yg(e,t,r,i){hg(t,e),cg(t,r,i,t.attr("id"))}g(yg,"addA11yInfo");var ir=Object.freeze({render:qk,parse:pg,getDiagramFromText:mg,initialize:fg,getConfig:Dt,setConfig:dh,getSiteConfig:ch,updateSiteConfig:ff,reset:g(()=>{Wi()},"reset"),globalReset:g(()=>{Wi(wr)},"globalReset"),defaultConfig:wr});Ws(Dt().logLevel);Wi(Dt());var Nk=g((e,t,r)=>{M.warn(e),Qs(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Cg=g(async function(e={querySelector:".mermaid"}){try{await Wk(e)}catch(t){if(Qs(t)&&M.error(t.str),Oe.parseError&&Oe.parseError(t),!e.suppressErrors)throw M.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Wk=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=ir.getConfig();M.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");M.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(M.debug("Start On Load: "+i?.startOnLoad),ir.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new Vt.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const h of Array.from(o)){if(M.info("Rendering diagram: "+h.id),h.getAttribute("data-processed"))continue;h.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=h.innerHTML,a=Kl(Vt.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const l=Vt.detectInit(a);l&&M.debug("Detected early reinit: ",l);try{const{svg:d,bindFunctions:u}=await Sg(c,a,h);h.innerHTML=d,e&&await e(c),u&&u(h)}catch(d){Nk(d,n,Oe.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),xg=g(function(e){ir.initialize(e)},"initialize"),zk=g(async function(e,t,r){M.warn("mermaid.init is deprecated. Please use run instead."),e&&xg(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Cg(i)},"init"),Hk=g(async(e,{lazyLoad:t=!0}={})=>{mo(),ls(...e),t===!1&&await dk()},"registerExternalDiagrams"),bg=g(function(){if(Oe.startOnLoad){const{startOnLoad:e}=ir.getConfig();e&&Oe.run().catch(t=>M.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",bg,!1);var Yk=g(function(e){Oe.parseError=e},"setParseErrorHandler"),Ji=[],Jo=!1,kg=g(async()=>{if(!Jo){for(Jo=!0;Ji.length>0;){const e=Ji.shift();if(e)try{await e()}catch(t){M.error("Error executing queue",t)}}Jo=!1}},"executeQueue"),jk=g(async(e,t)=>new Promise((r,i)=>{const o=g(()=>new Promise((s,a)=>{ir.parse(e,t).then(n=>{s(n),r(n)},n=>{M.error("Error parsing",n),Oe.parseError?.(n),a(n),i(n)})}),"performCall");Ji.push(o),kg().catch(i)}),"parse"),Sg=g((e,t,r)=>new Promise((i,o)=>{const s=g(()=>new Promise((a,n)=>{ir.render(e,t,r).then(h=>{a(h),i(h)},h=>{M.error("Error parsing",h),Oe.parseError?.(h),n(h),o(h)})}),"performCall");Ji.push(s),kg().catch(o)}),"render"),Xk=g(()=>Object.keys(tr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Oe={startOnLoad:!0,mermaidAPI:ir,parse:jk,render:Sg,init:zk,run:Cg,registerExternalDiagrams:Hk,registerLayoutLoaders:yu,initialize:xg,parseError:void 0,contentLoaded:bg,setParseErrorHandler:Yk,detectType:zs,registerIconPacks:rm,getRegisteredDiagramsMetadata:Xk},ts=Oe;const St=e=>e.replace(/\s*!important\s*$/i,"").trim(),Uk=(e,t)=>{let r=t;for(;r<e.length&&/\s/.test(e[r]);)r+=1;const i=r;for(;r<e.length&&/[a-z-]/i.test(e[r]);)r+=1;if(r===i)return!1;for(;r<e.length&&/\s/.test(e[r]);)r+=1;return e[r]===":"},le=e=>{const t=[];let r=0;for(;r<e.length;){for(;r<e.length&&/[\s;,]/.test(e[r]);)r+=1;if(r>=e.length)break;const i=r;for(;r<e.length&&e[r]!==":"&&!(e[r]===";"||e[r]===",");)r+=1;if(r>=e.length||e[r]!==":")break;const o=e.substring(i,r).trim().toLowerCase();r+=1;const s=r;let a=0,n=null;for(;r<e.length;){const c=e[r];if(n){c===n&&e[r-1]!=="\\"&&(n=null),r+=1;continue}if(c==='"'||c==="'"){n=c,r+=1;continue}if(c==="("){a+=1,r+=1;continue}if(c===")"){a=Math.max(0,a-1),r+=1;continue}if(a===0&&(c===";"||c===","||/\s/.test(c)&&Uk(e,r)))break;r+=1}const h=St(e.substring(s,r));o&&h&&t.push({property:o,value:h}),r<e.length&&(e[r]===";"||e[r]===",")&&(r+=1)}return t},he=e=>{const t=St(e);if(!t)return!1;if(typeof CSS<"u"&&typeof CSS.supports=="function")return CSS.supports("color",t);if(typeof document<"u"){const r=document.createElement("div");return r.style.color="",r.style.color=t,r.style.color!==""}return!1},Tl=(e,t)=>{const r=e.getAttribute("style");return r&&le(r).find(i=>i.property===t)?.value||""},es=(...e)=>{for(const t of e){const r=St(t||"");if(he(r))return r}},Na=(e,t)=>{const r=e.querySelector("text, foreignObject, div, span, p")||e,i=es(r.getAttribute?.("fill"),Tl(r,"fill"),r.style?.fill);if(i)return i;const o=es(r.getAttribute?.("color"),Tl(r,"color"),r.style?.color);if(o)return o;const s=es(t);if(s)return s},Wa=(e,t,r)=>{switch(t){case At.FILL:case At.STROKE:he(r)&&(e[t]=r);break;case At.STROKE_WIDTH:case At.STROKE_DASHARRAY:e[t]=r;break}},to=(e,t,r)=>{t===Qt.COLOR&&he(r)&&(e[Qt.COLOR]=r)},eo=(e,t,r)=>{e&&le(e).forEach(({property:i,value:o})=>{Wa(t,i,o),to(r,i,o)})},Tg=(e,t)=>{e&&le(e).forEach(({property:r,value:i})=>{if(r==="fill"&&he(i)){t[Qt.COLOR]=i;return}to(t,r,i)})},wg=(e,t)=>{if(!e)return;[[At.FILL,e.getAttribute("fill")],[At.STROKE,e.getAttribute("stroke")],[At.STROKE_WIDTH,e.getAttribute("stroke-width")],[At.STROKE_DASHARRAY,e.getAttribute("stroke-dasharray")]].forEach(([i,o])=>{const s=St(o||"");s&&Wa(t,i,s)})},Bg=(e,t)=>{if(!e)return;const r=e.getAttribute("fill")||e.getAttribute("color"),i=St(r||"");he(i)&&(t[Qt.COLOR]=i)},Os=(e,t,r,i)=>{if(!(t instanceof Map))return;const o=t.get(e);o&&(o.styles?.forEach(s=>{le(s).forEach(({property:a,value:n})=>{Wa(r,a,n),to(i,a,n)})}),o.textStyles?.forEach(s=>{le(s).forEach(({property:a,value:n})=>{to(i,a,n)})}))},Gk=(e,t,r)=>{const i=e.nodes.map(u=>u.startsWith("flowchart-")?u.split("-")[1]:u),o=t.querySelector(`[id='${e.id}']`);if(!o)throw new Error("SubGraph element not found");const s=za(o,t),a=o.getBBox(),n={width:a.width,height:a.height},h={},c={},l=o.querySelector(":scope > rect, :scope > path, :scope > polygon, :scope > ellipse")||o.querySelector(".cluster > rect, .cluster > path, .cluster > polygon, .cluster > ellipse")||o.querySelector("rect, path, polygon, ellipse");eo(o.getAttribute("style"),h,c),eo(l?.getAttribute("style"),h,c),wg(l,h);const d=o.querySelector(".cluster-label text, .cluster-label tspan")||o.querySelector("text");return Tg(d?.getAttribute("style"),c),Bg(d,c),Os(e.id,r,h,c),e.classes?.forEach(u=>{Os(u,r,h,c)}),{id:e.id,nodeIds:i,text:re(e.title),labelType:"text",...s,...n,containerStyle:h,labelStyle:c}},wl=(e,t,r)=>{const i=t.querySelector(`[id*="${e.domId}"]`);if(!i)return;let o;i.parentElement?.tagName.toLowerCase()==="a"&&(o=i.parentElement.getAttribute("xlink:href"));const s=za(o?i.parentElement:i,t),a=i.getBBox(),n={width:a.width,height:a.height},h={},c={};e.classes&&r instanceof Map&&(Array.isArray(e.classes)?e.classes:[e.classes]).forEach(u=>{Os(u,r,h,c)}),e.styles?.forEach(u=>{eo(u,h,c)});const l=i.querySelector(".label-container");return eo(l?.getAttribute("style"),h,c),wg(l,h),Array.from(i.querySelectorAll(".label, .nodeLabel, .label text, .label tspan, .label span, .label div")).forEach(u=>{Tg(u.getAttribute("style"),c),Bg(u,c)}),{id:e.id,labelType:e.labelType,text:re(e.text||""),type:e.type,link:o||void 0,...s,...n,containerStyle:h,labelStyle:c}},Vk=(e,t,r)=>{const i=r.querySelector(`[id*="${e.id}"]`);if(!i)throw new Error("Edge element not found");const o=za(i,r),s=oh(i,o);return e.length=void 0,{...e,...s,text:re(e.text)}},za=(e,t)=>{if(!e)throw new Error("Element not found");let r=e.parentElement?.parentElement;const i=e.childNodes[0];let o={x:0,y:0};if(i){const{transformX:h,transformY:c}=Qe(i),l=i.getBBox();o={x:Number(i.getAttribute("x"))||h+l.x||0,y:Number(i.getAttribute("y"))||c+l.y||0}}const{transformX:s,transformY:a}=Qe(e),n={x:s+o.x,y:a+o.y};for(;r&&r.id!==t.id;){if(r.classList.value==="root"&&r.hasAttribute("transform")){const{transformX:h,transformY:c}=Qe(r);n.x+=h,n.y+=c}r=r.parentElement}return n},Kk=(e,t)=>{const r=e.getVertices(),i=e.getEdges(),o=e.getSubGraphs(),s=e.getClasses(),a={},n=s instanceof Map?s:{};r instanceof Map?r.forEach((d,u)=>{a[u]=wl(d,t,n)}):typeof r=="object"&&r!==null&&Object.entries(r).forEach(([d,u])=>{a[d]=wl(u,t,n)});const h=new Map,c=(Array.isArray(i)?i:[]).map(d=>{if(!t.querySelector(`[id*="${d.id}"]`))return null;const u=`${d.start}-${d.end}`,f=h.get(u)||0;return h.set(u,f+1),Vk(d,f,t)}).filter(d=>d!==null&&d.reflectionPoints.length>1);return{type:"flowchart",subGraphs:(Array.isArray(o)?o:[]).map(d=>Gk(d,t,n)),vertices:a,edges:c}},Zk=(e,t)=>{const r={};t?.label&&(r.label={text:re(t.label),fontSize:16});const i=e.tagName;if(i==="line")r.startX=Number(e.getAttribute("x1")),r.startY=Number(e.getAttribute("y1")),r.endX=Number(e.getAttribute("x2")),r.endY=Number(e.getAttribute("y2"));else if(i==="path"){const a=e.getAttribute("d");if(!a)throw new Error('Path element does not contain a "d" attribute');const n=a.split(/(?=[LC])/),h=n[0].substring(1).split(",").map(d=>parseFloat(d)),c=[];n.forEach(d=>{const u=d.substring(1).trim().split(" ").map(f=>{const[m,y]=f.split(",");return[parseFloat(m)-h[0],parseFloat(y)-h[1]]});c.push(...u)});const l=c[c.length-1];r.startX=h[0],r.startY=h[1],r.endX=l[0],r.endY=l[1],r.points=c}t?.label&&(r.startY=r.startY-10,r.endY=r.endY-10);const o=e.getAttribute("stroke"),s=(o&&o!=="none"?o:"")||getComputedStyle(e).stroke||"";return r.strokeColor=s?St(s):null,r.strokeWidth=Number(e.getAttribute("stroke-width")),r.type="arrow",r.strokeStyle=t?.strokeStyle||"solid",r.startArrowhead=t?.startArrowhead||null,r.endArrowhead=t?.endArrowhead||null,r},Ha=(e,t,r,i,o)=>{const s={};return s.type="arrow",s.startX=e,s.startY=t,s.endX=r,s.endY=i,Object.assign(s,{...o}),s},ro=(e,t,r,i)=>({type:"text",x:e,y:t,text:r,width:i?.width||20,height:i?.height||20,fontSize:i?.fontSize||di,id:i?.id,color:i?.color,groupId:i?.groupId,metadata:i?.metadata}),vg=(e,t,r)=>{const i={},o=Number(e.getAttribute("x")),s=Number(e.getAttribute("y"));i.type="text",i.text=re(t),r?.id&&(i.id=r.id),r?.groupId&&(i.groupId=r.groupId);const a=e.getBBox();i.width=a.width,i.height=a.height,i.x=o-a.width/2,i.y=s;const n=parseInt(getComputedStyle(e).fontSize);return i.fontSize=n,i.color=Na(e),i},$e=(e,t,r={})=>{const i={};i.type=t;const{label:o,subtype:s,id:a,groupId:n}=r;i.id=a,n&&(i.groupId=n),o&&(i.label={text:re(o.text),fontSize:16,textAlign:o?.textAlign,verticalAlign:o?.verticalAlign});const h=e.getBBox();switch(i.x=h.x,i.y=h.y,i.width=h.width,i.height=h.height,i.subtype=s,s){case"highlight":const c=e.getAttribute("fill");c&&(i.bgColor=St(c));break;case"note":i.strokeStyle="dashed";break}return i},ci=(e,t,r,i,o,s)=>{const a={};a.startX=t,a.startY=r,a.endX=i,s?.groupId&&(a.groupId=s.groupId),s?.id&&(a.id=s.id),a.endY=o;const n=e.getAttribute("stroke");return a.strokeColor=n?St(n):null,a.strokeWidth=Number(e.getAttribute("stroke-width")),a.type="line",a},Bl={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},ke={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,SOLID_POINT:24,DOTTED_POINT:25,CRITICAL_START:27},Qk=e=>{let t;switch(e){case ke.SOLID:case ke.SOLID_CROSS:case ke.SOLID_OPEN:case ke.SOLID_POINT:t="solid";break;case ke.DOTTED:case ke.DOTTED_CROSS:case ke.DOTTED_OPEN:case ke.DOTTED_POINT:t="dotted";break;default:t="solid";break}return t},Jk=(e,t)=>{if(!!e.nextElementSibling?.classList.contains("sequenceNumber")){const i=e.nextElementSibling?.textContent;if(!i)throw new Error("sequence number not present");const o=30,s=o/2,n={type:"rectangle",x:t.startX-10,y:t.startY-s,label:{text:i,fontSize:14},bgColor:"#e9ecef",height:o,subtype:"sequence"};Object.assign(t,{sequenceNumber:n})}},vl=(e,t,r)=>{if(!e)throw"root node not found";const i=se(),o=Array.from(e.children),s=[];return o.forEach((a,n)=>{const h=`${r?.id}-${n}`;let c;switch(a.tagName){case"line":const l=Number(a.getAttribute("x1")),d=Number(a.getAttribute("y1")),u=Number(a.getAttribute("x2")),f=Number(a.getAttribute("y2"));c=ci(a,l,d,u,f,{groupId:i,id:h});break;case"text":c=vg(a,t,{groupId:i,id:h});break;case"circle":c=$e(a,"ellipse",{label:a.textContent?{text:a.textContent}:void 0,groupId:i,id:h});default:c=$e(a,tp[a.tagName],{label:a.textContent?{text:a.textContent}:void 0,groupId:i,id:h})}s.push(c)}),s},Ll=(e,t)=>{const r=t.getAttribute("fill"),i=t.getAttribute("stroke"),o=t.getAttribute("stroke-width"),s=t.getAttribute("stroke-dasharray");r&&r!=="none"&&(e.bgColor=St(r)),i&&i!=="none"&&(e.strokeColor=St(i)),o&&(e.strokeWidth=Number(o)),s&&s.trim()&&(e.strokeStyle="dashed")},t1=(e,t)=>{const r=Array.from(t.querySelectorAll(".actor-top")),i=Array.from(t.querySelectorAll(".actor-bottom")),o=[],s=[],a={},n=e instanceof Map?Array.from(e.values()):Object.values(e),h=Array.from(t.querySelectorAll(".actor-line")),c=(l,d)=>{const u=l.name,f=h.find(y=>y.getAttribute("name")===u);if(f)return f;const m=l.type==="participant"?d.parentElement?.previousElementSibling:d.previousElementSibling;return m?m.tagName==="line"?m:m.querySelector("line"):null};return n.forEach(l=>{const d=r.find(m=>m.getAttribute("name")===l.name),u=i.find(m=>m.getAttribute("name")===l.name);if(!d||!u)throw"root not found";const f=l.description;if(l.type==="participant"){const m=$e(d,"rectangle",{id:`${l.name}-top`,label:{text:f},subtype:"actor"});if(Ll(m,d),!m)throw"Top Node element not found!";o.push([m]);const y=$e(u,"rectangle",{id:`${l.name}-bottom`,label:{text:f},subtype:"actor"});a[l.name]={topId:`${l.name}-top`,bottomId:`${l.name}-bottom`,bindType:"rectangle"},Ll(y,u),o.push([y]);const x=c(l,d);if(x?.tagName!=="line")throw"Line not found";const C=Number(x.getAttribute("x1"));if(!m.height)throw"Top node element height is null";const b=m.y+m.height,T=y.y,w=Number(x.getAttribute("x2")),B=ci(x,C,b,w,T);s.push(B)}else if(l.type==="actor"){const m=vl(d,f,{id:`${l.name}-top`});o.push(m);const y=vl(u,f,{id:`${l.name}-bottom`});o.push(y);const x=c(l,d);if(x?.tagName!=="line")throw"Line not found";const C=Number(x.getAttribute("x1")),b=Number(x.getAttribute("y1")),T=Number(x.getAttribute("x2")),w=y.find(L=>L.type==="ellipse");if(w){const L=w.y,v=ci(x,C,b,T,L);s.push(v)}const B=m.find(L=>L.type==="ellipse"),F=y.find(L=>L.type==="ellipse");B?.id&&F?.id&&(a[l.name]={topId:B.id,bottomId:F.id,bindType:"ellipse"})}}),{nodes:o,lines:s,actorMap:a}},e1=(e,t,r)=>{const i=[],o=Array.from(t.querySelectorAll('[class*="messageLine"]')),s=Object.keys(Bl),a=e.filter(n=>s.includes(n.type.toString()));return o.forEach((n,h)=>{const c=a[h],l=Bl[c.type],d=Zk(n,{label:c?.message,strokeStyle:Qk(c.type),endArrowhead:l==="SOLID_OPEN"||l==="DOTTED_OPEN"?null:"arrow"}),u=r[c.from],f=r[c.to];u?.topId&&f?.topId&&(d.start={type:u.bindType||"rectangle",id:u.topId},d.end={type:f.bindType||"rectangle",id:f.topId}),Jk(n,d),i.push(d)}),i},r1=(e,t)=>{const r=Array.from(t.querySelectorAll(".note")).map(s=>s.parentElement),i=e.filter(s=>s.type===ke.NOTE),o=[];return r.forEach((s,a)=>{if(!s)return;const n=s.firstChild,h=i[a].message,c=$e(n,"rectangle",{label:{text:h},subtype:"note"}),l=n.getAttribute("fill"),d=n.getAttribute("stroke"),u=n.getAttribute("stroke-width"),f=n.getAttribute("stroke-dasharray");l&&l!=="none"&&(c.bgColor=St(l)),d&&d!=="none"&&(c.strokeColor=St(d)),u&&(c.strokeWidth=Number(u)),f&&f.trim()&&(c.strokeStyle="dashed"),o.push(c)}),o},i1=e=>{const t=Array.from(e.querySelectorAll("[class*=activation]")),r=[];return t.forEach(i=>{const o=$e(i,"rectangle",{label:{text:""},subtype:"activation"});(()=>{const a=i.getAttribute("fill"),n=i.getAttribute("stroke"),h=i.getAttribute("stroke-width"),c=i.getAttribute("stroke-dasharray");a&&a!=="none"&&(o.bgColor=St(a)),n&&n!=="none"&&(o.strokeColor=St(n)),h&&(o.strokeWidth=Number(h)),c&&c.trim()&&(o.strokeStyle="dashed")})(),r.push(o)}),r},o1=(e,t)=>{const r=Array.from(t.querySelectorAll(".loopLine")),i=[],o=[],s=[];r.forEach(l=>{const d=Number(l.getAttribute("x1")),u=Number(l.getAttribute("y1")),f=Number(l.getAttribute("x2")),m=Number(l.getAttribute("y2")),y=ci(l,d,u,f,m);y.strokeStyle="dotted",y.strokeColor="#adb5bd",y.strokeWidth=2,i.push(y)});const a=Array.from(t.querySelectorAll(".loopText")),n=e.filter(l=>l.type===ke.CRITICAL_START).map(l=>l.message);a.forEach(l=>{const d=l.textContent||"",u=vg(l,d),f=d.match(/\[(.*?)\]/)?.[1]||"";n.includes(f)&&(u.x+=16),o.push(u)});const h=Array.from(t?.querySelectorAll(".labelBox")),c=Array.from(t?.querySelectorAll(".labelText"));return h.forEach((l,d)=>{const u=c[d]?.textContent||"",f=$e(l,"rectangle",{label:{text:u}});f.strokeColor="#adb5bd",f.bgColor="#e9ecef",f.width=void 0,s.push(f)}),{lines:i,texts:o,nodes:s}},s1=e=>{const t=Array.from(e.querySelectorAll(".rect")).filter(i=>i.parentElement?.tagName!=="g"),r=[];return t.forEach(i=>{const o=$e(i,"rectangle",{label:{text:""},subtype:"highlight"});r.push(o)}),r},a1=(e,t)=>{const r=e.db,i=[],s=r.getBoxes().map(x=>({...x,fill:St(x.fill||"")})),a=s1(t),n=r.getActors(),{nodes:h,lines:c,actorMap:l}=t1(n,t),d=r.getMessages(),u=e1(d,t,l),f=r1(d,t),m=i1(t),y=o1(d,t);return i.push(a),i.push(...h),i.push(f),i.push(m),{type:"sequence",lines:c,arrows:u,nodes:i,loops:y,groups:s}},n1=e=>{const t={};return e&&e.forEach(r=>{le(r).forEach(({property:i,value:o})=>{i&&o&&(t[i]=St(o))})}),t},_i={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Fl={LINE:0,DOTTED_LINE:1},El=16,l1=e=>{let t;switch(e){case Fl.LINE:t="solid";break;case Fl.DOTTED_LINE:t="dotted";break;default:t="solid"}return t},Al=e=>{let t;switch(e){case _i.AGGREGATION:t="diamond_outline";break;case _i.COMPOSITION:t="diamond";break;case _i.EXTENSION:t="triangle_outline";break;case"none":t=null;break;case _i.DEPENDENCY:default:t="arrow";break}return t},rs=(e,t)=>{let r=0,i=0,o=e;for(;o&&o!==t;){const{transformX:s,transformY:a}=Qe(o);r+=s,i+=a,o=o.parentElement}return{tx:r,ty:i}},_l=new Set(["triangle_outline","diamond","diamond_outline"]),Lg=(e,t=.5)=>{if(e.length<=2)return[...e];const r=[e[0]];for(let i=1;i<e.length-1;i++){const o=r[r.length-1],s=e[i],a=e[i+1],n=a.x-o.x,h=a.y-o.y,c=Math.hypot(n,h);if(!c)continue;const d=Math.abs(n*(s.y-o.y)-h*(s.x-o.x))/c,u=((s.x-o.x)*n+(s.y-o.y)*h)/(c*c);d<=t&&u>=-t&&u<=1+t||r.push(s)}return r.push(e[e.length-1]),r},Fg=e=>{const t=qs(ih(e).map(i=>[i.x,i.y])).map(([i,o])=>({x:i,y:o})),r=Ns(e);return r&&t.length>=2&&(t[0]={x:r.startX,y:r.startY},t[t.length-1]={x:r.endX,y:r.endY}),Lg(t)},Ml=(e,t,r)=>{const i=e.x-t.x,o=e.y-t.y,s=Math.hypot(i,o);return s?{x:e.x+i/s*r,y:e.y+o/s*r}:e},h1=(e,t)=>{const r=qs(t.map(s=>[s.x,s.y])).map(([s,a])=>({x:s,y:a}));if(r.length<2)throw new Error("Arrow route must contain at least two points");const i=r[0],o=r[r.length-1];e.startX=i.x,e.startY=i.y,e.endX=o.x,e.endY=o.y,e.points=r.map(s=>[s.x-i.x,s.y-i.y])},c1=e=>{const t=e.points?.map(([s,a])=>({x:e.startX+s,y:e.startY+a})).filter(s=>Number.isFinite(s.x)&&Number.isFinite(s.y));if(!t||t.length<2)return e;const r=[...t],i=!!e.startArrowhead&&_l.has(e.startArrowhead),o=!!e.endArrowhead&&_l.has(e.endArrowhead);if(!i&&!o)return e;if(i&&(r[0]=Ml(r[0],r[1],El)),o){const s=r.length-1;r[s]=Ml(r[s],r[s-1],El)}return h1(e,r),e},d1=(e,t)=>{const r=St(e.getAttribute("stroke")||getComputedStyle(e).stroke||""),i=parseFloat(e.getAttribute("stroke-width")||getComputedStyle(e).strokeWidth||"1");he(r)&&r!=="none"&&(t.strokeColor=r),Number.isFinite(i)&&i>0&&(t.strokeWidth=i)},u1=e=>{const t=[];return e.forEach(r=>{Fg(r).forEach(i=>{const o=t[t.length-1];o&&o.x===i.x&&o.y===i.y||t.push(i)})}),Lg(t)},Eg=(e,t,r)=>{if(e.length<2)throw new Error(`Class diagram edge ${t?.id||"<unknown>"} is missing usable path points`);const i=e[0],o=e[e.length-1],s=Ha(i.x,i.y,o.x,o.y,{id:t?.getAttribute("data-id")||t?.id||void 0,...r,points:e.map(a=>[a.x-i.x,a.y-i.y])});return t&&d1(t,s),c1(s)},Ag=(e,t)=>Eg(u1(e),e[0],t),g1=(e,t)=>{const r=Fg(e);return Eg([r[0],r[r.length-1]],e,t)},p1=(e,t)=>Ag([e],t),f1=(e,t)=>[`${e}-cyclic-special-1`,`${e}-cyclic-special-mid`,`${e}-cyclic-special-2`].map(i=>t.querySelector(`path[id="${i}"][data-edge="true"]`)).filter(i=>i!==null),m1=e=>e.points?.map(([t,r])=>({x:e.startX+t,y:e.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))||[],Il=(e,t)=>{const r=m1(e);if(r.length<2)return null;const i=t==="start",o=i?r[0]:r[r.length-1],s=i?r[1]:r[r.length-2],a=s.x===o.x?i?-1:1:Math.sign(s.x-o.x),n=s.y===o.y?1:Math.sign(s.y-o.y);return{x:o.x+a*20,y:o.y+(n>=0?12:-28)}},y1=(e,t)=>{let r=e;for(;r&&r!==t;){if(r.classList.contains("annotation-group")||r.classList.contains("label-group"))return"header";if(r.classList.contains("members-group"))return"members";if(r.classList.contains("methods-group"))return"methods";r=r.parentElement}return"other"},C1=(e,t,r)=>{const i=[],o=[],s=[];return Object.values(e).forEach(a=>{const{domId:n,id:h}=a,c=se(),l=n1(a.styles||a.cssStyles);let d;try{d=r?r(h):void 0}catch{d=void 0}const u=P=>{const Y=new RegExp(`^classId-${P}(?:-|$)`);return Array.from(t.querySelectorAll("[id]")).filter(at=>Y.test(at.id))[0]},f=d&&t.querySelector(`#${d}`)||t.querySelector(`#${n}`)||t.querySelector(`[data-id='${h}']`)||u(h);if(!f)throw Error(`DOM Node with id ${n} not found`);const m=f.querySelector("rect")||f,y=m.getBBox(),{tx:x,ty:C}=rs(m,t),b={type:"rectangle",id:h,groupId:c,x:y.x+x,y:y.y+C,width:y.width,height:y.height,metadata:{classId:h}},T=m.getAttribute("fill"),w=m.getAttribute("stroke"),B=m.getAttribute("stroke-width"),F=m.getAttribute("stroke-dasharray"),L=getComputedStyle(m),v=St(T||l.fill||(T?L.fill:"")),R=St(w||l.stroke||(w?L.stroke:"")),N=B||l["stroke-width"]||(B?L.strokeWidth:""),q=F||l["stroke-dasharray"]||(F?L.strokeDasharray==="none"?"":L.strokeDasharray:""),J=P=>{if(!P||!he(P))return!1;const Y=P.toLowerCase();return!(Y==="none"||Y==="transparent"||Y==="rgba(0, 0, 0, 0)"||Y==="black"||Y==="#000"||Y==="#000000"||Y==="rgb(0, 0, 0)"||Y==="rgba(0, 0, 0, 1)")};J(v)?b.bgColor=v:b.bgColor=void 0,J(R)?b.strokeColor=R:b.strokeColor=void 0,N?b.strokeWidth=Number(N):b.strokeWidth=void 0,q&&q.trim().length>0?b.strokeStyle="dashed":b.strokeStyle=void 0,i.push(b),[...Array.from(f.querySelectorAll("line")),...Array.from(f.querySelectorAll("g.divider path"))].forEach(P=>{const{tx:Y,ty:lt}=rs(P,t);let at,Ct,Et,mt;if(P.tagName.toLowerCase()==="line")at=Number(P.getAttribute("x1"))+Y,Ct=Number(P.getAttribute("y1"))+lt,Et=Number(P.getAttribute("x2"))+Y,mt=Number(P.getAttribute("y2"))+lt;else{const xt=P.getBBox();at=xt.x+Y,Et=xt.x+xt.width+Y;const ht=xt.y+xt.height/2+lt;Ct=ht,mt=ht}if(at===Et&&Ct===mt)return;const Tt=ci(P,at,Ct,Et,mt,{groupId:c,id:se()});b.strokeColor?Tt.strokeColor=b.strokeColor:Tt.strokeColor=void 0,b.strokeWidth!==void 0?Tt.strokeWidth=b.strokeWidth:Tt.strokeWidth=void 0,b.strokeStyle?Tt.strokeStyle=b.strokeStyle:Tt.strokeStyle=void 0,Tt.metadata={classId:h},o.push(Tt)});const z=Array.from(f.querySelectorAll("text, foreignObject")),V=[];z.forEach(P=>{const Y=P.tagName.toLowerCase()==="foreignobject",lt=Y?[]:Array.from(P.querySelectorAll("tspan")),at=lt.length?lt.map(xt=>xt.textContent?.trim()).filter(Boolean).join(`
311
+ `):P.textContent?.trim()||"";if(!at)return;const Ct=P.getBBox(),{ty:Et}=rs(P,t);let mt=parseFloat(getComputedStyle(P).fontSize||"");if(Y&&(!Number.isFinite(mt)||!mt)){const xt=P.querySelector("div, span, p");xt&&(mt=parseFloat(getComputedStyle(xt).fontSize||""))}(!Number.isFinite(mt)||mt<=0)&&(mt=Math.max(12,Ct.height*.6)),mt=mt*.9;const Tt=Na(P,l.color);V.push({section:y1(P,f),text:re(at),x:Ct.x,y:Ct.y+Et,width:b&&b.width?Math.max(b.width-8,Ct.width):Ct.width,height:Ct.height,fontSize:mt,color:Tt})});const I=V.filter(P=>P.section==="header").sort((P,Y)=>P.y-Y.y||P.x-Y.x);if(!b.label){const P=I.length===0&&V.length===1?V:I;P.length>0&&(b.label={text:P.map(Y=>Y.text).join(`
312
+ `),fontSize:Math.max(...P.map(Y=>Y.fontSize)),color:P.find(Y=>Y.color)?.color,verticalAlign:"top"})}V.filter(P=>I.length>0?P.section!=="header":!(b.label&&V.length===1)).forEach(P=>{const Y=ro((b?.x||0)+4,P.y,P.text,{width:P.width,height:P.height,fontSize:P.fontSize,color:P.color,id:se(),groupId:c,metadata:{classId:h}});s.push(Y)})}),{nodes:i,lines:o,text:s}},x1=(e,t,r,i)=>{const o=Array.from(r.querySelectorAll('.edgePaths path[data-edge="true"]:not([id^="edgeNote"]):not([id*="-cyclic-special-"])'));if(e.length===0)return{arrows:[],text:[]};const s=[],a=[];let n=0;return e.forEach(h=>{const{id1:c,id2:l,relation:d}=h,u=t.find(N=>N.id===c),f=t.find(N=>N.id===l);if(!u)throw new Error(`parseRelations: Cannot find node with id ${c}`);if(!f)throw new Error(`parseRelations: Cannot find node with id ${l}`);const m=l1(d.lineType),y=Al(d.type1),x=Al(d.type2);let C;if(c===l){const N=f1(c,r);if(!N.length)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${c} -> ${l}`);C=Ag(N,{strokeStyle:m,startArrowhead:y,endArrowhead:x,label:h.title?{text:h.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:f.id}})}else{const N=o[n];if(!N)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${c} -> ${l}`);n+=1,C=g1(N,{strokeStyle:m,startArrowhead:y,endArrowhead:x,label:h.title?{text:h.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:f.id}})}s.push(C);const{relationTitle1:b,relationTitle2:T}=h,w=c===l,B=20,F=15,L=15;let v,R;if(b&&b!=="none"){if(w){const q=Il(C,"start");q&&(v=q.x,R=q.y)}else switch(i){case"TB":v=C.startX-B,C.endX<C.startX&&(v-=L),R=C.startY+F;break;case"BT":v=C.startX+B,C.endX>C.startX&&(v+=L),R=C.startY-F;break;case"LR":v=C.startX+B,R=C.startY+F,C.endY>C.startY&&(R+=L);break;case"RL":v=C.startX-B,R=C.startY-F,C.startY>C.endY&&(R-=L);break;default:v=C.startX-B,R=C.startY+F}v??=C.startX-B,R??=C.startY+F;const N=ro(v,R,b,{fontSize:16});a.push(N)}if(T&&T!=="none"){if(w){const q=Il(C,"end");q&&(v=q.x,R=q.y)}else switch(i){case"TB":v=C.endX+B,C.endX<C.startX&&(v+=L),R=C.endY-F;break;case"BT":v=C.endX-B,C.endX>C.startX&&(v-=L),R=C.endY+F;break;case"LR":v=C.endX-B,R=C.endY-F,C.endY>C.startY&&(R-=L);break;case"RL":v=C.endX+B,R=C.endY+F,C.startY>C.endY&&(R+=L);break;default:v=C.endX+B,R=C.endY-F}v??=C.endX+B,R??=C.endY+F;const N=ro(v,R,T,{fontSize:16});a.push(N)}}),{arrows:s,text:a}},b1=(e,t,r)=>{const i=[],o=[];return e.forEach((s,a)=>{const{id:n,text:h,class:c}=s,l=t.querySelector(`#${n}`);if(!l)throw new Error(`Node with id ${n} not found!`);const{transformX:d,transformY:u}=Qe(l),f=l.firstChild,m=$e(f,"rectangle",{id:n,subtype:"note",label:{text:h}});if(Object.assign(m,{x:m.x+d,y:m.y+u}),i.push(m),c){const y=r.find(F=>F.id===c);if(!y)throw new Error(`class node with id ${c} not found!`);const x=t.querySelector(`path[id="edgeNote${a+1}"][data-edge="true"]`);if(x){o.push(p1(x,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:m.id,type:"rectangle"},end:{id:y.id,type:"rectangle"}}));return}const C=m.x+(m.width||0)/2,b=m.y+(m.height||0),T=C,w=y.y,B=Ha(C,b,T,w,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:m.id,type:"rectangle"},end:{id:y.id,type:"rectangle"}});o.push(B)}}),{notes:i,connectors:o}},k1=(e,t)=>{const r=e.db,i=r.getDirection?.()||"TB",o=[],s=[],a=[],n=[],h=r.getNamespaces?.()||[],c=r.getClasses?.()||{},l=c instanceof Map?Object.fromEntries(c):c;if(l&&Object.keys(l).length){const C=typeof r.lookUpDomId=="function"?r.lookUpDomId.bind(r):void 0,b=C1(l,t,C);o.push(b.nodes),s.push(...b.lines),a.push(...b.text),n.push(...b.nodes)}const d=r.getRelations?.()||[],{arrows:u,text:f}=x1(d,n,t,i),m=r.getNotes?.()||[],{notes:y,connectors:x}=b1(m,t,n);return o.push(y),u.push(...x),a.push(...f),{type:"class",nodes:o,lines:s,arrows:u,text:a,namespaces:h}},Ol=18,S1=e=>{const t={};return e&&e.forEach(r=>{le(r).forEach(({property:i,value:o})=>{i&&o&&(t[i]=St(o))})}),t},T1=e=>{if(e==null||e==="")return;const t=typeof e=="number"?e:parseFloat(St(e));if(!(!Number.isFinite(t)||t<=0))return t},Ya=(e,t)=>{let r=0,i=0,o=e;for(;o&&o!==t;){const{transformX:s,transformY:a}=Qe(o);r+=s,i+=a,o=o.parentElement}return{tx:r,ty:i}},w1=e=>{const t=Array.from(e.querySelectorAll("tspan")),r=t.length?t.map(i=>i.textContent?.trim()).filter(Boolean).join(`
313
+ `):e.textContent?.trim()||"";return re(r)},B1=e=>{const t=e.querySelector("text, foreignObject, div, span, p")||e;let r=parseFloat(getComputedStyle(t).fontSize||"");return(!Number.isFinite(r)||r<=0)&&(r=Math.max(12,e.getBBox().height*.75)),r},v1=(e,t,r)=>{const i=w1(e);if(!i)return null;const o=e.getBBox(),{tx:s,ty:a}=Ya(e,t);return{className:e.getAttribute("class")||"",text:i,x:o.x+s,y:o.y+a,width:o.width,height:o.height,fontSize:B1(e),color:Na(e,r)}},L1=(e,t,r,i,o,s,a)=>{const{tx:n,ty:h}=Ya(e,t);let c=0,l=0,d=0,u=0;if(e.tagName.toLowerCase()==="line")c=Number(e.getAttribute("x1"))+n,l=Number(e.getAttribute("y1"))+h,d=Number(e.getAttribute("x2"))+n,u=Number(e.getAttribute("y2"))+h;else{const m=Ns(e);if(!m)return null;c=m.startX+n,l=m.startY+h,d=m.endX+n,u=m.endY+h}const f={type:"line",id:se(),groupId:r,startX:c,startY:l,endX:d,endY:u,metadata:{entityId:i}};return o&&he(o)&&o!=="none"&&(f.strokeColor=o),s!==void 0&&(f.strokeWidth=s),a&&(f.strokeStyle=a),f},$l=e=>{switch(e?.toLowerCase()){case"one":return"cardinality_one";case"many":return"cardinality_many";case"only_one":return"cardinality_exactly_one";case"one_or_more":return"cardinality_one_or_many";case"zero_or_one":return"cardinality_zero_or_one";case"zero_or_more":return"cardinality_zero_or_many";default:return null}},F1=e=>{switch(e){case"dotted":return"dotted";case"dashed":return"dashed";default:return"solid"}},E1=(e,t)=>{const r=t.querySelector(`path[id="${e.id}"][data-edge="true"]`);return r?[r]:e.start!==e.end?[]:[`${e.start}-cyclic-special-1`,`${e.start}-cyclic-special-mid`,`${e.start}-cyclic-special-2`].map(o=>t.querySelector(`path[id="${o}"][data-edge="true"]`)).filter(o=>o!==null)},A1=e=>{const t=[];return e.forEach(r=>{ih(r).forEach(i=>{const o=t[t.length-1];o&&o.x===i.x&&o.y===i.y||t.push(i)})}),t},_1=(e,t)=>{const r=t.querySelector(`[id="${e.id}"]`);if(!r)throw new Error(`ER entity ${e.id} not found in rendered SVG`);const i=e.attributes.length?se():void 0,o=r.getBBox(),{tx:s,ty:a}=Ya(r,t),n=S1([...e.cssStyles||[],...e.cssCompiledStyles||[]]),h=St(n.fill||""),c=St(n.stroke||""),l=T1(n["stroke-width"]),d=St(n["stroke-dasharray"]||""),u=Array.from(r.querySelectorAll("g.label")).map(T=>v1(T,t,n.color)).filter(T=>T!==null),f=u.find(T=>T.className.includes("name"))||u[0],m=u.filter(T=>T!==f),y=f?.text||re(e.alias||e.label||""),x={type:"rectangle",id:e.id,groupId:i,x:o.x+s,y:o.y+a,width:o.width,height:o.height,label:{text:y,fontSize:e.attributes.length?Ol:f?.fontSize||16,color:f?.color,textAlign:"center",verticalAlign:e.attributes.length?"top":"middle"},metadata:{entityId:e.id,entityLabel:e.label,entityAlias:e.alias}};he(h)&&h!=="none"&&(x.bgColor=h),he(c)&&c!=="none"&&(x.strokeColor=c),l&&Number.isFinite(l)&&l>0&&(x.strokeWidth=l),d&&d!=="none"&&(x.strokeStyle="dashed");const C=Array.from(r.querySelectorAll(".divider path, path.divider, line.divider")).map(T=>L1(T,t,i,e.id,x.strokeColor,x.strokeWidth,x.strokeStyle)).filter(T=>T!==null),b=m.map(T=>ro(T.x,T.y,T.text,{id:se(),groupId:i,width:T.width,height:T.height,fontSize:Ol,color:T.color,metadata:{entityId:e.id}}));return{container:x,lines:C,text:b}},M1=(e,t)=>{const r=E1(e,t);if(!r.length)throw new Error(`ER relationship ${e.id} not found in rendered SVG`);const i=A1(r);if(i.length<2)throw new Error(`ER relationship ${e.id} is missing usable path points`);const o=i[0],s=i[i.length-1],a=r[0],n=St(a.getAttribute("stroke")||getComputedStyle(a).stroke||""),h=Number(a.getAttribute("stroke-width")||getComputedStyle(a).strokeWidth||1),c=Ha(o.x,o.y,s.x,s.y,{id:e.id,label:e.label?{text:re(e.label),fontSize:16,textAlign:"center"}:void 0,strokeStyle:F1(e.pattern),startArrowhead:$l(e.arrowTypeStart),endArrowhead:$l(e.arrowTypeEnd),start:{type:"rectangle",id:e.start},end:{type:"rectangle",id:e.end},points:i.map(l=>[l.x-o.x,l.y-o.y])});return he(n)&&n!=="none"&&(c.strokeColor=n),Number.isFinite(h)&&h>0&&(c.strokeWidth=h),c},I1=(e,t)=>{const r=e.getData(),i=r.nodes,o=r.edges,s=[],a=[],n=[];i.forEach(c=>{const l=_1(c,t);s.push(l.container),a.push(...l.lines),n.push(...l.text)});const h=o.map(c=>M1(c,t));return{type:"erd",nodes:[s],lines:a,arrows:h,text:n}},or=e=>{const t=St(e||"");return!t||t==="none"||t==="transparent"||t==="rgba(0, 0, 0, 0)"||t==="rgba(0,0,0,0)"?!1:he(t)},_g=(e,t,r)=>{switch(t){case At.FILL:case At.STROKE:or(r)&&(e[t]=St(r));break;case At.STROKE_WIDTH:case At.STROKE_DASHARRAY:St(r)&&(e[t]=St(r));break}},Mg=(e,t,r)=>{t===Qt.COLOR&&or(r)&&(e[Qt.COLOR]=St(r))},O1=(e,t,r)=>{e&&le(e).forEach(({property:i,value:o})=>{_g(t,i,o),Mg(r,i,o)})},$1=(e,t)=>{e&&le(e).forEach(({property:r,value:i})=>{if(r===At.FILL&&or(i)){t[Qt.COLOR]=St(i);return}Mg(t,r,i)})},D1=e=>{const t=new Set;return e.filter(Boolean).forEach(r=>{le(r||"").forEach(({property:i})=>{t.add(i)})}),t},P1=(e,t,r)=>{if(!e)return;[[At.FILL,e.getAttribute("fill")],[At.STROKE,e.getAttribute("stroke")],[At.STROKE_WIDTH,e.getAttribute("stroke-width")],[At.STROKE_DASHARRAY,e.getAttribute("stroke-dasharray")]].forEach(([o,s])=>{if(!r.has(o)||t[o])return;const a=St(s||"");a&&_g(t,o,a)})},R1=(e,t,r)=>{if(!e)return;const i=[e,...Array.from(e.querySelectorAll("text, foreignObject, div, span, p"))];for(const o of i){if(t[Qt.COLOR]||(r.has(Qt.COLOR)||r.has(At.FILL))&&($1(o.getAttribute("style"),t),t[Qt.COLOR]))break;const s=St(o.getAttribute("fill")||o.getAttribute("color")||"");(r.has(Qt.COLOR)||r.has(At.FILL))&&or(s)&&(t[Qt.COLOR]=s)}},ja=(e,t)=>{let r=0,i=0,o=e;for(;o&&o!==t;){const{transformX:s,transformY:a}=Qe(o);r+=s,i+=a,o=o.parentElement}return{tx:r,ty:i}},q1=(e,t)=>{const r=e.getBBox(),{tx:i,ty:o}=ja(e,t);return{x:r.x+i,y:r.y+o,width:r.width,height:r.height}},N1=(e,t)=>{const r=e.querySelector("line.divider");if(!r)return;const{tx:i,ty:o}=ja(r,t);return{startX:Number(r.getAttribute("x1"))+i,startY:Number(r.getAttribute("y1"))+o,endX:Number(r.getAttribute("x2"))+i,endY:Number(r.getAttribute("y2"))+o}},W1=e=>{const t=e.getBBox();return Math.abs(t.width*t.height)},Dl=(e,t)=>{const r=e.getAttribute("style");if(!r)return;const i=le(r).find(o=>o.property===t);if(i)return St(i.value)},$s=(e,t)=>{const r=e.map(o=>({element:o,area:W1(o)})).filter(({area:o})=>Number.isFinite(o)&&o>0);return r.length===0?null:r.sort((o,s)=>t==="largest"?s.area-o.area:o.area-s.area)[0].element},z1=(e,t)=>{if(!e||!t.has(At.FILL)&&!t.has(At.STROKE))return;const r=St(e.getAttribute("fill")||Dl(e,At.FILL)||""),i=St(e.getAttribute("stroke")||Dl(e,At.STROKE)||"");if(or(r))return r;if(or(i))return i},H1=(e,t)=>{const r=Array.from(e.querySelectorAll("circle, ellipse, path")),i=$s(r,"smallest");return z1(i,t)},Y1=e=>{if(e.length<2)return e;const t=e.slice(1),r=t.filter(i=>i.trim().length>0).reduce((i,o)=>{const s=o.match(/^\s*/)?.[0].length??0;return Math.min(i,s)},Number.POSITIVE_INFINITY);return!Number.isFinite(r)||r<=0?e.map(i=>i.trimEnd()):[e[0].trimEnd(),...t.map(i=>i.replace(new RegExp(`^\\s{0,${r}}`),"").trimEnd())]},j1=e=>{const t=Array.isArray(e.label)?e.label.map(i=>re(i)):re(e.label||"").split(`
314
+ `);return Y1(t).join(`
315
+ `)},X1=e=>e.description?(Array.isArray(e.description)?e.description:[e.description]).map(r=>re(r)).filter(r=>r.length>0):[],U1=e=>{const t=new Set,r=o=>(o&&t.add(o),o),i=o=>{const s=o.find(a=>!t.has(a));return r(s||null)};return o=>{const s=[`[id='${o.domId}']`,`[id='${o.id}']`,`[data-id='${o.id}']`];for(const a of s){const n=e.querySelector(a);if(n)return r(n)}switch(o.shape){case"divider":return i(Array.from(e.querySelectorAll("g.statediagram-cluster-alt")));case"stateStart":return i(Array.from(e.querySelectorAll("g.node.default")).filter(a=>a.querySelector("circle.state-start")));case"stateEnd":return i(Array.from(e.querySelectorAll("g.node.default")).filter(a=>!a.querySelector("circle.state-start")));default:return null}}},G1=(e,t)=>{switch(t){case"roundedWithTitle":return e.querySelector("rect.outer")||e.querySelector("rect")||e;case"divider":return e.querySelector("rect.divider")||e.querySelector("rect")||e;case"rectWithTitle":return e.querySelector("rect.outer")||e.querySelector("rect")||e;case"stateStart":return $s(Array.from(e.querySelectorAll("circle, ellipse, path")),"largest")||e;case"stateEnd":return $s(Array.from(e.querySelectorAll("circle, ellipse, path")),"largest")||e;default:return e.querySelector("rect, path, circle, ellipse, polygon")||e}},V1=(e,t,r)=>{const i=r(e);if(!i)throw new Error(`State node element not found for "${e.id}"`);const o=G1(i,e.shape),s={},a={},n=[e.labelStyle,...e.cssCompiledStyles||[],...e.cssStyles||[]],h=D1(n);n.filter(Boolean).forEach(l=>{O1(l,s,a)}),P1(o,s,h),R1(i,a,h);const c=q1(o,t);return{id:e.id,shape:e.shape,text:j1(e),description:X1(e),x:c.x,y:c.y,width:c.width,height:c.height,parentId:e.parentId,position:e.position,containerStyle:s,labelStyle:a,dividerLine:e.shape==="rectWithTitle"?N1(i,t):void 0,endInnerColor:e.shape==="stateEnd"?H1(i,h):void 0,isRenderable:e.shape!=="noteGroup"}},K1=(e,t)=>{const r=t.querySelector(`[id='${e.id}']`);if(!r)return null;const{tx:i,ty:o}=ja(r,t),s=oh(r,{x:i,y:o},"MCL");if(s.reflectionPoints.length<2)return null;const a={},n=(c,l)=>{switch(c){case At.STROKE:or(l)&&(a.strokeColor=St(l));break;case At.STROKE_WIDTH:{const d=parseFloat(St(l));Number.isFinite(d)&&d>0&&(a.strokeWidth=d);break}case At.STROKE_DASHARRAY:St(l)&&(a.strokeStyle="dashed");break}};[e.style].filter(Boolean).forEach(c=>{le(c||"").forEach(({property:l,value:d})=>{n(l,d)})});const h=e.arrowhead==="none"||e.classes?.includes("note-edge");return{id:e.id,start:e.start,end:e.end,text:re(e.label||""),...s,strokeColor:a.strokeColor,strokeWidth:a.strokeWidth,strokeStyle:h?"dashed":a.strokeStyle,isNoteEdge:h}},Z1=(e,t)=>{const{nodes:r,edges:i}=e.getData(),o=U1(t);return{type:"state",nodes:r.map(s=>V1(s,t,o)),edges:i.map(s=>K1(s,t)).filter(s=>s!==null)}};let Pl=Promise.resolve();const Q1=e=>{const t=Pl.then(e,e);return Pl=t.then(()=>{},()=>{}),t};let Rl=null,J1=0;const t2=e=>JSON.stringify(e),ql=e=>{const t=e.querySelector("svg");if(!t)throw new Error("SVG element not found");const r=t.getBoundingClientRect(),i=r.width,o=r.height;t.setAttribute("width",`${i}`),t.setAttribute("height",`${o}`);const s="image/svg+xml",a=unescape(encodeURIComponent(t.outerHTML)),h=`data:image/svg+xml;base64,${btoa(a)}`;return{type:"graphImage",mimeType:s,dataURL:h,width:i,height:o}},e2=async(e,t=bi)=>Q1(async()=>{const r=t.themeVariables?.fontSize??bi.themeVariables.fontSize,i={...bi,...t,fontSize:r,themeVariables:{...bi.themeVariables,...t.themeVariables,fontSize:r}},o=t2(i);o!==Rl&&(ts.initialize(i),Rl=o);const s=await ts.mermaidAPI.getDiagramFromText($p(e)),a=`mermaid-to-excalidraw-${J1++}`,n=document.createElement("div");n.setAttribute("style","opacity: 0; position: fixed; z-index: -1; left: -99999px; top: -99999px;");const h=`${a}-container`;n.id=h,document.getElementById(h)?.remove(),document.body.appendChild(n);try{const{svg:c}=await ts.render(a,e,n);n.innerHTML=c;let l;try{switch(s.type){case"flowchart-v2":case"graph":{l=Kk(s.db,n);break}case"sequence":{l=a1(s,n);break}case"class":case"classDiagram":{l=k1(s,n);break}case"er":{l=I1(s.db,n);break}case"state":case"stateDiagram":{l=Z1(s.db,n);break}default:l=ql(n)}}catch(d){console.error("Error processing Mermaid diagram:",d),l=ql(n)}return l}finally{n.remove()}}),r2=async(e,t)=>{const r=t||{},i=parseInt(r.themeVariables?.fontSize??"")||di,o=await e2(e,{...r,themeVariables:{...r.themeVariables}});return qp(o,{fontSize:i})},R2=Object.freeze(Object.defineProperty({__proto__:null,parseMermaidToExcalidraw:r2},Symbol.toStringTag,{value:"Module"}));export{zd as $,Js as A,lh as B,mm as C,Kf as D,io as E,Xp as F,uy as G,g2 as H,nx as I,ax as J,ai as K,u2 as L,Lf as M,bh as N,Ja as O,uo as P,fm as Q,$f as R,Sh as S,d2 as T,qd as U,ya as V,Pn as W,p2 as X,jd as Y,nm as Z,g as _,Wf as a,Ca as a0,kC as a1,_h as a2,fi as a3,rm as a4,me as a5,em as a6,Zs as a7,rt as a8,st as a9,Th as aa,T2 as ab,S2 as ac,ix as ad,Lt as ae,Xd as af,ot as ag,k2 as ah,Qi as ai,Gd as aj,ho as ak,Gt as al,sC as am,R2 as an,Nf as b,Bt as c,kh as d,Ht as e,Ie as f,Hf as g,Dd as h,ae as i,pi as j,Ih as k,M as l,gi as m,am as n,Yf as o,jf as p,qf as q,f2 as r,zf as s,Np as t,P2 as u,D2 as v,xm as w,Vt as x,Dt as y,Uf as z};