dorkos 0.110.0 → 0.111.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 (173) hide show
  1. package/dist/bin/cli.js +57 -17
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-C4kqKgU6.js → AboutPage-BKzqcz_A.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-DiSxgHLa.js → ActivityErrorState-BXOZg9ve.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-BQneQ83b.js → ActivityPage-CFN2MEAV.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-BEKcGUIZ.js → ActivityRow-CujXx04u.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-CyEZ9jER.js → AdapterIcon-BdM7K69W.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-DpnW23lt.js → AdapterSetupWizard-3Bt9HEWF.js} +1 -1
  10. package/dist/client/assets/{AgentRequestCard-DosR0AYu.js → AgentRequestCard-CAaBGC0L.js} +1 -1
  11. package/dist/client/assets/{AppearancePage-DIeNtC-G.js → AppearancePage-BEe-Gssu.js} +1 -1
  12. package/dist/client/assets/{AttentionSignalRow-B0nSHLwZ.js → AttentionSignalRow-Cp0AJs73.js} +1 -1
  13. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BXMeIZyY.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CN1iW2cB.js} +1 -1
  14. package/dist/client/assets/{BlintzCanvas-D-7b_-SG.js → BlintzCanvas-B7qs2dxW.js} +1 -1
  15. package/dist/client/assets/{CanvasCsvContent-iBvH55TS.js → CanvasCsvContent-DiB5zXOC.js} +1 -1
  16. package/dist/client/assets/{CanvasFileContent-C4LA1NRl.js → CanvasFileContent-CDNfnWMW.js} +2 -2
  17. package/dist/client/assets/{CanvasModel3dContent-BqLPKItZ.js → CanvasModel3dContent-C7EINmuq.js} +2 -2
  18. package/dist/client/assets/{CodeMirrorDiff-BfF4jWmG.js → CodeMirrorDiff-BJhflpbC.js} +1 -1
  19. package/dist/client/assets/{CodeMirrorEditor-gShkyo4u.js → CodeMirrorEditor-SkdXRKSN.js} +1 -1
  20. package/dist/client/assets/{CommitmentList-Bz1qfyAm.js → CommitmentList-DsEn6iK1.js} +1 -1
  21. package/dist/client/assets/{CommitmentsPage-BFnrzM5F.js → CommitmentsPage-W5h0GjRr.js} +1 -1
  22. package/dist/client/assets/{ConnectionAccessLists-C5dmaUUD.js → ConnectionAccessLists-DVFqelmV.js} +1 -1
  23. package/dist/client/assets/{ConnectionsPage-BX_hUzvu.js → ConnectionsPage-CZhSh2mO.js} +1 -1
  24. package/dist/client/assets/{ConventionPage-DHtiOJYZ.js → ConventionPage-DcDBP-vR.js} +1 -1
  25. package/dist/client/assets/{ExtensionPageRoute-DluAWT6h.js → ExtensionPageRoute-mKN8Jqyx.js} +1 -1
  26. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-IBBeJf7u.js → FloatingTanStackRouterDevtools-CqogiFob-CGXG-x9g.js} +1 -1
  27. package/dist/client/assets/HandlePage-Bun58ePo.js +1 -0
  28. package/dist/client/assets/{HeartbeatPage-DcispKV9.js → HeartbeatPage-DFf7Udem.js} +1 -1
  29. package/dist/client/assets/{LexicalField-CvW19ipK.js → LexicalField-vJ284m2H.js} +1 -1
  30. package/dist/client/assets/{ManagesPage-Dru8_kTd.js → ManagesPage-mDuaA2JT.js} +1 -1
  31. package/dist/client/assets/{Marketplace-UEST-d72.js → Marketplace-BoiupH2Z.js} +1 -1
  32. package/dist/client/assets/{MarketplaceSourcesView-2XwWS0fF.js → MarketplaceSourcesView-krw9hUyu.js} +1 -1
  33. package/dist/client/assets/{McpAppFrame-DcPNmy1o.js → McpAppFrame-DmHduNgp.js} +1 -1
  34. package/dist/client/assets/{McpSigninBody-YXQtYFSW.js → McpSigninBody-DoY09n4J.js} +1 -1
  35. package/dist/client/assets/{Model3dViewer-D9HznL8w.js → Model3dViewer-BZEdR7-9.js} +1 -1
  36. package/dist/client/assets/NamePage-CXyClUPJ.js +1 -0
  37. package/dist/client/assets/{NewDirectMessageMenu-DNd6s2qQ.js → NewDirectMessageMenu-BjqYwnXW.js} +1 -1
  38. package/dist/client/assets/{NotificationsPage-Dg7_d0Fo.js → NotificationsPage-CybW1eIb.js} +1 -1
  39. package/dist/client/assets/{OpenMeshSwitch-Dw8ylRP7.js → OpenMeshSwitch-DrmjsCDY.js} +1 -1
  40. package/dist/client/assets/{OperatorIdentityForm-DtA4qIAR.js → OperatorIdentityForm-byU2FeSU.js} +1 -1
  41. package/dist/client/assets/{PermissionsPage-ZEO9Crz4.js → PermissionsPage-CP3kbqyJ.js} +1 -1
  42. package/dist/client/assets/{PersonalityPopover-Cv26YoDX.js → PersonalityPopover-BLsjgaum.js} +1 -1
  43. package/dist/client/assets/PhotoPage-hn5b42qN.js +1 -0
  44. package/dist/client/assets/{PreviewRefusedNotice-CLOum_3D.js → PreviewRefusedNotice-fTN8MJ1h.js} +1 -1
  45. package/dist/client/assets/{PromptSuggestionChips-BMFNtxGR.js → PromptSuggestionChips-BZOaY5Tx.js} +1 -1
  46. package/dist/client/assets/{ReportsToPopover-CR7Exvh7.js → ReportsToPopover-B6JvfRt3.js} +1 -1
  47. package/dist/client/assets/{RoomSurface-Bq7667r4.js → RoomSurface-BM0QO_av.js} +3 -3
  48. package/dist/client/assets/{RoomsPage-DGOvUZFv.js → RoomsPage-B-NOCLXC.js} +1 -1
  49. package/dist/client/assets/{RunsOnPopover-CpS43xkI.js → RunsOnPopover-D1jQQatj.js} +1 -1
  50. package/dist/client/assets/{RuntimeSetupDialog-Bh0jopL-.js → RuntimeSetupDialog-ufwCvCJB.js} +1 -1
  51. package/dist/client/assets/{SessionsPage-Zfpi_q-8.js → SessionsPage-CBE1KHYg.js} +1 -1
  52. package/dist/client/assets/{SkillsPage-cjkbMED1.js → SkillsPage-CPTFjEUe.js} +1 -1
  53. package/dist/client/assets/{TasksPage-HQqmMSc-.js → TasksPage-BRUqs3v5.js} +1 -1
  54. package/dist/client/assets/{ToolsPage-Bo2_xjXO.js → ToolsPage-C25kL822.js} +1 -1
  55. package/dist/client/assets/{TopologyGraph-Is22VGxs.js → TopologyGraph-of6Cp5Kj.js} +1 -1
  56. package/dist/client/assets/{TourHost-DxBh58jt.js → TourHost-zwSilkjm.js} +1 -1
  57. package/dist/client/assets/{UnlinkDialog-B70UThXm.js → UnlinkDialog-BgwHAqdW.js} +1 -1
  58. package/dist/client/assets/{WidgetErrorCard-l8cP9oJc.js → WidgetErrorCard-BQwrR6PJ.js} +6 -6
  59. package/dist/client/assets/{_shell-pedi36wq.js → _shell-bcx2y7VT.js} +1 -1
  60. package/dist/client/assets/{_shell._home-9g2nykRD.js → _shell._home-BkP0NafS.js} +1 -1
  61. package/dist/client/assets/{_shell._home.activity-M0V2vwFy.js → _shell._home.activity-BO_2ciGK.js} +1 -1
  62. package/dist/client/assets/{_shell._home.index-8qVMuOhT.js → _shell._home.index-B-OFwU9u.js} +1 -1
  63. package/dist/client/assets/{_shell._home.tasks-fGzbxCP4.js → _shell._home.tasks-jAQczH7j.js} +1 -1
  64. package/dist/client/assets/{_shell._home.workspaces-BSeaYQDz.js → _shell._home.workspaces-B34Uk1SP.js} +1 -1
  65. package/dist/client/assets/{_shell.channels-DwyPOJGL.js → _shell.channels-CGzsxvXD.js} +1 -1
  66. package/dist/client/assets/_shell.connections-BNbeBrxQ.js +1 -0
  67. package/dist/client/assets/{_shell.feedback-requests-BPwtAQNY.js → _shell.feedback-requests-B71l48KB.js} +1 -1
  68. package/dist/client/assets/_shell.marketplace-3YAsNaRk.js +1 -0
  69. package/dist/client/assets/_shell.marketplace_.sources-cI3nNBXr.js +1 -0
  70. package/dist/client/assets/_shell.session-ybAc0bwn.js +66 -0
  71. package/dist/client/assets/{_shell.team-DKZ4y6kn.js → _shell.team-BE_60YS4.js} +3 -3
  72. package/dist/client/assets/_shell.x._extensionId-jiyP599c.js +1 -0
  73. package/dist/client/assets/_shell.x._extensionId_._-jiyP599c.js +1 -0
  74. package/dist/client/assets/{agent-browser-CSBlgMiw.js → agent-browser-Cs8abkZs.js} +1 -1
  75. package/dist/client/assets/{banner-D26eekSD.js → banner-CU2Nh3Kv.js} +1 -1
  76. package/dist/client/assets/{card-CTGm0Blo.js → card-BTgwskmX.js} +1 -1
  77. package/dist/client/assets/{file-B6neiwXF.js → file-DlQX-hKl.js} +1 -1
  78. package/dist/client/assets/{file-exclamation-point-B-iziRzy.js → file-exclamation-point-Dg2iCyPM.js} +1 -1
  79. package/dist/client/assets/{find-latest-widget-fence-Dw4BJ_cR.js → find-latest-widget-fence-BGiexm6r.js} +1 -1
  80. package/dist/client/assets/{git-branch-D9jctpSd.js → git-branch-Dq_w3Iyx.js} +1 -1
  81. package/dist/client/assets/{heart-cgLUdSV5.js → heart-Bp14wOx6.js} +1 -1
  82. package/dist/client/assets/{highlighted-body-KPVGNVTW-CEOricmN.js → highlighted-body-KPVGNVTW-kD1HK_wk.js} +1 -1
  83. package/dist/client/assets/{index-DcqBUr0N.js → index--3UwFg2s.js} +1 -1
  84. package/dist/client/assets/{index-CVzwL_3n.js → index-5OyUurJr.js} +1 -1
  85. package/dist/client/assets/{index-CUu6WsiU.js → index-B0OZehWe.js} +1 -1
  86. package/dist/client/assets/{index-BWnfydnq.js → index-B2JJZXsq.js} +1 -1
  87. package/dist/client/assets/{index-ZNJbhnlq.js → index-B6_ikFYj.js} +1 -1
  88. package/dist/client/assets/{index-1flHw44u.js → index-B8R78Nnj.js} +2 -2
  89. package/dist/client/assets/{index-bHlg-Jp8.js → index-BA-nPsLw.js} +1 -1
  90. package/dist/client/assets/{index-jD4A_p4E.js → index-BAjUSKoJ.js} +1 -1
  91. package/dist/client/assets/{index-CiIZQZuK.js → index-BHsZlKfx.js} +1 -1
  92. package/dist/client/assets/{index-BO2LMWbR.js → index-BeBmUxo_.js} +1 -1
  93. package/dist/client/assets/index-BpDY3eoD.js +1 -0
  94. package/dist/client/assets/{index-CqHifKay.js → index-BxUoa3yn.js} +1 -1
  95. package/dist/client/assets/{index-CLuxURdA.js → index-BxrZwUJp.js} +1 -1
  96. package/dist/client/assets/{index-vkTtWH-G.js → index-C-DN0Vg_.js} +1 -1
  97. package/dist/client/assets/{index-ClIP6HHR.js → index-C99173Ze.js} +1 -1
  98. package/dist/client/assets/{index-DKjP63zN.js → index-CAhJGlSW.js} +1 -1
  99. package/dist/client/assets/{index-CeCuaX5y.js → index-CDWsIVX7.js} +1 -1
  100. package/dist/client/assets/{index-tf4Y0hYZ.js → index-CKCMjqcu.js} +1 -1
  101. package/dist/client/assets/{index-K2hqr6x6.js → index-C_uYJzKi.js} +3 -3
  102. package/dist/client/assets/{index-CupP-VJi.js → index-Cc280M3V.js} +1 -1
  103. package/dist/client/assets/{index-D4em25Xt.js → index-CcV9S7cO.js} +1 -1
  104. package/dist/client/assets/{index-Bkfi8Myj.js → index-DHUToGjI.js} +1 -1
  105. package/dist/client/assets/{index-LP8S5WuT.js → index-DKQDBIWq.js} +1 -1
  106. package/dist/client/assets/{index-BfgOj4sK.js → index-DKlxz3u7.js} +1 -1
  107. package/dist/client/assets/{index-CBQqdBKL.js → index-DNglWRBB.js} +1 -1
  108. package/dist/client/assets/{index-CbDB1su1.js → index-DO6a5Hey.js} +1 -1
  109. package/dist/client/assets/{index-DQDCxGNh.js → index-DS-thlE8.js} +1 -1
  110. package/dist/client/assets/{index-CsjcT6BA.js → index-DSPs6GF4.js} +1 -1
  111. package/dist/client/assets/{index-DMmU6ZLq.js → index-DW6zqLoM.js} +1 -1
  112. package/dist/client/assets/{index-_nhqr_iZ.js → index-Dm53S0up.js} +1 -1
  113. package/dist/client/assets/{index-DckajKF2.js → index-DnmtTIUB.js} +1 -1
  114. package/dist/client/assets/{index-BZKMWkth.js → index-Dr-0P6rd.js} +239 -234
  115. package/dist/client/assets/{index-CGLE5zMG.js → index-F7Lcwnfm.js} +1 -1
  116. package/dist/client/assets/{index-B38pxhxw.js → index-LszRbEbX.js} +1 -1
  117. package/dist/client/assets/{index-lKqCjbqn.js → index-PxSRtDpP.js} +1 -1
  118. package/dist/client/assets/{index-BkYvXnXR.js → index-aDNEGBTK.js} +1 -1
  119. package/dist/client/assets/{index-C3tcDwG6.js → index-gu2JYnOq.js} +1 -1
  120. package/dist/client/assets/{index-BfDqp5Sv.js → index-kHXlTLUx.js} +7 -7
  121. package/dist/client/assets/{index-CSQHKTvU.js → index-knGXyHhh.js} +1 -1
  122. package/dist/client/assets/{kickoff-D-oHin9P.js → kickoff-Btbza7bw.js} +1 -1
  123. package/dist/client/assets/{layers-BpMm7sp6.js → layers-B0oCOfxz.js} +1 -1
  124. package/dist/client/assets/{lightbulb-CxP8HLlU.js → lightbulb-D80IzMqz.js} +1 -1
  125. package/dist/client/assets/{markdown-content-plNIomQc.js → markdown-content-aNzh-54y.js} +1 -1
  126. package/dist/client/assets/{mention-pill-B9c_KFvY.js → mention-pill-BxMK0xuY.js} +1 -1
  127. package/dist/client/assets/{message-square-off-8wAP6cRG.js → message-square-off-D-CJXmTq.js} +1 -1
  128. package/dist/client/assets/{owner-notice-CopwUeso.js → owner-notice-BkrTEMDm.js} +1 -1
  129. package/dist/client/assets/{package-B7amjGSw.js → package-CoTlAnXZ.js} +1 -1
  130. package/dist/client/assets/{page-container-DMx2f-Ca.js → page-container-CPxW5T9E.js} +1 -1
  131. package/dist/client/assets/{paperclip-CA9pcNn6.js → paperclip-Cj1P85mz.js} +1 -1
  132. package/dist/client/assets/{radio-B4GY45ie.js → radio-DICkTr_p.js} +1 -1
  133. package/dist/client/assets/{room-files-source-91oNy8mM.js → room-files-source-BywWQPBN.js} +1 -1
  134. package/dist/client/assets/{rotate-ccw-clock-C-ftj_rU.js → rotate-ccw-clock-cx5RyP4l.js} +1 -1
  135. package/dist/client/assets/{rotate-cw-TrlUqVdq.js → rotate-cw-DrGRGSwy.js} +1 -1
  136. package/dist/client/assets/{scroll-area-DKse0rZa.js → scroll-area-XlDz8u4m.js} +1 -1
  137. package/dist/client/assets/{search-x-DvMuhABO.js → search-x-LIKnWE64.js} +1 -1
  138. package/dist/client/assets/{shield-x-ZcQ8NB0Z.js → shield-x-DioB6qH_.js} +1 -1
  139. package/dist/client/assets/{soul-file-B_MwZHvh.js → soul-file-C7YgkNET.js} +1 -1
  140. package/dist/client/assets/{table-BJDpTBxJ.js → table-P4N5xQn2.js} +1 -1
  141. package/dist/client/assets/{use-connector-management-BZ-sfu8O.js → use-connector-management-pgVHbXoO.js} +1 -1
  142. package/dist/client/assets/{use-delete-binding-XWrr4lIB.js → use-delete-binding-DxEiOjjh.js} +1 -1
  143. package/dist/client/assets/{use-dev-links-daERqZ4e.js → use-dev-links-BImQrE6g.js} +1 -1
  144. package/dist/client/assets/{use-external-adapter-catalog-DE5zmChu.js → use-external-adapter-catalog-D8KHMSZU.js} +1 -1
  145. package/dist/client/assets/{use-full-activity-feed-DkDB2i0G.js → use-full-activity-feed-2o7GNAMe.js} +1 -1
  146. package/dist/client/assets/use-is-below-desktop-DBet5zg_.js +1 -0
  147. package/dist/client/assets/{use-jump-back-in-Dm-2B4la.js → use-jump-back-in-D9tBJ4v5.js} +1 -1
  148. package/dist/client/assets/{use-mesh-topology-DXFAk9hJ.js → use-mesh-topology-DBeqzUoy.js} +1 -1
  149. package/dist/client/assets/use-pending-read-DmrlNHS0.js +1 -0
  150. package/dist/client/assets/{use-personality-commit-CgQm9Y7m.js → use-personality-commit-Gfoi__sT.js} +1 -1
  151. package/dist/client/assets/{use-promo-activation-CZMwcIvl.js → use-promo-activation-Bv1gnqKq.js} +1 -1
  152. package/dist/client/assets/{use-pulse-freshness-CKzRoyfz.js → use-pulse-freshness-SFRdnugS.js} +1 -1
  153. package/dist/client/assets/{use-room-follow-claim-TvE0bgPq.js → use-room-follow-claim-Cf20JiJ_.js} +1 -1
  154. package/dist/client/assets/{use-roving-tab-list-DlrB639e.js → use-roving-tab-list-3Pb7ps4E.js} +1 -1
  155. package/dist/client/assets/{use-session-canvas-8hTR83y8.js → use-session-canvas-BaXuEhw8.js} +4 -4
  156. package/dist/client/assets/{use-session-diagnostics-DAd4CfKM.js → use-session-diagnostics-7xxJ6zQQ.js} +1 -1
  157. package/dist/client/assets/{use-unclaimed-chats-DKLFamqB.js → use-unclaimed-chats-D4k-EK_f.js} +1 -1
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/index.js +865 -216
  160. package/dist/server/index.js.map +2 -2
  161. package/package.json +3 -3
  162. package/dist/client/assets/HandlePage-CjinTYw3.js +0 -1
  163. package/dist/client/assets/NamePage-D5q8YN0G.js +0 -1
  164. package/dist/client/assets/PhotoPage-BYtfMHJD.js +0 -1
  165. package/dist/client/assets/_shell.connections-DQ8AztAx.js +0 -6
  166. package/dist/client/assets/_shell.marketplace-CiM3PSqV.js +0 -1
  167. package/dist/client/assets/_shell.marketplace_.sources-C5u-WJmL.js +0 -1
  168. package/dist/client/assets/_shell.session-DYCz4inz.js +0 -66
  169. package/dist/client/assets/_shell.x._extensionId-C1fzIfH4.js +0 -1
  170. package/dist/client/assets/_shell.x._extensionId_._-C1fzIfH4.js +0 -1
  171. package/dist/client/assets/index-AYHwV9IU.js +0 -1
  172. package/dist/client/assets/use-is-below-desktop-B-Dt4c9S.js +0 -1
  173. package/dist/client/assets/use-pending-read-CH_0XPYp.js +0 -1
@@ -1,4 +1,4 @@
1
- import{or as IRn,hB as PRn,r as sn,j as de,e8 as Kan,i3 as ORn,iA as NRn,mq as $Rn,os as DRn,a3 as MN,bl as A2e,B as Wan,iC as Van,Z as r2,g_ as M2e,b2 as C2e,b1 as LRn,aa as jN,f as _Rn,hD as FRn,X as RRn,ot as BRn,ou as Fhn,eS as JRn,kd as GRn,iB as HRn,an as qRn,ov as zRn,g1 as URn,h1 as XRn,g2 as KRn,g3 as WRn,bH as VX,fo as VRn,F as Rhn,a6 as QRn,A as YRn,g$ as ZRn,lw as eBn,g6 as nBn,fR as tBn,fS as iBn,fT as rBn,fU as cBn,fV as uBn,fW as oBn,fX as sBn,fY as fBn,ow as lBn}from"./index-BZKMWkth.js";import{H as wK}from"./_shell.team-DKZ4y6kn.js";import{H as hBn}from"./heart-cgLUdSV5.js";import{a as e2e,A as aBn}from"./AdapterIcon-CyEZ9jER.js";import{s as dBn}from"./session-strategy-labels-C7Wduch3.js";import{u as bBn}from"./use-mesh-topology-DXFAk9hJ.js";import{u as wBn}from"./use-delete-binding-XWrr4lIB.js";import"./use-pending-read-CH_0XPYp.js";import"./search-x-DvMuhABO.js";import"./scroll-area-DKse0rZa.js";import"./OpenMeshSwitch-Dw8ylRP7.js";import"./table-BJDpTBxJ.js";import"./page-container-DMx2f-Ca.js";import"./CommitmentList-Bz1qfyAm.js";function Kf(d){if(typeof d=="string"||typeof d=="number")return""+d;let v="";if(Array.isArray(d))for(let E=0,A;E<d.length;E++)(A=Kf(d[E]))!==""&&(v+=(v&&" ")+A);else for(let E in d)d[E]&&(v+=(v&&" ")+E);return v}var gBn={value:()=>{}};function CK(){for(var d=0,v=arguments.length,E={},A;d<v;++d){if(!(A=arguments[d]+"")||A in E||/[\s.]/.test(A))throw new Error("illegal type: "+A);E[A]=[]}return new sK(E)}function sK(d){this._=d}function pBn(d,v){return d.trim().split(/^|\s+/).map(function(E){var A="",M=E.indexOf(".");if(M>=0&&(A=E.slice(M+1),E=E.slice(0,M)),E&&!v.hasOwnProperty(E))throw new Error("unknown type: "+E);return{type:E,name:A}})}sK.prototype=CK.prototype={constructor:sK,on:function(d,v){var E=this._,A=pBn(d+"",E),M,P=-1,m=A.length;if(arguments.length<2){for(;++P<m;)if((M=(d=A[P]).type)&&(M=mBn(E[M],d.name)))return M;return}if(v!=null&&typeof v!="function")throw new Error("invalid callback: "+v);for(;++P<m;)if(M=(d=A[P]).type)E[M]=Bhn(E[M],d.name,v);else if(v==null)for(M in E)E[M]=Bhn(E[M],d.name,null);return this},copy:function(){var d={},v=this._;for(var E in v)d[E]=v[E].slice();return new sK(d)},call:function(d,v){if((M=arguments.length-2)>0)for(var E=new Array(M),A=0,M,P;A<M;++A)E[A]=arguments[A+2];if(!this._.hasOwnProperty(d))throw new Error("unknown type: "+d);for(P=this._[d],A=0,M=P.length;A<M;++A)P[A].value.apply(v,E)},apply:function(d,v,E){if(!this._.hasOwnProperty(d))throw new Error("unknown type: "+d);for(var A=this._[d],M=0,P=A.length;M<P;++M)A[M].value.apply(v,E)}};function mBn(d,v){for(var E=0,A=d.length,M;E<A;++E)if((M=d[E]).name===v)return M.value}function Bhn(d,v,E){for(var A=0,M=d.length;A<M;++A)if(d[A].name===v){d[A]=gBn,d=d.slice(0,A).concat(d.slice(A+1));break}return E!=null&&d.push({name:v,value:E}),d}var h2e="http://www.w3.org/1999/xhtml";const Jhn={svg:"http://www.w3.org/2000/svg",xhtml:h2e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function TK(d){var v=d+="",E=v.indexOf(":");return E>=0&&(v=d.slice(0,E))!=="xmlns"&&(d=d.slice(E+1)),Jhn.hasOwnProperty(v)?{space:Jhn[v],local:d}:d}function vBn(d){return function(){var v=this.ownerDocument,E=this.namespaceURI;return E===h2e&&v.documentElement.namespaceURI===h2e?v.createElement(d):v.createElementNS(E,d)}}function yBn(d){return function(){return this.ownerDocument.createElementNS(d.space,d.local)}}function Qan(d){var v=TK(d);return(v.local?yBn:vBn)(v)}function kBn(){}function T2e(d){return d==null?kBn:function(){return this.querySelector(d)}}function EBn(d){typeof d!="function"&&(d=T2e(d));for(var v=this._groups,E=v.length,A=new Array(E),M=0;M<E;++M)for(var P=v[M],m=P.length,L=A[M]=new Array(m),H,U,Q=0;Q<m;++Q)(H=P[Q])&&(U=d.call(H,H.__data__,Q,P))&&("__data__"in H&&(U.__data__=H.__data__),L[Q]=U);return new F0(A,this._parents)}function jBn(d){return d==null?[]:Array.isArray(d)?d:Array.from(d)}function xBn(){return[]}function Yan(d){return d==null?xBn:function(){return this.querySelectorAll(d)}}function ABn(d){return function(){return jBn(d.apply(this,arguments))}}function MBn(d){typeof d=="function"?d=ABn(d):d=Yan(d);for(var v=this._groups,E=v.length,A=[],M=[],P=0;P<E;++P)for(var m=v[P],L=m.length,H,U=0;U<L;++U)(H=m[U])&&(A.push(d.call(H,H.__data__,U,m)),M.push(H));return new F0(A,M)}function Zan(d){return function(){return this.matches(d)}}function e1n(d){return function(v){return v.matches(d)}}var CBn=Array.prototype.find;function TBn(d){return function(){return CBn.call(this.children,d)}}function SBn(){return this.firstElementChild}function IBn(d){return this.select(d==null?SBn:TBn(typeof d=="function"?d:e1n(d)))}var PBn=Array.prototype.filter;function OBn(){return Array.from(this.children)}function NBn(d){return function(){return PBn.call(this.children,d)}}function $Bn(d){return this.selectAll(d==null?OBn:NBn(typeof d=="function"?d:e1n(d)))}function DBn(d){typeof d!="function"&&(d=Zan(d));for(var v=this._groups,E=v.length,A=new Array(E),M=0;M<E;++M)for(var P=v[M],m=P.length,L=A[M]=[],H,U=0;U<m;++U)(H=P[U])&&d.call(H,H.__data__,U,P)&&L.push(H);return new F0(A,this._parents)}function n1n(d){return new Array(d.length)}function LBn(){return new F0(this._enter||this._groups.map(n1n),this._parents)}function gK(d,v){this.ownerDocument=d.ownerDocument,this.namespaceURI=d.namespaceURI,this._next=null,this._parent=d,this.__data__=v}gK.prototype={constructor:gK,appendChild:function(d){return this._parent.insertBefore(d,this._next)},insertBefore:function(d,v){return this._parent.insertBefore(d,v)},querySelector:function(d){return this._parent.querySelector(d)},querySelectorAll:function(d){return this._parent.querySelectorAll(d)}};function _Bn(d){return function(){return d}}function FBn(d,v,E,A,M,P){for(var m=0,L,H=v.length,U=P.length;m<U;++m)(L=v[m])?(L.__data__=P[m],A[m]=L):E[m]=new gK(d,P[m]);for(;m<H;++m)(L=v[m])&&(M[m]=L)}function RBn(d,v,E,A,M,P,m){var L,H,U=new Map,Q=v.length,Y=P.length,G=new Array(Q),V;for(L=0;L<Q;++L)(H=v[L])&&(G[L]=V=m.call(H,H.__data__,L,v)+"",U.has(V)?M[L]=H:U.set(V,H));for(L=0;L<Y;++L)V=m.call(d,P[L],L,P)+"",(H=U.get(V))?(A[L]=H,H.__data__=P[L],U.delete(V)):E[L]=new gK(d,P[L]);for(L=0;L<Q;++L)(H=v[L])&&U.get(G[L])===H&&(M[L]=H)}function BBn(d){return d.__data__}function JBn(d,v){if(!arguments.length)return Array.from(this,BBn);var E=v?RBn:FBn,A=this._parents,M=this._groups;typeof d!="function"&&(d=_Bn(d));for(var P=M.length,m=new Array(P),L=new Array(P),H=new Array(P),U=0;U<P;++U){var Q=A[U],Y=M[U],G=Y.length,V=GBn(d.call(Q,Q&&Q.__data__,U,A)),te=V.length,X=L[U]=new Array(te),Ee=m[U]=new Array(te),ue=H[U]=new Array(G);E(Q,Y,X,Ee,ue,V,v);for(var ge=0,re=0,je,Ke;ge<te;++ge)if(je=X[ge]){for(ge>=re&&(re=ge+1);!(Ke=Ee[re])&&++re<te;);je._next=Ke||null}}return m=new F0(m,A),m._enter=L,m._exit=H,m}function GBn(d){return typeof d=="object"&&"length"in d?d:Array.from(d)}function HBn(){return new F0(this._exit||this._groups.map(n1n),this._parents)}function qBn(d,v,E){var A=this.enter(),M=this,P=this.exit();return typeof d=="function"?(A=d(A),A&&(A=A.selection())):A=A.append(d+""),v!=null&&(M=v(M),M&&(M=M.selection())),E==null?P.remove():E(P),A&&M?A.merge(M).order():M}function zBn(d){for(var v=d.selection?d.selection():d,E=this._groups,A=v._groups,M=E.length,P=A.length,m=Math.min(M,P),L=new Array(M),H=0;H<m;++H)for(var U=E[H],Q=A[H],Y=U.length,G=L[H]=new Array(Y),V,te=0;te<Y;++te)(V=U[te]||Q[te])&&(G[te]=V);for(;H<M;++H)L[H]=E[H];return new F0(L,this._parents)}function UBn(){for(var d=this._groups,v=-1,E=d.length;++v<E;)for(var A=d[v],M=A.length-1,P=A[M],m;--M>=0;)(m=A[M])&&(P&&m.compareDocumentPosition(P)^4&&P.parentNode.insertBefore(m,P),P=m);return this}function XBn(d){d||(d=KBn);function v(Y,G){return Y&&G?d(Y.__data__,G.__data__):!Y-!G}for(var E=this._groups,A=E.length,M=new Array(A),P=0;P<A;++P){for(var m=E[P],L=m.length,H=M[P]=new Array(L),U,Q=0;Q<L;++Q)(U=m[Q])&&(H[Q]=U);H.sort(v)}return new F0(M,this._parents).order()}function KBn(d,v){return d<v?-1:d>v?1:d>=v?0:NaN}function WBn(){var d=arguments[0];return arguments[0]=this,d.apply(null,arguments),this}function VBn(){return Array.from(this)}function QBn(){for(var d=this._groups,v=0,E=d.length;v<E;++v)for(var A=d[v],M=0,P=A.length;M<P;++M){var m=A[M];if(m)return m}return null}function YBn(){let d=0;for(const v of this)++d;return d}function ZBn(){return!this.node()}function eJn(d){for(var v=this._groups,E=0,A=v.length;E<A;++E)for(var M=v[E],P=0,m=M.length,L;P<m;++P)(L=M[P])&&d.call(L,L.__data__,P,M);return this}function nJn(d){return function(){this.removeAttribute(d)}}function tJn(d){return function(){this.removeAttributeNS(d.space,d.local)}}function iJn(d,v){return function(){this.setAttribute(d,v)}}function rJn(d,v){return function(){this.setAttributeNS(d.space,d.local,v)}}function cJn(d,v){return function(){var E=v.apply(this,arguments);E==null?this.removeAttribute(d):this.setAttribute(d,E)}}function uJn(d,v){return function(){var E=v.apply(this,arguments);E==null?this.removeAttributeNS(d.space,d.local):this.setAttributeNS(d.space,d.local,E)}}function oJn(d,v){var E=TK(d);if(arguments.length<2){var A=this.node();return E.local?A.getAttributeNS(E.space,E.local):A.getAttribute(E)}return this.each((v==null?E.local?tJn:nJn:typeof v=="function"?E.local?uJn:cJn:E.local?rJn:iJn)(E,v))}function t1n(d){return d.ownerDocument&&d.ownerDocument.defaultView||d.document&&d||d.defaultView}function sJn(d){return function(){this.style.removeProperty(d)}}function fJn(d,v,E){return function(){this.style.setProperty(d,v,E)}}function lJn(d,v,E){return function(){var A=v.apply(this,arguments);A==null?this.style.removeProperty(d):this.style.setProperty(d,A,E)}}function hJn(d,v,E){return arguments.length>1?this.each((v==null?sJn:typeof v=="function"?lJn:fJn)(d,v,E??"")):Gx(this.node(),d)}function Gx(d,v){return d.style.getPropertyValue(v)||t1n(d).getComputedStyle(d,null).getPropertyValue(v)}function aJn(d){return function(){delete this[d]}}function dJn(d,v){return function(){this[d]=v}}function bJn(d,v){return function(){var E=v.apply(this,arguments);E==null?delete this[d]:this[d]=E}}function wJn(d,v){return arguments.length>1?this.each((v==null?aJn:typeof v=="function"?bJn:dJn)(d,v)):this.node()[d]}function i1n(d){return d.trim().split(/^|\s+/)}function S2e(d){return d.classList||new r1n(d)}function r1n(d){this._node=d,this._names=i1n(d.getAttribute("class")||"")}r1n.prototype={add:function(d){var v=this._names.indexOf(d);v<0&&(this._names.push(d),this._node.setAttribute("class",this._names.join(" ")))},remove:function(d){var v=this._names.indexOf(d);v>=0&&(this._names.splice(v,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(d){return this._names.indexOf(d)>=0}};function c1n(d,v){for(var E=S2e(d),A=-1,M=v.length;++A<M;)E.add(v[A])}function u1n(d,v){for(var E=S2e(d),A=-1,M=v.length;++A<M;)E.remove(v[A])}function gJn(d){return function(){c1n(this,d)}}function pJn(d){return function(){u1n(this,d)}}function mJn(d,v){return function(){(v.apply(this,arguments)?c1n:u1n)(this,d)}}function vJn(d,v){var E=i1n(d+"");if(arguments.length<2){for(var A=S2e(this.node()),M=-1,P=E.length;++M<P;)if(!A.contains(E[M]))return!1;return!0}return this.each((typeof v=="function"?mJn:v?gJn:pJn)(E,v))}function yJn(){this.textContent=""}function kJn(d){return function(){this.textContent=d}}function EJn(d){return function(){var v=d.apply(this,arguments);this.textContent=v??""}}function jJn(d){return arguments.length?this.each(d==null?yJn:(typeof d=="function"?EJn:kJn)(d)):this.node().textContent}function xJn(){this.innerHTML=""}function AJn(d){return function(){this.innerHTML=d}}function MJn(d){return function(){var v=d.apply(this,arguments);this.innerHTML=v??""}}function CJn(d){return arguments.length?this.each(d==null?xJn:(typeof d=="function"?MJn:AJn)(d)):this.node().innerHTML}function TJn(){this.nextSibling&&this.parentNode.appendChild(this)}function SJn(){return this.each(TJn)}function IJn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function PJn(){return this.each(IJn)}function OJn(d){var v=typeof d=="function"?d:Qan(d);return this.select(function(){return this.appendChild(v.apply(this,arguments))})}function NJn(){return null}function $Jn(d,v){var E=typeof d=="function"?d:Qan(d),A=v==null?NJn:typeof v=="function"?v:T2e(v);return this.select(function(){return this.insertBefore(E.apply(this,arguments),A.apply(this,arguments)||null)})}function DJn(){var d=this.parentNode;d&&d.removeChild(this)}function LJn(){return this.each(DJn)}function _Jn(){var d=this.cloneNode(!1),v=this.parentNode;return v?v.insertBefore(d,this.nextSibling):d}function FJn(){var d=this.cloneNode(!0),v=this.parentNode;return v?v.insertBefore(d,this.nextSibling):d}function RJn(d){return this.select(d?FJn:_Jn)}function BJn(d){return arguments.length?this.property("__data__",d):this.node().__data__}function JJn(d){return function(v){d.call(this,v,this.__data__)}}function GJn(d){return d.trim().split(/^|\s+/).map(function(v){var E="",A=v.indexOf(".");return A>=0&&(E=v.slice(A+1),v=v.slice(0,A)),{type:v,name:E}})}function HJn(d){return function(){var v=this.__on;if(v){for(var E=0,A=-1,M=v.length,P;E<M;++E)P=v[E],(!d.type||P.type===d.type)&&P.name===d.name?this.removeEventListener(P.type,P.listener,P.options):v[++A]=P;++A?v.length=A:delete this.__on}}}function qJn(d,v,E){return function(){var A=this.__on,M,P=JJn(v);if(A){for(var m=0,L=A.length;m<L;++m)if((M=A[m]).type===d.type&&M.name===d.name){this.removeEventListener(M.type,M.listener,M.options),this.addEventListener(M.type,M.listener=P,M.options=E),M.value=v;return}}this.addEventListener(d.type,P,E),M={type:d.type,name:d.name,value:v,listener:P,options:E},A?A.push(M):this.__on=[M]}}function zJn(d,v,E){var A=GJn(d+""),M,P=A.length,m;if(arguments.length<2){var L=this.node().__on;if(L){for(var H=0,U=L.length,Q;H<U;++H)for(M=0,Q=L[H];M<P;++M)if((m=A[M]).type===Q.type&&m.name===Q.name)return Q.value}return}for(L=v?qJn:HJn,M=0;M<P;++M)this.each(L(A[M],v,E));return this}function o1n(d,v,E){var A=t1n(d),M=A.CustomEvent;typeof M=="function"?M=new M(v,E):(M=A.document.createEvent("Event"),E?(M.initEvent(v,E.bubbles,E.cancelable),M.detail=E.detail):M.initEvent(v,!1,!1)),d.dispatchEvent(M)}function UJn(d,v){return function(){return o1n(this,d,v)}}function XJn(d,v){return function(){return o1n(this,d,v.apply(this,arguments))}}function KJn(d,v){return this.each((typeof v=="function"?XJn:UJn)(d,v))}function*WJn(){for(var d=this._groups,v=0,E=d.length;v<E;++v)for(var A=d[v],M=0,P=A.length,m;M<P;++M)(m=A[M])&&(yield m)}var s1n=[null];function F0(d,v){this._groups=d,this._parents=v}function _N(){return new F0([[document.documentElement]],s1n)}function VJn(){return this}F0.prototype=_N.prototype={constructor:F0,select:EBn,selectAll:MBn,selectChild:IBn,selectChildren:$Bn,filter:DBn,data:JBn,enter:LBn,exit:HBn,join:qBn,merge:zBn,selection:VJn,order:UBn,sort:XBn,call:WBn,nodes:VBn,node:QBn,size:YBn,empty:ZBn,each:eJn,attr:oJn,style:hJn,property:wJn,classed:vJn,text:jJn,html:CJn,raise:SJn,lower:PJn,append:OJn,insert:$Jn,remove:LJn,clone:RJn,datum:BJn,on:zJn,dispatch:KJn,[Symbol.iterator]:WJn};function _0(d){return typeof d=="string"?new F0([[document.querySelector(d)]],[document.documentElement]):new F0([[d]],s1n)}function QJn(d){let v;for(;v=d.sourceEvent;)d=v;return d}function e2(d,v){if(d=QJn(d),v===void 0&&(v=d.currentTarget),v){var E=v.ownerSVGElement||v;if(E.createSVGPoint){var A=E.createSVGPoint();return A.x=d.clientX,A.y=d.clientY,A=A.matrixTransform(v.getScreenCTM().inverse()),[A.x,A.y]}if(v.getBoundingClientRect){var M=v.getBoundingClientRect();return[d.clientX-M.left-v.clientLeft,d.clientY-M.top-v.clientTop]}}return[d.pageX,d.pageY]}const YJn={passive:!1},CN={capture:!0,passive:!1};function n2e(d){d.stopImmediatePropagation()}function Bx(d){d.preventDefault(),d.stopImmediatePropagation()}function f1n(d){var v=d.document.documentElement,E=_0(d).on("dragstart.drag",Bx,CN);"onselectstart"in v?E.on("selectstart.drag",Bx,CN):(v.__noselect=v.style.MozUserSelect,v.style.MozUserSelect="none")}function l1n(d,v){var E=d.document.documentElement,A=_0(d).on("dragstart.drag",null);v&&(A.on("click.drag",Bx,CN),setTimeout(function(){A.on("click.drag",null)},0)),"onselectstart"in E?A.on("selectstart.drag",null):(E.style.MozUserSelect=E.__noselect,delete E.__noselect)}const QX=d=>()=>d;function a2e(d,{sourceEvent:v,subject:E,target:A,identifier:M,active:P,x:m,y:L,dx:H,dy:U,dispatch:Q}){Object.defineProperties(this,{type:{value:d,enumerable:!0,configurable:!0},sourceEvent:{value:v,enumerable:!0,configurable:!0},subject:{value:E,enumerable:!0,configurable:!0},target:{value:A,enumerable:!0,configurable:!0},identifier:{value:M,enumerable:!0,configurable:!0},active:{value:P,enumerable:!0,configurable:!0},x:{value:m,enumerable:!0,configurable:!0},y:{value:L,enumerable:!0,configurable:!0},dx:{value:H,enumerable:!0,configurable:!0},dy:{value:U,enumerable:!0,configurable:!0},_:{value:Q}})}a2e.prototype.on=function(){var d=this._.on.apply(this._,arguments);return d===this._?this:d};function ZJn(d){return!d.ctrlKey&&!d.button}function eGn(){return this.parentNode}function nGn(d,v){return v??{x:d.x,y:d.y}}function tGn(){return navigator.maxTouchPoints||"ontouchstart"in this}function h1n(){var d=ZJn,v=eGn,E=nGn,A=tGn,M={},P=CK("start","drag","end"),m=0,L,H,U,Q,Y=0;function G(je){je.on("mousedown.drag",V).filter(A).on("touchstart.drag",Ee).on("touchmove.drag",ue,YJn).on("touchend.drag touchcancel.drag",ge).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function V(je,Ke){if(!(Q||!d.call(this,je,Ke))){var Xe=re(this,v.call(this,je,Ke),je,Ke,"mouse");Xe&&(_0(je.view).on("mousemove.drag",te,CN).on("mouseup.drag",X,CN),f1n(je.view),n2e(je),U=!1,L=je.clientX,H=je.clientY,Xe("start",je))}}function te(je){if(Bx(je),!U){var Ke=je.clientX-L,Xe=je.clientY-H;U=Ke*Ke+Xe*Xe>Y}M.mouse("drag",je)}function X(je){_0(je.view).on("mousemove.drag mouseup.drag",null),l1n(je.view,U),Bx(je),M.mouse("end",je)}function Ee(je,Ke){if(d.call(this,je,Ke)){var Xe=je.changedTouches,Ye=v.call(this,je,Ke),kn=Xe.length,En,Zn;for(En=0;En<kn;++En)(Zn=re(this,Ye,je,Ke,Xe[En].identifier,Xe[En]))&&(n2e(je),Zn("start",je,Xe[En]))}}function ue(je){var Ke=je.changedTouches,Xe=Ke.length,Ye,kn;for(Ye=0;Ye<Xe;++Ye)(kn=M[Ke[Ye].identifier])&&(Bx(je),kn("drag",je,Ke[Ye]))}function ge(je){var Ke=je.changedTouches,Xe=Ke.length,Ye,kn;for(Q&&clearTimeout(Q),Q=setTimeout(function(){Q=null},500),Ye=0;Ye<Xe;++Ye)(kn=M[Ke[Ye].identifier])&&(n2e(je),kn("end",je,Ke[Ye]))}function re(je,Ke,Xe,Ye,kn,En){var Zn=P.copy(),Ln=e2(En||Xe,Ke),Vn,J,xe;if((xe=E.call(je,new a2e("beforestart",{sourceEvent:Xe,target:G,identifier:kn,active:m,x:Ln[0],y:Ln[1],dx:0,dy:0,dispatch:Zn}),Ye))!=null)return Vn=xe.x-Ln[0]||0,J=xe.y-Ln[1]||0,function on(rn,Sn,Fn){var dn=Ln,Gn;switch(rn){case"start":M[kn]=on,Gn=m++;break;case"end":delete M[kn],--m;case"drag":Ln=e2(Fn||Sn,Ke),Gn=m;break}Zn.call(rn,je,new a2e(rn,{sourceEvent:Sn,subject:xe,target:G,identifier:kn,active:Gn,x:Ln[0]+Vn,y:Ln[1]+J,dx:Ln[0]-dn[0],dy:Ln[1]-dn[1],dispatch:Zn}),Ye)}}return G.filter=function(je){return arguments.length?(d=typeof je=="function"?je:QX(!!je),G):d},G.container=function(je){return arguments.length?(v=typeof je=="function"?je:QX(je),G):v},G.subject=function(je){return arguments.length?(E=typeof je=="function"?je:QX(je),G):E},G.touchable=function(je){return arguments.length?(A=typeof je=="function"?je:QX(!!je),G):A},G.on=function(){var je=P.on.apply(P,arguments);return je===P?G:je},G.clickDistance=function(je){return arguments.length?(Y=(je=+je)*je,G):Math.sqrt(Y)},G}function I2e(d,v,E){d.prototype=v.prototype=E,E.constructor=d}function a1n(d,v){var E=Object.create(d.prototype);for(var A in v)E[A]=v[A];return E}function FN(){}var TN=.7,pK=1/TN,Jx="\\s*([+-]?\\d+)\\s*",SN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iGn=/^#([0-9a-f]{3,8})$/,rGn=new RegExp(`^rgb\\(${Jx},${Jx},${Jx}\\)$`),cGn=new RegExp(`^rgb\\(${qp},${qp},${qp}\\)$`),uGn=new RegExp(`^rgba\\(${Jx},${Jx},${Jx},${SN}\\)$`),oGn=new RegExp(`^rgba\\(${qp},${qp},${qp},${SN}\\)$`),sGn=new RegExp(`^hsl\\(${SN},${qp},${qp}\\)$`),fGn=new RegExp(`^hsla\\(${SN},${qp},${qp},${SN}\\)$`),Ghn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};I2e(FN,fk,{copy(d){return Object.assign(new this.constructor,this,d)},displayable(){return this.rgb().displayable()},hex:Hhn,formatHex:Hhn,formatHex8:lGn,formatHsl:hGn,formatRgb:qhn,toString:qhn});function Hhn(){return this.rgb().formatHex()}function lGn(){return this.rgb().formatHex8()}function hGn(){return d1n(this).formatHsl()}function qhn(){return this.rgb().formatRgb()}function fk(d){var v,E;return d=(d+"").trim().toLowerCase(),(v=iGn.exec(d))?(E=v[1].length,v=parseInt(v[1],16),E===6?zhn(v):E===3?new Ad(v>>8&15|v>>4&240,v>>4&15|v&240,(v&15)<<4|v&15,1):E===8?YX(v>>24&255,v>>16&255,v>>8&255,(v&255)/255):E===4?YX(v>>12&15|v>>8&240,v>>8&15|v>>4&240,v>>4&15|v&240,((v&15)<<4|v&15)/255):null):(v=rGn.exec(d))?new Ad(v[1],v[2],v[3],1):(v=cGn.exec(d))?new Ad(v[1]*255/100,v[2]*255/100,v[3]*255/100,1):(v=uGn.exec(d))?YX(v[1],v[2],v[3],v[4]):(v=oGn.exec(d))?YX(v[1]*255/100,v[2]*255/100,v[3]*255/100,v[4]):(v=sGn.exec(d))?Khn(v[1],v[2]/100,v[3]/100,1):(v=fGn.exec(d))?Khn(v[1],v[2]/100,v[3]/100,v[4]):Ghn.hasOwnProperty(d)?zhn(Ghn[d]):d==="transparent"?new Ad(NaN,NaN,NaN,0):null}function zhn(d){return new Ad(d>>16&255,d>>8&255,d&255,1)}function YX(d,v,E,A){return A<=0&&(d=v=E=NaN),new Ad(d,v,E,A)}function aGn(d){return d instanceof FN||(d=fk(d)),d?(d=d.rgb(),new Ad(d.r,d.g,d.b,d.opacity)):new Ad}function d2e(d,v,E,A){return arguments.length===1?aGn(d):new Ad(d,v,E,A??1)}function Ad(d,v,E,A){this.r=+d,this.g=+v,this.b=+E,this.opacity=+A}I2e(Ad,d2e,a1n(FN,{brighter(d){return d=d==null?pK:Math.pow(pK,d),new Ad(this.r*d,this.g*d,this.b*d,this.opacity)},darker(d){return d=d==null?TN:Math.pow(TN,d),new Ad(this.r*d,this.g*d,this.b*d,this.opacity)},rgb(){return this},clamp(){return new Ad(ok(this.r),ok(this.g),ok(this.b),mK(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Uhn,formatHex:Uhn,formatHex8:dGn,formatRgb:Xhn,toString:Xhn}));function Uhn(){return`#${uk(this.r)}${uk(this.g)}${uk(this.b)}`}function dGn(){return`#${uk(this.r)}${uk(this.g)}${uk(this.b)}${uk((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xhn(){const d=mK(this.opacity);return`${d===1?"rgb(":"rgba("}${ok(this.r)}, ${ok(this.g)}, ${ok(this.b)}${d===1?")":`, ${d})`}`}function mK(d){return isNaN(d)?1:Math.max(0,Math.min(1,d))}function ok(d){return Math.max(0,Math.min(255,Math.round(d)||0))}function uk(d){return d=ok(d),(d<16?"0":"")+d.toString(16)}function Khn(d,v,E,A){return A<=0?d=v=E=NaN:E<=0||E>=1?d=v=NaN:v<=0&&(d=NaN),new n2(d,v,E,A)}function d1n(d){if(d instanceof n2)return new n2(d.h,d.s,d.l,d.opacity);if(d instanceof FN||(d=fk(d)),!d)return new n2;if(d instanceof n2)return d;d=d.rgb();var v=d.r/255,E=d.g/255,A=d.b/255,M=Math.min(v,E,A),P=Math.max(v,E,A),m=NaN,L=P-M,H=(P+M)/2;return L?(v===P?m=(E-A)/L+(E<A)*6:E===P?m=(A-v)/L+2:m=(v-E)/L+4,L/=H<.5?P+M:2-P-M,m*=60):L=H>0&&H<1?0:m,new n2(m,L,H,d.opacity)}function bGn(d,v,E,A){return arguments.length===1?d1n(d):new n2(d,v,E,A??1)}function n2(d,v,E,A){this.h=+d,this.s=+v,this.l=+E,this.opacity=+A}I2e(n2,bGn,a1n(FN,{brighter(d){return d=d==null?pK:Math.pow(pK,d),new n2(this.h,this.s,this.l*d,this.opacity)},darker(d){return d=d==null?TN:Math.pow(TN,d),new n2(this.h,this.s,this.l*d,this.opacity)},rgb(){var d=this.h%360+(this.h<0)*360,v=isNaN(d)||isNaN(this.s)?0:this.s,E=this.l,A=E+(E<.5?E:1-E)*v,M=2*E-A;return new Ad(t2e(d>=240?d-240:d+120,M,A),t2e(d,M,A),t2e(d<120?d+240:d-120,M,A),this.opacity)},clamp(){return new n2(Whn(this.h),ZX(this.s),ZX(this.l),mK(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const d=mK(this.opacity);return`${d===1?"hsl(":"hsla("}${Whn(this.h)}, ${ZX(this.s)*100}%, ${ZX(this.l)*100}%${d===1?")":`, ${d})`}`}}));function Whn(d){return d=(d||0)%360,d<0?d+360:d}function ZX(d){return Math.max(0,Math.min(1,d||0))}function t2e(d,v,E){return(d<60?v+(E-v)*d/60:d<180?E:d<240?v+(E-v)*(240-d)/60:v)*255}const P2e=d=>()=>d;function wGn(d,v){return function(E){return d+E*v}}function gGn(d,v,E){return d=Math.pow(d,E),v=Math.pow(v,E)-d,E=1/E,function(A){return Math.pow(d+A*v,E)}}function pGn(d){return(d=+d)==1?b1n:function(v,E){return E-v?gGn(v,E,d):P2e(isNaN(v)?E:v)}}function b1n(d,v){var E=v-d;return E?wGn(d,E):P2e(isNaN(d)?v:d)}const vK=(function d(v){var E=pGn(v);function A(M,P){var m=E((M=d2e(M)).r,(P=d2e(P)).r),L=E(M.g,P.g),H=E(M.b,P.b),U=b1n(M.opacity,P.opacity);return function(Q){return M.r=m(Q),M.g=L(Q),M.b=H(Q),M.opacity=U(Q),M+""}}return A.gamma=d,A})(1);function mGn(d,v){v||(v=[]);var E=d?Math.min(v.length,d.length):0,A=v.slice(),M;return function(P){for(M=0;M<E;++M)A[M]=d[M]*(1-P)+v[M]*P;return A}}function vGn(d){return ArrayBuffer.isView(d)&&!(d instanceof DataView)}function yGn(d,v){var E=v?v.length:0,A=d?Math.min(E,d.length):0,M=new Array(A),P=new Array(E),m;for(m=0;m<A;++m)M[m]=xN(d[m],v[m]);for(;m<E;++m)P[m]=v[m];return function(L){for(m=0;m<A;++m)P[m]=M[m](L);return P}}function kGn(d,v){var E=new Date;return d=+d,v=+v,function(A){return E.setTime(d*(1-A)+v*A),E}}function Hp(d,v){return d=+d,v=+v,function(E){return d*(1-E)+v*E}}function EGn(d,v){var E={},A={},M;(d===null||typeof d!="object")&&(d={}),(v===null||typeof v!="object")&&(v={});for(M in v)M in d?E[M]=xN(d[M],v[M]):A[M]=v[M];return function(P){for(M in E)A[M]=E[M](P);return A}}var b2e=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,i2e=new RegExp(b2e.source,"g");function jGn(d){return function(){return d}}function xGn(d){return function(v){return d(v)+""}}function w1n(d,v){var E=b2e.lastIndex=i2e.lastIndex=0,A,M,P,m=-1,L=[],H=[];for(d=d+"",v=v+"";(A=b2e.exec(d))&&(M=i2e.exec(v));)(P=M.index)>E&&(P=v.slice(E,P),L[m]?L[m]+=P:L[++m]=P),(A=A[0])===(M=M[0])?L[m]?L[m]+=M:L[++m]=M:(L[++m]=null,H.push({i:m,x:Hp(A,M)})),E=i2e.lastIndex;return E<v.length&&(P=v.slice(E),L[m]?L[m]+=P:L[++m]=P),L.length<2?H[0]?xGn(H[0].x):jGn(v):(v=H.length,function(U){for(var Q=0,Y;Q<v;++Q)L[(Y=H[Q]).i]=Y.x(U);return L.join("")})}function xN(d,v){var E=typeof v,A;return v==null||E==="boolean"?P2e(v):(E==="number"?Hp:E==="string"?(A=fk(v))?(v=A,vK):w1n:v instanceof fk?vK:v instanceof Date?kGn:vGn(v)?mGn:Array.isArray(v)?yGn:typeof v.valueOf!="function"&&typeof v.toString!="function"||isNaN(v)?EGn:Hp)(d,v)}var Vhn=180/Math.PI,w2e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function g1n(d,v,E,A,M,P){var m,L,H;return(m=Math.sqrt(d*d+v*v))&&(d/=m,v/=m),(H=d*E+v*A)&&(E-=d*H,A-=v*H),(L=Math.sqrt(E*E+A*A))&&(E/=L,A/=L,H/=L),d*A<v*E&&(d=-d,v=-v,H=-H,m=-m),{translateX:M,translateY:P,rotate:Math.atan2(v,d)*Vhn,skewX:Math.atan(H)*Vhn,scaleX:m,scaleY:L}}var eK;function AGn(d){const v=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(d+"");return v.isIdentity?w2e:g1n(v.a,v.b,v.c,v.d,v.e,v.f)}function MGn(d){return d==null||(eK||(eK=document.createElementNS("http://www.w3.org/2000/svg","g")),eK.setAttribute("transform",d),!(d=eK.transform.baseVal.consolidate()))?w2e:(d=d.matrix,g1n(d.a,d.b,d.c,d.d,d.e,d.f))}function p1n(d,v,E,A){function M(U){return U.length?U.pop()+" ":""}function P(U,Q,Y,G,V,te){if(U!==Y||Q!==G){var X=V.push("translate(",null,v,null,E);te.push({i:X-4,x:Hp(U,Y)},{i:X-2,x:Hp(Q,G)})}else(Y||G)&&V.push("translate("+Y+v+G+E)}function m(U,Q,Y,G){U!==Q?(U-Q>180?Q+=360:Q-U>180&&(U+=360),G.push({i:Y.push(M(Y)+"rotate(",null,A)-2,x:Hp(U,Q)})):Q&&Y.push(M(Y)+"rotate("+Q+A)}function L(U,Q,Y,G){U!==Q?G.push({i:Y.push(M(Y)+"skewX(",null,A)-2,x:Hp(U,Q)}):Q&&Y.push(M(Y)+"skewX("+Q+A)}function H(U,Q,Y,G,V,te){if(U!==Y||Q!==G){var X=V.push(M(V)+"scale(",null,",",null,")");te.push({i:X-4,x:Hp(U,Y)},{i:X-2,x:Hp(Q,G)})}else(Y!==1||G!==1)&&V.push(M(V)+"scale("+Y+","+G+")")}return function(U,Q){var Y=[],G=[];return U=d(U),Q=d(Q),P(U.translateX,U.translateY,Q.translateX,Q.translateY,Y,G),m(U.rotate,Q.rotate,Y,G),L(U.skewX,Q.skewX,Y,G),H(U.scaleX,U.scaleY,Q.scaleX,Q.scaleY,Y,G),U=Q=null,function(V){for(var te=-1,X=G.length,Ee;++te<X;)Y[(Ee=G[te]).i]=Ee.x(V);return Y.join("")}}}var CGn=p1n(AGn,"px, ","px)","deg)"),TGn=p1n(MGn,", ",")",")"),SGn=1e-12;function Qhn(d){return((d=Math.exp(d))+1/d)/2}function IGn(d){return((d=Math.exp(d))-1/d)/2}function PGn(d){return((d=Math.exp(2*d))-1)/(d+1)}const fK=(function d(v,E,A){function M(P,m){var L=P[0],H=P[1],U=P[2],Q=m[0],Y=m[1],G=m[2],V=Q-L,te=Y-H,X=V*V+te*te,Ee,ue;if(X<SGn)ue=Math.log(G/U)/v,Ee=function(Ye){return[L+Ye*V,H+Ye*te,U*Math.exp(v*Ye*ue)]};else{var ge=Math.sqrt(X),re=(G*G-U*U+A*X)/(2*U*E*ge),je=(G*G-U*U-A*X)/(2*G*E*ge),Ke=Math.log(Math.sqrt(re*re+1)-re),Xe=Math.log(Math.sqrt(je*je+1)-je);ue=(Xe-Ke)/v,Ee=function(Ye){var kn=Ye*ue,En=Qhn(Ke),Zn=U/(E*ge)*(En*PGn(v*kn+Ke)-IGn(Ke));return[L+Zn*V,H+Zn*te,U*En/Qhn(v*kn+Ke)]}}return Ee.duration=ue*1e3*v/Math.SQRT2,Ee}return M.rho=function(P){var m=Math.max(.001,+P),L=m*m,H=L*L;return d(m,L,H)},M})(Math.SQRT2,2,4);var Hx=0,kN=0,vN=0,m1n=1e3,yK,EN,kK=0,lk=0,SK=0,IN=typeof performance=="object"&&performance.now?performance:Date,v1n=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(d){setTimeout(d,17)};function O2e(){return lk||(v1n(OGn),lk=IN.now()+SK)}function OGn(){lk=0}function EK(){this._call=this._time=this._next=null}EK.prototype=y1n.prototype={constructor:EK,restart:function(d,v,E){if(typeof d!="function")throw new TypeError("callback is not a function");E=(E==null?O2e():+E)+(v==null?0:+v),!this._next&&EN!==this&&(EN?EN._next=this:yK=this,EN=this),this._call=d,this._time=E,g2e()},stop:function(){this._call&&(this._call=null,this._time=1/0,g2e())}};function y1n(d,v,E){var A=new EK;return A.restart(d,v,E),A}function NGn(){O2e(),++Hx;for(var d=yK,v;d;)(v=lk-d._time)>=0&&d._call.call(void 0,v),d=d._next;--Hx}function Yhn(){lk=(kK=IN.now())+SK,Hx=kN=0;try{NGn()}finally{Hx=0,DGn(),lk=0}}function $Gn(){var d=IN.now(),v=d-kK;v>m1n&&(SK-=v,kK=d)}function DGn(){for(var d,v=yK,E,A=1/0;v;)v._call?(A>v._time&&(A=v._time),d=v,v=v._next):(E=v._next,v._next=null,v=d?d._next=E:yK=E);EN=d,g2e(A)}function g2e(d){if(!Hx){kN&&(kN=clearTimeout(kN));var v=d-lk;v>24?(d<1/0&&(kN=setTimeout(Yhn,d-IN.now()-SK)),vN&&(vN=clearInterval(vN))):(vN||(kK=IN.now(),vN=setInterval($Gn,m1n)),Hx=1,v1n(Yhn))}}function Zhn(d,v,E){var A=new EK;return v=v==null?0:+v,A.restart(M=>{A.stop(),d(M+v)},v,E),A}var LGn=CK("start","end","cancel","interrupt"),_Gn=[],k1n=0,ean=1,p2e=2,lK=3,nan=4,m2e=5,hK=6;function IK(d,v,E,A,M,P){var m=d.__transition;if(!m)d.__transition={};else if(E in m)return;FGn(d,E,{name:v,index:A,group:M,on:LGn,tween:_Gn,time:P.time,delay:P.delay,duration:P.duration,ease:P.ease,timer:null,state:k1n})}function N2e(d,v){var E=u2(d,v);if(E.state>k1n)throw new Error("too late; already scheduled");return E}function zp(d,v){var E=u2(d,v);if(E.state>lK)throw new Error("too late; already running");return E}function u2(d,v){var E=d.__transition;if(!E||!(E=E[v]))throw new Error("transition not found");return E}function FGn(d,v,E){var A=d.__transition,M;A[v]=E,E.timer=y1n(P,0,E.time);function P(U){E.state=ean,E.timer.restart(m,E.delay,E.time),E.delay<=U&&m(U-E.delay)}function m(U){var Q,Y,G,V;if(E.state!==ean)return H();for(Q in A)if(V=A[Q],V.name===E.name){if(V.state===lK)return Zhn(m);V.state===nan?(V.state=hK,V.timer.stop(),V.on.call("interrupt",d,d.__data__,V.index,V.group),delete A[Q]):+Q<v&&(V.state=hK,V.timer.stop(),V.on.call("cancel",d,d.__data__,V.index,V.group),delete A[Q])}if(Zhn(function(){E.state===lK&&(E.state=nan,E.timer.restart(L,E.delay,E.time),L(U))}),E.state=p2e,E.on.call("start",d,d.__data__,E.index,E.group),E.state===p2e){for(E.state=lK,M=new Array(G=E.tween.length),Q=0,Y=-1;Q<G;++Q)(V=E.tween[Q].value.call(d,d.__data__,E.index,E.group))&&(M[++Y]=V);M.length=Y+1}}function L(U){for(var Q=U<E.duration?E.ease.call(null,U/E.duration):(E.timer.restart(H),E.state=m2e,1),Y=-1,G=M.length;++Y<G;)M[Y].call(d,Q);E.state===m2e&&(E.on.call("end",d,d.__data__,E.index,E.group),H())}function H(){E.state=hK,E.timer.stop(),delete A[v];for(var U in A)return;delete d.__transition}}function aK(d,v){var E=d.__transition,A,M,P=!0,m;if(E){v=v==null?null:v+"";for(m in E){if((A=E[m]).name!==v){P=!1;continue}M=A.state>p2e&&A.state<m2e,A.state=hK,A.timer.stop(),A.on.call(M?"interrupt":"cancel",d,d.__data__,A.index,A.group),delete E[m]}P&&delete d.__transition}}function RGn(d){return this.each(function(){aK(this,d)})}function BGn(d,v){var E,A;return function(){var M=zp(this,d),P=M.tween;if(P!==E){A=E=P;for(var m=0,L=A.length;m<L;++m)if(A[m].name===v){A=A.slice(),A.splice(m,1);break}}M.tween=A}}function JGn(d,v,E){var A,M;if(typeof E!="function")throw new Error;return function(){var P=zp(this,d),m=P.tween;if(m!==A){M=(A=m).slice();for(var L={name:v,value:E},H=0,U=M.length;H<U;++H)if(M[H].name===v){M[H]=L;break}H===U&&M.push(L)}P.tween=M}}function GGn(d,v){var E=this._id;if(d+="",arguments.length<2){for(var A=u2(this.node(),E).tween,M=0,P=A.length,m;M<P;++M)if((m=A[M]).name===d)return m.value;return null}return this.each((v==null?BGn:JGn)(E,d,v))}function $2e(d,v,E){var A=d._id;return d.each(function(){var M=zp(this,A);(M.value||(M.value={}))[v]=E.apply(this,arguments)}),function(M){return u2(M,A).value[v]}}function E1n(d,v){var E;return(typeof v=="number"?Hp:v instanceof fk?vK:(E=fk(v))?(v=E,vK):w1n)(d,v)}function HGn(d){return function(){this.removeAttribute(d)}}function qGn(d){return function(){this.removeAttributeNS(d.space,d.local)}}function zGn(d,v,E){var A,M=E+"",P;return function(){var m=this.getAttribute(d);return m===M?null:m===A?P:P=v(A=m,E)}}function UGn(d,v,E){var A,M=E+"",P;return function(){var m=this.getAttributeNS(d.space,d.local);return m===M?null:m===A?P:P=v(A=m,E)}}function XGn(d,v,E){var A,M,P;return function(){var m,L=E(this),H;return L==null?void this.removeAttribute(d):(m=this.getAttribute(d),H=L+"",m===H?null:m===A&&H===M?P:(M=H,P=v(A=m,L)))}}function KGn(d,v,E){var A,M,P;return function(){var m,L=E(this),H;return L==null?void this.removeAttributeNS(d.space,d.local):(m=this.getAttributeNS(d.space,d.local),H=L+"",m===H?null:m===A&&H===M?P:(M=H,P=v(A=m,L)))}}function WGn(d,v){var E=TK(d),A=E==="transform"?TGn:E1n;return this.attrTween(d,typeof v=="function"?(E.local?KGn:XGn)(E,A,$2e(this,"attr."+d,v)):v==null?(E.local?qGn:HGn)(E):(E.local?UGn:zGn)(E,A,v))}function VGn(d,v){return function(E){this.setAttribute(d,v.call(this,E))}}function QGn(d,v){return function(E){this.setAttributeNS(d.space,d.local,v.call(this,E))}}function YGn(d,v){var E,A;function M(){var P=v.apply(this,arguments);return P!==A&&(E=(A=P)&&QGn(d,P)),E}return M._value=v,M}function ZGn(d,v){var E,A;function M(){var P=v.apply(this,arguments);return P!==A&&(E=(A=P)&&VGn(d,P)),E}return M._value=v,M}function eHn(d,v){var E="attr."+d;if(arguments.length<2)return(E=this.tween(E))&&E._value;if(v==null)return this.tween(E,null);if(typeof v!="function")throw new Error;var A=TK(d);return this.tween(E,(A.local?YGn:ZGn)(A,v))}function nHn(d,v){return function(){N2e(this,d).delay=+v.apply(this,arguments)}}function tHn(d,v){return v=+v,function(){N2e(this,d).delay=v}}function iHn(d){var v=this._id;return arguments.length?this.each((typeof d=="function"?nHn:tHn)(v,d)):u2(this.node(),v).delay}function rHn(d,v){return function(){zp(this,d).duration=+v.apply(this,arguments)}}function cHn(d,v){return v=+v,function(){zp(this,d).duration=v}}function uHn(d){var v=this._id;return arguments.length?this.each((typeof d=="function"?rHn:cHn)(v,d)):u2(this.node(),v).duration}function oHn(d,v){if(typeof v!="function")throw new Error;return function(){zp(this,d).ease=v}}function sHn(d){var v=this._id;return arguments.length?this.each(oHn(v,d)):u2(this.node(),v).ease}function fHn(d,v){return function(){var E=v.apply(this,arguments);if(typeof E!="function")throw new Error;zp(this,d).ease=E}}function lHn(d){if(typeof d!="function")throw new Error;return this.each(fHn(this._id,d))}function hHn(d){typeof d!="function"&&(d=Zan(d));for(var v=this._groups,E=v.length,A=new Array(E),M=0;M<E;++M)for(var P=v[M],m=P.length,L=A[M]=[],H,U=0;U<m;++U)(H=P[U])&&d.call(H,H.__data__,U,P)&&L.push(H);return new Q3(A,this._parents,this._name,this._id)}function aHn(d){if(d._id!==this._id)throw new Error;for(var v=this._groups,E=d._groups,A=v.length,M=E.length,P=Math.min(A,M),m=new Array(A),L=0;L<P;++L)for(var H=v[L],U=E[L],Q=H.length,Y=m[L]=new Array(Q),G,V=0;V<Q;++V)(G=H[V]||U[V])&&(Y[V]=G);for(;L<A;++L)m[L]=v[L];return new Q3(m,this._parents,this._name,this._id)}function dHn(d){return(d+"").trim().split(/^|\s+/).every(function(v){var E=v.indexOf(".");return E>=0&&(v=v.slice(0,E)),!v||v==="start"})}function bHn(d,v,E){var A,M,P=dHn(v)?N2e:zp;return function(){var m=P(this,d),L=m.on;L!==A&&(M=(A=L).copy()).on(v,E),m.on=M}}function wHn(d,v){var E=this._id;return arguments.length<2?u2(this.node(),E).on.on(d):this.each(bHn(E,d,v))}function gHn(d){return function(){var v=this.parentNode;for(var E in this.__transition)if(+E!==d)return;v&&v.removeChild(this)}}function pHn(){return this.on("end.remove",gHn(this._id))}function mHn(d){var v=this._name,E=this._id;typeof d!="function"&&(d=T2e(d));for(var A=this._groups,M=A.length,P=new Array(M),m=0;m<M;++m)for(var L=A[m],H=L.length,U=P[m]=new Array(H),Q,Y,G=0;G<H;++G)(Q=L[G])&&(Y=d.call(Q,Q.__data__,G,L))&&("__data__"in Q&&(Y.__data__=Q.__data__),U[G]=Y,IK(U[G],v,E,G,U,u2(Q,E)));return new Q3(P,this._parents,v,E)}function vHn(d){var v=this._name,E=this._id;typeof d!="function"&&(d=Yan(d));for(var A=this._groups,M=A.length,P=[],m=[],L=0;L<M;++L)for(var H=A[L],U=H.length,Q,Y=0;Y<U;++Y)if(Q=H[Y]){for(var G=d.call(Q,Q.__data__,Y,H),V,te=u2(Q,E),X=0,Ee=G.length;X<Ee;++X)(V=G[X])&&IK(V,v,E,X,G,te);P.push(G),m.push(Q)}return new Q3(P,m,v,E)}var yHn=_N.prototype.constructor;function kHn(){return new yHn(this._groups,this._parents)}function EHn(d,v){var E,A,M;return function(){var P=Gx(this,d),m=(this.style.removeProperty(d),Gx(this,d));return P===m?null:P===E&&m===A?M:M=v(E=P,A=m)}}function j1n(d){return function(){this.style.removeProperty(d)}}function jHn(d,v,E){var A,M=E+"",P;return function(){var m=Gx(this,d);return m===M?null:m===A?P:P=v(A=m,E)}}function xHn(d,v,E){var A,M,P;return function(){var m=Gx(this,d),L=E(this),H=L+"";return L==null&&(H=L=(this.style.removeProperty(d),Gx(this,d))),m===H?null:m===A&&H===M?P:(M=H,P=v(A=m,L))}}function AHn(d,v){var E,A,M,P="style."+v,m="end."+P,L;return function(){var H=zp(this,d),U=H.on,Q=H.value[P]==null?L||(L=j1n(v)):void 0;(U!==E||M!==Q)&&(A=(E=U).copy()).on(m,M=Q),H.on=A}}function MHn(d,v,E){var A=(d+="")=="transform"?CGn:E1n;return v==null?this.styleTween(d,EHn(d,A)).on("end.style."+d,j1n(d)):typeof v=="function"?this.styleTween(d,xHn(d,A,$2e(this,"style."+d,v))).each(AHn(this._id,d)):this.styleTween(d,jHn(d,A,v),E).on("end.style."+d,null)}function CHn(d,v,E){return function(A){this.style.setProperty(d,v.call(this,A),E)}}function THn(d,v,E){var A,M;function P(){var m=v.apply(this,arguments);return m!==M&&(A=(M=m)&&CHn(d,m,E)),A}return P._value=v,P}function SHn(d,v,E){var A="style."+(d+="");if(arguments.length<2)return(A=this.tween(A))&&A._value;if(v==null)return this.tween(A,null);if(typeof v!="function")throw new Error;return this.tween(A,THn(d,v,E??""))}function IHn(d){return function(){this.textContent=d}}function PHn(d){return function(){var v=d(this);this.textContent=v??""}}function OHn(d){return this.tween("text",typeof d=="function"?PHn($2e(this,"text",d)):IHn(d==null?"":d+""))}function NHn(d){return function(v){this.textContent=d.call(this,v)}}function $Hn(d){var v,E;function A(){var M=d.apply(this,arguments);return M!==E&&(v=(E=M)&&NHn(M)),v}return A._value=d,A}function DHn(d){var v="text";if(arguments.length<1)return(v=this.tween(v))&&v._value;if(d==null)return this.tween(v,null);if(typeof d!="function")throw new Error;return this.tween(v,$Hn(d))}function LHn(){for(var d=this._name,v=this._id,E=x1n(),A=this._groups,M=A.length,P=0;P<M;++P)for(var m=A[P],L=m.length,H,U=0;U<L;++U)if(H=m[U]){var Q=u2(H,v);IK(H,d,E,U,m,{time:Q.time+Q.delay+Q.duration,delay:0,duration:Q.duration,ease:Q.ease})}return new Q3(A,this._parents,d,E)}function _Hn(){var d,v,E=this,A=E._id,M=E.size();return new Promise(function(P,m){var L={value:m},H={value:function(){--M===0&&P()}};E.each(function(){var U=zp(this,A),Q=U.on;Q!==d&&(v=(d=Q).copy(),v._.cancel.push(L),v._.interrupt.push(L),v._.end.push(H)),U.on=v}),M===0&&P()})}var FHn=0;function Q3(d,v,E,A){this._groups=d,this._parents=v,this._name=E,this._id=A}function x1n(){return++FHn}var K3=_N.prototype;Q3.prototype={constructor:Q3,select:mHn,selectAll:vHn,selectChild:K3.selectChild,selectChildren:K3.selectChildren,filter:hHn,merge:aHn,selection:kHn,transition:LHn,call:K3.call,nodes:K3.nodes,node:K3.node,size:K3.size,empty:K3.empty,each:K3.each,on:wHn,attr:WGn,attrTween:eHn,style:MHn,styleTween:SHn,text:OHn,textTween:DHn,remove:pHn,tween:GGn,delay:iHn,duration:uHn,ease:sHn,easeVarying:lHn,end:_Hn,[Symbol.iterator]:K3[Symbol.iterator]};function RHn(d){return((d*=2)<=1?d*d*d:(d-=2)*d*d+2)/2}var BHn={time:null,delay:0,duration:250,ease:RHn};function JHn(d,v){for(var E;!(E=d.__transition)||!(E=E[v]);)if(!(d=d.parentNode))throw new Error(`transition ${v} not found`);return E}function GHn(d){var v,E;d instanceof Q3?(v=d._id,d=d._name):(v=x1n(),(E=BHn).time=O2e(),d=d==null?null:d+"");for(var A=this._groups,M=A.length,P=0;P<M;++P)for(var m=A[P],L=m.length,H,U=0;U<L;++U)(H=m[U])&&IK(H,d,v,U,m,E||JHn(H,v));return new Q3(A,this._parents,d,v)}_N.prototype.interrupt=RGn;_N.prototype.transition=GHn;const nK=d=>()=>d;function HHn(d,{sourceEvent:v,target:E,transform:A,dispatch:M}){Object.defineProperties(this,{type:{value:d,enumerable:!0,configurable:!0},sourceEvent:{value:v,enumerable:!0,configurable:!0},target:{value:E,enumerable:!0,configurable:!0},transform:{value:A,enumerable:!0,configurable:!0},_:{value:M}})}function W3(d,v,E){this.k=d,this.x=v,this.y=E}W3.prototype={constructor:W3,scale:function(d){return d===1?this:new W3(this.k*d,this.x,this.y)},translate:function(d,v){return d===0&v===0?this:new W3(this.k,this.x+this.k*d,this.y+this.k*v)},apply:function(d){return[d[0]*this.k+this.x,d[1]*this.k+this.y]},applyX:function(d){return d*this.k+this.x},applyY:function(d){return d*this.k+this.y},invert:function(d){return[(d[0]-this.x)/this.k,(d[1]-this.y)/this.k]},invertX:function(d){return(d-this.x)/this.k},invertY:function(d){return(d-this.y)/this.k},rescaleX:function(d){return d.copy().domain(d.range().map(this.invertX,this).map(d.invert,d))},rescaleY:function(d){return d.copy().domain(d.range().map(this.invertY,this).map(d.invert,d))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var PK=new W3(1,0,0);A1n.prototype=W3.prototype;function A1n(d){for(;!d.__zoom;)if(!(d=d.parentNode))return PK;return d.__zoom}function r2e(d){d.stopImmediatePropagation()}function yN(d){d.preventDefault(),d.stopImmediatePropagation()}function qHn(d){return(!d.ctrlKey||d.type==="wheel")&&!d.button}function zHn(){var d=this;return d instanceof SVGElement?(d=d.ownerSVGElement||d,d.hasAttribute("viewBox")?(d=d.viewBox.baseVal,[[d.x,d.y],[d.x+d.width,d.y+d.height]]):[[0,0],[d.width.baseVal.value,d.height.baseVal.value]]):[[0,0],[d.clientWidth,d.clientHeight]]}function tan(){return this.__zoom||PK}function UHn(d){return-d.deltaY*(d.deltaMode===1?.05:d.deltaMode?1:.002)*(d.ctrlKey?10:1)}function XHn(){return navigator.maxTouchPoints||"ontouchstart"in this}function KHn(d,v,E){var A=d.invertX(v[0][0])-E[0][0],M=d.invertX(v[1][0])-E[1][0],P=d.invertY(v[0][1])-E[0][1],m=d.invertY(v[1][1])-E[1][1];return d.translate(M>A?(A+M)/2:Math.min(0,A)||Math.max(0,M),m>P?(P+m)/2:Math.min(0,P)||Math.max(0,m))}function M1n(){var d=qHn,v=zHn,E=KHn,A=UHn,M=XHn,P=[0,1/0],m=[[-1/0,-1/0],[1/0,1/0]],L=250,H=fK,U=CK("start","zoom","end"),Q,Y,G,V=500,te=150,X=0,Ee=10;function ue(xe){xe.property("__zoom",tan).on("wheel.zoom",kn,{passive:!1}).on("mousedown.zoom",En).on("dblclick.zoom",Zn).filter(M).on("touchstart.zoom",Ln).on("touchmove.zoom",Vn).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}ue.transform=function(xe,on,rn,Sn){var Fn=xe.selection?xe.selection():xe;Fn.property("__zoom",tan),xe!==Fn?Ke(xe,on,rn,Sn):Fn.interrupt().each(function(){Xe(this,arguments).event(Sn).start().zoom(null,typeof on=="function"?on.apply(this,arguments):on).end()})},ue.scaleBy=function(xe,on,rn,Sn){ue.scaleTo(xe,function(){var Fn=this.__zoom.k,dn=typeof on=="function"?on.apply(this,arguments):on;return Fn*dn},rn,Sn)},ue.scaleTo=function(xe,on,rn,Sn){ue.transform(xe,function(){var Fn=v.apply(this,arguments),dn=this.__zoom,Gn=rn==null?je(Fn):typeof rn=="function"?rn.apply(this,arguments):rn,Nn=dn.invert(Gn),qn=typeof on=="function"?on.apply(this,arguments):on;return E(re(ge(dn,qn),Gn,Nn),Fn,m)},rn,Sn)},ue.translateBy=function(xe,on,rn,Sn){ue.transform(xe,function(){return E(this.__zoom.translate(typeof on=="function"?on.apply(this,arguments):on,typeof rn=="function"?rn.apply(this,arguments):rn),v.apply(this,arguments),m)},null,Sn)},ue.translateTo=function(xe,on,rn,Sn,Fn){ue.transform(xe,function(){var dn=v.apply(this,arguments),Gn=this.__zoom,Nn=Sn==null?je(dn):typeof Sn=="function"?Sn.apply(this,arguments):Sn;return E(PK.translate(Nn[0],Nn[1]).scale(Gn.k).translate(typeof on=="function"?-on.apply(this,arguments):-on,typeof rn=="function"?-rn.apply(this,arguments):-rn),dn,m)},Sn,Fn)};function ge(xe,on){return on=Math.max(P[0],Math.min(P[1],on)),on===xe.k?xe:new W3(on,xe.x,xe.y)}function re(xe,on,rn){var Sn=on[0]-rn[0]*xe.k,Fn=on[1]-rn[1]*xe.k;return Sn===xe.x&&Fn===xe.y?xe:new W3(xe.k,Sn,Fn)}function je(xe){return[(+xe[0][0]+ +xe[1][0])/2,(+xe[0][1]+ +xe[1][1])/2]}function Ke(xe,on,rn,Sn){xe.on("start.zoom",function(){Xe(this,arguments).event(Sn).start()}).on("interrupt.zoom end.zoom",function(){Xe(this,arguments).event(Sn).end()}).tween("zoom",function(){var Fn=this,dn=arguments,Gn=Xe(Fn,dn).event(Sn),Nn=v.apply(Fn,dn),qn=rn==null?je(Nn):typeof rn=="function"?rn.apply(Fn,dn):rn,Jt=Math.max(Nn[1][0]-Nn[0][0],Nn[1][1]-Nn[0][1]),Kt=Fn.__zoom,Oi=typeof on=="function"?on.apply(Fn,dn):on,gr=H(Kt.invert(qn).concat(Jt/Kt.k),Oi.invert(qn).concat(Jt/Oi.k));return function(Ki){if(Ki===1)Ki=Oi;else{var Kn=gr(Ki),ei=Jt/Kn[2];Ki=new W3(ei,qn[0]-Kn[0]*ei,qn[1]-Kn[1]*ei)}Gn.zoom(null,Ki)}})}function Xe(xe,on,rn){return!rn&&xe.__zooming||new Ye(xe,on)}function Ye(xe,on){this.that=xe,this.args=on,this.active=0,this.sourceEvent=null,this.extent=v.apply(xe,on),this.taps=0}Ye.prototype={event:function(xe){return xe&&(this.sourceEvent=xe),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(xe,on){return this.mouse&&xe!=="mouse"&&(this.mouse[1]=on.invert(this.mouse[0])),this.touch0&&xe!=="touch"&&(this.touch0[1]=on.invert(this.touch0[0])),this.touch1&&xe!=="touch"&&(this.touch1[1]=on.invert(this.touch1[0])),this.that.__zoom=on,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(xe){var on=_0(this.that).datum();U.call(xe,this.that,new HHn(xe,{sourceEvent:this.sourceEvent,target:ue,transform:this.that.__zoom,dispatch:U}),on)}};function kn(xe,...on){if(!d.apply(this,arguments))return;var rn=Xe(this,on).event(xe),Sn=this.__zoom,Fn=Math.max(P[0],Math.min(P[1],Sn.k*Math.pow(2,A.apply(this,arguments)))),dn=e2(xe);if(rn.wheel)(rn.mouse[0][0]!==dn[0]||rn.mouse[0][1]!==dn[1])&&(rn.mouse[1]=Sn.invert(rn.mouse[0]=dn)),clearTimeout(rn.wheel);else{if(Sn.k===Fn)return;rn.mouse=[dn,Sn.invert(dn)],aK(this),rn.start()}yN(xe),rn.wheel=setTimeout(Gn,te),rn.zoom("mouse",E(re(ge(Sn,Fn),rn.mouse[0],rn.mouse[1]),rn.extent,m));function Gn(){rn.wheel=null,rn.end()}}function En(xe,...on){if(G||!d.apply(this,arguments))return;var rn=xe.currentTarget,Sn=Xe(this,on,!0).event(xe),Fn=_0(xe.view).on("mousemove.zoom",qn,!0).on("mouseup.zoom",Jt,!0),dn=e2(xe,rn),Gn=xe.clientX,Nn=xe.clientY;f1n(xe.view),r2e(xe),Sn.mouse=[dn,this.__zoom.invert(dn)],aK(this),Sn.start();function qn(Kt){if(yN(Kt),!Sn.moved){var Oi=Kt.clientX-Gn,gr=Kt.clientY-Nn;Sn.moved=Oi*Oi+gr*gr>X}Sn.event(Kt).zoom("mouse",E(re(Sn.that.__zoom,Sn.mouse[0]=e2(Kt,rn),Sn.mouse[1]),Sn.extent,m))}function Jt(Kt){Fn.on("mousemove.zoom mouseup.zoom",null),l1n(Kt.view,Sn.moved),yN(Kt),Sn.event(Kt).end()}}function Zn(xe,...on){if(d.apply(this,arguments)){var rn=this.__zoom,Sn=e2(xe.changedTouches?xe.changedTouches[0]:xe,this),Fn=rn.invert(Sn),dn=rn.k*(xe.shiftKey?.5:2),Gn=E(re(ge(rn,dn),Sn,Fn),v.apply(this,on),m);yN(xe),L>0?_0(this).transition().duration(L).call(Ke,Gn,Sn,xe):_0(this).call(ue.transform,Gn,Sn,xe)}}function Ln(xe,...on){if(d.apply(this,arguments)){var rn=xe.touches,Sn=rn.length,Fn=Xe(this,on,xe.changedTouches.length===Sn).event(xe),dn,Gn,Nn,qn;for(r2e(xe),Gn=0;Gn<Sn;++Gn)Nn=rn[Gn],qn=e2(Nn,this),qn=[qn,this.__zoom.invert(qn),Nn.identifier],Fn.touch0?!Fn.touch1&&Fn.touch0[2]!==qn[2]&&(Fn.touch1=qn,Fn.taps=0):(Fn.touch0=qn,dn=!0,Fn.taps=1+!!Q);Q&&(Q=clearTimeout(Q)),dn&&(Fn.taps<2&&(Y=qn[0],Q=setTimeout(function(){Q=null},V)),aK(this),Fn.start())}}function Vn(xe,...on){if(this.__zooming){var rn=Xe(this,on).event(xe),Sn=xe.changedTouches,Fn=Sn.length,dn,Gn,Nn,qn;for(yN(xe),dn=0;dn<Fn;++dn)Gn=Sn[dn],Nn=e2(Gn,this),rn.touch0&&rn.touch0[2]===Gn.identifier?rn.touch0[0]=Nn:rn.touch1&&rn.touch1[2]===Gn.identifier&&(rn.touch1[0]=Nn);if(Gn=rn.that.__zoom,rn.touch1){var Jt=rn.touch0[0],Kt=rn.touch0[1],Oi=rn.touch1[0],gr=rn.touch1[1],Ki=(Ki=Oi[0]-Jt[0])*Ki+(Ki=Oi[1]-Jt[1])*Ki,Kn=(Kn=gr[0]-Kt[0])*Kn+(Kn=gr[1]-Kt[1])*Kn;Gn=ge(Gn,Math.sqrt(Ki/Kn)),Nn=[(Jt[0]+Oi[0])/2,(Jt[1]+Oi[1])/2],qn=[(Kt[0]+gr[0])/2,(Kt[1]+gr[1])/2]}else if(rn.touch0)Nn=rn.touch0[0],qn=rn.touch0[1];else return;rn.zoom("touch",E(re(Gn,Nn,qn),rn.extent,m))}}function J(xe,...on){if(this.__zooming){var rn=Xe(this,on).event(xe),Sn=xe.changedTouches,Fn=Sn.length,dn,Gn;for(r2e(xe),G&&clearTimeout(G),G=setTimeout(function(){G=null},V),dn=0;dn<Fn;++dn)Gn=Sn[dn],rn.touch0&&rn.touch0[2]===Gn.identifier?delete rn.touch0:rn.touch1&&rn.touch1[2]===Gn.identifier&&delete rn.touch1;if(rn.touch1&&!rn.touch0&&(rn.touch0=rn.touch1,delete rn.touch1),rn.touch0)rn.touch0[1]=this.__zoom.invert(rn.touch0[0]);else if(rn.end(),rn.taps===2&&(Gn=e2(Gn,this),Math.hypot(Y[0]-Gn[0],Y[1]-Gn[1])<Ee)){var Nn=_0(this).on("dblclick.zoom");Nn&&Nn.apply(this,arguments)}}}return ue.wheelDelta=function(xe){return arguments.length?(A=typeof xe=="function"?xe:nK(+xe),ue):A},ue.filter=function(xe){return arguments.length?(d=typeof xe=="function"?xe:nK(!!xe),ue):d},ue.touchable=function(xe){return arguments.length?(M=typeof xe=="function"?xe:nK(!!xe),ue):M},ue.extent=function(xe){return arguments.length?(v=typeof xe=="function"?xe:nK([[+xe[0][0],+xe[0][1]],[+xe[1][0],+xe[1][1]]]),ue):v},ue.scaleExtent=function(xe){return arguments.length?(P[0]=+xe[0],P[1]=+xe[1],ue):[P[0],P[1]]},ue.translateExtent=function(xe){return arguments.length?(m[0][0]=+xe[0][0],m[1][0]=+xe[1][0],m[0][1]=+xe[0][1],m[1][1]=+xe[1][1],ue):[[m[0][0],m[0][1]],[m[1][0],m[1][1]]]},ue.constrain=function(xe){return arguments.length?(E=xe,ue):E},ue.duration=function(xe){return arguments.length?(L=+xe,ue):L},ue.interpolate=function(xe){return arguments.length?(H=xe,ue):H},ue.on=function(){var xe=U.on.apply(U,arguments);return xe===U?ue:xe},ue.clickDistance=function(xe){return arguments.length?(X=(xe=+xe)*xe,ue):Math.sqrt(X)},ue.tapDistance=function(xe){return arguments.length?(Ee=+xe,ue):Ee},ue}const c2={error001:(d="react")=>`Seems like you have not used ${d==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${d}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:d=>`Node type "${d}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:d=>`The old edge with id=${d} does not exist.`,error009:d=>`Marker type "${d}" doesn't exist.`,error008:(d,{id:v,sourceHandle:E,targetHandle:A})=>`Couldn't create edge for ${d} handle id: "${d==="source"?E:A}", edge id: ${v}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:d=>`Edge type "${d}" not found. Using fallback type "default".`,error012:d=>`Node with id "${d}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(d="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${d}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:d=>`Edge with id "${d}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},PN=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],C1n=["Enter"," ","Escape"],T1n={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:d,x:v,y:E})=>`Moved selected node ${d}. New position, x: ${v}, y: ${E}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var qx;(function(d){d.Strict="strict",d.Loose="loose"})(qx||(qx={}));var sk;(function(d){d.Free="free",d.Vertical="vertical",d.Horizontal="horizontal"})(sk||(sk={}));var ON;(function(d){d.Partial="partial",d.Full="full"})(ON||(ON={}));const S1n={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Q5;(function(d){d.Bezier="default",d.Straight="straight",d.Step="step",d.SmoothStep="smoothstep",d.SimpleBezier="simplebezier"})(Q5||(Q5={}));var NN;(function(d){d.Arrow="arrow",d.ArrowClosed="arrowclosed"})(NN||(NN={}));var Ei;(function(d){d.Left="left",d.Top="top",d.Right="right",d.Bottom="bottom"})(Ei||(Ei={}));const ian={[Ei.Left]:Ei.Right,[Ei.Right]:Ei.Left,[Ei.Top]:Ei.Bottom,[Ei.Bottom]:Ei.Top},I1n=d=>!!d&&typeof d=="object"&&"id"in d&&"source"in d&&"target"in d,WHn=d=>!!d&&typeof d=="object"&&"id"in d&&"position"in d&&!("source"in d)&&!("target"in d),D2e=d=>!!d&&typeof d=="object"&&"id"in d&&"internals"in d&&!("source"in d)&&!("target"in d),RN=(d,v=[0,0])=>{const{width:E,height:A}=o2(d),M=d.origin??v,P=E*M[0],m=A*M[1];return{x:d.position.x-P,y:d.position.y-m}},VHn=(d,v={nodeOrigin:[0,0]})=>{if(d.length===0)return{x:0,y:0,width:0,height:0};let E=!1;const A=d.reduce((M,P)=>{const m=typeof P=="string";let L=!v.nodeLookup&&!m?P:void 0;return v.nodeLookup&&(L=m?v.nodeLookup.get(P):D2e(P)?P:v.nodeLookup.get(P.id)),L?(E=!0,OK(M,jK(L,v.nodeOrigin))):M},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return E?NK(A):{x:0,y:0,width:0,height:0}},Kx=(d,v={})=>{let E={x:1/0,y:1/0,x2:-1/0,y2:-1/0},A=!1;return d.forEach(M=>{(v.filter===void 0||v.filter(M))&&(E=OK(E,jK(M)),A=!0)}),A?NK(E):{x:0,y:0,width:0,height:0}},L2e=(d,v,[E,A,M]=[0,0,1],P=!1,m=!1)=>{const L=(v.x-E)/M,H=(v.y-A)/M,U=v.width/M,Q=v.height/M,Y=[];for(const G of d.values()){const{measured:V,selectable:te=!0,hidden:X=!1}=G;if(m&&!te||X)continue;const Ee=V.width??G.width??G.initialWidth??0,ue=V.height??G.height??G.initialHeight??0,{x:ge,y:re}=G.internals.positionAbsolute,je=$1n(L,H,U,Q,ge,re,Ee,ue),Ke=Ee*ue,Xe=P&&je>0;(!G.internals.handleBounds||Xe||je>=Ke||G.dragging)&&Y.push(G)}return Y},QHn=(d,v)=>{const E=new Set;return d.forEach(A=>{E.add(A.id)}),v.filter(A=>E.has(A.source)||E.has(A.target))};function YHn(d,v){const E=new Map,A=v!=null&&v.nodes?new Set(v.nodes.map(M=>M.id)):null;return d.forEach(M=>{let P;if(v!=null&&v.includeHiddenNodes){const{width:m,height:L}=o2(M);P=m>0&&L>0}else P=!!(M.measured.width&&M.measured.height&&!M.hidden);P&&(!A||A.has(M.id))&&E.set(M.id,M)}),E}async function ZHn({nodes:d,width:v,height:E,panZoom:A,minZoom:M,maxZoom:P},m){if(d.size===0)return!0;const L=YHn(d,m),H=Kx(L),U=F2e(H,v,E,(m==null?void 0:m.minZoom)??M,(m==null?void 0:m.maxZoom)??P,(m==null?void 0:m.padding)??.1);return await A.setViewport(U,{duration:m==null?void 0:m.duration,ease:m==null?void 0:m.ease,interpolate:m==null?void 0:m.interpolate}),!0}function P1n({nodeId:d,nextPosition:v,nodeLookup:E,nodeOrigin:A=[0,0],nodeExtent:M,onError:P}){const m=E.get(d),L=m.parentId?E.get(m.parentId):void 0,{x:H,y:U}=L?L.internals.positionAbsolute:{x:0,y:0},Q=m.origin??A;let Y=m.extent||M;if(m.extent==="parent"&&!m.expandParent)if(!L)P==null||P("005",c2.error005());else{const{width:V,height:te}=o2(L);V&&te&&(Y=[[H,U],[H+V,U+te]])}else L&&ak(m.extent)&&(Y=[[m.extent[0][0]+H,m.extent[0][1]+U],[m.extent[1][0]+H,m.extent[1][1]+U]]);const G=ak(Y)?hk(v,Y,m.measured):v;return(m.measured.width===void 0||m.measured.height===void 0)&&(P==null||P("015",c2.error015())),{position:{x:G.x-H+(m.measured.width??0)*Q[0],y:G.y-U+(m.measured.height??0)*Q[1]},positionAbsolute:G}}async function eqn({nodesToRemove:d=[],edgesToRemove:v=[],nodes:E,edges:A,onBeforeDelete:M}){const P=new Set(d.map(G=>G.id)),m=[];for(const G of E){if(G.deletable===!1)continue;const V=P.has(G.id),te=!V&&G.parentId&&m.find(X=>X.id===G.parentId);(V||te)&&m.push(G)}const L=new Set(v.map(G=>G.id)),H=A.filter(G=>G.deletable!==!1),Q=QHn(m,H);for(const G of H)L.has(G.id)&&!Q.find(te=>te.id===G.id)&&Q.push(G);if(!M)return{edges:Q,nodes:m};const Y=await M({nodes:m,edges:Q});return typeof Y=="boolean"?Y?{edges:Q,nodes:m}:{edges:[],nodes:[]}:Y}const zx=(d,v=0,E=1)=>Math.min(Math.max(d,v),E),hk=(d={x:0,y:0},v,E)=>({x:zx(d.x,v[0][0],v[1][0]-((E==null?void 0:E.width)??0)),y:zx(d.y,v[0][1],v[1][1]-((E==null?void 0:E.height)??0))});function O1n(d,v,E){const{width:A,height:M}=o2(E),{x:P,y:m}=E.internals.positionAbsolute;return hk(d,[[P,m],[P+A,m+M]],v)}const ran=(d,v,E)=>d<v?zx(Math.abs(d-v),1,v)/v:d>E?-zx(Math.abs(d-E),1,v)/v:0,_2e=(d,v,E=15,A=40)=>{const M=ran(d.x,A,v.width-A)*E,P=ran(d.y,A,v.height-A)*E;return[M,P]},OK=(d,v)=>({x:Math.min(d.x,v.x),y:Math.min(d.y,v.y),x2:Math.max(d.x2,v.x2),y2:Math.max(d.y2,v.y2)}),v2e=({x:d,y:v,width:E,height:A})=>({x:d,y:v,x2:d+E,y2:v+A}),NK=({x:d,y:v,x2:E,y2:A})=>({x:d,y:v,width:E-d,height:A-v}),$N=(d,v=[0,0])=>{var M,P;const{x:E,y:A}=D2e(d)?d.internals.positionAbsolute:RN(d,v);return{x:E,y:A,width:((M=d.measured)==null?void 0:M.width)??d.width??d.initialWidth??0,height:((P=d.measured)==null?void 0:P.height)??d.height??d.initialHeight??0}},jK=(d,v=[0,0])=>{var M,P;const{x:E,y:A}=D2e(d)?d.internals.positionAbsolute:RN(d,v);return{x:E,y:A,x2:E+(((M=d.measured)==null?void 0:M.width)??d.width??d.initialWidth??0),y2:A+(((P=d.measured)==null?void 0:P.height)??d.height??d.initialHeight??0)}},N1n=(d,v)=>NK(OK(v2e(d),v2e(v))),$1n=(d,v,E,A,M,P,m,L)=>{const H=Math.max(0,Math.min(d+E,M+m)-Math.max(d,M)),U=Math.max(0,Math.min(v+A,P+L)-Math.max(v,P));return Math.ceil(H*U)},xK=(d,v)=>$1n(d.x,d.y,d.width,d.height,v.x,v.y,v.width,v.height),can=d=>t2(d.width)&&t2(d.height)&&t2(d.x)&&t2(d.y),t2=d=>!isNaN(d)&&isFinite(d),D1n=(d,v)=>(E,A)=>{},BN=(d,v=[1,1])=>({x:v[0]*Math.round(d.x/v[0]),y:v[1]*Math.round(d.y/v[1])}),JN=({x:d,y:v},[E,A,M],P=!1,m=[1,1])=>{const L={x:(d-E)/M,y:(v-A)/M};return P?BN(L,m):L},Ux=({x:d,y:v},[E,A,M])=>({x:d*M+E,y:v*M+A});function Fx(d,v){if(typeof d=="number")return Math.floor((v-v/(1+d))*.5);if(typeof d=="string"&&d.endsWith("px")){const E=parseFloat(d);if(!Number.isNaN(E))return Math.floor(E)}if(typeof d=="string"&&d.endsWith("%")){const E=parseFloat(d);if(!Number.isNaN(E))return Math.floor(v*E*.01)}return console.error(`The padding value "${d}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nqn(d,v,E){if(typeof d=="string"||typeof d=="number"){const A=Fx(d,E),M=Fx(d,v);return{top:A,right:M,bottom:A,left:M,x:M*2,y:A*2}}if(typeof d=="object"){const A=Fx(d.top??d.y??0,E),M=Fx(d.bottom??d.y??0,E),P=Fx(d.left??d.x??0,v),m=Fx(d.right??d.x??0,v);return{top:A,right:m,bottom:M,left:P,x:P+m,y:A+M}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tqn(d,v,E,A,M,P){const{x:m,y:L}=Ux(d,[v,E,A]),{x:H,y:U}=Ux({x:d.x+d.width,y:d.y+d.height},[v,E,A]),Q=M-H,Y=P-U;return{left:Math.floor(m),top:Math.floor(L),right:Math.floor(Q),bottom:Math.floor(Y)}}const F2e=(d,v,E,A,M,P)=>{const m=nqn(P,v,E),L=(v-m.x)/d.width,H=(E-m.y)/d.height,U=Math.min(L,H),Q=zx(U,A,M),Y=d.x+d.width/2,G=d.y+d.height/2,V=v/2-Y*Q,te=E/2-G*Q,X=tqn(d,V,te,Q,v,E),Ee={left:Math.min(X.left-m.left,0),top:Math.min(X.top-m.top,0),right:Math.min(X.right-m.right,0),bottom:Math.min(X.bottom-m.bottom,0)};return{x:V-Ee.left+Ee.right,y:te-Ee.top+Ee.bottom,zoom:Q}},DN=()=>{var d;return typeof navigator<"u"&&((d=navigator==null?void 0:navigator.userAgent)==null?void 0:d.indexOf("Mac"))>=0};function ak(d){return d!=null&&d!=="parent"}function o2(d){var v,E;return{width:((v=d.measured)==null?void 0:v.width)??d.width??d.initialWidth??0,height:((E=d.measured)==null?void 0:E.height)??d.height??d.initialHeight??0}}function L1n(d){var v,E;return(((v=d.measured)==null?void 0:v.width)??d.width??d.initialWidth)!==void 0&&(((E=d.measured)==null?void 0:E.height)??d.height??d.initialHeight)!==void 0}function _1n(d,v={width:0,height:0},E,A,M){const P={...d},m=A.get(E);if(m){const L=m.origin||M;P.x+=m.internals.positionAbsolute.x-(v.width??0)*L[0],P.y+=m.internals.positionAbsolute.y-(v.height??0)*L[1]}return P}function uan(d,v){if(d.size!==v.size)return!1;for(const E of d)if(!v.has(E))return!1;return!0}function iqn(){let d,v;return{promise:new Promise((A,M)=>{d=A,v=M}),resolve:d,reject:v}}function rqn(d){return{...T1n,...d||{}}}function F1n(d){return d===null?null:d?"valid":"invalid"}function AN(d,{snapGrid:v=[0,0],snapToGrid:E=!1,transform:A,containerBounds:M}){const{x:P,y:m}=i2(d),L=JN({x:P-((M==null?void 0:M.left)??0),y:m-((M==null?void 0:M.top)??0)},A),{x:H,y:U}=E?BN(L,v):L;return{xSnapped:H,ySnapped:U,...L}}const R2e=d=>({width:d.offsetWidth,height:d.offsetHeight}),R1n=d=>{var v;return((v=d==null?void 0:d.getRootNode)==null?void 0:v.call(d))||(window==null?void 0:window.document)},cqn=["INPUT","SELECT","TEXTAREA"];function B1n(d){var A,M;const v=((M=(A=d.composedPath)==null?void 0:A.call(d))==null?void 0:M[0])||d.target;return(v==null?void 0:v.nodeType)!==1?!1:cqn.includes(v.nodeName)||v.hasAttribute("contenteditable")||!!v.closest(".nokey")}const J1n=d=>"clientX"in d,i2=(d,v)=>{var P,m;const E=J1n(d),A=E?d.clientX:(P=d.touches)==null?void 0:P[0].clientX,M=E?d.clientY:(m=d.touches)==null?void 0:m[0].clientY;return{x:A-((v==null?void 0:v.left)??0),y:M-((v==null?void 0:v.top)??0)}},oan=(d,v,E,A,M)=>{const P=v.querySelectorAll(`.${d}`);return!P||!P.length?null:Array.from(P).map(m=>{const L=m.getBoundingClientRect();return{id:m.getAttribute("data-handleid"),type:d,nodeId:M,position:m.getAttribute("data-handlepos"),x:(L.left-E.left)/A,y:(L.top-E.top)/A,...R2e(m)}})};function G1n({sourceX:d,sourceY:v,targetX:E,targetY:A,sourceControlX:M,sourceControlY:P,targetControlX:m,targetControlY:L}){const H=d*.125+M*.375+m*.375+E*.125,U=v*.125+P*.375+L*.375+A*.125,Q=Math.abs(H-d),Y=Math.abs(U-v);return[H,U,Q,Y]}function tK(d,v){return d>=0?.5*d:v*25*Math.sqrt(-d)}function san({pos:d,x1:v,y1:E,x2:A,y2:M,c:P}){switch(d){case Ei.Left:return[v-tK(v-A,P),E];case Ei.Right:return[v+tK(A-v,P),E];case Ei.Top:return[v,E-tK(E-M,P)];case Ei.Bottom:return[v,E+tK(M-E,P)]}}function GN({sourceX:d,sourceY:v,sourcePosition:E=Ei.Bottom,targetX:A,targetY:M,targetPosition:P=Ei.Top,curvature:m=.25}){const[L,H]=san({pos:E,x1:d,y1:v,x2:A,y2:M,c:m}),[U,Q]=san({pos:P,x1:A,y1:M,x2:d,y2:v,c:m}),[Y,G,V,te]=G1n({sourceX:d,sourceY:v,targetX:A,targetY:M,sourceControlX:L,sourceControlY:H,targetControlX:U,targetControlY:Q});return[`M${d},${v} C${L},${H} ${U},${Q} ${A},${M}`,Y,G,V,te]}function H1n({sourceX:d,sourceY:v,targetX:E,targetY:A}){const M=Math.abs(E-d)/2,P=E<d?E+M:E-M,m=Math.abs(A-v)/2,L=A<v?A+m:A-m;return[P,L,M,m]}function uqn({sourceNode:d,targetNode:v,selected:E=!1,zIndex:A=0,elevateOnSelect:M=!1,zIndexMode:P="basic"}){if(P==="manual")return A;const m=M&&E?A+1e3:A,L=Math.max(d.parentId||M&&d.selected?d.internals.z:0,v.parentId||M&&v.selected?v.internals.z:0);return m+L}function oqn({sourceNode:d,targetNode:v,width:E,height:A,transform:M}){const P=OK(jK(d),jK(v));P.x===P.x2&&(P.x2+=1),P.y===P.y2&&(P.y2+=1);const m={x:-M[0]/M[2],y:-M[1]/M[2],width:E/M[2],height:A/M[2]};return xK(m,NK(P))>0}const sqn=({source:d,sourceHandle:v,target:E,targetHandle:A})=>`xy-edge__${d}${v||""}-${E}${A||""}`,fqn=(d,v)=>v.some(E=>E.source===d.source&&E.target===d.target&&(E.sourceHandle===d.sourceHandle||!E.sourceHandle&&!d.sourceHandle)&&(E.targetHandle===d.targetHandle||!E.targetHandle&&!d.targetHandle)),lqn=(d,v,E={})=>{var P;if(!d.source||!d.target)return(P=E.onError)==null||P.call(E,"006",c2.error006()),v;const A=E.getEdgeId||sqn;let M;return I1n(d)?M={...d}:M={...d,id:A(d)},fqn(M,v)?v:(M.sourceHandle===null&&delete M.sourceHandle,M.targetHandle===null&&delete M.targetHandle,v.concat(M))};function q1n({sourceX:d,sourceY:v,targetX:E,targetY:A}){const[M,P,m,L]=H1n({sourceX:d,sourceY:v,targetX:E,targetY:A});return[`M ${d},${v}L ${E},${A}`,M,P,m,L]}const fan={[Ei.Left]:{x:-1,y:0},[Ei.Right]:{x:1,y:0},[Ei.Top]:{x:0,y:-1},[Ei.Bottom]:{x:0,y:1}},hqn=({source:d,sourcePosition:v=Ei.Bottom,target:E})=>v===Ei.Left||v===Ei.Right?d.x<E.x?{x:1,y:0}:{x:-1,y:0}:d.y<E.y?{x:0,y:1}:{x:0,y:-1},lan=(d,v)=>Math.sqrt(Math.pow(v.x-d.x,2)+Math.pow(v.y-d.y,2));function aqn({source:d,sourcePosition:v=Ei.Bottom,target:E,targetPosition:A=Ei.Top,center:M,offset:P,stepPosition:m}){const L=fan[v],H=fan[A],U={x:d.x+L.x*P,y:d.y+L.y*P},Q={x:E.x+H.x*P,y:E.y+H.y*P},Y=hqn({source:U,sourcePosition:v,target:Q}),G=Y.x!==0?"x":"y",V=Y[G];let te=[],X,Ee;const ue={x:0,y:0},ge={x:0,y:0},[,,re,je]=H1n({sourceX:d.x,sourceY:d.y,targetX:E.x,targetY:E.y});if(L[G]*H[G]===-1){G==="x"?(X=M.x??U.x+(Q.x-U.x)*m,Ee=M.y??(U.y+Q.y)/2):(X=M.x??(U.x+Q.x)/2,Ee=M.y??U.y+(Q.y-U.y)*m);const kn=[{x:X,y:U.y},{x:X,y:Q.y}],En=[{x:U.x,y:Ee},{x:Q.x,y:Ee}];L[G]===V?te=G==="x"?kn:En:te=G==="x"?En:kn}else{const kn=[{x:U.x,y:Q.y}],En=[{x:Q.x,y:U.y}];if(G==="x"?te=L.x===V?En:kn:te=L.y===V?kn:En,v===A){const xe=Math.abs(d[G]-E[G]);if(xe<=P){const on=Math.min(P-1,P-xe);L[G]===V?ue[G]=(U[G]>d[G]?-1:1)*on:ge[G]=(Q[G]>E[G]?-1:1)*on}}if(v!==A){const xe=G==="x"?"y":"x",on=L[G]===H[xe],rn=U[xe]>Q[xe],Sn=U[xe]<Q[xe];(L[G]===1&&(!on&&rn||on&&Sn)||L[G]!==1&&(!on&&Sn||on&&rn))&&(te=G==="x"?kn:En)}const Zn={x:U.x+ue.x,y:U.y+ue.y},Ln={x:Q.x+ge.x,y:Q.y+ge.y},Vn=Math.max(Math.abs(Zn.x-te[0].x),Math.abs(Ln.x-te[0].x)),J=Math.max(Math.abs(Zn.y-te[0].y),Math.abs(Ln.y-te[0].y));Vn>=J?(X=(Zn.x+Ln.x)/2,Ee=te[0].y):(X=te[0].x,Ee=(Zn.y+Ln.y)/2)}const Ke={x:U.x+ue.x,y:U.y+ue.y},Xe={x:Q.x+ge.x,y:Q.y+ge.y};return[[d,...Ke.x!==te[0].x||Ke.y!==te[0].y?[Ke]:[],...te,...Xe.x!==te[te.length-1].x||Xe.y!==te[te.length-1].y?[Xe]:[],E],X,Ee,re,je]}function dqn(d,v,E,A){const M=Math.min(lan(d,v)/2,lan(v,E)/2,A),{x:P,y:m}=v;if(d.x===P&&P===E.x||d.y===m&&m===E.y)return`L${P} ${m}`;if(d.y===m){const U=d.x<E.x?-1:1,Q=d.y<E.y?1:-1;return`L ${P+M*U},${m}Q ${P},${m} ${P},${m+M*Q}`}const L=d.x<E.x?1:-1,H=d.y<E.y?-1:1;return`L ${P},${m+M*H}Q ${P},${m} ${P+M*L},${m}`}function y2e({sourceX:d,sourceY:v,sourcePosition:E=Ei.Bottom,targetX:A,targetY:M,targetPosition:P=Ei.Top,borderRadius:m=5,centerX:L,centerY:H,offset:U=20,stepPosition:Q=.5}){const[Y,G,V,te,X]=aqn({source:{x:d,y:v},sourcePosition:E,target:{x:A,y:M},targetPosition:P,center:{x:L,y:H},offset:U,stepPosition:Q});let Ee=`M${Y[0].x} ${Y[0].y}`;for(let ue=1;ue<Y.length-1;ue++)Ee+=dqn(Y[ue-1],Y[ue],Y[ue+1],m);return Ee+=`L${Y[Y.length-1].x} ${Y[Y.length-1].y}`,[Ee,G,V,te,X]}function han(d){var v;return d&&!!(d.internals.handleBounds||(v=d.handles)!=null&&v.length)&&!!(d.measured.width||d.width||d.initialWidth)}function bqn(d){var Y;const{sourceNode:v,targetNode:E}=d;if(!han(v)||!han(E))return null;const A=v.internals.handleBounds||aan(v.handles),M=E.internals.handleBounds||aan(E.handles),P=dan((A==null?void 0:A.source)??[],d.sourceHandle),m=dan(d.connectionMode===qx.Strict?(M==null?void 0:M.target)??[]:((M==null?void 0:M.target)??[]).concat((M==null?void 0:M.source)??[]),d.targetHandle);if(!P||!m)return(Y=d.onError)==null||Y.call(d,"008",c2.error008(P?"target":"source",{id:d.id,sourceHandle:d.sourceHandle,targetHandle:d.targetHandle})),null;const L=(P==null?void 0:P.position)||Ei.Bottom,H=(m==null?void 0:m.position)||Ei.Top,U=dk(v,P,L),Q=dk(E,m,H);return{sourceX:U.x,sourceY:U.y,targetX:Q.x,targetY:Q.y,sourcePosition:L,targetPosition:H}}function aan(d){if(!d)return null;const v=[],E=[];for(const A of d)A.width=A.width??1,A.height=A.height??1,A.type==="source"?v.push(A):A.type==="target"&&E.push(A);return{source:v,target:E}}function dk(d,v,E=Ei.Left,A=!1){const M=((v==null?void 0:v.x)??0)+d.internals.positionAbsolute.x,P=((v==null?void 0:v.y)??0)+d.internals.positionAbsolute.y,{width:m,height:L}=v??o2(d);if(A)return{x:M+m/2,y:P+L/2};switch((v==null?void 0:v.position)??E){case Ei.Top:return{x:M+m/2,y:P};case Ei.Right:return{x:M+m,y:P+L/2};case Ei.Bottom:return{x:M+m/2,y:P+L};case Ei.Left:return{x:M,y:P+L/2}}}function dan(d,v){return d&&(v?d.find(E=>E.id===v):d[0])||null}function k2e(d,v){return d?typeof d=="string"?d:`${v?`${v}__`:""}${Object.keys(d).sort().map(A=>`${A}=${d[A]}`).join("&")}`:""}function wqn(d,{id:v,defaultColor:E,defaultMarkerStart:A,defaultMarkerEnd:M}){const P=new Set;return d.reduce((m,L)=>([L.markerStart||A,L.markerEnd||M].forEach(H=>{if(H&&typeof H=="object"){const U=k2e(H,v);P.has(U)||(m.push({id:U,color:H.color||E,...H}),P.add(U))}}),m),[]).sort((m,L)=>m.id.localeCompare(L.id))}function gqn(d,v,E,A,M){let P=.5;M==="start"?P=0:M==="end"&&(P=1);let m=[(d.x+d.width*P)*v.zoom+v.x,d.y*v.zoom+v.y-A],L=[-100*P,-100];switch(E){case Ei.Right:m=[(d.x+d.width)*v.zoom+v.x+A,(d.y+d.height*P)*v.zoom+v.y],L=[0,-100*P];break;case Ei.Bottom:m[1]=(d.y+d.height)*v.zoom+v.y+A,L[1]=0;break;case Ei.Left:m=[d.x*v.zoom+v.x-A,(d.y+d.height*P)*v.zoom+v.y],L=[-100,-100*P];break}return`translate(${m[0]}px, ${m[1]}px) translate(${L[0]}%, ${L[1]}%)`}const z1n=1e3,pqn=10,B2e={nodeOrigin:[0,0],nodeExtent:PN,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},mqn={...B2e,checkEquality:!0};function J2e(d,v){const E={...d};for(const A in v)v[A]!==void 0&&(E[A]=v[A]);return E}function vqn(d,v,E){const A=J2e(B2e,E);for(const M of d.values())if(M.parentId)H2e(M,d,v,A);else{const P=RN(M,A.nodeOrigin),m=ak(M.extent)?M.extent:A.nodeExtent,L=hk(P,m,o2(M));M.internals.positionAbsolute=L}}function yqn(d,v){if(!d.handles)return d.measured?v==null?void 0:v.internals.handleBounds:void 0;const E=[],A=[];for(const M of d.handles){const P={id:M.id,width:M.width??1,height:M.height??1,nodeId:d.id,x:M.x,y:M.y,position:M.position,type:M.type};M.type==="source"?E.push(P):M.type==="target"&&A.push(P)}return{source:E,target:A}}function G2e(d){return d==="manual"}function E2e(d,v,E,A={}){var Q,Y;const M=J2e(mqn,A),P={i:0},m=new Map(v),L=M!=null&&M.elevateNodesOnSelect&&!G2e(M.zIndexMode)?z1n:0;let H=d.length>0,U=!1;v.clear(),E.clear();for(const G of d){let V=m.get(G.id);if(M.checkEquality&&G===(V==null?void 0:V.internals.userNode))v.set(G.id,V);else{const te=RN(G,M.nodeOrigin),X=ak(G.extent)?G.extent:M.nodeExtent,Ee=hk(te,X,o2(G));V={...M.defaults,...G,measured:{width:(Q=G.measured)==null?void 0:Q.width,height:(Y=G.measured)==null?void 0:Y.height},internals:{positionAbsolute:Ee,handleBounds:yqn(G,V),z:U1n(G,L,M.zIndexMode),userNode:G}},v.set(G.id,V)}(V.measured===void 0||V.measured.width===void 0||V.measured.height===void 0)&&!V.hidden&&(H=!1),G.parentId&&H2e(V,v,E,A,P),U||(U=G.selected??!1)}return{nodesInitialized:H,hasSelectedNodes:U}}function kqn(d,v){if(!d.parentId)return;const E=v.get(d.parentId);E?E.set(d.id,d):v.set(d.parentId,new Map([[d.id,d]]))}function H2e(d,v,E,A,M){const{elevateNodesOnSelect:P,nodeOrigin:m,nodeExtent:L,zIndexMode:H}=J2e(B2e,A),U=d.parentId,Q=v.get(U);if(!Q){console.warn(`Parent node ${U} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}kqn(d,E),M&&!Q.parentId&&Q.internals.rootParentIndex===void 0&&H==="auto"&&(Q.internals.rootParentIndex=++M.i,Q.internals.z=Q.internals.z+M.i*pqn),M&&Q.internals.rootParentIndex!==void 0&&(M.i=Q.internals.rootParentIndex);const Y=P&&!G2e(H)?z1n:0,{x:G,y:V,z:te}=Eqn(d,Q,m,L,Y,H),{positionAbsolute:X}=d.internals,Ee=G!==X.x||V!==X.y;(Ee||te!==d.internals.z)&&v.set(d.id,{...d,internals:{...d.internals,positionAbsolute:Ee?{x:G,y:V}:X,z:te}})}function U1n(d,v,E){const A=t2(d.zIndex)?d.zIndex:0;return G2e(E)?A:A+(d.selected?v:0)}function Eqn(d,v,E,A,M,P){const{x:m,y:L}=v.internals.positionAbsolute,H=o2(d),U=RN(d,E),Q=ak(d.extent)?hk(U,d.extent,H):U;let Y=hk({x:m+Q.x,y:L+Q.y},A,H);d.extent==="parent"&&(Y=O1n(Y,H,v));const G=U1n(d,M,P),V=v.internals.z??0;return{x:Y.x,y:Y.y,z:V>=G?V+1:G}}function q2e(d,v,E,A=[0,0]){var m;const M=[],P=new Map;for(const L of d){const H=v.get(L.parentId);if(!H)continue;const U=((m=P.get(L.parentId))==null?void 0:m.expandedRect)??$N(H),Q=N1n(U,L.rect);P.set(L.parentId,{expandedRect:Q,parent:H})}return P.size>0&&P.forEach(({expandedRect:L,parent:H},U)=>{var re;const Q=H.internals.positionAbsolute,Y=o2(H),G=H.origin??A,V=L.x<Q.x?Math.round(Math.abs(Q.x-L.x)):0,te=L.y<Q.y?Math.round(Math.abs(Q.y-L.y)):0,X=Math.max(Y.width,Math.round(L.width)),Ee=Math.max(Y.height,Math.round(L.height)),ue=(X-Y.width)*G[0],ge=(Ee-Y.height)*G[1];(V>0||te>0||ue||ge)&&(M.push({id:U,type:"position",position:{x:H.position.x-V+ue,y:H.position.y-te+ge}}),(re=E.get(U))==null||re.forEach(je=>{d.some(Ke=>Ke.id===je.id)||M.push({id:je.id,type:"position",position:{x:je.position.x+V,y:je.position.y+te}})})),(Y.width<L.width||Y.height<L.height||V||te)&&M.push({id:U,type:"dimensions",setAttributes:!0,dimensions:{width:X+(V?G[0]*V-ue:0),height:Ee+(te?G[1]*te-ge:0)}})}),M}function jqn(d,v,E,A,M,P,m){const L=A==null?void 0:A.querySelector(".xyflow__viewport");let H=!1;if(!L)return{changes:[],updatedInternals:H};const U=[],Q=window.getComputedStyle(L),{m22:Y}=new window.DOMMatrixReadOnly(Q.transform),G=[];for(const V of d.values()){const te=v.get(V.id);if(!te)continue;if(te.hidden){v.set(te.id,{...te,internals:{...te.internals,handleBounds:void 0}}),H=!0;continue}const X=R2e(V.nodeElement),Ee=te.measured.width!==X.width||te.measured.height!==X.height;if(!!(X.width&&X.height&&(Ee||!te.internals.handleBounds||V.force))){const ge=V.nodeElement.getBoundingClientRect(),re=ak(te.extent)?te.extent:P;let{positionAbsolute:je}=te.internals;if(te.parentId&&te.extent==="parent"){const Xe=v.get(te.parentId);Xe&&(je=O1n(je,X,Xe))}else re&&(je=hk(je,re,X));const Ke={...te,measured:X,internals:{...te.internals,positionAbsolute:je,handleBounds:{source:oan("source",V.nodeElement,ge,Y,te.id),target:oan("target",V.nodeElement,ge,Y,te.id)}}};v.set(te.id,Ke),te.parentId&&H2e(Ke,v,E,{nodeOrigin:M,zIndexMode:m}),H=!0,Ee&&(U.push({id:te.id,type:"dimensions",dimensions:X}),te.expandParent&&te.parentId&&G.push({id:te.id,parentId:te.parentId,rect:$N(Ke,M)}))}}if(G.length>0){const V=q2e(G,v,E,M);U.push(...V)}return{changes:U,updatedInternals:H}}async function xqn({delta:d,panZoom:v,transform:E,translateExtent:A,width:M,height:P}){if(!v||!d.x&&!d.y)return!1;const m=await v.setViewportConstrained({x:E[0]+d.x,y:E[1]+d.y,zoom:E[2]},[[0,0],[M,P]],A);return!!m&&(m.x!==E[0]||m.y!==E[1]||m.k!==E[2])}function ban(d,v,E,A,M,P){let m=M;const L=A.get(m)||new Map;A.set(m,L.set(E,v)),m=`${M}-${d}`;const H=A.get(m)||new Map;if(A.set(m,H.set(E,v)),P){m=`${M}-${d}-${P}`;const U=A.get(m)||new Map;A.set(m,U.set(E,v))}}function X1n(d,v,E){d.clear(),v.clear();for(const A of E){const{source:M,target:P,sourceHandle:m=null,targetHandle:L=null}=A,H={edgeId:A.id,source:M,target:P,sourceHandle:m,targetHandle:L},U=`${M}-${m}--${P}-${L}`,Q=`${P}-${L}--${M}-${m}`;ban("source",H,Q,d,M,m),ban("target",H,U,d,P,L),v.set(A.id,A)}}function K1n(d,v){if(!d.parentId)return!1;const E=v.get(d.parentId);return E?E.selected?!0:K1n(E,v):!1}function wan(d,v,E){var M;let A=d;do{if((M=A==null?void 0:A.matches)!=null&&M.call(A,v))return!0;if(A===E)return!1;A=A==null?void 0:A.parentElement}while(A);return!1}function Aqn(d,v,E,A){const M=new Map;for(const[P,m]of d)if((m.selected||m.id===A)&&(!m.parentId||!K1n(m,d))&&(m.draggable||v&&typeof m.draggable>"u")){const L=d.get(P);L&&M.set(P,{id:P,position:L.position||{x:0,y:0},distance:{x:E.x-L.internals.positionAbsolute.x,y:E.y-L.internals.positionAbsolute.y},extent:L.extent,parentId:L.parentId,origin:L.origin,expandParent:L.expandParent,internals:{positionAbsolute:L.internals.positionAbsolute||{x:0,y:0}},measured:{width:L.measured.width??0,height:L.measured.height??0}})}return M}function c2e({nodeId:d,dragItems:v,nodeLookup:E,dragging:A=!0}){var m,L,H;const M=[];for(const[U,Q]of v){const Y=(m=E.get(U))==null?void 0:m.internals.userNode;Y&&M.push({...Y,position:Q.position,dragging:A})}if(!d)return[M[0],M];const P=(L=E.get(d))==null?void 0:L.internals.userNode;return[P?{...P,position:((H=v.get(d))==null?void 0:H.position)||P.position,dragging:A}:M[0],M]}function Mqn({dragItems:d,snapGrid:v,x:E,y:A}){const M=d.values().next().value;if(!M)return null;const P={x:E-M.distance.x,y:A-M.distance.y},m=BN(P,v);return{x:m.x-P.x,y:m.y-P.y}}function Cqn({onNodeMouseDown:d,getStoreItems:v,onDragStart:E,onDrag:A,onDragStop:M}){let P={x:null,y:null},m=0,L=new Map,H=!1,U={x:0,y:0},Q=null,Y=!1,G=null,V=!1,te=!1,X=null;function Ee({noDragClassName:ge,handleSelector:re,domNode:je,isSelectable:Ke,nodeId:Xe,nodeClickDistance:Ye=0}){G=_0(je);function kn({x:Vn,y:J}){const{nodeLookup:xe,nodeExtent:on,snapGrid:rn,snapToGrid:Sn,nodeOrigin:Fn,onNodeDrag:dn,onSelectionDrag:Gn,onError:Nn,updateNodePositions:qn}=v();P={x:Vn,y:J};let Jt=!1;const Kt=L.size>1,Oi=Kt&&on?v2e(Kx(L)):null,gr=Kt&&Sn?Mqn({dragItems:L,snapGrid:rn,x:Vn,y:J}):null;for(const[Ki,Kn]of L){if(!xe.has(Ki))continue;let ei={x:Vn-Kn.distance.x,y:J-Kn.distance.y};Sn&&(ei=gr?{x:Math.round(ei.x+gr.x),y:Math.round(ei.y+gr.y)}:BN(ei,rn));let rr=null;if(Kt&&on&&!Kn.extent&&Oi){const{positionAbsolute:sr}=Kn.internals,ri=sr.x-Oi.x+on[0][0],bi=sr.x+Kn.measured.width-Oi.x2+on[1][0],Ac=sr.y-Oi.y+on[0][1],ku=sr.y+Kn.measured.height-Oi.y2+on[1][1];rr=[[ri,Ac],[bi,ku]]}const{position:cr,positionAbsolute:Bi}=P1n({nodeId:Ki,nextPosition:ei,nodeLookup:xe,nodeExtent:rr||on,nodeOrigin:Fn,onError:Nn});Jt=Jt||Kn.position.x!==cr.x||Kn.position.y!==cr.y,Kn.position=cr,Kn.internals.positionAbsolute=Bi}if(te=te||Jt,!!Jt&&(qn(L,!0),X&&(A||dn||!Xe&&Gn))){const[Ki,Kn]=c2e({nodeId:Xe,dragItems:L,nodeLookup:xe});A==null||A(X,L,Ki,Kn),dn==null||dn(X,Ki,Kn),Xe||Gn==null||Gn(X,Kn)}}async function En(){if(!Q)return;const{transform:Vn,panBy:J,autoPanSpeed:xe,autoPanOnNodeDrag:on}=v();if(!on){H=!1,cancelAnimationFrame(m);return}const[rn,Sn]=_2e(U,Q,xe);(rn!==0||Sn!==0)&&(P.x=(P.x??0)-rn/Vn[2],P.y=(P.y??0)-Sn/Vn[2],await J({x:rn,y:Sn})&&kn(P)),m=requestAnimationFrame(En)}function Zn(Vn){var Kt;const{nodeLookup:J,multiSelectionActive:xe,nodesDraggable:on,transform:rn,snapGrid:Sn,snapToGrid:Fn,selectNodesOnDrag:dn,onNodeDragStart:Gn,onSelectionDragStart:Nn,unselectNodesAndEdges:qn}=v();Y=!0,(!dn||!Ke)&&!xe&&Xe&&((Kt=J.get(Xe))!=null&&Kt.selected||qn()),Ke&&dn&&Xe&&(d==null||d(Xe));const Jt=AN(Vn.sourceEvent,{transform:rn,snapGrid:Sn,snapToGrid:Fn,containerBounds:Q});if(P=Jt,L=Aqn(J,on,Jt,Xe),L.size>0&&(E||Gn||!Xe&&Nn)){const[Oi,gr]=c2e({nodeId:Xe,dragItems:L,nodeLookup:J});E==null||E(Vn.sourceEvent,L,Oi,gr),Gn==null||Gn(Vn.sourceEvent,Oi,gr),Xe||Nn==null||Nn(Vn.sourceEvent,gr)}}const Ln=h1n().clickDistance(Ye).on("start",Vn=>{const{domNode:J,nodeDragThreshold:xe,transform:on,snapGrid:rn,snapToGrid:Sn}=v();Q=(J==null?void 0:J.getBoundingClientRect())||null,V=!1,te=!1,X=Vn.sourceEvent,xe===0&&Zn(Vn),P=AN(Vn.sourceEvent,{transform:on,snapGrid:rn,snapToGrid:Sn,containerBounds:Q}),U=i2(Vn.sourceEvent,Q)}).on("drag",Vn=>{const{autoPanOnNodeDrag:J,transform:xe,snapGrid:on,snapToGrid:rn,nodeDragThreshold:Sn,nodeLookup:Fn}=v(),dn=AN(Vn.sourceEvent,{transform:xe,snapGrid:on,snapToGrid:rn,containerBounds:Q});if(X=Vn.sourceEvent,(Vn.sourceEvent.type==="touchmove"&&Vn.sourceEvent.touches.length>1||Xe&&!Fn.has(Xe))&&(V=!0),!V){if(!H&&J&&Y&&(H=!0,En()),!Y){const Gn=i2(Vn.sourceEvent,Q),Nn=Gn.x-U.x,qn=Gn.y-U.y;Math.sqrt(Nn*Nn+qn*qn)>Sn&&Zn(Vn)}(P.x!==dn.xSnapped||P.y!==dn.ySnapped)&&L&&Y&&(U=i2(Vn.sourceEvent,Q),kn(dn))}}).on("end",Vn=>{if(!Y||V){V&&L.size>0&&v().updateNodePositions(L,!1);return}if(H=!1,Y=!1,cancelAnimationFrame(m),L.size>0){const{nodeLookup:J,updateNodePositions:xe,onNodeDragStop:on,onSelectionDragStop:rn}=v();if(te&&(xe(L,!1),te=!1),M||on||!Xe&&rn){const[Sn,Fn]=c2e({nodeId:Xe,dragItems:L,nodeLookup:J,dragging:!1});M==null||M(Vn.sourceEvent,L,Sn,Fn),on==null||on(Vn.sourceEvent,Sn,Fn),Xe||rn==null||rn(Vn.sourceEvent,Fn)}}}).filter(Vn=>{const J=Vn.target;return!Vn.button&&(!ge||!wan(J,`.${ge}`,je))&&(!re||wan(J,re,je))});G.call(Ln)}function ue(){G==null||G.on(".drag",null)}return{update:Ee,destroy:ue}}function Tqn(d,v,E){const A=[],M={x:d.x-E,y:d.y-E,width:E*2,height:E*2};for(const P of v.values())xK(M,$N(P))>0&&A.push(P);return A}const Sqn=250;function Iqn(d,v,E,A){var L,H;let M=[],P=1/0;const m=Tqn(d,E,v+Sqn);for(const U of m){const Q=[...((L=U.internals.handleBounds)==null?void 0:L.source)??[],...((H=U.internals.handleBounds)==null?void 0:H.target)??[]];for(const Y of Q){if(A.nodeId===Y.nodeId&&A.type===Y.type&&A.id===Y.id)continue;const{x:G,y:V}=dk(U,Y,Y.position,!0),te=Math.sqrt(Math.pow(G-d.x,2)+Math.pow(V-d.y,2));te>v||(te<P?(M=[{...Y,x:G,y:V}],P=te):te===P&&M.push({...Y,x:G,y:V}))}}if(!M.length)return null;if(M.length>1){const U=A.type==="source"?"target":"source";return M.find(Q=>Q.type===U)??M[0]}return M[0]}function W1n(d,v,E,A,M,P=!1){var U,Q,Y;const m=A.get(d);if(!m)return null;const L=M==="strict"?(U=m.internals.handleBounds)==null?void 0:U[v]:[...((Q=m.internals.handleBounds)==null?void 0:Q.source)??[],...((Y=m.internals.handleBounds)==null?void 0:Y.target)??[]],H=(E?L==null?void 0:L.find(G=>G.id===E):L==null?void 0:L[0])??null;return H&&P?{...H,...dk(m,H,H.position,!0)}:H}function V1n(d,v){return d||(v!=null&&v.classList.contains("target")?"target":v!=null&&v.classList.contains("source")?"source":null)}function Pqn(d,v){let E=null;return v?E=!0:d&&!v&&(E=!1),E}const Q1n=()=>!0;function Oqn(d,{connectionMode:v,connectionRadius:E,handleId:A,nodeId:M,edgeUpdaterType:P,isTarget:m,domNode:L,nodeLookup:H,lib:U,autoPanOnConnect:Q,flowId:Y,panBy:G,cancelConnection:V,onConnectStart:te,onConnect:X,onConnectEnd:Ee,isValidConnection:ue=Q1n,onReconnectEnd:ge,updateConnection:re,getTransform:je,getFromHandle:Ke,autoPanSpeed:Xe,dragThreshold:Ye=1,handleDomNode:kn}){const En=R1n(d.target);let Zn=0,Ln;const{x:Vn,y:J}=i2(d),xe=V1n(P,kn),on=L==null?void 0:L.getBoundingClientRect();let rn=!1;if(!on||!xe)return;const Sn=W1n(M,xe,A,H,v);if(!Sn)return;let Fn=i2(d,on),dn=!1,Gn=null,Nn=!1,qn=null;function Jt(){if(!Q||!on)return;const[cr,Bi]=_2e(Fn,on,Xe);G({x:cr,y:Bi}),Zn=requestAnimationFrame(Jt)}const Kt={...Sn,nodeId:M,type:xe,position:Sn.position},Oi=H.get(M);let Ki={inProgress:!0,isValid:null,from:dk(Oi,Kt,Ei.Left,!0),fromHandle:Kt,fromPosition:Kt.position,fromNode:Oi,to:Fn,toHandle:null,toPosition:ian[Kt.position],toNode:null,pointer:Fn};function Kn(){rn=!0,re(Ki),te==null||te(d,{nodeId:M,handleId:A,handleType:xe})}Ye===0&&Kn();function ei(cr){if(!rn){const{x:ku,y:Pr}=i2(cr),Ca=ku-Vn,zl=Pr-J;if(!(Ca*Ca+zl*zl>Ye*Ye))return;Kn()}if(!Ke()||!Kt){rr(cr);return}const Bi=je();Fn=i2(cr,on),Ln=Iqn(JN(Fn,Bi,!1,[1,1]),E,H,Kt),dn||(Jt(),dn=!0);const sr=Y1n(cr,{handle:Ln,connectionMode:v,fromNodeId:M,fromHandleId:A,fromType:m?"target":"source",isValidConnection:ue,doc:En,lib:U,flowId:Y,nodeLookup:H});qn=sr.handleDomNode,Gn=sr.connection,Nn=Pqn(!!Ln,sr.isValid);const ri=H.get(M),bi=ri?dk(ri,Kt,Ei.Left,!0):Ki.from,Ac={...Ki,from:bi,isValid:Nn,to:sr.toHandle&&Nn?Ux({x:sr.toHandle.x,y:sr.toHandle.y},Bi):Fn,toHandle:sr.toHandle,toPosition:Nn&&sr.toHandle?sr.toHandle.position:ian[Kt.position],toNode:sr.toHandle?H.get(sr.toHandle.nodeId):null,pointer:Fn};re(Ac),Ki=Ac}function rr(cr){if(!("touches"in cr&&cr.touches.length>0)){if(rn){(Ln||qn)&&Gn&&Nn&&(X==null||X(Gn));const{inProgress:Bi,...sr}=Ki,ri={...sr,toPosition:Ki.toHandle?Ki.toPosition:null};Ee==null||Ee(cr,ri),P&&(ge==null||ge(cr,ri))}V(),cancelAnimationFrame(Zn),dn=!1,Nn=!1,Gn=null,qn=null,En.removeEventListener("mousemove",ei),En.removeEventListener("mouseup",rr),En.removeEventListener("touchmove",ei),En.removeEventListener("touchend",rr)}}En.addEventListener("mousemove",ei),En.addEventListener("mouseup",rr),En.addEventListener("touchmove",ei),En.addEventListener("touchend",rr)}function Y1n(d,{handle:v,connectionMode:E,fromNodeId:A,fromHandleId:M,fromType:P,doc:m,lib:L,flowId:H,isValidConnection:U=Q1n,nodeLookup:Q}){const Y=P==="target",G=v?m.querySelector(`.${L}-flow__handle[data-id="${H}-${v==null?void 0:v.nodeId}-${v==null?void 0:v.id}-${v==null?void 0:v.type}"]`):null,{x:V,y:te}=i2(d),X=m.elementFromPoint(V,te),Ee=X!=null&&X.classList.contains(`${L}-flow__handle`)?X:G,ue={handleDomNode:Ee,isValid:!1,connection:null,toHandle:null};if(Ee){const ge=V1n(void 0,Ee),re=Ee.getAttribute("data-nodeid"),je=Ee.getAttribute("data-handleid"),Ke=Ee.classList.contains("connectable"),Xe=Ee.classList.contains("connectableend");if(!re||!ge)return ue;const Ye={source:Y?re:A,sourceHandle:Y?je:M,target:Y?A:re,targetHandle:Y?M:je};ue.connection=Ye;const En=Ke&&Xe&&(E===qx.Strict?Y&&ge==="source"||!Y&&ge==="target":re!==A||je!==M);ue.isValid=En&&U(Ye),ue.toHandle=W1n(re,ge,je,Q,E,!0)}return ue}const j2e={onPointerDown:Oqn,isValid:Y1n};function Nqn({domNode:d,panZoom:v,getTransform:E,getViewScale:A}){const M=_0(d);function P({translateExtent:L,width:H,height:U,zoomStep:Q=1,pannable:Y=!0,zoomable:G=!0,inversePan:V=!1}){const te=re=>{if(re.sourceEvent.type!=="wheel"||!v)return;const je=E(),Ke=re.sourceEvent.ctrlKey&&DN()?10:1,Xe=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*Q,Ye=je[2]*Math.pow(2,Xe*Ke);v.scaleTo(Ye)};let X=[0,0];const Ee=re=>{(re.sourceEvent.type==="mousedown"||re.sourceEvent.type==="touchstart")&&(X=[re.sourceEvent.clientX??re.sourceEvent.touches[0].clientX,re.sourceEvent.clientY??re.sourceEvent.touches[0].clientY])},ue=re=>{const je=E();if(re.sourceEvent.type!=="mousemove"&&re.sourceEvent.type!=="touchmove"||!v)return;const Ke=[re.sourceEvent.clientX??re.sourceEvent.touches[0].clientX,re.sourceEvent.clientY??re.sourceEvent.touches[0].clientY],Xe=[Ke[0]-X[0],Ke[1]-X[1]];X=Ke;const Ye=A()*Math.max(je[2],Math.log(je[2]))*(V?-1:1),kn={x:je[0]-Xe[0]*Ye,y:je[1]-Xe[1]*Ye},En=[[0,0],[H,U]];v.setViewportConstrained({x:kn.x,y:kn.y,zoom:je[2]},En,L)},ge=M1n().on("start",Ee).on("zoom",Y?ue:null).on("zoom.wheel",G?te:null);M.call(ge,{})}function m(){M.on("zoom",null)}return{update:P,destroy:m,pointer:e2}}const $K=d=>({x:d.x,y:d.y,zoom:d.k}),u2e=({x:d,y:v,zoom:E})=>PK.translate(d,v).scale(E),V5=(d,v)=>d.target.closest(`.${v}`),Z1n=(d,v)=>v===2&&Array.isArray(d)&&d.includes(2),$qn=d=>((d*=2)<=1?d*d*d:(d-=2)*d*d+2)/2,o2e=(d,v=0,E=$qn,A=()=>{})=>{const M=typeof v=="number"&&v>0;return M||A(),M?d.transition().duration(v).ease(E).on("end",A):d},edn=d=>{const v=d.ctrlKey&&DN()?10:1;return-d.deltaY*(d.deltaMode===1?.05:d.deltaMode?1:.002)*v};function Dqn({zoomPanValues:d,noWheelClassName:v,d3Selection:E,d3Zoom:A,panOnScrollMode:M,panOnScrollSpeed:P,zoomOnPinch:m,onPanZoomStart:L,onPanZoom:H,onPanZoomEnd:U}){return Q=>{if(V5(Q,v))return Q.ctrlKey&&Q.preventDefault(),!1;Q.preventDefault(),Q.stopImmediatePropagation();const Y=E.property("__zoom").k||1;if(Q.ctrlKey&&m){const Ee=e2(Q),ue=edn(Q),ge=Y*Math.pow(2,ue);A.scaleTo(E,ge,Ee,Q);return}const G=Q.deltaMode===1?20:1;let V=M===sk.Vertical?0:Q.deltaX*G,te=M===sk.Horizontal?0:Q.deltaY*G;!DN()&&Q.shiftKey&&M!==sk.Vertical&&(V=Q.deltaY*G,te=0),A.translateBy(E,-(V/Y)*P,-(te/Y)*P,{internal:!0});const X=$K(E.property("__zoom"));clearTimeout(d.panScrollTimeout),d.isPanScrolling?H==null||H(Q,X):(d.isPanScrolling=!0,L==null||L(Q,X)),d.panScrollTimeout=setTimeout(()=>{U==null||U(Q,X),d.isPanScrolling=!1},150)}}function Lqn({noWheelClassName:d,preventScrolling:v,d3ZoomHandler:E}){return function(A,M){const P=A.type==="wheel",m=!v&&P&&!A.ctrlKey,L=V5(A,d);if(A.ctrlKey&&P&&L&&A.preventDefault(),m||L)return null;A.preventDefault(),E.call(this,A,M)}}function _qn({zoomPanValues:d,onDraggingChange:v,onPanZoomStart:E}){return A=>{var P,m,L;if((P=A.sourceEvent)!=null&&P.internal)return;const M=$K(A.transform);d.mouseButton=((m=A.sourceEvent)==null?void 0:m.button)||0,d.isZoomingOrPanning=!0,d.prevViewport=M,((L=A.sourceEvent)==null?void 0:L.type)==="mousedown"&&v(!0),E&&(E==null||E(A.sourceEvent,M))}}function Fqn({zoomPanValues:d,panOnDrag:v,onPaneContextMenu:E,onTransformChange:A,onPanZoom:M}){return P=>{var m,L;d.usedRightMouseButton=!!(E&&Z1n(v,d.mouseButton??0)),(m=P.sourceEvent)!=null&&m.sync||A([P.transform.x,P.transform.y,P.transform.k]),M&&!((L=P.sourceEvent)!=null&&L.internal)&&(M==null||M(P.sourceEvent,$K(P.transform)))}}function Rqn({zoomPanValues:d,panOnDrag:v,panOnScroll:E,onDraggingChange:A,onPanZoomEnd:M,onPaneContextMenu:P}){return m=>{var L;if(!((L=m.sourceEvent)!=null&&L.internal)&&(d.isZoomingOrPanning=!1,P&&Z1n(v,d.mouseButton??0)&&!d.usedRightMouseButton&&m.sourceEvent&&P(m.sourceEvent),d.usedRightMouseButton=!1,A(!1),M)){const H=$K(m.transform);d.prevViewport=H,clearTimeout(d.timerId),d.timerId=setTimeout(()=>{M==null||M(m.sourceEvent,H)},E?150:0)}}}function Bqn({panActivationKeyPressed:d,zoomActivationKeyPressed:v,zoomOnScroll:E,zoomOnPinch:A,panOnDrag:M,panOnScroll:P,zoomOnDoubleClick:m,userSelectionActive:L,noWheelClassName:H,noPanClassName:U,lib:Q,connectionInProgress:Y}){return G=>{var ue;const V=v||E,te=A&&G.ctrlKey,X=G.type==="wheel";if(G.button===1&&G.type==="mousedown"&&(V5(G,`${Q}-flow__node`)||V5(G,`${Q}-flow__edge`)||V5(G,`${Q}-flow__selection`)||V5(G,`${Q}-flow__nodesselection`)))return!0;if(!M&&!V&&!P&&!m&&!A||L||Y&&!X||V5(G,H)&&X||V5(G,U)&&(!X||P&&X&&!v)||!A&&G.ctrlKey&&X)return!1;if(!A&&G.type==="touchstart"&&((ue=G.touches)==null?void 0:ue.length)>1)return G.preventDefault(),!1;if(!V&&!P&&!te&&X||!M&&(G.type==="mousedown"||G.type==="touchstart")||Array.isArray(M)&&!M.includes(G.button)&&G.type==="mousedown")return!1;const Ee=Array.isArray(M)&&M.includes(G.button)||!G.button||G.button<=1;return(!G.ctrlKey||X||d)&&Ee}}function Jqn({domNode:d,minZoom:v,maxZoom:E,translateExtent:A,viewport:M,onPanZoom:P,onPanZoomStart:m,onPanZoomEnd:L,onDraggingChange:H}){const U={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},Q=d.getBoundingClientRect();let Y=[[0,0],[Q.width,Q.height]];const G=typeof ResizeObserver<"u"?new ResizeObserver(J=>{const xe=J[0];xe&&(Y=[[0,0],[xe.contentRect.width,xe.contentRect.height]])}):null;G==null||G.observe(d);const V=M1n().extent(()=>Y).scaleExtent([v,E]).translateExtent(A),te=_0(d).call(V);je({x:M.x,y:M.y,zoom:zx(M.zoom,v,E)},[[0,0],[Q.width,Q.height]],A);const X=te.on("wheel.zoom"),Ee=te.on("dblclick.zoom");V.wheelDelta(edn);async function ue(J,xe){return te?new Promise(on=>{V==null||V.interpolate((xe==null?void 0:xe.interpolate)==="linear"?xN:fK).transform(o2e(te,xe==null?void 0:xe.duration,xe==null?void 0:xe.ease,()=>on(!0)),J)}):!1}function ge({noWheelClassName:J,noPanClassName:xe,onPaneContextMenu:on,userSelectionActive:rn,panOnScroll:Sn,panOnDrag:Fn,panOnScrollMode:dn,panOnScrollSpeed:Gn,preventScrolling:Nn,zoomOnPinch:qn,zoomOnScroll:Jt,zoomOnDoubleClick:Kt,panActivationKeyPressed:Oi=!1,zoomActivationKeyPressed:gr,lib:Ki,onTransformChange:Kn,connectionInProgress:ei,paneClickDistance:rr,selectionOnDrag:cr}){rn&&!U.isZoomingOrPanning&&re();const Bi=Sn&&!gr&&!rn;V.clickDistance(cr?1/0:!t2(rr)||rr<0?0:rr);const sr=Bi?Dqn({zoomPanValues:U,noWheelClassName:J,d3Selection:te,d3Zoom:V,panOnScrollMode:dn,panOnScrollSpeed:Gn,zoomOnPinch:qn,onPanZoomStart:m,onPanZoom:P,onPanZoomEnd:L}):Lqn({noWheelClassName:J,preventScrolling:Nn,d3ZoomHandler:X});te.on("wheel.zoom",sr,{passive:!1});const ri=_qn({zoomPanValues:U,onDraggingChange:H,onPanZoomStart:m});V.on("start",ri);const bi=Fqn({zoomPanValues:U,panOnDrag:Fn,onPaneContextMenu:!!on,onPanZoom:P,onTransformChange:Kn});V.on("zoom",bi);const Ac=Rqn({zoomPanValues:U,panOnDrag:Fn,panOnScroll:Sn,onPaneContextMenu:on,onPanZoomEnd:L,onDraggingChange:H});V.on("end",Ac);const ku=Bqn({panActivationKeyPressed:Oi,zoomActivationKeyPressed:gr,panOnDrag:Fn,zoomOnScroll:Jt,panOnScroll:Sn,zoomOnDoubleClick:Kt,zoomOnPinch:qn,userSelectionActive:rn,noPanClassName:xe,noWheelClassName:J,lib:Ki,connectionInProgress:ei});V.filter(ku),Kt?te.on("dblclick.zoom",Ee):te.on("dblclick.zoom",null)}function re(){V.on("zoom",null)}async function je(J,xe,on){const rn=u2e(J),Sn=V==null?void 0:V.constrain()(rn,xe,on);return Sn&&await ue(Sn),Sn}async function Ke(J,xe){const on=u2e(J);return await ue(on,xe),on}function Xe(J){if(te){const xe=u2e(J),on=te.property("__zoom");(on.k!==J.zoom||on.x!==J.x||on.y!==J.y)&&(V==null||V.transform(te,xe,null,{sync:!0}))}}function Ye(){const J=te?A1n(te.node()):{x:0,y:0,k:1};return{x:J.x,y:J.y,zoom:J.k}}async function kn(J,xe){return te?new Promise(on=>{V==null||V.interpolate((xe==null?void 0:xe.interpolate)==="linear"?xN:fK).scaleTo(o2e(te,xe==null?void 0:xe.duration,xe==null?void 0:xe.ease,()=>on(!0)),J)}):!1}async function En(J,xe){return te?new Promise(on=>{V==null||V.interpolate((xe==null?void 0:xe.interpolate)==="linear"?xN:fK).scaleBy(o2e(te,xe==null?void 0:xe.duration,xe==null?void 0:xe.ease,()=>on(!0)),J)}):!1}function Zn(J){V==null||V.scaleExtent(J)}function Ln(J){V==null||V.translateExtent(J)}function Vn(J){const xe=!t2(J)||J<0?0:J;V==null||V.clickDistance(xe)}return{update:ge,destroy:re,setViewport:Ke,setViewportConstrained:je,getViewport:Ye,scaleTo:kn,scaleBy:En,setScaleExtent:Zn,setTranslateExtent:Ln,syncViewport:Xe,setClickDistance:Vn}}var Xx;(function(d){d.Line="line",d.Handle="handle"})(Xx||(Xx={}));function Gqn({width:d,prevWidth:v,height:E,prevHeight:A,affectsX:M,affectsY:P}){const m=d-v,L=E-A,H=[m>0?1:m<0?-1:0,L>0?1:L<0?-1:0];return m&&M&&(H[0]=H[0]*-1),L&&P&&(H[1]=H[1]*-1),H}function gan(d){const v=d.includes("right")||d.includes("left"),E=d.includes("bottom")||d.includes("top"),A=d.includes("left"),M=d.includes("top");return{isHorizontal:v,isVertical:E,affectsX:A,affectsY:M}}function K5(d,v){return Math.max(0,v-d)}function W5(d,v){return Math.max(0,d-v)}function iK(d,v,E){return Math.max(0,v-d,d-E)}function pan(d,v){return d?!v:v}function Hqn(d,v,E,A,M,P,m,L){let{affectsX:H,affectsY:U}=v;const{isHorizontal:Q,isVertical:Y}=v,G=Q&&Y,{xSnapped:V,ySnapped:te}=E,{minWidth:X,maxWidth:Ee,minHeight:ue,maxHeight:ge}=A,{x:re,y:je,width:Ke,height:Xe,aspectRatio:Ye}=d;let kn=Math.floor(Q?V-d.pointerX:0),En=Math.floor(Y?te-d.pointerY:0);const Zn=Ke+(H?-kn:kn),Ln=Xe+(U?-En:En),Vn=-P[0]*Ke,J=-P[1]*Xe;let xe=iK(Zn,X,Ee),on=iK(Ln,ue,ge);if(m){let Fn=0,dn=0;H&&kn<0?Fn=K5(re+kn+Vn,m[0][0]):!H&&kn>0&&(Fn=W5(re+Zn+Vn,m[1][0])),U&&En<0?dn=K5(je+En+J,m[0][1]):!U&&En>0&&(dn=W5(je+Ln+J,m[1][1])),xe=Math.max(xe,Fn),on=Math.max(on,dn)}if(L){let Fn=0,dn=0;H&&kn>0?Fn=W5(re+kn,L[0][0]):!H&&kn<0&&(Fn=K5(re+Zn,L[1][0])),U&&En>0?dn=W5(je+En,L[0][1]):!U&&En<0&&(dn=K5(je+Ln,L[1][1])),xe=Math.max(xe,Fn),on=Math.max(on,dn)}if(M){if(Q){const Fn=iK(Zn/Ye,ue,ge)*Ye;if(xe=Math.max(xe,Fn),m){let dn=0;!H&&!U||H&&!U&&G?dn=W5(je+J+Zn/Ye,m[1][1])*Ye:dn=K5(je+J+(H?kn:-kn)/Ye,m[0][1])*Ye,xe=Math.max(xe,dn)}if(L){let dn=0;!H&&!U||H&&!U&&G?dn=K5(je+Zn/Ye,L[1][1])*Ye:dn=W5(je+(H?kn:-kn)/Ye,L[0][1])*Ye,xe=Math.max(xe,dn)}}if(Y){const Fn=iK(Ln*Ye,X,Ee)/Ye;if(on=Math.max(on,Fn),m){let dn=0;!H&&!U||U&&!H&&G?dn=W5(re+Ln*Ye+Vn,m[1][0])/Ye:dn=K5(re+(U?En:-En)*Ye+Vn,m[0][0])/Ye,on=Math.max(on,dn)}if(L){let dn=0;!H&&!U||U&&!H&&G?dn=K5(re+Ln*Ye,L[1][0])/Ye:dn=W5(re+(U?En:-En)*Ye,L[0][0])/Ye,on=Math.max(on,dn)}}}En=En+(En<0?on:-on),kn=kn+(kn<0?xe:-xe),M&&(G?Zn>Ln*Ye?En=(pan(H,U)?-kn:kn)/Ye:kn=(pan(H,U)?-En:En)*Ye:Q?(En=kn/Ye,U=H):(kn=En*Ye,H=U));const rn=H?re+kn:re,Sn=U?je+En:je;return{width:Ke+(H?-kn:kn),height:Xe+(U?-En:En),x:P[0]*kn*(H?-1:1)+rn,y:P[1]*En*(U?-1:1)+Sn}}const ndn={width:0,height:0,x:0,y:0},qqn={...ndn,pointerX:0,pointerY:0,aspectRatio:1};function zqn(d,v,E){const A=v.position.x+d.position.x,M=v.position.y+d.position.y,P=d.measured.width??0,m=d.measured.height??0,L=E[0]*P,H=E[1]*m;return[[A-L,M-H],[A+P-L,M+m-H]]}function Uqn({domNode:d,nodeId:v,getStoreItems:E,onChange:A,onEnd:M}){const P=_0(d);let m={controlDirection:gan("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function L({controlPosition:U,boundaries:Q,keepAspectRatio:Y,resizeDirection:G,onResizeStart:V,onResize:te,onResizeEnd:X,shouldResize:Ee}){let ue={...ndn},ge={...qqn};m={boundaries:Q,resizeDirection:G,keepAspectRatio:Y,controlDirection:gan(U)};let re,je=null,Ke=[],Xe,Ye,kn;const En=h1n().on("start",Zn=>{const{nodeLookup:Ln,transform:Vn,snapGrid:J,snapToGrid:xe,nodeOrigin:on,paneDomNode:rn}=E();if(re=Ln.get(v),!re)return;je=(rn==null?void 0:rn.getBoundingClientRect())??null;const{xSnapped:Sn,ySnapped:Fn}=AN(Zn.sourceEvent,{transform:Vn,snapGrid:J,snapToGrid:xe,containerBounds:je});ue={width:re.measured.width??0,height:re.measured.height??0,x:re.position.x??0,y:re.position.y??0},ge={...ue,pointerX:Sn,pointerY:Fn,aspectRatio:ue.width/ue.height},Xe=void 0,Ye=ak(re.extent)?re.extent:void 0,re.parentId&&(re.extent==="parent"||re.expandParent)&&(Xe=Ln.get(re.parentId)),Xe&&re.extent==="parent"&&(Ye=[[0,0],[Xe.measured.width,Xe.measured.height]]),Ke=[],kn=void 0;for(const[dn,Gn]of Ln)if(Gn.parentId===v&&(Ke.push({id:dn,position:{...Gn.position},extent:Gn.extent}),Gn.extent==="parent"||Gn.expandParent)){const Nn=zqn(Gn,re,Gn.origin??on);kn?kn=[[Math.min(Nn[0][0],kn[0][0]),Math.min(Nn[0][1],kn[0][1])],[Math.max(Nn[1][0],kn[1][0]),Math.max(Nn[1][1],kn[1][1])]]:kn=Nn}V==null||V(Zn,{...ue})}).on("drag",Zn=>{const{transform:Ln,snapGrid:Vn,snapToGrid:J,nodeOrigin:xe}=E(),on=AN(Zn.sourceEvent,{transform:Ln,snapGrid:Vn,snapToGrid:J,containerBounds:je}),rn=[];if(!re)return;const{x:Sn,y:Fn,width:dn,height:Gn}=ue,Nn={},qn=re.origin??xe,{width:Jt,height:Kt,x:Oi,y:gr}=Hqn(ge,m.controlDirection,on,m.boundaries,m.keepAspectRatio,qn,Ye,kn),Ki=Jt!==dn,Kn=Kt!==Gn,ei=Oi!==Sn&&Ki,rr=gr!==Fn&&Kn;if(!ei&&!rr&&!Ki&&!Kn)return;const cr={prevValues:{...ue},startX:ge.x,startY:ge.y,childNodes:Ke.map(bi=>({...bi,position:{...bi.position}}))};if((ei||rr||qn[0]===1||qn[1]===1)&&(Nn.x=ei?Oi:ue.x,Nn.y=rr?gr:ue.y,ue.x=Nn.x,ue.y=Nn.y,Ke.length>0)){const bi=Oi-Sn,Ac=gr-Fn;for(const ku of Ke)ku.position={x:ku.position.x-bi+qn[0]*(Jt-dn),y:ku.position.y-Ac+qn[1]*(Kt-Gn)},rn.push(ku)}if((Ki||Kn)&&(Nn.width=Ki&&(!m.resizeDirection||m.resizeDirection==="horizontal")?Jt:ue.width,Nn.height=Kn&&(!m.resizeDirection||m.resizeDirection==="vertical")?Kt:ue.height,ue.width=Nn.width,ue.height=Nn.height),Xe&&re.expandParent){const bi=qn[0]*(Nn.width??0);Nn.x&&Nn.x<bi&&(ue.x=bi,ge.x=ge.x-(Nn.x-bi));const Ac=qn[1]*(Nn.height??0);Nn.y&&Nn.y<Ac&&(ue.y=Ac,ge.y=ge.y-(Nn.y-Ac))}const Bi=Gqn({width:ue.width,prevWidth:dn,height:ue.height,prevHeight:Gn,affectsX:m.controlDirection.affectsX,affectsY:m.controlDirection.affectsY}),sr={...ue,direction:Bi};if((Ee==null?void 0:Ee(Zn,sr))===!1){ue=cr.prevValues,ge.x=cr.startX,ge.y=cr.startY,Ke.forEach((bi,Ac)=>{bi.position=cr.childNodes[Ac].position});return}te==null||te(Zn,sr),A(Nn,rn)}).on("end",Zn=>{X==null||X(Zn,{...ue}),M==null||M({...ue})});P.call(En)}function H(){P.on(".drag",null)}return{update:L,destroy:H}}const Xqn={},man=d=>{let v;const E=new Set,A=(Q,Y)=>{const G=typeof Q=="function"?Q(v):Q;if(!Object.is(G,v)){const V=v;v=Y??(typeof G!="object"||G===null)?G:Object.assign({},v,G),E.forEach(te=>te(v,V))}},M=()=>v,H={setState:A,getState:M,getInitialState:()=>U,subscribe:Q=>(E.add(Q),()=>E.delete(Q)),destroy:()=>{(Xqn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),E.clear()}},U=v=d(A,M,H);return H},Kqn=d=>d?man(d):man,{useDebugValue:Wqn}=PRn,{useSyncExternalStoreWithSelector:Vqn}=IRn,Qqn=d=>d;function tdn(d,v=Qqn,E){const A=Vqn(d.subscribe,d.getState,d.getServerState||d.getInitialState,v,E);return Wqn(A),A}const van=(d,v)=>{const E=Kqn(d),A=(M,P=v)=>tdn(E,M,P);return Object.assign(A,E),A},Yqn=(d,v)=>d?van(d,v):van;function Ts(d,v){if(Object.is(d,v))return!0;if(typeof d!="object"||d===null||typeof v!="object"||v===null)return!1;if(d instanceof Map&&v instanceof Map){if(d.size!==v.size)return!1;for(const[A,M]of d)if(!Object.is(M,v.get(A)))return!1;return!0}if(d instanceof Set&&v instanceof Set){if(d.size!==v.size)return!1;for(const A of d)if(!v.has(A))return!1;return!0}const E=Object.keys(d);if(E.length!==Object.keys(v).length)return!1;for(const A of E)if(!Object.prototype.hasOwnProperty.call(v,A)||!Object.is(d[A],v[A]))return!1;return!0}const DK=sn.createContext(null),Zqn=DK.Provider,idn=c2.error001("react");function Sc(d,v){const E=sn.useContext(DK);if(E===null)throw new Error(idn);return tdn(E,d,v)}function os(){const d=sn.useContext(DK);if(d===null)throw new Error(idn);return sn.useMemo(()=>({getState:d.getState,setState:d.setState,subscribe:d.subscribe}),[d])}const yan={display:"none"},ezn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rdn="react-flow__node-desc",cdn="react-flow__edge-desc",nzn="react-flow__aria-live",tzn=d=>d.ariaLiveMessage,izn=d=>d.ariaLabelConfig;function rzn({rfId:d}){const v=Sc(tzn);return de.jsx("div",{id:`${nzn}-${d}`,"aria-live":"assertive","aria-atomic":"true",style:ezn,children:v})}function czn({rfId:d,disableKeyboardA11y:v}){const E=Sc(izn);return de.jsxs(de.Fragment,{children:[de.jsx("div",{id:`${rdn}-${d}`,style:yan,children:v?E["node.a11yDescription.default"]:E["node.a11yDescription.keyboardDisabled"]}),de.jsx("div",{id:`${cdn}-${d}`,style:yan,children:E["edge.a11yDescription.default"]}),!v&&de.jsx(rzn,{rfId:d})]})}const HN=sn.forwardRef(({position:d="top-left",children:v,className:E,style:A,...M},P)=>{const m=`${d}`.split("-");return de.jsx("div",{className:Kf(["react-flow__panel",E,...m]),style:A,ref:P,...M,children:v})});HN.displayName="Panel";const kan="https://reactflow.dev?utm_source=attribution";function uzn({proOptions:d,position:v="bottom-right"}){return sn.useEffect(()=>{},[]),d!=null&&d.hideAttribution?null:de.jsx(HN,{position:v,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kan}`,children:de.jsx("a",{href:kan,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ozn=d=>{const v=[],E=[];for(const[,A]of d.nodeLookup)A.selected&&v.push(A.internals.userNode);for(const[,A]of d.edgeLookup)A.selected&&E.push(A);return{selectedNodes:v,selectedEdges:E}},rK=d=>d.id;function szn(d,v){return Ts(d.selectedNodes.map(rK),v.selectedNodes.map(rK))&&Ts(d.selectedEdges.map(rK),v.selectedEdges.map(rK))}function fzn({onSelectionChange:d}){const v=os(),{selectedNodes:E,selectedEdges:A}=Sc(ozn,szn);return sn.useEffect(()=>{const M={nodes:E,edges:A};d==null||d(M),v.getState().onSelectionChangeHandlers.forEach(P=>P(M))},[E,A,d]),null}const lzn=d=>!!d.onSelectionChangeHandlers;function hzn({onSelectionChange:d}){const v=Sc(lzn);return d||v?de.jsx(fzn,{onSelectionChange:d}):null}const udn=[0,0],azn={x:0,y:0,zoom:1},dzn=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ean=[...dzn,"rfId"],bzn=d=>({setNodes:d.setNodes,setEdges:d.setEdges,setMinZoom:d.setMinZoom,setMaxZoom:d.setMaxZoom,setTranslateExtent:d.setTranslateExtent,setNodeExtent:d.setNodeExtent,reset:d.reset,setDefaultNodesAndEdges:d.setDefaultNodesAndEdges}),jan={translateExtent:PN,nodeOrigin:udn,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wzn(d){const{setNodes:v,setEdges:E,setMinZoom:A,setMaxZoom:M,setTranslateExtent:P,setNodeExtent:m,reset:L,setDefaultNodesAndEdges:H}=Sc(bzn,Ts),U=os();sn.useEffect(()=>(H(d.defaultNodes,d.defaultEdges),()=>{Q.current=jan,L()}),[]);const Q=sn.useRef(jan);return sn.useEffect(()=>{for(const Y of Ean){const G=d[Y],V=Q.current[Y];G!==V&&(typeof d[Y]>"u"||(Y==="nodes"?v(G):Y==="edges"?E(G):Y==="minZoom"?A(G):Y==="maxZoom"?M(G):Y==="translateExtent"?P(G):Y==="nodeExtent"?m(G):Y==="ariaLabelConfig"?U.setState({ariaLabelConfig:rqn(G)}):Y==="fitView"?U.setState({fitViewQueued:G}):Y==="fitViewOptions"?U.setState({fitViewOptions:G}):U.setState({[Y]:G})))}Q.current=d},Ean.map(Y=>d[Y])),null}function xan(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function gzn(d){var A;const[v,E]=sn.useState(d==="system"?null:d);return sn.useEffect(()=>{if(d!=="system"){E(d);return}const M=xan(),P=()=>E(M!=null&&M.matches?"dark":"light");return P(),M==null||M.addEventListener("change",P),()=>{M==null||M.removeEventListener("change",P)}},[d]),v!==null?v:(A=xan())!=null&&A.matches?"dark":"light"}const Aan=typeof document<"u"?document:null;function LN(d=null,v={target:Aan,actInsideInputWithModifier:!0}){const[E,A]=sn.useState(!1),M=sn.useRef(!1),P=sn.useRef(new Set([])),[m,L]=sn.useMemo(()=>{if(d!==null){const U=(Array.isArray(d)?d:[d]).filter(Y=>typeof Y=="string").map(Y=>Y.replace(/\+/g,`
1
+ import{os as IRn,hB as PRn,r as sn,j as de,e8 as Kan,i3 as ORn,iA as NRn,mr as $Rn,ot as DRn,a3 as MN,bl as A2e,B as Wan,iC as Van,Z as r2,g_ as M2e,b2 as C2e,b1 as LRn,aa as jN,f as _Rn,hD as FRn,X as RRn,ou as BRn,ov as Fhn,eS as JRn,ke as GRn,iB as HRn,an as qRn,ow as zRn,g1 as URn,h1 as XRn,g2 as KRn,g3 as WRn,bH as VX,fo as VRn,F as Rhn,a6 as QRn,A as YRn,g$ as ZRn,lx as eBn,g6 as nBn,fR as tBn,fS as iBn,fT as rBn,fU as cBn,fV as uBn,fW as oBn,fX as sBn,fY as fBn,ox as lBn}from"./index-Dr-0P6rd.js";import{H as wK}from"./_shell.team-BE_60YS4.js";import{H as hBn}from"./heart-Bp14wOx6.js";import{a as e2e,A as aBn}from"./AdapterIcon-BdM7K69W.js";import{s as dBn}from"./session-strategy-labels-C7Wduch3.js";import{u as bBn}from"./use-mesh-topology-DBeqzUoy.js";import{u as wBn}from"./use-delete-binding-DxEiOjjh.js";import"./use-pending-read-DmrlNHS0.js";import"./search-x-LIKnWE64.js";import"./scroll-area-XlDz8u4m.js";import"./OpenMeshSwitch-DrmjsCDY.js";import"./table-P4N5xQn2.js";import"./page-container-CPxW5T9E.js";import"./CommitmentList-DsEn6iK1.js";function Kf(d){if(typeof d=="string"||typeof d=="number")return""+d;let v="";if(Array.isArray(d))for(let E=0,A;E<d.length;E++)(A=Kf(d[E]))!==""&&(v+=(v&&" ")+A);else for(let E in d)d[E]&&(v+=(v&&" ")+E);return v}var gBn={value:()=>{}};function CK(){for(var d=0,v=arguments.length,E={},A;d<v;++d){if(!(A=arguments[d]+"")||A in E||/[\s.]/.test(A))throw new Error("illegal type: "+A);E[A]=[]}return new sK(E)}function sK(d){this._=d}function pBn(d,v){return d.trim().split(/^|\s+/).map(function(E){var A="",M=E.indexOf(".");if(M>=0&&(A=E.slice(M+1),E=E.slice(0,M)),E&&!v.hasOwnProperty(E))throw new Error("unknown type: "+E);return{type:E,name:A}})}sK.prototype=CK.prototype={constructor:sK,on:function(d,v){var E=this._,A=pBn(d+"",E),M,P=-1,m=A.length;if(arguments.length<2){for(;++P<m;)if((M=(d=A[P]).type)&&(M=mBn(E[M],d.name)))return M;return}if(v!=null&&typeof v!="function")throw new Error("invalid callback: "+v);for(;++P<m;)if(M=(d=A[P]).type)E[M]=Bhn(E[M],d.name,v);else if(v==null)for(M in E)E[M]=Bhn(E[M],d.name,null);return this},copy:function(){var d={},v=this._;for(var E in v)d[E]=v[E].slice();return new sK(d)},call:function(d,v){if((M=arguments.length-2)>0)for(var E=new Array(M),A=0,M,P;A<M;++A)E[A]=arguments[A+2];if(!this._.hasOwnProperty(d))throw new Error("unknown type: "+d);for(P=this._[d],A=0,M=P.length;A<M;++A)P[A].value.apply(v,E)},apply:function(d,v,E){if(!this._.hasOwnProperty(d))throw new Error("unknown type: "+d);for(var A=this._[d],M=0,P=A.length;M<P;++M)A[M].value.apply(v,E)}};function mBn(d,v){for(var E=0,A=d.length,M;E<A;++E)if((M=d[E]).name===v)return M.value}function Bhn(d,v,E){for(var A=0,M=d.length;A<M;++A)if(d[A].name===v){d[A]=gBn,d=d.slice(0,A).concat(d.slice(A+1));break}return E!=null&&d.push({name:v,value:E}),d}var h2e="http://www.w3.org/1999/xhtml";const Jhn={svg:"http://www.w3.org/2000/svg",xhtml:h2e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function TK(d){var v=d+="",E=v.indexOf(":");return E>=0&&(v=d.slice(0,E))!=="xmlns"&&(d=d.slice(E+1)),Jhn.hasOwnProperty(v)?{space:Jhn[v],local:d}:d}function vBn(d){return function(){var v=this.ownerDocument,E=this.namespaceURI;return E===h2e&&v.documentElement.namespaceURI===h2e?v.createElement(d):v.createElementNS(E,d)}}function yBn(d){return function(){return this.ownerDocument.createElementNS(d.space,d.local)}}function Qan(d){var v=TK(d);return(v.local?yBn:vBn)(v)}function kBn(){}function T2e(d){return d==null?kBn:function(){return this.querySelector(d)}}function EBn(d){typeof d!="function"&&(d=T2e(d));for(var v=this._groups,E=v.length,A=new Array(E),M=0;M<E;++M)for(var P=v[M],m=P.length,L=A[M]=new Array(m),H,U,Q=0;Q<m;++Q)(H=P[Q])&&(U=d.call(H,H.__data__,Q,P))&&("__data__"in H&&(U.__data__=H.__data__),L[Q]=U);return new F0(A,this._parents)}function jBn(d){return d==null?[]:Array.isArray(d)?d:Array.from(d)}function xBn(){return[]}function Yan(d){return d==null?xBn:function(){return this.querySelectorAll(d)}}function ABn(d){return function(){return jBn(d.apply(this,arguments))}}function MBn(d){typeof d=="function"?d=ABn(d):d=Yan(d);for(var v=this._groups,E=v.length,A=[],M=[],P=0;P<E;++P)for(var m=v[P],L=m.length,H,U=0;U<L;++U)(H=m[U])&&(A.push(d.call(H,H.__data__,U,m)),M.push(H));return new F0(A,M)}function Zan(d){return function(){return this.matches(d)}}function e1n(d){return function(v){return v.matches(d)}}var CBn=Array.prototype.find;function TBn(d){return function(){return CBn.call(this.children,d)}}function SBn(){return this.firstElementChild}function IBn(d){return this.select(d==null?SBn:TBn(typeof d=="function"?d:e1n(d)))}var PBn=Array.prototype.filter;function OBn(){return Array.from(this.children)}function NBn(d){return function(){return PBn.call(this.children,d)}}function $Bn(d){return this.selectAll(d==null?OBn:NBn(typeof d=="function"?d:e1n(d)))}function DBn(d){typeof d!="function"&&(d=Zan(d));for(var v=this._groups,E=v.length,A=new Array(E),M=0;M<E;++M)for(var P=v[M],m=P.length,L=A[M]=[],H,U=0;U<m;++U)(H=P[U])&&d.call(H,H.__data__,U,P)&&L.push(H);return new F0(A,this._parents)}function n1n(d){return new Array(d.length)}function LBn(){return new F0(this._enter||this._groups.map(n1n),this._parents)}function gK(d,v){this.ownerDocument=d.ownerDocument,this.namespaceURI=d.namespaceURI,this._next=null,this._parent=d,this.__data__=v}gK.prototype={constructor:gK,appendChild:function(d){return this._parent.insertBefore(d,this._next)},insertBefore:function(d,v){return this._parent.insertBefore(d,v)},querySelector:function(d){return this._parent.querySelector(d)},querySelectorAll:function(d){return this._parent.querySelectorAll(d)}};function _Bn(d){return function(){return d}}function FBn(d,v,E,A,M,P){for(var m=0,L,H=v.length,U=P.length;m<U;++m)(L=v[m])?(L.__data__=P[m],A[m]=L):E[m]=new gK(d,P[m]);for(;m<H;++m)(L=v[m])&&(M[m]=L)}function RBn(d,v,E,A,M,P,m){var L,H,U=new Map,Q=v.length,Y=P.length,G=new Array(Q),V;for(L=0;L<Q;++L)(H=v[L])&&(G[L]=V=m.call(H,H.__data__,L,v)+"",U.has(V)?M[L]=H:U.set(V,H));for(L=0;L<Y;++L)V=m.call(d,P[L],L,P)+"",(H=U.get(V))?(A[L]=H,H.__data__=P[L],U.delete(V)):E[L]=new gK(d,P[L]);for(L=0;L<Q;++L)(H=v[L])&&U.get(G[L])===H&&(M[L]=H)}function BBn(d){return d.__data__}function JBn(d,v){if(!arguments.length)return Array.from(this,BBn);var E=v?RBn:FBn,A=this._parents,M=this._groups;typeof d!="function"&&(d=_Bn(d));for(var P=M.length,m=new Array(P),L=new Array(P),H=new Array(P),U=0;U<P;++U){var Q=A[U],Y=M[U],G=Y.length,V=GBn(d.call(Q,Q&&Q.__data__,U,A)),te=V.length,X=L[U]=new Array(te),Ee=m[U]=new Array(te),ue=H[U]=new Array(G);E(Q,Y,X,Ee,ue,V,v);for(var ge=0,re=0,je,Ke;ge<te;++ge)if(je=X[ge]){for(ge>=re&&(re=ge+1);!(Ke=Ee[re])&&++re<te;);je._next=Ke||null}}return m=new F0(m,A),m._enter=L,m._exit=H,m}function GBn(d){return typeof d=="object"&&"length"in d?d:Array.from(d)}function HBn(){return new F0(this._exit||this._groups.map(n1n),this._parents)}function qBn(d,v,E){var A=this.enter(),M=this,P=this.exit();return typeof d=="function"?(A=d(A),A&&(A=A.selection())):A=A.append(d+""),v!=null&&(M=v(M),M&&(M=M.selection())),E==null?P.remove():E(P),A&&M?A.merge(M).order():M}function zBn(d){for(var v=d.selection?d.selection():d,E=this._groups,A=v._groups,M=E.length,P=A.length,m=Math.min(M,P),L=new Array(M),H=0;H<m;++H)for(var U=E[H],Q=A[H],Y=U.length,G=L[H]=new Array(Y),V,te=0;te<Y;++te)(V=U[te]||Q[te])&&(G[te]=V);for(;H<M;++H)L[H]=E[H];return new F0(L,this._parents)}function UBn(){for(var d=this._groups,v=-1,E=d.length;++v<E;)for(var A=d[v],M=A.length-1,P=A[M],m;--M>=0;)(m=A[M])&&(P&&m.compareDocumentPosition(P)^4&&P.parentNode.insertBefore(m,P),P=m);return this}function XBn(d){d||(d=KBn);function v(Y,G){return Y&&G?d(Y.__data__,G.__data__):!Y-!G}for(var E=this._groups,A=E.length,M=new Array(A),P=0;P<A;++P){for(var m=E[P],L=m.length,H=M[P]=new Array(L),U,Q=0;Q<L;++Q)(U=m[Q])&&(H[Q]=U);H.sort(v)}return new F0(M,this._parents).order()}function KBn(d,v){return d<v?-1:d>v?1:d>=v?0:NaN}function WBn(){var d=arguments[0];return arguments[0]=this,d.apply(null,arguments),this}function VBn(){return Array.from(this)}function QBn(){for(var d=this._groups,v=0,E=d.length;v<E;++v)for(var A=d[v],M=0,P=A.length;M<P;++M){var m=A[M];if(m)return m}return null}function YBn(){let d=0;for(const v of this)++d;return d}function ZBn(){return!this.node()}function eJn(d){for(var v=this._groups,E=0,A=v.length;E<A;++E)for(var M=v[E],P=0,m=M.length,L;P<m;++P)(L=M[P])&&d.call(L,L.__data__,P,M);return this}function nJn(d){return function(){this.removeAttribute(d)}}function tJn(d){return function(){this.removeAttributeNS(d.space,d.local)}}function iJn(d,v){return function(){this.setAttribute(d,v)}}function rJn(d,v){return function(){this.setAttributeNS(d.space,d.local,v)}}function cJn(d,v){return function(){var E=v.apply(this,arguments);E==null?this.removeAttribute(d):this.setAttribute(d,E)}}function uJn(d,v){return function(){var E=v.apply(this,arguments);E==null?this.removeAttributeNS(d.space,d.local):this.setAttributeNS(d.space,d.local,E)}}function oJn(d,v){var E=TK(d);if(arguments.length<2){var A=this.node();return E.local?A.getAttributeNS(E.space,E.local):A.getAttribute(E)}return this.each((v==null?E.local?tJn:nJn:typeof v=="function"?E.local?uJn:cJn:E.local?rJn:iJn)(E,v))}function t1n(d){return d.ownerDocument&&d.ownerDocument.defaultView||d.document&&d||d.defaultView}function sJn(d){return function(){this.style.removeProperty(d)}}function fJn(d,v,E){return function(){this.style.setProperty(d,v,E)}}function lJn(d,v,E){return function(){var A=v.apply(this,arguments);A==null?this.style.removeProperty(d):this.style.setProperty(d,A,E)}}function hJn(d,v,E){return arguments.length>1?this.each((v==null?sJn:typeof v=="function"?lJn:fJn)(d,v,E??"")):Gx(this.node(),d)}function Gx(d,v){return d.style.getPropertyValue(v)||t1n(d).getComputedStyle(d,null).getPropertyValue(v)}function aJn(d){return function(){delete this[d]}}function dJn(d,v){return function(){this[d]=v}}function bJn(d,v){return function(){var E=v.apply(this,arguments);E==null?delete this[d]:this[d]=E}}function wJn(d,v){return arguments.length>1?this.each((v==null?aJn:typeof v=="function"?bJn:dJn)(d,v)):this.node()[d]}function i1n(d){return d.trim().split(/^|\s+/)}function S2e(d){return d.classList||new r1n(d)}function r1n(d){this._node=d,this._names=i1n(d.getAttribute("class")||"")}r1n.prototype={add:function(d){var v=this._names.indexOf(d);v<0&&(this._names.push(d),this._node.setAttribute("class",this._names.join(" ")))},remove:function(d){var v=this._names.indexOf(d);v>=0&&(this._names.splice(v,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(d){return this._names.indexOf(d)>=0}};function c1n(d,v){for(var E=S2e(d),A=-1,M=v.length;++A<M;)E.add(v[A])}function u1n(d,v){for(var E=S2e(d),A=-1,M=v.length;++A<M;)E.remove(v[A])}function gJn(d){return function(){c1n(this,d)}}function pJn(d){return function(){u1n(this,d)}}function mJn(d,v){return function(){(v.apply(this,arguments)?c1n:u1n)(this,d)}}function vJn(d,v){var E=i1n(d+"");if(arguments.length<2){for(var A=S2e(this.node()),M=-1,P=E.length;++M<P;)if(!A.contains(E[M]))return!1;return!0}return this.each((typeof v=="function"?mJn:v?gJn:pJn)(E,v))}function yJn(){this.textContent=""}function kJn(d){return function(){this.textContent=d}}function EJn(d){return function(){var v=d.apply(this,arguments);this.textContent=v??""}}function jJn(d){return arguments.length?this.each(d==null?yJn:(typeof d=="function"?EJn:kJn)(d)):this.node().textContent}function xJn(){this.innerHTML=""}function AJn(d){return function(){this.innerHTML=d}}function MJn(d){return function(){var v=d.apply(this,arguments);this.innerHTML=v??""}}function CJn(d){return arguments.length?this.each(d==null?xJn:(typeof d=="function"?MJn:AJn)(d)):this.node().innerHTML}function TJn(){this.nextSibling&&this.parentNode.appendChild(this)}function SJn(){return this.each(TJn)}function IJn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function PJn(){return this.each(IJn)}function OJn(d){var v=typeof d=="function"?d:Qan(d);return this.select(function(){return this.appendChild(v.apply(this,arguments))})}function NJn(){return null}function $Jn(d,v){var E=typeof d=="function"?d:Qan(d),A=v==null?NJn:typeof v=="function"?v:T2e(v);return this.select(function(){return this.insertBefore(E.apply(this,arguments),A.apply(this,arguments)||null)})}function DJn(){var d=this.parentNode;d&&d.removeChild(this)}function LJn(){return this.each(DJn)}function _Jn(){var d=this.cloneNode(!1),v=this.parentNode;return v?v.insertBefore(d,this.nextSibling):d}function FJn(){var d=this.cloneNode(!0),v=this.parentNode;return v?v.insertBefore(d,this.nextSibling):d}function RJn(d){return this.select(d?FJn:_Jn)}function BJn(d){return arguments.length?this.property("__data__",d):this.node().__data__}function JJn(d){return function(v){d.call(this,v,this.__data__)}}function GJn(d){return d.trim().split(/^|\s+/).map(function(v){var E="",A=v.indexOf(".");return A>=0&&(E=v.slice(A+1),v=v.slice(0,A)),{type:v,name:E}})}function HJn(d){return function(){var v=this.__on;if(v){for(var E=0,A=-1,M=v.length,P;E<M;++E)P=v[E],(!d.type||P.type===d.type)&&P.name===d.name?this.removeEventListener(P.type,P.listener,P.options):v[++A]=P;++A?v.length=A:delete this.__on}}}function qJn(d,v,E){return function(){var A=this.__on,M,P=JJn(v);if(A){for(var m=0,L=A.length;m<L;++m)if((M=A[m]).type===d.type&&M.name===d.name){this.removeEventListener(M.type,M.listener,M.options),this.addEventListener(M.type,M.listener=P,M.options=E),M.value=v;return}}this.addEventListener(d.type,P,E),M={type:d.type,name:d.name,value:v,listener:P,options:E},A?A.push(M):this.__on=[M]}}function zJn(d,v,E){var A=GJn(d+""),M,P=A.length,m;if(arguments.length<2){var L=this.node().__on;if(L){for(var H=0,U=L.length,Q;H<U;++H)for(M=0,Q=L[H];M<P;++M)if((m=A[M]).type===Q.type&&m.name===Q.name)return Q.value}return}for(L=v?qJn:HJn,M=0;M<P;++M)this.each(L(A[M],v,E));return this}function o1n(d,v,E){var A=t1n(d),M=A.CustomEvent;typeof M=="function"?M=new M(v,E):(M=A.document.createEvent("Event"),E?(M.initEvent(v,E.bubbles,E.cancelable),M.detail=E.detail):M.initEvent(v,!1,!1)),d.dispatchEvent(M)}function UJn(d,v){return function(){return o1n(this,d,v)}}function XJn(d,v){return function(){return o1n(this,d,v.apply(this,arguments))}}function KJn(d,v){return this.each((typeof v=="function"?XJn:UJn)(d,v))}function*WJn(){for(var d=this._groups,v=0,E=d.length;v<E;++v)for(var A=d[v],M=0,P=A.length,m;M<P;++M)(m=A[M])&&(yield m)}var s1n=[null];function F0(d,v){this._groups=d,this._parents=v}function _N(){return new F0([[document.documentElement]],s1n)}function VJn(){return this}F0.prototype=_N.prototype={constructor:F0,select:EBn,selectAll:MBn,selectChild:IBn,selectChildren:$Bn,filter:DBn,data:JBn,enter:LBn,exit:HBn,join:qBn,merge:zBn,selection:VJn,order:UBn,sort:XBn,call:WBn,nodes:VBn,node:QBn,size:YBn,empty:ZBn,each:eJn,attr:oJn,style:hJn,property:wJn,classed:vJn,text:jJn,html:CJn,raise:SJn,lower:PJn,append:OJn,insert:$Jn,remove:LJn,clone:RJn,datum:BJn,on:zJn,dispatch:KJn,[Symbol.iterator]:WJn};function _0(d){return typeof d=="string"?new F0([[document.querySelector(d)]],[document.documentElement]):new F0([[d]],s1n)}function QJn(d){let v;for(;v=d.sourceEvent;)d=v;return d}function e2(d,v){if(d=QJn(d),v===void 0&&(v=d.currentTarget),v){var E=v.ownerSVGElement||v;if(E.createSVGPoint){var A=E.createSVGPoint();return A.x=d.clientX,A.y=d.clientY,A=A.matrixTransform(v.getScreenCTM().inverse()),[A.x,A.y]}if(v.getBoundingClientRect){var M=v.getBoundingClientRect();return[d.clientX-M.left-v.clientLeft,d.clientY-M.top-v.clientTop]}}return[d.pageX,d.pageY]}const YJn={passive:!1},CN={capture:!0,passive:!1};function n2e(d){d.stopImmediatePropagation()}function Bx(d){d.preventDefault(),d.stopImmediatePropagation()}function f1n(d){var v=d.document.documentElement,E=_0(d).on("dragstart.drag",Bx,CN);"onselectstart"in v?E.on("selectstart.drag",Bx,CN):(v.__noselect=v.style.MozUserSelect,v.style.MozUserSelect="none")}function l1n(d,v){var E=d.document.documentElement,A=_0(d).on("dragstart.drag",null);v&&(A.on("click.drag",Bx,CN),setTimeout(function(){A.on("click.drag",null)},0)),"onselectstart"in E?A.on("selectstart.drag",null):(E.style.MozUserSelect=E.__noselect,delete E.__noselect)}const QX=d=>()=>d;function a2e(d,{sourceEvent:v,subject:E,target:A,identifier:M,active:P,x:m,y:L,dx:H,dy:U,dispatch:Q}){Object.defineProperties(this,{type:{value:d,enumerable:!0,configurable:!0},sourceEvent:{value:v,enumerable:!0,configurable:!0},subject:{value:E,enumerable:!0,configurable:!0},target:{value:A,enumerable:!0,configurable:!0},identifier:{value:M,enumerable:!0,configurable:!0},active:{value:P,enumerable:!0,configurable:!0},x:{value:m,enumerable:!0,configurable:!0},y:{value:L,enumerable:!0,configurable:!0},dx:{value:H,enumerable:!0,configurable:!0},dy:{value:U,enumerable:!0,configurable:!0},_:{value:Q}})}a2e.prototype.on=function(){var d=this._.on.apply(this._,arguments);return d===this._?this:d};function ZJn(d){return!d.ctrlKey&&!d.button}function eGn(){return this.parentNode}function nGn(d,v){return v??{x:d.x,y:d.y}}function tGn(){return navigator.maxTouchPoints||"ontouchstart"in this}function h1n(){var d=ZJn,v=eGn,E=nGn,A=tGn,M={},P=CK("start","drag","end"),m=0,L,H,U,Q,Y=0;function G(je){je.on("mousedown.drag",V).filter(A).on("touchstart.drag",Ee).on("touchmove.drag",ue,YJn).on("touchend.drag touchcancel.drag",ge).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function V(je,Ke){if(!(Q||!d.call(this,je,Ke))){var Xe=re(this,v.call(this,je,Ke),je,Ke,"mouse");Xe&&(_0(je.view).on("mousemove.drag",te,CN).on("mouseup.drag",X,CN),f1n(je.view),n2e(je),U=!1,L=je.clientX,H=je.clientY,Xe("start",je))}}function te(je){if(Bx(je),!U){var Ke=je.clientX-L,Xe=je.clientY-H;U=Ke*Ke+Xe*Xe>Y}M.mouse("drag",je)}function X(je){_0(je.view).on("mousemove.drag mouseup.drag",null),l1n(je.view,U),Bx(je),M.mouse("end",je)}function Ee(je,Ke){if(d.call(this,je,Ke)){var Xe=je.changedTouches,Ye=v.call(this,je,Ke),kn=Xe.length,En,Zn;for(En=0;En<kn;++En)(Zn=re(this,Ye,je,Ke,Xe[En].identifier,Xe[En]))&&(n2e(je),Zn("start",je,Xe[En]))}}function ue(je){var Ke=je.changedTouches,Xe=Ke.length,Ye,kn;for(Ye=0;Ye<Xe;++Ye)(kn=M[Ke[Ye].identifier])&&(Bx(je),kn("drag",je,Ke[Ye]))}function ge(je){var Ke=je.changedTouches,Xe=Ke.length,Ye,kn;for(Q&&clearTimeout(Q),Q=setTimeout(function(){Q=null},500),Ye=0;Ye<Xe;++Ye)(kn=M[Ke[Ye].identifier])&&(n2e(je),kn("end",je,Ke[Ye]))}function re(je,Ke,Xe,Ye,kn,En){var Zn=P.copy(),Ln=e2(En||Xe,Ke),Vn,J,xe;if((xe=E.call(je,new a2e("beforestart",{sourceEvent:Xe,target:G,identifier:kn,active:m,x:Ln[0],y:Ln[1],dx:0,dy:0,dispatch:Zn}),Ye))!=null)return Vn=xe.x-Ln[0]||0,J=xe.y-Ln[1]||0,function on(rn,Sn,Fn){var dn=Ln,Gn;switch(rn){case"start":M[kn]=on,Gn=m++;break;case"end":delete M[kn],--m;case"drag":Ln=e2(Fn||Sn,Ke),Gn=m;break}Zn.call(rn,je,new a2e(rn,{sourceEvent:Sn,subject:xe,target:G,identifier:kn,active:Gn,x:Ln[0]+Vn,y:Ln[1]+J,dx:Ln[0]-dn[0],dy:Ln[1]-dn[1],dispatch:Zn}),Ye)}}return G.filter=function(je){return arguments.length?(d=typeof je=="function"?je:QX(!!je),G):d},G.container=function(je){return arguments.length?(v=typeof je=="function"?je:QX(je),G):v},G.subject=function(je){return arguments.length?(E=typeof je=="function"?je:QX(je),G):E},G.touchable=function(je){return arguments.length?(A=typeof je=="function"?je:QX(!!je),G):A},G.on=function(){var je=P.on.apply(P,arguments);return je===P?G:je},G.clickDistance=function(je){return arguments.length?(Y=(je=+je)*je,G):Math.sqrt(Y)},G}function I2e(d,v,E){d.prototype=v.prototype=E,E.constructor=d}function a1n(d,v){var E=Object.create(d.prototype);for(var A in v)E[A]=v[A];return E}function FN(){}var TN=.7,pK=1/TN,Jx="\\s*([+-]?\\d+)\\s*",SN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iGn=/^#([0-9a-f]{3,8})$/,rGn=new RegExp(`^rgb\\(${Jx},${Jx},${Jx}\\)$`),cGn=new RegExp(`^rgb\\(${qp},${qp},${qp}\\)$`),uGn=new RegExp(`^rgba\\(${Jx},${Jx},${Jx},${SN}\\)$`),oGn=new RegExp(`^rgba\\(${qp},${qp},${qp},${SN}\\)$`),sGn=new RegExp(`^hsl\\(${SN},${qp},${qp}\\)$`),fGn=new RegExp(`^hsla\\(${SN},${qp},${qp},${SN}\\)$`),Ghn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};I2e(FN,fk,{copy(d){return Object.assign(new this.constructor,this,d)},displayable(){return this.rgb().displayable()},hex:Hhn,formatHex:Hhn,formatHex8:lGn,formatHsl:hGn,formatRgb:qhn,toString:qhn});function Hhn(){return this.rgb().formatHex()}function lGn(){return this.rgb().formatHex8()}function hGn(){return d1n(this).formatHsl()}function qhn(){return this.rgb().formatRgb()}function fk(d){var v,E;return d=(d+"").trim().toLowerCase(),(v=iGn.exec(d))?(E=v[1].length,v=parseInt(v[1],16),E===6?zhn(v):E===3?new Ad(v>>8&15|v>>4&240,v>>4&15|v&240,(v&15)<<4|v&15,1):E===8?YX(v>>24&255,v>>16&255,v>>8&255,(v&255)/255):E===4?YX(v>>12&15|v>>8&240,v>>8&15|v>>4&240,v>>4&15|v&240,((v&15)<<4|v&15)/255):null):(v=rGn.exec(d))?new Ad(v[1],v[2],v[3],1):(v=cGn.exec(d))?new Ad(v[1]*255/100,v[2]*255/100,v[3]*255/100,1):(v=uGn.exec(d))?YX(v[1],v[2],v[3],v[4]):(v=oGn.exec(d))?YX(v[1]*255/100,v[2]*255/100,v[3]*255/100,v[4]):(v=sGn.exec(d))?Khn(v[1],v[2]/100,v[3]/100,1):(v=fGn.exec(d))?Khn(v[1],v[2]/100,v[3]/100,v[4]):Ghn.hasOwnProperty(d)?zhn(Ghn[d]):d==="transparent"?new Ad(NaN,NaN,NaN,0):null}function zhn(d){return new Ad(d>>16&255,d>>8&255,d&255,1)}function YX(d,v,E,A){return A<=0&&(d=v=E=NaN),new Ad(d,v,E,A)}function aGn(d){return d instanceof FN||(d=fk(d)),d?(d=d.rgb(),new Ad(d.r,d.g,d.b,d.opacity)):new Ad}function d2e(d,v,E,A){return arguments.length===1?aGn(d):new Ad(d,v,E,A??1)}function Ad(d,v,E,A){this.r=+d,this.g=+v,this.b=+E,this.opacity=+A}I2e(Ad,d2e,a1n(FN,{brighter(d){return d=d==null?pK:Math.pow(pK,d),new Ad(this.r*d,this.g*d,this.b*d,this.opacity)},darker(d){return d=d==null?TN:Math.pow(TN,d),new Ad(this.r*d,this.g*d,this.b*d,this.opacity)},rgb(){return this},clamp(){return new Ad(ok(this.r),ok(this.g),ok(this.b),mK(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Uhn,formatHex:Uhn,formatHex8:dGn,formatRgb:Xhn,toString:Xhn}));function Uhn(){return`#${uk(this.r)}${uk(this.g)}${uk(this.b)}`}function dGn(){return`#${uk(this.r)}${uk(this.g)}${uk(this.b)}${uk((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xhn(){const d=mK(this.opacity);return`${d===1?"rgb(":"rgba("}${ok(this.r)}, ${ok(this.g)}, ${ok(this.b)}${d===1?")":`, ${d})`}`}function mK(d){return isNaN(d)?1:Math.max(0,Math.min(1,d))}function ok(d){return Math.max(0,Math.min(255,Math.round(d)||0))}function uk(d){return d=ok(d),(d<16?"0":"")+d.toString(16)}function Khn(d,v,E,A){return A<=0?d=v=E=NaN:E<=0||E>=1?d=v=NaN:v<=0&&(d=NaN),new n2(d,v,E,A)}function d1n(d){if(d instanceof n2)return new n2(d.h,d.s,d.l,d.opacity);if(d instanceof FN||(d=fk(d)),!d)return new n2;if(d instanceof n2)return d;d=d.rgb();var v=d.r/255,E=d.g/255,A=d.b/255,M=Math.min(v,E,A),P=Math.max(v,E,A),m=NaN,L=P-M,H=(P+M)/2;return L?(v===P?m=(E-A)/L+(E<A)*6:E===P?m=(A-v)/L+2:m=(v-E)/L+4,L/=H<.5?P+M:2-P-M,m*=60):L=H>0&&H<1?0:m,new n2(m,L,H,d.opacity)}function bGn(d,v,E,A){return arguments.length===1?d1n(d):new n2(d,v,E,A??1)}function n2(d,v,E,A){this.h=+d,this.s=+v,this.l=+E,this.opacity=+A}I2e(n2,bGn,a1n(FN,{brighter(d){return d=d==null?pK:Math.pow(pK,d),new n2(this.h,this.s,this.l*d,this.opacity)},darker(d){return d=d==null?TN:Math.pow(TN,d),new n2(this.h,this.s,this.l*d,this.opacity)},rgb(){var d=this.h%360+(this.h<0)*360,v=isNaN(d)||isNaN(this.s)?0:this.s,E=this.l,A=E+(E<.5?E:1-E)*v,M=2*E-A;return new Ad(t2e(d>=240?d-240:d+120,M,A),t2e(d,M,A),t2e(d<120?d+240:d-120,M,A),this.opacity)},clamp(){return new n2(Whn(this.h),ZX(this.s),ZX(this.l),mK(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const d=mK(this.opacity);return`${d===1?"hsl(":"hsla("}${Whn(this.h)}, ${ZX(this.s)*100}%, ${ZX(this.l)*100}%${d===1?")":`, ${d})`}`}}));function Whn(d){return d=(d||0)%360,d<0?d+360:d}function ZX(d){return Math.max(0,Math.min(1,d||0))}function t2e(d,v,E){return(d<60?v+(E-v)*d/60:d<180?E:d<240?v+(E-v)*(240-d)/60:v)*255}const P2e=d=>()=>d;function wGn(d,v){return function(E){return d+E*v}}function gGn(d,v,E){return d=Math.pow(d,E),v=Math.pow(v,E)-d,E=1/E,function(A){return Math.pow(d+A*v,E)}}function pGn(d){return(d=+d)==1?b1n:function(v,E){return E-v?gGn(v,E,d):P2e(isNaN(v)?E:v)}}function b1n(d,v){var E=v-d;return E?wGn(d,E):P2e(isNaN(d)?v:d)}const vK=(function d(v){var E=pGn(v);function A(M,P){var m=E((M=d2e(M)).r,(P=d2e(P)).r),L=E(M.g,P.g),H=E(M.b,P.b),U=b1n(M.opacity,P.opacity);return function(Q){return M.r=m(Q),M.g=L(Q),M.b=H(Q),M.opacity=U(Q),M+""}}return A.gamma=d,A})(1);function mGn(d,v){v||(v=[]);var E=d?Math.min(v.length,d.length):0,A=v.slice(),M;return function(P){for(M=0;M<E;++M)A[M]=d[M]*(1-P)+v[M]*P;return A}}function vGn(d){return ArrayBuffer.isView(d)&&!(d instanceof DataView)}function yGn(d,v){var E=v?v.length:0,A=d?Math.min(E,d.length):0,M=new Array(A),P=new Array(E),m;for(m=0;m<A;++m)M[m]=xN(d[m],v[m]);for(;m<E;++m)P[m]=v[m];return function(L){for(m=0;m<A;++m)P[m]=M[m](L);return P}}function kGn(d,v){var E=new Date;return d=+d,v=+v,function(A){return E.setTime(d*(1-A)+v*A),E}}function Hp(d,v){return d=+d,v=+v,function(E){return d*(1-E)+v*E}}function EGn(d,v){var E={},A={},M;(d===null||typeof d!="object")&&(d={}),(v===null||typeof v!="object")&&(v={});for(M in v)M in d?E[M]=xN(d[M],v[M]):A[M]=v[M];return function(P){for(M in E)A[M]=E[M](P);return A}}var b2e=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,i2e=new RegExp(b2e.source,"g");function jGn(d){return function(){return d}}function xGn(d){return function(v){return d(v)+""}}function w1n(d,v){var E=b2e.lastIndex=i2e.lastIndex=0,A,M,P,m=-1,L=[],H=[];for(d=d+"",v=v+"";(A=b2e.exec(d))&&(M=i2e.exec(v));)(P=M.index)>E&&(P=v.slice(E,P),L[m]?L[m]+=P:L[++m]=P),(A=A[0])===(M=M[0])?L[m]?L[m]+=M:L[++m]=M:(L[++m]=null,H.push({i:m,x:Hp(A,M)})),E=i2e.lastIndex;return E<v.length&&(P=v.slice(E),L[m]?L[m]+=P:L[++m]=P),L.length<2?H[0]?xGn(H[0].x):jGn(v):(v=H.length,function(U){for(var Q=0,Y;Q<v;++Q)L[(Y=H[Q]).i]=Y.x(U);return L.join("")})}function xN(d,v){var E=typeof v,A;return v==null||E==="boolean"?P2e(v):(E==="number"?Hp:E==="string"?(A=fk(v))?(v=A,vK):w1n:v instanceof fk?vK:v instanceof Date?kGn:vGn(v)?mGn:Array.isArray(v)?yGn:typeof v.valueOf!="function"&&typeof v.toString!="function"||isNaN(v)?EGn:Hp)(d,v)}var Vhn=180/Math.PI,w2e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function g1n(d,v,E,A,M,P){var m,L,H;return(m=Math.sqrt(d*d+v*v))&&(d/=m,v/=m),(H=d*E+v*A)&&(E-=d*H,A-=v*H),(L=Math.sqrt(E*E+A*A))&&(E/=L,A/=L,H/=L),d*A<v*E&&(d=-d,v=-v,H=-H,m=-m),{translateX:M,translateY:P,rotate:Math.atan2(v,d)*Vhn,skewX:Math.atan(H)*Vhn,scaleX:m,scaleY:L}}var eK;function AGn(d){const v=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(d+"");return v.isIdentity?w2e:g1n(v.a,v.b,v.c,v.d,v.e,v.f)}function MGn(d){return d==null||(eK||(eK=document.createElementNS("http://www.w3.org/2000/svg","g")),eK.setAttribute("transform",d),!(d=eK.transform.baseVal.consolidate()))?w2e:(d=d.matrix,g1n(d.a,d.b,d.c,d.d,d.e,d.f))}function p1n(d,v,E,A){function M(U){return U.length?U.pop()+" ":""}function P(U,Q,Y,G,V,te){if(U!==Y||Q!==G){var X=V.push("translate(",null,v,null,E);te.push({i:X-4,x:Hp(U,Y)},{i:X-2,x:Hp(Q,G)})}else(Y||G)&&V.push("translate("+Y+v+G+E)}function m(U,Q,Y,G){U!==Q?(U-Q>180?Q+=360:Q-U>180&&(U+=360),G.push({i:Y.push(M(Y)+"rotate(",null,A)-2,x:Hp(U,Q)})):Q&&Y.push(M(Y)+"rotate("+Q+A)}function L(U,Q,Y,G){U!==Q?G.push({i:Y.push(M(Y)+"skewX(",null,A)-2,x:Hp(U,Q)}):Q&&Y.push(M(Y)+"skewX("+Q+A)}function H(U,Q,Y,G,V,te){if(U!==Y||Q!==G){var X=V.push(M(V)+"scale(",null,",",null,")");te.push({i:X-4,x:Hp(U,Y)},{i:X-2,x:Hp(Q,G)})}else(Y!==1||G!==1)&&V.push(M(V)+"scale("+Y+","+G+")")}return function(U,Q){var Y=[],G=[];return U=d(U),Q=d(Q),P(U.translateX,U.translateY,Q.translateX,Q.translateY,Y,G),m(U.rotate,Q.rotate,Y,G),L(U.skewX,Q.skewX,Y,G),H(U.scaleX,U.scaleY,Q.scaleX,Q.scaleY,Y,G),U=Q=null,function(V){for(var te=-1,X=G.length,Ee;++te<X;)Y[(Ee=G[te]).i]=Ee.x(V);return Y.join("")}}}var CGn=p1n(AGn,"px, ","px)","deg)"),TGn=p1n(MGn,", ",")",")"),SGn=1e-12;function Qhn(d){return((d=Math.exp(d))+1/d)/2}function IGn(d){return((d=Math.exp(d))-1/d)/2}function PGn(d){return((d=Math.exp(2*d))-1)/(d+1)}const fK=(function d(v,E,A){function M(P,m){var L=P[0],H=P[1],U=P[2],Q=m[0],Y=m[1],G=m[2],V=Q-L,te=Y-H,X=V*V+te*te,Ee,ue;if(X<SGn)ue=Math.log(G/U)/v,Ee=function(Ye){return[L+Ye*V,H+Ye*te,U*Math.exp(v*Ye*ue)]};else{var ge=Math.sqrt(X),re=(G*G-U*U+A*X)/(2*U*E*ge),je=(G*G-U*U-A*X)/(2*G*E*ge),Ke=Math.log(Math.sqrt(re*re+1)-re),Xe=Math.log(Math.sqrt(je*je+1)-je);ue=(Xe-Ke)/v,Ee=function(Ye){var kn=Ye*ue,En=Qhn(Ke),Zn=U/(E*ge)*(En*PGn(v*kn+Ke)-IGn(Ke));return[L+Zn*V,H+Zn*te,U*En/Qhn(v*kn+Ke)]}}return Ee.duration=ue*1e3*v/Math.SQRT2,Ee}return M.rho=function(P){var m=Math.max(.001,+P),L=m*m,H=L*L;return d(m,L,H)},M})(Math.SQRT2,2,4);var Hx=0,kN=0,vN=0,m1n=1e3,yK,EN,kK=0,lk=0,SK=0,IN=typeof performance=="object"&&performance.now?performance:Date,v1n=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(d){setTimeout(d,17)};function O2e(){return lk||(v1n(OGn),lk=IN.now()+SK)}function OGn(){lk=0}function EK(){this._call=this._time=this._next=null}EK.prototype=y1n.prototype={constructor:EK,restart:function(d,v,E){if(typeof d!="function")throw new TypeError("callback is not a function");E=(E==null?O2e():+E)+(v==null?0:+v),!this._next&&EN!==this&&(EN?EN._next=this:yK=this,EN=this),this._call=d,this._time=E,g2e()},stop:function(){this._call&&(this._call=null,this._time=1/0,g2e())}};function y1n(d,v,E){var A=new EK;return A.restart(d,v,E),A}function NGn(){O2e(),++Hx;for(var d=yK,v;d;)(v=lk-d._time)>=0&&d._call.call(void 0,v),d=d._next;--Hx}function Yhn(){lk=(kK=IN.now())+SK,Hx=kN=0;try{NGn()}finally{Hx=0,DGn(),lk=0}}function $Gn(){var d=IN.now(),v=d-kK;v>m1n&&(SK-=v,kK=d)}function DGn(){for(var d,v=yK,E,A=1/0;v;)v._call?(A>v._time&&(A=v._time),d=v,v=v._next):(E=v._next,v._next=null,v=d?d._next=E:yK=E);EN=d,g2e(A)}function g2e(d){if(!Hx){kN&&(kN=clearTimeout(kN));var v=d-lk;v>24?(d<1/0&&(kN=setTimeout(Yhn,d-IN.now()-SK)),vN&&(vN=clearInterval(vN))):(vN||(kK=IN.now(),vN=setInterval($Gn,m1n)),Hx=1,v1n(Yhn))}}function Zhn(d,v,E){var A=new EK;return v=v==null?0:+v,A.restart(M=>{A.stop(),d(M+v)},v,E),A}var LGn=CK("start","end","cancel","interrupt"),_Gn=[],k1n=0,ean=1,p2e=2,lK=3,nan=4,m2e=5,hK=6;function IK(d,v,E,A,M,P){var m=d.__transition;if(!m)d.__transition={};else if(E in m)return;FGn(d,E,{name:v,index:A,group:M,on:LGn,tween:_Gn,time:P.time,delay:P.delay,duration:P.duration,ease:P.ease,timer:null,state:k1n})}function N2e(d,v){var E=u2(d,v);if(E.state>k1n)throw new Error("too late; already scheduled");return E}function zp(d,v){var E=u2(d,v);if(E.state>lK)throw new Error("too late; already running");return E}function u2(d,v){var E=d.__transition;if(!E||!(E=E[v]))throw new Error("transition not found");return E}function FGn(d,v,E){var A=d.__transition,M;A[v]=E,E.timer=y1n(P,0,E.time);function P(U){E.state=ean,E.timer.restart(m,E.delay,E.time),E.delay<=U&&m(U-E.delay)}function m(U){var Q,Y,G,V;if(E.state!==ean)return H();for(Q in A)if(V=A[Q],V.name===E.name){if(V.state===lK)return Zhn(m);V.state===nan?(V.state=hK,V.timer.stop(),V.on.call("interrupt",d,d.__data__,V.index,V.group),delete A[Q]):+Q<v&&(V.state=hK,V.timer.stop(),V.on.call("cancel",d,d.__data__,V.index,V.group),delete A[Q])}if(Zhn(function(){E.state===lK&&(E.state=nan,E.timer.restart(L,E.delay,E.time),L(U))}),E.state=p2e,E.on.call("start",d,d.__data__,E.index,E.group),E.state===p2e){for(E.state=lK,M=new Array(G=E.tween.length),Q=0,Y=-1;Q<G;++Q)(V=E.tween[Q].value.call(d,d.__data__,E.index,E.group))&&(M[++Y]=V);M.length=Y+1}}function L(U){for(var Q=U<E.duration?E.ease.call(null,U/E.duration):(E.timer.restart(H),E.state=m2e,1),Y=-1,G=M.length;++Y<G;)M[Y].call(d,Q);E.state===m2e&&(E.on.call("end",d,d.__data__,E.index,E.group),H())}function H(){E.state=hK,E.timer.stop(),delete A[v];for(var U in A)return;delete d.__transition}}function aK(d,v){var E=d.__transition,A,M,P=!0,m;if(E){v=v==null?null:v+"";for(m in E){if((A=E[m]).name!==v){P=!1;continue}M=A.state>p2e&&A.state<m2e,A.state=hK,A.timer.stop(),A.on.call(M?"interrupt":"cancel",d,d.__data__,A.index,A.group),delete E[m]}P&&delete d.__transition}}function RGn(d){return this.each(function(){aK(this,d)})}function BGn(d,v){var E,A;return function(){var M=zp(this,d),P=M.tween;if(P!==E){A=E=P;for(var m=0,L=A.length;m<L;++m)if(A[m].name===v){A=A.slice(),A.splice(m,1);break}}M.tween=A}}function JGn(d,v,E){var A,M;if(typeof E!="function")throw new Error;return function(){var P=zp(this,d),m=P.tween;if(m!==A){M=(A=m).slice();for(var L={name:v,value:E},H=0,U=M.length;H<U;++H)if(M[H].name===v){M[H]=L;break}H===U&&M.push(L)}P.tween=M}}function GGn(d,v){var E=this._id;if(d+="",arguments.length<2){for(var A=u2(this.node(),E).tween,M=0,P=A.length,m;M<P;++M)if((m=A[M]).name===d)return m.value;return null}return this.each((v==null?BGn:JGn)(E,d,v))}function $2e(d,v,E){var A=d._id;return d.each(function(){var M=zp(this,A);(M.value||(M.value={}))[v]=E.apply(this,arguments)}),function(M){return u2(M,A).value[v]}}function E1n(d,v){var E;return(typeof v=="number"?Hp:v instanceof fk?vK:(E=fk(v))?(v=E,vK):w1n)(d,v)}function HGn(d){return function(){this.removeAttribute(d)}}function qGn(d){return function(){this.removeAttributeNS(d.space,d.local)}}function zGn(d,v,E){var A,M=E+"",P;return function(){var m=this.getAttribute(d);return m===M?null:m===A?P:P=v(A=m,E)}}function UGn(d,v,E){var A,M=E+"",P;return function(){var m=this.getAttributeNS(d.space,d.local);return m===M?null:m===A?P:P=v(A=m,E)}}function XGn(d,v,E){var A,M,P;return function(){var m,L=E(this),H;return L==null?void this.removeAttribute(d):(m=this.getAttribute(d),H=L+"",m===H?null:m===A&&H===M?P:(M=H,P=v(A=m,L)))}}function KGn(d,v,E){var A,M,P;return function(){var m,L=E(this),H;return L==null?void this.removeAttributeNS(d.space,d.local):(m=this.getAttributeNS(d.space,d.local),H=L+"",m===H?null:m===A&&H===M?P:(M=H,P=v(A=m,L)))}}function WGn(d,v){var E=TK(d),A=E==="transform"?TGn:E1n;return this.attrTween(d,typeof v=="function"?(E.local?KGn:XGn)(E,A,$2e(this,"attr."+d,v)):v==null?(E.local?qGn:HGn)(E):(E.local?UGn:zGn)(E,A,v))}function VGn(d,v){return function(E){this.setAttribute(d,v.call(this,E))}}function QGn(d,v){return function(E){this.setAttributeNS(d.space,d.local,v.call(this,E))}}function YGn(d,v){var E,A;function M(){var P=v.apply(this,arguments);return P!==A&&(E=(A=P)&&QGn(d,P)),E}return M._value=v,M}function ZGn(d,v){var E,A;function M(){var P=v.apply(this,arguments);return P!==A&&(E=(A=P)&&VGn(d,P)),E}return M._value=v,M}function eHn(d,v){var E="attr."+d;if(arguments.length<2)return(E=this.tween(E))&&E._value;if(v==null)return this.tween(E,null);if(typeof v!="function")throw new Error;var A=TK(d);return this.tween(E,(A.local?YGn:ZGn)(A,v))}function nHn(d,v){return function(){N2e(this,d).delay=+v.apply(this,arguments)}}function tHn(d,v){return v=+v,function(){N2e(this,d).delay=v}}function iHn(d){var v=this._id;return arguments.length?this.each((typeof d=="function"?nHn:tHn)(v,d)):u2(this.node(),v).delay}function rHn(d,v){return function(){zp(this,d).duration=+v.apply(this,arguments)}}function cHn(d,v){return v=+v,function(){zp(this,d).duration=v}}function uHn(d){var v=this._id;return arguments.length?this.each((typeof d=="function"?rHn:cHn)(v,d)):u2(this.node(),v).duration}function oHn(d,v){if(typeof v!="function")throw new Error;return function(){zp(this,d).ease=v}}function sHn(d){var v=this._id;return arguments.length?this.each(oHn(v,d)):u2(this.node(),v).ease}function fHn(d,v){return function(){var E=v.apply(this,arguments);if(typeof E!="function")throw new Error;zp(this,d).ease=E}}function lHn(d){if(typeof d!="function")throw new Error;return this.each(fHn(this._id,d))}function hHn(d){typeof d!="function"&&(d=Zan(d));for(var v=this._groups,E=v.length,A=new Array(E),M=0;M<E;++M)for(var P=v[M],m=P.length,L=A[M]=[],H,U=0;U<m;++U)(H=P[U])&&d.call(H,H.__data__,U,P)&&L.push(H);return new Q3(A,this._parents,this._name,this._id)}function aHn(d){if(d._id!==this._id)throw new Error;for(var v=this._groups,E=d._groups,A=v.length,M=E.length,P=Math.min(A,M),m=new Array(A),L=0;L<P;++L)for(var H=v[L],U=E[L],Q=H.length,Y=m[L]=new Array(Q),G,V=0;V<Q;++V)(G=H[V]||U[V])&&(Y[V]=G);for(;L<A;++L)m[L]=v[L];return new Q3(m,this._parents,this._name,this._id)}function dHn(d){return(d+"").trim().split(/^|\s+/).every(function(v){var E=v.indexOf(".");return E>=0&&(v=v.slice(0,E)),!v||v==="start"})}function bHn(d,v,E){var A,M,P=dHn(v)?N2e:zp;return function(){var m=P(this,d),L=m.on;L!==A&&(M=(A=L).copy()).on(v,E),m.on=M}}function wHn(d,v){var E=this._id;return arguments.length<2?u2(this.node(),E).on.on(d):this.each(bHn(E,d,v))}function gHn(d){return function(){var v=this.parentNode;for(var E in this.__transition)if(+E!==d)return;v&&v.removeChild(this)}}function pHn(){return this.on("end.remove",gHn(this._id))}function mHn(d){var v=this._name,E=this._id;typeof d!="function"&&(d=T2e(d));for(var A=this._groups,M=A.length,P=new Array(M),m=0;m<M;++m)for(var L=A[m],H=L.length,U=P[m]=new Array(H),Q,Y,G=0;G<H;++G)(Q=L[G])&&(Y=d.call(Q,Q.__data__,G,L))&&("__data__"in Q&&(Y.__data__=Q.__data__),U[G]=Y,IK(U[G],v,E,G,U,u2(Q,E)));return new Q3(P,this._parents,v,E)}function vHn(d){var v=this._name,E=this._id;typeof d!="function"&&(d=Yan(d));for(var A=this._groups,M=A.length,P=[],m=[],L=0;L<M;++L)for(var H=A[L],U=H.length,Q,Y=0;Y<U;++Y)if(Q=H[Y]){for(var G=d.call(Q,Q.__data__,Y,H),V,te=u2(Q,E),X=0,Ee=G.length;X<Ee;++X)(V=G[X])&&IK(V,v,E,X,G,te);P.push(G),m.push(Q)}return new Q3(P,m,v,E)}var yHn=_N.prototype.constructor;function kHn(){return new yHn(this._groups,this._parents)}function EHn(d,v){var E,A,M;return function(){var P=Gx(this,d),m=(this.style.removeProperty(d),Gx(this,d));return P===m?null:P===E&&m===A?M:M=v(E=P,A=m)}}function j1n(d){return function(){this.style.removeProperty(d)}}function jHn(d,v,E){var A,M=E+"",P;return function(){var m=Gx(this,d);return m===M?null:m===A?P:P=v(A=m,E)}}function xHn(d,v,E){var A,M,P;return function(){var m=Gx(this,d),L=E(this),H=L+"";return L==null&&(H=L=(this.style.removeProperty(d),Gx(this,d))),m===H?null:m===A&&H===M?P:(M=H,P=v(A=m,L))}}function AHn(d,v){var E,A,M,P="style."+v,m="end."+P,L;return function(){var H=zp(this,d),U=H.on,Q=H.value[P]==null?L||(L=j1n(v)):void 0;(U!==E||M!==Q)&&(A=(E=U).copy()).on(m,M=Q),H.on=A}}function MHn(d,v,E){var A=(d+="")=="transform"?CGn:E1n;return v==null?this.styleTween(d,EHn(d,A)).on("end.style."+d,j1n(d)):typeof v=="function"?this.styleTween(d,xHn(d,A,$2e(this,"style."+d,v))).each(AHn(this._id,d)):this.styleTween(d,jHn(d,A,v),E).on("end.style."+d,null)}function CHn(d,v,E){return function(A){this.style.setProperty(d,v.call(this,A),E)}}function THn(d,v,E){var A,M;function P(){var m=v.apply(this,arguments);return m!==M&&(A=(M=m)&&CHn(d,m,E)),A}return P._value=v,P}function SHn(d,v,E){var A="style."+(d+="");if(arguments.length<2)return(A=this.tween(A))&&A._value;if(v==null)return this.tween(A,null);if(typeof v!="function")throw new Error;return this.tween(A,THn(d,v,E??""))}function IHn(d){return function(){this.textContent=d}}function PHn(d){return function(){var v=d(this);this.textContent=v??""}}function OHn(d){return this.tween("text",typeof d=="function"?PHn($2e(this,"text",d)):IHn(d==null?"":d+""))}function NHn(d){return function(v){this.textContent=d.call(this,v)}}function $Hn(d){var v,E;function A(){var M=d.apply(this,arguments);return M!==E&&(v=(E=M)&&NHn(M)),v}return A._value=d,A}function DHn(d){var v="text";if(arguments.length<1)return(v=this.tween(v))&&v._value;if(d==null)return this.tween(v,null);if(typeof d!="function")throw new Error;return this.tween(v,$Hn(d))}function LHn(){for(var d=this._name,v=this._id,E=x1n(),A=this._groups,M=A.length,P=0;P<M;++P)for(var m=A[P],L=m.length,H,U=0;U<L;++U)if(H=m[U]){var Q=u2(H,v);IK(H,d,E,U,m,{time:Q.time+Q.delay+Q.duration,delay:0,duration:Q.duration,ease:Q.ease})}return new Q3(A,this._parents,d,E)}function _Hn(){var d,v,E=this,A=E._id,M=E.size();return new Promise(function(P,m){var L={value:m},H={value:function(){--M===0&&P()}};E.each(function(){var U=zp(this,A),Q=U.on;Q!==d&&(v=(d=Q).copy(),v._.cancel.push(L),v._.interrupt.push(L),v._.end.push(H)),U.on=v}),M===0&&P()})}var FHn=0;function Q3(d,v,E,A){this._groups=d,this._parents=v,this._name=E,this._id=A}function x1n(){return++FHn}var K3=_N.prototype;Q3.prototype={constructor:Q3,select:mHn,selectAll:vHn,selectChild:K3.selectChild,selectChildren:K3.selectChildren,filter:hHn,merge:aHn,selection:kHn,transition:LHn,call:K3.call,nodes:K3.nodes,node:K3.node,size:K3.size,empty:K3.empty,each:K3.each,on:wHn,attr:WGn,attrTween:eHn,style:MHn,styleTween:SHn,text:OHn,textTween:DHn,remove:pHn,tween:GGn,delay:iHn,duration:uHn,ease:sHn,easeVarying:lHn,end:_Hn,[Symbol.iterator]:K3[Symbol.iterator]};function RHn(d){return((d*=2)<=1?d*d*d:(d-=2)*d*d+2)/2}var BHn={time:null,delay:0,duration:250,ease:RHn};function JHn(d,v){for(var E;!(E=d.__transition)||!(E=E[v]);)if(!(d=d.parentNode))throw new Error(`transition ${v} not found`);return E}function GHn(d){var v,E;d instanceof Q3?(v=d._id,d=d._name):(v=x1n(),(E=BHn).time=O2e(),d=d==null?null:d+"");for(var A=this._groups,M=A.length,P=0;P<M;++P)for(var m=A[P],L=m.length,H,U=0;U<L;++U)(H=m[U])&&IK(H,d,v,U,m,E||JHn(H,v));return new Q3(A,this._parents,d,v)}_N.prototype.interrupt=RGn;_N.prototype.transition=GHn;const nK=d=>()=>d;function HHn(d,{sourceEvent:v,target:E,transform:A,dispatch:M}){Object.defineProperties(this,{type:{value:d,enumerable:!0,configurable:!0},sourceEvent:{value:v,enumerable:!0,configurable:!0},target:{value:E,enumerable:!0,configurable:!0},transform:{value:A,enumerable:!0,configurable:!0},_:{value:M}})}function W3(d,v,E){this.k=d,this.x=v,this.y=E}W3.prototype={constructor:W3,scale:function(d){return d===1?this:new W3(this.k*d,this.x,this.y)},translate:function(d,v){return d===0&v===0?this:new W3(this.k,this.x+this.k*d,this.y+this.k*v)},apply:function(d){return[d[0]*this.k+this.x,d[1]*this.k+this.y]},applyX:function(d){return d*this.k+this.x},applyY:function(d){return d*this.k+this.y},invert:function(d){return[(d[0]-this.x)/this.k,(d[1]-this.y)/this.k]},invertX:function(d){return(d-this.x)/this.k},invertY:function(d){return(d-this.y)/this.k},rescaleX:function(d){return d.copy().domain(d.range().map(this.invertX,this).map(d.invert,d))},rescaleY:function(d){return d.copy().domain(d.range().map(this.invertY,this).map(d.invert,d))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var PK=new W3(1,0,0);A1n.prototype=W3.prototype;function A1n(d){for(;!d.__zoom;)if(!(d=d.parentNode))return PK;return d.__zoom}function r2e(d){d.stopImmediatePropagation()}function yN(d){d.preventDefault(),d.stopImmediatePropagation()}function qHn(d){return(!d.ctrlKey||d.type==="wheel")&&!d.button}function zHn(){var d=this;return d instanceof SVGElement?(d=d.ownerSVGElement||d,d.hasAttribute("viewBox")?(d=d.viewBox.baseVal,[[d.x,d.y],[d.x+d.width,d.y+d.height]]):[[0,0],[d.width.baseVal.value,d.height.baseVal.value]]):[[0,0],[d.clientWidth,d.clientHeight]]}function tan(){return this.__zoom||PK}function UHn(d){return-d.deltaY*(d.deltaMode===1?.05:d.deltaMode?1:.002)*(d.ctrlKey?10:1)}function XHn(){return navigator.maxTouchPoints||"ontouchstart"in this}function KHn(d,v,E){var A=d.invertX(v[0][0])-E[0][0],M=d.invertX(v[1][0])-E[1][0],P=d.invertY(v[0][1])-E[0][1],m=d.invertY(v[1][1])-E[1][1];return d.translate(M>A?(A+M)/2:Math.min(0,A)||Math.max(0,M),m>P?(P+m)/2:Math.min(0,P)||Math.max(0,m))}function M1n(){var d=qHn,v=zHn,E=KHn,A=UHn,M=XHn,P=[0,1/0],m=[[-1/0,-1/0],[1/0,1/0]],L=250,H=fK,U=CK("start","zoom","end"),Q,Y,G,V=500,te=150,X=0,Ee=10;function ue(xe){xe.property("__zoom",tan).on("wheel.zoom",kn,{passive:!1}).on("mousedown.zoom",En).on("dblclick.zoom",Zn).filter(M).on("touchstart.zoom",Ln).on("touchmove.zoom",Vn).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}ue.transform=function(xe,on,rn,Sn){var Fn=xe.selection?xe.selection():xe;Fn.property("__zoom",tan),xe!==Fn?Ke(xe,on,rn,Sn):Fn.interrupt().each(function(){Xe(this,arguments).event(Sn).start().zoom(null,typeof on=="function"?on.apply(this,arguments):on).end()})},ue.scaleBy=function(xe,on,rn,Sn){ue.scaleTo(xe,function(){var Fn=this.__zoom.k,dn=typeof on=="function"?on.apply(this,arguments):on;return Fn*dn},rn,Sn)},ue.scaleTo=function(xe,on,rn,Sn){ue.transform(xe,function(){var Fn=v.apply(this,arguments),dn=this.__zoom,Gn=rn==null?je(Fn):typeof rn=="function"?rn.apply(this,arguments):rn,Nn=dn.invert(Gn),qn=typeof on=="function"?on.apply(this,arguments):on;return E(re(ge(dn,qn),Gn,Nn),Fn,m)},rn,Sn)},ue.translateBy=function(xe,on,rn,Sn){ue.transform(xe,function(){return E(this.__zoom.translate(typeof on=="function"?on.apply(this,arguments):on,typeof rn=="function"?rn.apply(this,arguments):rn),v.apply(this,arguments),m)},null,Sn)},ue.translateTo=function(xe,on,rn,Sn,Fn){ue.transform(xe,function(){var dn=v.apply(this,arguments),Gn=this.__zoom,Nn=Sn==null?je(dn):typeof Sn=="function"?Sn.apply(this,arguments):Sn;return E(PK.translate(Nn[0],Nn[1]).scale(Gn.k).translate(typeof on=="function"?-on.apply(this,arguments):-on,typeof rn=="function"?-rn.apply(this,arguments):-rn),dn,m)},Sn,Fn)};function ge(xe,on){return on=Math.max(P[0],Math.min(P[1],on)),on===xe.k?xe:new W3(on,xe.x,xe.y)}function re(xe,on,rn){var Sn=on[0]-rn[0]*xe.k,Fn=on[1]-rn[1]*xe.k;return Sn===xe.x&&Fn===xe.y?xe:new W3(xe.k,Sn,Fn)}function je(xe){return[(+xe[0][0]+ +xe[1][0])/2,(+xe[0][1]+ +xe[1][1])/2]}function Ke(xe,on,rn,Sn){xe.on("start.zoom",function(){Xe(this,arguments).event(Sn).start()}).on("interrupt.zoom end.zoom",function(){Xe(this,arguments).event(Sn).end()}).tween("zoom",function(){var Fn=this,dn=arguments,Gn=Xe(Fn,dn).event(Sn),Nn=v.apply(Fn,dn),qn=rn==null?je(Nn):typeof rn=="function"?rn.apply(Fn,dn):rn,Jt=Math.max(Nn[1][0]-Nn[0][0],Nn[1][1]-Nn[0][1]),Kt=Fn.__zoom,Oi=typeof on=="function"?on.apply(Fn,dn):on,gr=H(Kt.invert(qn).concat(Jt/Kt.k),Oi.invert(qn).concat(Jt/Oi.k));return function(Ki){if(Ki===1)Ki=Oi;else{var Kn=gr(Ki),ei=Jt/Kn[2];Ki=new W3(ei,qn[0]-Kn[0]*ei,qn[1]-Kn[1]*ei)}Gn.zoom(null,Ki)}})}function Xe(xe,on,rn){return!rn&&xe.__zooming||new Ye(xe,on)}function Ye(xe,on){this.that=xe,this.args=on,this.active=0,this.sourceEvent=null,this.extent=v.apply(xe,on),this.taps=0}Ye.prototype={event:function(xe){return xe&&(this.sourceEvent=xe),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(xe,on){return this.mouse&&xe!=="mouse"&&(this.mouse[1]=on.invert(this.mouse[0])),this.touch0&&xe!=="touch"&&(this.touch0[1]=on.invert(this.touch0[0])),this.touch1&&xe!=="touch"&&(this.touch1[1]=on.invert(this.touch1[0])),this.that.__zoom=on,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(xe){var on=_0(this.that).datum();U.call(xe,this.that,new HHn(xe,{sourceEvent:this.sourceEvent,target:ue,transform:this.that.__zoom,dispatch:U}),on)}};function kn(xe,...on){if(!d.apply(this,arguments))return;var rn=Xe(this,on).event(xe),Sn=this.__zoom,Fn=Math.max(P[0],Math.min(P[1],Sn.k*Math.pow(2,A.apply(this,arguments)))),dn=e2(xe);if(rn.wheel)(rn.mouse[0][0]!==dn[0]||rn.mouse[0][1]!==dn[1])&&(rn.mouse[1]=Sn.invert(rn.mouse[0]=dn)),clearTimeout(rn.wheel);else{if(Sn.k===Fn)return;rn.mouse=[dn,Sn.invert(dn)],aK(this),rn.start()}yN(xe),rn.wheel=setTimeout(Gn,te),rn.zoom("mouse",E(re(ge(Sn,Fn),rn.mouse[0],rn.mouse[1]),rn.extent,m));function Gn(){rn.wheel=null,rn.end()}}function En(xe,...on){if(G||!d.apply(this,arguments))return;var rn=xe.currentTarget,Sn=Xe(this,on,!0).event(xe),Fn=_0(xe.view).on("mousemove.zoom",qn,!0).on("mouseup.zoom",Jt,!0),dn=e2(xe,rn),Gn=xe.clientX,Nn=xe.clientY;f1n(xe.view),r2e(xe),Sn.mouse=[dn,this.__zoom.invert(dn)],aK(this),Sn.start();function qn(Kt){if(yN(Kt),!Sn.moved){var Oi=Kt.clientX-Gn,gr=Kt.clientY-Nn;Sn.moved=Oi*Oi+gr*gr>X}Sn.event(Kt).zoom("mouse",E(re(Sn.that.__zoom,Sn.mouse[0]=e2(Kt,rn),Sn.mouse[1]),Sn.extent,m))}function Jt(Kt){Fn.on("mousemove.zoom mouseup.zoom",null),l1n(Kt.view,Sn.moved),yN(Kt),Sn.event(Kt).end()}}function Zn(xe,...on){if(d.apply(this,arguments)){var rn=this.__zoom,Sn=e2(xe.changedTouches?xe.changedTouches[0]:xe,this),Fn=rn.invert(Sn),dn=rn.k*(xe.shiftKey?.5:2),Gn=E(re(ge(rn,dn),Sn,Fn),v.apply(this,on),m);yN(xe),L>0?_0(this).transition().duration(L).call(Ke,Gn,Sn,xe):_0(this).call(ue.transform,Gn,Sn,xe)}}function Ln(xe,...on){if(d.apply(this,arguments)){var rn=xe.touches,Sn=rn.length,Fn=Xe(this,on,xe.changedTouches.length===Sn).event(xe),dn,Gn,Nn,qn;for(r2e(xe),Gn=0;Gn<Sn;++Gn)Nn=rn[Gn],qn=e2(Nn,this),qn=[qn,this.__zoom.invert(qn),Nn.identifier],Fn.touch0?!Fn.touch1&&Fn.touch0[2]!==qn[2]&&(Fn.touch1=qn,Fn.taps=0):(Fn.touch0=qn,dn=!0,Fn.taps=1+!!Q);Q&&(Q=clearTimeout(Q)),dn&&(Fn.taps<2&&(Y=qn[0],Q=setTimeout(function(){Q=null},V)),aK(this),Fn.start())}}function Vn(xe,...on){if(this.__zooming){var rn=Xe(this,on).event(xe),Sn=xe.changedTouches,Fn=Sn.length,dn,Gn,Nn,qn;for(yN(xe),dn=0;dn<Fn;++dn)Gn=Sn[dn],Nn=e2(Gn,this),rn.touch0&&rn.touch0[2]===Gn.identifier?rn.touch0[0]=Nn:rn.touch1&&rn.touch1[2]===Gn.identifier&&(rn.touch1[0]=Nn);if(Gn=rn.that.__zoom,rn.touch1){var Jt=rn.touch0[0],Kt=rn.touch0[1],Oi=rn.touch1[0],gr=rn.touch1[1],Ki=(Ki=Oi[0]-Jt[0])*Ki+(Ki=Oi[1]-Jt[1])*Ki,Kn=(Kn=gr[0]-Kt[0])*Kn+(Kn=gr[1]-Kt[1])*Kn;Gn=ge(Gn,Math.sqrt(Ki/Kn)),Nn=[(Jt[0]+Oi[0])/2,(Jt[1]+Oi[1])/2],qn=[(Kt[0]+gr[0])/2,(Kt[1]+gr[1])/2]}else if(rn.touch0)Nn=rn.touch0[0],qn=rn.touch0[1];else return;rn.zoom("touch",E(re(Gn,Nn,qn),rn.extent,m))}}function J(xe,...on){if(this.__zooming){var rn=Xe(this,on).event(xe),Sn=xe.changedTouches,Fn=Sn.length,dn,Gn;for(r2e(xe),G&&clearTimeout(G),G=setTimeout(function(){G=null},V),dn=0;dn<Fn;++dn)Gn=Sn[dn],rn.touch0&&rn.touch0[2]===Gn.identifier?delete rn.touch0:rn.touch1&&rn.touch1[2]===Gn.identifier&&delete rn.touch1;if(rn.touch1&&!rn.touch0&&(rn.touch0=rn.touch1,delete rn.touch1),rn.touch0)rn.touch0[1]=this.__zoom.invert(rn.touch0[0]);else if(rn.end(),rn.taps===2&&(Gn=e2(Gn,this),Math.hypot(Y[0]-Gn[0],Y[1]-Gn[1])<Ee)){var Nn=_0(this).on("dblclick.zoom");Nn&&Nn.apply(this,arguments)}}}return ue.wheelDelta=function(xe){return arguments.length?(A=typeof xe=="function"?xe:nK(+xe),ue):A},ue.filter=function(xe){return arguments.length?(d=typeof xe=="function"?xe:nK(!!xe),ue):d},ue.touchable=function(xe){return arguments.length?(M=typeof xe=="function"?xe:nK(!!xe),ue):M},ue.extent=function(xe){return arguments.length?(v=typeof xe=="function"?xe:nK([[+xe[0][0],+xe[0][1]],[+xe[1][0],+xe[1][1]]]),ue):v},ue.scaleExtent=function(xe){return arguments.length?(P[0]=+xe[0],P[1]=+xe[1],ue):[P[0],P[1]]},ue.translateExtent=function(xe){return arguments.length?(m[0][0]=+xe[0][0],m[1][0]=+xe[1][0],m[0][1]=+xe[0][1],m[1][1]=+xe[1][1],ue):[[m[0][0],m[0][1]],[m[1][0],m[1][1]]]},ue.constrain=function(xe){return arguments.length?(E=xe,ue):E},ue.duration=function(xe){return arguments.length?(L=+xe,ue):L},ue.interpolate=function(xe){return arguments.length?(H=xe,ue):H},ue.on=function(){var xe=U.on.apply(U,arguments);return xe===U?ue:xe},ue.clickDistance=function(xe){return arguments.length?(X=(xe=+xe)*xe,ue):Math.sqrt(X)},ue.tapDistance=function(xe){return arguments.length?(Ee=+xe,ue):Ee},ue}const c2={error001:(d="react")=>`Seems like you have not used ${d==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${d}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:d=>`Node type "${d}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:d=>`The old edge with id=${d} does not exist.`,error009:d=>`Marker type "${d}" doesn't exist.`,error008:(d,{id:v,sourceHandle:E,targetHandle:A})=>`Couldn't create edge for ${d} handle id: "${d==="source"?E:A}", edge id: ${v}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:d=>`Edge type "${d}" not found. Using fallback type "default".`,error012:d=>`Node with id "${d}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(d="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${d}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:d=>`Edge with id "${d}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},PN=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],C1n=["Enter"," ","Escape"],T1n={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:d,x:v,y:E})=>`Moved selected node ${d}. New position, x: ${v}, y: ${E}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var qx;(function(d){d.Strict="strict",d.Loose="loose"})(qx||(qx={}));var sk;(function(d){d.Free="free",d.Vertical="vertical",d.Horizontal="horizontal"})(sk||(sk={}));var ON;(function(d){d.Partial="partial",d.Full="full"})(ON||(ON={}));const S1n={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Q5;(function(d){d.Bezier="default",d.Straight="straight",d.Step="step",d.SmoothStep="smoothstep",d.SimpleBezier="simplebezier"})(Q5||(Q5={}));var NN;(function(d){d.Arrow="arrow",d.ArrowClosed="arrowclosed"})(NN||(NN={}));var Ei;(function(d){d.Left="left",d.Top="top",d.Right="right",d.Bottom="bottom"})(Ei||(Ei={}));const ian={[Ei.Left]:Ei.Right,[Ei.Right]:Ei.Left,[Ei.Top]:Ei.Bottom,[Ei.Bottom]:Ei.Top},I1n=d=>!!d&&typeof d=="object"&&"id"in d&&"source"in d&&"target"in d,WHn=d=>!!d&&typeof d=="object"&&"id"in d&&"position"in d&&!("source"in d)&&!("target"in d),D2e=d=>!!d&&typeof d=="object"&&"id"in d&&"internals"in d&&!("source"in d)&&!("target"in d),RN=(d,v=[0,0])=>{const{width:E,height:A}=o2(d),M=d.origin??v,P=E*M[0],m=A*M[1];return{x:d.position.x-P,y:d.position.y-m}},VHn=(d,v={nodeOrigin:[0,0]})=>{if(d.length===0)return{x:0,y:0,width:0,height:0};let E=!1;const A=d.reduce((M,P)=>{const m=typeof P=="string";let L=!v.nodeLookup&&!m?P:void 0;return v.nodeLookup&&(L=m?v.nodeLookup.get(P):D2e(P)?P:v.nodeLookup.get(P.id)),L?(E=!0,OK(M,jK(L,v.nodeOrigin))):M},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return E?NK(A):{x:0,y:0,width:0,height:0}},Kx=(d,v={})=>{let E={x:1/0,y:1/0,x2:-1/0,y2:-1/0},A=!1;return d.forEach(M=>{(v.filter===void 0||v.filter(M))&&(E=OK(E,jK(M)),A=!0)}),A?NK(E):{x:0,y:0,width:0,height:0}},L2e=(d,v,[E,A,M]=[0,0,1],P=!1,m=!1)=>{const L=(v.x-E)/M,H=(v.y-A)/M,U=v.width/M,Q=v.height/M,Y=[];for(const G of d.values()){const{measured:V,selectable:te=!0,hidden:X=!1}=G;if(m&&!te||X)continue;const Ee=V.width??G.width??G.initialWidth??0,ue=V.height??G.height??G.initialHeight??0,{x:ge,y:re}=G.internals.positionAbsolute,je=$1n(L,H,U,Q,ge,re,Ee,ue),Ke=Ee*ue,Xe=P&&je>0;(!G.internals.handleBounds||Xe||je>=Ke||G.dragging)&&Y.push(G)}return Y},QHn=(d,v)=>{const E=new Set;return d.forEach(A=>{E.add(A.id)}),v.filter(A=>E.has(A.source)||E.has(A.target))};function YHn(d,v){const E=new Map,A=v!=null&&v.nodes?new Set(v.nodes.map(M=>M.id)):null;return d.forEach(M=>{let P;if(v!=null&&v.includeHiddenNodes){const{width:m,height:L}=o2(M);P=m>0&&L>0}else P=!!(M.measured.width&&M.measured.height&&!M.hidden);P&&(!A||A.has(M.id))&&E.set(M.id,M)}),E}async function ZHn({nodes:d,width:v,height:E,panZoom:A,minZoom:M,maxZoom:P},m){if(d.size===0)return!0;const L=YHn(d,m),H=Kx(L),U=F2e(H,v,E,(m==null?void 0:m.minZoom)??M,(m==null?void 0:m.maxZoom)??P,(m==null?void 0:m.padding)??.1);return await A.setViewport(U,{duration:m==null?void 0:m.duration,ease:m==null?void 0:m.ease,interpolate:m==null?void 0:m.interpolate}),!0}function P1n({nodeId:d,nextPosition:v,nodeLookup:E,nodeOrigin:A=[0,0],nodeExtent:M,onError:P}){const m=E.get(d),L=m.parentId?E.get(m.parentId):void 0,{x:H,y:U}=L?L.internals.positionAbsolute:{x:0,y:0},Q=m.origin??A;let Y=m.extent||M;if(m.extent==="parent"&&!m.expandParent)if(!L)P==null||P("005",c2.error005());else{const{width:V,height:te}=o2(L);V&&te&&(Y=[[H,U],[H+V,U+te]])}else L&&ak(m.extent)&&(Y=[[m.extent[0][0]+H,m.extent[0][1]+U],[m.extent[1][0]+H,m.extent[1][1]+U]]);const G=ak(Y)?hk(v,Y,m.measured):v;return(m.measured.width===void 0||m.measured.height===void 0)&&(P==null||P("015",c2.error015())),{position:{x:G.x-H+(m.measured.width??0)*Q[0],y:G.y-U+(m.measured.height??0)*Q[1]},positionAbsolute:G}}async function eqn({nodesToRemove:d=[],edgesToRemove:v=[],nodes:E,edges:A,onBeforeDelete:M}){const P=new Set(d.map(G=>G.id)),m=[];for(const G of E){if(G.deletable===!1)continue;const V=P.has(G.id),te=!V&&G.parentId&&m.find(X=>X.id===G.parentId);(V||te)&&m.push(G)}const L=new Set(v.map(G=>G.id)),H=A.filter(G=>G.deletable!==!1),Q=QHn(m,H);for(const G of H)L.has(G.id)&&!Q.find(te=>te.id===G.id)&&Q.push(G);if(!M)return{edges:Q,nodes:m};const Y=await M({nodes:m,edges:Q});return typeof Y=="boolean"?Y?{edges:Q,nodes:m}:{edges:[],nodes:[]}:Y}const zx=(d,v=0,E=1)=>Math.min(Math.max(d,v),E),hk=(d={x:0,y:0},v,E)=>({x:zx(d.x,v[0][0],v[1][0]-((E==null?void 0:E.width)??0)),y:zx(d.y,v[0][1],v[1][1]-((E==null?void 0:E.height)??0))});function O1n(d,v,E){const{width:A,height:M}=o2(E),{x:P,y:m}=E.internals.positionAbsolute;return hk(d,[[P,m],[P+A,m+M]],v)}const ran=(d,v,E)=>d<v?zx(Math.abs(d-v),1,v)/v:d>E?-zx(Math.abs(d-E),1,v)/v:0,_2e=(d,v,E=15,A=40)=>{const M=ran(d.x,A,v.width-A)*E,P=ran(d.y,A,v.height-A)*E;return[M,P]},OK=(d,v)=>({x:Math.min(d.x,v.x),y:Math.min(d.y,v.y),x2:Math.max(d.x2,v.x2),y2:Math.max(d.y2,v.y2)}),v2e=({x:d,y:v,width:E,height:A})=>({x:d,y:v,x2:d+E,y2:v+A}),NK=({x:d,y:v,x2:E,y2:A})=>({x:d,y:v,width:E-d,height:A-v}),$N=(d,v=[0,0])=>{var M,P;const{x:E,y:A}=D2e(d)?d.internals.positionAbsolute:RN(d,v);return{x:E,y:A,width:((M=d.measured)==null?void 0:M.width)??d.width??d.initialWidth??0,height:((P=d.measured)==null?void 0:P.height)??d.height??d.initialHeight??0}},jK=(d,v=[0,0])=>{var M,P;const{x:E,y:A}=D2e(d)?d.internals.positionAbsolute:RN(d,v);return{x:E,y:A,x2:E+(((M=d.measured)==null?void 0:M.width)??d.width??d.initialWidth??0),y2:A+(((P=d.measured)==null?void 0:P.height)??d.height??d.initialHeight??0)}},N1n=(d,v)=>NK(OK(v2e(d),v2e(v))),$1n=(d,v,E,A,M,P,m,L)=>{const H=Math.max(0,Math.min(d+E,M+m)-Math.max(d,M)),U=Math.max(0,Math.min(v+A,P+L)-Math.max(v,P));return Math.ceil(H*U)},xK=(d,v)=>$1n(d.x,d.y,d.width,d.height,v.x,v.y,v.width,v.height),can=d=>t2(d.width)&&t2(d.height)&&t2(d.x)&&t2(d.y),t2=d=>!isNaN(d)&&isFinite(d),D1n=(d,v)=>(E,A)=>{},BN=(d,v=[1,1])=>({x:v[0]*Math.round(d.x/v[0]),y:v[1]*Math.round(d.y/v[1])}),JN=({x:d,y:v},[E,A,M],P=!1,m=[1,1])=>{const L={x:(d-E)/M,y:(v-A)/M};return P?BN(L,m):L},Ux=({x:d,y:v},[E,A,M])=>({x:d*M+E,y:v*M+A});function Fx(d,v){if(typeof d=="number")return Math.floor((v-v/(1+d))*.5);if(typeof d=="string"&&d.endsWith("px")){const E=parseFloat(d);if(!Number.isNaN(E))return Math.floor(E)}if(typeof d=="string"&&d.endsWith("%")){const E=parseFloat(d);if(!Number.isNaN(E))return Math.floor(v*E*.01)}return console.error(`The padding value "${d}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nqn(d,v,E){if(typeof d=="string"||typeof d=="number"){const A=Fx(d,E),M=Fx(d,v);return{top:A,right:M,bottom:A,left:M,x:M*2,y:A*2}}if(typeof d=="object"){const A=Fx(d.top??d.y??0,E),M=Fx(d.bottom??d.y??0,E),P=Fx(d.left??d.x??0,v),m=Fx(d.right??d.x??0,v);return{top:A,right:m,bottom:M,left:P,x:P+m,y:A+M}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tqn(d,v,E,A,M,P){const{x:m,y:L}=Ux(d,[v,E,A]),{x:H,y:U}=Ux({x:d.x+d.width,y:d.y+d.height},[v,E,A]),Q=M-H,Y=P-U;return{left:Math.floor(m),top:Math.floor(L),right:Math.floor(Q),bottom:Math.floor(Y)}}const F2e=(d,v,E,A,M,P)=>{const m=nqn(P,v,E),L=(v-m.x)/d.width,H=(E-m.y)/d.height,U=Math.min(L,H),Q=zx(U,A,M),Y=d.x+d.width/2,G=d.y+d.height/2,V=v/2-Y*Q,te=E/2-G*Q,X=tqn(d,V,te,Q,v,E),Ee={left:Math.min(X.left-m.left,0),top:Math.min(X.top-m.top,0),right:Math.min(X.right-m.right,0),bottom:Math.min(X.bottom-m.bottom,0)};return{x:V-Ee.left+Ee.right,y:te-Ee.top+Ee.bottom,zoom:Q}},DN=()=>{var d;return typeof navigator<"u"&&((d=navigator==null?void 0:navigator.userAgent)==null?void 0:d.indexOf("Mac"))>=0};function ak(d){return d!=null&&d!=="parent"}function o2(d){var v,E;return{width:((v=d.measured)==null?void 0:v.width)??d.width??d.initialWidth??0,height:((E=d.measured)==null?void 0:E.height)??d.height??d.initialHeight??0}}function L1n(d){var v,E;return(((v=d.measured)==null?void 0:v.width)??d.width??d.initialWidth)!==void 0&&(((E=d.measured)==null?void 0:E.height)??d.height??d.initialHeight)!==void 0}function _1n(d,v={width:0,height:0},E,A,M){const P={...d},m=A.get(E);if(m){const L=m.origin||M;P.x+=m.internals.positionAbsolute.x-(v.width??0)*L[0],P.y+=m.internals.positionAbsolute.y-(v.height??0)*L[1]}return P}function uan(d,v){if(d.size!==v.size)return!1;for(const E of d)if(!v.has(E))return!1;return!0}function iqn(){let d,v;return{promise:new Promise((A,M)=>{d=A,v=M}),resolve:d,reject:v}}function rqn(d){return{...T1n,...d||{}}}function F1n(d){return d===null?null:d?"valid":"invalid"}function AN(d,{snapGrid:v=[0,0],snapToGrid:E=!1,transform:A,containerBounds:M}){const{x:P,y:m}=i2(d),L=JN({x:P-((M==null?void 0:M.left)??0),y:m-((M==null?void 0:M.top)??0)},A),{x:H,y:U}=E?BN(L,v):L;return{xSnapped:H,ySnapped:U,...L}}const R2e=d=>({width:d.offsetWidth,height:d.offsetHeight}),R1n=d=>{var v;return((v=d==null?void 0:d.getRootNode)==null?void 0:v.call(d))||(window==null?void 0:window.document)},cqn=["INPUT","SELECT","TEXTAREA"];function B1n(d){var A,M;const v=((M=(A=d.composedPath)==null?void 0:A.call(d))==null?void 0:M[0])||d.target;return(v==null?void 0:v.nodeType)!==1?!1:cqn.includes(v.nodeName)||v.hasAttribute("contenteditable")||!!v.closest(".nokey")}const J1n=d=>"clientX"in d,i2=(d,v)=>{var P,m;const E=J1n(d),A=E?d.clientX:(P=d.touches)==null?void 0:P[0].clientX,M=E?d.clientY:(m=d.touches)==null?void 0:m[0].clientY;return{x:A-((v==null?void 0:v.left)??0),y:M-((v==null?void 0:v.top)??0)}},oan=(d,v,E,A,M)=>{const P=v.querySelectorAll(`.${d}`);return!P||!P.length?null:Array.from(P).map(m=>{const L=m.getBoundingClientRect();return{id:m.getAttribute("data-handleid"),type:d,nodeId:M,position:m.getAttribute("data-handlepos"),x:(L.left-E.left)/A,y:(L.top-E.top)/A,...R2e(m)}})};function G1n({sourceX:d,sourceY:v,targetX:E,targetY:A,sourceControlX:M,sourceControlY:P,targetControlX:m,targetControlY:L}){const H=d*.125+M*.375+m*.375+E*.125,U=v*.125+P*.375+L*.375+A*.125,Q=Math.abs(H-d),Y=Math.abs(U-v);return[H,U,Q,Y]}function tK(d,v){return d>=0?.5*d:v*25*Math.sqrt(-d)}function san({pos:d,x1:v,y1:E,x2:A,y2:M,c:P}){switch(d){case Ei.Left:return[v-tK(v-A,P),E];case Ei.Right:return[v+tK(A-v,P),E];case Ei.Top:return[v,E-tK(E-M,P)];case Ei.Bottom:return[v,E+tK(M-E,P)]}}function GN({sourceX:d,sourceY:v,sourcePosition:E=Ei.Bottom,targetX:A,targetY:M,targetPosition:P=Ei.Top,curvature:m=.25}){const[L,H]=san({pos:E,x1:d,y1:v,x2:A,y2:M,c:m}),[U,Q]=san({pos:P,x1:A,y1:M,x2:d,y2:v,c:m}),[Y,G,V,te]=G1n({sourceX:d,sourceY:v,targetX:A,targetY:M,sourceControlX:L,sourceControlY:H,targetControlX:U,targetControlY:Q});return[`M${d},${v} C${L},${H} ${U},${Q} ${A},${M}`,Y,G,V,te]}function H1n({sourceX:d,sourceY:v,targetX:E,targetY:A}){const M=Math.abs(E-d)/2,P=E<d?E+M:E-M,m=Math.abs(A-v)/2,L=A<v?A+m:A-m;return[P,L,M,m]}function uqn({sourceNode:d,targetNode:v,selected:E=!1,zIndex:A=0,elevateOnSelect:M=!1,zIndexMode:P="basic"}){if(P==="manual")return A;const m=M&&E?A+1e3:A,L=Math.max(d.parentId||M&&d.selected?d.internals.z:0,v.parentId||M&&v.selected?v.internals.z:0);return m+L}function oqn({sourceNode:d,targetNode:v,width:E,height:A,transform:M}){const P=OK(jK(d),jK(v));P.x===P.x2&&(P.x2+=1),P.y===P.y2&&(P.y2+=1);const m={x:-M[0]/M[2],y:-M[1]/M[2],width:E/M[2],height:A/M[2]};return xK(m,NK(P))>0}const sqn=({source:d,sourceHandle:v,target:E,targetHandle:A})=>`xy-edge__${d}${v||""}-${E}${A||""}`,fqn=(d,v)=>v.some(E=>E.source===d.source&&E.target===d.target&&(E.sourceHandle===d.sourceHandle||!E.sourceHandle&&!d.sourceHandle)&&(E.targetHandle===d.targetHandle||!E.targetHandle&&!d.targetHandle)),lqn=(d,v,E={})=>{var P;if(!d.source||!d.target)return(P=E.onError)==null||P.call(E,"006",c2.error006()),v;const A=E.getEdgeId||sqn;let M;return I1n(d)?M={...d}:M={...d,id:A(d)},fqn(M,v)?v:(M.sourceHandle===null&&delete M.sourceHandle,M.targetHandle===null&&delete M.targetHandle,v.concat(M))};function q1n({sourceX:d,sourceY:v,targetX:E,targetY:A}){const[M,P,m,L]=H1n({sourceX:d,sourceY:v,targetX:E,targetY:A});return[`M ${d},${v}L ${E},${A}`,M,P,m,L]}const fan={[Ei.Left]:{x:-1,y:0},[Ei.Right]:{x:1,y:0},[Ei.Top]:{x:0,y:-1},[Ei.Bottom]:{x:0,y:1}},hqn=({source:d,sourcePosition:v=Ei.Bottom,target:E})=>v===Ei.Left||v===Ei.Right?d.x<E.x?{x:1,y:0}:{x:-1,y:0}:d.y<E.y?{x:0,y:1}:{x:0,y:-1},lan=(d,v)=>Math.sqrt(Math.pow(v.x-d.x,2)+Math.pow(v.y-d.y,2));function aqn({source:d,sourcePosition:v=Ei.Bottom,target:E,targetPosition:A=Ei.Top,center:M,offset:P,stepPosition:m}){const L=fan[v],H=fan[A],U={x:d.x+L.x*P,y:d.y+L.y*P},Q={x:E.x+H.x*P,y:E.y+H.y*P},Y=hqn({source:U,sourcePosition:v,target:Q}),G=Y.x!==0?"x":"y",V=Y[G];let te=[],X,Ee;const ue={x:0,y:0},ge={x:0,y:0},[,,re,je]=H1n({sourceX:d.x,sourceY:d.y,targetX:E.x,targetY:E.y});if(L[G]*H[G]===-1){G==="x"?(X=M.x??U.x+(Q.x-U.x)*m,Ee=M.y??(U.y+Q.y)/2):(X=M.x??(U.x+Q.x)/2,Ee=M.y??U.y+(Q.y-U.y)*m);const kn=[{x:X,y:U.y},{x:X,y:Q.y}],En=[{x:U.x,y:Ee},{x:Q.x,y:Ee}];L[G]===V?te=G==="x"?kn:En:te=G==="x"?En:kn}else{const kn=[{x:U.x,y:Q.y}],En=[{x:Q.x,y:U.y}];if(G==="x"?te=L.x===V?En:kn:te=L.y===V?kn:En,v===A){const xe=Math.abs(d[G]-E[G]);if(xe<=P){const on=Math.min(P-1,P-xe);L[G]===V?ue[G]=(U[G]>d[G]?-1:1)*on:ge[G]=(Q[G]>E[G]?-1:1)*on}}if(v!==A){const xe=G==="x"?"y":"x",on=L[G]===H[xe],rn=U[xe]>Q[xe],Sn=U[xe]<Q[xe];(L[G]===1&&(!on&&rn||on&&Sn)||L[G]!==1&&(!on&&Sn||on&&rn))&&(te=G==="x"?kn:En)}const Zn={x:U.x+ue.x,y:U.y+ue.y},Ln={x:Q.x+ge.x,y:Q.y+ge.y},Vn=Math.max(Math.abs(Zn.x-te[0].x),Math.abs(Ln.x-te[0].x)),J=Math.max(Math.abs(Zn.y-te[0].y),Math.abs(Ln.y-te[0].y));Vn>=J?(X=(Zn.x+Ln.x)/2,Ee=te[0].y):(X=te[0].x,Ee=(Zn.y+Ln.y)/2)}const Ke={x:U.x+ue.x,y:U.y+ue.y},Xe={x:Q.x+ge.x,y:Q.y+ge.y};return[[d,...Ke.x!==te[0].x||Ke.y!==te[0].y?[Ke]:[],...te,...Xe.x!==te[te.length-1].x||Xe.y!==te[te.length-1].y?[Xe]:[],E],X,Ee,re,je]}function dqn(d,v,E,A){const M=Math.min(lan(d,v)/2,lan(v,E)/2,A),{x:P,y:m}=v;if(d.x===P&&P===E.x||d.y===m&&m===E.y)return`L${P} ${m}`;if(d.y===m){const U=d.x<E.x?-1:1,Q=d.y<E.y?1:-1;return`L ${P+M*U},${m}Q ${P},${m} ${P},${m+M*Q}`}const L=d.x<E.x?1:-1,H=d.y<E.y?-1:1;return`L ${P},${m+M*H}Q ${P},${m} ${P+M*L},${m}`}function y2e({sourceX:d,sourceY:v,sourcePosition:E=Ei.Bottom,targetX:A,targetY:M,targetPosition:P=Ei.Top,borderRadius:m=5,centerX:L,centerY:H,offset:U=20,stepPosition:Q=.5}){const[Y,G,V,te,X]=aqn({source:{x:d,y:v},sourcePosition:E,target:{x:A,y:M},targetPosition:P,center:{x:L,y:H},offset:U,stepPosition:Q});let Ee=`M${Y[0].x} ${Y[0].y}`;for(let ue=1;ue<Y.length-1;ue++)Ee+=dqn(Y[ue-1],Y[ue],Y[ue+1],m);return Ee+=`L${Y[Y.length-1].x} ${Y[Y.length-1].y}`,[Ee,G,V,te,X]}function han(d){var v;return d&&!!(d.internals.handleBounds||(v=d.handles)!=null&&v.length)&&!!(d.measured.width||d.width||d.initialWidth)}function bqn(d){var Y;const{sourceNode:v,targetNode:E}=d;if(!han(v)||!han(E))return null;const A=v.internals.handleBounds||aan(v.handles),M=E.internals.handleBounds||aan(E.handles),P=dan((A==null?void 0:A.source)??[],d.sourceHandle),m=dan(d.connectionMode===qx.Strict?(M==null?void 0:M.target)??[]:((M==null?void 0:M.target)??[]).concat((M==null?void 0:M.source)??[]),d.targetHandle);if(!P||!m)return(Y=d.onError)==null||Y.call(d,"008",c2.error008(P?"target":"source",{id:d.id,sourceHandle:d.sourceHandle,targetHandle:d.targetHandle})),null;const L=(P==null?void 0:P.position)||Ei.Bottom,H=(m==null?void 0:m.position)||Ei.Top,U=dk(v,P,L),Q=dk(E,m,H);return{sourceX:U.x,sourceY:U.y,targetX:Q.x,targetY:Q.y,sourcePosition:L,targetPosition:H}}function aan(d){if(!d)return null;const v=[],E=[];for(const A of d)A.width=A.width??1,A.height=A.height??1,A.type==="source"?v.push(A):A.type==="target"&&E.push(A);return{source:v,target:E}}function dk(d,v,E=Ei.Left,A=!1){const M=((v==null?void 0:v.x)??0)+d.internals.positionAbsolute.x,P=((v==null?void 0:v.y)??0)+d.internals.positionAbsolute.y,{width:m,height:L}=v??o2(d);if(A)return{x:M+m/2,y:P+L/2};switch((v==null?void 0:v.position)??E){case Ei.Top:return{x:M+m/2,y:P};case Ei.Right:return{x:M+m,y:P+L/2};case Ei.Bottom:return{x:M+m/2,y:P+L};case Ei.Left:return{x:M,y:P+L/2}}}function dan(d,v){return d&&(v?d.find(E=>E.id===v):d[0])||null}function k2e(d,v){return d?typeof d=="string"?d:`${v?`${v}__`:""}${Object.keys(d).sort().map(A=>`${A}=${d[A]}`).join("&")}`:""}function wqn(d,{id:v,defaultColor:E,defaultMarkerStart:A,defaultMarkerEnd:M}){const P=new Set;return d.reduce((m,L)=>([L.markerStart||A,L.markerEnd||M].forEach(H=>{if(H&&typeof H=="object"){const U=k2e(H,v);P.has(U)||(m.push({id:U,color:H.color||E,...H}),P.add(U))}}),m),[]).sort((m,L)=>m.id.localeCompare(L.id))}function gqn(d,v,E,A,M){let P=.5;M==="start"?P=0:M==="end"&&(P=1);let m=[(d.x+d.width*P)*v.zoom+v.x,d.y*v.zoom+v.y-A],L=[-100*P,-100];switch(E){case Ei.Right:m=[(d.x+d.width)*v.zoom+v.x+A,(d.y+d.height*P)*v.zoom+v.y],L=[0,-100*P];break;case Ei.Bottom:m[1]=(d.y+d.height)*v.zoom+v.y+A,L[1]=0;break;case Ei.Left:m=[d.x*v.zoom+v.x-A,(d.y+d.height*P)*v.zoom+v.y],L=[-100,-100*P];break}return`translate(${m[0]}px, ${m[1]}px) translate(${L[0]}%, ${L[1]}%)`}const z1n=1e3,pqn=10,B2e={nodeOrigin:[0,0],nodeExtent:PN,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},mqn={...B2e,checkEquality:!0};function J2e(d,v){const E={...d};for(const A in v)v[A]!==void 0&&(E[A]=v[A]);return E}function vqn(d,v,E){const A=J2e(B2e,E);for(const M of d.values())if(M.parentId)H2e(M,d,v,A);else{const P=RN(M,A.nodeOrigin),m=ak(M.extent)?M.extent:A.nodeExtent,L=hk(P,m,o2(M));M.internals.positionAbsolute=L}}function yqn(d,v){if(!d.handles)return d.measured?v==null?void 0:v.internals.handleBounds:void 0;const E=[],A=[];for(const M of d.handles){const P={id:M.id,width:M.width??1,height:M.height??1,nodeId:d.id,x:M.x,y:M.y,position:M.position,type:M.type};M.type==="source"?E.push(P):M.type==="target"&&A.push(P)}return{source:E,target:A}}function G2e(d){return d==="manual"}function E2e(d,v,E,A={}){var Q,Y;const M=J2e(mqn,A),P={i:0},m=new Map(v),L=M!=null&&M.elevateNodesOnSelect&&!G2e(M.zIndexMode)?z1n:0;let H=d.length>0,U=!1;v.clear(),E.clear();for(const G of d){let V=m.get(G.id);if(M.checkEquality&&G===(V==null?void 0:V.internals.userNode))v.set(G.id,V);else{const te=RN(G,M.nodeOrigin),X=ak(G.extent)?G.extent:M.nodeExtent,Ee=hk(te,X,o2(G));V={...M.defaults,...G,measured:{width:(Q=G.measured)==null?void 0:Q.width,height:(Y=G.measured)==null?void 0:Y.height},internals:{positionAbsolute:Ee,handleBounds:yqn(G,V),z:U1n(G,L,M.zIndexMode),userNode:G}},v.set(G.id,V)}(V.measured===void 0||V.measured.width===void 0||V.measured.height===void 0)&&!V.hidden&&(H=!1),G.parentId&&H2e(V,v,E,A,P),U||(U=G.selected??!1)}return{nodesInitialized:H,hasSelectedNodes:U}}function kqn(d,v){if(!d.parentId)return;const E=v.get(d.parentId);E?E.set(d.id,d):v.set(d.parentId,new Map([[d.id,d]]))}function H2e(d,v,E,A,M){const{elevateNodesOnSelect:P,nodeOrigin:m,nodeExtent:L,zIndexMode:H}=J2e(B2e,A),U=d.parentId,Q=v.get(U);if(!Q){console.warn(`Parent node ${U} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}kqn(d,E),M&&!Q.parentId&&Q.internals.rootParentIndex===void 0&&H==="auto"&&(Q.internals.rootParentIndex=++M.i,Q.internals.z=Q.internals.z+M.i*pqn),M&&Q.internals.rootParentIndex!==void 0&&(M.i=Q.internals.rootParentIndex);const Y=P&&!G2e(H)?z1n:0,{x:G,y:V,z:te}=Eqn(d,Q,m,L,Y,H),{positionAbsolute:X}=d.internals,Ee=G!==X.x||V!==X.y;(Ee||te!==d.internals.z)&&v.set(d.id,{...d,internals:{...d.internals,positionAbsolute:Ee?{x:G,y:V}:X,z:te}})}function U1n(d,v,E){const A=t2(d.zIndex)?d.zIndex:0;return G2e(E)?A:A+(d.selected?v:0)}function Eqn(d,v,E,A,M,P){const{x:m,y:L}=v.internals.positionAbsolute,H=o2(d),U=RN(d,E),Q=ak(d.extent)?hk(U,d.extent,H):U;let Y=hk({x:m+Q.x,y:L+Q.y},A,H);d.extent==="parent"&&(Y=O1n(Y,H,v));const G=U1n(d,M,P),V=v.internals.z??0;return{x:Y.x,y:Y.y,z:V>=G?V+1:G}}function q2e(d,v,E,A=[0,0]){var m;const M=[],P=new Map;for(const L of d){const H=v.get(L.parentId);if(!H)continue;const U=((m=P.get(L.parentId))==null?void 0:m.expandedRect)??$N(H),Q=N1n(U,L.rect);P.set(L.parentId,{expandedRect:Q,parent:H})}return P.size>0&&P.forEach(({expandedRect:L,parent:H},U)=>{var re;const Q=H.internals.positionAbsolute,Y=o2(H),G=H.origin??A,V=L.x<Q.x?Math.round(Math.abs(Q.x-L.x)):0,te=L.y<Q.y?Math.round(Math.abs(Q.y-L.y)):0,X=Math.max(Y.width,Math.round(L.width)),Ee=Math.max(Y.height,Math.round(L.height)),ue=(X-Y.width)*G[0],ge=(Ee-Y.height)*G[1];(V>0||te>0||ue||ge)&&(M.push({id:U,type:"position",position:{x:H.position.x-V+ue,y:H.position.y-te+ge}}),(re=E.get(U))==null||re.forEach(je=>{d.some(Ke=>Ke.id===je.id)||M.push({id:je.id,type:"position",position:{x:je.position.x+V,y:je.position.y+te}})})),(Y.width<L.width||Y.height<L.height||V||te)&&M.push({id:U,type:"dimensions",setAttributes:!0,dimensions:{width:X+(V?G[0]*V-ue:0),height:Ee+(te?G[1]*te-ge:0)}})}),M}function jqn(d,v,E,A,M,P,m){const L=A==null?void 0:A.querySelector(".xyflow__viewport");let H=!1;if(!L)return{changes:[],updatedInternals:H};const U=[],Q=window.getComputedStyle(L),{m22:Y}=new window.DOMMatrixReadOnly(Q.transform),G=[];for(const V of d.values()){const te=v.get(V.id);if(!te)continue;if(te.hidden){v.set(te.id,{...te,internals:{...te.internals,handleBounds:void 0}}),H=!0;continue}const X=R2e(V.nodeElement),Ee=te.measured.width!==X.width||te.measured.height!==X.height;if(!!(X.width&&X.height&&(Ee||!te.internals.handleBounds||V.force))){const ge=V.nodeElement.getBoundingClientRect(),re=ak(te.extent)?te.extent:P;let{positionAbsolute:je}=te.internals;if(te.parentId&&te.extent==="parent"){const Xe=v.get(te.parentId);Xe&&(je=O1n(je,X,Xe))}else re&&(je=hk(je,re,X));const Ke={...te,measured:X,internals:{...te.internals,positionAbsolute:je,handleBounds:{source:oan("source",V.nodeElement,ge,Y,te.id),target:oan("target",V.nodeElement,ge,Y,te.id)}}};v.set(te.id,Ke),te.parentId&&H2e(Ke,v,E,{nodeOrigin:M,zIndexMode:m}),H=!0,Ee&&(U.push({id:te.id,type:"dimensions",dimensions:X}),te.expandParent&&te.parentId&&G.push({id:te.id,parentId:te.parentId,rect:$N(Ke,M)}))}}if(G.length>0){const V=q2e(G,v,E,M);U.push(...V)}return{changes:U,updatedInternals:H}}async function xqn({delta:d,panZoom:v,transform:E,translateExtent:A,width:M,height:P}){if(!v||!d.x&&!d.y)return!1;const m=await v.setViewportConstrained({x:E[0]+d.x,y:E[1]+d.y,zoom:E[2]},[[0,0],[M,P]],A);return!!m&&(m.x!==E[0]||m.y!==E[1]||m.k!==E[2])}function ban(d,v,E,A,M,P){let m=M;const L=A.get(m)||new Map;A.set(m,L.set(E,v)),m=`${M}-${d}`;const H=A.get(m)||new Map;if(A.set(m,H.set(E,v)),P){m=`${M}-${d}-${P}`;const U=A.get(m)||new Map;A.set(m,U.set(E,v))}}function X1n(d,v,E){d.clear(),v.clear();for(const A of E){const{source:M,target:P,sourceHandle:m=null,targetHandle:L=null}=A,H={edgeId:A.id,source:M,target:P,sourceHandle:m,targetHandle:L},U=`${M}-${m}--${P}-${L}`,Q=`${P}-${L}--${M}-${m}`;ban("source",H,Q,d,M,m),ban("target",H,U,d,P,L),v.set(A.id,A)}}function K1n(d,v){if(!d.parentId)return!1;const E=v.get(d.parentId);return E?E.selected?!0:K1n(E,v):!1}function wan(d,v,E){var M;let A=d;do{if((M=A==null?void 0:A.matches)!=null&&M.call(A,v))return!0;if(A===E)return!1;A=A==null?void 0:A.parentElement}while(A);return!1}function Aqn(d,v,E,A){const M=new Map;for(const[P,m]of d)if((m.selected||m.id===A)&&(!m.parentId||!K1n(m,d))&&(m.draggable||v&&typeof m.draggable>"u")){const L=d.get(P);L&&M.set(P,{id:P,position:L.position||{x:0,y:0},distance:{x:E.x-L.internals.positionAbsolute.x,y:E.y-L.internals.positionAbsolute.y},extent:L.extent,parentId:L.parentId,origin:L.origin,expandParent:L.expandParent,internals:{positionAbsolute:L.internals.positionAbsolute||{x:0,y:0}},measured:{width:L.measured.width??0,height:L.measured.height??0}})}return M}function c2e({nodeId:d,dragItems:v,nodeLookup:E,dragging:A=!0}){var m,L,H;const M=[];for(const[U,Q]of v){const Y=(m=E.get(U))==null?void 0:m.internals.userNode;Y&&M.push({...Y,position:Q.position,dragging:A})}if(!d)return[M[0],M];const P=(L=E.get(d))==null?void 0:L.internals.userNode;return[P?{...P,position:((H=v.get(d))==null?void 0:H.position)||P.position,dragging:A}:M[0],M]}function Mqn({dragItems:d,snapGrid:v,x:E,y:A}){const M=d.values().next().value;if(!M)return null;const P={x:E-M.distance.x,y:A-M.distance.y},m=BN(P,v);return{x:m.x-P.x,y:m.y-P.y}}function Cqn({onNodeMouseDown:d,getStoreItems:v,onDragStart:E,onDrag:A,onDragStop:M}){let P={x:null,y:null},m=0,L=new Map,H=!1,U={x:0,y:0},Q=null,Y=!1,G=null,V=!1,te=!1,X=null;function Ee({noDragClassName:ge,handleSelector:re,domNode:je,isSelectable:Ke,nodeId:Xe,nodeClickDistance:Ye=0}){G=_0(je);function kn({x:Vn,y:J}){const{nodeLookup:xe,nodeExtent:on,snapGrid:rn,snapToGrid:Sn,nodeOrigin:Fn,onNodeDrag:dn,onSelectionDrag:Gn,onError:Nn,updateNodePositions:qn}=v();P={x:Vn,y:J};let Jt=!1;const Kt=L.size>1,Oi=Kt&&on?v2e(Kx(L)):null,gr=Kt&&Sn?Mqn({dragItems:L,snapGrid:rn,x:Vn,y:J}):null;for(const[Ki,Kn]of L){if(!xe.has(Ki))continue;let ei={x:Vn-Kn.distance.x,y:J-Kn.distance.y};Sn&&(ei=gr?{x:Math.round(ei.x+gr.x),y:Math.round(ei.y+gr.y)}:BN(ei,rn));let rr=null;if(Kt&&on&&!Kn.extent&&Oi){const{positionAbsolute:sr}=Kn.internals,ri=sr.x-Oi.x+on[0][0],bi=sr.x+Kn.measured.width-Oi.x2+on[1][0],Ac=sr.y-Oi.y+on[0][1],ku=sr.y+Kn.measured.height-Oi.y2+on[1][1];rr=[[ri,Ac],[bi,ku]]}const{position:cr,positionAbsolute:Bi}=P1n({nodeId:Ki,nextPosition:ei,nodeLookup:xe,nodeExtent:rr||on,nodeOrigin:Fn,onError:Nn});Jt=Jt||Kn.position.x!==cr.x||Kn.position.y!==cr.y,Kn.position=cr,Kn.internals.positionAbsolute=Bi}if(te=te||Jt,!!Jt&&(qn(L,!0),X&&(A||dn||!Xe&&Gn))){const[Ki,Kn]=c2e({nodeId:Xe,dragItems:L,nodeLookup:xe});A==null||A(X,L,Ki,Kn),dn==null||dn(X,Ki,Kn),Xe||Gn==null||Gn(X,Kn)}}async function En(){if(!Q)return;const{transform:Vn,panBy:J,autoPanSpeed:xe,autoPanOnNodeDrag:on}=v();if(!on){H=!1,cancelAnimationFrame(m);return}const[rn,Sn]=_2e(U,Q,xe);(rn!==0||Sn!==0)&&(P.x=(P.x??0)-rn/Vn[2],P.y=(P.y??0)-Sn/Vn[2],await J({x:rn,y:Sn})&&kn(P)),m=requestAnimationFrame(En)}function Zn(Vn){var Kt;const{nodeLookup:J,multiSelectionActive:xe,nodesDraggable:on,transform:rn,snapGrid:Sn,snapToGrid:Fn,selectNodesOnDrag:dn,onNodeDragStart:Gn,onSelectionDragStart:Nn,unselectNodesAndEdges:qn}=v();Y=!0,(!dn||!Ke)&&!xe&&Xe&&((Kt=J.get(Xe))!=null&&Kt.selected||qn()),Ke&&dn&&Xe&&(d==null||d(Xe));const Jt=AN(Vn.sourceEvent,{transform:rn,snapGrid:Sn,snapToGrid:Fn,containerBounds:Q});if(P=Jt,L=Aqn(J,on,Jt,Xe),L.size>0&&(E||Gn||!Xe&&Nn)){const[Oi,gr]=c2e({nodeId:Xe,dragItems:L,nodeLookup:J});E==null||E(Vn.sourceEvent,L,Oi,gr),Gn==null||Gn(Vn.sourceEvent,Oi,gr),Xe||Nn==null||Nn(Vn.sourceEvent,gr)}}const Ln=h1n().clickDistance(Ye).on("start",Vn=>{const{domNode:J,nodeDragThreshold:xe,transform:on,snapGrid:rn,snapToGrid:Sn}=v();Q=(J==null?void 0:J.getBoundingClientRect())||null,V=!1,te=!1,X=Vn.sourceEvent,xe===0&&Zn(Vn),P=AN(Vn.sourceEvent,{transform:on,snapGrid:rn,snapToGrid:Sn,containerBounds:Q}),U=i2(Vn.sourceEvent,Q)}).on("drag",Vn=>{const{autoPanOnNodeDrag:J,transform:xe,snapGrid:on,snapToGrid:rn,nodeDragThreshold:Sn,nodeLookup:Fn}=v(),dn=AN(Vn.sourceEvent,{transform:xe,snapGrid:on,snapToGrid:rn,containerBounds:Q});if(X=Vn.sourceEvent,(Vn.sourceEvent.type==="touchmove"&&Vn.sourceEvent.touches.length>1||Xe&&!Fn.has(Xe))&&(V=!0),!V){if(!H&&J&&Y&&(H=!0,En()),!Y){const Gn=i2(Vn.sourceEvent,Q),Nn=Gn.x-U.x,qn=Gn.y-U.y;Math.sqrt(Nn*Nn+qn*qn)>Sn&&Zn(Vn)}(P.x!==dn.xSnapped||P.y!==dn.ySnapped)&&L&&Y&&(U=i2(Vn.sourceEvent,Q),kn(dn))}}).on("end",Vn=>{if(!Y||V){V&&L.size>0&&v().updateNodePositions(L,!1);return}if(H=!1,Y=!1,cancelAnimationFrame(m),L.size>0){const{nodeLookup:J,updateNodePositions:xe,onNodeDragStop:on,onSelectionDragStop:rn}=v();if(te&&(xe(L,!1),te=!1),M||on||!Xe&&rn){const[Sn,Fn]=c2e({nodeId:Xe,dragItems:L,nodeLookup:J,dragging:!1});M==null||M(Vn.sourceEvent,L,Sn,Fn),on==null||on(Vn.sourceEvent,Sn,Fn),Xe||rn==null||rn(Vn.sourceEvent,Fn)}}}).filter(Vn=>{const J=Vn.target;return!Vn.button&&(!ge||!wan(J,`.${ge}`,je))&&(!re||wan(J,re,je))});G.call(Ln)}function ue(){G==null||G.on(".drag",null)}return{update:Ee,destroy:ue}}function Tqn(d,v,E){const A=[],M={x:d.x-E,y:d.y-E,width:E*2,height:E*2};for(const P of v.values())xK(M,$N(P))>0&&A.push(P);return A}const Sqn=250;function Iqn(d,v,E,A){var L,H;let M=[],P=1/0;const m=Tqn(d,E,v+Sqn);for(const U of m){const Q=[...((L=U.internals.handleBounds)==null?void 0:L.source)??[],...((H=U.internals.handleBounds)==null?void 0:H.target)??[]];for(const Y of Q){if(A.nodeId===Y.nodeId&&A.type===Y.type&&A.id===Y.id)continue;const{x:G,y:V}=dk(U,Y,Y.position,!0),te=Math.sqrt(Math.pow(G-d.x,2)+Math.pow(V-d.y,2));te>v||(te<P?(M=[{...Y,x:G,y:V}],P=te):te===P&&M.push({...Y,x:G,y:V}))}}if(!M.length)return null;if(M.length>1){const U=A.type==="source"?"target":"source";return M.find(Q=>Q.type===U)??M[0]}return M[0]}function W1n(d,v,E,A,M,P=!1){var U,Q,Y;const m=A.get(d);if(!m)return null;const L=M==="strict"?(U=m.internals.handleBounds)==null?void 0:U[v]:[...((Q=m.internals.handleBounds)==null?void 0:Q.source)??[],...((Y=m.internals.handleBounds)==null?void 0:Y.target)??[]],H=(E?L==null?void 0:L.find(G=>G.id===E):L==null?void 0:L[0])??null;return H&&P?{...H,...dk(m,H,H.position,!0)}:H}function V1n(d,v){return d||(v!=null&&v.classList.contains("target")?"target":v!=null&&v.classList.contains("source")?"source":null)}function Pqn(d,v){let E=null;return v?E=!0:d&&!v&&(E=!1),E}const Q1n=()=>!0;function Oqn(d,{connectionMode:v,connectionRadius:E,handleId:A,nodeId:M,edgeUpdaterType:P,isTarget:m,domNode:L,nodeLookup:H,lib:U,autoPanOnConnect:Q,flowId:Y,panBy:G,cancelConnection:V,onConnectStart:te,onConnect:X,onConnectEnd:Ee,isValidConnection:ue=Q1n,onReconnectEnd:ge,updateConnection:re,getTransform:je,getFromHandle:Ke,autoPanSpeed:Xe,dragThreshold:Ye=1,handleDomNode:kn}){const En=R1n(d.target);let Zn=0,Ln;const{x:Vn,y:J}=i2(d),xe=V1n(P,kn),on=L==null?void 0:L.getBoundingClientRect();let rn=!1;if(!on||!xe)return;const Sn=W1n(M,xe,A,H,v);if(!Sn)return;let Fn=i2(d,on),dn=!1,Gn=null,Nn=!1,qn=null;function Jt(){if(!Q||!on)return;const[cr,Bi]=_2e(Fn,on,Xe);G({x:cr,y:Bi}),Zn=requestAnimationFrame(Jt)}const Kt={...Sn,nodeId:M,type:xe,position:Sn.position},Oi=H.get(M);let Ki={inProgress:!0,isValid:null,from:dk(Oi,Kt,Ei.Left,!0),fromHandle:Kt,fromPosition:Kt.position,fromNode:Oi,to:Fn,toHandle:null,toPosition:ian[Kt.position],toNode:null,pointer:Fn};function Kn(){rn=!0,re(Ki),te==null||te(d,{nodeId:M,handleId:A,handleType:xe})}Ye===0&&Kn();function ei(cr){if(!rn){const{x:ku,y:Pr}=i2(cr),Ca=ku-Vn,zl=Pr-J;if(!(Ca*Ca+zl*zl>Ye*Ye))return;Kn()}if(!Ke()||!Kt){rr(cr);return}const Bi=je();Fn=i2(cr,on),Ln=Iqn(JN(Fn,Bi,!1,[1,1]),E,H,Kt),dn||(Jt(),dn=!0);const sr=Y1n(cr,{handle:Ln,connectionMode:v,fromNodeId:M,fromHandleId:A,fromType:m?"target":"source",isValidConnection:ue,doc:En,lib:U,flowId:Y,nodeLookup:H});qn=sr.handleDomNode,Gn=sr.connection,Nn=Pqn(!!Ln,sr.isValid);const ri=H.get(M),bi=ri?dk(ri,Kt,Ei.Left,!0):Ki.from,Ac={...Ki,from:bi,isValid:Nn,to:sr.toHandle&&Nn?Ux({x:sr.toHandle.x,y:sr.toHandle.y},Bi):Fn,toHandle:sr.toHandle,toPosition:Nn&&sr.toHandle?sr.toHandle.position:ian[Kt.position],toNode:sr.toHandle?H.get(sr.toHandle.nodeId):null,pointer:Fn};re(Ac),Ki=Ac}function rr(cr){if(!("touches"in cr&&cr.touches.length>0)){if(rn){(Ln||qn)&&Gn&&Nn&&(X==null||X(Gn));const{inProgress:Bi,...sr}=Ki,ri={...sr,toPosition:Ki.toHandle?Ki.toPosition:null};Ee==null||Ee(cr,ri),P&&(ge==null||ge(cr,ri))}V(),cancelAnimationFrame(Zn),dn=!1,Nn=!1,Gn=null,qn=null,En.removeEventListener("mousemove",ei),En.removeEventListener("mouseup",rr),En.removeEventListener("touchmove",ei),En.removeEventListener("touchend",rr)}}En.addEventListener("mousemove",ei),En.addEventListener("mouseup",rr),En.addEventListener("touchmove",ei),En.addEventListener("touchend",rr)}function Y1n(d,{handle:v,connectionMode:E,fromNodeId:A,fromHandleId:M,fromType:P,doc:m,lib:L,flowId:H,isValidConnection:U=Q1n,nodeLookup:Q}){const Y=P==="target",G=v?m.querySelector(`.${L}-flow__handle[data-id="${H}-${v==null?void 0:v.nodeId}-${v==null?void 0:v.id}-${v==null?void 0:v.type}"]`):null,{x:V,y:te}=i2(d),X=m.elementFromPoint(V,te),Ee=X!=null&&X.classList.contains(`${L}-flow__handle`)?X:G,ue={handleDomNode:Ee,isValid:!1,connection:null,toHandle:null};if(Ee){const ge=V1n(void 0,Ee),re=Ee.getAttribute("data-nodeid"),je=Ee.getAttribute("data-handleid"),Ke=Ee.classList.contains("connectable"),Xe=Ee.classList.contains("connectableend");if(!re||!ge)return ue;const Ye={source:Y?re:A,sourceHandle:Y?je:M,target:Y?A:re,targetHandle:Y?M:je};ue.connection=Ye;const En=Ke&&Xe&&(E===qx.Strict?Y&&ge==="source"||!Y&&ge==="target":re!==A||je!==M);ue.isValid=En&&U(Ye),ue.toHandle=W1n(re,ge,je,Q,E,!0)}return ue}const j2e={onPointerDown:Oqn,isValid:Y1n};function Nqn({domNode:d,panZoom:v,getTransform:E,getViewScale:A}){const M=_0(d);function P({translateExtent:L,width:H,height:U,zoomStep:Q=1,pannable:Y=!0,zoomable:G=!0,inversePan:V=!1}){const te=re=>{if(re.sourceEvent.type!=="wheel"||!v)return;const je=E(),Ke=re.sourceEvent.ctrlKey&&DN()?10:1,Xe=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*Q,Ye=je[2]*Math.pow(2,Xe*Ke);v.scaleTo(Ye)};let X=[0,0];const Ee=re=>{(re.sourceEvent.type==="mousedown"||re.sourceEvent.type==="touchstart")&&(X=[re.sourceEvent.clientX??re.sourceEvent.touches[0].clientX,re.sourceEvent.clientY??re.sourceEvent.touches[0].clientY])},ue=re=>{const je=E();if(re.sourceEvent.type!=="mousemove"&&re.sourceEvent.type!=="touchmove"||!v)return;const Ke=[re.sourceEvent.clientX??re.sourceEvent.touches[0].clientX,re.sourceEvent.clientY??re.sourceEvent.touches[0].clientY],Xe=[Ke[0]-X[0],Ke[1]-X[1]];X=Ke;const Ye=A()*Math.max(je[2],Math.log(je[2]))*(V?-1:1),kn={x:je[0]-Xe[0]*Ye,y:je[1]-Xe[1]*Ye},En=[[0,0],[H,U]];v.setViewportConstrained({x:kn.x,y:kn.y,zoom:je[2]},En,L)},ge=M1n().on("start",Ee).on("zoom",Y?ue:null).on("zoom.wheel",G?te:null);M.call(ge,{})}function m(){M.on("zoom",null)}return{update:P,destroy:m,pointer:e2}}const $K=d=>({x:d.x,y:d.y,zoom:d.k}),u2e=({x:d,y:v,zoom:E})=>PK.translate(d,v).scale(E),V5=(d,v)=>d.target.closest(`.${v}`),Z1n=(d,v)=>v===2&&Array.isArray(d)&&d.includes(2),$qn=d=>((d*=2)<=1?d*d*d:(d-=2)*d*d+2)/2,o2e=(d,v=0,E=$qn,A=()=>{})=>{const M=typeof v=="number"&&v>0;return M||A(),M?d.transition().duration(v).ease(E).on("end",A):d},edn=d=>{const v=d.ctrlKey&&DN()?10:1;return-d.deltaY*(d.deltaMode===1?.05:d.deltaMode?1:.002)*v};function Dqn({zoomPanValues:d,noWheelClassName:v,d3Selection:E,d3Zoom:A,panOnScrollMode:M,panOnScrollSpeed:P,zoomOnPinch:m,onPanZoomStart:L,onPanZoom:H,onPanZoomEnd:U}){return Q=>{if(V5(Q,v))return Q.ctrlKey&&Q.preventDefault(),!1;Q.preventDefault(),Q.stopImmediatePropagation();const Y=E.property("__zoom").k||1;if(Q.ctrlKey&&m){const Ee=e2(Q),ue=edn(Q),ge=Y*Math.pow(2,ue);A.scaleTo(E,ge,Ee,Q);return}const G=Q.deltaMode===1?20:1;let V=M===sk.Vertical?0:Q.deltaX*G,te=M===sk.Horizontal?0:Q.deltaY*G;!DN()&&Q.shiftKey&&M!==sk.Vertical&&(V=Q.deltaY*G,te=0),A.translateBy(E,-(V/Y)*P,-(te/Y)*P,{internal:!0});const X=$K(E.property("__zoom"));clearTimeout(d.panScrollTimeout),d.isPanScrolling?H==null||H(Q,X):(d.isPanScrolling=!0,L==null||L(Q,X)),d.panScrollTimeout=setTimeout(()=>{U==null||U(Q,X),d.isPanScrolling=!1},150)}}function Lqn({noWheelClassName:d,preventScrolling:v,d3ZoomHandler:E}){return function(A,M){const P=A.type==="wheel",m=!v&&P&&!A.ctrlKey,L=V5(A,d);if(A.ctrlKey&&P&&L&&A.preventDefault(),m||L)return null;A.preventDefault(),E.call(this,A,M)}}function _qn({zoomPanValues:d,onDraggingChange:v,onPanZoomStart:E}){return A=>{var P,m,L;if((P=A.sourceEvent)!=null&&P.internal)return;const M=$K(A.transform);d.mouseButton=((m=A.sourceEvent)==null?void 0:m.button)||0,d.isZoomingOrPanning=!0,d.prevViewport=M,((L=A.sourceEvent)==null?void 0:L.type)==="mousedown"&&v(!0),E&&(E==null||E(A.sourceEvent,M))}}function Fqn({zoomPanValues:d,panOnDrag:v,onPaneContextMenu:E,onTransformChange:A,onPanZoom:M}){return P=>{var m,L;d.usedRightMouseButton=!!(E&&Z1n(v,d.mouseButton??0)),(m=P.sourceEvent)!=null&&m.sync||A([P.transform.x,P.transform.y,P.transform.k]),M&&!((L=P.sourceEvent)!=null&&L.internal)&&(M==null||M(P.sourceEvent,$K(P.transform)))}}function Rqn({zoomPanValues:d,panOnDrag:v,panOnScroll:E,onDraggingChange:A,onPanZoomEnd:M,onPaneContextMenu:P}){return m=>{var L;if(!((L=m.sourceEvent)!=null&&L.internal)&&(d.isZoomingOrPanning=!1,P&&Z1n(v,d.mouseButton??0)&&!d.usedRightMouseButton&&m.sourceEvent&&P(m.sourceEvent),d.usedRightMouseButton=!1,A(!1),M)){const H=$K(m.transform);d.prevViewport=H,clearTimeout(d.timerId),d.timerId=setTimeout(()=>{M==null||M(m.sourceEvent,H)},E?150:0)}}}function Bqn({panActivationKeyPressed:d,zoomActivationKeyPressed:v,zoomOnScroll:E,zoomOnPinch:A,panOnDrag:M,panOnScroll:P,zoomOnDoubleClick:m,userSelectionActive:L,noWheelClassName:H,noPanClassName:U,lib:Q,connectionInProgress:Y}){return G=>{var ue;const V=v||E,te=A&&G.ctrlKey,X=G.type==="wheel";if(G.button===1&&G.type==="mousedown"&&(V5(G,`${Q}-flow__node`)||V5(G,`${Q}-flow__edge`)||V5(G,`${Q}-flow__selection`)||V5(G,`${Q}-flow__nodesselection`)))return!0;if(!M&&!V&&!P&&!m&&!A||L||Y&&!X||V5(G,H)&&X||V5(G,U)&&(!X||P&&X&&!v)||!A&&G.ctrlKey&&X)return!1;if(!A&&G.type==="touchstart"&&((ue=G.touches)==null?void 0:ue.length)>1)return G.preventDefault(),!1;if(!V&&!P&&!te&&X||!M&&(G.type==="mousedown"||G.type==="touchstart")||Array.isArray(M)&&!M.includes(G.button)&&G.type==="mousedown")return!1;const Ee=Array.isArray(M)&&M.includes(G.button)||!G.button||G.button<=1;return(!G.ctrlKey||X||d)&&Ee}}function Jqn({domNode:d,minZoom:v,maxZoom:E,translateExtent:A,viewport:M,onPanZoom:P,onPanZoomStart:m,onPanZoomEnd:L,onDraggingChange:H}){const U={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},Q=d.getBoundingClientRect();let Y=[[0,0],[Q.width,Q.height]];const G=typeof ResizeObserver<"u"?new ResizeObserver(J=>{const xe=J[0];xe&&(Y=[[0,0],[xe.contentRect.width,xe.contentRect.height]])}):null;G==null||G.observe(d);const V=M1n().extent(()=>Y).scaleExtent([v,E]).translateExtent(A),te=_0(d).call(V);je({x:M.x,y:M.y,zoom:zx(M.zoom,v,E)},[[0,0],[Q.width,Q.height]],A);const X=te.on("wheel.zoom"),Ee=te.on("dblclick.zoom");V.wheelDelta(edn);async function ue(J,xe){return te?new Promise(on=>{V==null||V.interpolate((xe==null?void 0:xe.interpolate)==="linear"?xN:fK).transform(o2e(te,xe==null?void 0:xe.duration,xe==null?void 0:xe.ease,()=>on(!0)),J)}):!1}function ge({noWheelClassName:J,noPanClassName:xe,onPaneContextMenu:on,userSelectionActive:rn,panOnScroll:Sn,panOnDrag:Fn,panOnScrollMode:dn,panOnScrollSpeed:Gn,preventScrolling:Nn,zoomOnPinch:qn,zoomOnScroll:Jt,zoomOnDoubleClick:Kt,panActivationKeyPressed:Oi=!1,zoomActivationKeyPressed:gr,lib:Ki,onTransformChange:Kn,connectionInProgress:ei,paneClickDistance:rr,selectionOnDrag:cr}){rn&&!U.isZoomingOrPanning&&re();const Bi=Sn&&!gr&&!rn;V.clickDistance(cr?1/0:!t2(rr)||rr<0?0:rr);const sr=Bi?Dqn({zoomPanValues:U,noWheelClassName:J,d3Selection:te,d3Zoom:V,panOnScrollMode:dn,panOnScrollSpeed:Gn,zoomOnPinch:qn,onPanZoomStart:m,onPanZoom:P,onPanZoomEnd:L}):Lqn({noWheelClassName:J,preventScrolling:Nn,d3ZoomHandler:X});te.on("wheel.zoom",sr,{passive:!1});const ri=_qn({zoomPanValues:U,onDraggingChange:H,onPanZoomStart:m});V.on("start",ri);const bi=Fqn({zoomPanValues:U,panOnDrag:Fn,onPaneContextMenu:!!on,onPanZoom:P,onTransformChange:Kn});V.on("zoom",bi);const Ac=Rqn({zoomPanValues:U,panOnDrag:Fn,panOnScroll:Sn,onPaneContextMenu:on,onPanZoomEnd:L,onDraggingChange:H});V.on("end",Ac);const ku=Bqn({panActivationKeyPressed:Oi,zoomActivationKeyPressed:gr,panOnDrag:Fn,zoomOnScroll:Jt,panOnScroll:Sn,zoomOnDoubleClick:Kt,zoomOnPinch:qn,userSelectionActive:rn,noPanClassName:xe,noWheelClassName:J,lib:Ki,connectionInProgress:ei});V.filter(ku),Kt?te.on("dblclick.zoom",Ee):te.on("dblclick.zoom",null)}function re(){V.on("zoom",null)}async function je(J,xe,on){const rn=u2e(J),Sn=V==null?void 0:V.constrain()(rn,xe,on);return Sn&&await ue(Sn),Sn}async function Ke(J,xe){const on=u2e(J);return await ue(on,xe),on}function Xe(J){if(te){const xe=u2e(J),on=te.property("__zoom");(on.k!==J.zoom||on.x!==J.x||on.y!==J.y)&&(V==null||V.transform(te,xe,null,{sync:!0}))}}function Ye(){const J=te?A1n(te.node()):{x:0,y:0,k:1};return{x:J.x,y:J.y,zoom:J.k}}async function kn(J,xe){return te?new Promise(on=>{V==null||V.interpolate((xe==null?void 0:xe.interpolate)==="linear"?xN:fK).scaleTo(o2e(te,xe==null?void 0:xe.duration,xe==null?void 0:xe.ease,()=>on(!0)),J)}):!1}async function En(J,xe){return te?new Promise(on=>{V==null||V.interpolate((xe==null?void 0:xe.interpolate)==="linear"?xN:fK).scaleBy(o2e(te,xe==null?void 0:xe.duration,xe==null?void 0:xe.ease,()=>on(!0)),J)}):!1}function Zn(J){V==null||V.scaleExtent(J)}function Ln(J){V==null||V.translateExtent(J)}function Vn(J){const xe=!t2(J)||J<0?0:J;V==null||V.clickDistance(xe)}return{update:ge,destroy:re,setViewport:Ke,setViewportConstrained:je,getViewport:Ye,scaleTo:kn,scaleBy:En,setScaleExtent:Zn,setTranslateExtent:Ln,syncViewport:Xe,setClickDistance:Vn}}var Xx;(function(d){d.Line="line",d.Handle="handle"})(Xx||(Xx={}));function Gqn({width:d,prevWidth:v,height:E,prevHeight:A,affectsX:M,affectsY:P}){const m=d-v,L=E-A,H=[m>0?1:m<0?-1:0,L>0?1:L<0?-1:0];return m&&M&&(H[0]=H[0]*-1),L&&P&&(H[1]=H[1]*-1),H}function gan(d){const v=d.includes("right")||d.includes("left"),E=d.includes("bottom")||d.includes("top"),A=d.includes("left"),M=d.includes("top");return{isHorizontal:v,isVertical:E,affectsX:A,affectsY:M}}function K5(d,v){return Math.max(0,v-d)}function W5(d,v){return Math.max(0,d-v)}function iK(d,v,E){return Math.max(0,v-d,d-E)}function pan(d,v){return d?!v:v}function Hqn(d,v,E,A,M,P,m,L){let{affectsX:H,affectsY:U}=v;const{isHorizontal:Q,isVertical:Y}=v,G=Q&&Y,{xSnapped:V,ySnapped:te}=E,{minWidth:X,maxWidth:Ee,minHeight:ue,maxHeight:ge}=A,{x:re,y:je,width:Ke,height:Xe,aspectRatio:Ye}=d;let kn=Math.floor(Q?V-d.pointerX:0),En=Math.floor(Y?te-d.pointerY:0);const Zn=Ke+(H?-kn:kn),Ln=Xe+(U?-En:En),Vn=-P[0]*Ke,J=-P[1]*Xe;let xe=iK(Zn,X,Ee),on=iK(Ln,ue,ge);if(m){let Fn=0,dn=0;H&&kn<0?Fn=K5(re+kn+Vn,m[0][0]):!H&&kn>0&&(Fn=W5(re+Zn+Vn,m[1][0])),U&&En<0?dn=K5(je+En+J,m[0][1]):!U&&En>0&&(dn=W5(je+Ln+J,m[1][1])),xe=Math.max(xe,Fn),on=Math.max(on,dn)}if(L){let Fn=0,dn=0;H&&kn>0?Fn=W5(re+kn,L[0][0]):!H&&kn<0&&(Fn=K5(re+Zn,L[1][0])),U&&En>0?dn=W5(je+En,L[0][1]):!U&&En<0&&(dn=K5(je+Ln,L[1][1])),xe=Math.max(xe,Fn),on=Math.max(on,dn)}if(M){if(Q){const Fn=iK(Zn/Ye,ue,ge)*Ye;if(xe=Math.max(xe,Fn),m){let dn=0;!H&&!U||H&&!U&&G?dn=W5(je+J+Zn/Ye,m[1][1])*Ye:dn=K5(je+J+(H?kn:-kn)/Ye,m[0][1])*Ye,xe=Math.max(xe,dn)}if(L){let dn=0;!H&&!U||H&&!U&&G?dn=K5(je+Zn/Ye,L[1][1])*Ye:dn=W5(je+(H?kn:-kn)/Ye,L[0][1])*Ye,xe=Math.max(xe,dn)}}if(Y){const Fn=iK(Ln*Ye,X,Ee)/Ye;if(on=Math.max(on,Fn),m){let dn=0;!H&&!U||U&&!H&&G?dn=W5(re+Ln*Ye+Vn,m[1][0])/Ye:dn=K5(re+(U?En:-En)*Ye+Vn,m[0][0])/Ye,on=Math.max(on,dn)}if(L){let dn=0;!H&&!U||U&&!H&&G?dn=K5(re+Ln*Ye,L[1][0])/Ye:dn=W5(re+(U?En:-En)*Ye,L[0][0])/Ye,on=Math.max(on,dn)}}}En=En+(En<0?on:-on),kn=kn+(kn<0?xe:-xe),M&&(G?Zn>Ln*Ye?En=(pan(H,U)?-kn:kn)/Ye:kn=(pan(H,U)?-En:En)*Ye:Q?(En=kn/Ye,U=H):(kn=En*Ye,H=U));const rn=H?re+kn:re,Sn=U?je+En:je;return{width:Ke+(H?-kn:kn),height:Xe+(U?-En:En),x:P[0]*kn*(H?-1:1)+rn,y:P[1]*En*(U?-1:1)+Sn}}const ndn={width:0,height:0,x:0,y:0},qqn={...ndn,pointerX:0,pointerY:0,aspectRatio:1};function zqn(d,v,E){const A=v.position.x+d.position.x,M=v.position.y+d.position.y,P=d.measured.width??0,m=d.measured.height??0,L=E[0]*P,H=E[1]*m;return[[A-L,M-H],[A+P-L,M+m-H]]}function Uqn({domNode:d,nodeId:v,getStoreItems:E,onChange:A,onEnd:M}){const P=_0(d);let m={controlDirection:gan("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function L({controlPosition:U,boundaries:Q,keepAspectRatio:Y,resizeDirection:G,onResizeStart:V,onResize:te,onResizeEnd:X,shouldResize:Ee}){let ue={...ndn},ge={...qqn};m={boundaries:Q,resizeDirection:G,keepAspectRatio:Y,controlDirection:gan(U)};let re,je=null,Ke=[],Xe,Ye,kn;const En=h1n().on("start",Zn=>{const{nodeLookup:Ln,transform:Vn,snapGrid:J,snapToGrid:xe,nodeOrigin:on,paneDomNode:rn}=E();if(re=Ln.get(v),!re)return;je=(rn==null?void 0:rn.getBoundingClientRect())??null;const{xSnapped:Sn,ySnapped:Fn}=AN(Zn.sourceEvent,{transform:Vn,snapGrid:J,snapToGrid:xe,containerBounds:je});ue={width:re.measured.width??0,height:re.measured.height??0,x:re.position.x??0,y:re.position.y??0},ge={...ue,pointerX:Sn,pointerY:Fn,aspectRatio:ue.width/ue.height},Xe=void 0,Ye=ak(re.extent)?re.extent:void 0,re.parentId&&(re.extent==="parent"||re.expandParent)&&(Xe=Ln.get(re.parentId)),Xe&&re.extent==="parent"&&(Ye=[[0,0],[Xe.measured.width,Xe.measured.height]]),Ke=[],kn=void 0;for(const[dn,Gn]of Ln)if(Gn.parentId===v&&(Ke.push({id:dn,position:{...Gn.position},extent:Gn.extent}),Gn.extent==="parent"||Gn.expandParent)){const Nn=zqn(Gn,re,Gn.origin??on);kn?kn=[[Math.min(Nn[0][0],kn[0][0]),Math.min(Nn[0][1],kn[0][1])],[Math.max(Nn[1][0],kn[1][0]),Math.max(Nn[1][1],kn[1][1])]]:kn=Nn}V==null||V(Zn,{...ue})}).on("drag",Zn=>{const{transform:Ln,snapGrid:Vn,snapToGrid:J,nodeOrigin:xe}=E(),on=AN(Zn.sourceEvent,{transform:Ln,snapGrid:Vn,snapToGrid:J,containerBounds:je}),rn=[];if(!re)return;const{x:Sn,y:Fn,width:dn,height:Gn}=ue,Nn={},qn=re.origin??xe,{width:Jt,height:Kt,x:Oi,y:gr}=Hqn(ge,m.controlDirection,on,m.boundaries,m.keepAspectRatio,qn,Ye,kn),Ki=Jt!==dn,Kn=Kt!==Gn,ei=Oi!==Sn&&Ki,rr=gr!==Fn&&Kn;if(!ei&&!rr&&!Ki&&!Kn)return;const cr={prevValues:{...ue},startX:ge.x,startY:ge.y,childNodes:Ke.map(bi=>({...bi,position:{...bi.position}}))};if((ei||rr||qn[0]===1||qn[1]===1)&&(Nn.x=ei?Oi:ue.x,Nn.y=rr?gr:ue.y,ue.x=Nn.x,ue.y=Nn.y,Ke.length>0)){const bi=Oi-Sn,Ac=gr-Fn;for(const ku of Ke)ku.position={x:ku.position.x-bi+qn[0]*(Jt-dn),y:ku.position.y-Ac+qn[1]*(Kt-Gn)},rn.push(ku)}if((Ki||Kn)&&(Nn.width=Ki&&(!m.resizeDirection||m.resizeDirection==="horizontal")?Jt:ue.width,Nn.height=Kn&&(!m.resizeDirection||m.resizeDirection==="vertical")?Kt:ue.height,ue.width=Nn.width,ue.height=Nn.height),Xe&&re.expandParent){const bi=qn[0]*(Nn.width??0);Nn.x&&Nn.x<bi&&(ue.x=bi,ge.x=ge.x-(Nn.x-bi));const Ac=qn[1]*(Nn.height??0);Nn.y&&Nn.y<Ac&&(ue.y=Ac,ge.y=ge.y-(Nn.y-Ac))}const Bi=Gqn({width:ue.width,prevWidth:dn,height:ue.height,prevHeight:Gn,affectsX:m.controlDirection.affectsX,affectsY:m.controlDirection.affectsY}),sr={...ue,direction:Bi};if((Ee==null?void 0:Ee(Zn,sr))===!1){ue=cr.prevValues,ge.x=cr.startX,ge.y=cr.startY,Ke.forEach((bi,Ac)=>{bi.position=cr.childNodes[Ac].position});return}te==null||te(Zn,sr),A(Nn,rn)}).on("end",Zn=>{X==null||X(Zn,{...ue}),M==null||M({...ue})});P.call(En)}function H(){P.on(".drag",null)}return{update:L,destroy:H}}const Xqn={},man=d=>{let v;const E=new Set,A=(Q,Y)=>{const G=typeof Q=="function"?Q(v):Q;if(!Object.is(G,v)){const V=v;v=Y??(typeof G!="object"||G===null)?G:Object.assign({},v,G),E.forEach(te=>te(v,V))}},M=()=>v,H={setState:A,getState:M,getInitialState:()=>U,subscribe:Q=>(E.add(Q),()=>E.delete(Q)),destroy:()=>{(Xqn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),E.clear()}},U=v=d(A,M,H);return H},Kqn=d=>d?man(d):man,{useDebugValue:Wqn}=PRn,{useSyncExternalStoreWithSelector:Vqn}=IRn,Qqn=d=>d;function tdn(d,v=Qqn,E){const A=Vqn(d.subscribe,d.getState,d.getServerState||d.getInitialState,v,E);return Wqn(A),A}const van=(d,v)=>{const E=Kqn(d),A=(M,P=v)=>tdn(E,M,P);return Object.assign(A,E),A},Yqn=(d,v)=>d?van(d,v):van;function Ts(d,v){if(Object.is(d,v))return!0;if(typeof d!="object"||d===null||typeof v!="object"||v===null)return!1;if(d instanceof Map&&v instanceof Map){if(d.size!==v.size)return!1;for(const[A,M]of d)if(!Object.is(M,v.get(A)))return!1;return!0}if(d instanceof Set&&v instanceof Set){if(d.size!==v.size)return!1;for(const A of d)if(!v.has(A))return!1;return!0}const E=Object.keys(d);if(E.length!==Object.keys(v).length)return!1;for(const A of E)if(!Object.prototype.hasOwnProperty.call(v,A)||!Object.is(d[A],v[A]))return!1;return!0}const DK=sn.createContext(null),Zqn=DK.Provider,idn=c2.error001("react");function Sc(d,v){const E=sn.useContext(DK);if(E===null)throw new Error(idn);return tdn(E,d,v)}function os(){const d=sn.useContext(DK);if(d===null)throw new Error(idn);return sn.useMemo(()=>({getState:d.getState,setState:d.setState,subscribe:d.subscribe}),[d])}const yan={display:"none"},ezn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rdn="react-flow__node-desc",cdn="react-flow__edge-desc",nzn="react-flow__aria-live",tzn=d=>d.ariaLiveMessage,izn=d=>d.ariaLabelConfig;function rzn({rfId:d}){const v=Sc(tzn);return de.jsx("div",{id:`${nzn}-${d}`,"aria-live":"assertive","aria-atomic":"true",style:ezn,children:v})}function czn({rfId:d,disableKeyboardA11y:v}){const E=Sc(izn);return de.jsxs(de.Fragment,{children:[de.jsx("div",{id:`${rdn}-${d}`,style:yan,children:v?E["node.a11yDescription.default"]:E["node.a11yDescription.keyboardDisabled"]}),de.jsx("div",{id:`${cdn}-${d}`,style:yan,children:E["edge.a11yDescription.default"]}),!v&&de.jsx(rzn,{rfId:d})]})}const HN=sn.forwardRef(({position:d="top-left",children:v,className:E,style:A,...M},P)=>{const m=`${d}`.split("-");return de.jsx("div",{className:Kf(["react-flow__panel",E,...m]),style:A,ref:P,...M,children:v})});HN.displayName="Panel";const kan="https://reactflow.dev?utm_source=attribution";function uzn({proOptions:d,position:v="bottom-right"}){return sn.useEffect(()=>{},[]),d!=null&&d.hideAttribution?null:de.jsx(HN,{position:v,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kan}`,children:de.jsx("a",{href:kan,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ozn=d=>{const v=[],E=[];for(const[,A]of d.nodeLookup)A.selected&&v.push(A.internals.userNode);for(const[,A]of d.edgeLookup)A.selected&&E.push(A);return{selectedNodes:v,selectedEdges:E}},rK=d=>d.id;function szn(d,v){return Ts(d.selectedNodes.map(rK),v.selectedNodes.map(rK))&&Ts(d.selectedEdges.map(rK),v.selectedEdges.map(rK))}function fzn({onSelectionChange:d}){const v=os(),{selectedNodes:E,selectedEdges:A}=Sc(ozn,szn);return sn.useEffect(()=>{const M={nodes:E,edges:A};d==null||d(M),v.getState().onSelectionChangeHandlers.forEach(P=>P(M))},[E,A,d]),null}const lzn=d=>!!d.onSelectionChangeHandlers;function hzn({onSelectionChange:d}){const v=Sc(lzn);return d||v?de.jsx(fzn,{onSelectionChange:d}):null}const udn=[0,0],azn={x:0,y:0,zoom:1},dzn=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ean=[...dzn,"rfId"],bzn=d=>({setNodes:d.setNodes,setEdges:d.setEdges,setMinZoom:d.setMinZoom,setMaxZoom:d.setMaxZoom,setTranslateExtent:d.setTranslateExtent,setNodeExtent:d.setNodeExtent,reset:d.reset,setDefaultNodesAndEdges:d.setDefaultNodesAndEdges}),jan={translateExtent:PN,nodeOrigin:udn,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wzn(d){const{setNodes:v,setEdges:E,setMinZoom:A,setMaxZoom:M,setTranslateExtent:P,setNodeExtent:m,reset:L,setDefaultNodesAndEdges:H}=Sc(bzn,Ts),U=os();sn.useEffect(()=>(H(d.defaultNodes,d.defaultEdges),()=>{Q.current=jan,L()}),[]);const Q=sn.useRef(jan);return sn.useEffect(()=>{for(const Y of Ean){const G=d[Y],V=Q.current[Y];G!==V&&(typeof d[Y]>"u"||(Y==="nodes"?v(G):Y==="edges"?E(G):Y==="minZoom"?A(G):Y==="maxZoom"?M(G):Y==="translateExtent"?P(G):Y==="nodeExtent"?m(G):Y==="ariaLabelConfig"?U.setState({ariaLabelConfig:rqn(G)}):Y==="fitView"?U.setState({fitViewQueued:G}):Y==="fitViewOptions"?U.setState({fitViewOptions:G}):U.setState({[Y]:G})))}Q.current=d},Ean.map(Y=>d[Y])),null}function xan(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function gzn(d){var A;const[v,E]=sn.useState(d==="system"?null:d);return sn.useEffect(()=>{if(d!=="system"){E(d);return}const M=xan(),P=()=>E(M!=null&&M.matches?"dark":"light");return P(),M==null||M.addEventListener("change",P),()=>{M==null||M.removeEventListener("change",P)}},[d]),v!==null?v:(A=xan())!=null&&A.matches?"dark":"light"}const Aan=typeof document<"u"?document:null;function LN(d=null,v={target:Aan,actInsideInputWithModifier:!0}){const[E,A]=sn.useState(!1),M=sn.useRef(!1),P=sn.useRef(new Set([])),[m,L]=sn.useMemo(()=>{if(d!==null){const U=(Array.isArray(d)?d:[d]).filter(Y=>typeof Y=="string").map(Y=>Y.replace(/\+/g,`
2
2
  `).replace(`
3
3
 
4
4
  `,`