@runfusion/fusion 0.43.1 → 0.45.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.
- package/README.md +2 -1
- package/dist/automation-store-EKXXEE2S.js +10 -0
- package/dist/automation-store-PLNG3X72.js +10 -0
- package/dist/automation-store-RDDYZFUJ.js +10 -0
- package/dist/bin.js +14420 -3360
- package/dist/chunk-2JI3F6MG.js +948 -0
- package/dist/chunk-4L6CLWJC.js +8345 -0
- package/dist/chunk-4VNS5WPM.js +42 -0
- package/dist/chunk-5RGECGQL.js +1139 -0
- package/dist/chunk-6JDLN7IL.js +409 -0
- package/dist/chunk-AICJATVW.js +948 -0
- package/dist/chunk-AWKNRUOR.js +1148 -0
- package/dist/chunk-BHM3UYWS.js +4651 -0
- package/dist/chunk-BMUXDSBF.js +4647 -0
- package/dist/chunk-GETECT6V.js +353 -0
- package/dist/chunk-GUV4QQT3.js +1143 -0
- package/dist/chunk-JKQO7YYZ.js +8369 -0
- package/dist/chunk-LYZVU6UV.js +409 -0
- package/dist/chunk-MAN4WYHO.js +353 -0
- package/dist/chunk-MCUG2Z7M.js +4651 -0
- package/dist/chunk-PSDYB45U.js +948 -0
- package/dist/chunk-RR2HM46R.js +8345 -0
- package/dist/chunk-RXMQ5OMY.js +9226 -0
- package/dist/chunk-S2EVJUY3.js +353 -0
- package/dist/chunk-UXR5XZFZ.js +409 -0
- package/dist/client/.vite/manifest.json +1138 -340
- package/dist/client/assets/AgentDetailView-CgbB51Iw.css +1 -0
- package/dist/client/assets/AgentDetailView-DJTi6hKC.js +18 -0
- package/dist/client/assets/{AgentPermissionPolicyEditor-BiY1a4KR.js → AgentPermissionPolicyEditor-C5DR9dUS.js} +2 -2
- package/dist/client/assets/AgentsView-BNd90PSx.js +29 -0
- package/dist/client/assets/AgentsView-CzMa5Olf.css +1 -0
- package/dist/client/assets/ChatView-B7JaZCL_.js +19 -0
- package/dist/client/assets/ChatView-BtjkE0V7.css +1 -0
- package/dist/client/assets/CommandCenter-CHO21xEW.js +74 -0
- package/dist/client/assets/CommandCenter-Xs5Ftv8s.css +1 -0
- package/dist/client/assets/DevServerView-B_p91Mj_.css +1 -0
- package/dist/client/assets/DevServerView-H9OkT1ld.js +1 -0
- package/dist/client/assets/{DirectoryPicker-DTKtd8L2.css → DirectoryPicker-0rspvcMz.css} +1 -1
- package/dist/client/assets/DirectoryPicker-DegxT8ia.js +1 -0
- package/dist/client/assets/DocumentsView-kVVQYISc.js +1 -0
- package/dist/client/assets/EvalsView-C9-iTSat.js +1 -0
- package/dist/client/assets/EvalsView-CTbgPUne.css +1 -0
- package/dist/client/assets/ExperimentalAgentOnboardingModal-3ZEFv8sr.css +1 -0
- package/dist/client/assets/ExperimentalAgentOnboardingModal-DjP_xNkc.js +1 -0
- package/dist/client/assets/GoalsView-CUh8JBnJ.css +1 -0
- package/dist/client/assets/GoalsView-VoIHJJ5l.js +2 -0
- package/dist/client/assets/InsightsView-BIZaUcpd.js +11 -0
- package/dist/client/assets/InsightsView-C7yRTMPn.css +1 -0
- package/dist/client/assets/MemoryView-7v7rv6ns.js +2 -0
- package/dist/client/assets/MemoryView-CBDUr2Jy.css +1 -0
- package/dist/client/assets/PiExtensionsManager-CB89rV4U.js +11 -0
- package/dist/client/assets/PluginManager-BNSuW_R4.js +1 -0
- package/dist/client/assets/PluginManager-DSiHizRD.css +1 -0
- package/dist/client/assets/PullRequestView-CI5jdKBL.js +6 -0
- package/dist/client/assets/PullRequestView-CpdE3Yo_.css +1 -0
- package/dist/client/assets/ResearchView-BT5dR_m8.js +1 -0
- package/dist/client/assets/ResearchView-DIVNQF4_.css +1 -0
- package/dist/client/assets/SecretsView-CvFioX7R.css +1 -0
- package/dist/client/assets/SecretsView-WPYI58Uo.js +1 -0
- package/dist/client/assets/SessionTerminal-C6gyOWLt.js +2 -0
- package/dist/client/assets/SessionTerminal-D4R3ScvQ.css +1 -0
- package/dist/client/assets/SettingsModal-BESN59Ao.css +1 -0
- package/dist/client/assets/SettingsModal-BZokaNyx.css +1 -0
- package/dist/client/assets/SettingsModal-Bq_3AbaB.js +1 -0
- package/dist/client/assets/SettingsModal-JHACoQJe.js +21 -0
- package/dist/client/assets/SetupWizardModal-CrgbnR_d.js +2 -0
- package/dist/client/assets/ShadcnColorPicker-1icHuwhC.js +11 -0
- package/dist/client/assets/ShadcnColorPicker-pqVWCC5-.css +1 -0
- package/dist/client/assets/SkillsView-CJ8snrma.css +1 -0
- package/dist/client/assets/SkillsView-byuSe3e0.js +1 -0
- package/dist/client/assets/TodoView-CIsL_uvQ.css +1 -0
- package/dist/client/assets/TodoView-CQ9GjYBg.js +6 -0
- package/dist/client/assets/WorkflowNodeEditor-DW7sJZUX.js +8 -0
- package/dist/client/assets/WorkflowNodeEditor-f_XPV5Jd.css +1 -0
- package/dist/client/assets/{addon-fit-B4jkcKk4.js → addon-fit-C1WQXRvu.js} +1 -1
- package/dist/client/assets/{addon-unicode11-Cdne2Sj4.js → addon-unicode11-BVmNDUBM.js} +1 -1
- package/dist/client/assets/{addon-web-links-CRNLzj7m.js → addon-web-links-CkVew5xs.js} +1 -1
- package/dist/client/assets/{addon-webgl-CeCSULF1.js → addon-webgl-uLc0RKcC.js} +1 -1
- package/dist/client/assets/agentSkills-CeytXLHF.js +1 -0
- package/dist/client/assets/agentSkills-bQJ4X1gH.css +1 -0
- package/dist/client/assets/agentsOrgChartLayout-BMvyuaLA.js +1 -0
- package/dist/client/assets/app-3wbZ08YC.js +13 -0
- package/dist/client/assets/app-7-5DWLtg.js +13 -0
- package/dist/client/assets/app-CSvE5Noc.js +13 -0
- package/dist/client/assets/app-CZ2LTFce.js +13 -0
- package/dist/client/assets/app-Cv9xEnll.js +13 -0
- package/dist/client/assets/app-x_yPcO5Y.js +13 -0
- package/dist/client/assets/arc-cxkkNsnK.js +1 -0
- package/dist/client/assets/architectureDiagram-3BPJPVTR-BRI0QwDf.js +36 -0
- package/dist/client/assets/band-CquvqAHh.js +1 -0
- package/dist/client/assets/blockDiagram-GPEHLZMM-BXkN8Hv_.js +132 -0
- package/dist/client/assets/c4Diagram-AAUBKEIU-C_Kcokep.js +10 -0
- package/dist/client/assets/channel-Clzpzu32.js +1 -0
- package/dist/client/assets/chunk-2J33WTMH-BGeuCz9C.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-DcVdctr0.js +1 -0
- package/dist/client/assets/chunk-55IACEB6-Dg6gDigQ.js +1 -0
- package/dist/client/assets/chunk-727SXJPM-B9B-vlEb.js +206 -0
- package/dist/client/assets/chunk-AQP2D5EJ-LrWQ-2yi.js +231 -0
- package/dist/client/assets/chunk-FMBD7UC4-Bnd6hAED.js +15 -0
- package/dist/client/assets/chunk-ND2GUHAM-nAw93UB5.js +1 -0
- package/dist/client/assets/chunk-QZHKN3VN-CgprKcZo.js +1 -0
- package/dist/client/assets/classDiagram-4FO5ZUOK-CzYHP-af.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CzYHP-af.js +1 -0
- package/dist/client/assets/common-BDp2y6CF.js +1 -0
- package/dist/client/assets/common-BnEo5fLN.js +1 -0
- package/dist/client/assets/common-Bzr_Y8h4.js +1 -0
- package/dist/client/assets/common-CvwyFzfv.js +1 -0
- package/dist/client/assets/common-CztCXRkz.js +1 -0
- package/dist/client/assets/common-DPe2mbb7.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-Bhn0g_iK.js +1 -0
- package/dist/client/assets/cytoscape.esm-OyMbaexL.js +331 -0
- package/dist/client/assets/dagre-BM42HDAG-CP4kfwqd.js +4 -0
- package/dist/client/assets/{dashboard-view-C3SsjXo1.js → dashboard-view-CM6Xin_H.js} +1680 -1620
- package/dist/client/assets/dashboard-view-DV1nEhh9.js +1 -0
- package/dist/client/assets/dashboard-view-D_zsA-kz.css +1 -0
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/client/assets/diagram-2AECGRRQ-DPhzVEUf.js +43 -0
- package/dist/client/assets/diagram-5GNKFQAL-8QOC3K_L.js +10 -0
- package/dist/client/assets/diagram-KO2AKTUF-C1twgEch.js +3 -0
- package/dist/client/assets/diagram-LMA3HP47-3bEegSuf.js +24 -0
- package/dist/client/assets/diagram-OG6HWLK6-BJ_x0rm6.js +24 -0
- package/dist/client/assets/erDiagram-TEJ5UH35-DNiiS5q6.js +85 -0
- package/dist/client/assets/flowDiagram-I6XJVG4X-DoouPklt.js +162 -0
- package/dist/client/assets/{folder-open-Bw1mxVfa.js → folder-open-CuUs2W7f.js} +1 -1
- package/dist/client/assets/ganttDiagram-6RSMTGT7-BrR6VnP5.js +292 -0
- package/dist/client/assets/gitGraphDiagram-PVQCEYII-BV8_J6Ee.js +106 -0
- package/dist/client/assets/graph--OzhPTMs.js +1 -0
- package/dist/client/assets/index-BZBQ_KsL.css +1 -0
- package/dist/client/assets/index-CZcWjLAb.js +1459 -0
- package/dist/client/assets/infoDiagram-5YYISTIA-DGwIIFkR.js +2 -0
- package/dist/client/assets/init-Dmth1JHB.js +1 -0
- package/dist/client/assets/ishikawaDiagram-YF4QCWOH-D5dEH4RE.js +70 -0
- package/dist/client/assets/journeyDiagram-JHISSGLW-BuuSWPw5.js +139 -0
- package/dist/client/assets/kanban-definition-UN3LZRKU-DA34uUla.js +89 -0
- package/dist/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/client/assets/layout-SsrduOYp.js +1 -0
- package/dist/client/assets/linear-dXivciGL.js +1 -0
- package/dist/client/assets/mermaid.core-Ch4HatqA.js +309 -0
- package/dist/client/assets/mindmap-definition-RKZ34NQL-DUCG-qD3.js +96 -0
- package/dist/client/assets/ordinal-DILIJJjt.js +1 -0
- package/dist/client/assets/pieDiagram-4H26LBE5-DWvFGiLa.js +30 -0
- package/dist/client/assets/quadrantDiagram-W4KKPZXB-OPTVW3WT.js +7 -0
- package/dist/client/assets/requirementDiagram-4Y6WPE33-D7feZvlU.js +84 -0
- package/dist/client/assets/sankeyDiagram-5OEKKPKP-AtnSsEX1.js +40 -0
- package/dist/client/assets/sequenceDiagram-3UESZ5HK-BZjHUeI5.js +162 -0
- package/dist/client/assets/shield-alert-CzaF9ROV.js +6 -0
- package/dist/client/assets/stateDiagram-AJRCARHV-C8j23Pvn.js +1 -0
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CiZR_S5-.js +1 -0
- package/dist/client/assets/step-yuy0qJer.js +1 -0
- package/dist/client/assets/time-DoDTxsna.js +1 -0
- package/dist/client/assets/timeline-definition-PNZ67QCA-DvfNz25n.js +120 -0
- package/dist/client/assets/{upload-BCmd-1I0.js → upload-DTsYywhN.js} +1 -1
- package/dist/client/assets/{users-DO_t3V1p.js → users-yAd09tKP.js} +1 -1
- package/dist/client/assets/{vendor-i18n-CV0mwX_-.js → vendor-i18n-GF3RlKbq.js} +2 -2
- package/dist/client/assets/vendor-react-SZ_qB27O.js +49 -0
- package/dist/client/assets/vendor-reactflow-Bg-Qjzh8.js +15 -0
- package/dist/client/assets/{vendor-xterm-tcedd2Jt.js → vendor-xterm-BNq00GSj.js} +1 -1
- package/dist/client/assets/vennDiagram-CIIHVFJN-CG2aMt3v.js +34 -0
- package/dist/client/assets/wardley-L42UT6IY-BnhBteen.js +173 -0
- package/dist/client/assets/wardleyDiagram-YWT4CUSO-DwqTzM3T.js +78 -0
- package/dist/client/assets/xychartDiagram-2RQKCTM6-5Cv2ZKMV.js +7 -0
- package/dist/client/assets/zoom-out-NWbVkreR.js +41 -0
- package/dist/client/icons/icon-192.png +0 -0
- package/dist/client/icons/icon-512.png +0 -0
- package/dist/client/index.html +30 -10
- package/dist/client/sw.js +1 -1
- package/dist/client/theme-data.css +3348 -469
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/index.ts +56 -40
- package/dist/droid-cli/package.json +1 -1
- package/dist/droid-cli/src/__tests__/execsync-guard.test.ts +17 -0
- package/dist/droid-cli/src/__tests__/index.test.ts +47 -21
- package/dist/droid-cli/src/__tests__/process-manager.test.ts +51 -78
- package/dist/extension.js +9651 -1556
- package/dist/extract-zip-WL55Z3AU.js +2497 -0
- package/dist/index.min-CHQ3ABYJ.js +2926 -0
- package/dist/memory-dreams-7USISKVE.js +32 -0
- package/dist/memory-dreams-PBPISUDD.js +32 -0
- package/dist/memory-dreams-XNO2B2QF.js +32 -0
- package/dist/migration-EH2YOCYQ.js +15 -0
- package/dist/migration-PLGTTKL5.js +15 -0
- package/dist/migration-WZEZK22R.js +15 -0
- package/dist/pi-claude-cli/index.ts +47 -8
- package/dist/pi-claude-cli/package.json +4 -1
- package/dist/pi-claude-cli/src/__tests__/acp-dispatch.test.ts +80 -0
- package/dist/pi-claude-cli/src/__tests__/acp-driver.test.ts +423 -0
- package/dist/pi-claude-cli/src/__tests__/execsync-guard.test.ts +14 -0
- package/dist/pi-claude-cli/src/__tests__/process-manager.test.ts +26 -45
- package/dist/pi-claude-cli/src/__tests__/provider.test.ts +0 -1
- package/dist/pi-claude-cli/src/acp-driver.ts +585 -0
- package/dist/pi-claude-cli/src/event-bridge.ts +7 -0
- package/dist/pi-claude-cli/src/mcp-config.ts +29 -0
- package/dist/pi-claude-cli/src/process-manager.ts +17 -39
- package/dist/plugin-sdk/index.d.ts +5305 -5148
- package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +263 -19
- package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
- package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +37 -7
- package/dist/plugins/fusion-plugin-compound-engineering/manifest.json +4 -4
- package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
- package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +69 -45
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/package.json +1 -1
- package/dist/plugins/fusion-plugin-roadmap/bundled.js +5 -11
- package/dist/plugins/fusion-plugin-roadmap/manifest.json +1 -11
- package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/index.test.ts +5 -1
- package/dist/routine-store-GIJ6MXWY.js +10 -0
- package/dist/routine-store-HTVC2PUQ.js +10 -0
- package/dist/routine-store-KGHZBPDF.js +10 -0
- package/package.json +3 -3
- package/skill/fusion/SKILL.md +1 -1
- package/skill/fusion/references/cli-commands.md +2 -1
- package/skill/fusion/references/engine-tools.md +6 -4
- package/skill/fusion/references/extension-tools.md +10 -0
- package/skill/fusion/references/fusion-capabilities.md +3 -1
- package/dist/client/assets/AgentDetailView-BGN03dyz.css +0 -1
- package/dist/client/assets/AgentDetailView-DKMz3r04.js +0 -18
- package/dist/client/assets/AgentsView-Co-k4vjh.js +0 -29
- package/dist/client/assets/AgentsView-DfznJDek.css +0 -1
- package/dist/client/assets/ChatView-BkAG99bj.js +0 -6
- package/dist/client/assets/ChatView-DwJAd5G1.css +0 -1
- package/dist/client/assets/DevServerView-C6DC0URX.js +0 -1
- package/dist/client/assets/DevServerView-VTQY28P7.css +0 -1
- package/dist/client/assets/DirectoryPicker-CkcGjyv0.js +0 -1
- package/dist/client/assets/DocumentsView-OCK1Vsw_.js +0 -1
- package/dist/client/assets/DocumentsView-WfVoTZt8.css +0 -1
- package/dist/client/assets/EvalsView-CUNJ1TLc.css +0 -1
- package/dist/client/assets/EvalsView-CUfyj5GW.js +0 -1
- package/dist/client/assets/ExperimentalAgentOnboardingModal-BNpveCEk.css +0 -1
- package/dist/client/assets/ExperimentalAgentOnboardingModal-Dau9RTU_.js +0 -499
- package/dist/client/assets/GoalsView-CNLTn0rX.js +0 -2
- package/dist/client/assets/GoalsView-DI66UsjT.css +0 -1
- package/dist/client/assets/InsightsView-BQPxHxKI.js +0 -11
- package/dist/client/assets/InsightsView-C9-mqVvf.css +0 -1
- package/dist/client/assets/MemoryView-D3xQIFjj.js +0 -2
- package/dist/client/assets/MemoryView-zaXewZzi.css +0 -1
- package/dist/client/assets/NodesView-7VInxyf_.css +0 -1
- package/dist/client/assets/NodesView-CSMvGwDU.js +0 -14
- package/dist/client/assets/PiExtensionsManager-BtqXF3fl.js +0 -11
- package/dist/client/assets/PluginManager-CSSDb3VO.js +0 -1
- package/dist/client/assets/PluginManager-UHVLvWWl.css +0 -1
- package/dist/client/assets/PullRequestView-Bjyfffdu.js +0 -6
- package/dist/client/assets/PullRequestView-WQIS0zUC.css +0 -1
- package/dist/client/assets/ReliabilityView-QKMUDebT.js +0 -1
- package/dist/client/assets/ReliabilityView-eoKBhBc4.css +0 -1
- package/dist/client/assets/ResearchView-CRU_NPho.js +0 -1
- package/dist/client/assets/ResearchView-DTh8FLUm.css +0 -1
- package/dist/client/assets/SecretsView-Bs8ySyC5.js +0 -1
- package/dist/client/assets/SecretsView-Djo1rahi.css +0 -1
- package/dist/client/assets/SessionTerminal-BiigPP2l.css +0 -1
- package/dist/client/assets/SessionTerminal-Dk1NgmN2.js +0 -2
- package/dist/client/assets/SettingsModal-DpAxDq6M.css +0 -1
- package/dist/client/assets/SettingsModal-JCaNvdAb.js +0 -31
- package/dist/client/assets/SettingsModal-Nw5cTKAK.js +0 -1
- package/dist/client/assets/SettingsModal-nF_GaeeK.css +0 -1
- package/dist/client/assets/SetupWizardModal-CE79myEy.js +0 -1
- package/dist/client/assets/SetupWizardModal-CIqFbkrD.css +0 -1
- package/dist/client/assets/SkillsView-3bhGyWs1.css +0 -1
- package/dist/client/assets/SkillsView-Dc8YskAX.js +0 -1
- package/dist/client/assets/StashRecoveryView-B_8WIQEo.css +0 -1
- package/dist/client/assets/StashRecoveryView-CqKOFiXT.js +0 -1
- package/dist/client/assets/TodoView-7xIh-Fmi.css +0 -1
- package/dist/client/assets/TodoView-BqIRwcZw.js +0 -6
- package/dist/client/assets/WorkflowNodeEditor-2jDuk2FR.js +0 -8
- package/dist/client/assets/WorkflowNodeEditor-BokhW3de.css +0 -1
- package/dist/client/assets/app-B2ZxMfJT.js +0 -13
- package/dist/client/assets/app-BffGU_HQ.js +0 -13
- package/dist/client/assets/app-C8AHhs5N.js +0 -13
- package/dist/client/assets/app-CUu1sm3x.js +0 -13
- package/dist/client/assets/app-Ri9Te2Dv.js +0 -13
- package/dist/client/assets/app-sEkTyT-w.js +0 -13
- package/dist/client/assets/common-BRyX4VxB.js +0 -1
- package/dist/client/assets/common-CN9QPI2d.js +0 -1
- package/dist/client/assets/common-CNbjPELi.js +0 -1
- package/dist/client/assets/common-DFDqu_n0.js +0 -1
- package/dist/client/assets/common-DgWWKG8Z.js +0 -1
- package/dist/client/assets/common-X6PzBnVA.js +0 -1
- package/dist/client/assets/createLucideIcon-BYvOGRiO.js +0 -21
- package/dist/client/assets/dashboard-view-BhbN8LPh.js +0 -1
- package/dist/client/assets/dashboard-view-DdGlfuu-.css +0 -1
- package/dist/client/assets/dashboard-view-DlKsVySD.js +0 -3
- package/dist/client/assets/dashboard-view-Du53JbmQ.css +0 -1
- package/dist/client/assets/index-CpTBp1RG.js +0 -793
- package/dist/client/assets/index-DqhCiU35.css +0 -1
- package/dist/client/assets/vendor-react-D37HfzIf.js +0 -49
- package/dist/client/assets/vendor-reactflow-CRZcPCXF.js +0 -15
- package/dist/client/assets/x-CqNX_9E2.js +0 -61
- package/dist/client/assets/zoom-out-CSTHbJgD.js +0 -21
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as Ea,g as Sa,R as Na,r as D,j as A}from"./vendor-react-SZ_qB27O.js";import{r as Ca}from"./vendor-i18n-GF3RlKbq.js";function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ie(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ma={value:()=>{}};function on(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ot(n)}function Ot(e){this._=e}function Ia(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ot.prototype=on.prototype={constructor:Ot,on:function(e,t){var n=this._,o=Ia(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=ka(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=_o(n[r],e.name,t);else if(t==null)for(r in n)n[r]=_o(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ot(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function ka(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function _o(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Ma,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Tn="http://www.w3.org/1999/xhtml";const Eo={svg:"http://www.w3.org/2000/svg",xhtml:Tn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Eo.hasOwnProperty(t)?{space:Eo[t],local:e}:e}function Aa(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Tn&&t.documentElement.namespaceURI===Tn?t.createElement(e):t.createElementNS(n,e)}}function $a(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Cr(e){var t=rn(e);return(t.local?$a:Aa)(t)}function Pa(){}function Kn(e){return e==null?Pa:function(){return this.querySelector(e)}}function Da(e){typeof e!="function"&&(e=Kn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new le(o,this._parents)}function za(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ta(){return[]}function Mr(e){return e==null?Ta:function(){return this.querySelectorAll(e)}}function Ha(e){return function(){return za(e.apply(this,arguments))}}function Ra(e){typeof e=="function"?e=Ha(e):e=Mr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new le(o,r)}function Ir(e){return function(){return this.matches(e)}}function kr(e){return function(t){return t.matches(e)}}var La=Array.prototype.find;function Va(e){return function(){return La.call(this.children,e)}}function Oa(){return this.firstElementChild}function Ba(e){return this.select(e==null?Oa:Va(typeof e=="function"?e:kr(e)))}var Fa=Array.prototype.filter;function Xa(){return Array.from(this.children)}function ja(e){return function(){return Fa.call(this.children,e)}}function Ya(e){return this.selectAll(e==null?Xa:ja(typeof e=="function"?e:kr(e)))}function Za(e){typeof e!="function"&&(e=Ir(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new le(o,this._parents)}function Ar(e){return new Array(e.length)}function Wa(){return new le(this._enter||this._groups.map(Ar),this._parents)}function Yt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Yt.prototype={constructor:Yt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function qa(e){return function(){return e}}function Ga(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Yt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Ka(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,f=new Array(u),p;for(a=0;a<u;++a)(l=t[a])&&(f[a]=p=s.call(l,l.__data__,a,t)+"",c.has(p)?r[a]=l:c.set(p,l));for(a=0;a<d;++a)p=s.call(e,i[a],a,i)+"",(l=c.get(p))?(o[a]=l,l.__data__=i[a],c.delete(p)):n[a]=new Yt(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(f[a])===l&&(r[a]=l)}function Ua(e){return e.__data__}function Qa(e,t){if(!arguments.length)return Array.from(this,Ua);var n=t?Ka:Ga,o=this._parents,r=this._groups;typeof e!="function"&&(e=qa(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],f=d.length,p=Ja(e.call(u,u&&u.__data__,c,o)),g=p.length,v=a[c]=new Array(g),y=s[c]=new Array(g),m=l[c]=new Array(f);n(u,d,v,y,m,p,t);for(var b=0,h=0,x,S;b<g;++b)if(x=v[b]){for(b>=h&&(h=b+1);!(S=y[h])&&++h<g;);x._next=S||null}}return s=new le(s,o),s._enter=a,s._exit=l,s}function Ja(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ec(){return new le(this._exit||this._groups.map(Ar),this._parents)}function tc(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function nc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,f=a[l]=new Array(d),p,g=0;g<d;++g)(p=c[g]||u[g])&&(f[g]=p);for(;l<r;++l)a[l]=n[l];return new le(a,this._parents)}function oc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function rc(e){e||(e=ic);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new le(r,this._parents).order()}function ic(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ac(){return Array.from(this)}function cc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function lc(){let e=0;for(const t of this)++e;return e}function uc(){return!this.node()}function dc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function fc(e){return function(){this.removeAttribute(e)}}function hc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gc(e,t){return function(){this.setAttribute(e,t)}}function pc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mc(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yc(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xc(e,t){var n=rn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?hc:fc:typeof t=="function"?n.local?yc:mc:n.local?pc:gc)(n,t))}function $r(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function wc(e){return function(){this.style.removeProperty(e)}}function vc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function bc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function _c(e,t,n){return arguments.length>1?this.each((t==null?wc:typeof t=="function"?bc:vc)(e,t,n??"")):nt(this.node(),e)}function nt(e,t){return e.style.getPropertyValue(t)||$r(e).getComputedStyle(e,null).getPropertyValue(t)}function Ec(e){return function(){delete this[e]}}function Sc(e,t){return function(){this[e]=t}}function Nc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Cc(e,t){return arguments.length>1?this.each((t==null?Ec:typeof t=="function"?Nc:Sc)(e,t)):this.node()[e]}function Pr(e){return e.trim().split(/^|\s+/)}function Un(e){return e.classList||new Dr(e)}function Dr(e){this._node=e,this._names=Pr(e.getAttribute("class")||"")}Dr.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function zr(e,t){for(var n=Un(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Tr(e,t){for(var n=Un(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Mc(e){return function(){zr(this,e)}}function Ic(e){return function(){Tr(this,e)}}function kc(e,t){return function(){(t.apply(this,arguments)?zr:Tr)(this,e)}}function Ac(e,t){var n=Pr(e+"");if(arguments.length<2){for(var o=Un(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?kc:t?Mc:Ic)(n,t))}function $c(){this.textContent=""}function Pc(e){return function(){this.textContent=e}}function Dc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function zc(e){return arguments.length?this.each(e==null?$c:(typeof e=="function"?Dc:Pc)(e)):this.node().textContent}function Tc(){this.innerHTML=""}function Hc(e){return function(){this.innerHTML=e}}function Rc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Lc(e){return arguments.length?this.each(e==null?Tc:(typeof e=="function"?Rc:Hc)(e)):this.node().innerHTML}function Vc(){this.nextSibling&&this.parentNode.appendChild(this)}function Oc(){return this.each(Vc)}function Bc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fc(){return this.each(Bc)}function Xc(e){var t=typeof e=="function"?e:Cr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function jc(){return null}function Yc(e,t){var n=typeof e=="function"?e:Cr(e),o=t==null?jc:typeof t=="function"?t:Kn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Zc(){var e=this.parentNode;e&&e.removeChild(this)}function Wc(){return this.each(Zc)}function qc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Kc(e){return this.select(e?Gc:qc)}function Uc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Qc(e){return function(t){e.call(this,t,this.__data__)}}function Jc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function el(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function tl(e,t,n){return function(){var o=this.__on,r,i=Qc(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function nl(e,t,n){var o=Jc(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?tl:el,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Hr(e,t,n){var o=$r(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function ol(e,t){return function(){return Hr(this,e,t)}}function rl(e,t){return function(){return Hr(this,e,t.apply(this,arguments))}}function il(e,t){return this.each((typeof t=="function"?rl:ol)(e,t))}function*sl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var Rr=[null];function le(e,t){this._groups=e,this._parents=t}function Ct(){return new le([[document.documentElement]],Rr)}function al(){return this}le.prototype=Ct.prototype={constructor:le,select:Da,selectAll:Ra,selectChild:Ba,selectChildren:Ya,filter:Za,data:Qa,enter:Wa,exit:ec,join:tc,merge:nc,selection:al,order:oc,sort:rc,call:sc,nodes:ac,node:cc,size:lc,empty:uc,each:dc,attr:xc,style:_c,property:Cc,classed:Ac,text:zc,html:Lc,raise:Oc,lower:Fc,append:Xc,insert:Yc,remove:Wc,clone:Kc,datum:Uc,on:nl,dispatch:il,[Symbol.iterator]:sl};function ce(e){return typeof e=="string"?new le([[document.querySelector(e)]],[document.documentElement]):new le([[e]],Rr)}function cl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function de(e,t){if(e=cl(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const ll={passive:!1},yt={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}function Qe(e){e.preventDefault(),e.stopImmediatePropagation()}function Lr(e){var t=e.document.documentElement,n=ce(e).on("dragstart.drag",Qe,yt);"onselectstart"in t?n.on("selectstart.drag",Qe,yt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Vr(e,t){var n=e.document.documentElement,o=ce(e).on("dragstart.drag",null);t&&(o.on("click.drag",Qe,yt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const $t=e=>()=>e;function Hn(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Hn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ul(e){return!e.ctrlKey&&!e.button}function dl(){return this.parentNode}function fl(e,t){return t??{x:e.x,y:e.y}}function hl(){return navigator.maxTouchPoints||"ontouchstart"in this}function Or(){var e=ul,t=dl,n=fl,o=hl,r={},i=on("start","drag","end"),s=0,a,l,c,u,d=0;function f(x){x.on("mousedown.drag",p).filter(o).on("touchstart.drag",y).on("touchmove.drag",m,ll).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,S){if(!(u||!e.call(this,x,S))){var _=h(this,t.call(this,x,S),x,S,"mouse");_&&(ce(x.view).on("mousemove.drag",g,yt).on("mouseup.drag",v,yt),Lr(x.view),vn(x),c=!1,a=x.clientX,l=x.clientY,_("start",x))}}function g(x){if(Qe(x),!c){var S=x.clientX-a,_=x.clientY-l;c=S*S+_*_>d}r.mouse("drag",x)}function v(x){ce(x.view).on("mousemove.drag mouseup.drag",null),Vr(x.view,c),Qe(x),r.mouse("end",x)}function y(x,S){if(e.call(this,x,S)){var _=x.changedTouches,C=t.call(this,x,S),k=_.length,$,B;for($=0;$<k;++$)(B=h(this,C,x,S,_[$].identifier,_[$]))&&(vn(x),B("start",x,_[$]))}}function m(x){var S=x.changedTouches,_=S.length,C,k;for(C=0;C<_;++C)(k=r[S[C].identifier])&&(Qe(x),k("drag",x,S[C]))}function b(x){var S=x.changedTouches,_=S.length,C,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<_;++C)(k=r[S[C].identifier])&&(vn(x),k("end",x,S[C]))}function h(x,S,_,C,k,$){var B=i.copy(),M=de($||_,S),T,R,w;if((w=n.call(x,new Hn("beforestart",{sourceEvent:_,target:f,identifier:k,active:s,x:M[0],y:M[1],dx:0,dy:0,dispatch:B}),C))!=null)return T=w.x-M[0]||0,R=w.y-M[1]||0,function N(E,I,z){var P=M,V;switch(E){case"start":r[k]=N,V=s++;break;case"end":delete r[k],--s;case"drag":M=de(z||I,S),V=s;break}B.call(E,x,new Hn(E,{sourceEvent:I,subject:w,target:f,identifier:k,active:V,x:M[0]+T,y:M[1]+R,dx:M[0]-P[0],dy:M[1]-P[1],dispatch:B}),C)}}return f.filter=function(x){return arguments.length?(e=typeof x=="function"?x:$t(!!x),f):e},f.container=function(x){return arguments.length?(t=typeof x=="function"?x:$t(x),f):t},f.subject=function(x){return arguments.length?(n=typeof x=="function"?x:$t(x),f):n},f.touchable=function(x){return arguments.length?(o=typeof x=="function"?x:$t(!!x),f):o},f.on=function(){var x=i.on.apply(i,arguments);return x===i?f:x},f.clickDistance=function(x){return arguments.length?(d=(x=+x)*x,f):Math.sqrt(d)},f}function Mt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sn(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function qe(){}var xt=.7,Zt=1/xt,Je="\\s*([+-]?\\d+)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gl=/^#([0-9a-f]{3,8})$/,pl=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),ml=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),yl=new RegExp(`^rgba\\(${Je},${Je},${Je},${wt}\\)$`),xl=new RegExp(`^rgba\\(${ve},${ve},${ve},${wt}\\)$`),wl=new RegExp(`^hsl\\(${wt},${ve},${ve}\\)$`),vl=new RegExp(`^hsla\\(${wt},${ve},${ve},${wt}\\)$`),So={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};Mt(qe,Xe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:No,formatHex:No,formatHex8:bl,formatHsl:_l,formatRgb:Co,toString:Co});function No(){return this.rgb().formatHex()}function bl(){return this.rgb().formatHex8()}function _l(){return Fr(this).formatHsl()}function Co(){return this.rgb().formatRgb()}function Xe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Mo(t):n===3?new se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pl.exec(e))?new se(t[1],t[2],t[3],1):(t=ml.exec(e))?new se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yl.exec(e))?Pt(t[1],t[2],t[3],t[4]):(t=xl.exec(e))?Pt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wl.exec(e))?Ao(t[1],t[2]/100,t[3]/100,1):(t=vl.exec(e))?Ao(t[1],t[2]/100,t[3]/100,t[4]):So.hasOwnProperty(e)?Mo(So[e]):e==="transparent"?new se(NaN,NaN,NaN,0):null}function Mo(e){return new se(e>>16&255,e>>8&255,e&255,1)}function Pt(e,t,n,o){return o<=0&&(e=t=n=NaN),new se(e,t,n,o)}function Br(e){return e instanceof qe||(e=Xe(e)),e?(e=e.rgb(),new se(e.r,e.g,e.b,e.opacity)):new se}function Rn(e,t,n,o){return arguments.length===1?Br(e):new se(e,t,n,o??1)}function se(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Mt(se,Rn,sn(qe,{brighter(e){return e=e==null?Zt:Math.pow(Zt,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new se(Be(this.r),Be(this.g),Be(this.b),Wt(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:Io,formatHex:Io,formatHex8:El,formatRgb:ko,toString:ko}));function Io(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}`}function El(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}${Oe((isNaN(this.opacity)?1:this.opacity)*255)}`}function ko(){const e=Wt(this.opacity);return`${e===1?"rgb(":"rgba("}${Be(this.r)}, ${Be(this.g)}, ${Be(this.b)}${e===1?")":`, ${e})`}`}function Wt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Be(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oe(e){return e=Be(e),(e<16?"0":"")+e.toString(16)}function Ao(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fe(e,t,n,o)}function Fr(e){if(e instanceof fe)return new fe(e.h,e.s,e.l,e.opacity);if(e instanceof qe||(e=Xe(e)),!e)return new fe;if(e instanceof fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new fe(s,a,l,e.opacity)}function Sl(e,t,n,o){return arguments.length===1?Fr(e):new fe(e,t,n,o??1)}function fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Mt(fe,Sl,sn(qe,{brighter(e){return e=e==null?Zt:Math.pow(Zt,e),new fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new fe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new se(bn(e>=240?e-240:e+120,r,o),bn(e,r,o),bn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new fe($o(this.h),Dt(this.s),Dt(this.l),Wt(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 e=Wt(this.opacity);return`${e===1?"hsl(":"hsla("}${$o(this.h)}, ${Dt(this.s)*100}%, ${Dt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $o(e){return e=(e||0)%360,e<0?e+360:e}function Dt(e){return Math.max(0,Math.min(1,e||0))}function bn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Nl=Math.PI/180,Cl=180/Math.PI,qt=18,Xr=.96422,jr=1,Yr=.82521,Zr=4/29,et=6/29,Wr=3*et*et,Ml=et*et*et;function qr(e){if(e instanceof be)return new be(e.l,e.a,e.b,e.opacity);if(e instanceof Ie)return Gr(e);e instanceof se||(e=Br(e));var t=Nn(e.r),n=Nn(e.g),o=Nn(e.b),r=_n((.2225045*t+.7168786*n+.0606169*o)/jr),i,s;return t===n&&n===o?i=s=r:(i=_n((.4360747*t+.3850649*n+.1430804*o)/Xr),s=_n((.0139322*t+.0971045*n+.7141733*o)/Yr)),new be(116*r-16,500*(i-r),200*(r-s),e.opacity)}function Il(e,t,n,o){return arguments.length===1?qr(e):new be(e,t,n,o??1)}function be(e,t,n,o){this.l=+e,this.a=+t,this.b=+n,this.opacity=+o}Mt(be,Il,sn(qe,{brighter(e){return new be(this.l+qt*(e??1),this.a,this.b,this.opacity)},darker(e){return new be(this.l-qt*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Xr*En(t),e=jr*En(e),n=Yr*En(n),new se(Sn(3.1338561*t-1.6168667*e-.4906146*n),Sn(-.9787684*t+1.9161415*e+.033454*n),Sn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function _n(e){return e>Ml?Math.pow(e,1/3):e/Wr+Zr}function En(e){return e>et?e*e*e:Wr*(e-Zr)}function Sn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Nn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function kl(e){if(e instanceof Ie)return new Ie(e.h,e.c,e.l,e.opacity);if(e instanceof be||(e=qr(e)),e.a===0&&e.b===0)return new Ie(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Cl;return new Ie(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Ln(e,t,n,o){return arguments.length===1?kl(e):new Ie(e,t,n,o??1)}function Ie(e,t,n,o){this.h=+e,this.c=+t,this.l=+n,this.opacity=+o}function Gr(e){if(isNaN(e.h))return new be(e.l,0,0,e.opacity);var t=e.h*Nl;return new be(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Mt(Ie,Ln,sn(qe,{brighter(e){return new Ie(this.h,this.c,this.l+qt*(e??1),this.opacity)},darker(e){return new Ie(this.h,this.c,this.l-qt*(e??1),this.opacity)},rgb(){return Gr(this).rgb()}}));const an=e=>()=>e;function Kr(e,t){return function(n){return e+n*t}}function Al(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function $l(e,t){var n=t-e;return n?Kr(e,n>180||n<-180?n-360*Math.round(n/360):n):an(isNaN(e)?t:e)}function Pl(e){return(e=+e)==1?pt:function(t,n){return n-t?Al(t,n,e):an(isNaN(t)?n:t)}}function pt(e,t){var n=t-e;return n?Kr(e,n):an(isNaN(e)?t:e)}const Gt=(function e(t){var n=Pl(t);function o(r,i){var s=n((r=Rn(r)).r,(i=Rn(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=pt(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function Dl(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function zl(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Tl(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=tt(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function Hl(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function we(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Rl(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=tt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Vn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp(Vn.source,"g");function Ll(e){return function(){return e}}function Vl(e){return function(t){return e(t)+""}}function Ur(e,t){var n=Vn.lastIndex=Cn.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Vn.exec(e))&&(r=Cn.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:we(o,r)})),n=Cn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Vl(l[0].x):Ll(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function tt(e,t){var n=typeof t,o;return t==null||n==="boolean"?an(t):(n==="number"?we:n==="string"?(o=Xe(t))?(t=o,Gt):Ur:t instanceof Xe?Gt:t instanceof Date?Hl:zl(t)?Dl:Array.isArray(t)?Tl:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Rl:we)(e,t)}function Tg(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Po=180/Math.PI,On={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Qr(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Po,skewX:Math.atan(l)*Po,scaleX:s,scaleY:a}}var zt;function Ol(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?On:Qr(t.a,t.b,t.c,t.d,t.e,t.f)}function Bl(e){return e==null||(zt||(zt=document.createElementNS("http://www.w3.org/2000/svg","g")),zt.setAttribute("transform",e),!(e=zt.transform.baseVal.consolidate()))?On:(e=e.matrix,Qr(e.a,e.b,e.c,e.d,e.e,e.f))}function Jr(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,p,g){if(c!==d||u!==f){var v=p.push("translate(",null,t,null,n);g.push({i:v-4,x:we(c,d)},{i:v-2,x:we(u,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:we(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,f){c!==u?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:we(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,p,g){if(c!==d||u!==f){var v=p.push(r(p)+"scale(",null,",",null,")");g.push({i:v-4,x:we(c,d)},{i:v-2,x:we(u,f)})}else(d!==1||f!==1)&&p.push(r(p)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(p){for(var g=-1,v=f.length,y;++g<v;)d[(y=f[g]).i]=y.x(p);return d.join("")}}}var Fl=Jr(Ol,"px, ","px)","deg)"),Xl=Jr(Bl,", ",")",")"),jl=1e-12;function Do(e){return((e=Math.exp(e))+1/e)/2}function Yl(e){return((e=Math.exp(e))-1/e)/2}function Zl(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bt=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],d=s[1],f=s[2],p=u-a,g=d-l,v=p*p+g*g,y,m;if(v<jl)m=Math.log(f/c)/t,y=function(C){return[a+C*p,l+C*g,c*Math.exp(t*C*m)]};else{var b=Math.sqrt(v),h=(f*f-c*c+o*v)/(2*c*n*b),x=(f*f-c*c-o*v)/(2*f*n*b),S=Math.log(Math.sqrt(h*h+1)-h),_=Math.log(Math.sqrt(x*x+1)-x);m=(_-S)/t,y=function(C){var k=C*m,$=Do(S),B=c/(n*b)*($*Zl(t*k+S)-Yl(S));return[a+B*p,l+B*g,c*$/Do(t*k+S)]}}return y.duration=m*1e3*t/Math.SQRT2,y}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);function Wl(e){return function(t,n){var o=e((t=Ln(t)).h,(n=Ln(n)).h),r=pt(t.c,n.c),i=pt(t.l,n.l),s=pt(t.opacity,n.opacity);return function(a){return t.h=o(a),t.c=r(a),t.l=i(a),t.opacity=s(a),t+""}}}const Hg=Wl($l);function Rg(e,t){t===void 0&&(t=e,e=tt);for(var n=0,o=t.length-1,r=t[0],i=new Array(o<0?0:o);n<o;)i[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(o-1,Math.floor(s*=o)));return i[a](s-a)}}var ot=0,ht=0,dt=0,ei=1e3,Kt,gt,Ut=0,je=0,cn=0,vt=typeof performance=="object"&&performance.now?performance:Date,ti=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qn(){return je||(ti(ql),je=vt.now()+cn)}function ql(){je=0}function Qt(){this._call=this._time=this._next=null}Qt.prototype=ni.prototype={constructor:Qt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Qn():+n)+(t==null?0:+t),!this._next&>!==this&&(gt?gt._next=this:Kt=this,gt=this),this._call=e,this._time=n,Bn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bn())}};function ni(e,t,n){var o=new Qt;return o.restart(e,t,n),o}function Gl(){Qn(),++ot;for(var e=Kt,t;e;)(t=je-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ot}function zo(){je=(Ut=vt.now())+cn,ot=ht=0;try{Gl()}finally{ot=0,Ul(),je=0}}function Kl(){var e=vt.now(),t=e-Ut;t>ei&&(cn-=t,Ut=e)}function Ul(){for(var e,t=Kt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Kt=n);gt=e,Bn(o)}function Bn(e){if(!ot){ht&&(ht=clearTimeout(ht));var t=e-je;t>24?(e<1/0&&(ht=setTimeout(zo,e-vt.now()-cn)),dt&&(dt=clearInterval(dt))):(dt||(Ut=vt.now(),dt=setInterval(Kl,ei)),ot=1,ti(zo))}}function To(e,t,n){var o=new Qt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ql=on("start","end","cancel","interrupt"),Jl=[],oi=0,Ho=1,Fn=2,Ft=3,Ro=4,Xn=5,Xt=6;function ln(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;eu(e,n,{name:t,index:o,group:r,on:Ql,tween:Jl,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:oi})}function Jn(e,t){var n=me(e,t);if(n.state>oi)throw new Error("too late; already scheduled");return n}function _e(e,t){var n=me(e,t);if(n.state>Ft)throw new Error("too late; already running");return n}function me(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function eu(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=ni(i,0,n.time);function i(c){n.state=Ho,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,p;if(n.state!==Ho)return l();for(u in o)if(p=o[u],p.name===n.name){if(p.state===Ft)return To(s);p.state===Ro?(p.state=Xt,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[u]):+u<t&&(p.state=Xt,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[u])}if(To(function(){n.state===Ft&&(n.state=Ro,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Fn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Fn){for(n.state=Ft,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=p);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Xn,1),d=-1,f=r.length;++d<f;)r[d].call(e,u);n.state===Xn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Xt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function jt(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Fn&&o.state<Xn,o.state=Xt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function tu(e){return this.each(function(){jt(this,e)})}function nu(e,t){var n,o;return function(){var r=_e(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function ou(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=_e(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function ru(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=me(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?nu:ou)(n,e,t))}function eo(e,t,n){var o=e._id;return e.each(function(){var r=_e(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return me(r,o).value[t]}}function ri(e,t){var n;return(typeof t=="number"?we:t instanceof Xe?Gt:(n=Xe(t))?(t=n,Gt):Ur)(e,t)}function iu(e){return function(){this.removeAttribute(e)}}function su(e){return function(){this.removeAttributeNS(e.space,e.local)}}function au(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function cu(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function lu(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function uu(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function du(e,t){var n=rn(e),o=n==="transform"?Xl:ri;return this.attrTween(e,typeof t=="function"?(n.local?uu:lu)(n,o,eo(this,"attr."+e,t)):t==null?(n.local?su:iu)(n):(n.local?cu:au)(n,o,t))}function fu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function gu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&hu(e,i)),n}return r._value=t,r}function pu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&fu(e,i)),n}return r._value=t,r}function mu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=rn(e);return this.tween(n,(o.local?gu:pu)(o,t))}function yu(e,t){return function(){Jn(this,e).delay=+t.apply(this,arguments)}}function xu(e,t){return t=+t,function(){Jn(this,e).delay=t}}function wu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yu:xu)(t,e)):me(this.node(),t).delay}function vu(e,t){return function(){_e(this,e).duration=+t.apply(this,arguments)}}function bu(e,t){return t=+t,function(){_e(this,e).duration=t}}function _u(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vu:bu)(t,e)):me(this.node(),t).duration}function Eu(e,t){if(typeof t!="function")throw new Error;return function(){_e(this,e).ease=t}}function Su(e){var t=this._id;return arguments.length?this.each(Eu(t,e)):me(this.node(),t).ease}function Nu(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;_e(this,e).ease=n}}function Cu(e){if(typeof e!="function")throw new Error;return this.each(Nu(this._id,e))}function Mu(e){typeof e!="function"&&(e=Ir(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Ae(o,this._parents,this._name,this._id)}function Iu(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,p=0;p<u;++p)(f=l[p]||c[p])&&(d[p]=f);for(;a<o;++a)s[a]=t[a];return new Ae(s,this._parents,this._name,this._id)}function ku(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Au(e,t,n){var o,r,i=ku(t)?Jn:_e;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function $u(e,t){var n=this._id;return arguments.length<2?me(this.node(),n).on.on(e):this.each(Au(n,e,t))}function Pu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Du(){return this.on("end.remove",Pu(this._id))}function zu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=e.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,ln(c[f],t,n,f,c,me(u,n)));return new Ae(i,this._parents,t,n)}function Tu(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Mr(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=e.call(u,u.__data__,d,l),p,g=me(u,n),v=0,y=f.length;v<y;++v)(p=f[v])&&ln(p,t,n,v,f,g);i.push(f),s.push(u)}return new Ae(i,s,t,n)}var Hu=Ct.prototype.constructor;function Ru(){return new Hu(this._groups,this._parents)}function Lu(e,t){var n,o,r;return function(){var i=nt(this,e),s=(this.style.removeProperty(e),nt(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function ii(e){return function(){this.style.removeProperty(e)}}function Vu(e,t,n){var o,r=n+"",i;return function(){var s=nt(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Ou(e,t,n){var o,r,i;return function(){var s=nt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),nt(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function Bu(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=_e(this,e),c=l.on,u=l.value[i]==null?a||(a=ii(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Fu(e,t,n){var o=(e+="")=="transform"?Fl:ri;return t==null?this.styleTween(e,Lu(e,o)).on("end.style."+e,ii(e)):typeof t=="function"?this.styleTween(e,Ou(e,o,eo(this,"style."+e,t))).each(Bu(this._id,e)):this.styleTween(e,Vu(e,o,t),n).on("end.style."+e,null)}function Xu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function ju(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Xu(e,s,n)),o}return i._value=t,i}function Yu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,ju(e,t,n??""))}function Zu(e){return function(){this.textContent=e}}function Wu(e){return function(){var t=e(this);this.textContent=t??""}}function qu(e){return this.tween("text",typeof e=="function"?Wu(eo(this,"text",e)):Zu(e==null?"":e+""))}function Gu(e){return function(t){this.textContent=e.call(this,t)}}function Ku(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Gu(r)),t}return o._value=e,o}function Uu(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ku(e))}function Qu(){for(var e=this._name,t=this._id,n=si(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=me(l,t);ln(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ae(o,this._parents,e,n)}function Ju(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=_e(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var ed=0;function Ae(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function si(){return++ed}var Me=Ct.prototype;Ae.prototype={constructor:Ae,select:zu,selectAll:Tu,selectChild:Me.selectChild,selectChildren:Me.selectChildren,filter:Mu,merge:Iu,selection:Ru,transition:Qu,call:Me.call,nodes:Me.nodes,node:Me.node,size:Me.size,empty:Me.empty,each:Me.each,on:$u,attr:du,attrTween:mu,style:Fu,styleTween:Yu,text:qu,textTween:Uu,remove:Du,tween:ru,delay:wu,duration:_u,ease:Su,easeVarying:Cu,end:Ju,[Symbol.iterator]:Me[Symbol.iterator]};function td(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nd={time:null,delay:0,duration:250,ease:td};function od(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function rd(e){var t,n;e instanceof Ae?(t=e._id,e=e._name):(t=si(),(n=nd).time=Qn(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&ln(l,e,t,c,s,n||od(l,t));return new Ae(o,this._parents,e,t)}Ct.prototype.interrupt=tu;Ct.prototype.transition=rd;const Tt=e=>()=>e;function id(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function ke(e,t,n){this.k=e,this.x=t,this.y=n}ke.prototype={constructor:ke,scale:function(e){return e===1?this:new ke(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ke(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var un=new ke(1,0,0);ai.prototype=ke.prototype;function ai(e){for(;!e.__zoom;)if(!(e=e.parentNode))return un;return e.__zoom}function Mn(e){e.stopImmediatePropagation()}function ft(e){e.preventDefault(),e.stopImmediatePropagation()}function sd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ad(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Lo(){return this.__zoom||un}function cd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ld(){return navigator.maxTouchPoints||"ontouchstart"in this}function ud(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function ci(){var e=sd,t=ad,n=ud,o=cd,r=ld,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Bt,c=on("start","zoom","end"),u,d,f,p=500,g=150,v=0,y=10;function m(w){w.property("__zoom",Lo).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",M).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(w,N,E,I){var z=w.selection?w.selection():w;z.property("__zoom",Lo),w!==z?S(w,N,E,I):z.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},m.scaleBy=function(w,N,E,I){m.scaleTo(w,function(){var z=this.__zoom.k,P=typeof N=="function"?N.apply(this,arguments):N;return z*P},E,I)},m.scaleTo=function(w,N,E,I){m.transform(w,function(){var z=t.apply(this,arguments),P=this.__zoom,V=E==null?x(z):typeof E=="function"?E.apply(this,arguments):E,O=P.invert(V),L=typeof N=="function"?N.apply(this,arguments):N;return n(h(b(P,L),V,O),z,s)},E,I)},m.translateBy=function(w,N,E,I){m.transform(w,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,I)},m.translateTo=function(w,N,E,I,z){m.transform(w,function(){var P=t.apply(this,arguments),V=this.__zoom,O=I==null?x(P):typeof I=="function"?I.apply(this,arguments):I;return n(un.translate(O[0],O[1]).scale(V.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof E=="function"?-E.apply(this,arguments):-E),P,s)},I,z)};function b(w,N){return N=Math.max(i[0],Math.min(i[1],N)),N===w.k?w:new ke(N,w.x,w.y)}function h(w,N,E){var I=N[0]-E[0]*w.k,z=N[1]-E[1]*w.k;return I===w.x&&z===w.y?w:new ke(w.k,I,z)}function x(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function S(w,N,E,I){w.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var z=this,P=arguments,V=_(z,P).event(I),O=t.apply(z,P),L=E==null?x(O):typeof E=="function"?E.apply(z,P):E,j=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),X=z.__zoom,q=typeof N=="function"?N.apply(z,P):N,Q=l(X.invert(L).concat(j/X.k),q.invert(L).concat(j/q.k));return function(W){if(W===1)W=q;else{var H=Q(W),F=j/H[2];W=new ke(F,L[0]-H[0]*F,L[1]-H[1]*F)}V.zoom(null,W)}})}function _(w,N,E){return!E&&w.__zooming||new C(w,N)}function C(w,N){this.that=w,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,N),this.taps=0}C.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,N){return this.mouse&&w!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var N=ce(this.that).datum();c.call(w,this.that,new id(w,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),N)}};function k(w,...N){if(!e.apply(this,arguments))return;var E=_(this,N).event(w),I=this.__zoom,z=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,o.apply(this,arguments)))),P=de(w);if(E.wheel)(E.mouse[0][0]!==P[0]||E.mouse[0][1]!==P[1])&&(E.mouse[1]=I.invert(E.mouse[0]=P)),clearTimeout(E.wheel);else{if(I.k===z)return;E.mouse=[P,I.invert(P)],jt(this),E.start()}ft(w),E.wheel=setTimeout(V,g),E.zoom("mouse",n(h(b(I,z),E.mouse[0],E.mouse[1]),E.extent,s));function V(){E.wheel=null,E.end()}}function $(w,...N){if(f||!e.apply(this,arguments))return;var E=w.currentTarget,I=_(this,N,!0).event(w),z=ce(w.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",j,!0),P=de(w,E),V=w.clientX,O=w.clientY;Lr(w.view),Mn(w),I.mouse=[P,this.__zoom.invert(P)],jt(this),I.start();function L(X){if(ft(X),!I.moved){var q=X.clientX-V,Q=X.clientY-O;I.moved=q*q+Q*Q>v}I.event(X).zoom("mouse",n(h(I.that.__zoom,I.mouse[0]=de(X,E),I.mouse[1]),I.extent,s))}function j(X){z.on("mousemove.zoom mouseup.zoom",null),Vr(X.view,I.moved),ft(X),I.event(X).end()}}function B(w,...N){if(e.apply(this,arguments)){var E=this.__zoom,I=de(w.changedTouches?w.changedTouches[0]:w,this),z=E.invert(I),P=E.k*(w.shiftKey?.5:2),V=n(h(b(E,P),I,z),t.apply(this,N),s);ft(w),a>0?ce(this).transition().duration(a).call(S,V,I,w):ce(this).call(m.transform,V,I,w)}}function M(w,...N){if(e.apply(this,arguments)){var E=w.touches,I=E.length,z=_(this,N,w.changedTouches.length===I).event(w),P,V,O,L;for(Mn(w),V=0;V<I;++V)O=E[V],L=de(O,this),L=[L,this.__zoom.invert(L),O.identifier],z.touch0?!z.touch1&&z.touch0[2]!==L[2]&&(z.touch1=L,z.taps=0):(z.touch0=L,P=!0,z.taps=1+!!u);u&&(u=clearTimeout(u)),P&&(z.taps<2&&(d=L[0],u=setTimeout(function(){u=null},p)),jt(this),z.start())}}function T(w,...N){if(this.__zooming){var E=_(this,N).event(w),I=w.changedTouches,z=I.length,P,V,O,L;for(ft(w),P=0;P<z;++P)V=I[P],O=de(V,this),E.touch0&&E.touch0[2]===V.identifier?E.touch0[0]=O:E.touch1&&E.touch1[2]===V.identifier&&(E.touch1[0]=O);if(V=E.that.__zoom,E.touch1){var j=E.touch0[0],X=E.touch0[1],q=E.touch1[0],Q=E.touch1[1],W=(W=q[0]-j[0])*W+(W=q[1]-j[1])*W,H=(H=Q[0]-X[0])*H+(H=Q[1]-X[1])*H;V=b(V,Math.sqrt(W/H)),O=[(j[0]+q[0])/2,(j[1]+q[1])/2],L=[(X[0]+Q[0])/2,(X[1]+Q[1])/2]}else if(E.touch0)O=E.touch0[0],L=E.touch0[1];else return;E.zoom("touch",n(h(V,O,L),E.extent,s))}}function R(w,...N){if(this.__zooming){var E=_(this,N).event(w),I=w.changedTouches,z=I.length,P,V;for(Mn(w),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),P=0;P<z;++P)V=I[P],E.touch0&&E.touch0[2]===V.identifier?delete E.touch0:E.touch1&&E.touch1[2]===V.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(V=de(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<y)){var O=ce(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return m.wheelDelta=function(w){return arguments.length?(o=typeof w=="function"?w:Tt(+w),m):o},m.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Tt(!!w),m):e},m.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Tt(!!w),m):r},m.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Tt([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),m):t},m.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],m):[i[0],i[1]]},m.translateExtent=function(w){return arguments.length?(s[0][0]=+w[0][0],s[1][0]=+w[1][0],s[0][1]=+w[0][1],s[1][1]=+w[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(w){return arguments.length?(n=w,m):n},m.duration=function(w){return arguments.length?(a=+w,m):a},m.interpolate=function(w){return arguments.length?(l=w,m):l},m.on=function(){var w=c.on.apply(c,arguments);return w===c?m:w},m.clickDistance=function(w){return arguments.length?(v=(w=+w)*w,m):Math.sqrt(v)},m.tapDistance=function(w){return arguments.length?(y=+w,m):y},m}const pe={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},bt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],li=["Enter"," ","Escape"],ui={"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:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 rt;(function(e){e.Strict="strict",e.Loose="loose"})(rt||(rt={}));var Fe;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Fe||(Fe={}));var _t;(function(e){e.Partial="partial",e.Full="full"})(_t||(_t={}));const di={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ze;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ze||(ze={}));var Jt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jt||(Jt={}));var Z;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Z||(Z={}));const Vo={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top};function fi(e){return e===null?null:e?"valid":"invalid"}const hi=e=>"id"in e&&"source"in e&&"target"in e,dd=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),to=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),It=(e,t=[0,0])=>{const{width:n,height:o}=$e(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},fd=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):to(r)?r:t.nodeLookup.get(r.id));const a=s?en(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return dn(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fn(n)},kt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=dn(n,en(r)),o=!0)}),o?fn(n):{x:0,y:0,width:0,height:0}},no=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...lt(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const c of e.values()){const{measured:u,selectable:d=!0,hidden:f=!1}=c;if(s&&!d||f)continue;const p=u.width??c.width??c.initialWidth??null,g=u.height??c.height??c.initialHeight??null,v=Et(a,st(c)),y=(p??0)*(g??0),m=i&&v>0;(!c.internals.handleBounds||m||v>=y||c.dragging)&&l.push(c)}return l},hd=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function gd(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function pd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=gd(e,s),l=kt(a),c=ro(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function gi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let d=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",pe.error005());else{const p=a.measured.width,g=a.measured.height;p&&g&&(d=[[l,c],[l+p,c+g]])}else a&&Ze(s.extent)&&(d=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const f=Ze(d)?Ye(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",pe.error015()),{position:{x:f.x-l+(s.measured.width??0)*u[0],y:f.y-c+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function md({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const p=i.has(f.id),g=!p&&f.parentId&&s.find(v=>v.id===f.parentId);(p||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),l=o.filter(f=>f.deletable!==!1),u=hd(s,l);for(const f of l)a.has(f.id)&&!u.find(g=>g.id===f.id)&&u.push(f);if(!r)return{edges:u,nodes:s};const d=await r({nodes:s,edges:u});return typeof d=="boolean"?d?{edges:u,nodes:s}:{edges:[],nodes:[]}:d}const it=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ye=(e={x:0,y:0},t,n)=>({x:it(e.x,t[0][0],t[1][0]-(n?.width??0)),y:it(e.y,t[0][1],t[1][1]-(n?.height??0))});function pi(e,t,n){const{width:o,height:r}=$e(n),{x:i,y:s}=n.internals.positionAbsolute;return Ye(e,[[i,s],[i+o,s+r]],t)}const Oo=(e,t,n)=>e<t?it(Math.abs(e-t),1,t)/t:e>n?-it(Math.abs(e-n),1,t)/t:0,oo=(e,t,n=15,o=40)=>{const r=Oo(e.x,o,t.width-o)*n,i=Oo(e.y,o,t.height-o)*n;return[r,i]},dn=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),jn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),fn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),st=(e,t=[0,0])=>{const{x:n,y:o}=to(e)?e.internals.positionAbsolute:It(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},en=(e,t=[0,0])=>{const{x:n,y:o}=to(e)?e.internals.positionAbsolute:It(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},mi=(e,t)=>fn(dn(jn(e),jn(t))),Et=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Bo=e=>he(e.width)&&he(e.height)&&he(e.x)&&he(e.y),he=e=>!isNaN(e)&&isFinite(e),yi=(e,t)=>(n,o)=>{},At=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),lt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?At(a,s):a},at=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Ge(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yd(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Ge(e,n),r=Ge(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Ge(e.top??e.y??0,n),r=Ge(e.bottom??e.y??0,n),i=Ge(e.left??e.x??0,t),s=Ge(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function xd(e,t,n,o,r,i){const{x:s,y:a}=at(e,[t,n,o]),{x:l,y:c}=at({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(d)}}const ro=(e,t,n,o,r,i)=>{const s=yd(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=it(c,o,r),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*u,g=n/2-f*u,v=xd(e,p,g,u,t,n),y={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:p-y.left+y.right,y:g-y.top+y.bottom,zoom:u}},St=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ze(e){return e!=null&&e!=="parent"}function $e(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function xi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function wi(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Fo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function wd(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function vd(e){return{...ui,...e||{}}}function mt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=ge(e),a=lt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?At(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const io=e=>({width:e.offsetWidth,height:e.offsetHeight}),vi=e=>e?.getRootNode?.()||window?.document,bd=["INPUT","SELECT","TEXTAREA"];function bi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:bd.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const _i=e=>"clientX"in e,ge=(e,t)=>{const n=_i(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Xo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...io(s)}})};function Ei({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}function Ht(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function jo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Z.Left:return[t-Ht(t-o,i),n];case Z.Right:return[t+Ht(o-t,i),n];case Z.Top:return[t,n-Ht(n-r,i)];case Z.Bottom:return[t,n+Ht(r-n,i)]}}function Si({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:o,targetY:r,targetPosition:i=Z.Top,curvature:s=.25}){const[a,l]=jo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=jo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[d,f,p,g]=Ei({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${o},${r}`,d,f,p,g]}function Ni({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function _d({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function Ed({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=dn(en(e),en(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Et(s,fn(i))>0}const Sd=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,Nd=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Cd=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",pe.error006()),t;const o=n.getEdgeId||Sd;let r;return hi(e)?r={...e}:r={...e,id:o(e)},Nd(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function Ci({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Ni({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Yo={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},Md=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Zo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Id({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:o=Z.Top,center:r,offset:i,stepPosition:s}){const a=Yo[t],l=Yo[o],c={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},d=Md({source:c,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",p=d[f];let g=[],v,y;const m={x:0,y:0},b={x:0,y:0},[,,h,x]=Ni({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(v=r.x??c.x+(u.x-c.x)*s,y=r.y??(c.y+u.y)/2):(v=r.x??(c.x+u.x)/2,y=r.y??c.y+(u.y-c.y)*s);const k=[{x:v,y:c.y},{x:v,y:u.y}],$=[{x:c.x,y},{x:u.x,y}];a[f]===p?g=f==="x"?k:$:g=f==="x"?$:k}else{const k=[{x:c.x,y:u.y}],$=[{x:u.x,y:c.y}];if(f==="x"?g=a.x===p?$:k:g=a.y===p?k:$,t===o){const w=Math.abs(e[f]-n[f]);if(w<=i){const N=Math.min(i-1,i-w);a[f]===p?m[f]=(c[f]>e[f]?-1:1)*N:b[f]=(u[f]>n[f]?-1:1)*N}}if(t!==o){const w=f==="x"?"y":"x",N=a[f]===l[w],E=c[w]>u[w],I=c[w]<u[w];(a[f]===1&&(!N&&E||N&&I)||a[f]!==1&&(!N&&I||N&&E))&&(g=f==="x"?k:$)}const B={x:c.x+m.x,y:c.y+m.y},M={x:u.x+b.x,y:u.y+b.y},T=Math.max(Math.abs(B.x-g[0].x),Math.abs(M.x-g[0].x)),R=Math.max(Math.abs(B.y-g[0].y),Math.abs(M.y-g[0].y));T>=R?(v=(B.x+M.x)/2,y=g[0].y):(v=g[0].x,y=(B.y+M.y)/2)}const S={x:c.x+m.x,y:c.y+m.y},_={x:u.x+b.x,y:u.y+b.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,..._.x!==g[g.length-1].x||_.y!==g[g.length-1].y?[_]:[],n],v,y,h,x]}function kd(e,t,n,o){const r=Math.min(Zo(e,t)/2,Zo(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function Yn({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:o,targetY:r,targetPosition:i=Z.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,p,g,v]=Id({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});let y=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)y+=kd(d[m-1],d[m],d[m+1],s);return y+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[y,f,p,g,v]}function Wo(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Ad(e){const{sourceNode:t,targetNode:n}=e;if(!Wo(t)||!Wo(n))return null;const o=t.internals.handleBounds||qo(t.handles),r=n.internals.handleBounds||qo(n.handles),i=Go(o?.source??[],e.sourceHandle),s=Go(e.connectionMode===rt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",pe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Z.Bottom,l=s?.position||Z.Top,c=We(t,i,a),u=We(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function qo(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function We(e,t,n=Z.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??$e(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Z.Top:return{x:r+s/2,y:i};case Z.Right:return{x:r+s,y:i+a/2};case Z.Bottom:return{x:r+s/2,y:i+a};case Z.Left:return{x:r,y:i+a/2}}}function Go(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function $d(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=Zn(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Mi=1e3,Pd=10,so={nodeOrigin:[0,0],nodeExtent:bt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Dd={...so,checkEquality:!0};function ao(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function zd(e,t,n){const o=ao(so,n);for(const r of e.values())if(r.parentId)lo(r,e,t,o);else{const i=It(r,o.nodeOrigin),s=Ze(r.extent)?r.extent:o.nodeExtent,a=Ye(i,s,$e(r));r.internals.positionAbsolute=a}}function Td(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function co(e){return e==="manual"}function Wn(e,t,n,o={}){const r=ao(Dd,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!co(r.zIndexMode)?Mi:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let d=s.get(u.id);if(r.checkEquality&&u===d?.internals.userNode)t.set(u.id,d);else{const f=It(u,r.nodeOrigin),p=Ze(u.extent)?u.extent:r.nodeExtent,g=Ye(f,p,$e(u));d={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:g,handleBounds:Td(u,d),z:Ii(u,a,r.zIndexMode),userNode:u}},t.set(u.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(l=!1),u.parentId&&lo(d,t,n,o,i),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function Hd(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function lo(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=ao(so,o),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Hd(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*Pd),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const d=i&&!co(l)?Mi:0,{x:f,y:p,z:g}=Rd(e,u,s,a,d,l),{positionAbsolute:v}=e.internals,y=f!==v.x||p!==v.y;(y||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:f,y:p}:v,z:g}})}function Ii(e,t,n){const o=he(e.zIndex)?e.zIndex:0;return co(n)?o:o+(e.selected?t:0)}function Rd(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=$e(e),c=It(e,n),u=Ze(e.extent)?Ye(c,e.extent,l):c;let d=Ye({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(d=pi(d,l,t));const f=Ii(e,r,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function uo(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??st(a),c=mi(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,u=$e(a),d=a.origin??o,f=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,p=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(u.width,Math.round(s.width)),v=Math.max(u.height,Math.round(s.height)),y=(g-u.width)*d[0],m=(v-u.height)*d[1];(f>0||p>0||y||m)&&(r.push({id:l,type:"position",position:{x:a.position.x-f+y,y:a.position.y-p+m}}),n.get(l)?.forEach(b=>{e.some(h=>h.id===b.id)||r.push({id:b.id,type:"position",position:{x:b.position.x+f,y:b.position.y+p}})})),(u.width<s.width||u.height<s.height||f||p)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(f?d[0]*f-y:0),height:v+(p?d[1]*p-m:0)}})}),r}function Ld(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const p of e.values()){const g=t.get(p.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const v=io(p.nodeElement),y=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(y||!g.internals.handleBounds||p.force))){const b=p.nodeElement.getBoundingClientRect(),h=Ze(g.extent)?g.extent:i;let{positionAbsolute:x}=g.internals;g.parentId&&g.extent==="parent"?x=pi(x,v,t.get(g.parentId)):h&&(x=Ye(x,h,v));const S={...g,measured:v,internals:{...g.internals,positionAbsolute:x,handleBounds:{source:Xo("source",p.nodeElement,b,d,g.id),target:Xo("target",p.nodeElement,b,d,g.id)}}};t.set(g.id,S),g.parentId&&lo(S,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,y&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:st(S,r)}))}}if(f.length>0){const p=uo(f,t,n,r);c.push(...p)}return{changes:c,updatedInternals:l}}async function Vd({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function Ko(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function ki(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Ko("source",l,u,e,r,s),Ko("target",l,c,e,i,a),t.set(o.id,o)}}function Ai(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ai(n,t):!1}function Uo(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function Od(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Ai(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function In({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Bd({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=At(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Fd({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,g=!1,v=null;function y({noDragClassName:b,handleSelector:h,domNode:x,isSelectable:S,nodeId:_,nodeClickDistance:C=0}){f=ce(x);function k({x:T,y:R}){const{nodeLookup:w,nodeExtent:N,snapGrid:E,snapToGrid:I,nodeOrigin:z,onNodeDrag:P,onSelectionDrag:V,onError:O,updateNodePositions:L}=t();i={x:T,y:R};let j=!1;const X=a.size>1,q=X&&N?jn(kt(a)):null,Q=X&&I?Bd({dragItems:a,snapGrid:E,x:T,y:R}):null;for(const[W,H]of a){if(!w.has(W))continue;let F={x:T-H.distance.x,y:R-H.distance.y};I&&(F=Q?{x:Math.round(F.x+Q.x),y:Math.round(F.y+Q.y)}:At(F,E));let U=null;if(X&&N&&!H.extent&&q){const{positionAbsolute:G}=H.internals,J=G.x-q.x+N[0][0],te=G.x+H.measured.width-q.x2+N[1][0],re=G.y-q.y+N[0][1],ae=G.y+H.measured.height-q.y2+N[1][1];U=[[J,re],[te,ae]]}const{position:K,positionAbsolute:Y}=gi({nodeId:W,nextPosition:F,nodeLookup:w,nodeExtent:U||N,nodeOrigin:z,onError:O});j=j||H.position.x!==K.x||H.position.y!==K.y,H.position=K,H.internals.positionAbsolute=Y}if(g=g||j,!!j&&(L(a,!0),v&&(o||P||!_&&V))){const[W,H]=In({nodeId:_,dragItems:a,nodeLookup:w});o?.(v,a,W,H),P?.(v,W,H),_||V?.(v,H)}}async function $(){if(!u)return;const{transform:T,panBy:R,autoPanSpeed:w,autoPanOnNodeDrag:N}=t();if(!N){l=!1,cancelAnimationFrame(s);return}const[E,I]=oo(c,u,w);(E!==0||I!==0)&&(i.x=(i.x??0)-E/T[2],i.y=(i.y??0)-I/T[2],await R({x:E,y:I})&&k(i)),s=requestAnimationFrame($)}function B(T){const{nodeLookup:R,multiSelectionActive:w,nodesDraggable:N,transform:E,snapGrid:I,snapToGrid:z,selectNodesOnDrag:P,onNodeDragStart:V,onSelectionDragStart:O,unselectNodesAndEdges:L}=t();d=!0,(!P||!S)&&!w&&_&&(R.get(_)?.selected||L()),S&&P&&_&&e?.(_);const j=mt(T.sourceEvent,{transform:E,snapGrid:I,snapToGrid:z,containerBounds:u});if(i=j,a=Od(R,N,j,_),a.size>0&&(n||V||!_&&O)){const[X,q]=In({nodeId:_,dragItems:a,nodeLookup:R});n?.(T.sourceEvent,a,X,q),V?.(T.sourceEvent,X,q),_||O?.(T.sourceEvent,q)}}const M=Or().clickDistance(C).on("start",T=>{const{domNode:R,nodeDragThreshold:w,transform:N,snapGrid:E,snapToGrid:I}=t();u=R?.getBoundingClientRect()||null,p=!1,g=!1,v=T.sourceEvent,w===0&&B(T),i=mt(T.sourceEvent,{transform:N,snapGrid:E,snapToGrid:I,containerBounds:u}),c=ge(T.sourceEvent,u)}).on("drag",T=>{const{autoPanOnNodeDrag:R,transform:w,snapGrid:N,snapToGrid:E,nodeDragThreshold:I,nodeLookup:z}=t(),P=mt(T.sourceEvent,{transform:w,snapGrid:N,snapToGrid:E,containerBounds:u});if(v=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||_&&!z.has(_))&&(p=!0),!p){if(!l&&R&&d&&(l=!0,$()),!d){const V=ge(T.sourceEvent,u),O=V.x-c.x,L=V.y-c.y;Math.sqrt(O*O+L*L)>I&&B(T)}(i.x!==P.xSnapped||i.y!==P.ySnapped)&&a&&d&&(c=ge(T.sourceEvent,u),k(P))}}).on("end",T=>{if(!d||p){p&&a.size>0&&t().updateNodePositions(a,!1);return}if(l=!1,d=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:R,updateNodePositions:w,onNodeDragStop:N,onSelectionDragStop:E}=t();if(g&&(w(a,!1),g=!1),r||N||!_&&E){const[I,z]=In({nodeId:_,dragItems:a,nodeLookup:R,dragging:!1});r?.(T.sourceEvent,a,I,z),N?.(T.sourceEvent,I,z),_||E?.(T.sourceEvent,z)}}}).filter(T=>{const R=T.target;return!T.button&&(!b||!Uo(R,`.${b}`,x))&&(!h||Uo(R,h,x))});f.call(M)}function m(){f?.on(".drag",null)}return{update:y,destroy:m}}function Xd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Et(r,st(i))>0&&o.push(i);return o}const jd=250;function Yd(e,t,n,o){let r=[],i=1/0;const s=Xd(e,n,t+jd);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:u,y:d}=We(a,c,c.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(d-e.y,2));f>t||(f<i?(r=[{...c,x:u,y:d}],i=f):f===i&&r.push({...c,x:u,y:d}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function $i(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...We(s,l,l.position,!0)}:l}function Pi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Zd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Di=()=>!0;function Wd(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:g,onConnect:v,onConnectEnd:y,isValidConnection:m=Di,onReconnectEnd:b,updateConnection:h,getTransform:x,getFromHandle:S,autoPanSpeed:_,dragThreshold:C=1,handleDomNode:k}){const $=vi(e.target);let B=0,M;const{x:T,y:R}=ge(e),w=Pi(i,k),N=a?.getBoundingClientRect();let E=!1;if(!N||!w)return;const I=$i(r,w,o,l,t);if(!I)return;let z=ge(e,N),P=!1,V=null,O=!1,L=null;function j(){if(!u||!N)return;const[K,Y]=oo(z,N,_);f({x:K,y:Y}),B=requestAnimationFrame(j)}const X={...I,nodeId:r,type:w,position:I.position},q=l.get(r);let W={inProgress:!0,isValid:null,from:We(q,X,Z.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:q,to:z,toHandle:null,toPosition:Vo[X.position],toNode:null,pointer:z};function H(){E=!0,h(W),g?.(e,{nodeId:r,handleId:o,handleType:w})}C===0&&H();function F(K){if(!E){const{x:ae,y:Ee}=ge(K),ye=ae-T,xe=Ee-R;if(!(ye*ye+xe*xe>C*C))return;H()}if(!S()||!X){U(K);return}const Y=x();z=ge(K,N),M=Yd(lt(z,Y,!1,[1,1]),n,l,X),P||(j(),P=!0);const G=zi(K,{handle:M,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:m,doc:$,lib:c,flowId:d,nodeLookup:l});L=G.handleDomNode,V=G.connection,O=Zd(!!M,G.isValid);const J=l.get(r),te=J?We(J,X,Z.Left,!0):W.from,re={...W,from:te,isValid:O,to:G.toHandle&&O?at({x:G.toHandle.x,y:G.toHandle.y},Y):z,toHandle:G.toHandle,toPosition:O&&G.toHandle?G.toHandle.position:Vo[X.position],toNode:G.toHandle?l.get(G.toHandle.nodeId):null,pointer:z};h(re),W=re}function U(K){if(!("touches"in K&&K.touches.length>0)){if(E){(M||L)&&V&&O&&v?.(V);const{inProgress:Y,...G}=W,J={...G,toPosition:W.toHandle?W.toPosition:null};y?.(K,J),i&&b?.(K,J)}p(),cancelAnimationFrame(B),P=!1,O=!1,V=null,L=null,$.removeEventListener("mousemove",F),$.removeEventListener("mouseup",U),$.removeEventListener("touchmove",F),$.removeEventListener("touchend",U)}}$.addEventListener("mousemove",F),$.addEventListener("mouseup",U),$.addEventListener("touchmove",F),$.addEventListener("touchend",U)}function zi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=Di,nodeLookup:u}){const d=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=ge(e),v=s.elementFromPoint(p,g),y=v?.classList.contains(`${a}-flow__handle`)?v:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const b=Pi(void 0,y),h=y.getAttribute("data-nodeid"),x=y.getAttribute("data-handleid"),S=y.classList.contains("connectable"),_=y.classList.contains("connectableend");if(!h||!b)return m;const C={source:d?h:o,sourceHandle:d?x:r,target:d?o:h,targetHandle:d?r:x};m.connection=C;const $=S&&_&&(n===rt.Strict?d&&b==="source"||!d&&b==="target":h!==o||x!==r);m.isValid=$&&c(C),m.toHandle=$i(h,b,x,u,n,!0)}return m}const qn={onPointerDown:Wd,isValid:zi};function qd({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ce(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const g=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const x=n(),S=h.sourceEvent.ctrlKey&&St()?10:1,_=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*u,C=x[2]*Math.pow(2,_*S);t.scaleTo(C)};let v=[0,0];const y=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(v=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},m=h=>{const x=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const S=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],_=[S[0]-v[0],S[1]-v[1]];v=S;const C=o()*Math.max(x[2],Math.log(x[2]))*(p?-1:1),k={x:x[0]-_[0]*C,y:x[1]-_[1]*C},$=[[0,0],[l,c]];t.setViewportConstrained({x:k.x,y:k.y,zoom:x[2]},$,a)},b=ci().on("start",y).on("zoom",d?m:null).on("zoom.wheel",f?g:null);r.call(b,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:de}}const hn=e=>({x:e.x,y:e.y,zoom:e.k}),kn=({x:e,y:t,zoom:n})=>un.translate(e,t).scale(n),Ke=(e,t)=>e.target.closest(`.${t}`),Ti=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Gd=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,An=(e,t=0,n=Gd,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Hi=e=>{const t=e.ctrlKey&&St()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Kd({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Ke(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&s){const y=de(u),m=Hi(u),b=d*Math.pow(2,m);o.scaleTo(n,b,y,u);return}const f=u.deltaMode===1?20:1;let p=r===Fe.Vertical?0:u.deltaX*f,g=r===Fe.Horizontal?0:u.deltaY*f;!St()&&u.shiftKey&&r!==Fe.Vertical&&(p=u.deltaY*f,g=0),o.translateBy(n,-(p/d)*i,-(g/d)*i,{internal:!0});const v=hn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,v),e.panScrollTimeout=setTimeout(()=>{c?.(u,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(u,v))}}function Ud({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Ke(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Qd({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=hn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Jd({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Ti(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,hn(i.transform))}}function ef({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Ti(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=hn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function tf({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{const f=e||t,p=n&&d.ctrlKey,g=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ke(d,`${c}-flow__node`)||Ke(d,`${c}-flow__edge`)))return!0;if(!o&&!f&&!r&&!i&&!n||s||u&&!g||Ke(d,a)&&g||Ke(d,l)&&(!g||r&&g&&!e)||!n&&d.ctrlKey&&g)return!1;if(!n&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!r&&!p&&g||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||g)&&v}}function nf({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=ci().scaleExtent([t,n]).translateExtent(o),f=ce(e).call(d);b({x:r.x,y:r.y,zoom:it(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");d.wheelDelta(Hi);async function v(M,T){return f?new Promise(R=>{d?.interpolate(T?.interpolate==="linear"?tt:Bt).transform(An(f,T?.duration,T?.ease,()=>R(!0)),M)}):!1}function y({noWheelClassName:M,noPanClassName:T,onPaneContextMenu:R,userSelectionActive:w,panOnScroll:N,panOnDrag:E,panOnScrollMode:I,panOnScrollSpeed:z,preventScrolling:P,zoomOnPinch:V,zoomOnScroll:O,zoomOnDoubleClick:L,zoomActivationKeyPressed:j,lib:X,onTransformChange:q,connectionInProgress:Q,paneClickDistance:W,selectionOnDrag:H}){w&&!c.isZoomingOrPanning&&m();const F=N&&!j&&!w;d.clickDistance(H?1/0:!he(W)||W<0?0:W);const U=F?Kd({zoomPanValues:c,noWheelClassName:M,d3Selection:f,d3Zoom:d,panOnScrollMode:I,panOnScrollSpeed:z,zoomOnPinch:V,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Ud({noWheelClassName:M,preventScrolling:P,d3ZoomHandler:p});f.on("wheel.zoom",U,{passive:!1});const K=Qd({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",K);const Y=Jd({zoomPanValues:c,panOnDrag:E,onPaneContextMenu:!!R,onPanZoom:i,onTransformChange:q});d.on("zoom",Y);const G=ef({zoomPanValues:c,panOnDrag:E,panOnScroll:N,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:l});d.on("end",G);const J=tf({zoomActivationKeyPressed:j,panOnDrag:E,zoomOnScroll:O,panOnScroll:N,zoomOnDoubleClick:L,zoomOnPinch:V,userSelectionActive:w,noPanClassName:T,noWheelClassName:M,lib:X,connectionInProgress:Q});d.filter(J),L?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function b(M,T,R){const w=kn(M),N=d?.constrain()(w,T,R);return N&&await v(N),N}async function h(M,T){const R=kn(M);return await v(R,T),R}function x(M){if(f){const T=kn(M),R=f.property("__zoom");(R.k!==M.zoom||R.x!==M.x||R.y!==M.y)&&d?.transform(f,T,null,{sync:!0})}}function S(){const M=f?ai(f.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}async function _(M,T){return f?new Promise(R=>{d?.interpolate(T?.interpolate==="linear"?tt:Bt).scaleTo(An(f,T?.duration,T?.ease,()=>R(!0)),M)}):!1}async function C(M,T){return f?new Promise(R=>{d?.interpolate(T?.interpolate==="linear"?tt:Bt).scaleBy(An(f,T?.duration,T?.ease,()=>R(!0)),M)}):!1}function k(M){d?.scaleExtent(M)}function $(M){d?.translateExtent(M)}function B(M){const T=!he(M)||M<0?0:M;d?.clickDistance(T)}return{update:y,destroy:m,setViewport:h,setViewportConstrained:b,getViewport:S,scaleTo:_,scaleBy:C,setScaleExtent:k,setTranslateExtent:$,syncViewport:x,setClickDistance:B}}var ct;(function(e){e.Line="line",e.Handle="handle"})(ct||(ct={}));function of({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Qo(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Pe(e,t){return Math.max(0,t-e)}function De(e,t){return Math.max(0,e-t)}function Rt(e,t,n){return Math.max(0,t-e,e-n)}function Jo(e,t){return e?!t:t}function rf(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:g}=n,{minWidth:v,maxWidth:y,minHeight:m,maxHeight:b}=o,{x:h,y:x,width:S,height:_,aspectRatio:C}=e;let k=Math.floor(u?p-e.pointerX:0),$=Math.floor(d?g-e.pointerY:0);const B=S+(l?-k:k),M=_+(c?-$:$),T=-i[0]*S,R=-i[1]*_;let w=Rt(B,v,y),N=Rt(M,m,b);if(s){let z=0,P=0;l&&k<0?z=Pe(h+k+T,s[0][0]):!l&&k>0&&(z=De(h+B+T,s[1][0])),c&&$<0?P=Pe(x+$+R,s[0][1]):!c&&$>0&&(P=De(x+M+R,s[1][1])),w=Math.max(w,z),N=Math.max(N,P)}if(a){let z=0,P=0;l&&k>0?z=De(h+k,a[0][0]):!l&&k<0&&(z=Pe(h+B,a[1][0])),c&&$>0?P=De(x+$,a[0][1]):!c&&$<0&&(P=Pe(x+M,a[1][1])),w=Math.max(w,z),N=Math.max(N,P)}if(r){if(u){const z=Rt(B/C,m,b)*C;if(w=Math.max(w,z),s){let P=0;!l&&!c||l&&!c&&f?P=De(x+R+B/C,s[1][1])*C:P=Pe(x+R+(l?k:-k)/C,s[0][1])*C,w=Math.max(w,P)}if(a){let P=0;!l&&!c||l&&!c&&f?P=Pe(x+B/C,a[1][1])*C:P=De(x+(l?k:-k)/C,a[0][1])*C,w=Math.max(w,P)}}if(d){const z=Rt(M*C,v,y)/C;if(N=Math.max(N,z),s){let P=0;!l&&!c||c&&!l&&f?P=De(h+M*C+T,s[1][0])/C:P=Pe(h+(c?$:-$)*C+T,s[0][0])/C,N=Math.max(N,P)}if(a){let P=0;!l&&!c||c&&!l&&f?P=Pe(h+M*C,a[1][0])/C:P=De(h+(c?$:-$)*C,a[0][0])/C,N=Math.max(N,P)}}}$=$+($<0?N:-N),k=k+(k<0?w:-w),r&&(f?B>M*C?$=(Jo(l,c)?-k:k)/C:k=(Jo(l,c)?-$:$)*C:u?($=k/C,c=l):(k=$*C,l=c));const E=l?h+k:h,I=c?x+$:x;return{width:S+(l?-k:k),height:_+(c?-$:$),x:i[0]*k*(l?-1:1)+E,y:i[1]*$*(c?-1:1)+I}}const Ri={width:0,height:0,x:0,y:0},sf={...Ri,pointerX:0,pointerY:0,aspectRatio:1};function af(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function cf({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ce(e);let s={controlDirection:Qo("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:d,resizeDirection:f,onResizeStart:p,onResize:g,onResizeEnd:v,shouldResize:y}){let m={...Ri},b={...sf};s={boundaries:u,resizeDirection:f,keepAspectRatio:d,controlDirection:Qo(c)};let h,x=null,S=[],_,C,k,$=!1;const B=Or().on("start",M=>{const{nodeLookup:T,transform:R,snapGrid:w,snapToGrid:N,nodeOrigin:E,paneDomNode:I}=n();if(h=T.get(t),!h)return;x=I?.getBoundingClientRect()??null;const{xSnapped:z,ySnapped:P}=mt(M.sourceEvent,{transform:R,snapGrid:w,snapToGrid:N,containerBounds:x});m={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},b={...m,pointerX:z,pointerY:P,aspectRatio:m.width/m.height},_=void 0,C=Ze(h.extent)?h.extent:void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(_=T.get(h.parentId)),_&&h.extent==="parent"&&(C=[[0,0],[_.measured.width,_.measured.height]]),S=[],k=void 0;for(const[V,O]of T)if(O.parentId===t&&(S.push({id:V,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const L=af(O,h,O.origin??E);k?k=[[Math.min(L[0][0],k[0][0]),Math.min(L[0][1],k[0][1])],[Math.max(L[1][0],k[1][0]),Math.max(L[1][1],k[1][1])]]:k=L}p?.(M,{...m})}).on("drag",M=>{const{transform:T,snapGrid:R,snapToGrid:w,nodeOrigin:N}=n(),E=mt(M.sourceEvent,{transform:T,snapGrid:R,snapToGrid:w,containerBounds:x}),I=[];if(!h)return;const{x:z,y:P,width:V,height:O}=m,L={},j=h.origin??N,{width:X,height:q,x:Q,y:W}=rf(b,s.controlDirection,E,s.boundaries,s.keepAspectRatio,j,C,k),H=X!==V,F=q!==O,U=Q!==z&&H,K=W!==P&&F;if(!U&&!K&&!H&&!F)return;if((U||K||j[0]===1||j[1]===1)&&(L.x=U?Q:m.x,L.y=K?W:m.y,m.x=L.x,m.y=L.y,S.length>0)){const te=Q-z,re=W-P;for(const ae of S)ae.position={x:ae.position.x-te+j[0]*(X-V),y:ae.position.y-re+j[1]*(q-O)},I.push(ae)}if((H||F)&&(L.width=H&&(!s.resizeDirection||s.resizeDirection==="horizontal")?X:m.width,L.height=F&&(!s.resizeDirection||s.resizeDirection==="vertical")?q:m.height,m.width=L.width,m.height=L.height),_&&h.expandParent){const te=j[0]*(L.width??0);L.x&&L.x<te&&(m.x=te,b.x=b.x-(L.x-te));const re=j[1]*(L.height??0);L.y&&L.y<re&&(m.y=re,b.y=b.y-(L.y-re))}const Y=of({width:m.width,prevWidth:V,height:m.height,prevHeight:O,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),G={...m,direction:Y};y?.(M,G)!==!1&&($=!0,g?.(M,G),o(L,I))}).on("end",M=>{$&&(v?.(M,{...m}),r?.({...m}),$=!1)});i.call(B)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}var $n={exports:{}},Pn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var er;function lf(){if(er)return Pn;er=1;var e=Ea(),t=Ca();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Pn.useSyncExternalStoreWithSelector=function(c,u,d,f,p){var g=i(null);if(g.current===null){var v={hasValue:!1,value:null};g.current=v}else v=g.current;g=a(function(){function m(_){if(!b){if(b=!0,h=_,_=f(_),p!==void 0&&v.hasValue){var C=v.value;if(p(C,_))return x=C}return x=_}if(C=x,o(h,_))return C;var k=f(_);return p!==void 0&&p(C,k)?(h=_,C):(h=_,x=k)}var b=!1,h,x,S=d===void 0?null:d;return[function(){return m(u())},S===null?void 0:function(){return m(S())}]},[u,d,f,p]);var y=r(c,g[0],g[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},Pn}var tr;function uf(){return tr||(tr=1,$n.exports=lf()),$n.exports}var df=uf();const ff=Sa(df),hf={},nr=e=>{let t;const n=new Set,o=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,p))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(hf?"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."),n.clear()}},c=t=e(o,r,l);return l},gf=e=>e?nr(e):nr,{useDebugValue:pf}=Na,{useSyncExternalStoreWithSelector:mf}=ff,yf=e=>e;function Li(e,t=yf,n){const o=mf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return pf(o),o}const or=(e,t)=>{const n=gf(e),o=(r,i=t)=>Li(n,r,i);return Object.assign(o,n),o},xf=(e,t)=>e?or(e,t):or;function ne(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const gn=D.createContext(null),wf=gn.Provider,Vi=pe.error001("react");function ee(e,t){const n=D.useContext(gn);if(n===null)throw new Error(Vi);return Li(n,e,t)}function oe(){const e=D.useContext(gn);if(e===null)throw new Error(Vi);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const rr={display:"none"},vf={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Oi="react-flow__node-desc",Bi="react-flow__edge-desc",bf="react-flow__aria-live",_f=e=>e.ariaLiveMessage,Ef=e=>e.ariaLabelConfig;function Sf({rfId:e}){const t=ee(_f);return A.jsx("div",{id:`${bf}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vf,children:t})}function Nf({rfId:e,disableKeyboardA11y:t}){const n=ee(Ef);return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:`${Oi}-${e}`,style:rr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),A.jsx("div",{id:`${Bi}-${e}`,style:rr,children:n["edge.a11yDescription.default"]}),!t&&A.jsx(Sf,{rfId:e})]})}const pn=D.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return A.jsx("div",{className:ie(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});pn.displayName="Panel";function Cf({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:A.jsx(pn,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:A.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Mf=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Lt=e=>e.id;function If(e,t){return ne(e.selectedNodes.map(Lt),t.selectedNodes.map(Lt))&&ne(e.selectedEdges.map(Lt),t.selectedEdges.map(Lt))}function kf({onSelectionChange:e}){const t=oe(),{selectedNodes:n,selectedEdges:o}=ee(Mf,If);return D.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const Af=e=>!!e.onSelectionChangeHandlers;function $f({onSelectionChange:e}){const t=ee(Af);return e||t?A.jsx(kf,{onSelectionChange:e}):null}const Fi=[0,0],Pf={x:0,y:0,zoom:1},Df=["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"],ir=[...Df,"rfId"],zf=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),sr={translateExtent:bt,nodeOrigin:Fi,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Tf(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ee(zf,ne),c=oe();D.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=sr,a()}),[]);const u=D.useRef(sr);return D.useEffect(()=>{for(const d of ir){const f=e[d],p=u.current[d];f!==p&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?o(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?c.setState({ariaLabelConfig:vd(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}u.current=e},ir.map(d=>e[d])),null}function ar(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Hf(e){const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const o=ar(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:ar()?.matches?"dark":"light"}const cr=typeof document<"u"?document:null;function Nt(e=null,t={target:cr,actInsideInputWithModifier:!0}){const[n,o]=D.useState(!1),r=D.useRef(!1),i=D.useRef(new Set([])),[s,a]=D.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
|
|
10
|
+
`).replace(`
|
|
11
|
+
|
|
12
|
+
`,`
|
|
13
|
+
+`).split(`
|
|
14
|
+
`)),u=c.reduce((d,f)=>d.concat(...f),[]);return[c,u]}return[[],[]]},[e]);return D.useEffect(()=>{const l=t?.target??cr,c=t?.actInsideInputWithModifier??!0;if(e!==null){const u=p=>{if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!c)&&bi(p))return!1;const v=ur(p.code,a);if(i.current.add(p[v]),lr(s,i.current,!1)){const y=p.composedPath?.()?.[0]||p.target,m=y?.nodeName==="BUTTON"||y?.nodeName==="A";t.preventDefault!==!1&&(r.current||!m)&&p.preventDefault(),o(!0)}},d=p=>{const g=ur(p.code,a);lr(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(p[g]),p.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),o(!1)};return l?.addEventListener("keydown",u),l?.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{l?.removeEventListener("keydown",u),l?.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function lr(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function ur(e,t){return t.includes(e)?"code":"key"}const Rf=()=>{const e=oe();return D.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=ro(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),c={x:t.x-a,y:t.y-l},u=n.snapGrid??r,d=n.snapToGrid??i;return lt(c,o,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=at(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function Xi(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)Lf(l,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Lf(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ji(e,t){return Xi(e,t)}function Yi(e,t){return Xi(e,t)}function Ve(e,t){return{id:e,type:"select",selected:t}}function Ue(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(Ve(i.id,s)))}return o}function dr({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function fr(e){return{id:e.id,type:"remove"}}const Vf=yi();function Of(e,t,n={}){return Cd(e,t,{...n,onError:n.onError??Vf})}const hr=e=>dd(e),Bf=e=>hi(e);function Zi(e){return D.forwardRef(e)}const Ff=typeof window<"u"?D.useLayoutEffect:D.useEffect;function gr(e){const[t,n]=D.useState(BigInt(0)),[o]=D.useState(()=>Xf(()=>n(r=>r+BigInt(1))));return Ff(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function Xf(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Wi=D.createContext(null);function jf({children:e}){const t=oe(),n=D.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:u,onNodesChange:d,nodeLookup:f,fitViewQueued:p,onNodesChangeMiddlewareMap:g}=t.getState();let v=l;for(const m of a)v=typeof m=="function"?m(v):m;let y=dr({items:v,lookup:f});for(const m of g.values())y=m(y);u&&c(v),y.length>0?d?.(y):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:b,setNodes:h}=t.getState();m&&h(b)})},[]),o=gr(n),r=D.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:d,edgeLookup:f}=t.getState();let p=l;for(const g of a)p=typeof g=="function"?g(p):g;u?c(p):d&&d(dr({items:p,lookup:f}))},[]),i=gr(r),s=D.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return A.jsx(Wi.Provider,{value:s,children:e})}function Yf(){const e=D.useContext(Wi);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Zf=e=>!!e.panZoom;function fo(){const e=Rf(),t=oe(),n=Yf(),o=ee(Zf),r=D.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},l=d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState(),g=hr(d)?d:f.get(d.id),v=g.parentId?wi(g.position,g.measured,g.parentId,f,p):g.position,y={...g,position:v,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return st(y)},c=(d,f,p={replace:!1})=>{s(g=>g.map(v=>{if(v.id===d){const y=typeof f=="function"?f(v):f;return p.replace&&hr(y)?y:{...v,...y}}return v}))},u=(d,f,p={replace:!1})=>{a(g=>g.map(v=>{if(v.id===d){const y=typeof f=="function"?f(v):f;return p.replace&&Bf(y)?y:{...v,...y}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>i(d)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:a,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[g,v,y]=p;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:g,y:v,zoom:y}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:g,onNodesDelete:v,onEdgesDelete:y,triggerNodeChanges:m,triggerEdgeChanges:b,onDelete:h,onBeforeDelete:x}=t.getState(),{nodes:S,edges:_}=await md({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:g,onBeforeDelete:x}),C=_.length>0,k=S.length>0;if(C){const $=_.map(fr);y?.(_),b($)}if(k){const $=S.map(fr);v?.(S),m($)}return(k||C)&&h?.({nodes:S,edges:_}),{deletedNodes:S,deletedEdges:_}},getIntersectingNodes:(d,f=!0,p)=>{const g=Bo(d),v=g?d:l(d),y=p!==void 0;return v?(p||t.getState().nodes).filter(m=>{const b=t.getState().nodeLookup.get(m.id);if(b&&!g&&(m.id===d.id||!b.internals.positionAbsolute))return!1;const h=st(y?m:b),x=Et(h,v);return f&&x>0||x>=h.width*h.height||x>=v.width*v.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const v=Bo(d)?d:l(d);if(!v)return!1;const y=Et(v,f);return p&&y>0||y>=f.width*f.height||y>=v.width*v.height},updateNode:c,updateNodeData:(d,f,p={replace:!1})=>{c(d,g=>{const v=typeof f=="function"?f(g):f;return p.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},p)},updateEdge:u,updateEdgeData:(d,f,p={replace:!1})=>{u(d,g=>{const v=typeof f=="function"?f(g):f;return p.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return fd(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>Array.from(t.getState().connectionLookup.get(`${p}-${d}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:d,handleId:f,nodeId:p})=>Array.from(t.getState().connectionLookup.get(`${p}${d?f?`-${d}-${f}`:`-${d}`:""}`)?.values()??[]),fitView:async d=>{const f=t.getState().fitViewResolver??wd();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return D.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const pr=e=>e.selected,Wf=typeof window<"u"?window:void 0;function qf({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=oe(),{deleteElements:o}=fo(),r=Nt(e,{actInsideInputWithModifier:!1}),i=Nt(t,{target:Wf});D.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(pr),edges:s.filter(pr)}),n.setState({nodesSelectionActive:!1})}},[r]),D.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Gf(e){const t=oe();D.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=io(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",pe.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const mn={position:"absolute",width:"100%",height:"100%",top:0,left:0},Kf=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Uf({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Fe.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:g,noWheelClassName:v,noPanClassName:y,onViewportChange:m,isControlledViewport:b,paneClickDistance:h,selectionOnDrag:x}){const S=oe(),_=D.useRef(null),{userSelectionActive:C,lib:k,connectionInProgress:$}=ee(Kf,ne),B=Nt(f),M=D.useRef();Gf(_);const T=D.useCallback(R=>{m?.({x:R[0],y:R[1],zoom:R[2]}),b||S.setState({transform:R})},[m,b]);return D.useEffect(()=>{if(_.current){M.current=nf({domNode:_.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:l,onDraggingChange:E=>S.setState(I=>I.paneDragging===E?I:{paneDragging:E}),onPanZoomStart:(E,I)=>{const{onViewportChangeStart:z,onMoveStart:P}=S.getState();P?.(E,I),z?.(I)},onPanZoom:(E,I)=>{const{onViewportChange:z,onMove:P}=S.getState();P?.(E,I),z?.(I)},onPanZoomEnd:(E,I)=>{const{onViewportChangeEnd:z,onMoveEnd:P}=S.getState();P?.(E,I),z?.(I)}});const{x:R,y:w,zoom:N}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[R,w,N],domNode:_.current.closest(".react-flow")}),()=>{M.current?.destroy()}}},[]),D.useEffect(()=>{M.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:B,preventScrolling:p,noPanClassName:y,userSelectionActive:C,noWheelClassName:v,lib:k,onTransformChange:T,connectionInProgress:$,selectionOnDrag:x,paneClickDistance:h})},[e,t,n,o,r,i,s,a,B,p,y,C,v,k,T,$,x,h]),A.jsx("div",{className:"react-flow__renderer",ref:_,style:mn,children:g})}const Qf=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Jf(){const{userSelectionActive:e,userSelectionRect:t}=ee(Qf,ne);return e&&t?A.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Dn=(e,t)=>n=>{n.target===t.current&&e?.(n)},eh=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function th({isSelecting:e,selectionKeyPressed:t,selectionMode:n=_t.Full,panOnDrag:o,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:g,children:v}){const y=D.useRef(0),m=oe(),{userSelectionActive:b,elementsSelectable:h,dragging:x,connectionInProgress:S,panBy:_,autoPanSpeed:C}=ee(eh,ne),k=h&&(e||b),$=D.useRef(null),B=D.useRef(),M=D.useRef(new Set),T=D.useRef(new Set),R=D.useRef(!1),w=D.useRef({x:0,y:0}),N=D.useRef(!1),E=H=>{if(R.current||S){R.current=!1;return}c?.(H),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},I=H=>{if(Array.isArray(o)&&o?.includes(2)){H.preventDefault();return}u?.(H)},z=d?H=>d(H):void 0,P=H=>{R.current&&(H.stopPropagation(),R.current=!1)},V=H=>{const{domNode:F,transform:U}=m.getState();if(B.current=F?.getBoundingClientRect(),!B.current)return;const K=H.target===$.current;if(!K&&!!H.target.closest(".nokey")||!e||!(s&&K||t)||H.button!==0||!H.isPrimary)return;H.target?.setPointerCapture?.(H.pointerId),R.current=!1;const{x:J,y:te}=ge(H.nativeEvent,B.current),re=lt({x:J,y:te},U);m.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:J,y:te}}),K||(H.stopPropagation(),H.preventDefault())};function O(H,F){const{userSelectionRect:U}=m.getState();if(!U)return;const{transform:K,nodeLookup:Y,edgeLookup:G,connectionLookup:J,triggerNodeChanges:te,triggerEdgeChanges:re,defaultEdgeOptions:ae}=m.getState(),Ee={x:U.startX,y:U.startY},{x:ye,y:xe}=at(Ee,K),Se={startX:Ee.x,startY:Ee.y,x:H<ye?H:ye,y:F<xe?F:xe,width:Math.abs(H-ye),height:Math.abs(F-xe)},ut=M.current,He=T.current;M.current=new Set(no(Y,Se,K,n===_t.Partial,!0).map(ue=>ue.id)),T.current=new Set;const Re=ae?.selectable??!0;for(const ue of M.current){const Ne=J.get(ue);if(Ne)for(const{edgeId:Ce}of Ne.values()){const Le=G.get(Ce);Le&&(Le.selectable??Re)&&T.current.add(Ce)}}if(!Fo(ut,M.current)){const ue=Ue(Y,M.current,!0);te(ue)}if(!Fo(He,T.current)){const ue=Ue(G,T.current);re(ue)}m.setState({userSelectionRect:Se,userSelectionActive:!0,nodesSelectionActive:!1})}function L(){if(!r||!B.current)return;const[H,F]=oo(w.current,B.current,C);_({x:H,y:F}).then(U=>{if(!R.current||!U){y.current=requestAnimationFrame(L);return}const{x:K,y:Y}=w.current;O(K,Y),y.current=requestAnimationFrame(L)})}const j=()=>{cancelAnimationFrame(y.current),y.current=0,N.current=!1};D.useEffect(()=>()=>j(),[]);const X=H=>{const{userSelectionRect:F,transform:U,resetSelectedElements:K}=m.getState();if(!B.current||!F)return;const{x:Y,y:G}=ge(H.nativeEvent,B.current);w.current={x:Y,y:G};const J=at({x:F.startX,y:F.startY},U);if(!R.current){const te=t?0:i;if(Math.hypot(Y-J.x,G-J.y)<=te)return;K(),a?.(H)}R.current=!0,N.current||(L(),N.current=!0),O(Y,G)},q=H=>{H.button===0&&(H.target?.releasePointerCapture?.(H.pointerId),!b&&H.target===$.current&&m.getState().userSelectionRect&&E?.(H),m.setState({userSelectionActive:!1,userSelectionRect:null}),R.current&&(l?.(H),m.setState({nodesSelectionActive:M.current.size>0})),j())},Q=H=>{H.target?.releasePointerCapture?.(H.pointerId),j()},W=o===!0||Array.isArray(o)&&o.includes(0);return A.jsxs("div",{className:ie(["react-flow__pane",{draggable:W,dragging:x,selection:e}]),onClick:k?void 0:Dn(E,$),onContextMenu:Dn(I,$),onWheel:Dn(z,$),onPointerEnter:k?void 0:f,onPointerMove:k?X:p,onPointerUp:k?q:void 0,onPointerCancel:k?Q:void 0,onPointerDownCapture:k?V:void 0,onClickCapture:k?P:void 0,onPointerLeave:g,ref:$,style:mn,children:[v,A.jsx(Jf,{})]})}function Gn({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),c=a.get(e);if(!c){l?.("012",pe.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function qi({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=oe(),[l,c]=D.useState(!1),u=D.useRef();return D.useEffect(()=>{u.current=Fd({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{Gn({id:d,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),D.useEffect(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{u.current?.destroy()}},[n,o,t,i,e,r,s]),l}const nh=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Gi(){const e=oe();return D.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:u}=e.getState(),d=new Map,f=nh(s),p=r?i[0]:5,g=r?i[1]:5,v=n.direction.x*p*n.factor,y=n.direction.y*g*n.factor;for(const[,m]of c){if(!f(m))continue;let b={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+y};r&&(b=At(b,i));const{position:h,positionAbsolute:x}=gi({nodeId:m.id,nextPosition:b,nodeLookup:c,nodeExtent:o,nodeOrigin:u,onError:a});m.position=h,m.internals.positionAbsolute=x,d.set(m.id,m)}l(d)},[])}const ho=D.createContext(null),oh=ho.Provider;ho.Consumer;const Ki=()=>D.useContext(ho),rh=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ih=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:l,isValid:c}=s,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===rt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&c}};function sh({type:e="source",position:t=Z.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},p){const g=s||null,v=e==="target",y=oe(),m=Ki(),{connectOnClick:b,noPanClassName:h,rfId:x}=ee(rh,ne),{connectingFrom:S,connectingTo:_,clickConnecting:C,isPossibleEndHandle:k,connectionInProcess:$,clickConnectionInProcess:B,valid:M}=ee(ih(m,g,e),ne);m||y.getState().onError?.("010",pe.error010());const T=N=>{const{defaultEdgeOptions:E,onConnect:I,hasDefaultEdges:z}=y.getState(),P={...E,...N};if(z){const{edges:V,setEdges:O,onError:L}=y.getState();O(Of(P,V,{onError:L}))}I?.(P),a?.(P)},R=N=>{if(!m)return;const E=_i(N.nativeEvent);if(r&&(E&&N.button===0||!E)){const I=y.getState();qn.onPointerDown(N.nativeEvent,{handleDomNode:N.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:v,handleId:g,nodeId:m,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...z)=>y.getState().onConnectEnd?.(...z),updateConnection:I.updateConnection,onConnect:T,isValidConnection:n||((...z)=>y.getState().isValidConnection?.(...z)??!0),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}E?u?.(N):d?.(N)},w=N=>{const{onClickConnectStart:E,onClickConnectEnd:I,connectionClickStartHandle:z,connectionMode:P,isValidConnection:V,lib:O,rfId:L,nodeLookup:j,connection:X}=y.getState();if(!m||!z&&!r)return;if(!z){E?.(N.nativeEvent,{nodeId:m,handleId:g,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:m,type:e,id:g}});return}const q=vi(N.target),Q=n||V,{connection:W,isValid:H}=qn.isValid(N.nativeEvent,{handle:{nodeId:m,id:g,type:e},connectionMode:P,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:Q,flowId:L,doc:q,lib:O,nodeLookup:j});H&&W&&T(W);const F=structuredClone(X);delete F.inProgress,F.toPosition=F.toHandle?F.toHandle.position:null,I?.(N,F),y.setState({connectionClickStartHandle:null})};return A.jsx("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":t,"data-id":`${x}-${m}-${g}-${e}`,className:ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",h,c,{source:!v,target:v,connectable:o,connectablestart:r,connectableend:i,clickconnecting:C,connectingfrom:S,connectingto:_,valid:M,connectionindicator:o&&(!$||k)&&($||B?i:r)}]),onMouseDown:R,onTouchStart:R,onClick:b?w:void 0,ref:p,...f,children:l})}const tn=D.memo(Zi(sh));function ah({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return A.jsxs(A.Fragment,{children:[e?.label,A.jsx(tn,{type:"source",position:n,isConnectable:t})]})}function ch({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:o=Z.Bottom}){return A.jsxs(A.Fragment,{children:[A.jsx(tn,{type:"target",position:n,isConnectable:t}),e?.label,A.jsx(tn,{type:"source",position:o,isConnectable:t})]})}function lh(){return null}function uh({data:e,isConnectable:t,targetPosition:n=Z.Top}){return A.jsxs(A.Fragment,{children:[A.jsx(tn,{type:"target",position:n,isConnectable:t}),e?.label]})}const nn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},mr={input:ah,default:ch,output:uh,group:lh};function dh(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const fh=e=>{const{width:t,height:n,x:o,y:r}=kt(e.nodeLookup,{filter:i=>!!i.selected});return{width:he(t)?t:null,height:he(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function hh({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=oe(),{width:r,height:i,transformString:s,userSelectionActive:a}=ee(fh,ne),l=Gi(),c=D.useRef(null);D.useEffect(()=>{n||c.current?.focus({preventScroll:!0})},[n]);const u=!a&&r!==null&&i!==null;if(qi({nodeRef:c,disabled:!u}),!u)return null;const d=e?p=>{const g=o.getState().nodes.filter(v=>v.selected);e(p,g)}:void 0,f=p=>{Object.prototype.hasOwnProperty.call(nn,p.key)&&(p.preventDefault(),l({direction:nn[p.key],factor:p.shiftKey?4:1}))};return A.jsx("div",{className:ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:A.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:r,height:i}})})}const yr=typeof window<"u"?window:void 0,gh=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Ui({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:g,panActivationKeyCode:v,zoomActivationKeyCode:y,elementsSelectable:m,zoomOnScroll:b,zoomOnPinch:h,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:C,panOnDrag:k,autoPanOnSelection:$,defaultViewport:B,translateExtent:M,minZoom:T,maxZoom:R,preventScrolling:w,onSelectionContextMenu:N,noWheelClassName:E,noPanClassName:I,disableKeyboardA11y:z,onViewportChange:P,isControlledViewport:V}){const{nodesSelectionActive:O,userSelectionActive:L}=ee(gh,ne),j=Nt(c,{target:yr}),X=Nt(v,{target:yr}),q=X||k,Q=X||x,W=u&&q!==!0,H=j||L||W;return qf({deleteKeyCode:l,multiSelectionKeyCode:g}),A.jsx(Uf,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:b,zoomOnPinch:h,panOnScroll:Q,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:C,panOnDrag:!j&&q,defaultViewport:B,translateExtent:M,minZoom:T,maxZoom:R,zoomActivationKeyCode:y,preventScrolling:w,noWheelClassName:E,noPanClassName:I,onViewportChange:P,isControlledViewport:V,paneClickDistance:a,selectionOnDrag:W,children:A.jsxs(th,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:q,autoPanOnSelection:$,isSelecting:!!H,selectionMode:d,selectionKeyPressed:j,paneClickDistance:a,selectionOnDrag:W,children:[e,O&&A.jsx(hh,{onSelectionContextMenu:N,noPanClassName:I,disableKeyboardA11y:z})]})})}Ui.displayName="FlowRenderer";const ph=D.memo(Ui),mh=e=>t=>e?no(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function yh(e){return ee(D.useCallback(mh(e),[e]),ne)}const xh=e=>e.updateNodeInternals;function wh(){const e=ee(xh),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return D.useEffect(()=>()=>{t?.disconnect()},[t]),t}function vh({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=oe(),i=D.useRef(null),s=D.useRef(null),a=D.useRef(e.sourcePosition),l=D.useRef(e.targetPosition),c=D.useRef(t),u=n&&!!e.internals.handleBounds;return D.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),D.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(i.current){const d=c.current!==t,f=a.current!==e.sourcePosition,p=l.current!==e.targetPosition;(d||f||p)&&(c.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function bh({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:g,rfId:v,nodeTypes:y,nodeClickDistance:m,onError:b}){const{node:h,internals:x,isParent:S}=ee(H=>{const F=H.nodeLookup.get(e),U=H.parentLookup.has(e);return{node:F,internals:F.internals,isParent:U}},ne);let _=h.type||"default",C=y?.[_]||mr[_];C===void 0&&(b?.("003",pe.error003(_)),_="default",C=y?.default||mr.default);const k=!!(h.draggable||a&&typeof h.draggable>"u"),$=!!(h.selectable||l&&typeof h.selectable>"u"),B=!!(h.connectable||c&&typeof h.connectable>"u"),M=!!(h.focusable||u&&typeof h.focusable>"u"),T=oe(),R=xi(h),w=vh({node:h,nodeType:_,hasDimensions:R,resizeObserver:d}),N=qi({nodeRef:w,disabled:h.hidden||!k,noDragClassName:f,handleSelector:h.dragHandle,nodeId:e,isSelectable:$,nodeClickDistance:m}),E=Gi();if(h.hidden)return null;const I=$e(h),z=dh(h),P=$||k||t||n||o||r,V=n?H=>n(H,{...x.userNode}):void 0,O=o?H=>o(H,{...x.userNode}):void 0,L=r?H=>r(H,{...x.userNode}):void 0,j=i?H=>i(H,{...x.userNode}):void 0,X=s?H=>s(H,{...x.userNode}):void 0,q=H=>{const{selectNodesOnDrag:F,nodeDragThreshold:U}=T.getState();$&&(!F||!k||U>0)&&Gn({id:e,store:T,nodeRef:w}),t&&t(H,{...x.userNode})},Q=H=>{if(!(bi(H.nativeEvent)||g)){if(li.includes(H.key)&&$){const F=H.key==="Escape";Gn({id:e,store:T,unselect:F,nodeRef:w})}else if(k&&h.selected&&Object.prototype.hasOwnProperty.call(nn,H.key)){H.preventDefault();const{ariaLabelConfig:F}=T.getState();T.setState({ariaLiveMessage:F["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),E({direction:nn[H.key],factor:H.shiftKey?4:1})}}},W=()=>{if(g||!w.current?.matches(":focus-visible"))return;const{transform:H,width:F,height:U,autoPanOnNodeFocus:K,setCenter:Y}=T.getState();if(!K)return;no(new Map([[e,h]]),{x:0,y:0,width:F,height:U},H,!0).length>0||Y(h.position.x+I.width/2,h.position.y+I.height/2,{zoom:H[2]})};return A.jsx("div",{className:ie(["react-flow__node",`react-flow__node-${_}`,{[p]:k},h.className,{selected:h.selected,selectable:$,parent:S,draggable:k,dragging:N}]),ref:w,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:R?"visible":"hidden",...h.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:O,onMouseLeave:L,onContextMenu:j,onClick:q,onDoubleClick:X,onKeyDown:M?Q:void 0,tabIndex:M?0:void 0,onFocus:M?W:void 0,role:h.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Oi}-${v}`,"aria-label":h.ariaLabel,...h.domAttributes,children:A.jsx(oh,{value:e,children:A.jsx(C,{id:e,data:h.data,type:_,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:h.selected??!1,selectable:$,draggable:k,deletable:h.deletable??!0,isConnectable:B,sourcePosition:h.sourcePosition,targetPosition:h.targetPosition,dragging:N,dragHandle:h.dragHandle,zIndex:x.z,parentId:h.parentId,...I})})})}var _h=D.memo(bh);const Eh=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Qi(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=ee(Eh,ne),s=yh(e.onlyRenderVisibleElements),a=wh();return A.jsx("div",{className:"react-flow__nodes",style:mn,children:s.map(l=>A.jsx(_h,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}Qi.displayName="NodeRenderer";const Sh=D.memo(Qi);function Nh(e){return ee(D.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&Ed({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),ne)}const Ch=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return A.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Mh=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return A.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xr={[Jt.Arrow]:Ch,[Jt.ArrowClosed]:Mh};function Ih(e){const t=oe();return D.useMemo(()=>Object.prototype.hasOwnProperty.call(xr,e)?xr[e]:(t.getState().onError?.("009",pe.error009(e)),null),[e])}const kh=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=Ih(t);return l?A.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:A.jsx(l,{color:n,strokeWidth:s})}):null},Ji=({defaultColor:e,rfId:t})=>{const n=ee(i=>i.edges),o=ee(i=>i.defaultEdgeOptions),r=D.useMemo(()=>$d(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?A.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:A.jsx("defs",{children:r.map(i=>A.jsx(kh,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Ji.displayName="MarkerDefinitions";var Ah=D.memo(Ji);function es({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u}){const[d,f]=D.useState({x:1,y:0,width:0,height:0}),p=ie(["react-flow__edge-textwrapper",c]),g=D.useRef(null);return D.useEffect(()=>{if(g.current){const v=g.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?A.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[r&&A.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),A.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:g,style:o,children:n}),l]}):null}es.displayName="EdgeText";const $h=D.memo(es);function yn({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return A.jsxs(A.Fragment,{children:[A.jsx("path",{...u,d:e,fill:"none",className:ie(["react-flow__edge-path",u.className])}),c?A.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&he(t)&&he(n)?A.jsx($h,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function wr({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===Z.Left||e===Z.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function ts({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:o,targetY:r,targetPosition:i=Z.Top}){const[s,a]=wr({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=wr({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,d,f,p]=Ei({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${o},${r}`,u,d,f,p]}function ns(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:y,interactionWidth:m})=>{const[b,h,x]=ts({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),S=e.isInternal?void 0:t;return A.jsx(yn,{id:S,path:b,labelX:h,labelY:x,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:y,interactionWidth:m})})}const Ph=ns({isInternal:!1}),os=ns({isInternal:!0});Ph.displayName="SimpleBezierEdge";os.displayName="SimpleBezierEdgeInternal";function rs(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Z.Bottom,targetPosition:g=Z.Top,markerEnd:v,markerStart:y,pathOptions:m,interactionWidth:b})=>{const[h,x,S]=Yn({sourceX:n,sourceY:o,sourcePosition:p,targetX:r,targetY:i,targetPosition:g,borderRadius:m?.borderRadius,offset:m?.offset,stepPosition:m?.stepPosition}),_=e.isInternal?void 0:t;return A.jsx(yn,{id:_,path:h,labelX:x,labelY:S,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:y,interactionWidth:b})})}const is=rs({isInternal:!1}),ss=rs({isInternal:!0});is.displayName="SmoothStepEdge";ss.displayName="SmoothStepEdgeInternal";function as(e){return D.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return A.jsx(is,{...n,id:o,pathOptions:D.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const Dh=as({isInternal:!1}),cs=as({isInternal:!0});Dh.displayName="StepEdge";cs.displayName="StepEdgeInternal";function ls(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:g,interactionWidth:v})=>{const[y,m,b]=Ci({sourceX:n,sourceY:o,targetX:r,targetY:i}),h=e.isInternal?void 0:t;return A.jsx(yn,{id:h,path:y,labelX:m,labelY:b,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:g,interactionWidth:v})})}const zh=ls({isInternal:!1}),us=ls({isInternal:!0});zh.displayName="StraightEdge";us.displayName="StraightEdgeInternal";function ds(e){return D.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=Z.Bottom,targetPosition:a=Z.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:y,pathOptions:m,interactionWidth:b})=>{const[h,x,S]=Si({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:m?.curvature}),_=e.isInternal?void 0:t;return A.jsx(yn,{id:_,path:h,labelX:x,labelY:S,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:g,markerEnd:v,markerStart:y,interactionWidth:b})})}const Th=ds({isInternal:!1}),fs=ds({isInternal:!0});Th.displayName="BezierEdge";fs.displayName="BezierEdgeInternal";const vr={default:fs,straight:us,step:cs,smoothstep:ss,simplebezier:os},br={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Hh=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,Rh=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,_r="react-flow__edgeupdater";function Er({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return A.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:ie([_r,`${_r}-${a}`]),cx:Hh(t,o,e),cy:Rh(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function Lh({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const g=oe(),v=(x,S)=>{if(x.button!==0)return;const{autoPanOnConnect:_,domNode:C,connectionMode:k,connectionRadius:$,lib:B,onConnectStart:M,cancelConnection:T,nodeLookup:R,rfId:w,panBy:N,updateConnection:E}=g.getState(),I=S.type==="target",z=(O,L)=>{f(!1),d?.(O,n,S.type,L)},P=O=>c?.(n,O),V=(O,L)=>{f(!0),u?.(x,n,S.type),M?.(O,L)};qn.onPointerDown(x.nativeEvent,{autoPanOnConnect:_,connectionMode:k,connectionRadius:$,domNode:C,handleId:S.id,nodeId:S.nodeId,nodeLookup:R,isTarget:I,edgeUpdaterType:S.type,lib:B,flowId:w,cancelConnection:T,panBy:N,isValidConnection:(...O)=>g.getState().isValidConnection?.(...O)??!0,onConnect:P,onConnectStart:V,onConnectEnd:(...O)=>g.getState().onConnectEnd?.(...O),onReconnectEnd:z,updateConnection:E,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:x.currentTarget})},y=x=>v(x,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=x=>v(x,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),h=()=>p(!1);return A.jsxs(A.Fragment,{children:[(e===!0||e==="source")&&A.jsx(Er,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:h,type:"source"}),(e===!0||e==="target")&&A.jsx(Er,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:b,onMouseOut:h,type:"target"})]})}function Vh({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:g,edgeTypes:v,noPanClassName:y,onError:m,disableKeyboardA11y:b}){let h=ee(Y=>Y.edgeLookup.get(e));const x=ee(Y=>Y.defaultEdgeOptions);h=x?{...x,...h}:h;let S=h.type||"default",_=v?.[S]||vr[S];_===void 0&&(m?.("011",pe.error011(S)),S="default",_=v?.default||vr.default);const C=!!(h.focusable||t&&typeof h.focusable>"u"),k=typeof d<"u"&&(h.reconnectable||n&&typeof h.reconnectable>"u"),$=!!(h.selectable||o&&typeof h.selectable>"u"),B=D.useRef(null),[M,T]=D.useState(!1),[R,w]=D.useState(!1),N=oe(),{zIndex:E,sourceX:I,sourceY:z,targetX:P,targetY:V,sourcePosition:O,targetPosition:L}=ee(D.useCallback(Y=>{const G=Y.nodeLookup.get(h.source),J=Y.nodeLookup.get(h.target);if(!G||!J)return{zIndex:h.zIndex,...br};const te=Ad({id:e,sourceNode:G,targetNode:J,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:Y.connectionMode,onError:m});return{zIndex:_d({selected:h.selected,zIndex:h.zIndex,sourceNode:G,targetNode:J,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...te||br}},[h.source,h.target,h.sourceHandle,h.targetHandle,h.selected,h.zIndex]),ne),j=D.useMemo(()=>h.markerStart?`url('#${Zn(h.markerStart,g)}')`:void 0,[h.markerStart,g]),X=D.useMemo(()=>h.markerEnd?`url('#${Zn(h.markerEnd,g)}')`:void 0,[h.markerEnd,g]);if(h.hidden||I===null||z===null||P===null||V===null)return null;const q=Y=>{const{addSelectedEdges:G,unselectNodesAndEdges:J,multiSelectionActive:te}=N.getState();$&&(N.setState({nodesSelectionActive:!1}),h.selected&&te?(J({nodes:[],edges:[h]}),B.current?.blur()):G([e])),r&&r(Y,h)},Q=i?Y=>{i(Y,{...h})}:void 0,W=s?Y=>{s(Y,{...h})}:void 0,H=a?Y=>{a(Y,{...h})}:void 0,F=l?Y=>{l(Y,{...h})}:void 0,U=c?Y=>{c(Y,{...h})}:void 0,K=Y=>{if(!b&&li.includes(Y.key)&&$){const{unselectNodesAndEdges:G,addSelectedEdges:J}=N.getState();Y.key==="Escape"?(B.current?.blur(),G({edges:[h]})):J([e])}};return A.jsx("svg",{style:{zIndex:E},children:A.jsxs("g",{className:ie(["react-flow__edge",`react-flow__edge-${S}`,h.className,y,{selected:h.selected,animated:h.animated,inactive:!$&&!r,updating:M,selectable:$}]),onClick:q,onDoubleClick:Q,onContextMenu:W,onMouseEnter:H,onMouseMove:F,onMouseLeave:U,onKeyDown:C?K:void 0,tabIndex:C?0:void 0,role:h.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":h.ariaLabel===null?void 0:h.ariaLabel||`Edge from ${h.source} to ${h.target}`,"aria-describedby":C?`${Bi}-${g}`:void 0,ref:B,...h.domAttributes,children:[!R&&A.jsx(_,{id:e,source:h.source,target:h.target,type:h.type,selected:h.selected,animated:h.animated,selectable:$,deletable:h.deletable??!0,label:h.label,labelStyle:h.labelStyle,labelShowBg:h.labelShowBg,labelBgStyle:h.labelBgStyle,labelBgPadding:h.labelBgPadding,labelBgBorderRadius:h.labelBgBorderRadius,sourceX:I,sourceY:z,targetX:P,targetY:V,sourcePosition:O,targetPosition:L,data:h.data,style:h.style,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerStart:j,markerEnd:X,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth}),k&&A.jsx(Lh,{edge:h,isReconnectable:k,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:I,sourceY:z,targetX:P,targetY:V,sourcePosition:O,targetPosition:L,setUpdateHover:T,setReconnecting:w})]})})}var Oh=D.memo(Vh);const Bh=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function hs({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:g,disableKeyboardA11y:v}){const{edgesFocusable:y,edgesReconnectable:m,elementsSelectable:b,onError:h}=ee(Bh,ne),x=Nh(t);return A.jsxs("div",{className:"react-flow__edges",children:[A.jsx(Ah,{defaultColor:e,rfId:n}),x.map(S=>A.jsx(Oh,{id:S,edgesFocusable:y,edgesReconnectable:m,elementsSelectable:b,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:g,rfId:n,onError:h,edgeTypes:o,disableKeyboardA11y:v},S))]})}hs.displayName="EdgeRenderer";const Fh=D.memo(hs),Xh=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jh({children:e}){const t=ee(Xh);return A.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Yh(e){const t=fo(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Zh=e=>e.panZoom?.syncViewport;function Wh(e){const t=ee(Zh),n=oe();return D.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function qh(e){return e.connection.inProgress?{...e.connection,to:lt(e.connection.to,e.transform)}:{...e.connection}}function Gh(e){return qh}function Kh(e){const t=Gh();return ee(t,ne)}const Uh=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qh({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:l}=ee(Uh,ne);return!(i&&r&&l)?null:A.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:A.jsx("g",{className:ie(["react-flow__connection",fi(a)]),children:A.jsx(gs,{style:t,type:n,CustomComponent:o,isValid:a})})})}const gs=({style:e,type:t=ze.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:c,toNode:u,toHandle:d,toPosition:f,pointer:p}=Kh();if(!r)return;if(n)return A.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:f,connectionStatus:fi(o),toNode:u,toHandle:d,pointer:p});let g="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case ze.Bezier:[g]=Si(v);break;case ze.SimpleBezier:[g]=ts(v);break;case ze.Step:[g]=Yn({...v,borderRadius:0});break;case ze.SmoothStep:[g]=Yn(v);break;default:[g]=Ci(v)}return A.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};gs.displayName="ConnectionLine";const Jh={};function Sr(e=Jh){D.useRef(e),oe(),D.useEffect(()=>{},[e])}function eg(){oe(),D.useRef(!1),D.useEffect(()=>{},[])}function ps({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:g,connectionLineStyle:v,connectionLineComponent:y,connectionLineContainerStyle:m,selectionKeyCode:b,selectionOnDrag:h,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:C,deleteKeyCode:k,onlyRenderVisibleElements:$,elementsSelectable:B,defaultViewport:M,translateExtent:T,minZoom:R,maxZoom:w,preventScrolling:N,defaultMarkerColor:E,zoomOnScroll:I,zoomOnPinch:z,panOnScroll:P,panOnScrollSpeed:V,panOnScrollMode:O,zoomOnDoubleClick:L,panOnDrag:j,autoPanOnSelection:X,onPaneClick:q,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:H,onPaneScroll:F,onPaneContextMenu:U,paneClickDistance:K,nodeClickDistance:Y,onEdgeContextMenu:G,onEdgeMouseEnter:J,onEdgeMouseMove:te,onEdgeMouseLeave:re,reconnectRadius:ae,onReconnect:Ee,onReconnectStart:ye,onReconnectEnd:xe,noDragClassName:Se,noWheelClassName:ut,noPanClassName:He,disableKeyboardA11y:Re,nodeExtent:ue,rfId:Ne,viewport:Ce,onViewportChange:Le}){return Sr(e),Sr(t),eg(),Yh(n),Wh(Ce),A.jsx(ph,{onPaneClick:q,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:H,onPaneContextMenu:U,onPaneScroll:F,paneClickDistance:K,deleteKeyCode:k,selectionKeyCode:b,selectionOnDrag:h,selectionMode:x,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:C,elementsSelectable:B,zoomOnScroll:I,zoomOnPinch:z,zoomOnDoubleClick:L,panOnScroll:P,panOnScrollSpeed:V,panOnScrollMode:O,panOnDrag:j,autoPanOnSelection:X,defaultViewport:M,translateExtent:T,minZoom:R,maxZoom:w,onSelectionContextMenu:d,preventScrolling:N,noDragClassName:Se,noWheelClassName:ut,noPanClassName:He,disableKeyboardA11y:Re,onViewportChange:Le,isControlledViewport:!!Ce,children:A.jsxs(jh,{children:[A.jsx(Fh,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Ee,onReconnectStart:ye,onReconnectEnd:xe,onlyRenderVisibleElements:$,onEdgeContextMenu:G,onEdgeMouseEnter:J,onEdgeMouseMove:te,onEdgeMouseLeave:re,reconnectRadius:ae,defaultMarkerColor:E,noPanClassName:He,disableKeyboardA11y:Re,rfId:Ne}),A.jsx(Qh,{style:v,type:g,component:y,containerStyle:m}),A.jsx("div",{className:"react-flow__edgelabel-renderer"}),A.jsx(Sh,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Y,onlyRenderVisibleElements:$,noPanClassName:He,noDragClassName:Se,disableKeyboardA11y:Re,nodeExtent:ue,rfId:Ne}),A.jsx("div",{className:"react-flow__viewport-portal"})]})})}ps.displayName="GraphView";const tg=D.memo(ps),ng=yi(),Nr=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{const p=new Map,g=new Map,v=new Map,y=new Map,m=o??t??[],b=n??e??[],h=u??[0,0],x=d??bt;ki(v,y,m);const{nodesInitialized:S}=Wn(b,p,g,{nodeOrigin:h,nodeExtent:x,zIndexMode:f});let _=[0,0,1];if(s&&r&&i){const C=kt(p,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:k,y:$,zoom:B}=ro(C,r,i,l,c,a?.padding??.1);_=[k,$,B]}return{rfId:"1",width:r??0,height:i??0,transform:_,nodes:b,nodesInitialized:S,nodeLookup:p,parentLookup:g,edges:m,edgeLookup:y,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:bt,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:rt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:h,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...di},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ng,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ui,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},og=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>xf((p,g)=>{async function v(){const{nodeLookup:y,panZoom:m,fitViewOptions:b,fitViewResolver:h,width:x,height:S,minZoom:_,maxZoom:C}=g();m&&(await pd({nodes:y,width:x,height:S,panZoom:m,minZoom:_,maxZoom:C},b),h?.resolve(!0),p({fitViewResolver:null}))}return{...Nr({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:y=>{const{nodeLookup:m,parentLookup:b,nodeOrigin:h,elevateNodesOnSelect:x,fitViewQueued:S,zIndexMode:_,nodesSelectionActive:C}=g(),{nodesInitialized:k,hasSelectedNodes:$}=Wn(y,m,b,{nodeOrigin:h,nodeExtent:d,elevateNodesOnSelect:x,checkEquality:!0,zIndexMode:_}),B=C&&$;S&&k?(v(),p({nodes:y,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):p({nodes:y,nodesInitialized:k,nodesSelectionActive:B})},setEdges:y=>{const{connectionLookup:m,edgeLookup:b}=g();ki(m,b,y),p({edges:y})},setDefaultNodesAndEdges:(y,m)=>{if(y){const{setNodes:b}=g();b(y),p({hasDefaultNodes:!0})}if(m){const{setEdges:b}=g();b(m),p({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:m,nodeLookup:b,parentLookup:h,domNode:x,nodeOrigin:S,nodeExtent:_,debug:C,fitViewQueued:k,zIndexMode:$}=g(),{changes:B,updatedInternals:M}=Ld(y,b,h,x,S,_,$);M&&(zd(b,h,{nodeOrigin:S,nodeExtent:_,zIndexMode:$}),k?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),B?.length>0&&(C&&console.log("React Flow: trigger node changes",B),m?.(B)))},updateNodePositions:(y,m=!1)=>{const b=[];let h=[];const{nodeLookup:x,triggerNodeChanges:S,connection:_,updateConnection:C,onNodesChangeMiddlewareMap:k}=g();for(const[$,B]of y){const M=x.get($),T=!!(M?.expandParent&&M?.parentId&&B?.position),R={id:$,type:"position",position:T?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:m};if(M&&_.inProgress&&_.fromNode.id===M.id){const w=We(M,_.fromHandle,Z.Left,!0);C({..._,from:w})}T&&M.parentId&&b.push({id:$,parentId:M.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),h.push(R)}if(b.length>0){const{parentLookup:$,nodeOrigin:B}=g(),M=uo(b,x,$,B);h.push(...M)}for(const $ of k.values())h=$(h);S(h)},triggerNodeChanges:y=>{const{onNodesChange:m,setNodes:b,nodes:h,hasDefaultNodes:x,debug:S}=g();if(y?.length){if(x){const _=ji(y,h);b(_)}S&&console.log("React Flow: trigger node changes",y),m?.(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:m,setEdges:b,edges:h,hasDefaultEdges:x,debug:S}=g();if(y?.length){if(x){const _=Yi(y,h);b(_)}S&&console.log("React Flow: trigger edge changes",y),m?.(y)}},addSelectedNodes:y=>{const{multiSelectionActive:m,edgeLookup:b,nodeLookup:h,triggerNodeChanges:x,triggerEdgeChanges:S}=g();if(m){const _=y.map(C=>Ve(C,!0));x(_);return}x(Ue(h,new Set([...y]),!0)),S(Ue(b))},addSelectedEdges:y=>{const{multiSelectionActive:m,edgeLookup:b,nodeLookup:h,triggerNodeChanges:x,triggerEdgeChanges:S}=g();if(m){const _=y.map(C=>Ve(C,!0));S(_);return}S(Ue(b,new Set([...y]))),x(Ue(h,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:m}={})=>{const{edges:b,nodes:h,nodeLookup:x,triggerNodeChanges:S,triggerEdgeChanges:_}=g(),C=y||h,k=m||b,$=[];for(const M of C){if(!M.selected)continue;const T=x.get(M.id);T&&(T.selected=!1),$.push(Ve(M.id,!1))}const B=[];for(const M of k)M.selected&&B.push(Ve(M.id,!1));S($),_(B)},setMinZoom:y=>{const{panZoom:m,maxZoom:b}=g();m?.setScaleExtent([y,b]),p({minZoom:y})},setMaxZoom:y=>{const{panZoom:m,minZoom:b}=g();m?.setScaleExtent([b,y]),p({maxZoom:y})},setTranslateExtent:y=>{g().panZoom?.setTranslateExtent(y),p({translateExtent:y})},resetSelectedElements:()=>{const{edges:y,nodes:m,triggerNodeChanges:b,triggerEdgeChanges:h,elementsSelectable:x}=g();if(!x)return;const S=m.reduce((C,k)=>k.selected?[...C,Ve(k.id,!1)]:C,[]),_=y.reduce((C,k)=>k.selected?[...C,Ve(k.id,!1)]:C,[]);b(S),h(_)},setNodeExtent:y=>{const{nodes:m,nodeLookup:b,parentLookup:h,nodeOrigin:x,elevateNodesOnSelect:S,nodeExtent:_,zIndexMode:C}=g();y[0][0]===_[0][0]&&y[0][1]===_[0][1]&&y[1][0]===_[1][0]&&y[1][1]===_[1][1]||(Wn(m,b,h,{nodeOrigin:x,nodeExtent:y,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:C}),p({nodeExtent:y}))},panBy:y=>{const{transform:m,width:b,height:h,panZoom:x,translateExtent:S}=g();return Vd({delta:y,panZoom:x,transform:m,translateExtent:S,width:b,height:h})},setCenter:async(y,m,b)=>{const{width:h,height:x,maxZoom:S,panZoom:_}=g();if(!_)return!1;const C=typeof b?.zoom<"u"?b.zoom:S;return await _.setViewport({x:h/2-y*C,y:x/2-m*C,zoom:C},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),!0},cancelConnection:()=>{p({connection:{...di}})},updateConnection:y=>{p({connection:y})},reset:()=>p({...Nr()})}},Object.is);function rg({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){const[g]=D.useState(()=>og({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:c,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return A.jsx(wf,{value:g,children:A.jsx(jf,{children:p})})}function ig({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return D.useContext(gn)?A.jsx(A.Fragment,{children:e}):A.jsx(rg,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}const sg={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ag({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:g,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:m,onNodeMouseEnter:b,onNodeMouseMove:h,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:$,onNodesDelete:B,onEdgesDelete:M,onDelete:T,onSelectionChange:R,onSelectionDragStart:w,onSelectionDrag:N,onSelectionDragStop:E,onSelectionContextMenu:I,onSelectionStart:z,onSelectionEnd:P,onBeforeDelete:V,connectionMode:O,connectionLineType:L=ze.Bezier,connectionLineStyle:j,connectionLineComponent:X,connectionLineContainerStyle:q,deleteKeyCode:Q="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:H=!1,selectionMode:F=_t.Full,panActivationKeyCode:U="Space",multiSelectionKeyCode:K=St()?"Meta":"Control",zoomActivationKeyCode:Y=St()?"Meta":"Control",snapToGrid:G,snapGrid:J,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:re,nodesDraggable:ae,autoPanOnNodeFocus:Ee,nodesConnectable:ye,nodesFocusable:xe,nodeOrigin:Se=Fi,edgesFocusable:ut,edgesReconnectable:He,elementsSelectable:Re=!0,defaultViewport:ue=Pf,minZoom:Ne=.5,maxZoom:Ce=2,translateExtent:Le=bt,preventScrolling:ws=!0,nodeExtent:xn,defaultMarkerColor:vs="#b1b1b7",zoomOnScroll:bs=!0,zoomOnPinch:_s=!0,panOnScroll:Es=!1,panOnScrollSpeed:Ss=.5,panOnScrollMode:Ns=Fe.Free,zoomOnDoubleClick:Cs=!0,panOnDrag:Ms=!0,onPaneClick:Is,onPaneMouseEnter:ks,onPaneMouseMove:As,onPaneMouseLeave:$s,onPaneScroll:Ps,onPaneContextMenu:Ds,paneClickDistance:zs=1,nodeClickDistance:Ts=0,children:Hs,onReconnect:Rs,onReconnectStart:Ls,onReconnectEnd:Vs,onEdgeContextMenu:Os,onEdgeDoubleClick:Bs,onEdgeMouseEnter:Fs,onEdgeMouseMove:Xs,onEdgeMouseLeave:js,reconnectRadius:Ys=10,onNodesChange:Zs,onEdgesChange:Ws,noDragClassName:qs="nodrag",noWheelClassName:Gs="nowheel",noPanClassName:go="nopan",fitView:po,fitViewOptions:mo,connectOnClick:Ks,attributionPosition:Us,proOptions:Qs,defaultEdgeOptions:Js,elevateNodesOnSelect:ea=!0,elevateEdgesOnSelect:ta=!1,disableKeyboardA11y:yo=!1,autoPanOnConnect:na,autoPanOnNodeDrag:oa,autoPanOnSelection:ra=!0,autoPanSpeed:ia,connectionRadius:sa,isValidConnection:aa,onError:ca,style:la,id:xo,nodeDragThreshold:ua,connectionDragThreshold:da,viewport:fa,onViewportChange:ha,width:ga,height:pa,colorMode:ma="light",debug:ya,onScroll:wo,ariaLabelConfig:xa,zIndexMode:vo="basic",...wa},va){const wn=xo||"1",ba=Hf(ma),_a=D.useCallback(bo=>{bo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),wo?.(bo)},[wo]);return A.jsx("div",{"data-testid":"rf__wrapper",...wa,onScroll:_a,style:{...la,...sg},ref:va,className:ie(["react-flow",r,ba]),id:xo,role:"application",children:A.jsxs(ig,{nodes:e,edges:t,width:ga,height:pa,fitView:po,fitViewOptions:mo,minZoom:Ne,maxZoom:Ce,nodeOrigin:Se,nodeExtent:xn,zIndexMode:vo,children:[A.jsx(Tf,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:p,onConnectStart:g,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:m,nodesDraggable:ae,autoPanOnNodeFocus:Ee,nodesConnectable:ye,nodesFocusable:xe,edgesFocusable:ut,edgesReconnectable:He,elementsSelectable:Re,elevateNodesOnSelect:ea,elevateEdgesOnSelect:ta,minZoom:Ne,maxZoom:Ce,nodeExtent:xn,onNodesChange:Zs,onEdgesChange:Ws,snapToGrid:G,snapGrid:J,connectionMode:O,translateExtent:Le,connectOnClick:Ks,defaultEdgeOptions:Js,fitView:po,fitViewOptions:mo,onNodesDelete:B,onEdgesDelete:M,onDelete:T,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:$,onSelectionDrag:N,onSelectionDragStart:w,onSelectionDragStop:E,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:go,nodeOrigin:Se,rfId:wn,autoPanOnConnect:na,autoPanOnNodeDrag:oa,autoPanSpeed:ia,onError:ca,connectionRadius:sa,isValidConnection:aa,selectNodesOnDrag:re,nodeDragThreshold:ua,connectionDragThreshold:da,onBeforeDelete:V,debug:ya,ariaLabelConfig:xa,zIndexMode:vo}),A.jsx(tg,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:b,onNodeMouseMove:h,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:L,connectionLineStyle:j,connectionLineComponent:X,connectionLineContainerStyle:q,selectionKeyCode:W,selectionOnDrag:H,selectionMode:F,deleteKeyCode:Q,multiSelectionKeyCode:K,panActivationKeyCode:U,zoomActivationKeyCode:Y,onlyRenderVisibleElements:te,defaultViewport:ue,translateExtent:Le,minZoom:Ne,maxZoom:Ce,preventScrolling:ws,zoomOnScroll:bs,zoomOnPinch:_s,zoomOnDoubleClick:Cs,panOnScroll:Es,panOnScrollSpeed:Ss,panOnScrollMode:Ns,panOnDrag:Ms,autoPanOnSelection:ra,onPaneClick:Is,onPaneMouseEnter:ks,onPaneMouseMove:As,onPaneMouseLeave:$s,onPaneScroll:Ps,onPaneContextMenu:Ds,paneClickDistance:zs,nodeClickDistance:Ts,onSelectionContextMenu:I,onSelectionStart:z,onSelectionEnd:P,onReconnect:Rs,onReconnectStart:Ls,onReconnectEnd:Vs,onEdgeContextMenu:Os,onEdgeDoubleClick:Bs,onEdgeMouseEnter:Fs,onEdgeMouseMove:Xs,onEdgeMouseLeave:js,reconnectRadius:Ys,defaultMarkerColor:vs,noDragClassName:qs,noWheelClassName:Gs,noPanClassName:go,rfId:wn,disableKeyboardA11y:yo,nodeExtent:xn,viewport:fa,onViewportChange:ha}),A.jsx($f,{onSelectionChange:R}),Hs,A.jsx(Cf,{proOptions:Qs,position:Us}),A.jsx(Nf,{rfId:wn,disableKeyboardA11y:yo})]})})}var Lg=Zi(ag);function Vg(e){const[t,n]=D.useState(e),o=D.useCallback(r=>n(i=>ji(r,i)),[]);return[t,n,o]}function Og(e){const[t,n]=D.useState(e),o=D.useCallback(r=>n(i=>Yi(r,i)),[]);return[t,n,o]}function cg({dimensions:e,lineWidth:t,variant:n,className:o}){return A.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ie(["react-flow__background-pattern",n,o])})}function lg({radius:e,className:t}){return A.jsx("circle",{cx:e,cy:e,r:e,className:ie(["react-flow__background-pattern","dots",t])})}var Te;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Te||(Te={}));const ug={[Te.Dots]:1,[Te.Lines]:1,[Te.Cross]:6},dg=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ms({id:e,variant:t=Te.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:l,className:c,patternClassName:u}){const d=D.useRef(null),{transform:f,patternId:p}=ee(dg,ne),g=o||ug[t],v=t===Te.Dots,y=t===Te.Cross,m=Array.isArray(n)?n:[n,n],b=[m[0]*f[2]||1,m[1]*f[2]||1],h=g*f[2],x=Array.isArray(i)?i:[i,i],S=y?[h,h]:b,_=[x[0]*f[2]||1+S[0]/2,x[1]*f[2]||1+S[1]/2],C=`${p}${e||""}`;return A.jsxs("svg",{className:ie(["react-flow__background",c]),style:{...l,...mn,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[A.jsx("pattern",{id:C,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?A.jsx(lg,{radius:h/2,className:u}):A.jsx(cg,{dimensions:S,lineWidth:r,variant:t,className:u})}),A.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}ms.displayName="Background";const Bg=D.memo(ms);function fg(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:A.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function hg(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:A.jsx("path",{d:"M0 0h32v4.2H0z"})})}function gg(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:A.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function pg(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function mg(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Vt({children:e,className:t,...n}){return A.jsx("button",{type:"button",className:ie(["react-flow__controls-button",t]),...n,children:e})}const yg=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ys({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p}){const g=oe(),{isInteractive:v,minZoomReached:y,maxZoomReached:m,ariaLabelConfig:b}=ee(yg,ne),{zoomIn:h,zoomOut:x,fitView:S}=fo(),_=()=>{h(),i?.()},C=()=>{x(),s?.()},k=()=>{S(r),a?.()},$=()=>{g.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l?.(!v)},B=f==="horizontal"?"horizontal":"vertical";return A.jsxs(pn,{className:ie(["react-flow__controls",B,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&A.jsxs(A.Fragment,{children:[A.jsx(Vt,{onClick:_,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:m,children:A.jsx(fg,{})}),A.jsx(Vt,{onClick:C,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:y,children:A.jsx(hg,{})})]}),n&&A.jsx(Vt,{className:"react-flow__controls-fitview",onClick:k,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:A.jsx(gg,{})}),o&&A.jsx(Vt,{className:"react-flow__controls-interactive",onClick:$,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:v?A.jsx(mg,{}):A.jsx(pg,{})}),u]})}ys.displayName="Controls";const Fg=D.memo(ys);function xg({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){const{background:g,backgroundColor:v}=i||{},y=s||g||v;return A.jsx("rect",{className:ie(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:y,stroke:a,strokeWidth:l},shapeRendering:d,onClick:p?m=>p(m,e):void 0})}const wg=D.memo(xg),vg=e=>e.nodes.map(t=>t.id),zn=e=>e instanceof Function?e:()=>e;function bg({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=wg,onClick:s}){const a=ee(vg,ne),l=zn(t),c=zn(e),u=zn(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return A.jsx(A.Fragment,{children:a.map(f=>A.jsx(Eg,{id:f,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function _g({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:c,x:u,y:d,width:f,height:p}=ee(g=>{const v=g.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const y=v.internals.userNode,{x:m,y:b}=v.internals.positionAbsolute,{width:h,height:x}=$e(y);return{node:y,x:m,y:b,width:h,height:x}},ne);return!c||c.hidden||!xi(c)?null:A.jsx(a,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:i,shapeRendering:s,onClick:l,id:c.id})}const Eg=D.memo(_g);var Sg=D.memo(bg);const Ng=200,Cg=150,Mg=e=>!e.hidden,Ig=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?mi(kt(e.nodeLookup,{filter:Mg}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},kg="react-flow__minimap-desc";function xs({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:g,pannable:v=!1,zoomable:y=!1,ariaLabel:m,inversePan:b,zoomStep:h=1,offsetScale:x=5}){const S=oe(),_=D.useRef(null),{boundingRect:C,viewBB:k,rfId:$,panZoom:B,translateExtent:M,flowWidth:T,flowHeight:R,ariaLabelConfig:w}=ee(Ig,ne),N=e?.width??Ng,E=e?.height??Cg,I=C.width/N,z=C.height/E,P=Math.max(I,z),V=P*N,O=P*E,L=x*P,j=C.x-(V-C.width)/2-L,X=C.y-(O-C.height)/2-L,q=V+L*2,Q=O+L*2,W=`${kg}-${$}`,H=D.useRef(0),F=D.useRef();H.current=P,D.useEffect(()=>{if(_.current&&B)return F.current=qd({domNode:_.current,panZoom:B,getTransform:()=>S.getState().transform,getViewScale:()=>H.current}),()=>{F.current?.destroy()}},[B]),D.useEffect(()=>{F.current?.update({translateExtent:M,width:T,height:R,inversePan:b,pannable:v,zoomStep:h,zoomable:y})},[v,y,b,h,M,T,R]);const U=p?G=>{const[J,te]=F.current?.pointer(G)||[0,0];p(G,{x:J,y:te})}:void 0,K=g?D.useCallback((G,J)=>{const te=S.getState().nodeLookup.get(J).internals.userNode;g(G,te)},[]):void 0,Y=m??w["minimap.ariaLabel"];return A.jsx(pn,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*P:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:A.jsxs("svg",{width:N,height:E,viewBox:`${j} ${X} ${q} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:_,onClick:U,children:[Y&&A.jsx("title",{id:W,children:Y}),A.jsx(Sg,{onClick:K,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),A.jsx("path",{className:"react-flow__minimap-mask",d:`M${j-L},${X-L}h${q+L*2}v${Q+L*2}h${-q-L*2}z
|
|
15
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}xs.displayName="MiniMap";const Xg=D.memo(xs),Ag=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,$g={[ct.Line]:"right",[ct.Handle]:"bottom-right"};function Pg({nodeId:e,position:t,variant:n=ct.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:g,onResizeStart:v,onResize:y,onResizeEnd:m}){const b=Ki(),h=typeof e=="string"?e:b,x=oe(),S=D.useRef(null),_=n===ct.Handle,C=ee(D.useCallback(Ag(_&&p),[_,p]),ne),k=D.useRef(null),$=t??$g[n];D.useEffect(()=>{if(!(!S.current||!h))return k.current||(k.current=cf({domNode:S.current,nodeId:h,getStoreItems:()=>{const{nodeLookup:M,transform:T,snapGrid:R,snapToGrid:w,nodeOrigin:N,domNode:E}=x.getState();return{nodeLookup:M,transform:T,snapGrid:R,snapToGrid:w,nodeOrigin:N,paneDomNode:E}},onChange:(M,T)=>{const{triggerNodeChanges:R,nodeLookup:w,parentLookup:N,nodeOrigin:E}=x.getState(),I=[],z={x:M.x,y:M.y},P=w.get(h);if(P&&P.expandParent&&P.parentId){const V=P.origin??E,O=M.width??P.measured.width??0,L=M.height??P.measured.height??0,j={id:P.id,parentId:P.parentId,rect:{width:O,height:L,...wi({x:M.x??P.position.x,y:M.y??P.position.y},{width:O,height:L},P.parentId,w,V)}},X=uo([j],w,N,E);I.push(...X),z.x=M.x?Math.max(V[0]*O,M.x):void 0,z.y=M.y?Math.max(V[1]*L,M.y):void 0}if(z.x!==void 0&&z.y!==void 0){const V={id:h,type:"position",position:{...z}};I.push(V)}if(M.width!==void 0&&M.height!==void 0){const O={id:h,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};I.push(O)}for(const V of T){const O={...V,type:"position"};I.push(O)}R(I)},onEnd:({width:M,height:T})=>{const R={id:h,type:"dimensions",resizing:!1,dimensions:{width:M,height:T}};x.getState().triggerNodeChanges([R])}})),k.current.update({controlPosition:$,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:y,onResizeEnd:m,shouldResize:g}),()=>{k.current?.destroy()}},[$,a,l,c,u,d,v,y,m,g]);const B=$.split("-");return A.jsx("div",{className:ie(["react-flow__resize-control","nodrag",...B,n,o]),ref:S,style:{...r,scale:C,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}D.memo(Pg);export{Bg as B,Fg as C,tn as H,Xg as M,Z as P,rg as R,tt as a,Tg as b,Hg as c,Og as d,fo as e,Lg as f,we as i,Rg as p,ce as s,Vg as u,df as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ce}from"./vendor-react-
|
|
1
|
+
import{g as Ce}from"./vendor-react-SZ_qB27O.js";function be(se,le){for(var te=0;te<le.length;te++){const Y=le[te];if(typeof Y!="string"&&!Array.isArray(Y)){for(const G in Y)if(G!=="default"&&!(G in se)){const ie=Object.getOwnPropertyDescriptor(Y,G);ie&&Object.defineProperty(se,G,ie.get?ie:{enumerable:!0,get:()=>Y[G]})}}}return Object.freeze(Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}))}var ve={exports:{}},pe;function we(){return pe||(pe=1,(function(se,le){(function(te,Y){se.exports=Y()})(globalThis,(()=>(()=>{var te={4567:function(O,r,o){var l=this&&this.__decorate||function(e,t,a,u){var _,p=arguments.length,c=p<3?t:u===null?u=Object.getOwnPropertyDescriptor(t,a):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,a,u);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(c=(p<3?_(c):p>3?_(t,a,c):_(t,a))||c);return p>3&&c&&Object.defineProperty(t,a,c),c},f=this&&this.__param||function(e,t){return function(a,u){t(a,u,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),d=o(9924),v=o(844),g=o(4725),h=o(2585),i=o(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,a,u){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
2
|
`)))),this.register(this._terminal.onA11yTab((_=>this._handleTab(_)))),this.register(this._terminal.onKey((_=>this._handleKey(_.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,i.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const a=this._terminal.buffer,u=a.lines.length.toString();for(let _=e;_<=t;_++){const p=a.lines.get(a.ydisp+_),c=[],m=p?.translateToString(!0,void 0,void 0,c)||"",E=(a.ydisp+_+1).toString(),k=this._rowElements[_];k&&(m.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=m,this._rowColumns.set(k,c)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const a=e.target,u=this._rowElements[t===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==u)return;let _,p;if(t===0?(_=a,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(_=this._rowElements.shift(),p=a,this._rowContainer.removeChild(_)),_.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{const c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===a.node&&t.offset>a.offset)&&([t,a]=[a,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const u=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(u)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:u,offset:u.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const _=({node:m,offset:E})=>{const k=m instanceof Text?m.parentNode:m;let D=parseInt(k?.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const b=this._rowColumns.get(k);if(!b)return console.warn("columns is null. Race condition?"),null;let x=E<b.length?b[E]:b.slice(-1)[0]+1;return x>=this._terminal.cols&&(++D,x=0),{row:D,column:x}},p=_(t),c=_(a);if(p&&c){if(p.row>c.row||p.row===c.row&&p.column>=c.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(c.row-p.row)*this._terminal.cols-p.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=l([f(1,h.IInstantiationService),f(2,g.ICoreBrowserService),f(3,g.IRenderService)],s)},3614:(O,r)=>{function o(d){return d.replace(/\r?\n/g,"\r")}function l(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function f(d,v,g,h){d=l(d=o(d),g.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function n(d,v,g){const h=g.getBoundingClientRect(),i=d.clientX-h.left-10,s=d.clientY-h.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${i}px`,v.style.top=`${s}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=l,r.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,v,g,h){d.stopPropagation(),d.clipboardData&&f(d.clipboardData.getData("text/plain"),v,g,h)},r.paste=f,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,v,g,h,i){n(d,v,g),i&&h.rightClickSelect(d),v.value=h.selectionText,v.select()}},7239:(O,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=o(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(f,n,d){this._css.set(f,n,d)}getCss(f,n){return this._css.get(f,n)}setColor(f,n,d){this._color.set(f,n,d)}getColor(f,n){return this._color.get(f,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,l,f,n){o.addEventListener(l,f,n);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(l,f,n))}}}},3551:function(O,r,o){var l=this&&this.__decorate||function(s,e,t,a){var u,_=arguments.length,p=_<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var c=s.length-1;c>=0;c--)(u=s[c])&&(p=(_<3?u(p):_>3?u(e,t,p):u(e,t))||p);return _>3&&p&&Object.defineProperty(e,t,p),p},f=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const n=o(3656),d=o(8460),v=o(844),g=o(2585),h=o(4725);let i=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,a,u){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=a,this._linkProviderService=u,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let a=0;a<t.length;a++){const u=t[a];if(u.classList.contains("xterm"))break;if(u.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach((a=>{a?.forEach((u=>{u.link.dispose&&u.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[a,u]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(t=this._checkLinkProviderResult(a,s,t)):u.provideLinks(s.y,(_=>{if(this._isMouseOut)return;const p=_?.map((c=>({link:c})));this._activeProviderReplies?.set(a,p),t=this._checkLinkProviderResult(a,s,t),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let a=0;a<e.size;a++){const u=e.get(a);if(u)for(let _=0;_<u.length;_++){const p=u[_],c=p.link.range.start.y<s?0:p.link.range.start.x,m=p.link.range.end.y>s?this._bufferService.cols:p.link.range.end.x;for(let E=c;E<=m;E++){if(t.has(E)){u.splice(_--,1);break}t.add(E)}}}}_checkLinkProviderResult(s,e,t){if(!this._activeProviderReplies)return t;const a=this._activeProviderReplies.get(s);let u=!1;for(let _=0;_<s;_++)this._activeProviderReplies.has(_)&&!this._activeProviderReplies.get(_)||(u=!0);if(!u&&a){const _=a.find((p=>this._linkAtPosition(p.link,e)));_&&(t=!0,this._handleNewLink(_))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let _=0;_<this._activeProviderReplies.size;_++){const p=this._activeProviderReplies.get(_)?.find((c=>this._linkAtPosition(c.link,e)));if(p){t=!0,this._handleNewLink(p);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:t=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const a=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,u=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=u&&(this._clearCurrentLink(a,u),this._lastMouseEvent)){const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._askForLink(_,!1)}}))))}_linkHover(s,e,t){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,a=this._bufferService.buffer.ydisp,u=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-a-1,t.end.x,t.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(u)}_linkLeave(s,e,t){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,a=s.range.end.y*this._bufferService.cols+s.range.end.x,u=e.y*this._bufferService.cols+e.x;return t<=u&&u<=a}_positionFromMouseEvent(s,e,t){const a=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,a,u){return{x1:s,y1:e,x2:t,y2:a,cols:this._bufferService.cols,fg:u}}};r.Linkifier=i=l([f(1,h.IMouseService),f(2,h.IRenderService),f(3,g.IBufferService),f(4,h.ILinkProviderService)],i)},9042:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,r,o){var l=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,u=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(h,i,s,e);else for(var _=h.length-1;_>=0;_--)(t=h[_])&&(u=(a<3?t(u):a>3?t(i,s,u):t(i,s))||u);return a>3&&u&&Object.defineProperty(i,s,u),u},f=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=o(511),d=o(2585);let v=r.OscLinkProvider=class{constructor(h,i,s){this._bufferService=h,this._optionsService=i,this._oscLinkService=s}provideLinks(h,i){const s=this._bufferService.buffer.lines.get(h-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,a=new n.CellData,u=s.getTrimmedLength();let _=-1,p=-1,c=!1;for(let m=0;m<u;m++)if(p!==-1||s.hasContent(m)){if(s.loadCell(m,a),a.hasExtendedAttrs()&&a.extended.urlId){if(p===-1){p=m,_=a.extended.urlId;continue}c=a.extended.urlId!==_}else p!==-1&&(c=!0);if(c||p!==-1&&m===u-1){const E=this._oscLinkService.getLinkData(_)?.uri;if(E){const k={start:{x:p+1,y:h},end:{x:m+(c||m!==u-1?0:1),y:h}};let D=!1;if(!t?.allowNonHttpProtocols)try{const b=new URL(E);["http:","https:"].includes(b.protocol)||(D=!0)}catch{D=!0}D||e.push({text:E,range:k,activate:(b,x)=>t?t.activate(b,x,k):g(0,x),hover:(b,x)=>t?.hover?.(b,x,k),leave:(b,x)=>t?.leave?.(b,x,k)})}c=!1,a.hasExtendedAttrs()&&a.extended.urlId?(p=m,_=a.extended.urlId):(p=-1,_=-1)}}i(e)}};function g(h,i){if(confirm(`Do you want to navigate to ${i}?
|
|
4
4
|
|