@dooc-dev/dooc 0.0.6 → 0.0.8

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 (395) hide show
  1. package/dist/client.global.js +1 -0
  2. package/dist/code-worker.global.js +11 -11
  3. package/dist/code.global.js +75 -75
  4. package/dist/edit.global.js +234 -231
  5. package/dist/{compiler → engine/compiler}/bundle-urls.js +1 -4
  6. package/dist/{compiler → engine/compiler}/check-prose.d.ts +1 -1
  7. package/dist/{compiler → engine/compiler}/check-prose.js +1 -1
  8. package/dist/{compiler → engine/compiler}/check.js +15 -27
  9. package/dist/{compiler → engine/compiler}/code-blocks.js +3 -1
  10. package/dist/{compiler → engine/compiler}/code-languages.js +1 -2
  11. package/dist/{compiler → engine/compiler}/compile.d.ts +5 -4
  12. package/dist/{compiler → engine/compiler}/compile.js +91 -32
  13. package/dist/{compiler → engine/compiler}/config.js +1 -3
  14. package/dist/{compiler → engine/compiler}/dialect.d.ts +1 -3
  15. package/dist/{compiler → engine/compiler}/dialect.js +8 -52
  16. package/dist/{compiler → engine/compiler}/dxf.js +1 -1
  17. package/dist/{compiler → engine/compiler}/export.js +15 -8
  18. package/dist/{compiler → engine/compiler}/figures.js +26 -22
  19. package/dist/{compiler → engine/compiler}/file-cache.d.ts +1 -2
  20. package/dist/{compiler → engine/compiler}/file-cache.js +8 -15
  21. package/dist/{compiler → engine/compiler}/files.js +49 -38
  22. package/dist/{compiler → engine/compiler}/fonts.js +1 -3
  23. package/dist/{compiler → engine/compiler}/from-mdast.js +1 -1
  24. package/dist/engine/compiler/host.d.ts +10 -0
  25. package/dist/engine/compiler/host.js +16 -0
  26. package/dist/{compiler → engine/compiler}/icons.d.ts +3 -0
  27. package/dist/{compiler → engine/compiler}/icons.js +28 -10
  28. package/dist/{compiler → engine/compiler}/ignored-files.d.ts +2 -0
  29. package/dist/{compiler → engine/compiler}/ignored-files.js +12 -3
  30. package/dist/{compiler → engine/compiler}/locales.js +2 -8
  31. package/dist/{compiler → engine/compiler}/manifest.d.ts +3 -2
  32. package/dist/engine/compiler/manifest.js +46 -0
  33. package/dist/{compiler → engine/compiler}/ops.d.ts +4 -1
  34. package/dist/{compiler → engine/compiler}/ops.js +36 -21
  35. package/dist/engine/compiler/schema-file-references.d.ts +2 -0
  36. package/dist/engine/compiler/schema-file-references.js +82 -0
  37. package/dist/engine/compiler/serialize.d.ts +2 -0
  38. package/dist/engine/compiler/serialize.js +5 -0
  39. package/dist/{compiler → engine/compiler}/subformat-schema.js +1 -3
  40. package/dist/{compiler → engine/compiler}/subformats.d.ts +10 -0
  41. package/dist/{compiler → engine/compiler}/subformats.js +122 -18
  42. package/dist/{compiler → engine/compiler}/textfile-remote.js +1 -2
  43. package/dist/{compiler → engine/compiler}/textfile.js +4 -6
  44. package/dist/{compiler → engine/compiler}/theme-variants.js +1 -1
  45. package/dist/{compiler → engine/compiler}/zip.js +1 -1
  46. package/dist/{core → engine/core}/blocks.d.ts +6 -4
  47. package/dist/{core → engine/core}/content-metadata.d.ts +6 -1
  48. package/dist/{core → engine/core}/content-metadata.js +84 -18
  49. package/dist/{core → engine/core}/content-types.d.ts +4 -2
  50. package/dist/{core → engine/core}/html.d.ts +7 -0
  51. package/dist/{core → engine/core}/html.js +44 -3
  52. package/dist/{core → engine/core}/icons.d.ts +3 -0
  53. package/dist/engine/core/icons.js +20 -0
  54. package/dist/{core → engine/core}/routing.d.ts +2 -0
  55. package/dist/{core → engine/core}/routing.js +9 -0
  56. package/dist/{core → engine/core}/schema-refs.d.ts +1 -1
  57. package/dist/{core → engine/core}/schema-refs.js +3 -1
  58. package/dist/engine/core/subformat-references.d.ts +5 -0
  59. package/dist/engine/core/subformat-references.js +33 -0
  60. package/dist/{core → engine/core}/subformats.d.ts +7 -0
  61. package/dist/{core → engine/core}/subformats.js +5 -1
  62. package/dist/{core → engine/core}/taxonomy.d.ts +2 -3
  63. package/dist/{core → engine/core}/taxonomy.js +1 -5
  64. package/dist/flow.global.js +1031 -1057
  65. package/dist/frontend/application-request.d.ts +14 -0
  66. package/dist/frontend/application-request.js +36 -0
  67. package/dist/frontend/document-application.d.ts +200 -0
  68. package/dist/{viewer/serve.js → frontend/document-application.js} +1611 -1670
  69. package/dist/frontend/figure-preview.d.ts +4 -0
  70. package/dist/{viewer → frontend}/figure-preview.js +4 -4
  71. package/dist/{viewer → frontend}/file-references.d.ts +1 -1
  72. package/dist/{viewer → frontend}/file-references.js +3 -3
  73. package/dist/{viewer → frontend}/font-picker.d.ts +1 -1
  74. package/dist/{viewer → frontend}/font-settings.d.ts +1 -1
  75. package/dist/{viewer → frontend}/language-picker.js +112 -18
  76. package/dist/{viewer → frontend}/locales/eng.json +16 -2
  77. package/dist/{viewer → frontend}/locales/jpn.json +16 -2
  78. package/dist/{viewer → frontend}/locales/zho.json +16 -2
  79. package/dist/{viewer → frontend}/nav-focus.js +2 -0
  80. package/dist/{viewer → frontend}/plugin-blocks.js +2 -2
  81. package/dist/{viewer → frontend}/resize.js +14 -2
  82. package/dist/frontend/resource-download.d.ts +2 -0
  83. package/dist/frontend/resource-download.js +43 -0
  84. package/dist/{viewer → frontend}/resource-library.d.ts +9 -2
  85. package/dist/{viewer → frontend}/resource-library.js +133 -37
  86. package/dist/{core → frontend}/schema-graph-flow.d.ts +1 -1
  87. package/dist/{core → frontend}/schema-graph-flow.js +1 -1
  88. package/dist/{viewer → frontend}/search.d.ts +2 -2
  89. package/dist/{viewer → frontend}/search.js +26 -8
  90. package/dist/graph/{abnfDiagram-S7VZAUFO-ASBULSKE.js → abnfDiagram-S7VZAUFO-GAGCW2J5.js} +1 -1
  91. package/dist/graph/{architecture-WOLXFQ4H-V57EDXXY.js → architecture-WOLXFQ4H-AWAC3VBS.js} +1 -1
  92. package/dist/graph/{architectureDiagram-YGSQEFNW-GIMP347N.js → architectureDiagram-YGSQEFNW-WQ7QKSUJ.js} +1 -1
  93. package/dist/graph/{blockDiagram-APKKGZFW-RDL2T4JW.js → blockDiagram-APKKGZFW-H7ZNJMOM.js} +1 -1
  94. package/dist/graph/{bpmnIcons-APHXDYXF-TWOSQNUQ.js → bpmnIcons-APHXDYXF-EAVPNTFE.js} +1 -1
  95. package/dist/graph/{c4Diagram-KJ2TOQU5-75LIUC4F.js → c4Diagram-KJ2TOQU5-3IYS34YL.js} +1 -1
  96. package/dist/graph/{chunk-KU6GTEMS.js → chunk-3CJU2RDX.js} +1 -1
  97. package/dist/graph/{chunk-ISO77HML.js → chunk-5N2X2DXU.js} +1 -1
  98. package/dist/graph/{chunk-YCRLJT2S.js → chunk-67BPVAXC.js} +1 -1
  99. package/dist/graph/{chunk-26TUJSYJ.js → chunk-6CDZONCA.js} +1 -1
  100. package/dist/graph/{chunk-I3DMZIHV.js → chunk-7ASYMKN2.js} +1 -1
  101. package/dist/graph/{chunk-K2KLZU7M.js → chunk-7JQUFVT4.js} +2 -2
  102. package/dist/graph/{chunk-BBD5CEDC.js → chunk-7LSMJ4VU.js} +1 -1
  103. package/dist/graph/{chunk-EG5UVNOC.js → chunk-7UKJADAE.js} +1 -1
  104. package/dist/graph/{chunk-BZAMCJ6B.js → chunk-AARGNXTW.js} +1 -1
  105. package/dist/graph/{chunk-HOPPTA6H.js → chunk-BOXAA5AP.js} +2 -2
  106. package/dist/graph/{chunk-N3OHKGRZ.js → chunk-BTMPKSGF.js} +1 -1
  107. package/dist/graph/{chunk-QCJUF4YA.js → chunk-DIDARDST.js} +1 -1
  108. package/dist/graph/{chunk-R63JUMUK.js → chunk-EWYECPNJ.js} +1 -1
  109. package/dist/graph/{chunk-3YJHMOOA.js → chunk-FD7ZFC7R.js} +1 -1
  110. package/dist/graph/chunk-GWYODWCE.js +1 -0
  111. package/dist/graph/{chunk-IC23EEF6.js → chunk-HKRJKXEE.js} +1 -1
  112. package/dist/graph/{chunk-PW2RGZ3O.js → chunk-I5LEUF24.js} +1 -1
  113. package/dist/graph/{chunk-OFZLK5G4.js → chunk-ICJPOOXG.js} +1 -1
  114. package/dist/graph/{chunk-KT4VPQD5.js → chunk-IVZHB6RS.js} +2 -2
  115. package/dist/graph/{chunk-VM2H7G2R.js → chunk-JZGXHT3J.js} +1 -1
  116. package/dist/graph/{chunk-HJG2HUYJ.js → chunk-LSRL537V.js} +1 -1
  117. package/dist/graph/{chunk-C6J4A356.js → chunk-N44XPVUD.js} +1 -1
  118. package/dist/graph/{chunk-JD7ZBJD2.js → chunk-NDAMZVXQ.js} +1 -1
  119. package/dist/graph/{chunk-QEEA3KYY.js → chunk-QLS7NIYR.js} +1 -1
  120. package/dist/graph/{chunk-JRSH5GNS.js → chunk-QQIGL7OP.js} +1 -1
  121. package/dist/graph/chunk-SQE76S5B.js +1 -0
  122. package/dist/graph/{chunk-ZMCB7VP2.js → chunk-WQHTQAFY.js} +1 -1
  123. package/dist/graph/{classDiagram-v2-L25IHNXF-JL7LVDZH.js → classDiagram-v2-L25IHNXF-HNTCDTNK.js} +1 -1
  124. package/dist/graph/{cose-bilkent-JH36ORCC-PNM3EYPB.js → cose-bilkent-JH36ORCC-2GVA7XKO.js} +1 -1
  125. package/dist/graph/{cynefin-EF2NZ3EQ-PSXP3DXL.js → cynefin-EF2NZ3EQ-TCI65RAQ.js} +1 -1
  126. package/dist/graph/{cynefinDiagram-L36ESFBY-QVY54CXO.js → cynefinDiagram-L36ESFBY-OKQ5BLVF.js} +1 -1
  127. package/dist/graph/{dagre-SPEB5RXH-HPGQXBZJ.js → dagre-SPEB5RXH-KZEBD52K.js} +1 -1
  128. package/dist/graph/{diagram-3B7GL73J-DWH5WS2P.js → diagram-3B7GL73J-ESCBJM3O.js} +1 -1
  129. package/dist/graph/{diagram-DNEMPZML-TEGH2U5I.js → diagram-DNEMPZML-ZIBUSQZI.js} +1 -1
  130. package/dist/graph/{diagram-L3MUGCDN-X4MREUWR.js → diagram-L3MUGCDN-IGK62IPN.js} +1 -1
  131. package/dist/graph/{diagram-LA4NIPWU-NXT746HG.js → diagram-LA4NIPWU-2KZCOFJ5.js} +1 -1
  132. package/dist/graph/{diagram-MHCOC4E2-JGHXSAGS.js → diagram-MHCOC4E2-EYAAB236.js} +1 -1
  133. package/dist/graph/{diagram-XPFHEONP-ZHZPBLT4.js → diagram-XPFHEONP-OZ5ARGMG.js} +1 -1
  134. package/dist/graph/{ebnfDiagram-UZSYDL2S-SMF6KJ43.js → ebnfDiagram-UZSYDL2S-M3XJHARD.js} +1 -1
  135. package/dist/graph/{erDiagram-EYBAPDEH-B3JNJ357.js → erDiagram-EYBAPDEH-Y7KUBH7A.js} +1 -1
  136. package/dist/graph/{eventmodeling-K75KTNOO-WG6DDYMC.js → eventmodeling-K75KTNOO-ROLYRDEP.js} +1 -1
  137. package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
  138. package/dist/graph/{ganttDiagram-23REXITY-YXBYWFOJ.js → ganttDiagram-23REXITY-JSBTFSSJ.js} +1 -1
  139. package/dist/graph/{gitGraph-VSP46ZUC-VBFWJBBT.js → gitGraph-VSP46ZUC-ZCBCDVNF.js} +1 -1
  140. package/dist/graph/{gitGraphDiagram-STJD7YCW-4FZDCFGV.js → gitGraphDiagram-STJD7YCW-3ZA5FT3G.js} +1 -1
  141. package/dist/graph/{info-OHQRW6UA-ALVDUVYV.js → info-OHQRW6UA-JKJGOQNY.js} +1 -1
  142. package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
  143. package/dist/graph/{ishikawaDiagram-M35NCXHK-FRZD2PWQ.js → ishikawaDiagram-M35NCXHK-YLEU44DY.js} +1 -1
  144. package/dist/graph/{journeyDiagram-OPLOXDXO-7Z66JCPR.js → journeyDiagram-OPLOXDXO-ZHJV66ZT.js} +1 -1
  145. package/dist/graph/{kanban-definition-BZKZHSQY-NN5AIKTE.js → kanban-definition-BZKZHSQY-SDU25WUM.js} +1 -1
  146. package/dist/graph/{katex-DXDNVO6V.js → katex-WSLZOTY7.js} +1 -1
  147. package/dist/graph/{mindmap-definition-I2QAS2VK-HDPCABN2.js → mindmap-definition-I2QAS2VK-XQNBCYHN.js} +1 -1
  148. package/dist/graph/{packet-JDAUHWVQ-5MQIBWAH.js → packet-JDAUHWVQ-Y3H77ERD.js} +1 -1
  149. package/dist/graph/{pegDiagram-FD4XPPHP-H2BFNCKT.js → pegDiagram-FD4XPPHP-YO4VWH6V.js} +1 -1
  150. package/dist/graph/{pie-XZMESJXO-T5VRKHVT.js → pie-XZMESJXO-PRER4XL5.js} +1 -1
  151. package/dist/graph/{pieDiagram-J4AKIIQI-O3NJSVD3.js → pieDiagram-J4AKIIQI-TJ5WOOSV.js} +1 -1
  152. package/dist/graph/{quadrantDiagram-XTYBLID2-TMTZJI3P.js → quadrantDiagram-XTYBLID2-G6MSSZLW.js} +1 -1
  153. package/dist/graph/{radar-ABXABTNO-C6FXIBYW.js → radar-ABXABTNO-M6MV34GM.js} +1 -1
  154. package/dist/graph/{railroad-I3PHUGI6-ZSO5JXB3.js → railroad-I3PHUGI6-YIWPGN6Q.js} +1 -1
  155. package/dist/graph/{railroad-abnf-LNEFI6M7-CI4GQRHB.js → railroad-abnf-LNEFI6M7-7JHLZ2R7.js} +1 -1
  156. package/dist/graph/{railroad-ebnf-DWYD2UWJ-MUENNCGK.js → railroad-ebnf-DWYD2UWJ-V55BXEWY.js} +1 -1
  157. package/dist/graph/{railroad-peg-JR7BVNR7-N3X5GGIX.js → railroad-peg-JR7BVNR7-XCGKDRMK.js} +1 -1
  158. package/dist/graph/{railroadDiagram-MRQ6NCDL-JHWS23UO.js → railroadDiagram-MRQ6NCDL-RACSFXC4.js} +1 -1
  159. package/dist/graph/{requirementDiagram-Y7LWUY3S-7DVLPO4B.js → requirementDiagram-Y7LWUY3S-4LQIQWHQ.js} +1 -1
  160. package/dist/graph/{sankeyDiagram-WGJFYUXA-Z5L4R5TR.js → sankeyDiagram-WGJFYUXA-K3RXG5FB.js} +1 -1
  161. package/dist/graph/schema-graph-global.js +17 -17
  162. package/dist/graph/{sequenceDiagram-5NDRBG5M-RCTU25NT.js → sequenceDiagram-5NDRBG5M-Y6RBHRS3.js} +1 -1
  163. package/dist/graph/{sizeCapture-INFHLROL-RROY32P5.js → sizeCapture-INFHLROL-TJW3VUGH.js} +1 -1
  164. package/dist/graph/{stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js → stateDiagram-v2-FJ4FJNEA-4M5WZORG.js} +1 -1
  165. package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
  166. package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
  167. package/dist/graph/{timeline-definition-SEUHKTQE-ZQSMIVAS.js → timeline-definition-SEUHKTQE-IHISQ4Q7.js} +1 -1
  168. package/dist/graph/{treeView-D4JQ5SDB-42S7U73N.js → treeView-D4JQ5SDB-EVGY4VYS.js} +1 -1
  169. package/dist/graph/{treemap-SAJKECNS-RUBYQ7XF.js → treemap-SAJKECNS-LN3SMFRX.js} +1 -1
  170. package/dist/graph/{usecaseDiagram-AFA6YXN4-57RDRYXF.js → usecaseDiagram-AFA6YXN4-B645A3J6.js} +1 -1
  171. package/dist/graph/{vennDiagram-NNMJR3RB-5C3LVAV6.js → vennDiagram-NNMJR3RB-K3HWMON6.js} +1 -1
  172. package/dist/graph/{wardley-7MLQ67FV-NV5HXTTC.js → wardley-7MLQ67FV-RRWOELC6.js} +1 -1
  173. package/dist/graph/{wardleyDiagram-S7YFUSEH-6D5BKXHM.js → wardleyDiagram-S7YFUSEH-DMMWKJEK.js} +1 -1
  174. package/dist/graph/{xychartDiagram-GGNKY7IX-6ET3ZM67.js → xychartDiagram-GGNKY7IX-K6MUQVXR.js} +1 -1
  175. package/dist/install.sh +68 -0
  176. package/dist/plugins.global.js +62 -62
  177. package/dist/{viewer → server}/assets.d.ts +2 -0
  178. package/dist/server/assets.js +7 -0
  179. package/dist/{viewer → server}/build-plugins.js +4 -4
  180. package/dist/{viewer → server}/build.d.ts +2 -1
  181. package/dist/{viewer → server}/build.js +31 -15
  182. package/dist/{cli.js → server/cli.js} +223 -56
  183. package/dist/server/editor-tools.d.ts +1 -0
  184. package/dist/server/editor-tools.js +1 -0
  185. package/dist/{viewer → server}/extension-pack.js +2 -2
  186. package/dist/{viewer → server}/extensions.d.ts +1 -1
  187. package/dist/{viewer → server}/extensions.js +3 -3
  188. package/dist/server/git-diff.d.ts +10 -0
  189. package/dist/{viewer → server}/git-diff.js +45 -10
  190. package/dist/server/git-origin.d.ts +4 -0
  191. package/dist/server/git-origin.js +103 -0
  192. package/dist/server/git.d.ts +9 -0
  193. package/dist/{viewer → server}/git.js +50 -6
  194. package/dist/server/history.d.ts +14 -0
  195. package/dist/server/history.js +205 -0
  196. package/dist/{viewer → server}/hmr.d.ts +0 -22
  197. package/dist/server/hmr.js +168 -0
  198. package/dist/server/index.d.ts +17 -0
  199. package/dist/{index.js → server/index.js} +16 -16
  200. package/dist/{viewer → server}/ja-lint.d.ts +1 -1
  201. package/dist/{viewer → server}/languages.d.ts +1 -1
  202. package/dist/{viewer → server}/languages.js +3 -3
  203. package/dist/{mcp.d.ts → server/mcp.d.ts} +2 -2
  204. package/dist/{mcp.js → server/mcp.js} +60 -21
  205. package/dist/{viewer → server}/plugin-config.d.ts +2 -2
  206. package/dist/{viewer → server}/plugin-config.js +2 -2
  207. package/dist/{plugins → server/plugins}/local-storage.d.ts +1 -1
  208. package/dist/{plugins → server/plugins}/local-storage.js +1 -1
  209. package/dist/{plugins → server/plugins}/runtime.d.ts +4 -4
  210. package/dist/{plugins → server/plugins}/runtime.js +4 -4
  211. package/dist/{viewer → server}/plugins.d.ts +3 -3
  212. package/dist/{viewer → server}/plugins.js +14 -13
  213. package/dist/server/resource-library.d.ts +1 -0
  214. package/dist/server/resource-library.js +1 -0
  215. package/dist/server/self.d.ts +5 -0
  216. package/dist/server/self.js +98 -0
  217. package/dist/server/serve.d.ts +61 -0
  218. package/dist/server/serve.js +503 -0
  219. package/dist/server/static-client.d.ts +4 -0
  220. package/dist/server/static-client.js +117 -0
  221. package/dist/server/workspace-server.d.ts +16 -0
  222. package/dist/server/workspace-server.js +266 -0
  223. package/dist/{viewer → server}/workspace.d.ts +6 -1
  224. package/dist/{viewer → server}/workspace.js +46 -0
  225. package/dist/subformats.global.js +92 -6
  226. package/dist/ui.global.js +85 -72
  227. package/dist/workspace/client.d.ts +13 -0
  228. package/dist/workspace/client.js +114 -0
  229. package/dist/{viewer → workspace}/code-file.d.ts +1 -1
  230. package/dist/{viewer → workspace}/code-file.js +7 -7
  231. package/dist/workspace/connection.d.ts +27 -0
  232. package/dist/workspace/connection.js +38 -0
  233. package/dist/{viewer → workspace}/editor-tools.d.ts +7 -1
  234. package/dist/{viewer → workspace}/editor-tools.js +12 -9
  235. package/dist/{viewer → workspace}/git-types.d.ts +7 -0
  236. package/dist/workspace/github.d.ts +4 -0
  237. package/dist/workspace/github.js +99 -0
  238. package/dist/workspace/history.d.ts +46 -0
  239. package/dist/workspace/history.js +86 -0
  240. package/dist/workspace/protocol.d.ts +38 -0
  241. package/dist/workspace/protocol.js +20 -0
  242. package/dist/workspace/resource-download.d.ts +1 -0
  243. package/dist/workspace/resource-download.js +8 -0
  244. package/dist/workspace/server.d.ts +9 -0
  245. package/dist/workspace/server.js +48 -0
  246. package/dist/{viewer → workspace}/site-icon.js +9 -10
  247. package/dist/{viewer → workspace}/site-title.js +6 -7
  248. package/dist/{viewer → workspace}/textfile.d.ts +1 -1
  249. package/dist/{viewer → workspace}/textfile.js +5 -5
  250. package/dist/workspace-worker.global.js +2859 -0
  251. package/package.json +43 -21
  252. package/dist/compiler/manifest.js +0 -37
  253. package/dist/compiler/serialize.d.ts +0 -3
  254. package/dist/compiler/serialize.js +0 -16
  255. package/dist/core/icons.js +0 -5
  256. package/dist/graph/chunk-3RNHDNP5.js +0 -1
  257. package/dist/graph/chunk-5UUEAHTN.js +0 -1
  258. package/dist/graph/chunk-6T55RVVR.js +0 -1
  259. package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +0 -27
  260. package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +0 -1
  261. package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +0 -2
  262. package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +0 -1
  263. package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +0 -8
  264. package/dist/index.d.ts +0 -17
  265. package/dist/viewer/assets.js +0 -3
  266. package/dist/viewer/figure-preview.d.ts +0 -4
  267. package/dist/viewer/git-diff.d.ts +0 -6
  268. package/dist/viewer/git.d.ts +0 -5
  269. package/dist/viewer/hmr.js +0 -341
  270. package/dist/viewer/serve.d.ts +0 -216
  271. /package/dist/{compiler → engine/compiler}/asset-references.d.ts +0 -0
  272. /package/dist/{compiler → engine/compiler}/asset-references.js +0 -0
  273. /package/dist/{compiler → engine/compiler}/bundle-urls.d.ts +0 -0
  274. /package/dist/{compiler → engine/compiler}/check-types.d.ts +0 -0
  275. /package/dist/{compiler → engine/compiler}/check-types.js +0 -0
  276. /package/dist/{compiler → engine/compiler}/check.d.ts +0 -0
  277. /package/dist/{compiler → engine/compiler}/code-blocks.d.ts +0 -0
  278. /package/dist/{compiler → engine/compiler}/code-languages.d.ts +0 -0
  279. /package/dist/{compiler → engine/compiler}/config.d.ts +0 -0
  280. /package/dist/{compiler → engine/compiler}/drawio.d.ts +0 -0
  281. /package/dist/{compiler → engine/compiler}/drawio.js +0 -0
  282. /package/dist/{compiler → engine/compiler}/dxf.d.ts +0 -0
  283. /package/dist/{compiler → engine/compiler}/export.d.ts +0 -0
  284. /package/dist/{compiler → engine/compiler}/figures.d.ts +0 -0
  285. /package/dist/{compiler → engine/compiler}/files.d.ts +0 -0
  286. /package/dist/{compiler → engine/compiler}/fonts.d.ts +0 -0
  287. /package/dist/{compiler → engine/compiler}/format.d.ts +0 -0
  288. /package/dist/{compiler → engine/compiler}/format.js +0 -0
  289. /package/dist/{compiler → engine/compiler}/from-mdast.d.ts +0 -0
  290. /package/dist/{compiler → engine/compiler}/language-codes.d.ts +0 -0
  291. /package/dist/{compiler → engine/compiler}/language-codes.js +0 -0
  292. /package/dist/{compiler → engine/compiler}/locales.d.ts +0 -0
  293. /package/dist/{compiler → engine/compiler}/public-file.d.ts +0 -0
  294. /package/dist/{compiler → engine/compiler}/public-file.js +0 -0
  295. /package/dist/{compiler → engine/compiler}/subformat-schema.d.ts +0 -0
  296. /package/dist/{compiler → engine/compiler}/terms.d.ts +0 -0
  297. /package/dist/{compiler → engine/compiler}/terms.js +0 -0
  298. /package/dist/{compiler → engine/compiler}/textfile-remote.d.ts +0 -0
  299. /package/dist/{compiler → engine/compiler}/textfile.d.ts +0 -0
  300. /package/dist/{compiler → engine/compiler}/theme-variants.d.ts +0 -0
  301. /package/dist/{compiler → engine/compiler}/zip.d.ts +0 -0
  302. /package/dist/{core → engine/core}/blocks.js +0 -0
  303. /package/dist/{core → engine/core}/code-file.d.ts +0 -0
  304. /package/dist/{core → engine/core}/code-file.js +0 -0
  305. /package/dist/{core → engine/core}/code-grammars.d.ts +0 -0
  306. /package/dist/{core → engine/core}/code-grammars.js +0 -0
  307. /package/dist/{core → engine/core}/content-types.js +0 -0
  308. /package/dist/{core → engine/core}/escape-html.d.ts +0 -0
  309. /package/dist/{core → engine/core}/escape-html.js +0 -0
  310. /package/dist/{core → engine/core}/extension-package.d.ts +0 -0
  311. /package/dist/{core → engine/core}/extension-package.js +0 -0
  312. /package/dist/{core → engine/core}/figure-frame.d.ts +0 -0
  313. /package/dist/{core → engine/core}/figure-frame.js +0 -0
  314. /package/dist/{core → engine/core}/file-embed.d.ts +0 -0
  315. /package/dist/{core → engine/core}/file-embed.js +0 -0
  316. /package/dist/{core → engine/core}/files.d.ts +0 -0
  317. /package/dist/{core → engine/core}/files.js +0 -0
  318. /package/dist/{core → engine/core}/graph-common.d.ts +0 -0
  319. /package/dist/{core → engine/core}/graph-common.js +0 -0
  320. /package/dist/{core → engine/core}/graph.d.ts +0 -0
  321. /package/dist/{core → engine/core}/graph.js +0 -0
  322. /package/dist/{core → engine/core}/inline.d.ts +0 -0
  323. /package/dist/{core → engine/core}/inline.js +0 -0
  324. /package/dist/{core → engine/core}/json-tools.d.ts +0 -0
  325. /package/dist/{core → engine/core}/json-tools.js +0 -0
  326. /package/dist/{core → engine/core}/language.d.ts +0 -0
  327. /package/dist/{core → engine/core}/language.js +0 -0
  328. /package/dist/{core → engine/core}/languages/ja.d.ts +0 -0
  329. /package/dist/{core → engine/core}/languages/ja.js +0 -0
  330. /package/dist/{core → engine/core}/markdown.d.ts +0 -0
  331. /package/dist/{core → engine/core}/markdown.js +0 -0
  332. /package/dist/{core → engine/core}/previewers.d.ts +0 -0
  333. /package/dist/{core → engine/core}/previewers.js +0 -0
  334. /package/dist/{core → engine/core}/schema-comments.d.ts +0 -0
  335. /package/dist/{core → engine/core}/schema-comments.js +0 -0
  336. /package/dist/{core → engine/core}/schema-fields.d.ts +0 -0
  337. /package/dist/{core → engine/core}/schema-fields.js +0 -0
  338. /package/dist/{core → engine/core}/schema-graph.d.ts +0 -0
  339. /package/dist/{core → engine/core}/schema-graph.js +0 -0
  340. /package/dist/{core → engine/core}/subformat-record.d.ts +0 -0
  341. /package/dist/{core → engine/core}/subformat-record.js +0 -0
  342. /package/dist/{core → engine/core}/term-reference.d.ts +0 -0
  343. /package/dist/{core → engine/core}/term-reference.js +0 -0
  344. /package/dist/{core → engine/core}/textfile.d.ts +0 -0
  345. /package/dist/{core → engine/core}/textfile.js +0 -0
  346. /package/dist/{core → engine/core}/theme-variants.d.ts +0 -0
  347. /package/dist/{core → engine/core}/theme-variants.js +0 -0
  348. /package/dist/{core → engine/core}/workspace.d.ts +0 -0
  349. /package/dist/{core → engine/core}/workspace.js +0 -0
  350. /package/dist/{viewer → frontend}/bundle-network.d.ts +0 -0
  351. /package/dist/{viewer → frontend}/bundle-network.js +0 -0
  352. /package/dist/{core → frontend}/flow-base-css.generated.d.ts +0 -0
  353. /package/dist/{core → frontend}/flow-base-css.generated.js +0 -0
  354. /package/dist/{core → frontend}/flow-css.d.ts +0 -0
  355. /package/dist/{core → frontend}/flow-css.js +0 -0
  356. /package/dist/{viewer → frontend}/font-picker.js +0 -0
  357. /package/dist/{viewer → frontend}/font-settings.js +0 -0
  358. /package/dist/{viewer → frontend}/i18n.d.ts +0 -0
  359. /package/dist/{viewer → frontend}/i18n.js +0 -0
  360. /package/dist/{viewer → frontend}/language-picker.d.ts +0 -0
  361. /package/dist/{viewer → frontend}/lazy-preview.d.ts +0 -0
  362. /package/dist/{viewer → frontend}/lazy-preview.js +0 -0
  363. /package/dist/{viewer → frontend}/nav-focus.d.ts +0 -0
  364. /package/dist/{viewer → frontend}/nav-update.d.ts +0 -0
  365. /package/dist/{viewer → frontend}/nav-update.js +0 -0
  366. /package/dist/{viewer → frontend}/plugin-blocks.d.ts +0 -0
  367. /package/dist/{viewer → frontend}/plugin-style.d.ts +0 -0
  368. /package/dist/{viewer → frontend}/plugin-style.js +0 -0
  369. /package/dist/{viewer → frontend}/plugin-view.d.ts +0 -0
  370. /package/dist/{viewer → frontend}/plugin-view.js +0 -0
  371. /package/dist/{viewer → frontend}/resize.d.ts +0 -0
  372. /package/dist/{core → frontend}/schema-graph-mount.d.ts +0 -0
  373. /package/dist/{core → frontend}/schema-graph-mount.js +0 -0
  374. /package/dist/{core → frontend}/table-ui.d.ts +0 -0
  375. /package/dist/{core → frontend}/table-ui.js +0 -0
  376. /package/dist/{core → frontend}/terms-ui.d.ts +0 -0
  377. /package/dist/{core → frontend}/terms-ui.js +0 -0
  378. /package/dist/{viewer → frontend}/theme-picker.d.ts +0 -0
  379. /package/dist/{viewer → frontend}/theme-picker.js +0 -0
  380. /package/dist/{core → frontend}/toc-ui.d.ts +0 -0
  381. /package/dist/{core → frontend}/toc-ui.js +0 -0
  382. /package/dist/{core → frontend}/video-ui.d.ts +0 -0
  383. /package/dist/{core → frontend}/video-ui.js +0 -0
  384. /package/dist/graph/{chunk-GYT4IYBZ.js → chunk-RJFVWYCA.js} +0 -0
  385. /package/dist/{viewer → server}/build-plugins.d.ts +0 -0
  386. /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
  387. /package/dist/{viewer → server}/extension-pack.d.ts +0 -0
  388. /package/dist/{viewer → server}/fonts/LICENSE.txt +0 -0
  389. /package/dist/{viewer → server}/fonts/udev-gothic-regular.woff2 +0 -0
  390. /package/dist/{viewer → server}/fonts.d.ts +0 -0
  391. /package/dist/{viewer → server}/fonts.js +0 -0
  392. /package/dist/{viewer → server}/ja-lint.js +0 -0
  393. /package/dist/{viewer → workspace}/git-types.js +0 -0
  394. /package/dist/{viewer → workspace}/site-icon.d.ts +0 -0
  395. /package/dist/{viewer → workspace}/site-title.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import{a as r}from"./chunk-GYT4IYBZ.js";function $n(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}r($n,"getDefaultExportFromCjs");var P={},Pe={},le={},_n;function Ae(){if(_n)return le;_n=1;function w(d){return typeof d>"u"||d===null}r(w,"isNothing");function x(d){return typeof d=="object"&&d!==null}r(x,"isObject");function _(d){return Array.isArray(d)?d:w(d)?[]:[d]}r(_,"toArray");function k(d,s){if(s){let C=Object.keys(s);for(let t=0,f=C.length;t<f;t+=1){let T=C[t];d[T]=s[T]}}return d}r(k,"extend");function h(d,s){let C="";for(let t=0;t<s;t+=1)C+=d;return C}r(h,"repeat");function A(d){return d===0&&Number.NEGATIVE_INFINITY===1/d}return r(A,"isNegativeZero"),le.isNothing=w,le.isObject=x,le.toArray=_,le.repeat=h,le.isNegativeZero=A,le.extend=k,le}r(Ae,"requireCommon");var Be,In;function ye(){if(In)return Be;In=1;function w(_,k){let h="",A=_.reason||"(unknown reason)";return _.mark?(_.mark.name&&(h+='in "'+_.mark.name+'" '),h+="("+(_.mark.line+1)+":"+(_.mark.column+1)+")",!k&&_.mark.snippet&&(h+=`
1
+ import{a as r}from"./chunk-RJFVWYCA.js";function $n(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}r($n,"getDefaultExportFromCjs");var P={},Pe={},le={},_n;function Ae(){if(_n)return le;_n=1;function w(d){return typeof d>"u"||d===null}r(w,"isNothing");function x(d){return typeof d=="object"&&d!==null}r(x,"isObject");function _(d){return Array.isArray(d)?d:w(d)?[]:[d]}r(_,"toArray");function k(d,s){if(s){let C=Object.keys(s);for(let t=0,f=C.length;t<f;t+=1){let T=C[t];d[T]=s[T]}}return d}r(k,"extend");function h(d,s){let C="";for(let t=0;t<s;t+=1)C+=d;return C}r(h,"repeat");function A(d){return d===0&&Number.NEGATIVE_INFINITY===1/d}return r(A,"isNegativeZero"),le.isNothing=w,le.isObject=x,le.toArray=_,le.repeat=h,le.isNegativeZero=A,le.extend=k,le}r(Ae,"requireCommon");var Be,In;function ye(){if(In)return Be;In=1;function w(_,k){let h="",A=_.reason||"(unknown reason)";return _.mark?(_.mark.name&&(h+='in "'+_.mark.name+'" '),h+="("+(_.mark.line+1)+":"+(_.mark.column+1)+")",!k&&_.mark.snippet&&(h+=`
2
2
 
3
3
  `+_.mark.snippet),A+" "+h):A}r(w,"formatError");function x(_,k){Error.call(this),this.name="YAMLException",this.reason=_,this.mark=k,this.message=w(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return r(x,"YAMLException2"),x.prototype=Object.create(Error.prototype),x.prototype.constructor=x,x.prototype.toString=r(function(k){return this.name+": "+w(this,k)},"toString"),Be=x,Be}r(ye,"requireException");var He,kn;function Zn(){if(kn)return He;kn=1;let w=Ae();function x(h,A,d,s,C){let t="",f="",T=Math.floor(C/2)-1;return s-A>T&&(t=" ... ",A=s-T+t.length),d-s>T&&(f=" ...",d=s+T-f.length),{str:t+h.slice(A,d).replace(/\t/g,"\u2192")+f,pos:s-A+t.length}}r(x,"getLine");function _(h,A){return w.repeat(" ",A-h.length)+h}r(_,"padStart");function k(h,A){if(A=Object.create(A||null),!h.buffer)return null;A.maxLength||(A.maxLength=79),typeof A.indent!="number"&&(A.indent=1),typeof A.linesBefore!="number"&&(A.linesBefore=3),typeof A.linesAfter!="number"&&(A.linesAfter=2);let d=/\r?\n|\r|\0/g,s=[0],C=[],t,f=-1;for(;t=d.exec(h.buffer);)C.push(t.index),s.push(t.index+t[0].length),h.position<=t.index&&f<0&&(f=s.length-2);f<0&&(f=s.length-1);let T="",O=Math.min(h.line+A.linesAfter,C.length).toString().length,N=A.maxLength-(A.indent+O+3);for(let q=1;q<=A.linesBefore&&!(f-q<0);q++){let U=x(h.buffer,s[f-q],C[f-q],h.position-(s[f]-s[f-q]),N);T=w.repeat(" ",A.indent)+_((h.line-q+1).toString(),O)+" | "+U.str+`
4
4
  `+T}let $=x(h.buffer,s[f],C[f],h.position,N);T+=w.repeat(" ",A.indent)+_((h.line+1).toString(),O)+" | "+$.str+`
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-4QDE4SUK.js";import{a as wa,b as Dt,d as H,e as R}from"./chunk-QCJUF4YA.js";import{c as Tt,e as ut}from"./chunk-BBD5CEDC.js";import{b as Sa,c as $a,d as va,e as St}from"./chunk-ISO77HML.js";import{g as $t}from"./chunk-KU6GTEMS.js";import{k as Wt,o as ka,s as Bt,u as Q}from"./chunk-QEEA3KYY.js";import{$ as V,C as Pt,G as wt,I as Ft,K as Kt,L as xa,ca as Qt,r as ba,v as xt}from"./chunk-KT4VPQD5.js";import{b as J,d as Z}from"./chunk-JRSH5GNS.js";import{a as w}from"./chunk-GYT4IYBZ.js";var Gs=1,js=3;async function ga(n){let t=n.getElementsByTagName("img");if(!t||t.length===0)return;let s=!ya(n);await Promise.all([...t].map(l=>new Promise(o=>{function c(){if(l.style.display="flex",l.style.flexDirection="column",s){let p=V().fontSize?V().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[h=ba.fontSize]=ka(p),i=h*r+"px";l.style.minWidth=i,l.style.maxWidth=i}else l.style.width="100%";o(l)}w(c,"setupImage"),setTimeout(()=>{l.complete&&c()}),l.addEventListener("error",c),l.addEventListener("load",c)})))}w(ga,"configureLabelImages");function ya(n){return n.nodeType===js?n.textContent?.trim()!=="":n.nodeType!==Gs||n.tagName.toLowerCase()==="img"?!1:[...n.childNodes].some(ya)}w(ya,"hasTextBesidesImages");var Ma=3,Fs=32,qs=w(async(n,t,s)=>{let l=V(),o=n.insert("g").attr("class",s??"node default").attr("id",t.domId||t.id),c=o.insert("g").attr("class","label").attr("style",Q(t.labelStyle)),r=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(d=>({text:d,cssClass:"c4-descr"}))].filter(d=>d.text),h=t.width?Math.max(t.width-2*(t.padding??0),Fs):V().flowchart?.wrappingWidth??200,a=l.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,e=await Promise.all(r.map(async d=>{let b=c.append("g").attr("class",d.cssClass),x=await ut(b,Ft(Bt(d.text??""),l),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:a,style:t.labelStyle},l);return Z(x).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),Z(x).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:b,box:b.node().getBBox()}})),g=Math.max(...e.map(({box:d})=>d.width),0),y=0;for(let{el:d,box:b}of e)d.attr("transform",`translate(${g/2-b.x-b.width/2}, ${y-b.y})`),y+=b.height+Ma;let f=e.length>0?y-Ma:0;c.insert("rect",":first-child"),c.attr("transform",`translate(${-g/2}, ${-f/2})`);let u=c.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:u,halfPadding:m,label:c}},"c4LabelHelper"),Pa=w((n,t)=>{let{x:s,y:l,width:o,height:c}=n;return o>=t?n:"left"in n?{x:s,y:l,width:t,height:c,top:l,left:s,bottom:l+c,right:s+t,toJSON:w(()=>({}),"toJSON")}:{x:s-(t-o)/2,y:l,width:t,height:c}},"withMinWidth"),Y=w(async(n,t,s,{ignoreMinWidth:l=!1}={})=>{if(t.stereotype!==void 0)return qs(n,t,s);let o,c=t.useHtmlLabels||xt(V()?.htmlLabels);s?o=s:o="node default";let p=n.insert("g").attr("class",o).attr("id",t.domId||t.id),r=p.insert("g").attr("class","label").attr("style",Q(t.labelStyle)),h;t.label===void 0?h="":h=typeof t.label=="string"?t.label:t.label[0];let i=!!t.icon||!!t.img,a=t.labelType==="markdown",e=h&&!t.width&&!l?t.minWidth??0:0,g=await ut(r,Ft(Bt(h),V()),{useHtmlLabels:c,width:t.width||t.wrappingWidth||V().flowchart?.wrappingWidth,minWidth:e,classes:a?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:i,markdown:a},V()),y=(t?.padding??0)/2,f;if(c){let u=g.children[0],m=Z(g);await ga(u),f=await Tt.measure(()=>u.getBoundingClientRect()),f=Pa(f,e),m.attr("width",f.width),m.attr("height",f.height)}else f=await Tt.measure(()=>g.getBBox()),f=Pa(f,e);return c?r.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):r.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&r.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:p,bbox:f,halfPadding:y,label:r}},"labelHelper"),Mt=w(async(n,t,s)=>{let l=s.useHtmlLabels??wt(V()),o=n.insert("g").attr("class","label").attr("style",s.labelStyle||""),c=await ut(o,Ft(Bt(t),V()),{useHtmlLabels:l,width:s.width||V()?.flowchart?.wrappingWidth,style:s.labelStyle,addSvgBackground:!!s.icon||!!s.img}),p=s.padding/2,r;if(wt(V())){let h=c.children[0],i=Z(c);r=await Tt.measure(()=>h.getBoundingClientRect()),i.attr("width",r.width),i.attr("height",r.height)}else r=await Tt.measure(()=>c.getBBox());return l?o.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"):o.attr("transform","translate(0, "+-r.height/2+")"),s.centerLabel&&o.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:r,halfPadding:p,label:o}},"insertLabel"),I=w((n,t,s)=>{if(s){n.width=s.width,n.height=s.height;return}let l=t.node().getBBox();n.width=l.width,n.height=l.height},"updateNodeBounds"),T=w((n,t)=>(n.look==="handDrawn"?"rough-node":"node")+" "+n.cssClasses+" "+(t||""),"getNodeClasses");function F(n){let t=n.map((s,l)=>`${l===0?"M":"L"}${s.x},${s.y}`);return t.push("Z"),t.join(" ")}w(F,"createPathFromPoints");function dt(n,t,s,l,o,c){let p=[],h=s-n,i=l-t,a=h/c,e=2*Math.PI/a,g=t+i/2;for(let y=0;y<=50;y++){let f=y/50,u=n+f*h,m=g+o*Math.sin(e*(u-n));p.push({x:u,y:m})}return p}w(dt,"generateFullSineWavePoints");function lt(n,t,s,l,o,c){let p=[],r=o*Math.PI/180,a=(c*Math.PI/180-r)/(l-1);for(let e=0;e<l;e++){let g=r+e*a,y=n+s*Math.cos(g),f=t+s*Math.sin(g);p.push({x:-y,y:-f})}return p}w(lt,"generateCirclePoints");function la(n){let t=Array.from(n.childNodes).filter(h=>h.tagName==="path"),s=document.createElementNS("http://www.w3.org/2000/svg","path"),l=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");s.setAttribute("d",l);let o=t.find(h=>h.getAttribute("fill")!=="none"),c=t.find(h=>h.getAttribute("stroke")!=="none"),p=w((h,i)=>h?.getAttribute(i)??void 0,"getAttr");if(o){let h={fill:p(o,"fill"),"fill-opacity":p(o,"fill-opacity")??"1"};Object.entries(h).forEach(([i,a])=>{a&&s.setAttribute(i,a)})}if(c){let h={stroke:p(c,"stroke"),"stroke-width":p(c,"stroke-width")??"1","stroke-opacity":p(c,"stroke-opacity")??"1"};Object.entries(h).forEach(([i,a])=>{a&&s.setAttribute(i,a)})}let r=document.createElementNS("http://www.w3.org/2000/svg","g");return r.appendChild(s),r}w(la,"mergePaths");var Vs=w((n,t)=>{var s=n.x,l=n.y,o=t.x-s,c=t.y-l,p=n.width/2,r=n.height/2,h,i;return Math.abs(c)*p>Math.abs(o)*r?(c<0&&(r=-r),h=c===0?0:r*o/c,i=r):(o<0&&(p=-p),h=p,i=o===0?0:p*c/o),{x:s+h,y:l+i}},"intersectRect"),zs=Vs;function Ua(n,t){return n.intersect(t)}w(Ua,"intersectNode");var Zs=Ua;function Ja(n,t,s,l){var o=n.x,c=n.y,p=o-l.x,r=c-l.y,h=Math.sqrt(t*t*r*r+s*s*p*p),i=Math.abs(t*s*p/h);l.x<o&&(i=-i);var a=Math.abs(t*s*r/h);return l.y<c&&(a=-a),{x:o+i,y:c+a}}w(Ja,"intersectEllipse");var Ka=Ja;function Qa(n,t,s){return Ka(n,t,t,s)}w(Qa,"intersectCircle");var Us=Qa;function te(n,t,s,l){{let o=t.y-n.y,c=n.x-t.x,p=t.x*n.y-n.x*t.y,r=o*s.x+c*s.y+p,h=o*l.x+c*l.y+p,i=1e-6;if(r!==0&&h!==0&&ca(r,h))return;let a=l.y-s.y,e=s.x-l.x,g=l.x*s.y-s.x*l.y,y=a*n.x+e*n.y+g,f=a*t.x+e*t.y+g;if(Math.abs(y)<i&&Math.abs(f)<i&&ca(y,f))return;let u=o*e-a*c;if(u===0)return;let m=(c*g-e*p)/u,d=(a*p-o*g)/u;return{x:m,y:d}}}w(te,"intersectLine");function ca(n,t){return n*t>0}w(ca,"sameSign");var Js=te;function ae(n,t,s){let l=n.x,o=n.y,c=[],p=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(a){p=Math.min(p,a.x),r=Math.min(r,a.y)}):(p=Math.min(p,t.x),r=Math.min(r,t.y));let h=l-n.width/2-p,i=o-n.height/2-r;for(let a=0;a<t.length;a++){let e=t[a],g=t[a<t.length-1?a+1:0],y=Js(n,s,{x:h+e.x,y:i+e.y},{x:h+g.x,y:i+g.y});y&&c.push(y)}return c.length?(c.length>1&&c.sort(function(a,e){let g=a.x-s.x,y=a.y-s.y,f=Math.sqrt(g*g+y*y),u=e.x-s.x,m=e.y-s.y,d=Math.sqrt(u*u+m*m);return f<d?-1:f===d?0:1}),c[0]):n}w(ae,"intersectPolygon");var Ks=ae,N={node:Zs,circle:Us,ellipse:Ka,polygon:Ks,rect:zs},yt=w((n,t,s,l,o)=>["M",n+o,t,"H",n+s-o,"A",o,o,0,0,1,n+s,t+o,"V",t+l-o,"A",o,o,0,0,1,n+s-o,t+l,"H",n+o,"A",o,o,0,0,1,n,t+l-o,"V",t+o,"A",o,o,0,0,1,n+o,t,"Z"].join(" "),"createRoundedRectPathD"),Qs=w(async(n,t,s,l=!1,o=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);let p=V(),r=wt(p);return await ut(n,c,{style:s,isTitle:l,useHtmlLabels:r,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},p)},"createLabel"),Da=Qs;function ee(n,t){let{labelStyles:s}=H(t);t.labelStyle=s;let l=T(t),o=l;l||(o="anchor");let c=n.insert("g").attr("class",o).attr("id",t.domId||t.id),p=1,{cssStyles:r}=t,h=v.svg(c),i=R(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(i.roughness=0);let a=h.circle(0,0,p*2,i),e=c.insert(()=>a,":first-child");return e.attr("class","anchor").attr("style",Q(r)),I(t,e),t.intersect=function(g){return J.info("Circle intersect",t,p,g),N.circle(t,p,g)},c}w(ee,"anchor");function oa(n,t,s,l,o,c,p){let h=(n+s)/2,i=(t+l)/2,a=Math.atan2(l-t,s-n),e=(s-n)/2,g=(l-t)/2,y=e/o,f=g/c,u=Math.sqrt(y**2+f**2);if(u>1)throw new Error("The given radii are too small to create an arc between the points.");let m=Math.sqrt(1-u**2),d=h+m*c*Math.sin(a)*(p?-1:1),b=i-m*o*Math.cos(a)*(p?-1:1),x=Math.atan2((t-b)/c,(n-d)/o),$=Math.atan2((l-b)/c,(s-d)/o)-x;p&&$<0&&($+=2*Math.PI),!p&&$>0&&($-=2*Math.PI);let M=[];for(let k=0;k<20;k++){let P=k/19,O=x+P*$,C=d+o*Math.cos(O),B=b+c*Math.sin(O);M.push({x:C,y:B})}return M}w(oa,"generateArcPoints");function se(n,t,s){let[l,o]=[t,s].sort((c,p)=>p-c);return o*(1-Math.sqrt(1-(n/l/2)**2))}w(se,"calculateArcSagitta");async function re(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=w(O=>O+p,"calcTotalHeight"),h=w(O=>{let C=O/2;return[C/(2.5+O/50),C]},"calcEllipseRadius"),{shapeSvg:i,bbox:a}=await Y(n,t,T(t)),e=r(t?.height?t?.height:a.height),[g,y]=h(e),f=se(e,g,y),m=(t?.width?t?.width:a.width)+c*2+f-f,d=e,{cssStyles:b}=t,x=[{x:m/2,y:-d/2},{x:-m/2,y:-d/2},...oa(-m/2,-d/2,-m/2,d/2,g,y,!1),{x:m/2,y:d/2},...oa(m/2,d/2,m/2,-d/2,g,y,!0)],S=v.svg(i),$=R(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let M=F(x),k=S.path(M,$),P=i.insert(()=>k,":first-child");return P.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(${g/2}, 0)`),I(t,P),t.intersect=function(O){return N.polygon(t,x,O)},i}w(re,"bowTieRect");async function ie(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,a=Math.max(p.width+i*2,t.width??0,80),e=Math.max(Math.min(a*.08,12),5),g=Math.max(p.height+i*2+e,t.height??0),y=-g/2+e,f=g/2,u=a*.72,m=[`M${-a/2},${y}`,`L${-u/2},${f}`,`A${u/2},${e} 0 0 0 ${u/2},${f}`,`L${a/2},${y}`,`A${a/2},${e} 0 0 0 ${-a/2},${y}`,"Z"].join(" "),{cssStyles:d}=t,b=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let P=v.svg(c).path(m,R(t,{}));b.node()?.appendChild(P),d&&b.attr("style",d)}else b.append("path").attr("d",m).attr("style",o);b.append("ellipse").attr("cx",0).attr("cy",y).attr("rx",a/2).attr("ry",e).attr("style",`fill:none;stroke:${h};stroke-width:1px`),I(t,b);let x=y+(f-y)/2;r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${x-p.height/2-(p.y-(p.top??0))})`);let S=12,$=w((k,P,O)=>Array.from({length:S+1},(C,B)=>{let L=Math.PI-B*Math.PI/S;return{x:k*Math.cos(L),y:P+O*e*Math.sin(L)}}),"arc"),M=[...$(a/2,y,-1),...$(u/2,f,1).reverse()];return t.intersect=function(k){return N.polygon(t,M,k)},c}w(ie,"bucket");var ta=20,aa=8,tr=80,ar=8;function ne(n){let{themeVariables:t}=V(),s=t.clusterBkg,l=t.clusterBorder;return n==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:ar,fill:s,stroke:l,cssClass:"collapsed-group"}}w(ne,"getCollapsedStyle");async function le(n,t){let s=ne(t.metadata?.containerType),{fill:l,stroke:o}=s,{nodeStyles:c}=H(t),{shapeSvg:p,bbox:r}=await Y(n,t,T(t)),{theme:h,themeVariables:i}=V();$t(p,t.colorIndex,h,i.borderColorArray);let a=t.padding??8,e=r.height,g=Math.max(r.width+a*2,tr,t?.width??0),y=Math.max(e+aa+ta+a*2,t?.height??0),f=-g/2,u=-y/2,m=-(aa+ta)/2,d=p.select(".label");d&&(t.useHtmlLabels??wt(V())?d.attr("transform",`translate(${-r.width/2}, ${-r.height/2+m})`):d.attr("transform",`translate(0, ${-r.height/2+m})`));let b;if(t.look==="handDrawn"){let k=v.svg(p),P=R(t,{fill:l,stroke:o,...s.strokeWidth===void 0?{}:{strokeWidth:s.strokeWidth},...l==="none"?{fillWeight:0}:{fillStyle:"solid"}}),O=k.path(yt(f,u,g,y,s.rx),P);b=p.insert(()=>O,":first-child"),b.attr("class","basic label-container "+s.cssClass).attr("style",Q(t.cssStyles))}else b=p.insert("rect",":first-child"),b.attr("class","basic label-container "+s.cssClass).attr("style",c).attr("rx",s.rx).attr("ry",s.rx).attr("x",f).attr("y",u).attr("width",g).attr("height",y).attr("fill",l).attr("stroke",o),s.strokeWidth!==void 0&&b.attr("stroke-width",s.strokeWidth+"px");let x=u+a+e+aa;p.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",x).attr("x2",f+g-8).attr("y2",x).attr("stroke",o).attr("stroke-dasharray","3, 3");let S=x+ta/2,$=2.5,M=10;for(let k=-1;k<=1;k++)p.append("circle").attr("class","collapsed-indicator").attr("cx",k*M).attr("cy",S).attr("r",$).attr("fill",o);return I(t,b),t.calcIntersect=function(k,P){return N.rect(k,P)},t.intersect=function(k){return N.rect(t,k)},p}w(le,"collapsedGroup");function ct(n,t,s,l){return n.insert("polygon",":first-child").attr("points",l.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}w(ct,"insertPolygonShape");var er=["right","left","up","down"],pa="point",sr=w(n=>{let t=new Set;for(let s of n)switch(s){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(s);break}return t},"expandAndDeduplicateDirections"),rr=w(n=>er.filter(t=>n.has(t)).join("|")||pa,"getDirectionKey"),Ba={"right|left|up|down":w(({height:n,midpoint:t,padding:s,width:l})=>[{x:0,y:0},{x:t,y:0},{x:l/2,y:2*s},{x:l-t,y:0},{x:l,y:0},{x:l,y:-n/3},{x:l+2*s,y:-n/2},{x:l,y:-2*n/3},{x:l,y:-n},{x:l-t,y:-n},{x:l/2,y:-n-2*s},{x:t,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*s,y:-n/2},{x:0,y:-n/3}],"right|left|up|down"),"right|left|up":w(({height:n,midpoint:t,width:s})=>[{x:t,y:0},{x:s-t,y:0},{x:s,y:-n/2},{x:s-t,y:-n},{x:t,y:-n},{x:0,y:-n/2}],"right|left|up"),"right|left|down":w(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:t,y:-n},{x:s-t,y:-n},{x:s,y:0}],"right|left|down"),"right|up|down":w(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:s,y:-t},{x:s,y:-n+t},{x:0,y:-n}],"right|up|down"),"left|up|down":w(({height:n,midpoint:t,width:s})=>[{x:s,y:0},{x:0,y:-t},{x:0,y:-n+t},{x:s,y:-n}],"left|up|down"),"right|left":w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:0},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:0},{x:l,y:-n/2},{x:l-t,y:-n},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n},{x:0,y:-n/2}],"right|left"),"up|down":w(({height:n,midpoint:t,padding:s,width:l})=>[{x:l/2,y:0},{x:0,y:-s},{x:t,y:-s},{x:t,y:-n+s},{x:0,y:-n+s},{x:l/2,y:-n},{x:l,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s},{x:l,y:-s}],"up|down"),"right|up":w(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:s,y:-t},{x:0,y:-n}],"right|up"),"right|down":w(({height:n,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-n}],"right|down"),"left|up":w(({height:n,midpoint:t,width:s})=>[{x:s,y:0},{x:0,y:-t},{x:s,y:-n}],"left|up"),"left|down":w(({height:n,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-n}],"left|down"),right:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:-s},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:0},{x:l,y:-n/2},{x:l-t,y:-n},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n+s}],"right"),left:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:0},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n},{x:0,y:-n/2}],"left"),up:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:-s},{x:t,y:-n+s},{x:0,y:-n+s},{x:l/2,y:-n},{x:l,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s}],"up"),down:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:l/2,y:0},{x:0,y:-s},{x:t,y:-s},{x:t,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s},{x:l,y:-s}],"down"),[pa]:()=>[{x:0,y:0}]},ir=w((n,t,s,l)=>{let o=sr(n),c=(s.padding??0)/2,p=t.height+4*c,r=p/2,h=l??t.width+2*r+2*c,i=rr(o);return(Ba[i]??Ba[pa])({height:p,midpoint:r,padding:c,width:h})},"getArrowPoints");async function ce(n,t){let s=t,{shapeSvg:l,bbox:o}=await Y(n,s,T(s)),c=s.padding??0,p=o.height+2*c,r=p/2,h=o.width+2*r+c,i=s.width??0,e=s.positioned&&(s.widthInColumns??1)>1&&i>h?i:h,g=ir(s.directions??[],o,s,e),y=ct(l,e,p,g);return y.attr("style",s.style??null),I(s,y),s.intersect=function(f){return N.polygon(s,g,f)},l}w(ce,"block_arrow");async function oe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,a=18,e=12,g=Math.max(p.width+i*2,t.width??0,90),y=Math.max(p.height+i*2+a,t.height??0),f=-y/2,{cssStyles:u}=t,m=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let x=v.svg(c).path(yt(-g/2,f,g,y,e),R(t,{}));m.node()?.appendChild(x),u&&m.attr("style",u)}else m.append("rect").attr("x",-g/2).attr("y",f).attr("width",g).attr("height",y).attr("rx",e).attr("ry",e).attr("style",o);m.append("line").attr("x1",-g/2).attr("y1",f+a).attr("x2",g/2).attr("y2",f+a).attr("style",`stroke:${h};stroke-width:1px`);for(let b=0;b<3;b++)m.append("circle").attr("cx",-g/2+12+b*9).attr("cy",f+a/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-g/2+44).attr("y",f+4).attr("width",Math.max(g-56,10)).attr("height",a-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),I(t,m);let d=f+a+(y-a)/2;return r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${d-p.height/2-(p.y-(p.top??0))})`),t.intersect=function(b){return N.rect(t,b)},c}w(oe,"browser");var qt=12;async function he(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?28:o,p=t.look==="neo"?24:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=(t?.width??h.width)+(t.look==="neo"?c*2:c+qt),a=(t?.height??h.height)+(t.look==="neo"?p*2:p),e=0,g=i,y=-a,f=0,u=[{x:e+qt,y},{x:g,y},{x:g,y:f},{x:e,y:f},{x:e,y:y+qt},{x:e+qt,y}],m,{cssStyles:d}=t;if(t.look==="handDrawn"){let b=v.svg(r),x=R(t,{}),S=F(u),$=b.path(S,x);m=r.insert(()=>$,":first-child").attr("transform",`translate(${-i/2}, ${a/2})`),d&&m.attr("style",d)}else m=ct(r,i,a,u);return l&&m.attr("style",l),I(t,m),t.intersect=function(b){return N.polygon(t,u,b)},r}w(he,"card");function ge(n,t){let{nodeStyles:s}=H(t);t.label="";let l=n.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,c=Math.max(28,t.width??0),p=[{x:0,y:c/2},{x:c/2,y:0},{x:0,y:-c/2},{x:-c/2,y:0}],r=v.svg(l),h=R(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let i=F(p),a=r.path(i,h),e=l.insert(()=>a,":first-child");return o&&t.look!=="handDrawn"&&e.selectAll("path").attr("style",o),s&&t.look!=="handDrawn"&&e.selectAll("path").attr("style",s),t.width=28,t.height=28,t.intersect=function(g){return N.polygon(t,p,g)},l}w(ge,"choice");async function fa(n,t,s){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,halfPadding:r}=await Y(n,t,T(t),{ignoreMinWidth:!0}),h=16,i=s?.padding??r,a=Math.sqrt(p.width**2+p.height**2)/2,e=t.look==="neo"?a+h:a+i,g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(c),u=R(t,{}),m=f.circle(0,0,e*2,u);g=c.insert(()=>m,":first-child"),g.attr("class","basic label-container").attr("style",Q(y))}else g=c.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",e).attr("cx",0).attr("cy",0);return I(t,g),t.calcIntersect=function(f,u){let m=f.width/2;return N.circle(f,m,u)},t.intersect=function(f){return J.info("Circle intersect",t,e,f),N.circle(t,e,f)},c}w(fa,"circle");async function ye(n,t){let s=t,l=["node",s.cssClasses,s.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:c,halfPadding:p}=await Y(n,s,l),r=o.insert("rect",":first-child"),h=s.padding??0,i=s.positioned?s.width??0:c.width+h,a=s.positioned?s.height??0:c.height+h,e=s.positioned?-i/2:-c.width/2-p,g=s.positioned?-a/2:-c.height/2-p;return r.attr("class","basic cluster composite label-container").attr("style",s.style??null).attr("rx",s.rx??null).attr("ry",s.ry??null).attr("x",e).attr("y",g).attr("width",i).attr("height",a),I(s,r),s.intersect=function(y){return N.rect(s,y)},o}w(ye,"composite");async function pe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,a=20,e=12,g=Math.max(p.width+i*2,t.width??0,90),y=Math.max(p.height+i*2+a,t.height??0),f=-y/2,{cssStyles:u}=t,m=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let x=v.svg(c).path(yt(-g/2,f,g,y,e),R(t,{}));m.node()?.appendChild(x),u&&m.attr("style",u)}else m.append("rect").attr("x",-g/2).attr("y",f).attr("width",g).attr("height",y).attr("rx",e).attr("ry",e).attr("style",o);m.append("text").attr("x",-g/2+12).attr("y",f+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),I(t,m);let d=f+a+(y-a)/2;return r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${d-p.height/2-(p.y-(p.top??0))})`),t.intersect=function(b){return N.rect(t,b)},c}w(pe,"consoleWindow");function fe(n){let t=Math.cos(Math.PI/4),s=Math.sin(Math.PI/4),l=n*2,o={x:l/2*t,y:l/2*s},c={x:-(l/2)*t,y:l/2*s},p={x:-(l/2)*t,y:-(l/2)*s},r={x:l/2*t,y:-(l/2)*s};return`M ${c.x},${c.y} L ${r.x},${r.y}
1
+ import{a as v}from"./chunk-4QDE4SUK.js";import{a as wa,b as Dt,d as H,e as R}from"./chunk-DIDARDST.js";import{c as Tt,e as ut}from"./chunk-7LSMJ4VU.js";import{b as Sa,c as $a,d as va,e as St}from"./chunk-5N2X2DXU.js";import{g as $t}from"./chunk-3CJU2RDX.js";import{k as Wt,o as ka,s as Bt,u as Q}from"./chunk-QLS7NIYR.js";import{$ as V,C as Pt,G as wt,I as Ft,K as Kt,L as xa,ca as Qt,r as ba,v as xt}from"./chunk-IVZHB6RS.js";import{b as J,d as Z}from"./chunk-QQIGL7OP.js";import{a as w}from"./chunk-RJFVWYCA.js";var Gs=1,js=3;async function ga(n){let t=n.getElementsByTagName("img");if(!t||t.length===0)return;let s=!ya(n);await Promise.all([...t].map(l=>new Promise(o=>{function c(){if(l.style.display="flex",l.style.flexDirection="column",s){let p=V().fontSize?V().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[h=ba.fontSize]=ka(p),i=h*r+"px";l.style.minWidth=i,l.style.maxWidth=i}else l.style.width="100%";o(l)}w(c,"setupImage"),setTimeout(()=>{l.complete&&c()}),l.addEventListener("error",c),l.addEventListener("load",c)})))}w(ga,"configureLabelImages");function ya(n){return n.nodeType===js?n.textContent?.trim()!=="":n.nodeType!==Gs||n.tagName.toLowerCase()==="img"?!1:[...n.childNodes].some(ya)}w(ya,"hasTextBesidesImages");var Ma=3,Fs=32,qs=w(async(n,t,s)=>{let l=V(),o=n.insert("g").attr("class",s??"node default").attr("id",t.domId||t.id),c=o.insert("g").attr("class","label").attr("style",Q(t.labelStyle)),r=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(d=>({text:d,cssClass:"c4-descr"}))].filter(d=>d.text),h=t.width?Math.max(t.width-2*(t.padding??0),Fs):V().flowchart?.wrappingWidth??200,a=l.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,e=await Promise.all(r.map(async d=>{let b=c.append("g").attr("class",d.cssClass),x=await ut(b,Ft(Bt(d.text??""),l),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:a,style:t.labelStyle},l);return Z(x).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),Z(x).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:b,box:b.node().getBBox()}})),g=Math.max(...e.map(({box:d})=>d.width),0),y=0;for(let{el:d,box:b}of e)d.attr("transform",`translate(${g/2-b.x-b.width/2}, ${y-b.y})`),y+=b.height+Ma;let f=e.length>0?y-Ma:0;c.insert("rect",":first-child"),c.attr("transform",`translate(${-g/2}, ${-f/2})`);let u=c.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:u,halfPadding:m,label:c}},"c4LabelHelper"),Pa=w((n,t)=>{let{x:s,y:l,width:o,height:c}=n;return o>=t?n:"left"in n?{x:s,y:l,width:t,height:c,top:l,left:s,bottom:l+c,right:s+t,toJSON:w(()=>({}),"toJSON")}:{x:s-(t-o)/2,y:l,width:t,height:c}},"withMinWidth"),Y=w(async(n,t,s,{ignoreMinWidth:l=!1}={})=>{if(t.stereotype!==void 0)return qs(n,t,s);let o,c=t.useHtmlLabels||xt(V()?.htmlLabels);s?o=s:o="node default";let p=n.insert("g").attr("class",o).attr("id",t.domId||t.id),r=p.insert("g").attr("class","label").attr("style",Q(t.labelStyle)),h;t.label===void 0?h="":h=typeof t.label=="string"?t.label:t.label[0];let i=!!t.icon||!!t.img,a=t.labelType==="markdown",e=h&&!t.width&&!l?t.minWidth??0:0,g=await ut(r,Ft(Bt(h),V()),{useHtmlLabels:c,width:t.width||t.wrappingWidth||V().flowchart?.wrappingWidth,minWidth:e,classes:a?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:i,markdown:a},V()),y=(t?.padding??0)/2,f;if(c){let u=g.children[0],m=Z(g);await ga(u),f=await Tt.measure(()=>u.getBoundingClientRect()),f=Pa(f,e),m.attr("width",f.width),m.attr("height",f.height)}else f=await Tt.measure(()=>g.getBBox()),f=Pa(f,e);return c?r.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):r.attr("transform","translate(0, "+-f.height/2+")"),t.centerLabel&&r.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:p,bbox:f,halfPadding:y,label:r}},"labelHelper"),Mt=w(async(n,t,s)=>{let l=s.useHtmlLabels??wt(V()),o=n.insert("g").attr("class","label").attr("style",s.labelStyle||""),c=await ut(o,Ft(Bt(t),V()),{useHtmlLabels:l,width:s.width||V()?.flowchart?.wrappingWidth,style:s.labelStyle,addSvgBackground:!!s.icon||!!s.img}),p=s.padding/2,r;if(wt(V())){let h=c.children[0],i=Z(c);r=await Tt.measure(()=>h.getBoundingClientRect()),i.attr("width",r.width),i.attr("height",r.height)}else r=await Tt.measure(()=>c.getBBox());return l?o.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"):o.attr("transform","translate(0, "+-r.height/2+")"),s.centerLabel&&o.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:r,halfPadding:p,label:o}},"insertLabel"),I=w((n,t,s)=>{if(s){n.width=s.width,n.height=s.height;return}let l=t.node().getBBox();n.width=l.width,n.height=l.height},"updateNodeBounds"),T=w((n,t)=>(n.look==="handDrawn"?"rough-node":"node")+" "+n.cssClasses+" "+(t||""),"getNodeClasses");function F(n){let t=n.map((s,l)=>`${l===0?"M":"L"}${s.x},${s.y}`);return t.push("Z"),t.join(" ")}w(F,"createPathFromPoints");function dt(n,t,s,l,o,c){let p=[],h=s-n,i=l-t,a=h/c,e=2*Math.PI/a,g=t+i/2;for(let y=0;y<=50;y++){let f=y/50,u=n+f*h,m=g+o*Math.sin(e*(u-n));p.push({x:u,y:m})}return p}w(dt,"generateFullSineWavePoints");function lt(n,t,s,l,o,c){let p=[],r=o*Math.PI/180,a=(c*Math.PI/180-r)/(l-1);for(let e=0;e<l;e++){let g=r+e*a,y=n+s*Math.cos(g),f=t+s*Math.sin(g);p.push({x:-y,y:-f})}return p}w(lt,"generateCirclePoints");function la(n){let t=Array.from(n.childNodes).filter(h=>h.tagName==="path"),s=document.createElementNS("http://www.w3.org/2000/svg","path"),l=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");s.setAttribute("d",l);let o=t.find(h=>h.getAttribute("fill")!=="none"),c=t.find(h=>h.getAttribute("stroke")!=="none"),p=w((h,i)=>h?.getAttribute(i)??void 0,"getAttr");if(o){let h={fill:p(o,"fill"),"fill-opacity":p(o,"fill-opacity")??"1"};Object.entries(h).forEach(([i,a])=>{a&&s.setAttribute(i,a)})}if(c){let h={stroke:p(c,"stroke"),"stroke-width":p(c,"stroke-width")??"1","stroke-opacity":p(c,"stroke-opacity")??"1"};Object.entries(h).forEach(([i,a])=>{a&&s.setAttribute(i,a)})}let r=document.createElementNS("http://www.w3.org/2000/svg","g");return r.appendChild(s),r}w(la,"mergePaths");var Vs=w((n,t)=>{var s=n.x,l=n.y,o=t.x-s,c=t.y-l,p=n.width/2,r=n.height/2,h,i;return Math.abs(c)*p>Math.abs(o)*r?(c<0&&(r=-r),h=c===0?0:r*o/c,i=r):(o<0&&(p=-p),h=p,i=o===0?0:p*c/o),{x:s+h,y:l+i}},"intersectRect"),zs=Vs;function Ua(n,t){return n.intersect(t)}w(Ua,"intersectNode");var Zs=Ua;function Ja(n,t,s,l){var o=n.x,c=n.y,p=o-l.x,r=c-l.y,h=Math.sqrt(t*t*r*r+s*s*p*p),i=Math.abs(t*s*p/h);l.x<o&&(i=-i);var a=Math.abs(t*s*r/h);return l.y<c&&(a=-a),{x:o+i,y:c+a}}w(Ja,"intersectEllipse");var Ka=Ja;function Qa(n,t,s){return Ka(n,t,t,s)}w(Qa,"intersectCircle");var Us=Qa;function te(n,t,s,l){{let o=t.y-n.y,c=n.x-t.x,p=t.x*n.y-n.x*t.y,r=o*s.x+c*s.y+p,h=o*l.x+c*l.y+p,i=1e-6;if(r!==0&&h!==0&&ca(r,h))return;let a=l.y-s.y,e=s.x-l.x,g=l.x*s.y-s.x*l.y,y=a*n.x+e*n.y+g,f=a*t.x+e*t.y+g;if(Math.abs(y)<i&&Math.abs(f)<i&&ca(y,f))return;let u=o*e-a*c;if(u===0)return;let m=(c*g-e*p)/u,d=(a*p-o*g)/u;return{x:m,y:d}}}w(te,"intersectLine");function ca(n,t){return n*t>0}w(ca,"sameSign");var Js=te;function ae(n,t,s){let l=n.x,o=n.y,c=[],p=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(a){p=Math.min(p,a.x),r=Math.min(r,a.y)}):(p=Math.min(p,t.x),r=Math.min(r,t.y));let h=l-n.width/2-p,i=o-n.height/2-r;for(let a=0;a<t.length;a++){let e=t[a],g=t[a<t.length-1?a+1:0],y=Js(n,s,{x:h+e.x,y:i+e.y},{x:h+g.x,y:i+g.y});y&&c.push(y)}return c.length?(c.length>1&&c.sort(function(a,e){let g=a.x-s.x,y=a.y-s.y,f=Math.sqrt(g*g+y*y),u=e.x-s.x,m=e.y-s.y,d=Math.sqrt(u*u+m*m);return f<d?-1:f===d?0:1}),c[0]):n}w(ae,"intersectPolygon");var Ks=ae,N={node:Zs,circle:Us,ellipse:Ka,polygon:Ks,rect:zs},yt=w((n,t,s,l,o)=>["M",n+o,t,"H",n+s-o,"A",o,o,0,0,1,n+s,t+o,"V",t+l-o,"A",o,o,0,0,1,n+s-o,t+l,"H",n+o,"A",o,o,0,0,1,n,t+l-o,"V",t+o,"A",o,o,0,0,1,n+o,t,"Z"].join(" "),"createRoundedRectPathD"),Qs=w(async(n,t,s,l=!1,o=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);let p=V(),r=wt(p);return await ut(n,c,{style:s,isTitle:l,useHtmlLabels:r,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},p)},"createLabel"),Da=Qs;function ee(n,t){let{labelStyles:s}=H(t);t.labelStyle=s;let l=T(t),o=l;l||(o="anchor");let c=n.insert("g").attr("class",o).attr("id",t.domId||t.id),p=1,{cssStyles:r}=t,h=v.svg(c),i=R(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(i.roughness=0);let a=h.circle(0,0,p*2,i),e=c.insert(()=>a,":first-child");return e.attr("class","anchor").attr("style",Q(r)),I(t,e),t.intersect=function(g){return J.info("Circle intersect",t,p,g),N.circle(t,p,g)},c}w(ee,"anchor");function oa(n,t,s,l,o,c,p){let h=(n+s)/2,i=(t+l)/2,a=Math.atan2(l-t,s-n),e=(s-n)/2,g=(l-t)/2,y=e/o,f=g/c,u=Math.sqrt(y**2+f**2);if(u>1)throw new Error("The given radii are too small to create an arc between the points.");let m=Math.sqrt(1-u**2),d=h+m*c*Math.sin(a)*(p?-1:1),b=i-m*o*Math.cos(a)*(p?-1:1),x=Math.atan2((t-b)/c,(n-d)/o),$=Math.atan2((l-b)/c,(s-d)/o)-x;p&&$<0&&($+=2*Math.PI),!p&&$>0&&($-=2*Math.PI);let M=[];for(let k=0;k<20;k++){let P=k/19,O=x+P*$,C=d+o*Math.cos(O),B=b+c*Math.sin(O);M.push({x:C,y:B})}return M}w(oa,"generateArcPoints");function se(n,t,s){let[l,o]=[t,s].sort((c,p)=>p-c);return o*(1-Math.sqrt(1-(n/l/2)**2))}w(se,"calculateArcSagitta");async function re(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=w(O=>O+p,"calcTotalHeight"),h=w(O=>{let C=O/2;return[C/(2.5+O/50),C]},"calcEllipseRadius"),{shapeSvg:i,bbox:a}=await Y(n,t,T(t)),e=r(t?.height?t?.height:a.height),[g,y]=h(e),f=se(e,g,y),m=(t?.width?t?.width:a.width)+c*2+f-f,d=e,{cssStyles:b}=t,x=[{x:m/2,y:-d/2},{x:-m/2,y:-d/2},...oa(-m/2,-d/2,-m/2,d/2,g,y,!1),{x:m/2,y:d/2},...oa(m/2,d/2,m/2,-d/2,g,y,!0)],S=v.svg(i),$=R(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let M=F(x),k=S.path(M,$),P=i.insert(()=>k,":first-child");return P.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(${g/2}, 0)`),I(t,P),t.intersect=function(O){return N.polygon(t,x,O)},i}w(re,"bowTieRect");async function ie(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,a=Math.max(p.width+i*2,t.width??0,80),e=Math.max(Math.min(a*.08,12),5),g=Math.max(p.height+i*2+e,t.height??0),y=-g/2+e,f=g/2,u=a*.72,m=[`M${-a/2},${y}`,`L${-u/2},${f}`,`A${u/2},${e} 0 0 0 ${u/2},${f}`,`L${a/2},${y}`,`A${a/2},${e} 0 0 0 ${-a/2},${y}`,"Z"].join(" "),{cssStyles:d}=t,b=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let P=v.svg(c).path(m,R(t,{}));b.node()?.appendChild(P),d&&b.attr("style",d)}else b.append("path").attr("d",m).attr("style",o);b.append("ellipse").attr("cx",0).attr("cy",y).attr("rx",a/2).attr("ry",e).attr("style",`fill:none;stroke:${h};stroke-width:1px`),I(t,b);let x=y+(f-y)/2;r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${x-p.height/2-(p.y-(p.top??0))})`);let S=12,$=w((k,P,O)=>Array.from({length:S+1},(C,B)=>{let L=Math.PI-B*Math.PI/S;return{x:k*Math.cos(L),y:P+O*e*Math.sin(L)}}),"arc"),M=[...$(a/2,y,-1),...$(u/2,f,1).reverse()];return t.intersect=function(k){return N.polygon(t,M,k)},c}w(ie,"bucket");var ta=20,aa=8,tr=80,ar=8;function ne(n){let{themeVariables:t}=V(),s=t.clusterBkg,l=t.clusterBorder;return n==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:ar,fill:s,stroke:l,cssClass:"collapsed-group"}}w(ne,"getCollapsedStyle");async function le(n,t){let s=ne(t.metadata?.containerType),{fill:l,stroke:o}=s,{nodeStyles:c}=H(t),{shapeSvg:p,bbox:r}=await Y(n,t,T(t)),{theme:h,themeVariables:i}=V();$t(p,t.colorIndex,h,i.borderColorArray);let a=t.padding??8,e=r.height,g=Math.max(r.width+a*2,tr,t?.width??0),y=Math.max(e+aa+ta+a*2,t?.height??0),f=-g/2,u=-y/2,m=-(aa+ta)/2,d=p.select(".label");d&&(t.useHtmlLabels??wt(V())?d.attr("transform",`translate(${-r.width/2}, ${-r.height/2+m})`):d.attr("transform",`translate(0, ${-r.height/2+m})`));let b;if(t.look==="handDrawn"){let k=v.svg(p),P=R(t,{fill:l,stroke:o,...s.strokeWidth===void 0?{}:{strokeWidth:s.strokeWidth},...l==="none"?{fillWeight:0}:{fillStyle:"solid"}}),O=k.path(yt(f,u,g,y,s.rx),P);b=p.insert(()=>O,":first-child"),b.attr("class","basic label-container "+s.cssClass).attr("style",Q(t.cssStyles))}else b=p.insert("rect",":first-child"),b.attr("class","basic label-container "+s.cssClass).attr("style",c).attr("rx",s.rx).attr("ry",s.rx).attr("x",f).attr("y",u).attr("width",g).attr("height",y).attr("fill",l).attr("stroke",o),s.strokeWidth!==void 0&&b.attr("stroke-width",s.strokeWidth+"px");let x=u+a+e+aa;p.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",x).attr("x2",f+g-8).attr("y2",x).attr("stroke",o).attr("stroke-dasharray","3, 3");let S=x+ta/2,$=2.5,M=10;for(let k=-1;k<=1;k++)p.append("circle").attr("class","collapsed-indicator").attr("cx",k*M).attr("cy",S).attr("r",$).attr("fill",o);return I(t,b),t.calcIntersect=function(k,P){return N.rect(k,P)},t.intersect=function(k){return N.rect(t,k)},p}w(le,"collapsedGroup");function ct(n,t,s,l){return n.insert("polygon",":first-child").attr("points",l.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}w(ct,"insertPolygonShape");var er=["right","left","up","down"],pa="point",sr=w(n=>{let t=new Set;for(let s of n)switch(s){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(s);break}return t},"expandAndDeduplicateDirections"),rr=w(n=>er.filter(t=>n.has(t)).join("|")||pa,"getDirectionKey"),Ba={"right|left|up|down":w(({height:n,midpoint:t,padding:s,width:l})=>[{x:0,y:0},{x:t,y:0},{x:l/2,y:2*s},{x:l-t,y:0},{x:l,y:0},{x:l,y:-n/3},{x:l+2*s,y:-n/2},{x:l,y:-2*n/3},{x:l,y:-n},{x:l-t,y:-n},{x:l/2,y:-n-2*s},{x:t,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*s,y:-n/2},{x:0,y:-n/3}],"right|left|up|down"),"right|left|up":w(({height:n,midpoint:t,width:s})=>[{x:t,y:0},{x:s-t,y:0},{x:s,y:-n/2},{x:s-t,y:-n},{x:t,y:-n},{x:0,y:-n/2}],"right|left|up"),"right|left|down":w(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:t,y:-n},{x:s-t,y:-n},{x:s,y:0}],"right|left|down"),"right|up|down":w(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:s,y:-t},{x:s,y:-n+t},{x:0,y:-n}],"right|up|down"),"left|up|down":w(({height:n,midpoint:t,width:s})=>[{x:s,y:0},{x:0,y:-t},{x:0,y:-n+t},{x:s,y:-n}],"left|up|down"),"right|left":w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:0},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:0},{x:l,y:-n/2},{x:l-t,y:-n},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n},{x:0,y:-n/2}],"right|left"),"up|down":w(({height:n,midpoint:t,padding:s,width:l})=>[{x:l/2,y:0},{x:0,y:-s},{x:t,y:-s},{x:t,y:-n+s},{x:0,y:-n+s},{x:l/2,y:-n},{x:l,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s},{x:l,y:-s}],"up|down"),"right|up":w(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:s,y:-t},{x:0,y:-n}],"right|up"),"right|down":w(({height:n,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-n}],"right|down"),"left|up":w(({height:n,midpoint:t,width:s})=>[{x:s,y:0},{x:0,y:-t},{x:s,y:-n}],"left|up"),"left|down":w(({height:n,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-n}],"left|down"),right:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:-s},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:0},{x:l,y:-n/2},{x:l-t,y:-n},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n+s}],"right"),left:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:0},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n},{x:0,y:-n/2}],"left"),up:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:-s},{x:t,y:-n+s},{x:0,y:-n+s},{x:l/2,y:-n},{x:l,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s}],"up"),down:w(({height:n,midpoint:t,padding:s,width:l})=>[{x:l/2,y:0},{x:0,y:-s},{x:t,y:-s},{x:t,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s},{x:l,y:-s}],"down"),[pa]:()=>[{x:0,y:0}]},ir=w((n,t,s,l)=>{let o=sr(n),c=(s.padding??0)/2,p=t.height+4*c,r=p/2,h=l??t.width+2*r+2*c,i=rr(o);return(Ba[i]??Ba[pa])({height:p,midpoint:r,padding:c,width:h})},"getArrowPoints");async function ce(n,t){let s=t,{shapeSvg:l,bbox:o}=await Y(n,s,T(s)),c=s.padding??0,p=o.height+2*c,r=p/2,h=o.width+2*r+c,i=s.width??0,e=s.positioned&&(s.widthInColumns??1)>1&&i>h?i:h,g=ir(s.directions??[],o,s,e),y=ct(l,e,p,g);return y.attr("style",s.style??null),I(s,y),s.intersect=function(f){return N.polygon(s,g,f)},l}w(ce,"block_arrow");async function oe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,a=18,e=12,g=Math.max(p.width+i*2,t.width??0,90),y=Math.max(p.height+i*2+a,t.height??0),f=-y/2,{cssStyles:u}=t,m=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let x=v.svg(c).path(yt(-g/2,f,g,y,e),R(t,{}));m.node()?.appendChild(x),u&&m.attr("style",u)}else m.append("rect").attr("x",-g/2).attr("y",f).attr("width",g).attr("height",y).attr("rx",e).attr("ry",e).attr("style",o);m.append("line").attr("x1",-g/2).attr("y1",f+a).attr("x2",g/2).attr("y2",f+a).attr("style",`stroke:${h};stroke-width:1px`);for(let b=0;b<3;b++)m.append("circle").attr("cx",-g/2+12+b*9).attr("cy",f+a/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-g/2+44).attr("y",f+4).attr("width",Math.max(g-56,10)).attr("height",a-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),I(t,m);let d=f+a+(y-a)/2;return r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${d-p.height/2-(p.y-(p.top??0))})`),t.intersect=function(b){return N.rect(t,b)},c}w(oe,"browser");var qt=12;async function he(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?28:o,p=t.look==="neo"?24:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=(t?.width??h.width)+(t.look==="neo"?c*2:c+qt),a=(t?.height??h.height)+(t.look==="neo"?p*2:p),e=0,g=i,y=-a,f=0,u=[{x:e+qt,y},{x:g,y},{x:g,y:f},{x:e,y:f},{x:e,y:y+qt},{x:e+qt,y}],m,{cssStyles:d}=t;if(t.look==="handDrawn"){let b=v.svg(r),x=R(t,{}),S=F(u),$=b.path(S,x);m=r.insert(()=>$,":first-child").attr("transform",`translate(${-i/2}, ${a/2})`),d&&m.attr("style",d)}else m=ct(r,i,a,u);return l&&m.attr("style",l),I(t,m),t.intersect=function(b){return N.polygon(t,u,b)},r}w(he,"card");function ge(n,t){let{nodeStyles:s}=H(t);t.label="";let l=n.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,c=Math.max(28,t.width??0),p=[{x:0,y:c/2},{x:c/2,y:0},{x:0,y:-c/2},{x:-c/2,y:0}],r=v.svg(l),h=R(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let i=F(p),a=r.path(i,h),e=l.insert(()=>a,":first-child");return o&&t.look!=="handDrawn"&&e.selectAll("path").attr("style",o),s&&t.look!=="handDrawn"&&e.selectAll("path").attr("style",s),t.width=28,t.height=28,t.intersect=function(g){return N.polygon(t,p,g)},l}w(ge,"choice");async function fa(n,t,s){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,halfPadding:r}=await Y(n,t,T(t),{ignoreMinWidth:!0}),h=16,i=s?.padding??r,a=Math.sqrt(p.width**2+p.height**2)/2,e=t.look==="neo"?a+h:a+i,g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(c),u=R(t,{}),m=f.circle(0,0,e*2,u);g=c.insert(()=>m,":first-child"),g.attr("class","basic label-container").attr("style",Q(y))}else g=c.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",e).attr("cx",0).attr("cy",0);return I(t,g),t.calcIntersect=function(f,u){let m=f.width/2;return N.circle(f,m,u)},t.intersect=function(f){return J.info("Circle intersect",t,e,f),N.circle(t,e,f)},c}w(fa,"circle");async function ye(n,t){let s=t,l=["node",s.cssClasses,s.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:c,halfPadding:p}=await Y(n,s,l),r=o.insert("rect",":first-child"),h=s.padding??0,i=s.positioned?s.width??0:c.width+h,a=s.positioned?s.height??0:c.height+h,e=s.positioned?-i/2:-c.width/2-p,g=s.positioned?-a/2:-c.height/2-p;return r.attr("class","basic cluster composite label-container").attr("style",s.style??null).attr("rx",s.rx??null).attr("ry",s.ry??null).attr("x",e).attr("y",g).attr("width",i).attr("height",a),I(s,r),s.intersect=function(y){return N.rect(s,y)},o}w(ye,"composite");async function pe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,a=20,e=12,g=Math.max(p.width+i*2,t.width??0,90),y=Math.max(p.height+i*2+a,t.height??0),f=-y/2,{cssStyles:u}=t,m=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let x=v.svg(c).path(yt(-g/2,f,g,y,e),R(t,{}));m.node()?.appendChild(x),u&&m.attr("style",u)}else m.append("rect").attr("x",-g/2).attr("y",f).attr("width",g).attr("height",y).attr("rx",e).attr("ry",e).attr("style",o);m.append("text").attr("x",-g/2+12).attr("y",f+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),I(t,m);let d=f+a+(y-a)/2;return r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${d-p.height/2-(p.y-(p.top??0))})`),t.intersect=function(b){return N.rect(t,b)},c}w(pe,"consoleWindow");function fe(n){let t=Math.cos(Math.PI/4),s=Math.sin(Math.PI/4),l=n*2,o={x:l/2*t,y:l/2*s},c={x:-(l/2)*t,y:l/2*s},p={x:-(l/2)*t,y:-(l/2)*s},r={x:l/2*t,y:-(l/2)*s};return`M ${c.x},${c.y} L ${r.x},${r.y}
2
2
  M ${o.x},${o.y} L ${p.x},${p.y}`}w(fe,"createLine");function ue(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s,t.label="";let o=n.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),c=Math.max(30,t?.width??0),{cssStyles:p}=t,r=v.svg(o),h=R(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let i=r.circle(0,0,c*2,h),a=fe(c),e=r.path(a,h),g=o.insert(()=>i,":first-child");return g.insert(()=>e),g.attr("class","outer-path"),p&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",p),l&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",l),I(t,g),t.intersect=function(y){return J.info("crossedCircle intersect",t,{radius:c,point:y}),N.circle(t,c,y)},o}w(ue,"crossedCircle");function ht(n,t,s,l=100,o=0,c=180){let p=[],r=o*Math.PI/180,a=(c*Math.PI/180-r)/(l-1);for(let e=0;e<l;e++){let g=r+e*a,y=n+s*Math.cos(g),f=t+s*Math.sin(g);p.push({x:-y,y:-f})}return p}w(ht,"generateCirclePoints");async function de(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,i=c.width+r,a=c.height+h,e=Math.max(5,a*.1),{cssStyles:g}=t,y=[...ht(i/2,-a/2,e,30,-90,0),{x:-i/2-e,y:e},...ht(i/2+e*2,-e,e,20,-180,-270),...ht(i/2+e*2,e,e,20,-90,-180),{x:-i/2-e,y:-a/2},...ht(i/2,a/2,e,20,0,90)],f=[{x:i/2,y:-a/2-e},{x:-i/2,y:-a/2-e},...ht(i/2,-a/2,e,20,-90,0),{x:-i/2-e,y:-e},...ht(i/2+i*.1,-e,e,20,-180,-270),...ht(i/2+i*.1,e,e,20,-90,-180),{x:-i/2-e,y:a/2},...ht(i/2,a/2,e,20,0,90),{x:-i/2,y:a/2+e},{x:i/2,y:a/2+e}],u=v.svg(o),m=R(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let b=F(y).replace("Z",""),x=u.path(b,m),S=F(f),$=u.path(S,{...m}),M=o.insert("g",":first-child");return M.insert(()=>$,":first-child").attr("stroke-opacity",0),M.insert(()=>x,":first-child"),M.attr("class","text"),g&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${e}, 0)`),p.attr("transform",`translate(${-i/2+e-(c.x-(c.left??0))},${-a/2+(t.padding??0)/2-(c.y-(c.top??0))})`),I(t,M),t.intersect=function(k){return N.polygon(t,f,k)},o}w(de,"curlyBraceLeft");function gt(n,t,s,l=100,o=0,c=180){let p=[],r=o*Math.PI/180,a=(c*Math.PI/180-r)/(l-1);for(let e=0;e<l;e++){let g=r+e*a,y=n+s*Math.cos(g),f=t+s*Math.sin(g);p.push({x:y,y:f})}return p}w(gt,"generateCirclePoints");async function me(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,i=c.width+(t.look==="neo"?r*2:r),a=c.height+(t.look==="neo"?h*2:h),e=Math.max(5,a*.1),{cssStyles:g}=t,y=[...gt(i/2,-a/2,e,20,-90,0),{x:i/2+e,y:-e},...gt(i/2+e*2,-e,e,20,-180,-270),...gt(i/2+e*2,e,e,20,-90,-180),{x:i/2+e,y:a/2},...gt(i/2,a/2,e,20,0,90)],f=[{x:-i/2,y:-a/2-e},{x:i/2,y:-a/2-e},...gt(i/2,-a/2,e,20,-90,0),{x:i/2+e,y:-e},...gt(i/2+e*2,-e,e,20,-180,-270),...gt(i/2+e*2,e,e,20,-90,-180),{x:i/2+e,y:a/2},...gt(i/2,a/2,e,20,0,90),{x:i/2,y:a/2+e},{x:-i/2,y:a/2+e}],u=v.svg(o),m=R(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let b=F(y).replace("Z",""),x=u.path(b,m),S=F(f),$=u.path(S,{...m}),M=o.insert("g",":first-child");return M.insert(()=>$,":first-child").attr("stroke-opacity",0),M.insert(()=>x,":first-child"),M.attr("class","text"),g&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${-e}, 0)`),p.attr("transform",`translate(${-i/2+(t.padding??0)/2-(c.x-(c.left??0))},${-a/2+(t.padding??0)/2-(c.y-(c.top??0))})`),I(t,M),t.intersect=function(k){return N.polygon(t,f,k)},o}w(me,"curlyBraceRight");function tt(n,t,s,l=100,o=0,c=180){let p=[],r=o*Math.PI/180,a=(c*Math.PI/180-r)/(l-1);for(let e=0;e<l;e++){let g=r+e*a,y=n+s*Math.cos(g),f=t+s*Math.sin(g);p.push({x:-y,y:-f})}return p}w(tt,"generateCirclePoints");async function be(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,i=c.width+(t.look==="neo"?r*2:r),a=c.height+(t.look==="neo"?h*2:h),e=Math.max(5,a*.1),{cssStyles:g}=t,y=[...tt(i/2,-a/2,e,30,-90,0),{x:-i/2-e,y:e},...tt(i/2+e*2,-e,e,20,-180,-270),...tt(i/2+e*2,e,e,20,-90,-180),{x:-i/2-e,y:-a/2},...tt(i/2,a/2,e,20,0,90)],f=[...tt(-i/2+e+e/2,-a/2,e,20,-90,-180),{x:i/2-e/2,y:e},...tt(-i/2-e/2,-e,e,20,0,90),...tt(-i/2-e/2,e,e,20,-90,0),{x:i/2-e/2,y:-e},...tt(-i/2+e+e/2,a/2,e,30,-180,-270)],u=[{x:i/2,y:-a/2-e},{x:-i/2,y:-a/2-e},...tt(i/2,-a/2,e,20,-90,0),{x:-i/2-e,y:-e},...tt(i/2+e*2,-e,e,20,-180,-270),...tt(i/2+e*2,e,e,20,-90,-180),{x:-i/2-e,y:a/2},...tt(i/2,a/2,e,20,0,90),{x:-i/2,y:a/2+e},{x:i/2-e-e/2,y:a/2+e},...tt(-i/2+e+e/2,-a/2,e,20,-90,-180),{x:i/2-e/2,y:e},...tt(-i/2-e/2,-e,e,20,0,90),...tt(-i/2-e/2,e,e,20,-90,0),{x:i/2-e/2,y:-e},...tt(-i/2+e+e/2,a/2,e,30,-180,-270)],m=v.svg(o),d=R(t,{fill:"none"});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let x=F(y).replace("Z",""),S=m.path(x,d),M=F(f).replace("Z",""),k=m.path(M,d),P=F(u),O=m.path(P,{...d}),C=o.insert("g",":first-child");return C.insert(()=>O,":first-child").attr("stroke-opacity",0),C.insert(()=>S,":first-child"),C.insert(()=>k,":first-child"),C.attr("class","text"),g&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${e-e/4}, 0)`),p.attr("transform",`translate(${-i/2+(t.padding??0)/2-(c.x-(c.left??0))},${-a/2+(t.padding??0)/2-(c.y-(c.top??0))})`),I(t,C),t.intersect=function(B){return N.polygon(t,u,B)},o}w(be,"curlyBraces");async function xe(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=20,h=5,{shapeSvg:i,bbox:a}=await Y(n,t,T(t)),e=Math.max(h,a.height+p*2,t?.height??0),g=e/2,y=g-Math.sqrt(Math.max(0,g**2-(a.height/2)**2)),f=Math.max(e/4,y),u=Math.max(r,a.width+c*2+f*2,(a.width+c*2)*1.25,t?.width??0),{cssStyles:m}=t,d=v.svg(i),b=R(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let x=u,S=e,$=x-g,M=S/4,k=[{x:$,y:0},{x:M,y:0},{x:0,y:S/2},{x:M,y:S},{x:$,y:S},...lt(-$,-S/2,g,50,270,90)],P=F(k),O=d.path(P,b),C=i.insert(()=>O,":first-child");return C.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",l),C.attr("transform",`translate(${-u/2}, ${-e/2})`),I(t,C),t.intersect=function(B){return N.polygon(t,k,B)},i}w(xe,"curvedTrapezoid");async function we(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=t.padding??20,h=Math.max(c.width+r*2,t.width??0,100),i=Math.min(Math.max(h*.23,16),56),a=i*.27,e=Math.max(c.height+r*2,t.height?t.height-(2*i-a):0),g=Math.min(h*.177,e*.45),y=e+2*i-a,f=-y/2,u=f+2*i-a,m=o.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:d}=t;if(t.look==="handDrawn"){let P=v.svg(o),O=R(t,{}),C=P.path(yt(-h/2,u,h,e,g),O),B=P.circle(0,f+i,i*2,O);m.insert(()=>B,":first-child"),m.insert(()=>C,":first-child"),d&&m.attr("style",d)}else m.append("rect").attr("x",-h/2).attr("y",u).attr("width",h).attr("height",e).attr("rx",g).attr("ry",g).attr("style",l),m.append("circle").attr("cx",0).attr("cy",f+i).attr("r",i).attr("style",l);I(t,m);let b=u+e/2;p.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${b-c.height/2-(c.y-(c.top??0))})`);let x=f+i,S=Math.asin(Math.min(1,(u-x)/i))*180/Math.PI,k=[...lt(0,-x,i,24,180+S,-S),...lt(-(-h/2+g),-(u+g),g,12,90,0),...lt(-(-h/2+g),-(y/2-g),g,12,360,270),...lt(-(h/2-g),-(y/2-g),g,12,270,180),...lt(-(h/2-g),-(u+g),g,12,180,90)];return t.intersect=function(P){return N.polygon(t,k,P)},o}w(we,"person");var nr=w((n,t,s,l,o,c)=>[`M${n},${t+c}`,`a${o},${c} 0,0,0 ${s},0`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`].join(" "),"createCylinderPathD"),lr=w((n,t,s,l,o,c)=>[`M${n},${t+c}`,`M${n+s},${t+c}`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`].join(" "),"createOuterCylinderPathD"),cr=w((n,t,s,l,o,c)=>[`M${n-s/2},${-l/2}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createInnerCylinderPathD"),Ca=8,Na=8;async function Se(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?24:o,p=t.look==="neo"?24:o,r=t.width??0;if(t.width&&(t.width=t.width-p,t.width<Na&&(t.width=Na)),t.height){let b=r/2/(2.5+r/50);t.height=t.height-c-b*3,t.height<Ca&&(t.height=Ca)}let{shapeSvg:h,bbox:i,label:a}=await Y(n,t,T(t)),e=Math.max(t.width??0,i.width)+p,g=e/2,y=g/(2.5+e/50),f=Math.max(t.height??0,i.height)+c+y,u,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=v.svg(h),b=lr(0,0,e,f,g,y),x=cr(0,y,e,f,g,y),S=R(t,{}),$=d.path(b,S),M=d.path(x,R(t,{fill:"none"}));u=h.insert(()=>M,":first-child"),u=h.insert(()=>$,":first-child"),u.attr("class","basic label-container"),m&&u.attr("style",m)}else{let d=nr(0,0,e,f,g,y);u=h.insert("path",":first-child").attr("d",d).attr("class","basic label-container outer-path").attr("style",Q(m)).attr("style",l)}return u.attr("label-offset-y",y),u.attr("transform",`translate(${-e/2}, ${-(f/2+y)})`),I(t,u),a.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)+(t.padding??0)/1.5-(i.y-(i.top??0))})`),t.intersect=function(d){let b=N.rect(t,d),x=b.x-(t.x??0);if(g!=0&&(Math.abs(x)<(t.width??0)/2||Math.abs(x)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-y)){let S=y*y*(1-x*x/(g*g));S>0&&(S=Math.sqrt(S)),S=y-S,d.y-(t.y??0)>0&&(S=-S),b.y+=S}return b},h}w(Se,"cylinder");async function Et(n,t,s){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p}=await Y(n,t,T(t)),r=Math.max(p.width+s.labelPaddingX*2,t?.width||0),h=Math.max(p.height+s.labelPaddingY*2,t?.height||0),i=-r/2,a=-h/2,e,{rx:g,ry:y}=t,{cssStyles:f}=t;if(s?.rx&&s.ry&&(g=s.rx,y=s.ry),t.look==="handDrawn"){let u=v.svg(c),m=R(t,{}),d=g||y?u.path(yt(i,a,r,h,g||0),m):u.rectangle(i,a,r,h,m);e=c.insert(()=>d,":first-child"),e.attr("class","basic label-container").attr("style",Q(f))}else e=c.insert("rect",":first-child"),e.attr("class","basic label-container").attr("style",o).attr("rx",Q(g)).attr("ry",Q(y)).attr("x",i).attr("y",a).attr("width",r).attr("height",h);return I(t,e,t.look==="handDrawn"?void 0:{width:r,height:h}),t.calcIntersect=function(u,m){return N.rect(u,m)},t.intersect=function(u){return N.rect(t,u)},c}w(Et,"drawRect");async function $e(n,t){let{cssClasses:s,labelPaddingX:l,labelPaddingY:o,padding:c,width:p,height:r}=t,h={rx:0,ry:0,classes:s??"",labelPaddingX:l??(c??0)*2,labelPaddingY:o??c??0},i=await Et(n,t,h);if(t.look==="handDrawn"){let y=v.svg(i),f=R(t,{}),u=i.select(".basic.label-container > path:nth-child(2)"),m=u.node();if(!m)return i;let d=null;if(m instanceof SVGGraphicsElement)d=m.getBBox();else return i;return i.insert(()=>y.line(d.x,d.y,d.x+d.width,d.y,f),".basic.label-container g.label"),i.insert(()=>y.line(d.x,d.y+d.height,d.x+d.width,d.y+d.height,f),".basic.label-container g.label"),u.remove(),i}let a=i.select(".basic.label-container"),e=(Number(a.attr("width"))||p)??0,g=(Number(a.attr("height"))||r)??0;return e>0&&g>0&&a.attr("stroke-dasharray",`${e} ${g}`),i}w($e,"datastore");async function ve(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.look==="neo"?16:t.padding??0,c=t.look==="neo"?16:t.padding??0,{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t)),i=r.width+o,a=r.height+c,e=a*.2,g=-i/2,y=-a/2-e/2,{cssStyles:f}=t,u=v.svg(p),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:g,y:y+e},{x:-g,y:y+e},{x:-g,y:-y},{x:g,y:-y},{x:g,y},{x:-g,y},{x:-g,y:y+e}],b=u.polygon(d.map(S=>[S.x,S.y]),m),x=p.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),l&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",l),h.attr("transform",`translate(${g+(t.padding??0)/2-(r.x-(r.left??0))}, ${y+e+(t.padding??0)/2-(r.y-(r.top??0))})`),I(t,x),t.intersect=function(S){return N.rect(t,S)},p}w(ve,"dividedRectangle");async function ke(n,t){let{labelStyles:s,nodeStyles:l}=H(t),o=t.look==="neo"?12:5;t.labelStyle=s;let c=t.padding??0,p=t.look==="neo"?16:c,{shapeSvg:r,bbox:h}=await Y(n,t,T(t),{ignoreMinWidth:!0}),i=Math.sqrt(h.width**2+h.height**2)/2,a=(t?.width?t?.width/2:i)+(p??0),e=a+o,g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(r),u=R(t,{roughness:.2,strokeWidth:2.5}),m=R(t,{roughness:.2,strokeWidth:1.5}),d=f.circle(0,0,e*2,u),b=f.circle(0,0,a*2,m);g=r.insert("g",":first-child"),g.attr("class",Q(t.cssClasses)).attr("style",Q(y)),g.node()?.appendChild(d),g.node()?.appendChild(b)}else{g=r.insert("g",":first-child");let f=g.insert("circle",":first-child"),u=g.insert("circle");g.attr("class","basic label-container").attr("style",l),f.attr("class","outer-circle").attr("style",l).attr("r",e).attr("cx",0).attr("cy",0),u.attr("class","inner-circle").attr("style",l).attr("r",a).attr("cx",0).attr("cy",0)}return I(t,g),t.intersect=function(f){return J.info("DoubleCircle intersect",t,e,f),N.circle(t,e,f)},r}w(ke,"doublecircle");async function Me(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,halfPadding:p}=await Y(n,t,T(t)),{theme:r,themeVariables:h}=V();$t(o,t.colorIndex,r,h.borderColorArray);let i=p??10,a=c.width/2+i*2,e=c.height/2+i*2,g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(o),u=R(t,{}),m=f.ellipse(0,0,a*2,e*2,u);g=o.insert(()=>m,":first-child"),g.attr("class","basic label-container"),y&&g.attr("style",y)}else g=o.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",l).attr("rx",a).attr("ry",e).attr("cx",0).attr("cy",0);return t.width=a*2,t.height=e*2,I(t,g),t.calcIntersect=function(f,u){let m=f.width/2,d=f.height/2;return N.ellipse(f,m,d,u)},t.intersect=function(f){return N.ellipse(t,a,e,f)},o}w(Me,"usecaseEllipse");function Pe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.label="",t.labelStyle=l;let c=n.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),p=7,{cssStyles:r}=t,h=v.svg(c),{nodeBorder:i}=s,a=R(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(a.roughness=0);let e=h.circle(0,0,p*2,a),g=c.insert(()=>e,":first-child");return g.selectAll("path").attr("style",`fill: ${i} !important;`),r&&r.length>0&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",r),o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),I(t,g),t.intersect=function(y){return J.info("filledCircle intersect",t,{radius:p,point:y}),N.circle(t,p,y)},c}w(Pe,"filledCircle");var Aa=10,Ha=10;async function De(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<Aa&&(t.height=Aa),t.width=(t?.width??0)-c-c/2,t.width<Ha&&(t.width=Ha));let{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t)),i=(t?.width?t?.width:r.width)+(c??0),a=t?.height?t?.height:i+r.height,e=a,g=[{x:0,y:-a},{x:e,y:-a},{x:e/2,y:0}],{cssStyles:y}=t,f=v.svg(p),u=R(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=F(g),d=f.path(m,u),b=p.insert(()=>d,":first-child").attr("transform",`translate(${-a/2}, ${a/2})`).attr("class","outer-path");return y&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",y),l&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",l),t.width=i,t.height=a,I(t,b),h.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-a/2+(t.padding??0)/2+(r.y-(r.top??0))})`),t.intersect=function(x){return J.info("Triangle intersect",t,g,x),N.polygon(t,g,x)},p}w(De,"flippedTriangle");async function Be(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=t.padding??12,h=Math.max(c.width+r*2,t.width??0,90),i=c.height+r*2,a=Math.max(Math.min(i*.16,14),8),e=Math.max(i+a,t.height??0),g=e-a,y=Math.max(h*.38,28),f=-e/2,u=[{x:-h/2,y:f},{x:-h/2+y,y:f},{x:-h/2+y,y:f+a},{x:h/2,y:f+a},{x:h/2,y:e/2},{x:-h/2,y:e/2}],m=[`M${u[0].x},${u[0].y}`,...u.slice(1).map(S=>`L${S.x},${S.y}`),"Z"].join(" "),{cssStyles:d}=t,b;if(t.look==="handDrawn"){let $=v.svg(o).path(m,R(t,{}));b=o.insert(()=>$,":first-child").attr("class","basic label-container"),d&&b.attr("style",d)}else b=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",l);t.look==="handDrawn"?I(t,b):I(t,b,{width:h,height:e});let x=f+a+g/2;return p.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${x-c.height/2-(c.y-(c.top??0))})`),t.intersect=function(S){return N.polygon(t,u,S)},o}w(Be,"folder");function Ce(n,t,{dir:s,config:{state:l,themeVariables:o}}){let{nodeStyles:c}=H(t);t.label="";let p=n.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:r}=t,h=Math.max(70,t?.width??0),i=Math.max(10,t?.height??0);(s==="LR"||s==="RL")&&(h=Math.max(10,t?.width??0),i=Math.max(70,t?.height??0));let a=-1*h/2,e=-1*i/2,g=v.svg(p),y=R(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let f=g.rectangle(a,e,h,i,y),u=p.insert(()=>f,":first-child");r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),c&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",c),I(t,u);let m=l?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(d){return N.rect(t,d)},p}w(Ce,"forkJoin");async function Ne(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=15,c=10,p=t.look==="neo"?16:t.padding??0,r=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-r*2,t.height<c&&(t.height=c),t.width=(t?.width??0)-p*2,t.width<o&&(t.width=o));let{shapeSvg:h,bbox:i}=await Y(n,t,T(t)),a=(t?.height?t?.height:Math.max(c,i.height))+r*2,e=a/2,g=e-Math.sqrt(Math.max(0,e**2-(i.height/2)**2)),y=(t?.width?t?.width:Math.max(o,i.width)+g*2)+p*2,{cssStyles:f}=t,u=v.svg(h),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:-y/2,y:-a/2},{x:y/2-e,y:-a/2},...lt(-y/2+e,0,e,50,90,270),{x:y/2-e,y:a/2},{x:-y/2,y:a/2}],b=F(d),x=u.path(b,m),S=h.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",f),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),I(t,S),t.intersect=function($){return J.info("Pill intersect",t,{radius:e,point:$}),N.polygon(t,d,$)},h}w(Ne,"halfRoundedRectangle");var or=w((n,t,s,l,o)=>[`M${n+o},${t}`,`L${n+s-o},${t}`,`L${n+s},${t-l/2}`,`L${n+s-o},${t-l}`,`L${n+o},${t-l}`,`L${n},${t-l/2}`,"Z"].join(" "),"createHexagonPathD");async function Ae(n,t){let{labelStyles:s,nodeStyles:l}=H(t),o=t.look==="neo"?3.5:4;t.labelStyle=s;let c=t.padding??0,p=70,r=32,h=t.look==="neo"?p:c,i=t.look==="neo"?r:c;if(t.width||t.height){let x=(t.height??0)/o;t.width=(t?.width??0)-2*x-i,t.height=(t.height??0)-h}let{shapeSvg:a,bbox:e}=await Y(n,t,T(t)),g=(t?.height?t?.height:e.height)+h,y=g/o,f=(t?.width?t?.width:e.width)+2*y+i,u=[{x:y,y:0},{x:f-y,y:0},{x:f,y:-g/2},{x:f-y,y:-g},{x:y,y:-g},{x:0,y:-g/2}],m,{cssStyles:d}=t;if(t.look==="handDrawn"){let b=v.svg(a),x=R(t,{}),S=or(0,0,f,g,y),$=b.path(S,x);m=a.insert(()=>$,":first-child").attr("transform",`translate(${-f/2}, ${g/2})`),d&&m.attr("style",d)}else m=ct(a,f,g,u);return l&&m.attr("style",l),t.width=f,t.height=g,I(t,m),t.intersect=function(b){return N.polygon(t,u,b)},a}w(Ae,"hexagon");async function He(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.label="",t.labelStyle=s;let{shapeSvg:o}=await Y(n,t,T(t)),c=Math.max(30,t?.width??0),p=Math.max(30,t?.height??0),{cssStyles:r}=t,h=v.svg(o),i=R(t,{});t.look!=="handDrawn"&&(i.roughness=0,i.fillStyle="solid");let a=[{x:0,y:0},{x:c,y:0},{x:0,y:p},{x:c,y:p}],e=F(a),g=h.path(e,i),y=o.insert(()=>g,":first-child");return y.attr("class","basic label-container outer-path"),r&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",r),l&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",l),y.attr("transform",`translate(${-c/2}, ${-p/2})`),I(t,y),t.intersect=function(f){return J.info("Pill intersect",t,{points:a}),N.polygon(t,a,f)},o}w(He,"hourglass");async function Ie(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=H(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:a,label:e}=await Y(n,t,"icon-shape default"),g=t.pos==="t",y=r,f=r,{nodeBorder:u}=s,{stylesMap:m}=Dt(t),d=-f/2,b=-y/2,x=t.label?8:0,S=v.svg(i),$=R(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let M=S.rectangle(d,b,f,y,$),k=Math.max(f,a.width),P=y+a.height+x,O=S.rectangle(-k/2,-P/2,k,P,{...$,fill:"transparent",stroke:"none"}),C=i.insert(()=>M,":first-child"),B=i.insert(()=>O);if(t.icon){let L=i.append("g");L.html(`<g>${await St(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let D=L.node().getBBox(),E=D.width,W=D.height,A=D.x,_=D.y;L.attr("transform",`translate(${-E/2-A},${g?a.height/2+x/2-W/2-_:-a.height/2-x/2-W/2-_})`),L.attr("style",`color: ${m.get("stroke")??u};`)}return e.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))},${g?-P/2:P/2-a.height})`),C.attr("transform",`translate(0,${g?a.height/2+x/2:-a.height/2-x/2})`),I(t,B),t.intersect=function(L){if(J.info("iconSquare intersect",t,L),!t.label)return N.rect(t,L);let D=t.x??0,E=t.y??0,W=t.height??0,A=[];return g?A=[{x:D-a.width/2,y:E-W/2},{x:D+a.width/2,y:E-W/2},{x:D+a.width/2,y:E-W/2+a.height+x},{x:D+f/2,y:E-W/2+a.height+x},{x:D+f/2,y:E+W/2},{x:D-f/2,y:E+W/2},{x:D-f/2,y:E-W/2+a.height+x},{x:D-a.width/2,y:E-W/2+a.height+x}]:A=[{x:D-f/2,y:E-W/2},{x:D+f/2,y:E-W/2},{x:D+f/2,y:E-W/2+y},{x:D+a.width/2,y:E-W/2+y},{x:D+a.width/2/2,y:E+W/2},{x:D-a.width/2,y:E+W/2},{x:D-a.width/2,y:E-W/2+y},{x:D-f/2,y:E-W/2+y}],N.polygon(t,A,L)},i}w(Ie,"icon");async function Re(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=H(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:a,label:e}=await Y(n,t,"icon-shape default"),g=20,y=t.label?8:0,f=t.pos==="t",{nodeBorder:u,mainBkg:m}=s,{stylesMap:d}=Dt(t),b=v.svg(i),x=R(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=d.get("fill");x.stroke=S??m;let $=i.append("g");t.icon&&$.html(`<g>${await St(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let M=$.node().getBBox(),k=M.width,P=M.height,O=M.x,C=M.y,B=Math.max(k,P)*Math.SQRT2+g*2,L=b.circle(0,0,B,x),D=Math.max(B,a.width),E=B+a.height+y,W=b.rectangle(-D/2,-E/2,D,E,{...x,fill:"transparent",stroke:"none"}),A=i.insert(()=>L,":first-child"),_=i.insert(()=>W);return $.attr("transform",`translate(${-k/2-O},${f?a.height/2+y/2-P/2-C:-a.height/2-y/2-P/2-C})`),$.attr("style",`color: ${d.get("stroke")??u};`),e.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))},${f?-E/2:E/2-a.height})`),A.attr("transform",`translate(0,${f?a.height/2+y/2:-a.height/2-y/2})`),I(t,_),t.intersect=function(X){return J.info("iconSquare intersect",t,X),N.rect(t,X)},i}w(Re,"iconCircle");async function Le(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=H(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:a,halfPadding:e,label:g}=await Y(n,t,"icon-shape default"),y=t.pos==="t",f=r+e*2,u=r+e*2,{nodeBorder:m,mainBkg:d}=s,{stylesMap:b}=Dt(t),x=-u/2,S=-f/2,$=t.label?8:0,M=v.svg(i),k=R(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let P=b.get("fill");k.stroke=P??d;let O=M.path(yt(x,S,u,f,5),k),C=Math.max(u,a.width),B=f+a.height+$,L=M.rectangle(-C/2,-B/2,C,B,{...k,fill:"transparent",stroke:"none"}),D=i.insert(()=>O,":first-child").attr("class","icon-shape2"),E=i.insert(()=>L);if(t.icon){let W=i.append("g");W.html(`<g>${await St(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let A=W.node().getBBox(),_=A.width,X=A.height,j=A.x,z=A.y;W.attr("transform",`translate(${-_/2-j},${y?a.height/2+$/2-X/2-z:-a.height/2-$/2-X/2-z})`),W.attr("style",`color: ${b.get("stroke")??m};`)}return g.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))},${y?-B/2:B/2-a.height})`),D.attr("transform",`translate(0,${y?a.height/2+$/2:-a.height/2-$/2})`),I(t,E),t.intersect=function(W){if(J.info("iconSquare intersect",t,W),!t.label)return N.rect(t,W);let A=t.x??0,_=t.y??0,X=t.height??0,j=[];return y?j=[{x:A-a.width/2,y:_-X/2},{x:A+a.width/2,y:_-X/2},{x:A+a.width/2,y:_-X/2+a.height+$},{x:A+u/2,y:_-X/2+a.height+$},{x:A+u/2,y:_+X/2},{x:A-u/2,y:_+X/2},{x:A-u/2,y:_-X/2+a.height+$},{x:A-a.width/2,y:_-X/2+a.height+$}]:j=[{x:A-u/2,y:_-X/2},{x:A+u/2,y:_-X/2},{x:A+u/2,y:_-X/2+f},{x:A+a.width/2,y:_-X/2+f},{x:A+a.width/2/2,y:_+X/2},{x:A-a.width/2,y:_+X/2},{x:A-a.width/2,y:_-X/2+f},{x:A-u/2,y:_-X/2+f}],N.polygon(t,j,W)},i}w(Le,"iconRounded");async function Ee(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=H(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:a,halfPadding:e,label:g}=await Y(n,t,"icon-shape default"),y=t.pos==="t",f=r+e*2,u=r+e*2,{nodeBorder:m,mainBkg:d}=s,{stylesMap:b}=Dt(t),x=-u/2,S=-f/2,$=t.label?8:0,M=v.svg(i),k=R(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let P=b.get("fill");k.stroke=P??d;let O=M.path(yt(x,S,u,f,.1),k),C=Math.max(u,a.width),B=f+a.height+$,L=M.rectangle(-C/2,-B/2,C,B,{...k,fill:"transparent",stroke:"none"}),D=i.insert(()=>O,":first-child"),E=i.insert(()=>L);if(t.icon){let W=i.append("g");W.html(`<g>${await St(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let A=W.node().getBBox(),_=A.width,X=A.height,j=A.x,z=A.y;W.attr("transform",`translate(${-_/2-j},${y?a.height/2+$/2-X/2-z:-a.height/2-$/2-X/2-z})`),W.attr("style",`color: ${b.get("stroke")??m};`)}return g.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))},${y?-B/2:B/2-a.height})`),D.attr("transform",`translate(0,${y?a.height/2+$/2:-a.height/2-$/2})`),I(t,E),t.intersect=function(W){if(J.info("iconSquare intersect",t,W),!t.label)return N.rect(t,W);let A=t.x??0,_=t.y??0,X=t.height??0,j=[];return y?j=[{x:A-a.width/2,y:_-X/2},{x:A+a.width/2,y:_-X/2},{x:A+a.width/2,y:_-X/2+a.height+$},{x:A+u/2,y:_-X/2+a.height+$},{x:A+u/2,y:_+X/2},{x:A-u/2,y:_+X/2},{x:A-u/2,y:_-X/2+a.height+$},{x:A-a.width/2,y:_-X/2+a.height+$}]:j=[{x:A-u/2,y:_-X/2},{x:A+u/2,y:_-X/2},{x:A+u/2,y:_-X/2+f},{x:A+a.width/2,y:_-X/2+f},{x:A+a.width/2/2,y:_+X/2},{x:A-a.width/2,y:_+X/2},{x:A-a.width/2,y:_-X/2+f},{x:A-u/2,y:_-X/2+f}],N.polygon(t,j,W)},i}w(Ee,"iconSquare");async function We(n,t,{config:{flowchart:s}}){let l=new Image;l.src=t?.img??"",await l.decode();let o=Number(l.naturalWidth.toString().replace("px","")),c=Number(l.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/c;let{labelStyles:p}=H(t);t.labelStyle=p;let r=s?.wrappingWidth;t.defaultWidth=s?.wrappingWidth;let h=Math.max(t.label?r??0:0,t?.assetWidth??o),i=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:h,a=t.constraint==="on"?i/t.imageAspectRatio:t?.assetHeight??c;t.width=Math.max(i,r??0);let{shapeSvg:e,bbox:g,label:y}=await Y(n,t,"image-shape default"),f=t.pos==="t",u=-i/2,m=-a/2,d=t.label?8:0,b=v.svg(e),x=R(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=b.rectangle(u,m,i,a,x),$=Math.max(i,g.width),M=a+g.height+d,k=b.rectangle(-$/2,-M/2,$,M,{...x,fill:"none",stroke:"none"}),P=e.insert(()=>S,":first-child"),O=e.insert(()=>k);if(t.img){let C=e.append("image");C.attr("href",t.img),C.attr("width",i),C.attr("height",a),C.attr("preserveAspectRatio","none"),C.attr("transform",`translate(${-i/2},${f?M/2-a:-M/2})`)}return y.attr("transform",`translate(${-g.width/2-(g.x-(g.left??0))},${f?-a/2-g.height/2-d/2:a/2-g.height/2+d/2})`),P.attr("transform",`translate(0,${f?g.height/2+d/2:-g.height/2-d/2})`),I(t,O),t.intersect=function(C){if(J.info("iconSquare intersect",t,C),!t.label)return N.rect(t,C);let B=t.x??0,L=t.y??0,D=t.height??0,E=[];return f?E=[{x:B-g.width/2,y:L-D/2},{x:B+g.width/2,y:L-D/2},{x:B+g.width/2,y:L-D/2+g.height+d},{x:B+i/2,y:L-D/2+g.height+d},{x:B+i/2,y:L+D/2},{x:B-i/2,y:L+D/2},{x:B-i/2,y:L-D/2+g.height+d},{x:B-g.width/2,y:L-D/2+g.height+d}]:E=[{x:B-i/2,y:L-D/2},{x:B+i/2,y:L-D/2},{x:B+i/2,y:L-D/2+a},{x:B+g.width/2,y:L-D/2+a},{x:B+g.width/2/2,y:L+D/2},{x:B-g.width/2,y:L+D/2},{x:B-g.width/2,y:L-D/2+a},{x:B-i/2,y:L-D/2+a}],N.polygon(t,E,C)},e}w(We,"imageSquare");async function Te(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=o,p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=Math.max(h.height+c*2,t.height??0),a=Math.max(h.width+p*2,(t.width??0)-i),e=[{x:0,y:0},{x:a,y:0},{x:a+3*i/6,y:-i},{x:-3*i/6,y:-i}],g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(r),u=R(t,{}),m=F(e),d=f.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-a/2}, ${i/2})`),y&&g.attr("style",y)}else g=ct(r,a,i,e);return l&&g.attr("style",l),t.width=a,t.height=i,I(t,g),t.intersect=function(f){return N.polygon(t,e,f)},r}w(Te,"inv_trapezoid");async function _e(n,t){let{shapeSvg:s,bbox:l,label:o}=await Y(n,t,"label"),c=s.insert("rect",":first-child");return c.attr("width",.1).attr("height",.1),s.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),I(t,c),t.intersect=function(h){return N.rect(t,h)},s}w(_e,"labelRect");async function Ye(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=o,p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=Math.max(h.height+c,t.height??0),a=Math.max(h.width+p,(t.width??0)-i),e=[{x:0,y:0},{x:a+3*i/6,y:0},{x:a,y:-i},{x:-(3*i)/6,y:-i}],g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(r),u=R(t,{}),m=F(e),d=f.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-a/2}, ${i/2})`),y&&g.attr("style",y)}else g=ct(r,a,i,e);return l&&g.attr("style",l),t.width=a,t.height=i,I(t,g),t.intersect=function(f){return N.polygon(t,e,f)},r}w(Ye,"lean_left");async function Oe(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=o,p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=Math.max(h.height+c,t.height??0),a=Math.max(h.width+p,(t.width??0)-i),e=[{x:-3*i/6,y:0},{x:a,y:0},{x:a+3*i/6,y:-i},{x:0,y:-i}],g,{cssStyles:y}=t;if(t.look==="handDrawn"){let f=v.svg(r),u=R(t,{}),m=F(e),d=f.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-a/2}, ${i/2})`),y&&g.attr("style",y)}else g=ct(r,a,i,e);return l&&g.attr("style",l),t.width=a,t.height=i,I(t,g),t.intersect=function(f){return N.polygon(t,e,f)},r}w(Oe,"lean_right");function Xe(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.label="",t.labelStyle=s;let o=n.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:c}=t,p=Math.max(35,t?.width??0),r=Math.max(35,t?.height??0),h=7,i=[{x:p,y:0},{x:0,y:r+h/2},{x:p-2*h,y:r+h/2},{x:0,y:2*r},{x:p,y:r-h/2},{x:2*h,y:r-h/2}],a=v.svg(o),e=R(t,{});t.look!=="handDrawn"&&(e.roughness=0,e.fillStyle="solid");let g=F(i),y=a.path(g,e),f=o.insert(()=>y,":first-child");return f.attr("class","outer-path"),c&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",c),l&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",l),f.attr("transform",`translate(-${p/2},${-r})`),I(t,f),t.intersect=function(u){return J.info("lightningBolt intersect",t,u),N.polygon(t,i,u)},o}w(Xe,"lightningBolt");var hr=w((n,t,s,l,o,c,p)=>[`M${n},${t+c}`,`a${o},${c} 0,0,0 ${s},0`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`,`M${n},${t+c+p}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createCylinderPathD"),gr=w((n,t,s,l,o,c,p)=>[`M${n},${t+c}`,`M${n+s},${t+c}`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`,`M${n},${t+c+p}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createOuterCylinderPathD"),yr=w((n,t,s,l,o,c)=>[`M${n-s/2},${-l/2}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createInnerCylinderPathD"),Ia=10,Ra=10;async function Ge(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?24:o;if(t.width||t.height){let d=t.width??0;t.width=(t.width??0)-c,t.width<Ra&&(t.width=Ra);let x=d/2/(2.5+d/50);t.height=(t.height??0)-p-x*3,t.height<Ia&&(t.height=Ia)}let{shapeSvg:r,bbox:h,label:i}=await Y(n,t,T(t)),a=(t?.width?t?.width:h.width)+c*2,e=a/2,g=e/(2.5+a/50),y=(t?.height?t?.height:h.height)+g+p*2,f=y*.1,u,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=v.svg(r),b=gr(0,0,a,y,e,g,f),x=yr(0,g,a,y,e,g),S=R(t,{}),$=d.path(b,S),M=d.path(x,S);r.insert(()=>M,":first-child").attr("class","line"),u=r.insert(()=>$,":first-child"),u.attr("class","basic label-container"),m&&u.attr("style",m)}else{let d=hr(0,0,a,y,e,g,f);u=r.insert("path",":first-child").attr("d",d).attr("class","basic label-container outer-path").attr("style",Q(m)).attr("style",l)}return u.attr("label-offset-y",g),u.attr("transform",`translate(${-a/2}, ${-(y/2+g)})`),I(t,u),i.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+g-(h.y-(h.top??0))})`),t.intersect=function(d){let b=N.rect(t,d),x=b.x-(t.x??0);if(e!=0&&(Math.abs(x)<(t.width??0)/2||Math.abs(x)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-g)){let S=g*g*(1-x*x/(e*e));S>0&&(S=Math.sqrt(S)),S=g-S,d.y-(t.y??0)>0&&(S=-S),b.y+=S}return b},r}w(Ge,"linedCylinder");async function je(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o;if(t.width||t.height){let S=t.width;t.width=(S??0)*10/11-c*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-p*2,t.height<10&&(t.height=10)}let{shapeSvg:r,bbox:h,label:i}=await Y(n,t,T(t)),a=(t?.width?t?.width:h.width)+(c??0)*2,e=(t?.height?t?.height:h.height)+(p??0)*2,g=t.look==="neo"?e/4:e/8,y=e+g,{cssStyles:f}=t,u=v.svg(r),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:-a/2-a/2*.1,y:-y/2},{x:-a/2-a/2*.1,y:y/2},...dt(-a/2-a/2*.1,y/2,a/2+a/2*.1,y/2,g,.8),{x:a/2+a/2*.1,y:-y/2},{x:-a/2-a/2*.1,y:-y/2},{x:-a/2,y:-y/2},{x:-a/2,y:y/2*1.1},{x:-a/2,y:-y/2}],b=u.polygon(d.map(S=>[S.x,S.y]),m),x=r.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),l&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",l),x.attr("transform",`translate(0,${-g/2})`),i.attr("transform",`translate(${-a/2+(t.padding??0)+a/2*.1/2-(h.x-(h.left??0))},${-e/2+(t.padding??0)-g-(h.y-(h.top??0))})`),I(t,x),t.intersect=function(S){return N.polygon(t,d,S)},r}w(je,"linedWaveEdgedRect");var pr=56,ea=72,La=8,Ea=2,fr=8,ur={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Wa=Math.PI/3,Ta=.6,sa=w((n,t)=>{let s=t*Ta,l=t*Math.sqrt(1-Ta**2),o=Math.cos(Wa),c=-Math.sin(Wa),p=s*-c,r=n+s*o,h=l*o,i=l*c;return`M ${p-h} ${r-i} L ${p+h} ${r+i}`},"businessMarkerPathForCircle"),dr={normal:sa(-24,12),hollow:sa(-23,9),awesome:sa(-21,13),icon:"M 12 -8 L 26 -26"},_a=w((n,t,s)=>{let l=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);n.attr("transform",`translate(${-t.width/2-l},${s-t.height/2-o})`)},"positionLabel"),ua=w((n,t,s,l,o=!1)=>{if(t.look==="handDrawn"){let r=v.svg(n).path(s,R(t,o?{fill:"none"}:{}));return n.insert(()=>r,":first-child").attr("class",l)}let c=n.append("path").attr("class",l).attr("d",s);return o&&c.attr("fill","none"),c},"appendActorPath"),mr=w((n,t,s,l,o,c,p=!1)=>{if(t.look==="handDrawn"){let i=v.svg(n).circle(s,l,o*2,R(t,p?{fill:"none"}:{}));return n.insert(()=>i,":first-child").attr("class",c)}let r=n.append("circle").attr("class",c).attr("cx",s).attr("cy",l).attr("r",o);return p&&r.attr("fill","none"),r},"appendActorCircle"),br=w((n,t,s)=>{t.business&&n.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",dr[s]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function Ot(n,t,s,l){let{labelStyles:o,nodeStyles:c}=H(t);t.labelStyle=o;let p=s==="icon"||t.stereotype!==void 0?{...t,icon:s==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:r,bbox:h,label:i}=await Y(n,p,T(t,`usecase-actor-variant usecase-actor-${s}`)),a=t.accessibleName??t.label;a&&r.attr("role","img").attr("aria-label",a),i.attr("class","label actor-label usecase-actor-label");let{theme:e,themeVariables:g}=V();$t(r,t.colorIndex,e,g.borderColorArray);let y,f;if(t.stereotype){let P=await Mt(r,`\xAB${t.stereotype}\xBB`,{labelStyle:o,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});y=P.label.attr("class","label usecase-stereotype"),f=P.bbox}let u=r.append("g").attr("class",`usecase-actor-glyph ${ur[s]}`).attr("style",c||null);await l(u,t),br(u,t,s);let m=t.padding??fr,d=f?.height??0,b=ea+La+h.height+(f?d+Ea:0),x=Math.max(pr,h.width,f?.width??0)+m*2,S=b+m*2,$=-b/2;u.attr("transform",`translate(0,${$+ea/2})`);let M=$+ea+La;y&&f&&(M+=d/2,_a(y,f,M),M+=d/2+Ea),_a(i,h,M+h.height/2);let k=r.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-x/2).attr("y",-S/2).attr("width",x).attr("height",S).attr("opacity",0).attr("aria-hidden","true");return I(t,k),t.intersect=P=>N.rect(t,P),r}w(Ot,"renderUsecaseActor");var xr=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function Fe(n,t){return Ot(n,t,"normal",(s,l)=>{ua(s,l,xr,"usecase-actor-stick")})}w(Fe,"usecaseActor");var wr=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function qe(n,t){return Ot(n,t,"awesome",(s,l)=>{ua(s,l,wr,"usecase-actor-awesome-silhouette")})}w(qe,"usecaseActorAwesome");var Sr=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function Ve(n,t){return Ot(n,t,"hollow",(s,l)=>{mr(s,l,0,-23,9,"usecase-actor-hollow-head",!0),ua(s,l,Sr,"usecase-actor-hollow-body",!0)})}w(Ve,"usecaseActorHollow");var Ct=52,Ya=42,Oa=-2,$r=w(async(n,t)=>{let s=-Ct/2,l=Oa-Ct/2;if(t.look==="handDrawn"){let a=v.svg(n).rectangle(s,l,Ct,Ct,R(t,{}));n.insert(()=>a,":first-child").attr("class","usecase-actor-icon-frame")}else n.append("rect").attr("class","usecase-actor-icon-frame").attr("x",s).attr("y",l).attr("width",Ct).attr("height",Ct).attr("rx",4).attr("ry",4);let o=t.icon??"",c=await va(o.includes(":")?o:`fa:${o}`),p=await St(o,{height:Ya,width:Ya,fallbackPrefix:"fa"}),r=n.append("g").attr("class",`usecase-actor-icon-symbol${c?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${p}</g>`),h=r.node()?.getBBox();h&&r.attr("transform",`translate(${-h.width/2-h.x},${Oa-h.height/2-h.y})`)},"drawIconActor");async function ze(n,t){return Ot(n,t,"icon",$r)}w(ze,"usecaseActorIcon");var Xa=w((n,t,s)=>{let l=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);n.attr("transform",`translate(${-t.width/2-l},${s-t.height/2-o})`)},"positionLabel");async function Ze(n,t){let s=t,{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let c=s.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:p,bbox:r,halfPadding:h,label:i}=await Y(n,c,T(t,"usecase-business-shape"));i.attr("class","label usecase-label");let{theme:a,themeVariables:e}=V();$t(p,t.colorIndex,a,e.borderColorArray);let g,y;if(s.stereotype){let D=await Mt(p,`\xAB${s.stereotype}\xBB`,{labelStyle:l,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});g=D.label.attr("class","label usecase-stereotype"),y=D.bbox}let f=y?2:0,u=r.height+(y?.height??0)+f,m=Math.max(r.width,y?.width??0),d=h??10,b=m/2+d*2,x=u/2+d*2,S=Math.min(Math.max(d/5,1),d/2),$=m/2+S,M=b-S,k=$/b,P=M/b,O=x*Math.sqrt(Math.max(0,1-k*k)),C=-x*Math.sqrt(Math.max(0,1-P*P));g&&y&&Xa(g,y,-u/2+y.height/2),Xa(i,r,u/2-r.height/2);let B;if(t.look==="handDrawn"){let E=v.svg(p).ellipse(0,0,b*2,x*2,R(t,{}));B=p.insert(()=>E,":first-child").attr("class","basic label-container usecase-business-ellipse")}else B=p.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",o).attr("rx",b).attr("ry",x).attr("cx",0).attr("cy",0);p.append("path").attr("class","usecase-business-marker").attr("d",`M ${$} ${O} L ${M} ${C}`).attr("fill","none").attr("style",o||null);let L=s.accessibleName??s.label;return L&&p.attr("role","img").attr("aria-label",L),I(t,B),t.calcIntersect=(D,E)=>N.ellipse(D,D.width/2,D.height/2,E),t.intersect=D=>N.ellipse(t,b,x,D),p}w(Ze,"usecaseBusiness");var ra=8,Ga=4,vr=1,ia=w((n,t,s,l)=>{let o=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);n.attr("transform",`translate(${s-t.width/2-o},${l-t.height/2-c})`)},"positionLabel"),kr=w(n=>{let t=Number.parseFloat(n??"");return Number.isFinite(t)&&t>=0?t:vr},"numericStrokeWidth");async function Ue(n,t){let s=t,{labelStyles:l,nodeStyles:o}=H(t),{stylesMap:c}=Dt(t);t.labelStyle=l;let{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t,"usecase-json-table"));p.attr("role","img"),s.accessibleName&&p.attr("aria-label",s.accessibleName),h.attr("class","label usecase-json-title");let i=p.append("g").attr("class","usecase-json-table-grid"),a=[];for(let D of s.jsonRows??[]){let E=await Mt(i,D.key,{labelStyle:l,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),W=await Mt(i,D.value,{labelStyle:l,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});a.push({key:{label:E.label.attr("class","label usecase-json-key"),bbox:E.bbox},value:{label:W.label.attr("class","label usecase-json-value"),bbox:W.bbox}})}let e=Math.max(0,...a.map(({key:D})=>D.bbox.width))+ra*2,g=Math.max(0,...a.map(({value:D})=>D.bbox.width))+ra*2,y=r.width+ra*2,f=Math.max(y,e+g),u=g+Math.max(0,f-e-g),m=r.height+Ga*2,d=a.map(({key:D,value:E})=>Math.max(D.bbox.height,E.bbox.height)+Ga*2),b=m+d.reduce((D,E)=>D+E,0),x=kr(c.get("stroke-width")),S=f+x*2,$=b+x*2,M=-f/2,k=-b/2,P=t.look==="handDrawn"?v.svg(p):void 0,O=P?R(t,{}):void 0,C=w((D,E,W,A,_,X)=>{if(P&&O){let j=P.rectangle(W,A,_,X,O);return D.insert(()=>j,":first-child").attr("class",E)}return D.insert("rect",":first-child").attr("class",E).attr("x",W).attr("y",A).attr("width",_).attr("height",X).attr("style",o)},"insertCell"),B=C(p,"label-container usecase-json-border",-S/2,-$/2,S,$);C(i,"usecase-json-cell usecase-json-title-cell",M,k,f,m),i.node()?.append(h.node()),ia(h,r,0,k+m/2);let L=k+m;return a.forEach(({key:D,value:E},W)=>{let A=d[W],_=i.append("g").attr("class","usecase-json-row").attr("data-row-index",W).attr("transform",`translate(0,${L})`);C(_,"usecase-json-cell usecase-json-key-cell",M,0,e,A),C(_,"usecase-json-cell usecase-json-value-cell",M+e,0,u,A),_.node()?.append(D.label.node(),E.label.node()),ia(D.label,D.bbox,M+e/2,A/2),ia(E.label,E.bbox,M+e+u/2,A/2),L+=A}),I(t,B),t.intersect=D=>N.rect(t,D),p}w(Ue,"usecaseJsonTable");async function Je(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-c*2-2*r,10),t.height=Math.max((t?.height??0)-p*2-2*r,10));let{shapeSvg:h,bbox:i,label:a}=await Y(n,t,T(t)),e=(t?.width?t?.width:i.width)+c*2+2*r,g=(t?.height?t?.height:i.height)+p*2+2*r,y=e-2*r,f=g-2*r,u=-y/2,m=-f/2,{cssStyles:d}=t,b=v.svg(h),x=R(t,{}),S=[{x:u-r,y:m+r},{x:u-r,y:m+f+r},{x:u+y-r,y:m+f+r},{x:u+y-r,y:m+f},{x:u+y,y:m+f},{x:u+y,y:m+f-r},{x:u+y+r,y:m+f-r},{x:u+y+r,y:m-r},{x:u+r,y:m-r},{x:u+r,y:m},{x:u,y:m},{x:u,y:m+r}],$=[{x:u,y:m+r},{x:u+y-r,y:m+r},{x:u+y-r,y:m+f},{x:u+y,y:m+f},{x:u+y,y:m},{x:u,y:m}];t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let M=F(S),k=b.path(M,x),P=F($),O=b.path(P,x);t.look!=="handDrawn"&&(k=la(k),O=la(O));let C=h.insert("g",":first-child");return C.insert(()=>k),C.insert(()=>O),C.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",l),a.attr("transform",`translate(${-(i.width/2)-r-(i.x-(i.left??0))}, ${-(i.height/2)+r-(i.y-(i.top??0))})`),I(t,C),t.intersect=function(B){return N.polygon(t,S,B)},h}w(Je,"multiRect");async function Ke(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=t.padding??0,h=t.look==="neo"?16:r,i=t.look==="neo"?12:r,a=!0;(t.width||t.height)&&(a=!1,t.width=(t?.width??0)-h*2,t.height=(t?.height??0)-i*3);let e=Math.max(c.width,t?.width??0)+h*2,g=Math.max(c.height,t?.height??0)+i*3,y=t.look==="neo"?g/4:g/8,f=g+(a?y/2:-y/2),u=-e/2,m=-f/2,d=10,{cssStyles:b}=t,x=dt(u-d,m+f+d,u+e-d,m+f+d,y,.8),S=x?.[x.length-1],$=[{x:u-d,y:m+d},{x:u-d,y:m+f+d},...x,{x:u+e-d,y:S.y-d},{x:u+e,y:S.y-d},{x:u+e,y:S.y-2*d},{x:u+e+d,y:S.y-2*d},{x:u+e+d,y:m-d},{x:u+d,y:m-d},{x:u+d,y:m},{x:u,y:m},{x:u,y:m+d}],M=[{x:u,y:m+d},{x:u+e-d,y:m+d},{x:u+e-d,y:S.y-d},{x:u+e,y:S.y-d},{x:u+e,y:m},{x:u,y:m}],k=v.svg(o),P=R(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let O=F($),C=k.path(O,P),B=F(M),L=k.path(B,P),D=o.insert(()=>C,":first-child");return D.insert(()=>L),D.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(0,${-y/2})`),p.attr("transform",`translate(${-(c.width/2)-d-(c.x-(c.left??0))}, ${-(c.height/2)+d-y-(c.y-(c.top??0))})`),I(t,D),t.intersect=function(E){return N.polygon(t,$,E)},o}w(Ke,"multiWaveEdgedRectangle");async function Qe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l,t.useHtmlLabels||wt(Pt())||(t.centerLabel=!0);let{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t)),i=Math.max(r.width+(t.padding??0)*2,t?.width??0),a=Math.max(r.height+(t.padding??0)*2,t?.height??0),e=-i/2,g=-a/2,{cssStyles:y}=t,f=v.svg(p),u=R(t,{fill:s.noteBkgColor,stroke:s.noteBorderColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=f.rectangle(e,g,i,a,u),d=p.insert(()=>m,":first-child");return d.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),y&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",y),o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),h.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,d),t.intersect=function(b){return N.rect(t,b)},p}w(Qe,"note");var Mr=w((n,t,s)=>[`M${n+s/2},${t}`,`L${n+s},${t-s/2}`,`L${n+s/2},${t-s}`,`L${n},${t-s/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function ts(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c}=await Y(n,t,T(t)),p=c.width+(t.padding??0),r=c.height+(t.padding??0),h=p+r,i=.5,a=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}],e,{cssStyles:g}=t;if(t.look==="handDrawn"){let y=v.svg(o),f=R(t,{}),u=Mr(0,0,h),m=y.path(u,f);e=o.insert(()=>m,":first-child").attr("transform",`translate(${-h/2+i}, ${h/2})`),g&&e.attr("style",g)}else e=ct(o,h,h,a),e.attr("transform",`translate(${-h/2+i}, ${h/2})`);return l&&e.attr("style",l),I(t,e),t.calcIntersect=function(y,f){let u=y.width,m=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}];return N.polygon(y,m,f)},t.intersect=function(y){return this.calcIntersect(t,y)},o}w(ts,"question");async function as(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?21:o??0,p=t.look==="neo"?12:o??0,{shapeSvg:r,bbox:h,label:i}=await Y(n,t,T(t)),a=h.width+(t.look==="neo"?c*2:c),e=Math.max(h.height+(t.look==="neo"?p*2:p),t.height??0),g=e/4,f=-Math.max(a,(t.width??0)-g)/2,u=-e/2,m=u/2,d=[{x:f+m,y:u},{x:f,y:0},{x:f+m,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:b}=t,x=v.svg(r),S=R(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let $=F(d),M=x.path($,S),k=r.insert(()=>M,":first-child");return k.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",b),l&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${-m/2},0)`),i.attr("transform",`translate(${-m/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),I(t,k),t.intersect=function(P){return N.polygon(t,d,P)},r}w(as,"rect_left_inv_arrow");async function es(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";let c=n.insert("g").attr("class",o).attr("id",t.domId||t.id),p=c.insert("g"),r=c.insert("g").attr("class","label").attr("style",l),h=t.description,i=t.label,a=await Da(r,i,t.labelStyle,!0,!0),e={width:0,height:0};if(wt(V())){let P=a.children[0],O=Z(a);e=P.getBoundingClientRect(),O.attr("width",e.width),O.attr("height",e.height)}J.info("Text 2",h);let g=h||[],y=a.getBBox(),f=await Da(r,Array.isArray(g)?g.join("<br/>"):g,t.labelStyle,!0,!0),u=f.children[0],m=Z(f);e=u.getBoundingClientRect(),m.attr("width",e.width),m.attr("height",e.height);let d=(t.padding||0)/2;Z(f).attr("transform","translate( "+(e.width>y.width?0:(y.width-e.width)/2)+", "+(y.height+d+5)+")"),Z(a).attr("transform","translate( "+(e.width<y.width?0:-(y.width-e.width)/2)+", 0)"),e=r.node().getBBox(),r.attr("transform","translate("+-e.width/2+", "+(-e.height/2-d+3)+")");let b=e.width+(t.padding||0),x=e.height+(t.padding||0),S=-e.width/2-d,$=-e.height/2-d,M,k;if(t.look==="handDrawn"){let P=v.svg(c),O=R(t,{}),C=P.path(yt(S,$,b,x,t.rx||0),O),B=P.line(-e.width/2-d,-e.height/2-d+y.height+d,e.width/2+d,-e.height/2-d+y.height+d,O);k=c.insert(()=>(J.debug("Rough node insert CXC",C),B),":first-child"),M=c.insert(()=>(J.debug("Rough node insert CXC",C),C),":first-child")}else M=p.insert("rect",":first-child"),k=p.insert("line"),M.attr("class","outer title-state").attr("style",l).attr("x",-e.width/2-d).attr("y",-e.height/2-d).attr("width",e.width+(t.padding||0)).attr("height",e.height+(t.padding||0)),k.attr("class","divider").attr("x1",-e.width/2-d).attr("x2",e.width/2+d).attr("y1",-e.height/2-d+y.height+d).attr("y2",-e.height/2-d+y.height+d);return I(t,M),t.intersect=function(P){return N.rect(t,P)},c}w(es,"rectWithTitle");async function ss(n,t,{config:{themeVariables:s}}){let l=s?.radius??5,o={rx:l,ry:l,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Et(n,t,o)}w(ss,"roundedRect");var vt=8;async function rs(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.look==="neo"?16:t.padding??0,c=t.look==="neo"?12:t.padding??0,{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t)),i=(t?.width??r.width)+o*2+(t.look==="neo"?vt:vt*2),a=(t?.height??r.height)+c*2,e=i-vt,g=a,y=vt-i/2,f=-a/2,{cssStyles:u}=t,m=v.svg(p),d=R(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let b=[{x:y,y:f},{x:y+e,y:f},{x:y+e,y:f+g},{x:y-vt,y:f+g},{x:y-vt,y:f},{x:y,y:f},{x:y,y:f+g}],x=m.polygon(b.map($=>[$.x,$.y]),d),S=p.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Q(u)),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),u&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),h.attr("transform",`translate(${vt/2-r.width/2-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,S),t.intersect=function($){return N.rect(t,$)},p}w(rs,"shadedProcess");async function is(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-c*2,10),t.height=Math.max((t?.height??0)/1.5-p*2,10));let{shapeSvg:r,bbox:h,label:i}=await Y(n,t,T(t)),a=(t?.width?t?.width:h.width)+c*2,e=((t?.height?t?.height:h.height)+p*2)*1.5,g=a,y=e/1.5,f=-g/2,u=-y/2,{cssStyles:m}=t,d=v.svg(r),b=R(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");let x=[{x:f,y:u},{x:f,y:u+y},{x:f+g,y:u+y},{x:f+g,y:u-y/2}],S=F(x),$=d.path(S,b),M=r.insert(()=>$,":first-child");return M.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(0, ${y/4})`),i.attr("transform",`translate(${-g/2+(t.padding??0)-(h.x-(h.left??0))}, ${-y/4+(t.padding??0)-(h.y-(h.top??0))})`),I(t,M),t.intersect=function(k){return N.polygon(t,x,k)},r}w(is,"slopedRect");async function ns(n,t){let s=t.padding??0,l=t.look==="neo"?16:s*2,o=t.look==="neo"?12:s,c={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??l,labelPaddingY:o},p=await Et(n,t,c);if(t.colorIndex!==void 0){let{theme:r,themeVariables:h}=V();$t(p,t.colorIndex,r,h.borderColorArray)}return p}w(ns,"squareRect");var ha=50,Pr=w((n,t,s)=>{let l=n.height+s,o=l*Math.cos(Math.PI/(2*(ha-1))),c=Math.sqrt(Math.max(0,o**2-n.height**2));return{w:Math.max(n.width+l/4+t,1.5*l+(l-o),n.width+t+l-c),h:l}},"stadiumDimensions");async function ls(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?40:o,p=t.look==="neo"?24:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),{w:i,h:a}=Pr(h,c,p),e=a/2,{cssStyles:g}=t,y=v.svg(r),f=R(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let u=[{x:-i/2+e,y:-a/2},{x:i/2-e,y:-a/2},...lt(-i/2+e,0,e,ha,90,270),{x:i/2-e,y:a/2},...lt(i/2-e,0,e,ha,270,450)],m=F(u),d=y.path(m,f),b=r.insert(()=>d,":first-child");return b.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),l&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",l),I(t,b),t.intersect=function(x){return N.polygon(t,u,x)},r}w(ls,"stadium");async function cs(n,t){let s={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return Et(n,t,s)}w(cs,"state");function os(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{cssStyles:c}=t,{lineColor:p,stateBorder:r,nodeBorder:h,nodeShadow:i}=s;(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);let a=n.insert("g").attr("class","node default").attr("id",t.domId??t.id),e=v.svg(a),g=R(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=e.circle(0,0,t.width,{...g,stroke:p,strokeWidth:2}),f=r??h,u=(t.width??0)*5/14,m=e.circle(0,0,u,{...g,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),d=a.insert(()=>y,":first-child");if(d.insert(()=>m),t.look!=="handDrawn"&&d.attr("class","outer-path"),c&&d.selectAll("path").attr("style",c),o&&d.selectAll("path").attr("style",o),t.width<25&&i&&t.look!=="handDrawn"){let b=n.node()?.ownerSVGElement?.id??"",x=b?`${b}-drop-shadow-small`:"drop-shadow-small";d.attr("style",`filter:url(#${x})`)}return I(t,d),t.intersect=function(b){return N.circle(t,(t.width??0)/2,b)},a}w(os,"stateEnd");function hs(n,t,{config:{themeVariables:s}}){let{lineColor:l,nodeShadow:o}=s;(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);let c=n.insert("g").attr("class","node default").attr("id",t.domId||t.id),p;if(t.look==="handDrawn"){let h=v.svg(c).circle(0,0,t.width,wa(l));p=c.insert(()=>h),p.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else p=c.insert("circle",":first-child"),p.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"){let r=n.node()?.ownerSVGElement?.id??"",h=r?`${r}-drop-shadow-small`:"drop-shadow-small";p.attr("style",`filter:url(#${h})`)}return I(t,p),t.intersect=function(r){return N.circle(t,(t.width??7)/2,r)},c}w(hs,"stateStart");var Nt=8;async function gs(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t?.padding??8,c=t.look==="neo"?28:o,p=t.look==="neo"?12:o,{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=Math.max(h.width+2*Nt+c,t.width??0),a=Math.max(h.height+p,t.height??0),e=i-2*Nt,g=a,y=-i/2,f=-a/2,u=[{x:0,y:0},{x:e,y:0},{x:e,y:-g},{x:0,y:-g},{x:0,y:0},{x:-8,y:0},{x:e+8,y:0},{x:e+8,y:-g},{x:-8,y:-g},{x:-8,y:0}];if(t.look==="handDrawn"){let m=v.svg(r),d=R(t,{}),b=m.rectangle(y,f,e+16,g,d),x=m.line(y+Nt,f,y+Nt,f+g,d),S=m.line(y+Nt+e,f,y+Nt+e,f+g,d);r.insert(()=>x,":first-child"),r.insert(()=>S,":first-child");let $=r.insert(()=>b,":first-child"),{cssStyles:M}=t;$.attr("class","basic label-container").attr("style",Q(M)),I(t,$)}else{let m=ct(r,e,g,u);l&&m.attr("style",l),I(t,m)}return t.intersect=function(m){return N.polygon(t,u,m)},r}w(gs,"subroutine");var na=.2;async function ys(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-p*2,10),t.width=Math.max((t?.width??0)-c*2-na*(t.height+p*2),10));let{shapeSvg:r,bbox:h}=await Y(n,t,T(t)),i=(t?.height?t?.height:h.height)+p*2,a=na*i,e=na*i,y=(t?.width?t?.width:h.width)+c*2+a-a,f=i,u=-y/2,m=-f/2,{cssStyles:d}=t,b=v.svg(r),x=R(t,{}),S=[{x:u-a/2,y:m},{x:u+y+a/2,y:m},{x:u+y+a/2,y:m+f},{x:u-a/2,y:m+f}],$=[{x:u+y-a/2,y:m+f},{x:u+y+a/2,y:m+f},{x:u+y+a/2,y:m+f-e}];t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let M=F(S),k=b.path(M,x),P=F($),O=b.path(P,{...x,fillStyle:"solid"}),C=r.insert(()=>O,":first-child");return C.insert(()=>k,":first-child"),C.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",l),I(t,C),t.intersect=function(B){return N.polygon(t,S,B)},r}w(ys,"taggedRect");async function ps(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t)),r=Math.max(c.width+(t.padding??0)*2,t?.width??0),h=Math.max(c.height+(t.padding??0)*2,t?.height??0),i=h/8,a=.2*r,e=.2*h,g=h+i,{cssStyles:y}=t,f=v.svg(o),u=R(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-r/2-r/2*.1,y:g/2},...dt(-r/2-r/2*.1,g/2,r/2+r/2*.1,g/2,i,.8),{x:r/2+r/2*.1,y:-g/2},{x:-r/2-r/2*.1,y:-g/2}],d=-r/2+r/2*.1,b=-g/2-e*.4,x=[{x:d+r-a,y:(b+h)*1.3},{x:d+r,y:b+h-e},{x:d+r,y:(b+h)*.9},...dt(d+r,(b+h)*1.25,d+r-a,(b+h)*1.3,-h*.02,.5)],S=F(m),$=f.path(S,u),M=F(x),k=f.path(M,{...u,fillStyle:"solid"}),P=o.insert(()=>k,":first-child");return P.insert(()=>$,":first-child"),P.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",y),l&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(0,${-i/2})`),p.attr("transform",`translate(${-r/2+(t.padding??0)-(c.x-(c.left??0))},${-h/2+(t.padding??0)-i/2-(c.y-(c.top??0))})`),I(t,P),t.intersect=function(O){return N.polygon(t,m,O)},o}w(ps,"taggedWaveEdgedRectangle");async function fs(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c}=await Y(n,t,T(t)),p=Math.max(c.width+(t.padding??0),t?.width||0),r=Math.max(c.height+(t.padding??0),t?.height||0),h=-p/2,i=-r/2,a=o.insert("rect",":first-child");return a.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",h).attr("y",i).attr("width",p).attr("height",r),I(t,a),t.intersect=function(e){return N.rect(t,e)},o}w(fs,"text");var Dr=w((n,t,s,l,o,c)=>`M${n},${t}
3
3
  a${o},${c} 0,0,1 0,${-l}
4
4
  l${s},0
@@ -59,4 +59,4 @@ import{a as v}from"./chunk-4QDE4SUK.js";import{a as wa,b as Dt,d as H,e as R}fro
59
59
  h${-(h-2*a)}
60
60
  q${-a},0 ${-a},${-a}
61
61
  Z
62
- `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let g=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",l).attr("d",e);return o.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",i/2).attr("x2",h/2).attr("y2",i/2),r.attr("transform",`translate(${-c.width/2}, ${-c.height/2})`),o.append(()=>r.node()),I(t,g),t.calcIntersect=function(y,f){return N.rect(y,f)},t.intersect=function(y){return N.rect(t,y)},o}w(Bs,"defaultMindmapNode");async function Cs(n,t){let s={padding:t.padding??0};return fa(n,t,s)}w(Cs,"mindmapCircle");var At=36,kt=50,Hr=100,Ir=80,mt=6,Lt=16,Rr="bpmn",Lr={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},Za;async function Ns(){return Za??=import("./bpmnIcons-APHXDYXF-TWOSQNUQ.js").then(({bpmnIcons:n})=>{$a(n.prefix)||Sa([{name:n.prefix,icons:n}])}),Za}w(Ns,"ensureBpmnIcons");function As(n){let t=n.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}w(As,"dataDirectionOf");function Hs(n){return n.metadata?.isCollection===!0}w(Hs,"isCollectionData");async function zt(n,t){return await Ns(),St(n,{height:t,width:t,fallbackPrefix:Rr})}w(zt,"glyphSvg");var Xt=w((n,t,s)=>{let l=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);n.attr("transform",`translate(${-t.width/2-l},${s-t.height/2-o})`)},"positionLabelBelow"),Is=w(async(n,t,s)=>{if(!t)return;let l=n.append("g").attr("class","bpmn-glyph");l.html(`<g>${await zt(t,s)}</g>`),l.attr("transform",`translate(${-s/2}, ${-s/2})`)},"appendGlyph"),Gt=w((n,t,s,l,o)=>{o&&(t.metadata={...t.metadata??{},drawnExtent:o});let c=n.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-s/2).attr("y",-l/2).attr("width",s).attr("height",l).attr("opacity",0).attr("aria-hidden","true");return I(t,c),c},"reserveBounds"),Er=8,Zt=w((n,t,s)=>Math.min(Math.max(n,t),s),"clamp"),Ut=w((n,t,s,l,o)=>{let c=n.x??0,p=n.y??0,r=t/2,h=s/2,i=l.x-c,a=l.y-p,e=o??(Math.abs(i)*h>Math.abs(a)*r?i>=0?"right":"left":a>=0?"bottom":"top"),g=w(y=>Math.max(0,y-Math.min(Er,y/2)),"reach");return e==="left"||e==="right"?{x:c+(e==="right"?r:-r),y:Zt(l.y,p-g(h),p+g(h))}:{x:Zt(l.x,c-g(r),c+g(r)),y:p+(e==="bottom"?h:-h)}},"faceProjectIntersect"),Wr=w((n,t,s)=>{let l=n.x??0,o=n.y??0,c=t/2,p=s.x-l,r=s.y-o,h=c*.85;if(Math.abs(r)>=Math.abs(p)){let a=Zt(p,-h,h);return{x:l+a,y:o+Math.sign(r||1)*Math.sqrt(c*c-a*a)}}let i=Zt(r,-h,h);return{x:l+Math.sign(p||1)*Math.sqrt(c*c-i*i),y:o+i}},"ringIntersect"),Tr=w((n,t,s,l)=>{let o=n.x??0,c=n.y??0,p=t/2,r=s/2,h=l.x-o,i=l.y-c;return Math.abs(h)*r>Math.abs(i)*p?{x:o+Math.sign(h)*p,y:c}:{x:o,y:c+Math.sign(i||1)*r}},"faceCentreIntersect");async function jt(n,t,s){let l=t,{labelStyles:o,nodeStyles:c}=H(t);t.labelStyle=o;let{rings:p,strokeWidth:r}=Lr[s],h=At/2,{shapeSvg:i,bbox:a,label:e}=await Y(n,t,T(t,`bpmn-event bpmn-event-${s}`)),g=i.insert("g",":first-child").attr("class","bpmn-event-body");g.attr("style",c);for(let d=0;d<p;d++)g.append("circle").attr("class",d===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",h-d*3).style("stroke-width",`${r}px`);await Is(g,l.icon,Lt);let y=a.height>0&&!!t.label,f=y?mt+a.height:0,u=At+2*f,m=Math.max(At,y?a.width:0);return y&&Xt(e,a,h+mt+a.height/2),Gt(i,t,m,u,{width:At,height:At}),t.intersect=function(d){return Wr(t,At,d)},i}w(jt,"renderBpmnEvent");async function Rs(n,t){return jt(n,t,"start")}w(Rs,"bpmnStart");async function Ls(n,t){return jt(n,t,"intermediate")}w(Ls,"bpmnIntermediate");async function Es(n,t){return jt(n,t,"boundary")}w(Es,"bpmnBoundary");async function Ws(n,t){return jt(n,t,"end")}w(Ws,"bpmnEnd");async function Ts(n,t){let s=t,{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let c=kt/2,{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t,"bpmn-gateway")),i=p.insert("g",":first-child").attr("class","bpmn-gateway-body");i.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-c} ${c},0 0,${c} ${-c},0`).attr("style",o),await Is(i,s.icon,Lt+2);let a=r.height>0&&!!t.label,e=a?mt+r.height:0,g=kt+2*e,y=Math.max(kt,a?r.width:0);return a&&Xt(h,r,c+mt+r.height/2),Gt(p,t,y,g,{width:kt,height:kt}),t.intersect=function(f){return Tr(t,kt,kt,f)},p}w(Ts,"bpmnGateway");async function _s(n,t){let s=t,{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t,"bpmn-activity")),h=s.markers??[],i=s.icon,a=i?Lt+6:10,e=h.length>0?Lt+4:10,g=Math.max(Hr,p.width+16),y=Math.max(Ir,p.height+a+e),f=c.insert("g",":first-child").attr("class","bpmn-activity-body");if(f.append("rect").attr("class","bpmn-activity-rect").attr("x",-g/2).attr("y",-y/2).attr("width",g).attr("height",y).attr("rx",10).attr("ry",10).attr("style",o),i){let u=f.append("g").attr("class","bpmn-activity-icon");u.html(`<g>${await zt(i,Lt)}</g>`),u.attr("transform",`translate(${-g/2+6}, ${-y/2+6})`)}if(h.length>0){let u=f.append("g").attr("class","bpmn-activity-markers"),m=Lt-2,d=h.length*m;for(let[b,x]of h.entries()){let S=u.append("g");S.html(`<g>${await zt(x,m)}</g>`),S.attr("transform",`translate(${-d/2+b*m}, 0)`)}u.attr("transform",`translate(0, ${y/2-m-3})`)}if(p.height>0){let u=-y/2+a,m=y/2-e;Xt(r,p,(u+m)/2)}return I(t,f),t.intersect=function(u){return Ut(t,g,y,u)},c}w(_s,"bpmnActivity");var _t=36,Ht=50,Vt=10;async function Ys(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t,"bpmn-data-object")),r=o.insert("g",":first-child").attr("class","bpmn-data-body"),h=-_t/2,i=-Ht/2,a=_t/2,e=Ht/2;r.append("path").attr("class","bpmn-data-page").attr("d",`M${h},${i} H${a-Vt} L${a},${i+Vt} V${e} H${h} Z`).attr("style",l),r.append("path").attr("class","bpmn-data-fold").attr("d",`M${a-Vt},${i} V${i+Vt} H${a}`);let g=As(t);g&&r.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${g}`).attr("d",`M${h+4},${i+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),Hs(t)&&r.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${e-11} v9 M0,${e-11} v9 M4,${e-11} v9`);let y=c.height>0&&!!t.label,f=y?mt+c.height:0,u=Ht+2*f,m=Math.max(_t,y?c.width:0);return y&&Xt(p,c,Ht/2+mt+c.height/2),Gt(o,t,m,u,{width:_t,height:Ht}),t.intersect=function(d){return Ut(t,_t,Ht,d)},o}w(Ys,"bpmnDataObject");var it=50;async function Os(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t,"bpmn-data-store")),r=o.insert("g",":first-child").attr("class","bpmn-data-body"),h=it/2,i=6;r.append("path").attr("class","bpmn-store-body").attr("d",`M${-h},${-h+i} a${h},${i} 0 0 1 ${it},0 V${h-i} a${h},${i} 0 0 1 ${-it},0 Z`).attr("style",l);for(let f of[0,5,10])r.append("path").attr("class","bpmn-store-rings").attr("d",`M${-h},${-h+i+f} a${h},${i} 0 0 0 ${it},0`);let a=c.height>0&&!!t.label,e=a?mt+c.height:0,g=it+2*e,y=Math.max(it,a?c.width:0);return a&&Xt(p,c,h+mt+c.height/2),Gt(o,t,y,g,{width:it,height:it}),t.intersect=function(f){return Ut(t,it,it,f)},o}w(Os,"bpmnDataStore");async function Xs(n,t){let{labelStyles:s}=H(t);t.labelStyle=s,t.wrappingWidth=160;let{shapeSvg:l,bbox:o,label:c}=await Y(n,t,T(t,"bpmn-annotation")),p=8,r=Math.max(28,o.height+p*2),h=o.width+p*2+6,i=t.metadata?.attachFace==="right"?"right":"left";l.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",i==="right"?`M${h/2-6},${-r/2} h6 V${r/2} h-6`:`M${-h/2+6},${-r/2} h-6 V${r/2} h6`);let e=i==="right"?-h/2+p:-h/2+p+6;return c.attr("transform",`translate(${e-(o.x??0)+(o.left??0)},${-o.height/2-((o.y??0)-(o.top??0))})`),Gt(l,t,h,r),t.intersect=function(g){return Ut(t,h,r,g,i)},l}w(Xs,"bpmnAnnotation");var _r=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ns},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ss},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:ls},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:gs},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Se},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:$e},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Be},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:ie},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:pe},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:oe},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:we},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:fa},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ps},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ds},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ts},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ae},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Oe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ye},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:ds},{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:Te},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:ke},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:fs},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:he},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:rs},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:hs},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:os},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Ce},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:He},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:de},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:me},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:be},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Xe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:xs},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Ne},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:us},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ge},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:xe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ve},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:bs},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ss},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Pe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:ms},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:De},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:is},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Ke},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Je},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:re},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:ue},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:ps},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ys},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:ws},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:as},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:je}],Yr=w(()=>{let t=[...Object.entries({state:cs,choice:ge,note:Qe,composite:ye,rectWithTitle:es,labelRect:_e,block_arrow:ce,collapsedGroup:le,iconSquare:Ee,iconCircle:Re,icon:Ie,iconRounded:Le,imageSquare:We,anchor:ee,kanbanItem:Ms,mindmapCircle:Cs,defaultMindmapNode:Bs,classBox:vs,erBox:da,requirementBox:ks,usecaseActor:Fe,usecaseActorHollow:Ve,usecaseActorAwesome:qe,usecaseActorIcon:ze,usecaseBusiness:Ze,usecaseEllipse:Me,usecaseJsonTable:Ue,"bpmn-start":Rs,"bpmn-intermediate":Ls,"bpmn-boundary":Es,"bpmn-end":Ws,"bpmn-gateway":Ts,"bpmn-activity":_s,"bpmn-data":Ys,"bpmn-data-store":Os,"bpmn-annotation":Xs}),..._r.flatMap(s=>[s.shortName,..."aliases"in s?s.aliases:[],..."internalAliases"in s?s.internalAliases:[]].map(o=>[o,s.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Or=Yr();function Xr(n){return n in Or}w(Xr,"isValidShape");export{Y as a,I as b,zs as c,N as d,yt as e,Da as f,Or as g,Xr as h};
62
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let g=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",l).attr("d",e);return o.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",i/2).attr("x2",h/2).attr("y2",i/2),r.attr("transform",`translate(${-c.width/2}, ${-c.height/2})`),o.append(()=>r.node()),I(t,g),t.calcIntersect=function(y,f){return N.rect(y,f)},t.intersect=function(y){return N.rect(t,y)},o}w(Bs,"defaultMindmapNode");async function Cs(n,t){let s={padding:t.padding??0};return fa(n,t,s)}w(Cs,"mindmapCircle");var At=36,kt=50,Hr=100,Ir=80,mt=6,Lt=16,Rr="bpmn",Lr={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},Za;async function Ns(){return Za??=import("./bpmnIcons-APHXDYXF-EAVPNTFE.js").then(({bpmnIcons:n})=>{$a(n.prefix)||Sa([{name:n.prefix,icons:n}])}),Za}w(Ns,"ensureBpmnIcons");function As(n){let t=n.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}w(As,"dataDirectionOf");function Hs(n){return n.metadata?.isCollection===!0}w(Hs,"isCollectionData");async function zt(n,t){return await Ns(),St(n,{height:t,width:t,fallbackPrefix:Rr})}w(zt,"glyphSvg");var Xt=w((n,t,s)=>{let l=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);n.attr("transform",`translate(${-t.width/2-l},${s-t.height/2-o})`)},"positionLabelBelow"),Is=w(async(n,t,s)=>{if(!t)return;let l=n.append("g").attr("class","bpmn-glyph");l.html(`<g>${await zt(t,s)}</g>`),l.attr("transform",`translate(${-s/2}, ${-s/2})`)},"appendGlyph"),Gt=w((n,t,s,l,o)=>{o&&(t.metadata={...t.metadata??{},drawnExtent:o});let c=n.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-s/2).attr("y",-l/2).attr("width",s).attr("height",l).attr("opacity",0).attr("aria-hidden","true");return I(t,c),c},"reserveBounds"),Er=8,Zt=w((n,t,s)=>Math.min(Math.max(n,t),s),"clamp"),Ut=w((n,t,s,l,o)=>{let c=n.x??0,p=n.y??0,r=t/2,h=s/2,i=l.x-c,a=l.y-p,e=o??(Math.abs(i)*h>Math.abs(a)*r?i>=0?"right":"left":a>=0?"bottom":"top"),g=w(y=>Math.max(0,y-Math.min(Er,y/2)),"reach");return e==="left"||e==="right"?{x:c+(e==="right"?r:-r),y:Zt(l.y,p-g(h),p+g(h))}:{x:Zt(l.x,c-g(r),c+g(r)),y:p+(e==="bottom"?h:-h)}},"faceProjectIntersect"),Wr=w((n,t,s)=>{let l=n.x??0,o=n.y??0,c=t/2,p=s.x-l,r=s.y-o,h=c*.85;if(Math.abs(r)>=Math.abs(p)){let a=Zt(p,-h,h);return{x:l+a,y:o+Math.sign(r||1)*Math.sqrt(c*c-a*a)}}let i=Zt(r,-h,h);return{x:l+Math.sign(p||1)*Math.sqrt(c*c-i*i),y:o+i}},"ringIntersect"),Tr=w((n,t,s,l)=>{let o=n.x??0,c=n.y??0,p=t/2,r=s/2,h=l.x-o,i=l.y-c;return Math.abs(h)*r>Math.abs(i)*p?{x:o+Math.sign(h)*p,y:c}:{x:o,y:c+Math.sign(i||1)*r}},"faceCentreIntersect");async function jt(n,t,s){let l=t,{labelStyles:o,nodeStyles:c}=H(t);t.labelStyle=o;let{rings:p,strokeWidth:r}=Lr[s],h=At/2,{shapeSvg:i,bbox:a,label:e}=await Y(n,t,T(t,`bpmn-event bpmn-event-${s}`)),g=i.insert("g",":first-child").attr("class","bpmn-event-body");g.attr("style",c);for(let d=0;d<p;d++)g.append("circle").attr("class",d===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",h-d*3).style("stroke-width",`${r}px`);await Is(g,l.icon,Lt);let y=a.height>0&&!!t.label,f=y?mt+a.height:0,u=At+2*f,m=Math.max(At,y?a.width:0);return y&&Xt(e,a,h+mt+a.height/2),Gt(i,t,m,u,{width:At,height:At}),t.intersect=function(d){return Wr(t,At,d)},i}w(jt,"renderBpmnEvent");async function Rs(n,t){return jt(n,t,"start")}w(Rs,"bpmnStart");async function Ls(n,t){return jt(n,t,"intermediate")}w(Ls,"bpmnIntermediate");async function Es(n,t){return jt(n,t,"boundary")}w(Es,"bpmnBoundary");async function Ws(n,t){return jt(n,t,"end")}w(Ws,"bpmnEnd");async function Ts(n,t){let s=t,{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let c=kt/2,{shapeSvg:p,bbox:r,label:h}=await Y(n,t,T(t,"bpmn-gateway")),i=p.insert("g",":first-child").attr("class","bpmn-gateway-body");i.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-c} ${c},0 0,${c} ${-c},0`).attr("style",o),await Is(i,s.icon,Lt+2);let a=r.height>0&&!!t.label,e=a?mt+r.height:0,g=kt+2*e,y=Math.max(kt,a?r.width:0);return a&&Xt(h,r,c+mt+r.height/2),Gt(p,t,y,g,{width:kt,height:kt}),t.intersect=function(f){return Tr(t,kt,kt,f)},p}w(Ts,"bpmnGateway");async function _s(n,t){let s=t,{labelStyles:l,nodeStyles:o}=H(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await Y(n,t,T(t,"bpmn-activity")),h=s.markers??[],i=s.icon,a=i?Lt+6:10,e=h.length>0?Lt+4:10,g=Math.max(Hr,p.width+16),y=Math.max(Ir,p.height+a+e),f=c.insert("g",":first-child").attr("class","bpmn-activity-body");if(f.append("rect").attr("class","bpmn-activity-rect").attr("x",-g/2).attr("y",-y/2).attr("width",g).attr("height",y).attr("rx",10).attr("ry",10).attr("style",o),i){let u=f.append("g").attr("class","bpmn-activity-icon");u.html(`<g>${await zt(i,Lt)}</g>`),u.attr("transform",`translate(${-g/2+6}, ${-y/2+6})`)}if(h.length>0){let u=f.append("g").attr("class","bpmn-activity-markers"),m=Lt-2,d=h.length*m;for(let[b,x]of h.entries()){let S=u.append("g");S.html(`<g>${await zt(x,m)}</g>`),S.attr("transform",`translate(${-d/2+b*m}, 0)`)}u.attr("transform",`translate(0, ${y/2-m-3})`)}if(p.height>0){let u=-y/2+a,m=y/2-e;Xt(r,p,(u+m)/2)}return I(t,f),t.intersect=function(u){return Ut(t,g,y,u)},c}w(_s,"bpmnActivity");var _t=36,Ht=50,Vt=10;async function Ys(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t,"bpmn-data-object")),r=o.insert("g",":first-child").attr("class","bpmn-data-body"),h=-_t/2,i=-Ht/2,a=_t/2,e=Ht/2;r.append("path").attr("class","bpmn-data-page").attr("d",`M${h},${i} H${a-Vt} L${a},${i+Vt} V${e} H${h} Z`).attr("style",l),r.append("path").attr("class","bpmn-data-fold").attr("d",`M${a-Vt},${i} V${i+Vt} H${a}`);let g=As(t);g&&r.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${g}`).attr("d",`M${h+4},${i+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),Hs(t)&&r.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${e-11} v9 M0,${e-11} v9 M4,${e-11} v9`);let y=c.height>0&&!!t.label,f=y?mt+c.height:0,u=Ht+2*f,m=Math.max(_t,y?c.width:0);return y&&Xt(p,c,Ht/2+mt+c.height/2),Gt(o,t,m,u,{width:_t,height:Ht}),t.intersect=function(d){return Ut(t,_t,Ht,d)},o}w(Ys,"bpmnDataObject");var it=50;async function Os(n,t){let{labelStyles:s,nodeStyles:l}=H(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await Y(n,t,T(t,"bpmn-data-store")),r=o.insert("g",":first-child").attr("class","bpmn-data-body"),h=it/2,i=6;r.append("path").attr("class","bpmn-store-body").attr("d",`M${-h},${-h+i} a${h},${i} 0 0 1 ${it},0 V${h-i} a${h},${i} 0 0 1 ${-it},0 Z`).attr("style",l);for(let f of[0,5,10])r.append("path").attr("class","bpmn-store-rings").attr("d",`M${-h},${-h+i+f} a${h},${i} 0 0 0 ${it},0`);let a=c.height>0&&!!t.label,e=a?mt+c.height:0,g=it+2*e,y=Math.max(it,a?c.width:0);return a&&Xt(p,c,h+mt+c.height/2),Gt(o,t,y,g,{width:it,height:it}),t.intersect=function(f){return Ut(t,it,it,f)},o}w(Os,"bpmnDataStore");async function Xs(n,t){let{labelStyles:s}=H(t);t.labelStyle=s,t.wrappingWidth=160;let{shapeSvg:l,bbox:o,label:c}=await Y(n,t,T(t,"bpmn-annotation")),p=8,r=Math.max(28,o.height+p*2),h=o.width+p*2+6,i=t.metadata?.attachFace==="right"?"right":"left";l.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",i==="right"?`M${h/2-6},${-r/2} h6 V${r/2} h-6`:`M${-h/2+6},${-r/2} h-6 V${r/2} h6`);let e=i==="right"?-h/2+p:-h/2+p+6;return c.attr("transform",`translate(${e-(o.x??0)+(o.left??0)},${-o.height/2-((o.y??0)-(o.top??0))})`),Gt(l,t,h,r),t.intersect=function(g){return Ut(t,h,r,g,i)},l}w(Xs,"bpmnAnnotation");var _r=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ns},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ss},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:ls},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:gs},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Se},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:$e},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Be},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:ie},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:pe},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:oe},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:we},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:fa},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ps},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ds},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ts},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ae},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Oe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ye},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:ds},{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:Te},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:ke},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:fs},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:he},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:rs},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:hs},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:os},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Ce},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:He},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:de},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:me},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:be},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Xe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:xs},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Ne},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:us},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ge},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:xe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ve},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:bs},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ss},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Pe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:ms},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:De},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:is},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Ke},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Je},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:re},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:ue},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:ps},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ys},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:ws},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:as},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:je}],Yr=w(()=>{let t=[...Object.entries({state:cs,choice:ge,note:Qe,composite:ye,rectWithTitle:es,labelRect:_e,block_arrow:ce,collapsedGroup:le,iconSquare:Ee,iconCircle:Re,icon:Ie,iconRounded:Le,imageSquare:We,anchor:ee,kanbanItem:Ms,mindmapCircle:Cs,defaultMindmapNode:Bs,classBox:vs,erBox:da,requirementBox:ks,usecaseActor:Fe,usecaseActorHollow:Ve,usecaseActorAwesome:qe,usecaseActorIcon:ze,usecaseBusiness:Ze,usecaseEllipse:Me,usecaseJsonTable:Ue,"bpmn-start":Rs,"bpmn-intermediate":Ls,"bpmn-boundary":Es,"bpmn-end":Ws,"bpmn-gateway":Ts,"bpmn-activity":_s,"bpmn-data":Ys,"bpmn-data-store":Os,"bpmn-annotation":Xs}),..._r.flatMap(s=>[s.shortName,..."aliases"in s?s.aliases:[],..."internalAliases"in s?s.internalAliases:[]].map(o=>[o,s.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Or=Yr();function Xr(n){return n in Or}w(Xr,"isValidShape");export{Y as a,I as b,zs as c,N as d,yt as e,Da as f,Or as g,Xr as h};
@@ -1 +1 @@
1
- import{a as t}from"./chunk-GYT4IYBZ.js";var s=class{constructor(i){this.init=i,this.records=this.init()}static{t(this,"ImperativeState")}reset(){this.records=this.init()}};export{s as a};
1
+ import{a as t}from"./chunk-RJFVWYCA.js";var s=class{constructor(i){this.init=i,this.records=this.init()}static{t(this,"ImperativeState")}reset(){this.records=this.init()}};export{s as a};
@@ -1 +1 @@
1
- import{$ as c}from"./chunk-KT4VPQD5.js";import{a as i}from"./chunk-GYT4IYBZ.js";var S=i(t=>{let{handDrawnSeed:e}=c();return{fill:t,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:t,seed:e}},"solidStateFill"),p=i(t=>Array.isArray(t)?t:t?t.split(";").map(e=>e.trim()).filter(Boolean):[],"normalizeStyleList"),h=i(t=>{let e=f([...t.cssCompiledStyles||[],...t.cssStyles||[],...p(t.labelStyle)]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),f=i(t=>{let e=new Map;return t.forEach(o=>{let[a,s]=o.split(":");e.set(a.trim(),s?.trim())}),e},"styles2Map"),u=i(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),v=i(t=>{let{stylesArray:e}=h(t),o=[],a=[],s=[],n=[];return e.forEach(r=>{let l=r[0];u(l)?o.push(r.join(":")+" !important"):(a.push(r.join(":")+" !important"),l.includes("stroke")&&s.push(r.join(":")+" !important"),l==="fill"&&n.push(r.join(":")+" !important"))}),{labelStyles:o.join(";"),nodeStyles:a.join(";"),stylesArray:e,borderStyles:s,backgroundStyles:n}},"styles2String"),w=i((t,e)=>{let{themeVariables:o,handDrawnSeed:a}=c(),{nodeBorder:s,mainBkg:n}=o,{stylesMap:r}=h(t);return Object.assign({roughness:.7,fill:r.get("fill")||n,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:r.get("stroke")||s,seed:a,strokeWidth:r.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:d(r.get("stroke-dasharray"))},e)},"userNodeOverrides"),d=i(t=>{if(!t)return[0,0];let e=t.trim().split(/\s+/).map(Number);if(e.length===1){let s=isNaN(e[0])?0:e[0];return[s,s]}let o=isNaN(e[0])?0:e[0],a=isNaN(e[1])?0:e[1];return[o,a]},"getStrokeDashArray");export{S as a,h as b,u as c,v as d,w as e};
1
+ import{$ as c}from"./chunk-IVZHB6RS.js";import{a as i}from"./chunk-RJFVWYCA.js";var S=i(t=>{let{handDrawnSeed:e}=c();return{fill:t,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:t,seed:e}},"solidStateFill"),p=i(t=>Array.isArray(t)?t:t?t.split(";").map(e=>e.trim()).filter(Boolean):[],"normalizeStyleList"),h=i(t=>{let e=f([...t.cssCompiledStyles||[],...t.cssStyles||[],...p(t.labelStyle)]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),f=i(t=>{let e=new Map;return t.forEach(o=>{let[a,s]=o.split(":");e.set(a.trim(),s?.trim())}),e},"styles2Map"),u=i(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),v=i(t=>{let{stylesArray:e}=h(t),o=[],a=[],s=[],n=[];return e.forEach(r=>{let l=r[0];u(l)?o.push(r.join(":")+" !important"):(a.push(r.join(":")+" !important"),l.includes("stroke")&&s.push(r.join(":")+" !important"),l==="fill"&&n.push(r.join(":")+" !important"))}),{labelStyles:o.join(";"),nodeStyles:a.join(";"),stylesArray:e,borderStyles:s,backgroundStyles:n}},"styles2String"),w=i((t,e)=>{let{themeVariables:o,handDrawnSeed:a}=c(),{nodeBorder:s,mainBkg:n}=o,{stylesMap:r}=h(t);return Object.assign({roughness:.7,fill:r.get("fill")||n,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:r.get("stroke")||s,seed:a,strokeWidth:r.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:d(r.get("stroke-dasharray"))},e)},"userNodeOverrides"),d=i(t=>{if(!t)return[0,0];let e=t.trim().split(/\s+/).map(Number);if(e.length===1){let s=isNaN(e[0])?0:e[0];return[s,s]}let o=isNaN(e[0])?0:e[0],a=isNaN(e[1])?0:e[1];return[o,a]},"getStrokeDashArray");export{S as a,h as b,u as c,v as d,w as e};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-JD7ZBJD2.js";import{c as X,e as q,f as tt}from"./chunk-HOPPTA6H.js";import{a as H}from"./chunk-4QDE4SUK.js";import{b as ct,d as J,e as O}from"./chunk-QCJUF4YA.js";import{e as z}from"./chunk-BBD5CEDC.js";import{g as P}from"./chunk-KU6GTEMS.js";import{$ as Y,G as W,v as lt}from"./chunk-KT4VPQD5.js";import{b as N,d as j}from"./chunk-JRSH5GNS.js";import{a as M}from"./chunk-GYT4IYBZ.js";var ht=M(async(h,t,{variant:r="swimlane"}={})=>{let d=r==="pool",m=d?"pool swimlane":"swimlane",x=d?"pool-label swimlane-label":"swimlane-label",b=d?"pool-title swimlane-title":"swimlane-title",k=d?"pool-body swimlane-body":"swimlane-body",T=Y(),{theme:B,themeVariables:S,handDrawnSeed:o}=T,{clusterBkg:y,clusterBorder:a,borderColorArray:C}=S,s=a,{labelStyles:i,nodeStyles:e,borderStyles:w,backgroundStyles:n}=J(t),c=h.insert("g").attr("class","cluster "+m+" "+(t.cssClasses||"")).attr("id",t.domId??t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);P(c,t.colorIndex,B,C);let f=lt(T.flowchart.htmlLabels),g=t.direction==="LR",u=c.insert("g").attr("class","cluster-label "+x),D=await z(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}),l=D.getBBox();if(f){let I=D.children[0],G=j(D);l=I.getBoundingClientRect(),G.attr("width",l.width),G.attr("height",l.height)}let R=t.padding??0,p=t.width<=l.width+R?l.width+R:t.width;t.width<=l.width+R?t.diff=(p-t.width)/2-R:t.diff=-R;let $=t.height,v=t.y-$/2,E=t.y+$/2,A=t.x-p/2,gt=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+$/3,at=g?4:0,it=l.height+2*at,L,V;if(g){let I=Math.max(it,l.height+2*at),G=A+I,_=Math.max(0,p-I);if(t.look==="handDrawn"){let Q=H.svg(c),rt=O(t,{roughness:.7,fill:y,stroke:s,seed:o}),Z=O(t,{roughness:.7,fill:"none",stroke:s,seed:o}),st=Q.rectangle(A,v,I,$,rt);L=c.insert(()=>st,":first-child").attr("class",b);let et=Q.rectangle(G,v,_,$,Z);V=c.insert(()=>et,":first-child").attr("class",k),L.select("path:nth-child(2)").attr("style",w.join(";")),L.select("path").attr("style",n.join(";").replace("fill","stroke"))}else L=c.insert("rect",":first-child"),V=c.insert("rect",":first-child"),L.attr("class",b).attr("style",e).attr("x",A).attr("y",v).attr("width",I).attr("height",$).attr("fill",y).attr("stroke",s),V.attr("class",k).attr("style",e).attr("x",G).attr("y",v).attr("width",_).attr("height",$).attr("fill","none").attr("stroke",s);let K=A+I/2,U=t.y;u.attr("transform",`translate(${K}, ${U}) rotate(-90) translate(${-l.width/2}, ${-l.height/2})`)}else{let I=Math.max(0,gt-v),G=Math.min(it,I),_=v+G,K=Math.max(0,E-_),U=t.x-p/2;if(t.look==="handDrawn"){let Z=H.svg(c),st=O(t,{roughness:.7,fill:y,stroke:s,fillWeight:3,seed:o}),et=O(t,{roughness:.7,fill:"none",stroke:s,seed:o}),dt=Z.rectangle(U,v,p,G,st);L=c.insert(()=>dt,":first-child").attr("class",b);let ft=Z.rectangle(U,_,p,K,et);V=c.insert(()=>ft,":first-child").attr("class",k),L.select("path:nth-child(2)").attr("style",w.join(";")),L.select("path").attr("style",n.join(";").replace("fill","stroke"))}else L=c.insert("rect",":first-child"),V=c.insert("rect",":first-child"),L.attr("class",b).attr("style",e).attr("x",U).attr("y",v).attr("width",p).attr("height",G).attr("fill",y).attr("stroke",s),V.attr("class",k).attr("style",e).attr("x",U).attr("y",_).attr("width",p).attr("height",K).attr("fill","none").attr("stroke",s);let Q=t.x-l.width/2,rt=v+(G-l.height)/2;u.attr("transform",`translate(${Q}, ${rt})`)}if(N.trace("Swimlane data ",t,JSON.stringify(t)),i){let I=u.select("span");I&&I.attr("style",i)}return t.offsetX=0,t.width=p,t.height=$,t.offsetY=l.height-R/2,t.intersect=function(I){return X(t,I)},{cluster:c,labelBBox:l}},"swimlane"),ot=M(async(h,t)=>{N.info("Creating subgraph rect for ",t.id,t);let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{clusterBkg:b,clusterBorder:k,borderColorArray:T}=m,{labelStyles:B,nodeStyles:S,borderStyles:o,backgroundStyles:y}=J(t),a=h.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);P(a,t.colorIndex,d,T);let C=W(r),s=a.insert("g").attr("class","cluster-label "),i;t.labelType==="markdown"?i=await z(s,t.label,{style:t.labelStyle,useHtmlLabels:C,isNode:!0,width:t.width}):i=await tt(s,t.label,t.labelStyle||"",!1,!0);let e=i.getBBox();if(W(r)){let l=i.children[0],R=j(i);e=l.getBoundingClientRect(),R.attr("width",e.width),R.attr("height",e.height)}let w=t.width<=e.width+t.padding?e.width+t.padding:t.width;t.width<=e.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;let n=t.height,c=t.x-w/2,f=t.y-n/2;N.trace("Data ",t,JSON.stringify(t));let g;if(t.look==="handDrawn"){let l=H.svg(a),R=O(t,{roughness:.7,fill:b,stroke:k,fillWeight:3,seed:x}),p=l.path(q(c,f,w,n,0),R);g=a.insert(()=>(N.debug("Rough node insert CXC",p),p),":first-child"),g.select("path:nth-child(2)").attr("style",o.join(";")),g.select("path").attr("style",y.join(";").replace("fill","stroke"))}else g=a.insert("rect",":first-child"),g.attr("style",S).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",f).attr("width",w).attr("height",n);let{subGraphTitleTopMargin:u}=F(r);if(s.attr("transform",`translate(${t.x-e.width/2}, ${t.y-t.height/2+u})`),B){let l=s.select("span");l&&l.attr("style",B)}let D=g.node().getBBox();return t.offsetX=0,t.width=D.width,t.height=D.height,t.offsetY=e.height-t.padding/2,t.intersect=function(l){return X(t,l)},{cluster:a,labelBBox:e}},"rect"),ut=M((h,t)=>{let r=h.insert("g").attr("class","note-cluster").attr("id",t.domId),d=r.insert("rect",":first-child"),m=0*t.padding,x=m/2;d.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-x).attr("y",t.y-t.height/2-x).attr("width",t.width+m).attr("height",t.height+m).attr("fill","none");let b=d.node().getBBox();return t.width=b.width,t.height=b.height,t.intersect=function(k){return X(t,k)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),yt=M(async(h,t)=>{let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{altBackground:b,borderColorArray:k,compositeBackground:T,compositeTitleBackground:B,nodeBorder:S}=m,o=h.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);P(o,t.colorIndex,d,k);let y=o.insert("g",":first-child"),a=o.insert("g").attr("class","cluster-label"),C=o.append("rect"),s=await tt(a,t.label,t.labelStyle,void 0,!0),i=s.getBBox();if(W(r)){let p=s.children[0],$=j(s);i=p.getBoundingClientRect(),$.attr("width",i.width),$.attr("height",i.height)}let e=0*t.padding,w=e/2,n=(t.width<=i.width+t.padding?i.width+t.padding:t.width)+e;t.width<=i.width+t.padding?t.diff=(n-t.width)/2-t.padding:t.diff=-t.padding;let c=t.height+e,f=t.height+e-i.height-6,g=t.x-n/2,u=t.y-c/2;t.width=n;let D=t.y-t.height/2-w+i.height+2,l;if(t.look==="handDrawn"){let p=t.cssClasses.includes("statediagram-cluster-alt"),$=H.svg(o),v=t.rx||t.ry?$.path(q(g,u,n,c,10),{roughness:.7,fill:B,fillStyle:"solid",stroke:S,seed:x}):$.rectangle(g,u,n,c,{seed:x});l=o.insert(()=>v,":first-child");let E=$.rectangle(g,D,n,f,{fill:p?b:T,fillStyle:p?"hachure":"solid",stroke:S,seed:x});l=o.insert(()=>v,":first-child"),C=o.insert(()=>E),l.attr("class","outer"),C.attr("class","inner")}else l=y.insert("rect",":first-child"),l.attr("class","outer").attr("x",g).attr("y",u).attr("width",n).attr("height",c).attr("data-look",t.look),C.attr("class","inner").attr("x",g).attr("y",D).attr("width",n).attr("height",f);a.attr("transform",`translate(${t.x-i.width/2}, ${u+1-(W(r)?0:3)})`);let R=l.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=i.height-t.padding/2,t.labelBBox=i,t.intersect=function(p){return X(t,p)},{cluster:o,labelBBox:i}},"roundedWithTitle"),wt=M(async(h,t)=>{N.info("Creating subgraph rect for ",t.id,t);let r=Y(),{themeVariables:d,handDrawnSeed:m}=r,{clusterBkg:x,clusterBorder:b}=d,{labelStyles:k,nodeStyles:T,borderStyles:B,backgroundStyles:S}=J(t),o=h.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),y=W(r),a=o.insert("g").attr("class","cluster-label "),C=await z(a,t.label,{style:t.labelStyle,useHtmlLabels:y,isNode:!0,width:t.width}),s=C.getBBox();if(W(r)){let u=C.children[0],D=j(C);s=u.getBoundingClientRect(),D.attr("width",s.width),D.attr("height",s.height)}let i=t.width<=s.width+t.padding?s.width+t.padding:t.width;t.width<=s.width+t.padding?t.diff=(i-t.width)/2-t.padding:t.diff=-t.padding;let e=t.height,w=t.x-i/2,n=t.y-e/2;N.trace("Data ",t,JSON.stringify(t));let c;if(t.look==="handDrawn"){let u=H.svg(o),D=O(t,{roughness:.7,fill:x,stroke:b,fillWeight:4,seed:m}),l=u.path(q(w,n,i,e,t.rx),D);c=o.insert(()=>(N.debug("Rough node insert CXC",l),l),":first-child"),c.select("path:nth-child(2)").attr("style",B.join(";")),c.select("path").attr("style",S.join(";").replace("fill","stroke"))}else c=o.insert("rect",":first-child"),c.attr("style",T).attr("rx",t.rx).attr("ry",t.ry).attr("x",w).attr("y",n).attr("width",i).attr("height",e);let{subGraphTitleTopMargin:f}=F(r);if(a.attr("transform",`translate(${t.x-s.width/2}, ${t.y-t.height/2+f})`),k){let u=a.select("span");u&&u.attr("style",k)}let g=c.node().getBBox();return t.offsetX=0,t.width=g.width,t.height=g.height,t.offsetY=s.height-t.padding/2,t.intersect=function(u){return X(t,u)},{cluster:o,labelBBox:s}},"kanbanSection"),bt=M((h,t)=>{let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{altBackground:b,nodeBorder:k,borderColorArray:T}=m,B=h.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);P(B,t.colorIndex,d,T);let S=B.insert("g",":first-child"),o=0*t.padding,y=t.width+o;t.diff=-t.padding;let a=t.height+o,C=t.x-y/2,s=t.y-a/2;t.width=y;let i;if(t.look==="handDrawn"){let n=H.svg(B).rectangle(C,s,y,a,{fill:b??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:k,seed:x});i=B.insert(()=>n,":first-child").attr("class","divider")}else{i=S.insert("rect",":first-child");let w="outer";t.look,w="divider",i.attr("class",w).attr("x",C).attr("y",s).attr("width",y).attr("height",a).attr("data-look",t.look)}let e=i.node().getBBox();return t.height=e.height,t.offsetX=0,t.offsetY=0,t.intersect=function(w){return X(t,w)},{cluster:B,labelBBox:{}}},"divider"),pt=M(async(h,t,r)=>{N.info(`Creating ${r.cssClass} for `,t.id,t);let d=Y(),{theme:m,themeVariables:x,handDrawnSeed:b}=d,{borderColorArray:k}=x,{labelStyles:T,borderStyles:B}=J(t),S=h.insert("g").attr("class","cluster "+r.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);P(S,t.colorIndex,m,k);let o=W(d),y=S.insert("g").attr("class","cluster-label"),a={width:0,height:0},C=t.label?.trim();if(C){let f;if(t.labelType==="markdown"?f=await z(y,t.label,{style:t.labelStyle,useHtmlLabels:o,isNode:!0,width:t.width}):f=await tt(y,t.label,t.labelStyle||"",!1,!0),a=f.getBBox(),o){let g=f.children[0],u=j(f);a=g.getBoundingClientRect(),u.attr("width",a.width),u.attr("height",a.height)}}let s=t.width<=a.width+t.padding?a.width+t.padding:t.width;t.width<=a.width+t.padding?t.diff=(s-t.width)/2-t.padding:t.diff=-t.padding;let i=t.height,e=t.x-s/2,w=t.y-i/2,n;if(t.look==="handDrawn"){let f=H.svg(S),g=O(t,{roughness:r.roughness,fill:r.fill,stroke:r.stroke,strokeWidth:r.strokeWidth,seed:b,...r.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...r.strokeDash?{strokeLineDash:r.strokeDash}:{}}),u=f.path(q(e,w,s,i,r.rx),g);n=S.insert(()=>u,":first-child"),n.select("path:nth-child(2)").attr("style",B.join(";"))}else n=S.insert("rect",":first-child"),n.attr("rx",r.rx).attr("ry",r.rx).attr("x",e).attr("y",w).attr("width",s).attr("height",i).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",r.strokeWidth+"px"),r.strokeDash&&n.attr("stroke-dasharray",r.strokeDash.join(", "));if(C){let{subGraphTitleTopMargin:f}=F(d);if(y.attr("transform",`translate(${t.x-a.width/2}, ${t.y-t.height/2+f})`),T){let g=y.select("span");g&&g.attr("style",T)}}let c=n.node().getBBox();return t.offsetX=0,t.width=c.width,t.height=c.height,t.offsetY=a.height-t.padding/2,t.intersect=function(f){return X(t,f)},{cluster:S,labelBBox:a}},"createContainerGroup"),mt=M(async(h,t)=>{let{themeVariables:r}=Y(),d=r.flowContainerStroke||r.secondaryBorderColor;return pt(h,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:d,strokeWidth:.75,roughness:.7})},"flowGroup"),xt=M((h,t)=>{let r=h.boundaryType||"rect",d=r==="package"?20:h.padding,m=r==="package"?t.height+10:0,x=Math.max(h.width,t.width+d),b=r==="package"?Math.max(h.height,m+h.padding*2):h.height,k=h.x-x/2,T=h.y-b/2;return{boundaryType:r,width:x,height:b,x:k,y:T,bodyY:T+m,bodyHeight:b-m,tabHeight:m,tabWidth:r==="package"?Math.min(x,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),kt=M(async(h,t)=>{N.info("Creating usecase system boundary for ",t.id,t);let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{clusterBkg:b,clusterBorder:k,borderColorArray:T}=m,{labelStyles:B,nodeStyles:S}=J(t),{stylesMap:o}=ct(t),y=t.boundaryType||"rect",a=h.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${y} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",y).attr("data-look",t.look);P(a,t.colorIndex,d,T);let C=W(r),s=a.insert("g").attr("class","cluster-label system-boundary-title"),i=await z(s,t.label,{style:B,useHtmlLabels:C,isNode:!0}),e=i.getBBox();if(C){let v=i.children[0],E=j(i);e=v.getBoundingClientRect(),E.attr("width",e.width),E.attr("height",e.height)}let w=xt(t,e),{width:n,height:c,x:f,y:g,bodyY:u,bodyHeight:D,tabHeight:l,tabWidth:R}=w;t.diff=t.width<=e.width+t.padding?(n-t.width)/2-t.padding:-t.padding;let p=O(t,{fill:o.get("fill")||b,stroke:o.get("stroke")||k,strokeWidth:o.get("stroke-width")?.replace("px","")||1,seed:x});if(t.look==="handDrawn"){let v=H.svg(a),E=v.rectangle(f,u,n,D,p);if(a.insert(()=>E,":first-child").attr("class","boundary-body label-container"),y==="package"){let A=v.rectangle(f,g,R,l,p);a.insert(()=>A,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else a.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",S).attr("x",f).attr("y",u).attr("width",n).attr("height",D),y==="package"&&a.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",S).attr("x",f).attr("y",g).attr("width",R).attr("height",l);let{subGraphTitleTopMargin:$}=F(r);return y==="package"?s.attr("transform",`translate(${f+(R-e.width)/2}, ${g+(l-e.height)/2})`):s.attr("transform",`translate(${t.x-e.width/2}, ${g+$})`),B&&(s.attr("style",B),s.select("span").attr("style",B)),t.offsetX=0,t.width=n,t.height=c,t.offsetY=e.height-t.padding/2,t.labelBBox=e,t.intersect=function(v){return X(t,v)},{cluster:a,labelBBox:e}},"usecaseSystemBoundary"),Bt=ot,St=M((h,t)=>ht(h,t,{variant:"pool"}),"pool"),Ct={rect:ot,squareRect:Bt,roundedWithTitle:yt,noteGroup:ut,divider:bt,kanbanSection:wt,flowGroup:mt,usecaseSystemBoundary:kt,swimlane:ht,pool:St},vt=new Set(["noteGroup","divider"]),Ot=M(h=>!vt.has(h??"rect"),"clusterPaintsTitle"),nt=new Map,Xt=M(async(h,t)=>{let r=t.shape||"rect",d=await Ct[r](h,t);return nt.set(t.id,d),d},"insertCluster"),Et=M(()=>{nt=new Map},"clear");export{Ot as a,Xt as b,Et as c};
1
+ import{a as F}from"./chunk-NDAMZVXQ.js";import{c as X,e as q,f as tt}from"./chunk-BOXAA5AP.js";import{a as H}from"./chunk-4QDE4SUK.js";import{b as ct,d as J,e as O}from"./chunk-DIDARDST.js";import{e as z}from"./chunk-7LSMJ4VU.js";import{g as P}from"./chunk-3CJU2RDX.js";import{$ as Y,G as W,v as lt}from"./chunk-IVZHB6RS.js";import{b as N,d as j}from"./chunk-QQIGL7OP.js";import{a as I}from"./chunk-RJFVWYCA.js";var ht=I(async(n,t,{variant:r="swimlane"}={})=>{let d=r==="pool",m=d?"pool swimlane":"swimlane",x=d?"pool-label swimlane-label":"swimlane-label",b=d?"pool-title swimlane-title":"swimlane-title",k=d?"pool-body swimlane-body":"swimlane-body",T=Y(),{theme:B,themeVariables:S,handDrawnSeed:h}=T,{clusterBkg:y,clusterBorder:a,borderColorArray:C}=S,s=a,{labelStyles:i,nodeStyles:e,borderStyles:w,backgroundStyles:o}=J(t),c=n.insert("g").attr("class","cluster "+m+" "+(t.cssClasses||"")).attr("id",t.domId??t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);P(c,t.colorIndex,B,C);let f=lt(T.flowchart.htmlLabels),g=t.direction==="LR",u=c.insert("g").attr("class","cluster-label "+x),D=await z(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}),l=D.getBBox();if(f){let M=D.children[0],G=j(D);l=M.getBoundingClientRect(),G.attr("width",l.width),G.attr("height",l.height)}let R=t.padding??0,p=t.width<=l.width+R?l.width+R:t.width;t.width<=l.width+R?t.diff=(p-t.width)/2-R:t.diff=-R;let $=t.height,v=t.y-$/2,E=t.y+$/2,A=t.x-p/2,gt=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+$/3,at=g?4:0,it=l.height+2*at,L,V;if(g){let M=Math.max(it,l.height+2*at),G=A+M,_=Math.max(0,p-M);if(t.look==="handDrawn"){let Q=H.svg(c),rt=O(t,{roughness:.7,fill:y,stroke:s,seed:h}),Z=O(t,{roughness:.7,fill:"none",stroke:s,seed:h}),st=Q.rectangle(A,v,M,$,rt);L=c.insert(()=>st,":first-child").attr("class",b);let et=Q.rectangle(G,v,_,$,Z);V=c.insert(()=>et,":first-child").attr("class",k),L.select("path:nth-child(2)").attr("style",w.join(";")),L.select("path").attr("style",o.join(";").replace("fill","stroke"))}else L=c.insert("rect",":first-child"),V=c.insert("rect",":first-child"),L.attr("class",b).attr("style",e).attr("x",A).attr("y",v).attr("width",M).attr("height",$).attr("fill",y).attr("stroke",s),V.attr("class",k).attr("style",e).attr("x",G).attr("y",v).attr("width",_).attr("height",$).attr("fill","none").attr("stroke",s);let K=A+M/2,U=t.y;u.attr("transform",`translate(${K}, ${U}) rotate(-90) translate(${-l.width/2}, ${-l.height/2})`)}else{let M=Math.max(0,gt-v),G=Math.min(it,M),_=v+G,K=Math.max(0,E-_),U=t.x-p/2;if(t.look==="handDrawn"){let Z=H.svg(c),st=O(t,{roughness:.7,fill:y,stroke:s,fillWeight:3,seed:h}),et=O(t,{roughness:.7,fill:"none",stroke:s,seed:h}),dt=Z.rectangle(U,v,p,G,st);L=c.insert(()=>dt,":first-child").attr("class",b);let ft=Z.rectangle(U,_,p,K,et);V=c.insert(()=>ft,":first-child").attr("class",k),L.select("path:nth-child(2)").attr("style",w.join(";")),L.select("path").attr("style",o.join(";").replace("fill","stroke"))}else L=c.insert("rect",":first-child"),V=c.insert("rect",":first-child"),L.attr("class",b).attr("style",e).attr("x",U).attr("y",v).attr("width",p).attr("height",G).attr("fill",y).attr("stroke",s),V.attr("class",k).attr("style",e).attr("x",U).attr("y",_).attr("width",p).attr("height",K).attr("fill","none").attr("stroke",s);let Q=t.x-l.width/2,rt=v+(G-l.height)/2;u.attr("transform",`translate(${Q}, ${rt})`)}if(N.trace("Swimlane data ",t,JSON.stringify(t)),i){let M=u.select("span");M&&M.attr("style",i)}return t.offsetX=0,t.width=p,t.height=$,t.offsetY=l.height-R/2,t.intersect=function(M){return X(t,M)},{cluster:c,labelBBox:l}},"swimlane"),ot=I(async(n,t)=>{N.info("Creating subgraph rect for ",t.id,t);let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{clusterBkg:b,clusterBorder:k,borderColorArray:T}=m,{labelStyles:B,nodeStyles:S,borderStyles:h,backgroundStyles:y}=J(t),a=n.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);P(a,t.colorIndex,d,T);let C=W(r),s=a.insert("g").attr("class","cluster-label "),i;t.labelType==="markdown"?i=await z(s,t.label,{style:t.labelStyle,useHtmlLabels:C,isNode:!0,width:t.width}):i=await tt(s,t.label,t.labelStyle||"",!1,!0);let e=i.getBBox();if(W(r)){let l=i.children[0],R=j(i);e=l.getBoundingClientRect(),R.attr("width",e.width),R.attr("height",e.height)}let w=t.width<=e.width+t.padding?e.width+t.padding:t.width;t.width<=e.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;let o=t.height,c=t.x-w/2,f=t.y-o/2;N.trace("Data ",t,JSON.stringify(t));let g;if(t.look==="handDrawn"){let l=H.svg(a),R=O(t,{roughness:.7,fill:b,stroke:k,fillWeight:3,seed:x}),p=l.path(q(c,f,w,o,0),R);g=a.insert(()=>(N.debug("Rough node insert CXC",p),p),":first-child"),g.select("path:nth-child(2)").attr("style",h.join(";")),g.select("path").attr("style",y.join(";").replace("fill","stroke"))}else g=a.insert("rect",":first-child"),g.attr("style",S).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",f).attr("width",w).attr("height",o);let{subGraphTitleTopMargin:u}=F(r);if(s.attr("transform",`translate(${t.x-e.width/2}, ${t.y-t.height/2+u})`),B){let l=s.select("span");l&&l.attr("style",B)}let D=g.node().getBBox();return t.offsetX=0,t.width=D.width,t.height=D.height,t.offsetY=e.height-t.padding/2,t.intersect=function(l){return X(t,l)},{cluster:a,labelBBox:e}},"rect"),ut=I((n,t)=>{let r=n.insert("g").attr("class","note-cluster").attr("id",t.domId),d=r.insert("rect",":first-child"),m=0*t.padding,x=m/2;d.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-x).attr("y",t.y-t.height/2-x).attr("width",t.width+m).attr("height",t.height+m).attr("fill","none");let b=d.node().getBBox();return t.width=b.width,t.height=b.height,t.intersect=function(k){return X(t,k)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),yt=I(async(n,t)=>{let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{altBackground:b,borderColorArray:k,compositeBackground:T,compositeTitleBackground:B,nodeBorder:S}=m,h=n.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);P(h,t.colorIndex,d,k);let y=h.insert("g",":first-child"),a=h.insert("g").attr("class","cluster-label"),C=h.append("rect"),s=await tt(a,t.label,t.labelStyle,void 0,!0),i=s.getBBox();if(W(r)){let p=s.children[0],$=j(s);i=p.getBoundingClientRect(),$.attr("width",i.width),$.attr("height",i.height)}let e=0*t.padding,w=e/2,o=(t.width<=i.width+t.padding?i.width+t.padding:t.width)+e;t.width<=i.width+t.padding?t.diff=(o-t.width)/2-t.padding:t.diff=-t.padding;let c=t.height+e,f=t.height+e-i.height-6,g=t.x-o/2,u=t.y-c/2;t.width=o;let D=t.y-t.height/2-w+i.height+2,l;if(t.look==="handDrawn"){let p=t.cssClasses.includes("statediagram-cluster-alt"),$=H.svg(h),v=t.rx||t.ry?$.path(q(g,u,o,c,10),{roughness:.7,fill:B,fillStyle:"solid",stroke:S,seed:x}):$.rectangle(g,u,o,c,{seed:x});l=h.insert(()=>v,":first-child");let E=$.rectangle(g,D,o,f,{fill:p?b:T,fillStyle:p?"hachure":"solid",stroke:S,seed:x});l=h.insert(()=>v,":first-child"),C=h.insert(()=>E),l.attr("class","outer"),C.attr("class","inner")}else l=y.insert("rect",":first-child"),l.attr("class","outer").attr("x",g).attr("y",u).attr("width",o).attr("height",c).attr("data-look",t.look),C.attr("class","inner").attr("x",g).attr("y",D).attr("width",o).attr("height",f);a.attr("transform",`translate(${t.x-i.width/2}, ${u+1-(W(r)?0:3)})`);let R=l.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=i.height-t.padding/2,t.labelBBox=i,t.intersect=function(p){return X(t,p)},{cluster:h,labelBBox:i}},"roundedWithTitle"),wt=I(async(n,t)=>{N.info("Creating subgraph rect for ",t.id,t);let r=Y(),{themeVariables:d,handDrawnSeed:m}=r,{clusterBkg:x,clusterBorder:b}=d,{labelStyles:k,nodeStyles:T,borderStyles:B,backgroundStyles:S}=J(t),h=n.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),y=W(r),a=h.insert("g").attr("class","cluster-label "),C=await z(a,t.label,{style:t.labelStyle,useHtmlLabels:y,isNode:!0,width:t.width}),s=C.getBBox();if(W(r)){let u=C.children[0],D=j(C);s=u.getBoundingClientRect(),D.attr("width",s.width),D.attr("height",s.height)}let i=t.width<=s.width+t.padding?s.width+t.padding:t.width;t.width<=s.width+t.padding?t.diff=(i-t.width)/2-t.padding:t.diff=-t.padding;let e=t.height,w=t.x-i/2,o=t.y-e/2;N.trace("Data ",t,JSON.stringify(t));let c;if(t.look==="handDrawn"){let u=H.svg(h),D=O(t,{roughness:.7,fill:x,stroke:b,fillWeight:4,seed:m}),l=u.path(q(w,o,i,e,t.rx),D);c=h.insert(()=>(N.debug("Rough node insert CXC",l),l),":first-child"),c.select("path:nth-child(2)").attr("style",B.join(";")),c.select("path").attr("style",S.join(";").replace("fill","stroke"))}else c=h.insert("rect",":first-child"),c.attr("style",T).attr("rx",t.rx).attr("ry",t.ry).attr("x",w).attr("y",o).attr("width",i).attr("height",e);let{subGraphTitleTopMargin:f}=F(r);if(a.attr("transform",`translate(${t.x-s.width/2}, ${t.y-t.height/2+f})`),k){let u=a.select("span");u&&u.attr("style",k)}let g=c.node().getBBox();return t.offsetX=0,t.width=g.width,t.height=g.height,t.offsetY=s.height-t.padding/2,t.intersect=function(u){return X(t,u)},{cluster:h,labelBBox:s}},"kanbanSection"),bt=I((n,t)=>{let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{altBackground:b,nodeBorder:k,borderColorArray:T}=m,B=n.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);P(B,t.colorIndex,d,T);let S=B.insert("g",":first-child"),h=0*t.padding,y=t.width+h;t.diff=-t.padding;let a=t.height+h,C=t.x-y/2,s=t.y-a/2;t.width=y;let i;if(t.look==="handDrawn"){let o=H.svg(B).rectangle(C,s,y,a,{fill:b??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:k,seed:x});i=B.insert(()=>o,":first-child").attr("class","divider")}else{i=S.insert("rect",":first-child");let w="outer";t.look,w="divider",i.attr("class",w).attr("x",C).attr("y",s).attr("width",y).attr("height",a).attr("data-look",t.look)}let e=i.node().getBBox();return t.height=e.height,t.offsetX=0,t.offsetY=0,t.intersect=function(w){return X(t,w)},{cluster:B,labelBBox:{}}},"divider"),pt=I(async(n,t,r)=>{N.info(`Creating ${r.cssClass} for `,t.id,t);let d=Y(),{theme:m,themeVariables:x,handDrawnSeed:b}=d,{borderColorArray:k}=x,{labelStyles:T,borderStyles:B}=J(t),S=n.insert("g").attr("class","cluster "+r.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);P(S,t.colorIndex,m,k);let h=W(d),y=S.insert("g").attr("class","cluster-label"),a={width:0,height:0},C=t.label?.trim();if(C){let f;if(t.labelType==="markdown"?f=await z(y,t.label,{style:t.labelStyle,useHtmlLabels:h,isNode:!0,width:t.width}):f=await tt(y,t.label,t.labelStyle||"",!1,!0),a=f.getBBox(),h){let g=f.children[0],u=j(f);a=g.getBoundingClientRect(),u.attr("width",a.width),u.attr("height",a.height)}}let s=t.width<=a.width+t.padding?a.width+t.padding:t.width;t.width<=a.width+t.padding?t.diff=(s-t.width)/2-t.padding:t.diff=-t.padding;let i=t.height,e=t.x-s/2,w=t.y-i/2,o;if(t.look==="handDrawn"){let f=H.svg(S),g=O(t,{roughness:r.roughness,fill:r.fill,stroke:r.stroke,strokeWidth:r.strokeWidth,seed:b,...r.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...r.strokeDash?{strokeLineDash:r.strokeDash}:{}}),u=f.path(q(e,w,s,i,r.rx),g);o=S.insert(()=>u,":first-child"),o.select("path:nth-child(2)").attr("style",B.join(";"))}else o=S.insert("rect",":first-child"),o.attr("rx",r.rx).attr("ry",r.rx).attr("x",e).attr("y",w).attr("width",s).attr("height",i).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",r.strokeWidth+"px"),r.strokeDash&&o.attr("stroke-dasharray",r.strokeDash.join(", "));if(C){let{subGraphTitleTopMargin:f}=F(d);if(y.attr("transform",`translate(${t.x-a.width/2}, ${t.y-t.height/2+f})`),T){let g=y.select("span");g&&g.attr("style",T)}}let c=o.node().getBBox();return t.offsetX=0,t.width=c.width,t.height=c.height,t.offsetY=a.height-t.padding/2,t.intersect=function(f){return X(t,f)},{cluster:S,labelBBox:a}},"createContainerGroup"),mt=I(async(n,t)=>{let{themeVariables:r}=Y(),d=r.flowContainerStroke||r.secondaryBorderColor;return pt(n,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:d,strokeWidth:.75,roughness:.7})},"flowGroup"),xt=I((n,t)=>{let r=n.boundaryType||"rect",d=r==="package"?20:n.padding,m=r==="package"?t.height+10:0,x=Math.max(n.width,t.width+d),b=r==="package"?Math.max(n.height,m+n.padding*2):n.height,k=n.x-x/2,T=n.y-b/2;return{boundaryType:r,width:x,height:b,x:k,y:T,bodyY:T+m,bodyHeight:b-m,tabHeight:m,tabWidth:r==="package"?Math.min(x,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),kt=I(async(n,t)=>{N.info("Creating usecase system boundary for ",t.id,t);let r=Y(),{theme:d,themeVariables:m,handDrawnSeed:x}=r,{clusterBkg:b,clusterBorder:k,borderColorArray:T}=m,{labelStyles:B,nodeStyles:S}=J(t),{stylesMap:h}=ct(t),y=t.boundaryType||"rect",a=n.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${y} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",y).attr("data-look",t.look);P(a,t.colorIndex,d,T);let C=W(r),s=a.insert("g").attr("class","cluster-label system-boundary-title"),i=await z(s,t.label,{style:B,useHtmlLabels:C,isNode:!0}),e=i.getBBox();if(C){let v=i.children[0],E=j(i);e=v.getBoundingClientRect(),E.attr("width",e.width),E.attr("height",e.height)}let w=xt(t,e),{width:o,height:c,x:f,y:g,bodyY:u,bodyHeight:D,tabHeight:l,tabWidth:R}=w;t.diff=t.width<=e.width+t.padding?(o-t.width)/2-t.padding:-t.padding;let p=O(t,{fill:h.get("fill")||b,stroke:h.get("stroke")||k,strokeWidth:h.get("stroke-width")?.replace("px","")||1,seed:x});if(t.look==="handDrawn"){let v=H.svg(a),E=v.rectangle(f,u,o,D,p);if(a.insert(()=>E,":first-child").attr("class","boundary-body label-container"),y==="package"){let A=v.rectangle(f,g,R,l,p);a.insert(()=>A,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else a.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",S).attr("x",f).attr("y",u).attr("width",o).attr("height",D),y==="package"&&a.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",S).attr("x",f).attr("y",g).attr("width",R).attr("height",l);let{subGraphTitleTopMargin:$}=F(r);return y==="package"?s.attr("transform",`translate(${f+(R-e.width)/2}, ${g+(l-e.height)/2})`):s.attr("transform",`translate(${t.x-e.width/2}, ${g+$})`),B&&(s.attr("style",B),s.select("span").attr("style",B)),t.offsetX=0,t.width=o,t.height=c,t.offsetY=e.height-t.padding/2,t.labelBBox=e,t.intersect=function(v){return X(t,v)},{cluster:a,labelBBox:e}},"usecaseSystemBoundary"),Bt=ot,St=I((n,t)=>ht(n,t,{variant:"pool"}),"pool"),Ct={rect:ot,squareRect:Bt,roundedWithTitle:yt,noteGroup:ut,divider:bt,kanbanSection:wt,flowGroup:mt,usecaseSystemBoundary:kt,swimlane:ht,pool:St};var nt=new Map,Yt=I(async(n,t)=>{let r=t.shape||"rect",d=await Ct[r](n,t);return nt.set(t.id,d),d},"insertCluster"),Ot=I(()=>{nt=new Map},"clear");export{Yt as a,Ot as b};
@@ -1,3 +1,3 @@
1
- import{a}from"./chunk-LT6LXKCR.js";var i={},d={info:a(async()=>{let{createInfoServices:e}=await import("./info-OHQRW6UA-ALVDUVYV.js"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:a(async()=>{let{createPacketServices:e}=await import("./packet-JDAUHWVQ-5MQIBWAH.js"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:a(async()=>{let{createPieServices:e}=await import("./pie-XZMESJXO-T5VRKHVT.js"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:a(async()=>{let{createTreeViewServices:e}=await import("./treeView-D4JQ5SDB-42S7U73N.js"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:a(async()=>{let{createArchitectureServices:e}=await import("./architecture-WOLXFQ4H-V57EDXXY.js"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:a(async()=>{let{createGitGraphServices:e}=await import("./gitGraph-VSP46ZUC-VBFWJBBT.js"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),eventmodeling:a(async()=>{let{createEventModelingServices:e}=await import("./eventmodeling-K75KTNOO-WG6DDYMC.js"),r=e().EventModel.parser.LangiumParser;i.eventmodeling=r},"eventmodeling"),radar:a(async()=>{let{createRadarServices:e}=await import("./radar-ABXABTNO-C6FXIBYW.js"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),railroad:a(async()=>{let{createRailroadServices:e}=await import("./railroad-I3PHUGI6-ZSO5JXB3.js"),r=e().Railroad.parser.LangiumParser;i.railroad=r},"railroad"),railroadEbnf:a(async()=>{let{createRailroadEbnfServices:e}=await import("./railroad-ebnf-DWYD2UWJ-MUENNCGK.js"),r=e().RailroadEbnf.parser.LangiumParser;i.railroadEbnf=r},"railroadEbnf"),railroadAbnf:a(async()=>{let{createRailroadAbnfServices:e}=await import("./railroad-abnf-LNEFI6M7-CI4GQRHB.js"),r=e().RailroadAbnf.parser.LangiumParser;i.railroadAbnf=r},"railroadAbnf"),railroadPeg:a(async()=>{let{createRailroadPegServices:e}=await import("./railroad-peg-JR7BVNR7-N3X5GGIX.js"),r=e().RailroadPeg.parser.LangiumParser;i.railroadPeg=r},"railroadPeg"),treemap:a(async()=>{let{createTreemapServices:e}=await import("./treemap-SAJKECNS-RUBYQ7XF.js"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:a(async()=>{let{createWardleyServices:e}=await import("./wardley-7MLQ67FV-NV5HXTTC.js"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley"),cynefin:a(async()=>{let{createCynefinServices:e}=await import("./cynefin-EF2NZ3EQ-PSXP3DXL.js"),r=e().Cynefin.parser.LangiumParser;i.cynefin=r},"cynefin")};async function l(e,r){let n=d[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();let t=i[e].parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new m(t);return t.value}a(l,"parse");var s=a(e=>e!==void 0&&e>=0?e:"?","formatLocation"),m=class extends Error{constructor(e){let r=e.lexerErrors.map(o=>{let t=s(o.line),c=s(o.column);return`Lexer error on line ${t}, column ${c}: ${o.message}`}).join(`
1
+ import{a}from"./chunk-LT6LXKCR.js";var i={},d={info:a(async()=>{let{createInfoServices:e}=await import("./info-OHQRW6UA-JKJGOQNY.js"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:a(async()=>{let{createPacketServices:e}=await import("./packet-JDAUHWVQ-Y3H77ERD.js"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:a(async()=>{let{createPieServices:e}=await import("./pie-XZMESJXO-PRER4XL5.js"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:a(async()=>{let{createTreeViewServices:e}=await import("./treeView-D4JQ5SDB-EVGY4VYS.js"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:a(async()=>{let{createArchitectureServices:e}=await import("./architecture-WOLXFQ4H-AWAC3VBS.js"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:a(async()=>{let{createGitGraphServices:e}=await import("./gitGraph-VSP46ZUC-ZCBCDVNF.js"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),eventmodeling:a(async()=>{let{createEventModelingServices:e}=await import("./eventmodeling-K75KTNOO-ROLYRDEP.js"),r=e().EventModel.parser.LangiumParser;i.eventmodeling=r},"eventmodeling"),radar:a(async()=>{let{createRadarServices:e}=await import("./radar-ABXABTNO-M6MV34GM.js"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),railroad:a(async()=>{let{createRailroadServices:e}=await import("./railroad-I3PHUGI6-YIWPGN6Q.js"),r=e().Railroad.parser.LangiumParser;i.railroad=r},"railroad"),railroadEbnf:a(async()=>{let{createRailroadEbnfServices:e}=await import("./railroad-ebnf-DWYD2UWJ-V55BXEWY.js"),r=e().RailroadEbnf.parser.LangiumParser;i.railroadEbnf=r},"railroadEbnf"),railroadAbnf:a(async()=>{let{createRailroadAbnfServices:e}=await import("./railroad-abnf-LNEFI6M7-7JHLZ2R7.js"),r=e().RailroadAbnf.parser.LangiumParser;i.railroadAbnf=r},"railroadAbnf"),railroadPeg:a(async()=>{let{createRailroadPegServices:e}=await import("./railroad-peg-JR7BVNR7-XCGKDRMK.js"),r=e().RailroadPeg.parser.LangiumParser;i.railroadPeg=r},"railroadPeg"),treemap:a(async()=>{let{createTreemapServices:e}=await import("./treemap-SAJKECNS-LN3SMFRX.js"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:a(async()=>{let{createWardleyServices:e}=await import("./wardley-7MLQ67FV-RRWOELC6.js"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley"),cynefin:a(async()=>{let{createCynefinServices:e}=await import("./cynefin-EF2NZ3EQ-TCI65RAQ.js"),r=e().Cynefin.parser.LangiumParser;i.cynefin=r},"cynefin")};async function l(e,r){let n=d[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();let t=i[e].parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new m(t);return t.value}a(l,"parse");var s=a(e=>e!==void 0&&e>=0?e:"?","formatLocation"),m=class extends Error{constructor(e){let r=e.lexerErrors.map(o=>{let t=s(o.line),c=s(o.column);return`Lexer error on line ${t}, column ${c}: ${o.message}`}).join(`
2
2
  `),n=e.parserErrors.map(o=>{let t=s(o.token.startLine),c=s(o.token.startColumn);return`Parse error on line ${t}, column ${c}: ${o.message}`}).join(`
3
3
  `);super(`Parsing failed: ${r} ${n}`),this.result=e}static{a(this,"MermaidParseError")}};export{l as a,m as b};
@@ -0,0 +1 @@
1
+ import{a as s}from"./chunk-WQHTQAFY.js";import{a as u}from"./chunk-EWYECPNJ.js";import{d as p,i as w,k as L,l as h,m as k}from"./chunk-7JQUFVT4.js";import{b as c}from"./chunk-NDAMZVXQ.js";import{a as f}from"./chunk-BOXAA5AP.js";import{e as g}from"./chunk-QLS7NIYR.js";import{C as m,O as d}from"./chunk-IVZHB6RS.js";import{b as n}from"./chunk-QQIGL7OP.js";import{a as o}from"./chunk-RJFVWYCA.js";var v={common:d,getConfig:m,insertCluster:u,insertEdge:h,insertEdgeLabel:w,insertMarkers:k,insertNode:c,interpolateToCurve:g,labelHelper:f,log:n,positionEdgeLabel:L};var a=Object.create(null),A=o(r=>{for(let e of r)a[e.name]=e},"registerLayoutLoaders"),$=o(()=>[],"elkLayoutLoaders"),E=o(()=>{A([{name:"dagre",loader:o(async()=>await import("./dagre-SPEB5RXH-KZEBD52K.js"),"loader")},{name:"swimlane",loader:o(async()=>await import("./swimlanes-UMQ2AFYF-O4W6U4RO.js"),"loader")},{name:"cose-bilkent",loader:o(async()=>await import("./cose-bilkent-JH36ORCC-2GVA7XKO.js"),"loader")},...$()])},"registerDefaultLayoutLoaders");E();var U=o(async(r,e)=>{if(!Object.hasOwn(a,r.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${r.layoutAlgorithm}`);if(r.diagramId)for(let i of r.nodes){let b=i.domId||i.id;i.domId=`${r.diagramId}-${b}`}let t=a[r.layoutAlgorithm],y=await t.loader();s(e,r.config);let O=await y.render(r,e,v,{algorithm:t.algorithm});return p(e.node()),O},"render"),l="dagre",x=o((r="",{fallback:e=l}={})=>{if(Object.hasOwn(a,r))return r;for(let t of[e,l])if(Object.hasOwn(a,t))return n.warn(`Layout algorithm ${r} is not registered. Using ${t} as fallback.`),t;throw new Error(`Neither layout algorithm ${r}, ${e}, nor ${l} is registered.`)},"getRegisteredLayoutAlgorithm");export{A as a,U as b,x as c};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-GYT4IYBZ.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as a};
1
+ import{a as i}from"./chunk-RJFVWYCA.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as a};