ocean-brain 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/README.md +115 -0
  2. package/dist/mcp.js +205 -294
  3. package/package.json +7 -6
  4. package/server/client/dist/assets/ArrowRight.es-Bm-ZXpEC.js +1 -0
  5. package/server/client/dist/assets/Calendar-BsNs3NzO.js +25 -0
  6. package/server/client/dist/assets/Callout-CviyPHKO.js +1 -0
  7. package/server/client/dist/assets/Copy.es-BPreRnP9.js +1 -0
  8. package/server/client/dist/assets/Graph-vXQQ0a-Q.js +1 -0
  9. package/server/client/dist/assets/Graph-yPE3ljW0.js +46 -0
  10. package/server/client/dist/assets/Image.es-DnR3qc_c.js +1 -0
  11. package/server/client/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  12. package/server/client/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  13. package/server/client/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  14. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  15. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  16. package/server/client/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  17. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  18. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  19. package/server/client/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  20. package/server/client/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  21. package/server/client/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  22. package/server/client/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  23. package/server/client/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  24. package/server/client/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  25. package/server/client/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  26. package/server/client/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  27. package/server/client/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  28. package/server/client/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  29. package/server/client/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  30. package/server/client/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  31. package/server/client/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  32. package/server/client/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  33. package/server/client/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  34. package/server/client/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  35. package/server/client/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  36. package/server/client/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  37. package/server/client/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  38. package/server/client/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  39. package/server/client/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  40. package/server/client/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  41. package/server/client/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  42. package/server/client/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  43. package/server/client/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  44. package/server/client/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  45. package/server/client/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  46. package/server/client/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  47. package/server/client/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  48. package/server/client/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  49. package/server/client/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  50. package/server/client/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  51. package/server/client/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  52. package/server/client/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  53. package/server/client/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  54. package/server/client/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  55. package/server/client/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  56. package/server/client/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  57. package/server/client/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  58. package/server/client/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  59. package/server/client/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  60. package/server/client/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  61. package/server/client/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  62. package/server/client/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  63. package/server/client/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  64. package/server/client/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  65. package/server/client/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  66. package/server/client/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  67. package/server/client/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  68. package/server/client/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  69. package/server/client/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  70. package/server/client/dist/assets/Note-CmreVzvQ.js +25 -0
  71. package/server/client/dist/assets/NotePropertiesPanel-DXYgE8h2.js +2 -0
  72. package/server/client/dist/assets/PencilLine.es-B9V6u64t.js +1 -0
  73. package/server/client/dist/assets/Plus.es-CRRp2u5J.js +1 -0
  74. package/server/client/dist/assets/Reminders-BOtfNeYD.js +1 -0
  75. package/server/client/dist/assets/Search-C-FB3pKf.js +1 -0
  76. package/server/client/dist/assets/SurfaceCard-GMt5xM7v.js +1 -0
  77. package/server/client/dist/assets/Tag-lBxDRE77.js +1 -0
  78. package/server/client/dist/assets/TagNotes-Bgorp_rC.js +1 -0
  79. package/server/client/dist/assets/Trash.es-svHOb5LN.js +1 -0
  80. package/server/client/dist/assets/ViewNotes-C7d10VFf.js +1 -0
  81. package/server/client/dist/assets/ViewSectionDialog-Bhw-ILop.js +102 -0
  82. package/server/client/dist/assets/Views-C7V3saUo.js +1 -0
  83. package/server/client/dist/assets/abnfDiagram-VRR7QNED-CWlV5dXw.js +1 -0
  84. package/server/client/dist/assets/app-DQBV36r_.js +50 -0
  85. package/server/client/dist/assets/app-ZgwR5t_I.css +1 -0
  86. package/server/client/dist/assets/arc-BV-n6RUX.js +1 -0
  87. package/server/client/dist/assets/architectureDiagram-ZJ3FMSHR-CekzMXdu.js +36 -0
  88. package/server/client/dist/assets/blockDiagram-677ZJIJ3-B49yHoxq.js +132 -0
  89. package/server/client/dist/assets/c4Diagram-LMCZKHZV-0AfB9NBC.js +10 -0
  90. package/server/client/dist/assets/channel-CigOulR-.js +1 -0
  91. package/server/client/dist/assets/chunk-2Q5K7J3B-DaPQAU1q.js +1 -0
  92. package/server/client/dist/assets/chunk-32BRIVSS-CfL3kZAg.js +1 -0
  93. package/server/client/dist/assets/chunk-5VM5RSS4-DeOwWPE_.js +15 -0
  94. package/server/client/dist/assets/chunk-EX3LRPZG-C3W1oc9y.js +231 -0
  95. package/server/client/dist/assets/chunk-JWPE2WC7-_Oqh79OY.js +1 -0
  96. package/server/client/dist/assets/chunk-MOJQB5TN-DDKNNzI6.js +88 -0
  97. package/server/client/dist/assets/chunk-RYQCIY6F-DCHah7CC.js +1 -0
  98. package/server/client/dist/assets/chunk-V7JOEXUC-uUOIzgxj.js +206 -0
  99. package/server/client/dist/assets/chunk-VR4S4FIN-DDVw2WPs.js +1 -0
  100. package/server/client/dist/assets/chunk-XXDRQBXY-Coo4UFm2.js +1 -0
  101. package/server/client/dist/assets/classDiagram-OUVF2IWQ-D13ISIOW.js +1 -0
  102. package/server/client/dist/assets/classDiagram-v2-EOCWNBFH-D13ISIOW.js +1 -0
  103. package/server/client/dist/assets/colors-Cc3OSVma.js +1 -0
  104. package/server/client/dist/assets/cose-bilkent-JH36ORCC-C3pHmHpD.js +1 -0
  105. package/server/client/dist/assets/cynefin-VYW2F7L2-DU_G4Atc.js +166 -0
  106. package/server/client/dist/assets/cynefinDiagram-TSTJHNR4-DZ6iiJFo.js +62 -0
  107. package/server/client/dist/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
  108. package/server/client/dist/assets/dagre-VKFMJZFB-DNELbhwC.js +4 -0
  109. package/server/client/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  110. package/server/client/dist/assets/diagram-FQU43EPY-CMEvZJ61.js +3 -0
  111. package/server/client/dist/assets/diagram-G47NLZAW-BYDtf6j9.js +24 -0
  112. package/server/client/dist/assets/diagram-NH7WQ7WH-CmXfcCQA.js +24 -0
  113. package/server/client/dist/assets/diagram-OA4YK3LP-BflTKJxU.js +30 -0
  114. package/server/client/dist/assets/diagram-WEI45ONY-KW3fKqna.js +41 -0
  115. package/server/client/dist/assets/ebnfDiagram-CCIWWBDH-CbyhY5Nj.js +1 -0
  116. package/server/client/dist/assets/erDiagram-Q63AITRT-CC2eZV8g.js +85 -0
  117. package/server/client/dist/assets/floating-ui.react-dom-BWTnA00G.js +1 -0
  118. package/server/client/dist/assets/flowDiagram-23GEKE2U-unplo7Qm.js +156 -0
  119. package/server/client/dist/assets/ganttDiagram-NO4QXBWP-BcBK5HcZ.js +292 -0
  120. package/server/client/dist/assets/gitGraphDiagram-IHSO6WYX-DgVbbb5k.js +106 -0
  121. package/server/client/dist/assets/graph-C5DFNLrC.js +1 -0
  122. package/server/client/dist/assets/image-delete-confirmation-D7xrODQV.js +1 -0
  123. package/server/client/dist/assets/image.api-QmHYjp3z.js +17 -0
  124. package/server/client/dist/assets/index-CaF9d-zG.js +1 -0
  125. package/server/client/dist/assets/infoDiagram-FWYZ7A6U-N_D9RdfG.js +2 -0
  126. package/server/client/dist/assets/init-Gi6I4Gst.js +1 -0
  127. package/server/client/dist/assets/isObject-U9U2HXiq.js +1 -0
  128. package/server/client/dist/assets/ishikawaDiagram-FXEZZL3T-BBKrzmB2.js +70 -0
  129. package/server/client/dist/assets/journeyDiagram-5HDEW3XC-NdCxLmQB.js +139 -0
  130. package/server/client/dist/assets/kanban-definition-HUTT4EX6-Ck7t4-tt.js +89 -0
  131. package/server/client/dist/assets/katex-DywYRkvg.css +1 -0
  132. package/server/client/dist/assets/katex-HP8lGamR.js +257 -0
  133. package/server/client/dist/assets/katex-x288kqHd.js +257 -0
  134. package/server/client/dist/assets/layout-Cz0MDlGi.js +1 -0
  135. package/server/client/dist/assets/linear-D6yRgDLq.js +1 -0
  136. package/server/client/dist/assets/manage-image-DCDF8AM9.js +1 -0
  137. package/server/client/dist/assets/manage-image-detail-e0ViRAj-.js +1 -0
  138. package/server/client/dist/assets/map-Mm1V-_Na.js +1 -0
  139. package/server/client/dist/assets/mcp-admin-adapter-D39G3udJ.js +1 -0
  140. package/server/client/dist/assets/{mcp-Dd98N9Hq.js → mcp-uFZkdhCi.js} +4 -4
  141. package/server/client/dist/assets/mermaid.core-B14ZAmWA.js +308 -0
  142. package/server/client/dist/assets/min-tv6RD-6E.js +1 -0
  143. package/server/client/dist/assets/mindmap-definition-LN4V7U3C-BTUqSdcP.js +96 -0
  144. package/server/client/dist/assets/note-core-DUTqUh5N.js +13 -0
  145. package/server/client/dist/assets/note-runtime-zN5ddTba.js +168 -0
  146. package/server/client/dist/assets/note-ui-CxK8ymUc.js +2 -0
  147. package/server/client/dist/assets/{index-DPI6YoDt.css → note-ui-DL8owV-U.css} +1 -1
  148. package/server/client/dist/assets/note.api-BQovzEzd.js +356 -0
  149. package/server/client/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  150. package/server/client/dist/assets/pegDiagram-2B236MQR-Cjcu3mVz.js +1 -0
  151. package/server/client/dist/assets/pieDiagram-ENE6RG2P-BxI_c22Z.js +39 -0
  152. package/server/client/dist/assets/placeholder-D3b8lZGE.js +34 -0
  153. package/server/client/dist/assets/preload-helper-BXl3LOEh.js +1 -0
  154. package/server/client/dist/assets/properties-M-yWq1D7.js +1 -0
  155. package/server/client/dist/assets/quadrantDiagram-ABIIQ3AL-DGm0a-yR.js +7 -0
  156. package/server/client/dist/assets/railroadDiagram-RFXS5EU6-DmCDu89O.js +1 -0
  157. package/server/client/dist/assets/requirementDiagram-TGXJPOKE-CBpUt7Ig.js +84 -0
  158. package/server/client/dist/assets/route-preload.js +2 -0
  159. package/server/client/dist/assets/sankeyDiagram-HTMAVEWB-BjGnDZlp.js +40 -0
  160. package/server/client/dist/assets/search-DFnzZKLd.js +1 -0
  161. package/server/client/dist/assets/sequenceDiagram-DBY2YBRQ-B7rpCfS6.js +162 -0
  162. package/server/client/dist/assets/sizeCapture-X5ZJPWSS-CUJhD0uW.js +1 -0
  163. package/server/client/dist/assets/stateDiagram-2N3HPSRC-Y9-3XqRX.js +1 -0
  164. package/server/client/dist/assets/stateDiagram-v2-6OUMAXLB-DbHXhT02.js +1 -0
  165. package/server/client/dist/assets/swimlanes-5IMT3BWC-Cs1NO9ng.js +2 -0
  166. package/server/client/dist/assets/swimlanesDiagram-G3AALYLV-DQnrq2ZC.js +8 -0
  167. package/server/client/dist/assets/{tag.api-CwmC8crB.js → tag.api-DUfjr8bg.js} +3 -3
  168. package/server/client/dist/assets/time-CfAYZipR.js +9 -0
  169. package/server/client/dist/assets/timeline-definition-FHXFAJF6-8fqD4WNL.js +120 -0
  170. package/server/client/dist/assets/toNumber-DE3J3kMD.js +1 -0
  171. package/server/client/dist/assets/transform-BUB79_za.js +1 -0
  172. package/server/client/dist/assets/trash-CClKfP1x.js +1 -0
  173. package/server/client/dist/assets/url-9nrbQs7Z.js +1 -0
  174. package/server/client/dist/assets/{useReminderMutate-DuVKxpBh.js → useReminderMutate--omDLmBV.js} +2 -2
  175. package/server/client/dist/assets/vennDiagram-L72KCM5P-BPqKkd5a.js +34 -0
  176. package/server/client/dist/assets/wardleyDiagram-EHGQE667-Cq11kU2M.js +78 -0
  177. package/server/client/dist/assets/xychartDiagram-FW5EYKEG-DJ6UzFj-.js +7 -0
  178. package/server/client/dist/index.html +10 -5
  179. package/server/dist/app.js +1 -1
  180. package/server/dist/features/image/services/delete.js +25 -1
  181. package/server/dist/features/note/graphql/note.mutation.resolver.js +38 -12
  182. package/server/dist/features/note/graphql/note.type-defs.js +1 -1
  183. package/server/dist/features/note/http/mcp.js +1 -60
  184. package/server/dist/features/note/services/authoring.js +2 -70
  185. package/server/dist/features/note/services/markdown-patch.js +80 -8
  186. package/server/dist/features/note/services/properties.js +21 -1
  187. package/server/dist/features/note/services/property-restore.js +26 -0
  188. package/server/dist/features/note/services/snapshot.js +79 -59
  189. package/server/dist/features/note/services/trash.js +16 -31
  190. package/server/dist/features/search/embedding-api-key-store.js +57 -0
  191. package/server/dist/features/search/embedding-client.js +179 -0
  192. package/server/dist/features/search/graphql/index.js +6 -0
  193. package/server/dist/features/search/graphql/resolver.js +20 -0
  194. package/server/dist/features/search/graphql/type-defs.js +30 -0
  195. package/server/dist/features/search/http/handlers.js +108 -0
  196. package/server/dist/features/search/hybrid-ranking.js +55 -0
  197. package/server/dist/features/search/hybrid-search.js +174 -0
  198. package/server/dist/features/search/note-change.js +16 -0
  199. package/server/dist/features/search/note-chunking.js +75 -0
  200. package/server/dist/features/search/search-config.js +150 -0
  201. package/server/dist/features/search/search-manager.js +431 -0
  202. package/server/dist/features/search/semantic-indexer.js +138 -0
  203. package/server/dist/features/search/sqlite-vector-index.js +636 -0
  204. package/server/dist/features/search/url-normalization.js +10 -0
  205. package/server/dist/features/tag/services/organization.js +3 -0
  206. package/server/dist/features/view/services/workspace.js +1 -1
  207. package/server/dist/main.js +2 -0
  208. package/server/dist/modules/blocknote.js +266 -80
  209. package/server/dist/modules/error-handler.js +8 -0
  210. package/server/dist/paths.js +7 -2
  211. package/server/dist/routes/api.js +37 -0
  212. package/server/dist/routes/mcp.js +0 -5
  213. package/server/dist/schema/index.js +3 -0
  214. package/server/client/dist/assets/ArrowRight.es-CbA8ey6a.js +0 -1
  215. package/server/client/dist/assets/Calendar-CgWgr1BV.js +0 -25
  216. package/server/client/dist/assets/Callout-DKruIT0f.js +0 -1
  217. package/server/client/dist/assets/Copy.es-DFbgpaNJ.js +0 -1
  218. package/server/client/dist/assets/Graph-kCltGRlY.js +0 -1
  219. package/server/client/dist/assets/Image-7W0DZwMo.js +0 -1
  220. package/server/client/dist/assets/Image.es-5pXLx9TU.js +0 -1
  221. package/server/client/dist/assets/Note-BW6Np_5g.js +0 -20
  222. package/server/client/dist/assets/Plus.es-B0sg64VJ.js +0 -1
  223. package/server/client/dist/assets/Reminders-C10fHQcl.js +0 -1
  224. package/server/client/dist/assets/Search-tf2nV4v0.js +0 -1
  225. package/server/client/dist/assets/SurfaceCard-pydtvHfu.js +0 -1
  226. package/server/client/dist/assets/Tag-uCoYbISy.js +0 -1
  227. package/server/client/dist/assets/TagNotes-CqOcQiRw.js +0 -1
  228. package/server/client/dist/assets/Trash.es-w32Goxfa.js +0 -1
  229. package/server/client/dist/assets/ViewNotes-slPXXoOY.js +0 -1
  230. package/server/client/dist/assets/ViewSectionDialog-brTrsF6G.js +0 -102
  231. package/server/client/dist/assets/Views-B_wsb-XJ.js +0 -1
  232. package/server/client/dist/assets/graph-vendor-BAF95C0g.js +0 -46
  233. package/server/client/dist/assets/image.api-CYsjXiMr.js +0 -17
  234. package/server/client/dist/assets/index-BR05aSXr.js +0 -342
  235. package/server/client/dist/assets/index-D83QbOcw.js +0 -1
  236. package/server/client/dist/assets/manage-image-BYIhWu56.js +0 -1
  237. package/server/client/dist/assets/manage-image-detail-6KgmQvbN.js +0 -1
  238. package/server/client/dist/assets/mcp-admin-adapter-DOgBsYpl.js +0 -1
  239. package/server/client/dist/assets/note-core-CMGUaW1v.js +0 -176
  240. package/server/client/dist/assets/note-vendor-Hoz9Q4-4.js +0 -54
  241. package/server/client/dist/assets/placeholder-siHGg9aK.js +0 -34
  242. package/server/client/dist/assets/properties-CyVRKgcT.js +0 -1
  243. package/server/client/dist/assets/trash-wojQBK9Z.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-DCHah7CC.js";import{_ as w,al as v,am as D,an as H,ao as Y,l,c as _,ap as W,aq as $,af as j,ar as q,ag as R,ae as F,as as z,at as K,au as G}from"./mermaid.core-B14ZAmWA.js";import{G as Q}from"./graph-C5DFNLrC.js";import{l as U}from"./layout-Cz0MDlGi.js";import"./map-Mm1V-_Na.js";import"./isObject-U9U2HXiq.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";import"./transform-BUB79_za.js";import"./toNumber-DE3J3kMD.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const u={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,u.width??0),S=te(n,X,y,t,u),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:u.width,height:u.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),u=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const p=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,d,`
3
+ data=`,p.height,`
4
+ Parent cluster`,c.height),t.setNode(c.id,p),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,p))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:p,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:p+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const p=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),u&&p.selfLoop){if(p.selfLoop.order!==1)return;const x=p.id;p.id=p.selfLoop.id,await G(i,p),p.id=x;return}await G(i,p)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const p=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-p||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",p),await F(h,e),E.get(e.id).node=e}else{const p=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",p,p?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:u}).forEach(function({edge:d,start:e,end:p}){l.info("Edge "+e+" -> "+p+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(p),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),he=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),u=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},u.originalEdge=i,u.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",u.startLabelRight="",u.startLabelLeft="",u.endLabelLeft="",u.endLabelRight="",u.arrowTypeStart="none",u.arrowTypeEnd="none",u.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,u,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,he as render};
@@ -0,0 +1 @@
1
+ function J(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if(!isFinite(n)||n===0)return null;var e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"),i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function K(n){return n=j(Math.abs(n)),n?n[1]:NaN}function Q(n,t){return function(e,i){for(var o=e.length,a=[],c=0,h=n[0],M=0;o>0&&h>0&&(M+h+1>i&&(h=Math.max(1,i-M)),a.push(e.substring(o-=h,o+h)),!((M+=h+1)>i));)h=n[c=(c+1)%n.length];return a.reverse().join(t)}}function V(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $(n){if(!(t=W.exec(n)))throw new Error("invalid format: "+n);var t;return new L({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$.prototype=L.prototype;function L(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}L.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _(n){n:for(var t=n.length,e=1,i=-1,o;e<t;++e)switch(n[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+n[e])break n;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var N;function v(n,t){var e=j(n,t);if(!e)return N=void 0,n.toPrecision(t);var i=e[0],o=e[1],a=o-(N=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+j(n,Math.max(0,t+a-1))[0]}function X(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const O={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:J,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>X(n*100,t),r:X,s:v,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function R(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nn(n){var t=n.grouping===void 0||n.thousands===void 0?R:Q(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?R:V(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",h=n.minus===void 0?"−":n.minus+"",M=n.nan===void 0?"NaN":n.nan+"";function T(f,g){f=$(f);var b=f.fill,p=f.align,m=f.sign,w=f.symbol,S=f.zero,E=f.width,F=f.comma,y=f.precision,C=f.trim,d=f.type;d==="n"?(F=!0,d="g"):O[d]||(y===void 0&&(y=12),C=!0,d="g"),(S||b==="0"&&p==="=")&&(S=!0,b="0",p="=");var q=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():""),B=(w==="$"?i:/[%p]/.test(d)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),D=O[d],H=/[defgprs%]/.test(d);y=y===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function G(r){var l=q,u=B,x,I,k;if(d==="c")u=D(r)+u,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?M:D(Math.abs(r),y),C&&(r=_(r)),P&&+r==0&&m!=="+"&&(P=!1),l=(P?m==="("?m:h:m==="-"||m==="("?"":m)+l,u=(d==="s"&&!isNaN(r)&&N!==void 0?Y[8+N/3]:"")+u+(P&&m==="("?")":""),H){for(x=-1,I=r.length;++x<I;)if(k=r.charCodeAt(x),48>k||k>57){u=(k===46?o+r.slice(x+1):r.slice(x))+u,r=r.slice(0,x);break}}}F&&!S&&(r=t(r,1/0));var z=l.length+r.length+u.length,s=z<E?new Array(E-z+1).join(b):"";switch(F&&S&&(r=t(s+r,s.length?E-u.length:1/0),s=""),p){case"<":r=l+r+u+s;break;case"=":r=l+s+r+u;break;case"^":r=s.slice(0,z=s.length>>1)+l+r+u+s.slice(z);break;default:r=s+l+r+u;break}return a(r)}return G.toString=function(){return f+""},G}function Z(f,g){var b=Math.max(-8,Math.min(8,Math.floor(K(g)/3)))*3,p=Math.pow(10,-b),m=T((f=$(f),f.type="f",f),{suffix:Y[8+b/3]});return function(w){return m(p*w)}}return{format:T,formatPrefix:Z}}var A,tn,rn;en({thousands:",",grouping:[3],currency:["$",""]});function en(n){return A=nn(n),tn=A.format,rn=A.formatPrefix,A}export{rn as a,tn as b,K as e,$ as f};
@@ -0,0 +1,3 @@
1
+ import{p as re}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,z as ue,p as xe,A as fe,y as M,B as ge,h as y,w as P,aj as he}from"./mermaid.core-B14ZAmWA.js";import{p as pe,i as be}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import{s as ve}from"./transform-BUB79_za.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),xe()},"clear");function C(){B={}}o(C,"reset");var Se=ge.eventmodeling,ke=o(()=>fe({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${P(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
2
+ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=he(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const w=f[p],R=f[p-1];w.y=R.y+R.height+s.swimlaneGap}return h}o(Y,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(be(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await pe("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
3
+ `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ve(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),ue(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,_e={parser:Ee,db:F,renderer:$e,styles:Ne};export{_e as diagram};
@@ -0,0 +1,24 @@
1
+ import{p as ge}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{_ as w,V as ye,y as ae,A as ee,E as Se,d as ve,l as te,b8 as B,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,b9 as Ae,p as Fe}from"./mermaid.core-B14ZAmWA.js";import{s as Ne}from"./chunk-VR4S4FIN-DDVw2WPs.js";import{p as Me}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import{s as U}from"./transform-BUB79_za.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Q}from"./ordinal-Cboi1Yqb.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function Ve(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ze(t,a){for(var l=this,n=[l],r,i,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function De(t,a){for(var l=this,n=[l],r=[],i,h,d,g=-1;l=n.pop();)if(r.push(l),i=l.children)for(h=0,d=i.length;h<d;++h)n.push(i[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=je)):a===void 0&&(a=Ye);for(var l=new Z(t),n,r=[l],i,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(i=h[d]=new Z(h[d])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:Ve,eachAfter:De,eachBefore:ze,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(n-a)/t.value;++d<g;)h=i[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(r-l)/t.value;++d<g;)h=i[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,i){for(var h=[],d=a.children,g,c,p=0,b=0,s=d.length,x,S,v=a.value,u,y,N,$,z,W,M;p<s;){x=r-l,S=i-n;do u=d[b++].value;while(!u&&b<s);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,z=Math.max(N/M,M/y);b<s;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>z){u-=c;break}z=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,r,v?n+=S*u/v:i):et(g,l,n,v?l+=x*u/v:r,i),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,i,h,d){at(a,n,r,i,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],i=G,h=G,d=G,g=G,c=G;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(b),r=[0],a&&s.eachBefore(Ke),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),s.x0=S,s.y0=v,s.x1=u,s.y1=y,s.children&&(x=r[s.depth+1]=i(s)/2,S+=c(s)-x,v+=h(s)-x,u-=d(s)-x,y-=g(s)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(s,S,v,u,y))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=Je(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:q(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(h=typeof s=="function"?s:q(+s),p):h},p.paddingRight=function(s){return arguments.length?(d=typeof s=="function"?s:q(+s),p):d},p.paddingBottom=function(s){return arguments.length?(g=typeof s=="function"?s:q(+s),p):g},p.paddingLeft=function(s){return arguments.length?(c=typeof s=="function"?s:q(+s),p):c},p}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(i=>{Ae(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n?.classSelector,n?.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const i=l[l.length-1].node;i.children?i.children.push(r):i.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const h=i.item;if(!h)continue;const d=i.indent?parseInt(i.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((i,h)=>{for(const d of i)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{try{const l=await Me("treemap",t);te.debug("Treemap AST:",l);const n=he.parser?.yy;if(!(n instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,i=r.getConfig(),h=i.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),s=i.nodeWidth?i.nodeWidth*E:960,x=i.nodeHeight?i.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,i.useMaxWidth);let u;try{const e=i.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=Q().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=Q().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=Q().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([s,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=U(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let V=f;for(;V.length>0;){if(V=f.substring(0,V.length-1),V.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(V+"..."),_.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),A=re.length>20,pe=A?16:38,Y=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,se=A?8:10,K=A?1:2,j=z.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=U(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*J,P=C-2*J;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const _=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(Y,Math.round(m*_))),k=m+K+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(Y,Math.round(m*_))),!(F<I&&m===D));)o.style("font-size",`${m}px`),k=m+K+F;o.style("font-size",`${m}px`),A?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),i.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=U(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=U(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+K;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*J;f.node().getComputedTextLength()>me||F+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=i.diagramPadding??8;Ne(b,ue,"flowchart",i?.useMaxWidth||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),i=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${r.sectionStrokeColor};
4
+ stroke-width: ${r.sectionStrokeWidth};
5
+ fill: ${r.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${r.leafStrokeColor};
9
+ stroke-width: ${r.leafStrokeWidth};
10
+ fill: ${r.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${h};
14
+ font-size: ${r.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${d};
18
+ font-size: ${r.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${i};
22
+ font-size: ${r.titleFontSize};
23
+ }
24
+ `},"getStyles"),ut=pt,Lt={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{Lt as diagram};
@@ -0,0 +1,24 @@
1
+ import{p as $}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{_ as b,A as m,E as C,d as S,l as w,b as D,a as T,n as E,o as P,g as z,s as A,y as F,B as W,p as _}from"./mermaid.core-B14ZAmWA.js";import{p as N}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";import"./transform-BUB79_za.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=D,this.getAccTitle=T,this.setDiagramTitle=E,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}getConfig(){const t=m({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{$(e,t);let r=-1,o=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);o.length<=l+1&&t.getPacket().length<M;){const[p,s]=I({start:a,end:i,bits:d,label:c},n,l);if(o.push(p),p.end+1===n*l&&(t.pushWord(o),o=[],n++),!s)break;({start:a,end:i,bits:d,label:c}=s)}}t.pushWord(o)},"populate"),I=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const o=t*r-1,n=t*r;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},O=b((e,t,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,B]of p.entries())j(f,B,y,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=b((e,t,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(o+l)+l;for(const s of t){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=b(({packet:e}={})=>{const t=m(H,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},"styles"),V={parser:x,get db(){return new v},renderer:G,styles:K};export{V as diagram};
@@ -0,0 +1,30 @@
1
+ import{I as X}from"./chunk-2Q5K7J3B-DaPQAU1q.js";import{p as O}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{n as G,b as Y,s as P,o as F,g as j,a as Z,_ as f,A,l as E,E as q,d as U,y as N,p as J,h as K,ah as Q,B as ee,ai as te}from"./mermaid.core-B14ZAmWA.js";import{p as ne}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";import"./transform-BUB79_za.js";var D=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>D.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(`
2
+ `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s<e.length;s++){const o=e[s];o.trim()===""||k.test(o)||$.test(o)||V.test(o)||i.push(o.replace(/\t/g," "))}if(!L(i))return{text:n,lineMap:t};const a=_(i),c=[];let l=0;for(let s=0;s<=r;s++)c.push(e[s]),l++,t.set(l,s+1);for(let s=r+1;s<e.length;s++){const o=e[s],h=o.trim(),p=s+1;if(h===""){c.push(o),l++,t.set(l,p);continue}if(k.test(o)){c.push(o),l++,t.set(l,p);continue}if($.test(o)){c.push(o),l++,t.set(l,p);continue}if(V.test(o))continue;const d=o.replace(/\t/g," "),w=S.exec(d);if(w?.index!==void 0){const g=w.index,m=Math.round(g/a)+1;let u=g+1;for(;u<d.length&&re.test(d[u]);)u++;for(;u<d.length&&d[u]===" ";)u++;const v=d.slice(u).trimEnd();if(!v)throw new Error(`Line ${p}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=ie.repeat(m);c.push(W+v),l++,t.set(l,p)}else{if(/^[\s─━│┃└┗├┣]+$/.test(d))continue;if(D.test(d))c.push(o),l++,t.set(l,p);else{if(/^\s+/.test(d))throw new Error(`Line ${p}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);c.push(o),l++,t.set(l,p)}}}return{text:c.join(`
3
+ `),lineMap:t}}f(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:j,getDiagramTitle:F,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);E.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{E.debug(`Rendering treeView diagram
4
+ `+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return`
5
+ .treeView-node-label {
6
+ font-size: ${e};
7
+ fill: ${t};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${r};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${i};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${e};
21
+ fill: ${a};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${c};
27
+ stroke: ${l};
28
+ stroke-width: 1;
29
+ }
30
+ `},"styles"),Be=ye,De={db:I,renderer:Ie,parser:fe,styles:Be};export{De as diagram};
@@ -0,0 +1,41 @@
1
+ import{p as k}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{s as R,g as E,o as I,n as _,a as F,b as D,_ as c,E as P,p as z,A as y,y as C,B as G,l as B,V,d as W}from"./mermaid.core-B14ZAmWA.js";import{p as H}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";import"./transform-BUB79_za.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:x},m=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>m.axes,"getAxes"),U=c(()=>m.curves,"getCurves"),X=c(()=>m.options,"getOptions"),Y=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule}},"setOptions"),K=c(()=>{z(),m=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:D,getAccTitle:F,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return W(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
2
+ .radarCurve-${r} {
3
+ color: ${s};
4
+ fill: ${s};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${s};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${s};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${s};
13
+ }
14
+ `}return e},"genIndexStyles"),it=c(a=>{const t=V(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${e.axisColor};
23
+ stroke-width: ${e.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ font-size: ${e.axisLabelFontSize}px;
27
+ color: ${e.axisColor};
28
+ }
29
+ .radarGraticule {
30
+ fill: ${e.graticuleColor};
31
+ fill-opacity: ${e.graticuleOpacity};
32
+ stroke: ${e.graticuleColor};
33
+ stroke-width: ${e.graticuleStrokeWidth};
34
+ }
35
+ .radarLegendText {
36
+ text-anchor: start;
37
+ font-size: ${e.legendFontSize}px;
38
+ dominant-baseline: hanging;
39
+ }
40
+ ${ot(t,e)}
41
+ `},"styles"),xt={parser:tt,db:$,renderer:nt,styles:lt};export{xt as diagram};
@@ -0,0 +1 @@
1
+ import{g as m,r as l,d as n}from"./chunk-MOJQB5TN-DDKNNzI6.js";import{p}from"./chunk-JWPE2WC7-_Oqh79OY.js";import{_ as t,l as o}from"./mermaid.core-B14ZAmWA.js";import"./transform-BUB79_za.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-DU_G4Atc.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},$={parser:g,db:n,renderer:l,styles:m};export{$ as diagram};
@@ -0,0 +1,85 @@
1
+ import{g as Bt}from"./chunk-XXDRQBXY-Coo4UFm2.js";import{s as Ft}from"./chunk-VR4S4FIN-DDVw2WPs.js";import{_ as d,b as Yt,a as Pt,s as zt,g as Gt,n as Kt,o as Ut,c as rt,l as V,p as Zt,q as jt,r as Wt,t as qt,u as Qt,v as Xt,x as Ht}from"./mermaid.core-B14ZAmWA.js";import{s as Jt}from"./transform-BUB79_za.js";import{c as $t}from"./channel-CigOulR-.js";import"./preload-helper-BXl3LOEh.js";import"./floating-ui.react-dom-BWTnA00G.js";var gt=(function(){var s=d(function(I,n,a,o){for(a=a||{},o=I.length;o--;a[I[o]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],c=[1,10],h=[1,11],l=[1,12],p=[1,13],y=[1,23],u=[1,24],m=[1,25],W=[1,26],q=[1,27],S=[1,19],Q=[1,28],B=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],G=[1,64],A=[1,61],K=[1,65],U=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],St=[1,83],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:d(function(n,a,o,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:c,24:h,26:l,28:p,29:14,30:15,31:16,32:17,33:y,34:u,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:C},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:c,24:h,26:l,28:p,29:14,30:15,31:16,32:17,33:y,34:u,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:C},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:G,42:A,45:62,46:63,48:K,49:U},s(X,[2,37]),s(X,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:G,42:A,45:62,46:63,48:K,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:St},{40:[1,86],41:[1,87]},s(Tt,[2,43],{46:88,13:z,41:G,48:K,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:St},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:G,45:105,46:63,48:K,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(X,[2,39]),s(X,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(Tt,[2,44],{46:88,13:z,41:G,48:K,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:d(function(n,a){if(a.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=a,o}},"parseError"),parse:d(function(n){var a=this,o=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,It=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(x.yy[pt]=this.yy[pt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){o.length=o.length-2*b,f.length=f.length-b,t.length=t.length-b}d(Mt,"popStack");function Rt(){var b;return b=r.pop()||_.lex()||It,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}d(Rt,"lex");for(var g,v,k,yt,w={},st,E,Ct,it;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Rt()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`:
2
+ `+_.showPosition()+`
3
+ Expecting `+it.join(", ")+", got '"+(this.terminals_[g]||g)+"'":_t="Parse error on line "+(et+1)+": Unexpected "+(g==It?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(_t,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),f.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,At=_.yyleng,e=_.yytext,et=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Vt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),yt=this.performAction.apply(w,[e,At,et,x.yy,k[1],f,t].concat(wt)),typeof yt<"u")return yt;E&&(o=o.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),Ct=j[o[o.length-2]][o[o.length-1]],o.push(Ct);break;case 3:return!0}}return!0},"parse")},Dt=(function(){var I={EOF:1,parseError:d(function(a,o){if(this.yy.parser)this.yy.parser.parseError(a,o);else throw new Error(a)},"parseError"),setInput:d(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:d(function(n){var a=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(n){this.unput(this.match.slice(n))},"less"),pastInput:d(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
5
+ `+a+"^"},"showPosition"),test_match:d(function(n,a){var o,r,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,o,r;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;t<f.length;t++)if(o=this._input.match(this.rules[f[t]]),o&&(!a||o[0].length>a[0].length)){if(a=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,f[t]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,f[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var a=this.next();return a||this.lex()},"lex"),begin:d(function(a){this.conditionStack.push(a)},"begin"),popState:d(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:d(function(a){this.begin(a)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(a,o,r,f){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return o.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return o.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return I})();dt.lexer=Dt;function tt(){this.yy={}}return d(tt,"Parser"),tt.prototype=dt,dt.Parser=tt,new tt})();gt.parser=gt;var te=gt,M,ee=(M=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Yt,this.getAccTitle=Pt,this.setAccDescription=zt,this.getAccDescription=Gt,this.setDiagramTitle=Kt,this.getDiagramTitle=Ut,this.getConfig=d(()=>rt().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,c=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&c&&(this.entities.get(i).alias=c,V.info(`Add alias '${c}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:c,shape:"erBox",look:rt().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,c){const h=this.addEntity(i);let l;for(l=c.length-1;l>=0;l--)c[l].keys||(c[l].keys=[]),c[l].comment||(c[l].comment=""),h.attributes.push(c[l]),V.debug("Added attribute ",c[l].name)}addRelationship(i,c,h,l){const p=this.entities.get(i),y=this.entities.get(h);if(!p||!y)return;const u={entityA:p.id,roleA:c,entityB:y.id,relSpec:l};this.relationships.push(u),V.debug("Added new relationship :",u)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let c=[];for(const h of i){const l=this.classes.get(h);l?.styles&&(c=[...c,...l.styles??[]].map(p=>p.trim())),l?.textStyles&&(c=[...c,...l.textStyles??[]].map(p=>p.trim()))}return c}addCssStyles(i,c){for(const h of i){const l=this.entities.get(h);if(!c||!l)return;for(const p of c)l.cssStyles.push(p)}}addClass(i,c){i.forEach(h=>{let l=this.classes.get(h);l===void 0&&(l={id:h,styles:[],textStyles:[]},this.classes.set(h,l)),c&&c.forEach(function(p){if(/color/.exec(p)){const y=p.replace("fill","bgFill");l.textStyles.push(y)}l.styles.push(p)})})}setClass(i,c){for(const h of i){const l=this.entities.get(h);if(l)for(const p of c)l.cssClasses+=" "+p}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Zt()}getData(){const i=[],c=[],h=rt();let l=0;for(const y of this.entities.keys()){const u=this.entities.get(y);u&&(u.cssCompiledStyles=this.getCompiledStyles(u.cssClasses.split(" ")),u.colorIndex=l++,i.push(u))}let p=0;for(const y of this.relationships){const u={id:jt(y.entityA,y.entityB,{prefix:"id",counter:p++}),type:"normal",curve:"basis",start:y.entityA,end:y.entityB,label:y.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:y.relSpec.cardB.toLowerCase(),arrowTypeEnd:y.relSpec.cardA.toLowerCase(),pattern:y.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};c.push(u)}return{nodes:i,edges:c,other:{},config:h,direction:"TB"}}},d(M,"ErDB"),M),vt={};qt(vt,{draw:()=>se});var se=d(async function(s,i,c,h){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:l,er:p,layout:y}=rt(),u=h.db.getData(),m=Bt(i,l);u.type=h.type,u.layoutAlgorithm=Qt(y),u.config.flowchart.nodeSpacing=p?.nodeSpacing||140,u.config.flowchart.rankSpacing=p?.rankSpacing||80,u.direction=h.db.getDirection();const{config:W}=u,{look:q}=W;q==="neo"?u.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:u.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],u.diagramId=i,await Xt(u,m),u.layoutAlgorithm==="elk"&&m.select(".edges").lower();const S=m.selectAll('[id*="-background"]');Array.from(S).length>0&&S.each(function(){const B=Jt(this),R=B.attr("id").replace("-background",""),T=m.select(`#${CSS.escape(R)}`);if(!T.empty()){const C=T.attr("transform");B.attr("transform",C)}});const Q=8;Ht.insertTitle(m,"erDiagramTitleText",p?.titleTopMargin??25,h.db.getDiagramTitle()),Ft(m,Q,"erDiagram",p?.useMaxWidth??!0)},"draw"),xt=d((s,i)=>{const c=$t,h=c(s,"r"),l=c(s,"g"),p=c(s,"b");return Wt(h,l,p,i)},"fade"),nt=new Set(["redux-color","redux-dark-color"]),ie=d(s=>{const{theme:i,look:c,bkgColorArray:h,borderColorArray:l}=s;if(!nt.has(i))return"";const p=h?.length>0;let y="";for(let u=0;u<s.THEME_COLOR_LIMIT;u++)y+=`
7
+
8
+ [data-look="${c}"][data-color-id="color-${u}"].node path {
9
+ stroke: ${l[u]};
10
+ ${p?`fill: ${h[u]};`:""}
11
+ }
12
+
13
+ [data-look="${c}"][data-color-id="color-${u}"].node rect {
14
+ stroke: ${l[u]};
15
+ ${p?`fill: ${h[u]};`:""}
16
+ }
17
+ `;return y},"genColor"),re=d(s=>{const{look:i,theme:c,erEdgeLabelBackground:h,strokeWidth:l}=s;return`
18
+ ${ie(s)}
19
+ .entityBox {
20
+ fill: ${s.mainBkg};
21
+ stroke: ${s.nodeBorder};
22
+ }
23
+
24
+ .relationshipLabelBox {
25
+ fill: ${s.tertiaryColor};
26
+ opacity: 0.7;
27
+ background-color: ${s.tertiaryColor};
28
+ rect {
29
+ opacity: 0.5;
30
+ }
31
+ }
32
+
33
+ .labelBkg {
34
+ background-color: ${nt.has(c)&&h?h:xt(s.tertiaryColor,.5)};
35
+ }
36
+
37
+ .edgeLabel {
38
+ background-color: ${nt.has(c)&&h?h:s.edgeLabelBackground};
39
+ }
40
+ .edgeLabel .label rect {
41
+ fill: ${nt.has(c)&&h?h:s.edgeLabelBackground};
42
+ }
43
+ .edgeLabel .label text {
44
+ fill: ${s.textColor};
45
+ }
46
+
47
+ .edgeLabel .label {
48
+ fill: ${s.nodeBorder};
49
+ font-size: 14px;
50
+ }
51
+
52
+ .label {
53
+ font-family: ${s.fontFamily};
54
+ color: ${s.nodeTextColor||s.textColor};
55
+ }
56
+
57
+ .edge-pattern-dashed {
58
+ stroke-dasharray: 8,8;
59
+ }
60
+
61
+ .node rect,
62
+ .node circle,
63
+ .node ellipse,
64
+ .node polygon
65
+ {
66
+ fill: ${s.mainBkg};
67
+ stroke: ${s.nodeBorder};
68
+ stroke-width: ${i==="neo"?l:"1px"};
69
+ }
70
+
71
+ .relationshipLine {
72
+ stroke: ${s.lineColor};
73
+ stroke-width: ${i==="neo"?l:"1px"};
74
+ fill: none;
75
+ }
76
+
77
+ .marker {
78
+ fill: none !important;
79
+ stroke: ${s.lineColor} !important;
80
+ stroke-width: 1;
81
+ }
82
+ [data-look=neo].labelBkg {
83
+ background-color: ${xt(s.tertiaryColor,.5)};
84
+ }
85
+ `},"getStyles"),ne=re,pe={parser:te,get db(){return new ee},renderer:vt,styles:ne};export{pe as diagram};
@@ -0,0 +1 @@
1
+ function Ce(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in t)){const c=Object.getOwnPropertyDescriptor(n,s);c&&Object.defineProperty(t,s,c.get?c:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ge(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var At={exports:{}},gt={};var zt;function Pe(){if(zt)return gt;zt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,c){var f=null;if(c!==void 0&&(f=""+c),s.key!==void 0&&(f=""+s.key),"key"in s){c={};for(var d in s)d!=="key"&&(c[d]=s[d])}else c=s;return s=c.ref,{$$typeof:t,type:n,key:f,ref:s!==void 0?s:null,props:c}}return gt.Fragment=e,gt.jsx=r,gt.jsxs=r,gt}var Gt;function Le(){return Gt||(Gt=1,At.exports=Pe()),At.exports}var zn=Le(),Tt={exports:{}},b={};var Xt;function De(){if(Xt)return b;Xt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),i=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),p=Symbol.iterator;function m(o){return o===null||typeof o!="object"?null:(o=p&&o[p]||o["@@iterator"],typeof o=="function"?o:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,v={};function x(o,g,A){this.props=o,this.context=g,this.refs=v,this.updater=A||h}x.prototype.isReactComponent={},x.prototype.setState=function(o,g){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,g,"setState")},x.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function S(){}S.prototype=x.prototype;function E(o,g,A){this.props=o,this.context=g,this.refs=v,this.updater=A||h}var R=E.prototype=new S;R.constructor=E,y(R,x.prototype),R.isPureReactComponent=!0;var T=Array.isArray;function _(){}var w={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function W(o,g,A){var O=A.ref;return{$$typeof:t,type:o,key:g,ref:O!==void 0?O:null,props:A}}function L(o,g){return W(o.type,g,o.props)}function F(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function B(o){var g={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(A){return g[A]})}var N=/\/+/g;function k(o,g){return typeof o=="object"&&o!==null&&o.key!=null?B(""+o.key):g.toString(36)}function Y(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(_,_):(o.status="pending",o.then(function(g){o.status==="pending"&&(o.status="fulfilled",o.value=g)},function(g){o.status==="pending"&&(o.status="rejected",o.reason=g)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function M(o,g,A,O,P){var D=typeof o;(D==="undefined"||D==="boolean")&&(o=null);var $=!1;if(o===null)$=!0;else switch(D){case"bigint":case"string":case"number":$=!0;break;case"object":switch(o.$$typeof){case t:case e:$=!0;break;case l:return $=o._init,M($(o._payload),g,A,O,P)}}if($)return P=P(o),$=O===""?"."+k(o,0):O,T(P)?(A="",$!=null&&(A=$.replace(N,"$&/")+"/"),M(P,g,A,"",function(Te){return Te})):P!=null&&(F(P)&&(P=L(P,A+(P.key==null||o&&o.key===P.key?"":(""+P.key).replace(N,"$&/")+"/")+$)),g.push(P)),1;$=0;var Z=O===""?".":O+":";if(T(o))for(var U=0;U<o.length;U++)O=o[U],D=Z+k(O,U),$+=M(O,g,A,D,P);else if(U=m(o),typeof U=="function")for(o=U.call(o),U=0;!(O=o.next()).done;)O=O.value,D=Z+k(O,U++),$+=M(O,g,A,D,P);else if(D==="object"){if(typeof o.then=="function")return M(Y(o),g,A,O,P);throw g=String(o),Error("Objects are not valid as a React child (found: "+(g==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":g)+"). If you meant to render a collection of children, use an array instead.")}return $}function H(o,g,A){if(o==null)return o;var O=[],P=0;return M(o,O,"","",function(D){return g.call(A,D,P++)}),O}function C(o){if(o._status===-1){var g=o._result;g=g(),g.then(function(A){(o._status===0||o._status===-1)&&(o._status=1,o._result=A)},function(A){(o._status===0||o._status===-1)&&(o._status=2,o._result=A)}),o._status===-1&&(o._status=0,o._result=g)}if(o._status===1)return o._result.default;throw o._result}var V=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var g=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(g))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Q={map:H,forEach:function(o,g,A){H(o,function(){g.apply(this,arguments)},A)},count:function(o){var g=0;return H(o,function(){g++}),g},toArray:function(o){return H(o,function(g){return g})||[]},only:function(o){if(!F(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};return b.Activity=a,b.Children=Q,b.Component=x,b.Fragment=r,b.Profiler=s,b.PureComponent=E,b.StrictMode=n,b.Suspense=u,b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,b.__COMPILER_RUNTIME={__proto__:null,c:function(o){return w.H.useMemoCache(o)}},b.cache=function(o){return function(){return o.apply(null,arguments)}},b.cacheSignal=function(){return null},b.cloneElement=function(o,g,A){if(o==null)throw Error("The argument must be a React element, but you passed "+o+".");var O=y({},o.props),P=o.key;if(g!=null)for(D in g.key!==void 0&&(P=""+g.key),g)!j.call(g,D)||D==="key"||D==="__self"||D==="__source"||D==="ref"&&g.ref===void 0||(O[D]=g[D]);var D=arguments.length-2;if(D===1)O.children=A;else if(1<D){for(var $=Array(D),Z=0;Z<D;Z++)$[Z]=arguments[Z+2];O.children=$}return W(o.type,P,O)},b.createContext=function(o){return o={$$typeof:f,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null},o.Provider=o,o.Consumer={$$typeof:c,_context:o},o},b.createElement=function(o,g,A){var O,P={},D=null;if(g!=null)for(O in g.key!==void 0&&(D=""+g.key),g)j.call(g,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(P[O]=g[O]);var $=arguments.length-2;if($===1)P.children=A;else if(1<$){for(var Z=Array($),U=0;U<$;U++)Z[U]=arguments[U+2];P.children=Z}if(o&&o.defaultProps)for(O in $=o.defaultProps,$)P[O]===void 0&&(P[O]=$[O]);return W(o,D,P)},b.createRef=function(){return{current:null}},b.forwardRef=function(o){return{$$typeof:d,render:o}},b.isValidElement=F,b.lazy=function(o){return{$$typeof:l,_payload:{_status:-1,_result:o},_init:C}},b.memo=function(o,g){return{$$typeof:i,type:o,compare:g===void 0?null:g}},b.startTransition=function(o){var g=w.T,A={};w.T=A;try{var O=o(),P=w.S;P!==null&&P(A,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(_,V)}catch(D){V(D)}finally{g!==null&&A.types!==null&&(g.types=A.types),w.T=g}},b.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},b.use=function(o){return w.H.use(o)},b.useActionState=function(o,g,A){return w.H.useActionState(o,g,A)},b.useCallback=function(o,g){return w.H.useCallback(o,g)},b.useContext=function(o){return w.H.useContext(o)},b.useDebugValue=function(){},b.useDeferredValue=function(o,g){return w.H.useDeferredValue(o,g)},b.useEffect=function(o,g){return w.H.useEffect(o,g)},b.useEffectEvent=function(o){return w.H.useEffectEvent(o)},b.useId=function(){return w.H.useId()},b.useImperativeHandle=function(o,g,A){return w.H.useImperativeHandle(o,g,A)},b.useInsertionEffect=function(o,g){return w.H.useInsertionEffect(o,g)},b.useLayoutEffect=function(o,g){return w.H.useLayoutEffect(o,g)},b.useMemo=function(o,g){return w.H.useMemo(o,g)},b.useOptimistic=function(o,g){return w.H.useOptimistic(o,g)},b.useReducer=function(o,g,A){return w.H.useReducer(o,g,A)},b.useRef=function(o){return w.H.useRef(o)},b.useState=function(o){return w.H.useState(o)},b.useSyncExternalStore=function(o,g,A){return w.H.useSyncExternalStore(o,g,A)},b.useTransition=function(){return w.H.useTransition()},b.version="19.2.4",b}var Jt;function Et(){return Jt||(Jt=1,Tt.exports=De()),Tt.exports}var I=Et();const Me=ge(I),Gn=Ce({__proto__:null,default:Me},[I]);var Ct={exports:{}},q={};var Kt;function ke(){if(Kt)return q;Kt=1;var t=Et();function e(u){var i="https://react.dev/errors/"+u;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+u+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(e(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(u,i,l){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:a==null?null:""+a,children:u,containerInfo:i,implementation:l}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(u,i){if(u==="font")return"";if(typeof i=="string")return i==="use-credentials"?i:""}return q.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,q.createPortal=function(u,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)throw Error(e(299));return c(u,i,null,l)},q.flushSync=function(u){var i=f.T,l=n.p;try{if(f.T=null,n.p=2,u)return u()}finally{f.T=i,n.p=l,n.d.f()}},q.preconnect=function(u,i){typeof u=="string"&&(i?(i=i.crossOrigin,i=typeof i=="string"?i==="use-credentials"?i:"":void 0):i=null,n.d.C(u,i))},q.prefetchDNS=function(u){typeof u=="string"&&n.d.D(u)},q.preinit=function(u,i){if(typeof u=="string"&&i&&typeof i.as=="string"){var l=i.as,a=d(l,i.crossOrigin),p=typeof i.integrity=="string"?i.integrity:void 0,m=typeof i.fetchPriority=="string"?i.fetchPriority:void 0;l==="style"?n.d.S(u,typeof i.precedence=="string"?i.precedence:void 0,{crossOrigin:a,integrity:p,fetchPriority:m}):l==="script"&&n.d.X(u,{crossOrigin:a,integrity:p,fetchPriority:m,nonce:typeof i.nonce=="string"?i.nonce:void 0})}},q.preinitModule=function(u,i){if(typeof u=="string")if(typeof i=="object"&&i!==null){if(i.as==null||i.as==="script"){var l=d(i.as,i.crossOrigin);n.d.M(u,{crossOrigin:l,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0})}}else i==null&&n.d.M(u)},q.preload=function(u,i){if(typeof u=="string"&&typeof i=="object"&&i!==null&&typeof i.as=="string"){var l=i.as,a=d(l,i.crossOrigin);n.d.L(u,l,{crossOrigin:a,integrity:typeof i.integrity=="string"?i.integrity:void 0,nonce:typeof i.nonce=="string"?i.nonce:void 0,type:typeof i.type=="string"?i.type:void 0,fetchPriority:typeof i.fetchPriority=="string"?i.fetchPriority:void 0,referrerPolicy:typeof i.referrerPolicy=="string"?i.referrerPolicy:void 0,imageSrcSet:typeof i.imageSrcSet=="string"?i.imageSrcSet:void 0,imageSizes:typeof i.imageSizes=="string"?i.imageSizes:void 0,media:typeof i.media=="string"?i.media:void 0})}},q.preloadModule=function(u,i){if(typeof u=="string")if(i){var l=d(i.as,i.crossOrigin);n.d.m(u,{as:typeof i.as=="string"&&i.as!=="script"?i.as:void 0,crossOrigin:l,integrity:typeof i.integrity=="string"?i.integrity:void 0})}else n.d.m(u)},q.requestFormReset=function(u){n.d.r(u)},q.unstable_batchedUpdates=function(u,i){return u(i)},q.useFormState=function(u,i,l){return f.H.useFormState(u,i,l)},q.useFormStatus=function(){return f.H.useHostTransitionStatus()},q.version="19.2.4",q}var Qt;function $e(){if(Qt)return Ct.exports;Qt=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ct.exports=ke(),Ct.exports}var Pt={exports:{}},Lt={},Dt={exports:{}},Mt={};var Zt;function je(){if(Zt)return Mt;Zt=1;var t=Et();function e(a,p){return a===p&&(a!==0||1/a===1/p)||a!==a&&p!==p}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,s=t.useEffect,c=t.useLayoutEffect,f=t.useDebugValue;function d(a,p){var m=p(),h=n({inst:{value:m,getSnapshot:p}}),y=h[0].inst,v=h[1];return c(function(){y.value=m,y.getSnapshot=p,u(y)&&v({inst:y})},[a,m,p]),s(function(){return u(y)&&v({inst:y}),a(function(){u(y)&&v({inst:y})})},[a]),f(m),m}function u(a){var p=a.getSnapshot;a=a.value;try{var m=p();return!r(a,m)}catch{return!0}}function i(a,p){return p()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:d;return Mt.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:l,Mt}var te;function Ne(){return te||(te=1,Dt.exports=je()),Dt.exports}var ee;function He(){if(ee)return Lt;ee=1;var t=Et(),e=Ne();function r(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var n=typeof Object.is=="function"?Object.is:r,s=e.useSyncExternalStore,c=t.useRef,f=t.useEffect,d=t.useMemo,u=t.useDebugValue;return Lt.useSyncExternalStoreWithSelector=function(i,l,a,p,m){var h=c(null);if(h.current===null){var y={hasValue:!1,value:null};h.current=y}else y=h.current;h=d(function(){function x(_){if(!S){if(S=!0,E=_,_=p(_),m!==void 0&&y.hasValue){var w=y.value;if(m(w,_))return R=w}return R=_}if(w=R,n(E,_))return w;var j=p(_);return m!==void 0&&m(w,j)?(E=_,w):(E=_,R=j)}var S=!1,E,R,T=a===void 0?null:a;return[function(){return x(l())},T===null?void 0:function(){return x(T())}]},[l,a,p,m]);var v=s(i,h[0],h[1]);return f(function(){y.hasValue=!0,y.value=v},[v]),u(v),v},Lt}var ne;function Fe(){return ne||(ne=1,Pt.exports=He()),Pt.exports}var Xn=Fe(),pe=$e();const Jn=ge(pe);function he(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=he(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Kn(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=he(t))&&(n&&(n+=" "),n+=e);return n}const Ie=["top","right","bottom","left"],it=Math.min,tt=Math.max,We={left:"right",right:"left",bottom:"top",top:"bottom"},Be={start:"end",end:"start"};function jt(t,e,r){return tt(t,it(e,r))}function nt(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function dt(t){return t.split("-")[1]}function It(t){return t==="x"?"y":"x"}function Wt(t){return t==="y"?"height":"width"}const Ye=new Set(["top","bottom"]);function G(t){return Ye.has(X(t))?"y":"x"}function Bt(t){return It(G(t))}function Ve(t,e,r){r===void 0&&(r=!1);const n=dt(t),s=Bt(t),c=Wt(s);let f=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[c]>e.floating[c]&&(f=wt(f)),[f,wt(f)]}function qe(t){const e=wt(t);return[Nt(t),e,Nt(e)]}function Nt(t){return t.replace(/start|end/g,e=>Be[e])}const re=["left","right"],oe=["right","left"],Ue=["top","bottom"],ze=["bottom","top"];function Ge(t,e,r){switch(t){case"top":case"bottom":return r?e?oe:re:e?re:oe;case"left":case"right":return e?Ue:ze;default:return[]}}function Xe(t,e,r,n){const s=dt(t);let c=Ge(X(t),r==="start",n);return s&&(c=c.map(f=>f+"-"+s),e&&(c=c.concat(c.map(Nt)))),c}function wt(t){return t.replace(/left|right|bottom|top/g,e=>We[e])}function Je(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yt(t){return typeof t!="number"?Je(t):{top:t,right:t,bottom:t,left:t}}function lt(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function ie(t,e,r){let{reference:n,floating:s}=t;const c=G(e),f=Bt(e),d=Wt(f),u=X(e),i=c==="y",l=n.x+n.width/2-s.width/2,a=n.y+n.height/2-s.height/2,p=n[d]/2-s[d]/2;let m;switch(u){case"top":m={x:l,y:n.y-s.height};break;case"bottom":m={x:l,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:a};break;case"left":m={x:n.x-s.width,y:a};break;default:m={x:n.x,y:n.y}}switch(dt(e)){case"start":m[f]-=p*(r&&i?-1:1);break;case"end":m[f]+=p*(r&&i?-1:1);break}return m}async function Ke(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:c,rects:f,elements:d,strategy:u}=t,{boundary:i="clippingAncestors",rootBoundary:l="viewport",elementContext:a="floating",altBoundary:p=!1,padding:m=0}=nt(e,t),h=Yt(m),v=d[p?a==="floating"?"reference":"floating":a],x=lt(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(v)))==null||r?v:v.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:i,rootBoundary:l,strategy:u})),S=a==="floating"?{x:n,y:s,width:f.floating.width,height:f.floating.height}:f.reference,E=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),R=await(c.isElement==null?void 0:c.isElement(E))?await(c.getScale==null?void 0:c.getScale(E))||{x:1,y:1}:{x:1,y:1},T=lt(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:S,offsetParent:E,strategy:u}):S);return{top:(x.top-T.top+h.top)/R.y,bottom:(T.bottom-x.bottom+h.bottom)/R.y,left:(x.left-T.left+h.left)/R.x,right:(T.right-x.right+h.right)/R.x}}const Qe=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:c=[],platform:f}=r,d=c.filter(Boolean),u=await(f.isRTL==null?void 0:f.isRTL(e));let i=await f.getElementRects({reference:t,floating:e,strategy:s}),{x:l,y:a}=ie(i,n,u),p=n,m={},h=0;for(let v=0;v<d.length;v++){var y;const{name:x,fn:S}=d[v],{x:E,y:R,data:T,reset:_}=await S({x:l,y:a,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:i,platform:{...f,detectOverflow:(y=f.detectOverflow)!=null?y:Ke},elements:{reference:t,floating:e}});l=E??l,a=R??a,m={...m,[x]:{...m[x],...T}},_&&h<=50&&(h++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(i=_.rects===!0?await f.getElementRects({reference:t,floating:e,strategy:s}):_.rects),{x:l,y:a}=ie(i,p,u)),v=-1)}return{x:l,y:a,placement:p,strategy:s,middlewareData:m}},Ze=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:c,platform:f,elements:d,middlewareData:u}=e,{element:i,padding:l=0}=nt(t,e)||{};if(i==null)return{};const a=Yt(l),p={x:r,y:n},m=Bt(s),h=Wt(m),y=await f.getDimensions(i),v=m==="y",x=v?"top":"left",S=v?"bottom":"right",E=v?"clientHeight":"clientWidth",R=c.reference[h]+c.reference[m]-p[m]-c.floating[h],T=p[m]-c.reference[m],_=await(f.getOffsetParent==null?void 0:f.getOffsetParent(i));let w=_?_[E]:0;(!w||!await(f.isElement==null?void 0:f.isElement(_)))&&(w=d.floating[E]||c.floating[h]);const j=R/2-T/2,W=w/2-y[h]/2-1,L=it(a[x],W),F=it(a[S],W),B=L,N=w-y[h]-F,k=w/2-y[h]/2+j,Y=jt(B,k,N),M=!u.arrow&&dt(s)!=null&&k!==Y&&c.reference[h]/2-(k<B?L:F)-y[h]/2<0,H=M?k<B?k-B:k-N:0;return{[m]:p[m]+H,data:{[m]:Y,centerOffset:k-Y-H,...M&&{alignmentOffset:H}},reset:M}}}),tn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:c,rects:f,initialPlacement:d,platform:u,elements:i}=e,{mainAxis:l=!0,crossAxis:a=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...v}=nt(t,e);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const x=X(s),S=G(d),E=X(d)===d,R=await(u.isRTL==null?void 0:u.isRTL(i.floating)),T=p||(E||!y?[wt(d)]:qe(d)),_=h!=="none";!p&&_&&T.push(...Xe(d,y,h,R));const w=[d,...T],j=await u.detectOverflow(e,v),W=[];let L=((n=c.flip)==null?void 0:n.overflows)||[];if(l&&W.push(j[x]),a){const k=Ve(s,f,R);W.push(j[k[0]],j[k[1]])}if(L=[...L,{placement:s,overflows:W}],!W.every(k=>k<=0)){var F,B;const k=(((F=c.flip)==null?void 0:F.index)||0)+1,Y=w[k];if(Y&&(!(a==="alignment"?S!==G(Y):!1)||L.every(C=>G(C.placement)===S?C.overflows[0]>0:!0)))return{data:{index:k,overflows:L},reset:{placement:Y}};let M=(B=L.filter(H=>H.overflows[0]<=0).sort((H,C)=>H.overflows[1]-C.overflows[1])[0])==null?void 0:B.placement;if(!M)switch(m){case"bestFit":{var N;const H=(N=L.filter(C=>{if(_){const V=G(C.placement);return V===S||V==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(V=>V>0).reduce((V,Q)=>V+Q,0)]).sort((C,V)=>C[1]-V[1])[0])==null?void 0:N[0];H&&(M=H);break}case"initialPlacement":M=d;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function se(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ce(t){return Ie.some(e=>t[e]>=0)}const en=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:s="referenceHidden",...c}=nt(t,e);switch(s){case"referenceHidden":{const f=await n.detectOverflow(e,{...c,elementContext:"reference"}),d=se(f,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:ce(d)}}}case"escaped":{const f=await n.detectOverflow(e,{...c,altBoundary:!0}),d=se(f,r.floating);return{data:{escapedOffsets:d,escaped:ce(d)}}}default:return{}}}}};function ye(t){const e=it(...t.map(c=>c.left)),r=it(...t.map(c=>c.top)),n=tt(...t.map(c=>c.right)),s=tt(...t.map(c=>c.bottom));return{x:e,y:r,width:n-e,height:s-r}}function nn(t){const e=t.slice().sort((s,c)=>s.y-c.y),r=[];let n=null;for(let s=0;s<e.length;s++){const c=e[s];!n||c.y-n.y>n.height/2?r.push([c]):r[r.length-1].push(c),n=c}return r.map(s=>lt(ye(s)))}const rn=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:r,elements:n,rects:s,platform:c,strategy:f}=e,{padding:d=2,x:u,y:i}=nt(t,e),l=Array.from(await(c.getClientRects==null?void 0:c.getClientRects(n.reference))||[]),a=nn(l),p=lt(ye(l)),m=Yt(d);function h(){if(a.length===2&&a[0].left>a[1].right&&u!=null&&i!=null)return a.find(v=>u>v.left-m.left&&u<v.right+m.right&&i>v.top-m.top&&i<v.bottom+m.bottom)||p;if(a.length>=2){if(G(r)==="y"){const L=a[0],F=a[a.length-1],B=X(r)==="top",N=L.top,k=F.bottom,Y=B?L.left:F.left,M=B?L.right:F.right,H=M-Y,C=k-N;return{top:N,bottom:k,left:Y,right:M,width:H,height:C,x:Y,y:N}}const v=X(r)==="left",x=tt(...a.map(L=>L.right)),S=it(...a.map(L=>L.left)),E=a.filter(L=>v?L.left===S:L.right===x),R=E[0].top,T=E[E.length-1].bottom,_=S,w=x,j=w-_,W=T-R;return{top:R,bottom:T,left:_,right:w,width:j,height:W,x:_,y:R}}return p}const y=await c.getElementRects({reference:{getBoundingClientRect:h},floating:n.floating,strategy:f});return s.reference.x!==y.reference.x||s.reference.y!==y.reference.y||s.reference.width!==y.reference.width||s.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},ve=new Set(["left","top"]);async function on(t,e){const{placement:r,platform:n,elements:s}=t,c=await(n.isRTL==null?void 0:n.isRTL(s.floating)),f=X(r),d=dt(r),u=G(r)==="y",i=ve.has(f)?-1:1,l=c&&u?-1:1,a=nt(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:h}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return d&&typeof h=="number"&&(m=d==="end"?h*-1:h),u?{x:m*l,y:p*i}:{x:p*i,y:m*l}}const sn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:c,placement:f,middlewareData:d}=e,u=await on(e,t);return f===((r=d.offset)==null?void 0:r.placement)&&(n=d.arrow)!=null&&n.alignmentOffset?{}:{x:s+u.x,y:c+u.y,data:{...u,placement:f}}}}},cn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s,platform:c}=e,{mainAxis:f=!0,crossAxis:d=!1,limiter:u={fn:x=>{let{x:S,y:E}=x;return{x:S,y:E}}},...i}=nt(t,e),l={x:r,y:n},a=await c.detectOverflow(e,i),p=G(X(s)),m=It(p);let h=l[m],y=l[p];if(f){const x=m==="y"?"top":"left",S=m==="y"?"bottom":"right",E=h+a[x],R=h-a[S];h=jt(E,h,R)}if(d){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",E=y+a[x],R=y-a[S];y=jt(E,y,R)}const v=u.fn({...e,[m]:h,[p]:y});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[m]:f,[p]:d}}}}}},fn=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:c,middlewareData:f}=e,{offset:d=0,mainAxis:u=!0,crossAxis:i=!0}=nt(t,e),l={x:r,y:n},a=G(s),p=It(a);let m=l[p],h=l[a];const y=nt(d,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const E=p==="y"?"height":"width",R=c.reference[p]-c.floating[E]+v.mainAxis,T=c.reference[p]+c.reference[E]-v.mainAxis;m<R?m=R:m>T&&(m=T)}if(i){var x,S;const E=p==="y"?"width":"height",R=ve.has(X(s)),T=c.reference[a]-c.floating[E]+(R&&((x=f.offset)==null?void 0:x[a])||0)+(R?0:v.crossAxis),_=c.reference[a]+c.reference[E]+(R?0:((S=f.offset)==null?void 0:S[a])||0)-(R?v.crossAxis:0);h<T?h=T:h>_&&(h=_)}return{[p]:m,[a]:h}}}},un=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:c,platform:f,elements:d}=e,{apply:u=()=>{},...i}=nt(t,e),l=await f.detectOverflow(e,i),a=X(s),p=dt(s),m=G(s)==="y",{width:h,height:y}=c.floating;let v,x;a==="top"||a==="bottom"?(v=a,x=p===(await(f.isRTL==null?void 0:f.isRTL(d.floating))?"start":"end")?"left":"right"):(x=a,v=p==="end"?"top":"bottom");const S=y-l.top-l.bottom,E=h-l.left-l.right,R=it(y-l[v],S),T=it(h-l[x],E),_=!e.middlewareData.shift;let w=R,j=T;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(j=E),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(w=S),_&&!p){const L=tt(l.left,0),F=tt(l.right,0),B=tt(l.top,0),N=tt(l.bottom,0);m?j=h-2*(L!==0||F!==0?L+F:tt(l.left,l.right)):w=y-2*(B!==0||N!==0?B+N:tt(l.top,l.bottom))}await u({...e,availableWidth:j,availableHeight:w});const W=await f.getDimensions(d.floating);return h!==W.width||y!==W.height?{reset:{rects:!0}}:{}}}},Ht=Math.min,ft=Math.max,xt=Math.round,yt=Math.floor,et=t=>({x:t,y:t});function _t(){return typeof window<"u"}function mt(t){return we(t)?(t.nodeName||"").toLowerCase():"#document"}function z(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ot(t){var e;return(e=(we(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function we(t){return _t()?t instanceof Node||t instanceof z(t).Node:!1}function J(t){return _t()?t instanceof Element||t instanceof z(t).Element:!1}function rt(t){return _t()?t instanceof HTMLElement||t instanceof z(t).HTMLElement:!1}function fe(t){return!_t()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof z(t).ShadowRoot}const ln=new Set(["inline","contents"]);function ht(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=K(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!ln.has(s)}const an=new Set(["table","td","th"]);function dn(t){return an.has(mt(t))}const mn=[":popover-open",":modal"];function St(t){return mn.some(e=>{try{return t.matches(e)}catch{return!1}})}const gn=["transform","translate","scale","rotate","perspective"],pn=["transform","translate","scale","rotate","perspective","filter"],hn=["paint","layout","strict","content"];function Vt(t){const e=qt(),r=J(t)?K(t):t;return gn.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||pn.some(n=>(r.willChange||"").includes(n))||hn.some(n=>(r.contain||"").includes(n))}function yn(t){let e=st(t);for(;rt(e)&&!at(e);){if(Vt(e))return e;if(St(e))return null;e=st(e)}return null}function qt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vn=new Set(["html","body","#document"]);function at(t){return vn.has(mt(t))}function K(t){return z(t).getComputedStyle(t)}function bt(t){return J(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function st(t){if(mt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fe(t)&&t.host||ot(t);return fe(e)?e.host:e}function xe(t){const e=st(t);return at(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&ht(e)?e:xe(e)}function pt(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=xe(t),c=s===((n=t.ownerDocument)==null?void 0:n.body),f=z(s);if(c){const d=Ft(f);return e.concat(f,f.visualViewport||[],ht(s)?s:[],d&&r?pt(d):[])}return e.concat(s,pt(s,[],r))}function Ft(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Re(t){const e=K(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=rt(t),c=s?t.offsetWidth:r,f=s?t.offsetHeight:n,d=xt(r)!==c||xt(n)!==f;return d&&(r=c,n=f),{width:r,height:n,$:d}}function Ut(t){return J(t)?t:t.contextElement}function ut(t){const e=Ut(t);if(!rt(e))return et(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:c}=Re(e);let f=(c?xt(r.width):r.width)/n,d=(c?xt(r.height):r.height)/s;return(!f||!Number.isFinite(f))&&(f=1),(!d||!Number.isFinite(d))&&(d=1),{x:f,y:d}}const wn=et(0);function Ee(t){const e=z(t);return!qt()||!e.visualViewport?wn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function xn(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==z(t)?!1:e}function ct(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),c=Ut(t);let f=et(1);e&&(n?J(n)&&(f=ut(n)):f=ut(t));const d=xn(c,r,n)?Ee(c):et(0);let u=(s.left+d.x)/f.x,i=(s.top+d.y)/f.y,l=s.width/f.x,a=s.height/f.y;if(c){const p=z(c),m=n&&J(n)?z(n):n;let h=p,y=Ft(h);for(;y&&n&&m!==h;){const v=ut(y),x=y.getBoundingClientRect(),S=K(y),E=x.left+(y.clientLeft+parseFloat(S.paddingLeft))*v.x,R=x.top+(y.clientTop+parseFloat(S.paddingTop))*v.y;u*=v.x,i*=v.y,l*=v.x,a*=v.y,u+=E,i+=R,h=z(y),y=Ft(h)}}return lt({width:l,height:a,x:u,y:i})}function Ot(t,e){const r=bt(t).scrollLeft;return e?e.left+r:ct(ot(t)).left+r}function _e(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Ot(t,r),s=r.top+e.scrollTop;return{x:n,y:s}}function Rn(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const c=s==="fixed",f=ot(n),d=e?St(e.floating):!1;if(n===f||d&&c)return r;let u={scrollLeft:0,scrollTop:0},i=et(1);const l=et(0),a=rt(n);if((a||!a&&!c)&&((mt(n)!=="body"||ht(f))&&(u=bt(n)),rt(n))){const m=ct(n);i=ut(n),l.x=m.x+n.clientLeft,l.y=m.y+n.clientTop}const p=f&&!a&&!c?_e(f,u):et(0);return{width:r.width*i.x,height:r.height*i.y,x:r.x*i.x-u.scrollLeft*i.x+l.x+p.x,y:r.y*i.y-u.scrollTop*i.y+l.y+p.y}}function En(t){return Array.from(t.getClientRects())}function _n(t){const e=ot(t),r=bt(t),n=t.ownerDocument.body,s=ft(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),c=ft(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let f=-r.scrollLeft+Ot(t);const d=-r.scrollTop;return K(n).direction==="rtl"&&(f+=ft(e.clientWidth,n.clientWidth)-s),{width:s,height:c,x:f,y:d}}const ue=25;function Sn(t,e){const r=z(t),n=ot(t),s=r.visualViewport;let c=n.clientWidth,f=n.clientHeight,d=0,u=0;if(s){c=s.width,f=s.height;const l=qt();(!l||l&&e==="fixed")&&(d=s.offsetLeft,u=s.offsetTop)}const i=Ot(n);if(i<=0){const l=n.ownerDocument,a=l.body,p=getComputedStyle(a),m=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(n.clientWidth-a.clientWidth-m);h<=ue&&(c-=h)}else i<=ue&&(c+=i);return{width:c,height:f,x:d,y:u}}const bn=new Set(["absolute","fixed"]);function On(t,e){const r=ct(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,c=rt(t)?ut(t):et(1),f=t.clientWidth*c.x,d=t.clientHeight*c.y,u=s*c.x,i=n*c.y;return{width:f,height:d,x:u,y:i}}function le(t,e,r){let n;if(e==="viewport")n=Sn(t,r);else if(e==="document")n=_n(ot(t));else if(J(e))n=On(e,r);else{const s=Ee(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return lt(n)}function Se(t,e){const r=st(t);return r===e||!J(r)||at(r)?!1:K(r).position==="fixed"||Se(r,e)}function An(t,e){const r=e.get(t);if(r)return r;let n=pt(t,[],!1).filter(d=>J(d)&&mt(d)!=="body"),s=null;const c=K(t).position==="fixed";let f=c?st(t):t;for(;J(f)&&!at(f);){const d=K(f),u=Vt(f);!u&&d.position==="fixed"&&(s=null),(c?!u&&!s:!u&&d.position==="static"&&!!s&&bn.has(s.position)||ht(f)&&!u&&Se(t,f))?n=n.filter(l=>l!==f):s=d,f=st(f)}return e.set(t,n),n}function Tn(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const f=[...r==="clippingAncestors"?St(e)?[]:An(e,this._c):[].concat(r),n],d=f[0],u=f.reduce((i,l)=>{const a=le(e,l,s);return i.top=ft(a.top,i.top),i.right=Ht(a.right,i.right),i.bottom=Ht(a.bottom,i.bottom),i.left=ft(a.left,i.left),i},le(e,d,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Cn(t){const{width:e,height:r}=Re(t);return{width:e,height:r}}function Pn(t,e,r){const n=rt(e),s=ot(e),c=r==="fixed",f=ct(t,!0,c,e);let d={scrollLeft:0,scrollTop:0};const u=et(0);function i(){u.x=Ot(s)}if(n||!n&&!c)if((mt(e)!=="body"||ht(s))&&(d=bt(e)),n){const m=ct(e,!0,c,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}else s&&i();c&&!n&&s&&i();const l=s&&!n&&!c?_e(s,d):et(0),a=f.left+d.scrollLeft-u.x-l.x,p=f.top+d.scrollTop-u.y-l.y;return{x:a,y:p,width:f.width,height:f.height}}function kt(t){return K(t).position==="static"}function ae(t,e){if(!rt(t)||K(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ot(t)===r&&(r=r.ownerDocument.body),r}function be(t,e){const r=z(t);if(St(t))return r;if(!rt(t)){let s=st(t);for(;s&&!at(s);){if(J(s)&&!kt(s))return s;s=st(s)}return r}let n=ae(t,e);for(;n&&dn(n)&&kt(n);)n=ae(n,e);return n&&at(n)&&kt(n)&&!Vt(n)?r:n||yn(t)||r}const Ln=async function(t){const e=this.getOffsetParent||be,r=this.getDimensions,n=await r(t.floating);return{reference:Pn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Dn(t){return K(t).direction==="rtl"}const Mn={convertOffsetParentRelativeRectToViewportRelativeRect:Rn,getDocumentElement:ot,getClippingRect:Tn,getOffsetParent:be,getElementRects:Ln,getClientRects:En,getDimensions:Cn,getScale:ut,isElement:J,isRTL:Dn};function Oe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kn(t,e){let r=null,n;const s=ot(t);function c(){var d;clearTimeout(n),(d=r)==null||d.disconnect(),r=null}function f(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),c();const i=t.getBoundingClientRect(),{left:l,top:a,width:p,height:m}=i;if(d||e(),!p||!m)return;const h=yt(a),y=yt(s.clientWidth-(l+p)),v=yt(s.clientHeight-(a+m)),x=yt(l),E={rootMargin:-h+"px "+-y+"px "+-v+"px "+-x+"px",threshold:ft(0,Ht(1,u))||1};let R=!0;function T(_){const w=_[0].intersectionRatio;if(w!==u){if(!R)return f();w?f(!1,w):n=setTimeout(()=>{f(!1,1e-7)},1e3)}w===1&&!Oe(i,t.getBoundingClientRect())&&f(),R=!1}try{r=new IntersectionObserver(T,{...E,root:s.ownerDocument})}catch{r=new IntersectionObserver(T,E)}r.observe(t)}return f(!0),c}function Qn(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,i=Ut(t),l=s||c?[...i?pt(i):[],...pt(e)]:[];l.forEach(x=>{s&&x.addEventListener("scroll",r,{passive:!0}),c&&x.addEventListener("resize",r)});const a=i&&d?kn(i,r):null;let p=-1,m=null;f&&(m=new ResizeObserver(x=>{let[S]=x;S&&S.target===i&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(e)})),r()}),i&&!u&&m.observe(i),m.observe(e));let h,y=u?ct(t):null;u&&v();function v(){const x=ct(t);y&&!Oe(y,x)&&r(),y=x,h=requestAnimationFrame(v)}return r(),()=>{var x;l.forEach(S=>{s&&S.removeEventListener("scroll",r),c&&S.removeEventListener("resize",r)}),a?.(),(x=m)==null||x.disconnect(),m=null,u&&cancelAnimationFrame(h)}}const $n=sn,jn=cn,Nn=tn,Hn=un,Fn=en,de=Ze,In=rn,Wn=fn,Bn=(t,e,r)=>{const n=new Map,s={platform:Mn,...r},c={...s.platform,_c:n};return Qe(t,e,{...s,platform:c})};var Yn=typeof document<"u",Vn=function(){},vt=Yn?I.useLayoutEffect:Vn;function Rt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Rt(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const c=s[n];if(!(c==="_owner"&&t.$$typeof)&&!Rt(t[c],e[c]))return!1}return!0}return t!==t&&e!==e}function Ae(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function me(t,e){const r=Ae(t);return Math.round(e*r)/r}function $t(t){const e=I.useRef(t);return vt(()=>{e.current=t}),e}function Zn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:c,floating:f}={},transform:d=!0,whileElementsMounted:u,open:i}=t,[l,a]=I.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=I.useState(n);Rt(p,n)||m(n);const[h,y]=I.useState(null),[v,x]=I.useState(null),S=I.useCallback(C=>{C!==_.current&&(_.current=C,y(C))},[]),E=I.useCallback(C=>{C!==w.current&&(w.current=C,x(C))},[]),R=c||h,T=f||v,_=I.useRef(null),w=I.useRef(null),j=I.useRef(l),W=u!=null,L=$t(u),F=$t(s),B=$t(i),N=I.useCallback(()=>{if(!_.current||!w.current)return;const C={placement:e,strategy:r,middleware:p};F.current&&(C.platform=F.current),Bn(_.current,w.current,C).then(V=>{const Q={...V,isPositioned:B.current!==!1};k.current&&!Rt(j.current,Q)&&(j.current=Q,pe.flushSync(()=>{a(Q)}))})},[p,e,r,F,B]);vt(()=>{i===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,a(C=>({...C,isPositioned:!1})))},[i]);const k=I.useRef(!1);vt(()=>(k.current=!0,()=>{k.current=!1}),[]),vt(()=>{if(R&&(_.current=R),T&&(w.current=T),R&&T){if(L.current)return L.current(R,T,N);N()}},[R,T,N,L,W]);const Y=I.useMemo(()=>({reference:_,floating:w,setReference:S,setFloating:E}),[S,E]),M=I.useMemo(()=>({reference:R,floating:T}),[R,T]),H=I.useMemo(()=>{const C={position:r,left:0,top:0};if(!M.floating)return C;const V=me(M.floating,l.x),Q=me(M.floating,l.y);return d?{...C,transform:"translate("+V+"px, "+Q+"px)",...Ae(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:V,top:Q}},[r,d,M.floating,l.x,l.y]);return I.useMemo(()=>({...l,update:N,refs:Y,elements:M,floatingStyles:H}),[l,N,Y,M,H])}const qn=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?de({element:n.current,padding:s}).fn(r):{}:n?de({element:n,padding:s}).fn(r):{}}}},tr=(t,e)=>({...$n(t),options:[t,e]}),er=(t,e)=>({...jn(t),options:[t,e]}),nr=(t,e)=>({...Wn(t),options:[t,e]}),rr=(t,e)=>({...Nn(t),options:[t,e]}),or=(t,e)=>({...Hn(t),options:[t,e]}),ir=(t,e)=>({...Fn(t),options:[t,e]}),sr=(t,e)=>({...In(t),options:[t,e]}),cr=(t,e)=>({...qn(t),options:[t,e]});export{Gn as R,pe as a,Me as b,Ne as c,Jn as d,Kn as e,pt as f,ge as g,Qn as h,ir as i,zn as j,rr as k,nr as l,sr as m,cr as n,tr as o,or as p,Un as q,I as r,er as s,Et as t,Zn as u,$e as v,Xn as w};