fuli-context 0.23.0-beta.2 → 0.23.0-beta.3
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/dist/web/assets/{AboutPage-CRIF2M8n.js → AboutPage--MFWAIhT.js} +1 -1
- package/dist/web/assets/{AgentHand-Dp9TFS4q.js → AgentHand-CWae1F0_.js} +1 -1
- package/dist/web/assets/{AgentMentionCopy-C7N92Shm.js → AgentMentionCopy-BrvWaFgO.js} +1 -1
- package/dist/web/assets/{AgentName-CbsQ9vDy.js → AgentName-2dUKeHT9.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-DOpq0b3j.js → AgentProfilePage-DBezR105.js} +2 -2
- package/dist/web/assets/{AgentServicesPage-Dr9WU0f9.js → AgentServicesPage-CRZfO_lg.js} +1 -1
- package/dist/web/assets/{AgentWorkbench-DTWZFf1A.js → AgentWorkbench-D2i5hbIl.js} +1 -1
- package/dist/web/assets/{AgentsDirectoryPage-CxDOdNxT.js → AgentsDirectoryPage-D99UMCXD.js} +1 -1
- package/dist/web/assets/{BackLink-ByRr21Sw.js → BackLink-zpLqtinf.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-Bd1T62eA.js → BoardMoveMenu-DSIagR2c.js} +1 -1
- package/dist/web/assets/CaptureChangePage-Dg2WO32H.js +1 -0
- package/dist/web/assets/{Card-BD5ohuk8.js → Card-BTUVLV33.js} +1 -1
- package/dist/web/assets/{CardHeader-DTVqXpsf.js → CardHeader-B54GWqxk.js} +1 -1
- package/dist/web/assets/{CardTitle-C5REIVlp.js → CardTitle-BflZBqDI.js} +1 -1
- package/dist/web/assets/{ConnectionsPage-CKruAjBF.js → ConnectionsPage-C3Mj3EdJ.js} +1 -1
- package/dist/web/assets/{CreateProjectDialog-D6JS3RtH.js → CreateProjectDialog-XTakMEGP.js} +1 -1
- package/dist/web/assets/{DataFormatPage-DNaogYjf.js → DataFormatPage-Dc1rDny2.js} +1 -1
- package/dist/web/assets/{DialogFooter-C5AIwQ5R.js → DialogFooter-BtZCe5br.js} +1 -1
- package/dist/web/assets/{EmployeeScopeDialog-Lmfos9SA.js → EmployeeScopeDialog-Bnzynxvk.js} +1 -1
- package/dist/web/assets/{EmployeeTaskBoard-U3KmfQG3.js → EmployeeTaskBoard-DZXIJswx.js} +3 -3
- package/dist/web/assets/{EmployeeWorkbenchPage-O9DEMzLT.js → EmployeeWorkbenchPage-D5RdR4rH.js} +1 -1
- package/dist/web/assets/{FieldDescription-_fuW5MBO.js → FieldDescription-zZ6z1zhP.js} +1 -1
- package/dist/web/assets/{GrowthLoading--m-lSUeo.js → GrowthLoading-PsR-4keQ.js} +1 -1
- package/dist/web/assets/{InboxPage-DmJfYzaK.js → InboxPage-CA9wtt1x.js} +1 -1
- package/dist/web/assets/{Input-DqjML-Qy.js → Input-Ccayh8y4.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-AFg1ybWc.js → KnowledgeHardDeleteSection-CQsjilDr.js} +1 -1
- package/dist/web/assets/{KnowledgeItemEditPage-B29px-r0.js → KnowledgeItemEditPage-BQB8esyE.js} +1 -1
- package/dist/web/assets/{KnowledgeItemSummaryCard-BhHet9HU.js → KnowledgeItemSummaryCard-DT50Wb81.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-BfD42JmC.js → KnowledgeOrganizerPage-CFaG-84v.js} +1 -1
- package/dist/web/assets/KnowledgePage-C718Uv1F.js +1 -0
- package/dist/web/assets/{KnowledgePeek-ByakOiOO.js → KnowledgePeek-Bl62ODGt.js} +1 -1
- package/dist/web/assets/{KnowledgePeek-CK2RKeRx.css → KnowledgePeek-Cvrv7P53.css} +1 -1
- package/dist/web/assets/{KnowledgeTurnReceiptPage-B1fMTy2W.js → KnowledgeTurnReceiptPage-BKnRR9Es.js} +1 -1
- package/dist/web/assets/{KnowledgeWorkspace-DCzwenHE.js → KnowledgeWorkspace-BgUYvw7M.js} +1 -1
- package/dist/web/assets/{Label-CufKLEgT.js → Label-BiTrpwc9.js} +1 -1
- package/dist/web/assets/{ModelSettingsPage-jQKn4MsB.js → ModelSettingsPage-C6lQHrHD.js} +1 -1
- package/dist/web/assets/{NotFoundPage-B4KkZO2q.js → NotFoundPage-DWx5rZ78.js} +1 -1
- package/dist/web/assets/{OccupationsPage-5Ja81Cfg.js → OccupationsPage-C0OcPulj.js} +1 -1
- package/dist/web/assets/{OverviewPage-C-K4KDNM.js → OverviewPage-CbCd0iBQ.js} +2 -2
- package/dist/web/assets/{PersonalProfilePage-BVZ3WHmf.js → PersonalProfilePage-DYDL6FLG.js} +1 -1
- package/dist/web/assets/{PersonalProjectsPage-C1J8Poj8.js → PersonalProjectsPage-Cn5bUM2Z.js} +1 -1
- package/dist/web/assets/{PopperContent-C-KMpRbF.js → PopperContent-CLd7OmI0.js} +1 -1
- package/dist/web/assets/{Presence-B4aVQMT8.js → Presence-Cfipq3-d.js} +1 -1
- package/dist/web/assets/{ProjectAgentDetailPage-B6bTOIhe.js → ProjectAgentDetailPage-RzucYb0r.js} +1 -1
- package/dist/web/assets/{ProjectAgentDialog-CWuqScFD.js → ProjectAgentDialog-eYTDh59y.js} +1 -1
- package/dist/web/assets/{ProjectAgentFirstTask-C7qzXCQ6.js → ProjectAgentFirstTask-BukX1skc.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-BNtWbct5.js → ProjectAgentsPage-BUeMfrSj.js} +1 -1
- package/dist/web/assets/{ProjectJudgmentPolicy-L_plkldY.js → ProjectJudgmentPolicy-B9uz6uiq.js} +1 -1
- package/dist/web/assets/{ProjectScopePicker-BXy07CHg.js → ProjectScopePicker-rHUKlntm.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-Cftk4zLX.js → PublicProjectsPage-D3TW5Qfa.js} +1 -1
- package/dist/web/assets/{RadioGroupItem-DoOqLMbZ.js → RadioGroupItem-CSU0NIZR.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-RCtrPHxs.js → RoundtablesPage-CuNZUb55.js} +1 -1
- package/dist/web/assets/{RovingFocusGroup-BeCLKMQA.js → RovingFocusGroup-y-iZi8XH.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-BN-h70s_.js → RovingFocusItem-BWVS-jCQ.js} +1 -1
- package/dist/web/assets/{SessionMigrationPage-Dcjylswy.js → SessionMigrationPage-CtYbrMQI.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-jrFse2a1.js → SessionRecordsPage-DKXS6TpA.js} +1 -1
- package/dist/web/assets/{SettingsPage-BkHm8GV4.js → SettingsPage-Czktje8V.js} +1 -1
- package/dist/web/assets/{SharedJefaReportPage-_KXsTVGF.js → SharedJefaReportPage-DNlDNI3a.js} +1 -1
- package/dist/web/assets/{Switch-BPAVVtqu.js → Switch-BSWYlK7-.js} +1 -1
- package/dist/web/assets/{TableHeader-P9d7xF7t.js → TableHeader-DPwbVeFd.js} +1 -1
- package/dist/web/assets/{TabsContent-Casnps6y.js → TabsContent-CYsZCa17.js} +1 -1
- package/dist/web/assets/{TabsTrigger-AQwqcZRn.js → TabsTrigger-C4wTZx6P.js} +1 -1
- package/dist/web/assets/{TagVocabularyPage-CsDJkbU3.js → TagVocabularyPage-Be2wl4ta.js} +1 -1
- package/dist/web/assets/{TaskBlockerClear-wqHV47Vx.js → TaskBlockerClear-Cwvy1Ny9.js} +1 -1
- package/dist/web/assets/{TaskBlockerNotice-DJytDDst.js → TaskBlockerNotice-eJnNf2L1.js} +1 -1
- package/dist/web/assets/TaskExecutionPlan-CcZY-ob6.js +2 -0
- package/dist/web/assets/TaskExecutionPlan-DO3Ziwy8.css +1 -0
- package/dist/web/assets/{TaskReason-C5g8DpOy.js → TaskReason-BwIwm8a0.js} +1 -1
- package/dist/web/assets/{Teleport-BV0XYmdS.js → Teleport-Cy9vb_Gx.js} +1 -1
- package/dist/web/assets/{TextField-C69MdaFy.js → TextField-DH13s8hF.js} +1 -1
- package/dist/web/assets/{Textarea-D1Kzx_7L.js → Textarea-DwUamIy2.js} +1 -1
- package/dist/web/assets/{UiChip-BqOpp18Q.js → UiChip-BlcXl6BD.js} +1 -1
- package/dist/web/assets/{UiDialog-BAWkdfF-.js → UiDialog-D7qpj9MO.js} +1 -1
- package/dist/web/assets/{UiDisclosure-mGmGItAv.js → UiDisclosure-B3G1FxjZ.js} +1 -1
- package/dist/web/assets/{UiIcon-BUYpKd4D.js → UiIcon-DuX-OCpk.js} +1 -1
- package/dist/web/assets/{UiIconButton-CeiP7Vmj.js → UiIconButton-CVb_NsPj.js} +1 -1
- package/dist/web/assets/{UiNotice-BlznzX5i.js → UiNotice-KRFYU6Na.js} +1 -1
- package/dist/web/assets/{UiSegmented-DlgYMxnc.js → UiSegmented-DUIhcPAq.js} +1 -1
- package/dist/web/assets/{UiSelect-BWViyott.js → UiSelect-BiPBjvEa.js} +1 -1
- package/dist/web/assets/{UiWeight-DZwt7cIP.js → UiWeight-r9xa5phD.js} +1 -1
- package/dist/web/assets/{UnassignedConversationsPanel-DV2CpIdb.js → UnassignedConversationsPanel-BoQG4yhI.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-D-3X_X7D.js → VirtualDirectoryList-Dd4h-9AA.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-BjPsr2D4.js → VisuallyHiddenInput-Bpf2p4pm.js} +1 -1
- package/dist/web/assets/{Workbench3D-CVlnk7bc.js → Workbench3D-9ZurUi6I.js} +1 -1
- package/dist/web/assets/{_plugin-vue_export-helper-lED7mxHY.js → _plugin-vue_export-helper-eI1tYej5.js} +2 -2
- package/dist/web/assets/{accordion-GR6gjqFY.js → accordion-DLrbaq5U.js} +1 -1
- package/dist/web/assets/{agent-pins-D2cylMl0.js → agent-pins-BCnc8oy_.js} +1 -1
- package/dist/web/assets/{agent-profile.css_vue_type_style_index_0_src_true_lang-w5YilVWS.js → agent-profile.css_vue_type_style_index_0_src_true_lang-CoOOfIVX.js} +1 -1
- package/dist/web/assets/{agent-roster-records-DgWGHLHW.js → agent-roster-records-DWEB68x2.js} +1 -1
- package/dist/web/assets/{agent-task-board-DCS97QK2.js → agent-task-board-wlVkgnUr.js} +1 -1
- package/dist/web/assets/{agent-work-summary-QPOQuybY.js → agent-work-summary-CJcHJf1_.js} +1 -1
- package/dist/web/assets/{attention-store-DKza0N1e.js → attention-store-BL2b7qH0.js} +1 -1
- package/dist/web/assets/{badge-CG2m9xwC.js → badge-CEUML1H6.js} +1 -1
- package/dist/web/assets/{button-CZBMEiSm.js → button-xqhURBmo.js} +1 -1
- package/dist/web/assets/{checkbox-3VSDPUJw.js → checkbox-D54DToGG.js} +1 -1
- package/dist/web/assets/{client-Dwnwq6uu.js → client-jLIUhqvq.js} +1 -1
- package/dist/web/assets/{client-links-store-DG6AhNPP.js → client-links-store-CT1-8ecr.js} +1 -1
- package/dist/web/assets/{console-ny5TvCWK.js → console-NADovARn.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-Ds-piWNR.js → conversation-launcher-settings-DTpcby1Z.js} +1 -1
- package/dist/web/assets/{design-lab-DrVlcS2x.js → design-lab-PILevyQh.js} +1 -1
- package/dist/web/assets/{dialog-C3x9ziBB.js → dialog-fmWMdzPi.js} +1 -1
- package/dist/web/assets/{dist-CB11Zet2.js → dist-B-l4N_ic.js} +1 -1
- package/dist/web/assets/{dropdown-menu-Cdtg4lAd.js → dropdown-menu-CfQyZPbi.js} +1 -1
- package/dist/web/assets/{field-DMSD3CwL.js → field-DSg7DaEB.js} +1 -1
- package/dist/web/assets/{identity-DI_OdSEg.js → identity-B_PUXajn.js} +1 -1
- package/dist/web/assets/index-VxjbvVMy.js +2 -0
- package/dist/web/assets/{judgment-api-CwnpLQOf.js → judgment-api-BO4iPCuh.js} +1 -1
- package/dist/web/assets/label-table-COJkW0qq.js +1 -0
- package/dist/web/assets/{model-BOXKOC62.js → model-BGXEpphp.js} +1 -1
- package/dist/web/assets/{model-kV1gs-y2.js → model-BRXy0y5T.js} +1 -1
- package/dist/web/assets/{model-C7hgak_o.js → model-CwPQEn-L.js} +1 -1
- package/dist/web/assets/{model-DSSYQ-i_.js → model-D-D84fzk.js} +1 -1
- package/dist/web/assets/{model-CmYu_CSs.js → model-D3hiIAyh.js} +1 -1
- package/dist/web/assets/{model-BlAV3okF.js → model-D7hnFInc.js} +1 -1
- package/dist/web/assets/{motion-preference-fHFXX4cl.js → motion-preference-DW1cTNCE.js} +1 -1
- package/dist/web/assets/{occupation-catalog-DOk8egq8.js → occupation-catalog-DiVka-SH.js} +1 -1
- package/dist/web/assets/{orchestration-filters-BqUPBFf1.js → orchestration-filters-DMbgGeec.js} +1 -1
- package/dist/web/assets/{page-title-D1CadCvf.js → page-title-R57kP_yk.js} +1 -1
- package/dist/web/assets/{profile-model-DGbpJdVC.js → profile-model-DiD-oHc6.js} +1 -1
- package/dist/web/assets/{project-board-layout-Dtyrl2is.js → project-board-layout-CSkhRou5.js} +1 -1
- package/dist/web/assets/{project-board-settings-CNVNKEfm.js → project-board-settings-CuMRwQ6d.js} +1 -1
- package/dist/web/assets/{project-capture-BpaGUI-m.js → project-capture-CX4wzdCd.js} +1 -1
- package/dist/web/assets/{project-origin-DJ4d13mb.js → project-origin-DHxPJqQL.js} +1 -1
- package/dist/web/assets/project-team-api-DwxUWQON.js +1 -0
- package/dist/web/assets/{quick-edit-api-CBMbWX0d.js → quick-edit-api-DmPjynh3.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-ClO7ICIC.js → runtime-dom.esm-bundler-hGmI7vEu.js} +1 -1
- package/dist/web/assets/{select-CCN-VOqx.js → select-Do_mcTB3.js} +1 -1
- package/dist/web/assets/{shared-report-BRgNEV5m.js → shared-report-yG4yeg7p.js} +1 -1
- package/dist/web/assets/source-adapters-D60SP1tX.js +1 -0
- package/dist/web/assets/task-evidence-DIbw2U42.js +1 -0
- package/dist/web/assets/{task-labels-pCGKthln.js → task-labels-DzwYKCAB.js} +1 -1
- package/dist/web/assets/{ui-Bfbk4_Xk.js → ui-CJi-7Kxt.js} +1 -1
- package/dist/web/assets/{useAgentRecords-DZPebmJ_.js → useAgentRecords-C9tF3UYl.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CpF4ddpD.js → useApi-CROJJdhE-C1eOl8U7.js} +1 -1
- package/dist/web/assets/useDirection-h6CFnL6Z.js +1 -0
- package/dist/web/assets/{useFocusReturn-DVcg2RDp.js → useFocusReturn-CxzLUN3f.js} +1 -1
- package/dist/web/assets/{useForwardExpose-CNq5826B.js → useForwardExpose-BXhmVX2M.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-CxwXNZqm.js → useKnowledgeItemPeek-CDvNm37w.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-SSJELjga.js → useMinimumLoadingDisplay-DPHiYCLH.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-BI9EATa_.js +1 -0
- package/dist/web/assets/{useRoutePeek-U71ADWt0.js → useRoutePeek-CC8bzbbQ.js} +1 -1
- package/dist/web/assets/{useTypeahead-CJkAiAa9.js → useTypeahead-BHpT5K-P.js} +1 -1
- package/dist/web/assets/{utils-CfVEk15i.js → utils-B1vlMxcz.js} +1 -1
- package/dist/web/assets/{vue-router-BFTYTsOL.js → vue-router-C8L9ZtNP.js} +1 -1
- package/dist/web/index.html +44 -44
- package/docs/client-connections.md +5 -2
- package/graph-provider/fuli_graph/models.py +1 -1
- package/graph-provider/fuli_graph/project_agent_models.py +1 -0
- package/graph-provider/fuli_graph/store_project_agents.py +1 -1
- package/graph-provider/fuli_graph/task_context_auto_close.py +1 -1
- package/graph-provider/fuli_graph/workflow_observation_models.py +1 -1
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +92 -418
- package/package.json +9 -2
- package/src/agent-kits/session-clients.js +1 -0
- package/src/agents/identity-receipt.js +3 -2
- package/src/agents/opencode/plugin-file.js +25 -2
- package/src/agents/source-applications.js +1 -1
- package/src/cli/clients-command.js +1 -1
- package/src/cli/command-registry.js +1 -1
- package/src/cli/connect-command.js +2 -2
- package/src/cli/local-runtime-command.js +2 -3
- package/src/cli/mcp-command.js +1 -1
- package/src/data-format/format-notices.js +3 -2
- package/src/desktop/fuli-links.js +56 -0
- package/src/desktop/windows-desktop-client.js +61 -28
- package/src/desktop/windows-installation-switch.js +4 -0
- package/src/desktop/windows-installation.js +4 -0
- package/src/desktop/windows-node-launcher.js +69 -0
- package/src/desktop/windows-uninstall-command.js +1 -1
- package/src/desktop/windows-uninstall.js +13 -7
- package/src/graphiti/capture-change-confirmation.js +1 -1
- package/src/graphiti/federated-application.js +5 -0
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/setup/agents/antigravity/adapter.test.js +55 -0
- package/src/setup/agents/antigravity/index.js +19 -0
- package/src/setup/agents/registry.js +2 -1
- package/src/setup/client-connection.js +1 -1
- package/src/setup/paths.js +10 -1
- package/src/setup/setup.js +3 -4
- package/src/system/client-connection-install.js +1 -1
- package/src/system/system-service.js +2 -2
- package/dist/web/assets/CaptureChangePage-DyuSSSDE.js +0 -1
- package/dist/web/assets/KnowledgePage-nbTejsvV.js +0 -1
- package/dist/web/assets/TaskExecutionPlan-8dwc8_Jf.css +0 -1
- package/dist/web/assets/TaskExecutionPlan-BPnu-yfT.js +0 -2
- package/dist/web/assets/index-S0AnueS1.js +0 -2
- package/dist/web/assets/label-table-vGnKmYm3.js +0 -1
- package/dist/web/assets/project-team-api-yJVsib_j.js +0 -1
- package/dist/web/assets/source-adapters-8UHmhZTa.js +0 -1
- package/dist/web/assets/task-evidence-B2smSxDg.js +0 -1
- package/dist/web/assets/useDirection-DXu4lssv.js +0 -1
- package/dist/web/assets/usePrimitiveElement-WBpNZTN_.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as e,E as t,En as n,F as r,In as i,L as a,O as o,Ot as s,P as c,St as l,T as u,Xt as d,ar as f,ft as p,gt as m,lr as h,lt as g,m as _,r as v,rn as y,s as b,t as x,tn as S,w as C,wn as w}from"./_plugin-vue_export-helper-lED7mxHY.js";import{S as T,_ as E,w as D,x as O,y as k}from"./runtime-dom.esm-bundler-ClO7ICIC.js";import{t as A}from"./console-ny5TvCWK.js";import{h as j,m as M}from"./useApi-CROJJdhE-CpF4ddpD.js";import{t as N}from"./vue-router-BFTYTsOL.js";import{t as P}from"./button-CZBMEiSm.js";import{n as F,t as I}from"./RadioGroupItem-DoOqLMbZ.js";import{t as L}from"./Switch-BPAVVtqu.js";import{n as R,r as ee,t as z}from"./TabsTrigger-AQwqcZRn.js";import{t as B}from"./GrowthLoading--m-lSUeo.js";import{a as te,c as V,l as H,n as U,r as ne,t as re}from"./client-Dwnwq6uu.js";import{i as ie,n as ae,r as oe,t as se}from"./project-origin-DJ4d13mb.js";import{n as ce}from"./ui-Bfbk4_Xk.js";import{t as le}from"./UiDialog-BAWkdfF-.js";import{t as ue}from"./UiIconButton-CeiP7Vmj.js";import{t as de}from"./UiNotice-BlznzX5i.js";import{t as fe}from"./UiSelect-BWViyott.js";import{t as pe}from"./agent-avatar-CBfHZX_0.js";import{n as me,t as he}from"./paths-CDREouhi.js";import{a as ge,i as _e,n as ve,o as ye,r as be,t as xe}from"./attach-closest-edge-B5hSH5Q1.js";import{t as W}from"./task-board-model-DSr4P56O.js";import{a as G,c as Se,d as K,i as Ce,l as we,n as Te,o as Ee,r as De,s as Oe,t as ke,u as Ae}from"./project-board-settings-CNVNKEfm.js";import{t as je}from"./Input-DqjML-Qy.js";import{n as Me,t as Ne}from"./useMinimumLoadingDisplay-SSJELjga.js";import{t as Pe}from"./debounce-CFk-gEUl.js";import{T as Fe}from"./model-BlAV3okF.js";import{t as Ie}from"./UiDisclosure-mGmGItAv.js";import{t as Le}from"./AgentName-CbsQ9vDy.js";import{t as Re}from"./project-team-api-yJVsib_j.js";import{t as ze}from"./CreateProjectDialog-D6JS3RtH.js";import{n as Be,r as Ve,t as He}from"./identity-DI_OdSEg.js";import{t as Ue}from"./ProjectJudgmentPolicy-L_plkldY.js";import{t as We}from"./VirtualDirectoryList-D-3X_X7D.js";import{C as Ge,E as Ke,F as qe,I as Je,L as Ye,M as Xe,O as Ze,P as Qe,S as $e,_ as et,b as tt,c as nt,d as rt,f as it,g as at,h as ot,j as st,k as ct,l as lt,p as ut,s as dt,u as ft,v as pt,w as mt,x as ht,y as q}from"./model-DSSYQ-i_.js";import{i as gt,n as _t,r as vt,t as yt}from"./KnowledgePeek-ByakOiOO.js";import{a as bt,o as xt,r as St}from"./project-capture-BpaGUI-m.js";function Ct(e,t){return e.status===`archived`||e.profile.lifecycle===`archived`?!1:t.showTemporary||e.project_id===t.selectedProjectId||ae(e)}function wt(e,t,n){let r=new Map(t.map(e=>[e.project_id,e])),i=new Set(t.filter(e=>!Ct(e,n)).map(e=>e.project_id)),a=new Set;for(let t of e.nodes){let e=t.attributes??{};if(t.type!==`PersonalProject`&&t.type!==`RelatedPersonalProject`)continue;let o=String(e.projectId??(t.id.split(`:`).slice(2).join(`:`)||t.id));Ct(r.get(o)??{project_id:o,scope_type:e.scope_type??e.scopeType,status:String(e.status??``),profile:{name:t.name,lifecycle:String(e.lifecycle??``),origin:String(e.origin??``)}},n)||(a.add(t.id),i.add(o),t.id.startsWith(`personal-project:`)&&i.add(t.id.slice(17)))}let o=[...i].map(e=>`project-profile:${e}:`),s=e.nodes.filter(e=>!a.has(e.id)&&!o.some(t=>e.id.startsWith(t))),c=new Set(s.map(e=>e.id)),l=e.edges.filter(e=>c.has(lt(e.source))&&c.has(lt(e.target)));return{...e,nodes:s,edges:l}}var Tt={value:()=>{}};function Et(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Dt(n)}function Dt(e){this._=e}function Ot(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Dt.prototype=Et.prototype={constructor:Dt,on:function(e,t){var n=this._,r=Ot(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=kt(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=At(n[i],e.name,t);else if(t==null)for(i in n)n[i]=At(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Dt(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function kt(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function At(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Tt,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jt={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Mt(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),jt.hasOwnProperty(t)?{space:jt[t],local:e}:e}function Nt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Pt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ft(e){var t=Mt(e);return(t.local?Pt:Nt)(t)}function It(){}function Lt(e){return e==null?It:function(){return this.querySelector(e)}}function Rt(e){typeof e!=`function`&&(e=Lt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Dr(r,this._parents)}function zt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Bt(){return[]}function Vt(e){return e==null?Bt:function(){return this.querySelectorAll(e)}}function Ht(e){return function(){return zt(e.apply(this,arguments))}}function Ut(e){e=typeof e==`function`?Ht(e):Vt(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Dr(r,i)}function Wt(e){return function(){return this.matches(e)}}function Gt(e){return function(t){return t.matches(e)}}var Kt=Array.prototype.find;function qt(e){return function(){return Kt.call(this.children,e)}}function Jt(){return this.firstElementChild}function Yt(e){return this.select(e==null?Jt:qt(typeof e==`function`?e:Gt(e)))}var Xt=Array.prototype.filter;function Zt(){return Array.from(this.children)}function Qt(e){return function(){return Xt.call(this.children,e)}}function $t(e){return this.selectAll(e==null?Zt:Qt(typeof e==`function`?e:Gt(e)))}function en(e){typeof e!=`function`&&(e=Wt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Dr(r,this._parents)}function tn(e){return Array(e.length)}function nn(){return new Dr(this._enter||this._groups.map(tn),this._parents)}function rn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}rn.prototype={constructor:rn,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 an(e){return function(){return e}}function on(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new rn(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function sn(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new rn(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function cn(e){return e.__data__}function ln(e,t){if(!arguments.length)return Array.from(this,cn);var n=t?sn:on,r=this._parents,i=this._groups;typeof e!=`function`&&(e=an(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=un(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Dr(o,r),o._enter=s,o._exit=c,o}function un(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function dn(){return new Dr(this._exit||this._groups.map(tn),this._parents)}function fn(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function pn(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Dr(s,this._parents)}function mn(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function hn(e){e||=gn;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Dr(i,this._parents).order()}function gn(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _n(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vn(){return Array.from(this)}function yn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function bn(){let e=0;for(let t of this)++e;return e}function xn(){return!this.node()}function Sn(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Cn(e){return function(){this.removeAttribute(e)}}function wn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tn(e,t){return function(){this.setAttribute(e,t)}}function En(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Dn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function On(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 kn(e,t){var n=Mt(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?wn:Cn:typeof t==`function`?n.local?On:Dn:n.local?En:Tn)(n,t))}function An(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jn(e){return function(){this.style.removeProperty(e)}}function Mn(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Nn(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Pn(e,t,n){return arguments.length>1?this.each((t==null?jn:typeof t==`function`?Nn:Mn)(e,t,n??``)):Fn(this.node(),e)}function Fn(e,t){return e.style.getPropertyValue(t)||An(e).getComputedStyle(e,null).getPropertyValue(t)}function In(e){return function(){delete this[e]}}function Ln(e,t){return function(){this[e]=t}}function Rn(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zn(e,t){return arguments.length>1?this.each((t==null?In:typeof t==`function`?Rn:Ln)(e,t)):this.node()[e]}function Bn(e){return e.trim().split(/^|\s+/)}function Vn(e){return e.classList||new Hn(e)}function Hn(e){this._node=e,this._names=Bn(e.getAttribute(`class`)||``)}Hn.prototype={add:function(e){this._names.indexOf(e)<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 Un(e,t){for(var n=Vn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Wn(e,t){for(var n=Vn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Gn(e){return function(){Un(this,e)}}function Kn(e){return function(){Wn(this,e)}}function qn(e,t){return function(){(t.apply(this,arguments)?Un:Wn)(this,e)}}function Jn(e,t){var n=Bn(e+``);if(arguments.length<2){for(var r=Vn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?qn:t?Gn:Kn)(n,t))}function Yn(){this.textContent=``}function Xn(e){return function(){this.textContent=e}}function Zn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Qn(e){return arguments.length?this.each(e==null?Yn:(typeof e==`function`?Zn:Xn)(e)):this.node().textContent}function $n(){this.innerHTML=``}function er(e){return function(){this.innerHTML=e}}function tr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function nr(e){return arguments.length?this.each(e==null?$n:(typeof e==`function`?tr:er)(e)):this.node().innerHTML}function rr(){this.nextSibling&&this.parentNode.appendChild(this)}function ir(){return this.each(rr)}function ar(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function or(){return this.each(ar)}function sr(e){var t=typeof e==`function`?e:Ft(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function cr(){return null}function lr(e,t){var n=typeof e==`function`?e:Ft(e),r=t==null?cr:typeof t==`function`?t:Lt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ur(){var e=this.parentNode;e&&e.removeChild(this)}function dr(){return this.each(ur)}function fr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pr(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mr(e){return this.select(e?pr:fr)}function hr(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function gr(e){return function(t){e.call(this,t,this.__data__)}}function _r(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function vr(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function yr(e,t,n){return function(){var r=this.__on,i,a=gr(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function br(e,t,n){var r=_r(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?yr:vr,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function xr(e,t,n){var r=An(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Sr(e,t){return function(){return xr(this,e,t)}}function Cr(e,t){return function(){return xr(this,e,t.apply(this,arguments))}}function wr(e,t){return this.each((typeof t==`function`?Cr:Sr)(e,t))}function*Tr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Er=[null];function Dr(e,t){this._groups=e,this._parents=t}function Or(){return new Dr([[document.documentElement]],Er)}function kr(){return this}Dr.prototype=Or.prototype={constructor:Dr,select:Rt,selectAll:Ut,selectChild:Yt,selectChildren:$t,filter:en,data:ln,enter:nn,exit:dn,join:fn,merge:pn,selection:kr,order:mn,sort:hn,call:_n,nodes:vn,node:yn,size:bn,empty:xn,each:Sn,attr:kn,style:Pn,property:zn,classed:Jn,text:Qn,html:nr,raise:ir,lower:or,append:sr,insert:lr,remove:dr,clone:mr,datum:hr,on:br,dispatch:wr,[Symbol.iterator]:Tr};function J(e){return typeof e==`string`?new Dr([[document.querySelector(e)]],[document.documentElement]):new Dr([[e]],Er)}function Ar(e){let t;for(;t=e.sourceEvent;)e=t;return e}function jr(e,t){if(e=Ar(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Mr={passive:!1},Nr={capture:!0,passive:!1};function Pr(e){e.stopImmediatePropagation()}function Fr(e){e.preventDefault(),e.stopImmediatePropagation()}function Ir(e){var t=e.document.documentElement,n=J(e).on(`dragstart.drag`,Fr,Nr);`onselectstart`in t?n.on(`selectstart.drag`,Fr,Nr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Lr(e,t){var n=e.document.documentElement,r=J(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Fr,Nr),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Rr=e=>()=>e;function zr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}zr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Br(e){return!e.ctrlKey&&!e.button}function Vr(){return this.parentNode}function Hr(e,t){return t??{x:e.x,y:e.y}}function Ur(){return navigator.maxTouchPoints||`ontouchstart`in this}function Wr(){var e=Br,t=Vr,n=Hr,r=Ur,i={},a=Et(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Mr).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(J(n.view).on(`mousemove.drag`,m,Nr).on(`mouseup.drag`,h,Nr),Ir(n.view),Pr(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Fr(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){J(e.view).on(`mousemove.drag mouseup.drag`,null),Lr(e.view,l),Fr(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Pr(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Fr(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Pr(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=jr(l||r,t),p,m,h;if((h=n.call(e,new zr(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=jr(l||a,t),_=o}u.call(r,e,new zr(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Rr(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Rr(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Rr(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Rr(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Gr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Kr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qr(){}var Jr=.7,Yr=1/Jr,Xr=`\\s*([+-]?\\d+)\\s*`,Zr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Qr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,$r=/^#([0-9a-f]{3,8})$/,ei=RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),ti=RegExp(`^rgb\\(${Qr},${Qr},${Qr}\\)$`),ni=RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Zr}\\)$`),ri=RegExp(`^rgba\\(${Qr},${Qr},${Qr},${Zr}\\)$`),ii=RegExp(`^hsl\\(${Zr},${Qr},${Qr}\\)$`),ai=RegExp(`^hsla\\(${Zr},${Qr},${Qr},${Zr}\\)$`),oi={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};Gr(qr,di,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:si,formatHex:si,formatHex8:ci,formatHsl:li,formatRgb:ui,toString:ui});function si(){return this.rgb().formatHex()}function ci(){return this.rgb().formatHex8()}function li(){return Ci(this).formatHsl()}function ui(){return this.rgb().formatRgb()}function di(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=$r.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fi(t):n===3?new Y(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pi(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=ei.exec(e))?new Y(t[1],t[2],t[3],1):(t=ti.exec(e))?new Y(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ni.exec(e))?pi(t[1],t[2],t[3],t[4]):(t=ri.exec(e))?pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ii.exec(e))?Si(t[1],t[2]/100,t[3]/100,1):(t=ai.exec(e))?Si(t[1],t[2]/100,t[3]/100,t[4]):oi.hasOwnProperty(e)?fi(oi[e]):e===`transparent`?new Y(NaN,NaN,NaN,0):null}function fi(e){return new Y(e>>16&255,e>>8&255,e&255,1)}function pi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Y(e,t,n,r)}function mi(e){return e instanceof qr||(e=di(e)),e?(e=e.rgb(),new Y(e.r,e.g,e.b,e.opacity)):new Y}function hi(e,t,n,r){return arguments.length===1?mi(e):new Y(e,t,n,r??1)}function Y(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Gr(Y,hi,Kr(qr,{brighter(e){return e=e==null?Yr:Yr**+e,new Y(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jr:Jr**+e,new Y(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Y(bi(this.r),bi(this.g),bi(this.b),yi(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:gi,formatHex:gi,formatHex8:_i,formatRgb:vi,toString:vi}));function gi(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}`}function _i(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}${xi((isNaN(this.opacity)?1:this.opacity)*255)}`}function vi(){let e=yi(this.opacity);return`${e===1?`rgb(`:`rgba(`}${bi(this.r)}, ${bi(this.g)}, ${bi(this.b)}${e===1?`)`:`, ${e})`}`}function yi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function bi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xi(e){return e=bi(e),(e<16?`0`:``)+e.toString(16)}function Si(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ti(e,t,n,r)}function Ci(e){if(e instanceof Ti)return new Ti(e.h,e.s,e.l,e.opacity);if(e instanceof qr||(e=di(e)),!e)return new Ti;if(e instanceof Ti)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ti(o,s,c,e.opacity)}function wi(e,t,n,r){return arguments.length===1?Ci(e):new Ti(e,t,n,r??1)}function Ti(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gr(Ti,wi,Kr(qr,{brighter(e){return e=e==null?Yr:Yr**+e,new Ti(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jr:Jr**+e,new Ti(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Y(Oi(e>=240?e-240:e+120,i,r),Oi(e,i,r),Oi(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ti(Ei(this.h),Di(this.s),Di(this.l),yi(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(){let e=yi(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Ei(this.h)}, ${Di(this.s)*100}%, ${Di(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Ei(e){return e=(e||0)%360,e<0?e+360:e}function Di(e){return Math.max(0,Math.min(1,e||0))}function Oi(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ki=e=>()=>e;function Ai(e,t){return function(n){return e+n*t}}function ji(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Mi(e){return(e=+e)==1?Ni:function(t,n){return n-t?ji(t,n,e):ki(isNaN(t)?n:t)}}function Ni(e,t){var n=t-e;return n?Ai(e,n):ki(isNaN(e)?t:e)}var Pi=(function e(t){var n=Mi(t);function r(e,t){var r=n((e=hi(e)).r,(t=hi(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Ni(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Fi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Li=new RegExp(Ii.source,`g`);function Ri(e){return function(){return e}}function zi(e){return function(t){return e(t)+``}}function Bi(e,t){var n=Ii.lastIndex=Li.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Ii.exec(e))&&(i=Li.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Fi(r,i)})),n=Li.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?zi(c[0].x):Ri(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var Vi=180/Math.PI,Hi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ui(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Vi,skewX:Math.atan(c)*Vi,scaleX:o,scaleY:s}}var Wi;function Gi(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Hi:Ui(t.a,t.b,t.c,t.d,t.e,t.f)}function Ki(e){return e==null||(Wi||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Wi.setAttribute(`transform`,e),!(e=Wi.transform.baseVal.consolidate()))?Hi:(e=e.matrix,Ui(e.a,e.b,e.c,e.d,e.e,e.f))}function qi(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Fi(e,i)},{i:c-2,x:Fi(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Fi(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Fi(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Fi(e,n)},{i:s-2,x:Fi(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Ji=qi(Gi,`px, `,`px)`,`deg)`),Yi=qi(Ki,`, `,`)`,`)`),Xi=1e-12;function Zi(e){return((e=Math.exp(e))+1/e)/2}function Qi(e){return((e=Math.exp(e))-1/e)/2}function $i(e){return((e=Math.exp(2*e))-1)/(e+1)}var ea=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Xi)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Zi(y),c=s/(n*g)*(i*$i(t*r+y)-Qi(y));return[a+c*d,o+c*f,s*i/Zi(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),ta=0,na=0,ra=0,ia=1e3,aa,oa,sa=0,ca=0,la=0,ua=typeof performance==`object`&&performance.now?performance:Date,da=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function fa(){return ca||=(da(pa),ua.now()+la)}function pa(){ca=0}function ma(){this._call=this._time=this._next=null}ma.prototype=ha.prototype={constructor:ma,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?fa():+n)+(t==null?0:+t),!this._next&&oa!==this&&(oa?oa._next=this:aa=this,oa=this),this._call=e,this._time=n,ba()},stop:function(){this._call&&(this._call=null,this._time=1/0,ba())}};function ha(e,t,n){var r=new ma;return r.restart(e,t,n),r}function ga(){fa(),++ta;for(var e=aa,t;e;)(t=ca-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ta}function _a(){ca=(sa=ua.now())+la,ta=na=0;try{ga()}finally{ta=0,ya(),ca=0}}function va(){var e=ua.now(),t=e-sa;t>ia&&(la-=t,sa=e)}function ya(){for(var e,t=aa,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:aa=n);oa=e,ba(r)}function ba(e){ta||(na&&=clearTimeout(na),e-ca>24?(e<1/0&&(na=setTimeout(_a,e-ua.now()-la)),ra&&=clearInterval(ra)):(ra||=(sa=ua.now(),setInterval(va,ia)),ta=1,da(_a)))}function xa(e,t,n){var r=new ma;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Sa=Et(`start`,`end`,`cancel`,`interrupt`),Ca=[];function wa(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Oa(e,n,{name:t,index:r,group:i,on:Sa,tween:Ca,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Ta(e,t){var n=Da(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Ea(e,t){var n=Da(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Da(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Oa(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ha(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return xa(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(xa(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function ka(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function Aa(e){return this.each(function(){ka(this,e)})}function ja(e,t){var n,r;return function(){var i=Ea(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ma(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ea(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Na(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Da(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ja:Ma)(n,e,t))}function Pa(e,t,n){var r=e._id;return e.each(function(){var e=Ea(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Da(e,r).value[t]}}function Fa(e,t){var n;return(typeof t==`number`?Fi:t instanceof di?Pi:(n=di(t))?(t=n,Pi):Bi)(e,t)}function Ia(e){return function(){this.removeAttribute(e)}}function La(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ra(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function za(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Ba(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Va(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ha(e,t){var n=Mt(e),r=n===`transform`?Yi:Fa;return this.attrTween(e,typeof t==`function`?(n.local?Va:Ba)(n,r,Pa(this,`attr.`+e,t)):t==null?(n.local?La:Ia)(n):(n.local?za:Ra)(n,r,t))}function Ua(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Wa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ga(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Wa(e,i)),n}return i._value=t,i}function Ka(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ua(e,i)),n}return i._value=t,i}function qa(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 Error();var r=Mt(e);return this.tween(n,(r.local?Ga:Ka)(r,t))}function Ja(e,t){return function(){Ta(this,e).delay=+t.apply(this,arguments)}}function Ya(e,t){return t=+t,function(){Ta(this,e).delay=t}}function Xa(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ja:Ya)(t,e)):Da(this.node(),t).delay}function Za(e,t){return function(){Ea(this,e).duration=+t.apply(this,arguments)}}function Qa(e,t){return t=+t,function(){Ea(this,e).duration=t}}function $a(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Za:Qa)(t,e)):Da(this.node(),t).duration}function eo(e,t){if(typeof t!=`function`)throw Error();return function(){Ea(this,e).ease=t}}function to(e){var t=this._id;return arguments.length?this.each(eo(t,e)):Da(this.node(),t).ease}function no(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ea(this,e).ease=n}}function ro(e){if(typeof e!=`function`)throw Error();return this.each(no(this._id,e))}function io(e){typeof e!=`function`&&(e=Wt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Po(r,this._parents,this._name,this._id)}function ao(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Po(o,this._parents,this._name,this._id)}function oo(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function so(e,t,n){var r,i,a=oo(t)?Ta:Ea;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function co(e,t){var n=this._id;return arguments.length<2?Da(this.node(),n).on.on(e):this.each(so(n,e,t))}function lo(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function uo(){return this.on(`end.remove`,lo(this._id))}function fo(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Lt(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,wa(l[f],t,n,f,l,Da(u,n)));return new Po(a,this._parents,t,n)}function po(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Vt(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Da(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&wa(p,t,n,h,f,m);a.push(f),o.push(u)}return new Po(a,o,t,n)}var mo=Or.prototype.constructor;function ho(){return new mo(this._groups,this._parents)}function go(e,t){var n,r,i;return function(){var a=Fn(this,e),o=(this.style.removeProperty(e),Fn(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function _o(e){return function(){this.style.removeProperty(e)}}function vo(e,t,n){var r,i=n+``,a;return function(){var o=Fn(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function yo(e,t,n){var r,i,a;return function(){var o=Fn(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Fn(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function bo(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ea(this,e),l=c.on,u=c.value[a]==null?s||=_o(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function xo(e,t,n){var r=(e+=``)==`transform`?Ji:Fa;return t==null?this.styleTween(e,go(e,r)).on(`end.style.`+e,_o(e)):typeof t==`function`?this.styleTween(e,yo(e,r,Pa(this,`style.`+e,t))).each(bo(this._id,e)):this.styleTween(e,vo(e,r,t),n).on(`end.style.`+e,null)}function So(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Co(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&So(e,a,n)),r}return a._value=t,a}function wo(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Co(e,t,n??``))}function To(e){return function(){this.textContent=e}}function Eo(e){return function(){var t=e(this);this.textContent=t??``}}function Do(e){return this.tween(`text`,typeof e==`function`?Eo(Pa(this,`text`,e)):To(e==null?``:e+``))}function Oo(e){return function(t){this.textContent=e.call(this,t)}}function ko(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Oo(r)),t}return r._value=e,r}function Ao(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 Error();return this.tween(t,ko(e))}function jo(){for(var e=this._name,t=this._id,n=Fo(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Da(c,t);wa(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Po(r,this._parents,e,n)}function Mo(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ea(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var No=0;function Po(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Fo(){return++No}var Io=Or.prototype;Po.prototype={constructor:Po,select:fo,selectAll:po,selectChild:Io.selectChild,selectChildren:Io.selectChildren,filter:io,merge:ao,selection:ho,transition:jo,call:Io.call,nodes:Io.nodes,node:Io.node,size:Io.size,empty:Io.empty,each:Io.each,on:co,attr:Ha,attrTween:qa,style:xo,styleTween:wo,text:Do,textTween:Ao,remove:uo,tween:Na,delay:Xa,duration:$a,ease:to,easeVarying:ro,end:Mo,[Symbol.iterator]:Io[Symbol.iterator]};function Lo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ro={time:null,delay:0,duration:250,ease:Lo};function zo(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Bo(e){var t,n;e instanceof Po?(t=e._id,e=e._name):(t=Fo(),(n=Ro).time=fa(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&wa(c,e,t,l,o,n||zo(c,t));return new Po(r,this._parents,e,t)}Or.prototype.interrupt=Aa,Or.prototype.transition=Bo;var{abs:Vo,max:Ho,min:Uo}=Math;[`w`,`e`].map(Wo),[`n`,`s`].map(Wo),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Wo);function Wo(e){return{type:e}}function Go(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i<a;++i)o=n[i],s+=o.x,c+=o.y;for(s=(s/a-e)*r,c=(c/a-t)*r,i=0;i<a;++i)o=n[i],o.x-=s,o.y-=c}return i.initialize=function(e){n=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i.strength=function(e){return arguments.length?(r=+e,i):r},i}function Ko(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return qo(this.cover(t,n),t,n,e)}function qo(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function Jo(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)qo(this,o[n],s[n],e[n]);return this}function Yo(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Xo(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Zo(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function X(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Qo(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new X(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a)){if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new X(p[3],g,_,c,l),new X(p[2],o,_,g,l),new X(p[1],g,s,c,_),new X(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);i=e-x,a=t-x,u=e+x,d=t+x,r=p.data}}}return r}function $o(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function es(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function ts(){return this._root}function ns(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function rs(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new X(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new X(i,l,u,s,c)),(i=r[2])&&t.push(new X(i,a,u,l,c)),(i=r[1])&&t.push(new X(i,l,o,s,u)),(i=r[0])&&t.push(new X(i,a,o,l,u))}return this}function is(e){var t=[],n=[],r;for(this._root&&t.push(new X(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new X(a,o,s,u,d)),(a=i[1])&&t.push(new X(a,u,s,c,d)),(a=i[2])&&t.push(new X(a,o,d,u,l)),(a=i[3])&&t.push(new X(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function as(e){return e[0]}function os(e){return arguments.length?(this._x=e,this):this._x}function ss(e){return e[1]}function cs(e){return arguments.length?(this._y=e,this):this._y}function ls(e,t,n){var r=new us(t??as,n??ss,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function us(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function ds(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Z=ls.prototype=us.prototype;Z.copy=function(){var e=new us(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=ds(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=ds(r));return e},Z.add=Ko,Z.addAll=Jo,Z.cover=Yo,Z.data=Xo,Z.extent=Zo,Z.find=Qo,Z.remove=$o,Z.removeAll=es,Z.root=ts,Z.size=ns,Z.visit=rs,Z.visitAfter=is,Z.x=os,Z.y=cs;function Q(e){return function(){return e}}function fs(e){return(e()-.5)*1e-6}function ps(e){return e.x+e.vx}function ms(e){return e.y+e.vy}function hs(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=Q(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=ls(t,ps,ms).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=fs(r),_+=h*h),g===0&&(g=fs(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}}else return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),c(),o):e},o}function gs(e){return e.index}function _s(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function vs(e){var t=gs,n=d,r,i=Q(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||fs(l),m=f.y+f.vy-d.y-d.vy||fs(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=_s(u,d.source)),typeof d.target!=`object`&&(d.target=_s(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:Q(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),h(),f):i},f}var ys=1664525,bs=1013904223,xs=4294967296;function Ss(){let e=1;return()=>(e=(ys*e+bs)%xs)/xs}function Cs(e){return e.x}function ws(e){return e.y}var Ts=10,Es=Math.PI*(3-Math.sqrt(5));function Ds(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=ha(d),l=Et(`tick`,`end`),u=Ss();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Ts*Math.sqrt(.5+t),a=t*Es;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Os(){var e,t,n,r,i=Q(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=ls(e,Cs,ws).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=fs(n),m+=d*d),f===0&&(f=fs(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=fs(n),m+=d*d),f===0&&(f=fs(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function ks(e,t,n){var r,i=Q(.1),a,o;typeof e!=`function`&&(e=Q(+e)),t??=0,n??=0;function s(e){for(var i=0,s=r.length;i<s;++i){var c=r[i],l=c.x-t||1e-6,u=c.y-n||1e-6,d=Math.sqrt(l*l+u*u),f=(o[i]-d)*a[i]*e/d;c.vx+=l*f,c.vy+=u*f}}function c(){if(r){var t,n=r.length;for(a=Array(n),o=Array(n),t=0;t<n;++t)o[t]=+e(r[t],t,r),a[t]=isNaN(o[t])?0:+i(r[t],t,r)}}return s.initialize=function(e){r=e,c()},s.strength=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),c(),s):i},s.radius=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),c(),s):e},s.x=function(e){return arguments.length?(t=+e,s):t},s.y=function(e){return arguments.length?(n=+e,s):n},s}function As(e){var t=Q(.1),n,r,i;typeof e!=`function`&&(e=Q(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:Q(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),o(),a):e},a}function js(e){var t=Q(.1),n,r,i;typeof e!=`function`&&(e=Q(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:Q(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),o(),a):e},a}var Ms=e=>()=>e;function Ns(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ps(e,t,n){this.k=e,this.x=t,this.y=n}Ps.prototype={constructor:Ps,scale:function(e){return e===1?this:new Ps(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ps(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 Fs=new Ps(1,0,0);Is.prototype=Ps.prototype;function Is(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fs;return e.__zoom}function Ls(e){e.stopImmediatePropagation()}function Rs(e){e.preventDefault(),e.stopImmediatePropagation()}function zs(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Bs(){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 Vs(){return this.__zoom||Fs}function Hs(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Us(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ws(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Gs(){var e=zs,t=Bs,n=Ws,r=Hs,i=Us,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ea,l=Et(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Vs).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Vs),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Fs.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Ps(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Ps(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Ps(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=J(this.that).datum();l.call(e,this.that,new Ns(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=jr(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],ka(this),s.start();Rs(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=J(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=jr(t,i),l=t.clientX,u=t.clientY;Ir(t.view),Ls(t),a.mouse=[c,this.__zoom.invert(c)],ka(this),a.start();function d(e){if(Rs(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=jr(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Lr(e.view,a.moved),Rs(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=jr(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Rs(r),s>0?J(this).transition().duration(s).call(x,d,c,r):J(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Ls(t),s=0;s<i;++s)c=r[s],l=jr(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),ka(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Rs(e),s=0;s<a;++s)c=i[s],l=jr(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Ls(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=jr(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=J(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Ms(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Ms(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Ms(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Ms([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Ks=new Set([`related`,`frequent`,`close`]),qs=new Set([`temporary`,`session`,`conversation`]),Js=new Set([`archived`]);function Ys(e){if(!e)return null;let t=typeof e.tier==`string`?e.tier.trim().toLowerCase():``;if(Ks.has(t))return t;let n=nc(e.recent30dCount),r=nc(e.totalCount),i=n>0?n:r;return i>=10?`close`:i>=3?`frequent`:i>=1?`related`:null}function Xs(e){return e?Ys(e.attributes)||(e.type===`PROJECT_MEMORY_ACCESS`?`related`:null):null}function Zs(e){return b(`knowledge.domain.weightTiers.${e}`)}function Qs(e,t){let n=String(e??``).trim();if(!n||se({project_id:n}))return!1;let r=t?.find(e=>e.project_id===n);if(r){let e=String(r.profile?.lifecycle??``).trim().toLowerCase();if(Js.has(e))return!1}return!0}function $s(e,t){if(!e)return!1;if(e.type!==`PersonalProject`&&e.type!==`RelatedPersonalProject`)return!0;let n=e.attributes??{},r=typeof n.projectId==`string`&&n.projectId.trim()?n.projectId.trim():rc(e.id);if(se({project_id:r})||se({project_id:e.id}))return!1;let i=String(n.scope_type??n.scopeType??``).trim().toLowerCase();if(qs.has(i))return!1;let a=String(n.lifecycle??n.status??``).trim().toLowerCase();return!Js.has(a)&&Qs(r,t)}function ec(e,t){let n=e.nodes.filter(e=>$s(e,t)),r=new Set(n.map(({id:e})=>e)),i=e.edges.filter(e=>r.has(ic(e.source))&&r.has(ic(e.target)));return{...e,nodes:n,edges:i}}function tc(e,t,n){let r=String(t??``).trim();if(!e||!r)return[];let i=e.nodes.find(e=>e.type===`PersonalProject`&&String(e.attributes?.projectId??``).trim()===r);if(!i)return[];let a=new Map(e.nodes.map(e=>[e.id,e])),o=new Map((n??[]).map(e=>[e.project_id,e])),s=new Map,c=Array.isArray(i.attributes?.frequentProjects)?i.attributes.frequentProjects:[];for(let t of c){if(!t||typeof t!=`object`)continue;let i=t,a=String(i.projectId??i.project_id??``).trim();if(!a||a===r||!Qs(a,n))continue;let c=e.nodes.find(e=>(e.type===`PersonalProject`||e.type===`RelatedPersonalProject`)&&String(e.attributes?.projectId??``).trim()===a);if(c&&!$s(c,n))continue;let l=nc(i.recent30dCount),u=Math.max(l,nc(i.totalCount)),d=Ys({tier:i.tier,recent30dCount:l,totalCount:u});if(!d)continue;let f=String(i.name??c?.name??o.get(a)?.profile.name??a).trim()||a;s.set(a,{projectId:a,name:f,totalCount:u,recent30dCount:l,lastUsedAt:typeof i.lastUsedAt==`string`?i.lastUsedAt:null,tier:d,suggestKnowledgeReuse:!!(i.suggestKnowledgeReuse??d===`close`),requiresHumanConfirmation:i.requiresHumanConfirmation!==!1,grantsAccess:!1})}for(let t of e.edges){if(t.type!==`PROJECT_MEMORY_ACCESS`||ic(t.source)!==i.id)continue;let e=a.get(ic(t.target));if(!e||!$s(e,n))continue;let c=String(e.attributes?.projectId??rc(e.id)).trim();if(!c||c===r||s.has(c)||!Qs(c,n))continue;let l=t.attributes??{},u=nc(l.recent30dCount),d=Math.max(u,nc(l.totalCount)),f=Xs(t);f&&s.set(c,{projectId:c,name:e.name||o.get(c)?.profile.name||c,totalCount:d,recent30dCount:u,lastUsedAt:typeof l.lastUsedAt==`string`?l.lastUsedAt:null,tier:f,suggestKnowledgeReuse:!!(l.suggestKnowledgeReuse??f===`close`),requiresHumanConfirmation:l.requiresHumanConfirmation!==!1,grantsAccess:!1})}return[...s.values()].sort((e,t)=>t.recent30dCount-e.recent30dCount||t.totalCount-e.totalCount||e.projectId.localeCompare(t.projectId)).slice(0,3)}function nc(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):0}function rc(e){let t=String(e??``).split(`:`);return t.length>=3?t.slice(2).join(`:`):String(e??``)}function ic(e){return typeof e==`object`&&e?e.id:e}var ac=.62,oc=3,sc=.28,cc=10,lc=240,uc=8,dc=4,fc={top:52,right:24,bottom:24,left:24};function pc(e,t){let n=0;for(let t of e)wc(t.codePointAt(0)??0)?n+=1:/[A-Z@#%&mwMW]/.test(t)?n+=.74:/[ilIjtf.,:;'!|\s]/.test(t)?n+=.36:n+=.6;return n*t}function mc(e,t){return[...e].length*t*ac}function hc(e,t,n=168){if(pc(e,t)<=n)return e;let r=n-pc(`…`,t),i=``;for(let n of e){if(pc(i+n,t)>r)break;i+=n}return`${i}…`}function gc({shapeRadius:e,labelWidth:t,labelBaseline:n,labelFontSize:r,idWidth:i,idBaseline:a,idFontSize:o,badgeTop:s,badgeWidth:c}){let l=Math.max(e,t/2+oc,i/2+oc,c/2),u=Math.max(e,n+r*sc+oc,a+o*sc+oc);return{left:-l,right:l,top:Math.min(-e,s),bottom:u}}function _c(e){return Math.hypot(Math.max(-e.left,e.right),Math.max(-e.top,e.bottom))+cc/2}function vc(e){let t=e.x??0,n=e.y??0,{left:r,top:i,right:a,bottom:o}=e.footprint;return{left:t+r,top:n+i,right:t+a,bottom:n+o}}function yc(e){if(e.length<2)return;let t=Ds(e).velocityDecay(.5).force(`collide`,hs(e=>_c(e.footprint)).strength(1).iterations(4)).stop();for(let n=0;n<lc&&(n%uc!==0||bc(e));n+=1)t.tick();for(let t of e)t.vx=0,t.vy=0}function bc(e){let t=e.map(e=>_c(e.footprint));for(let n=0;n<e.length;n+=1)for(let r=n+1;r<e.length;r+=1)if(Math.hypot((e[n].x??0)-(e[r].x??0),(e[n].y??0)-(e[r].y??0))<t[n]+t[r]-cc)return!0;return!1}function xc(e,t,n,{minScale:r,maxScale:i}){if(!e.length)return null;let a=e.map(vc),o=Math.min(...a.map(e=>e.left)),s=Math.max(...a.map(e=>e.right)),c=Math.min(...a.map(e=>e.top)),l=Math.max(...a.map(e=>e.bottom)),u=t-fc.left-fc.right,d=n-fc.top-fc.bottom,f=Math.max(r,Math.min(i,u/(s-o),d/(l-c))),p=fc.left+u/2,m=fc.top+d/2;return{k:f,x:p-f*(o+s)/2,y:m-f*(c+l)/2}}function Sc(e,t,n,r,i){let a=e.x??0,o=e.y??0,s=(t.x??0)-a,c=(t.y??0)-o,l=Math.hypot(s,c)||1,u=_c(e.footprint),d=_c(t.footprint),f=l-u-d,p=u+Math.max(f,0)/2,m=a+s/l*p,h=o+c/l*p,g={left:m-n.width/2-dc,right:m+n.width/2+dc,top:h-n.height/2-dc,bottom:h+n.height/2+dc};return{x:m,y:h,fits:f>=Math.hypot(n.width,n.height)+8&&!r.some(n=>n!==e&&n!==t&&Cc(g,vc(n)))&&!i.some(e=>Cc(g,{left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2}))}}function Cc(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function wc(e){return e>=4352&&e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744}var Tc=[`blue`,`teal`,`violet`,`amber`,`rose`,`cyan`,`slate`].map(e=>`var(--color-chart-${e})`),Ec=.05,Dc=5,Oc=1.5,kc=.72,Ac=12,jc=7,Mc=20,Nc=24,Pc=28,Fc={width:30,height:15,above:8},Ic=38;function Lc(e,t,n={}){let r=typeof n==`function`?{onNodeSelect:n}:n,i=Math.max(e.clientWidth||0,760),a=Math.max(e.clientHeight||0,520),o=r.projectVisibility===`provided`?t:ec(t),s=new Set(o.nodes.map(({id:e})=>e)),c=o.edges.map(Rc).filter(({sourceId:e,targetId:t})=>s.has(e)&&s.has(t)),l=o.nodes.map(e=>({...e,degree:Yc(e.id,c),footprint:{left:0,top:0,right:0,bottom:0}})),u=J(e);u.selectAll(`*`).remove(),u.attr(`viewBox`,`0 0 ${i} ${a}`).attr(`preserveAspectRatio`,`xMidYMid meet`);let d=`graph-arrow-${Math.random().toString(36).slice(2)}`;u.append(`defs`).append(`marker`).attr(`id`,d).attr(`viewBox`,`0 -5 10 10`).attr(`refX`,28).attr(`refY`,0).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,-5L10,0L0,5`).attr(`class`,`graph-arrow`);let f=u.append(`g`).attr(`class`,`graph-viewport`),p=f.append(`g`).attr(`class`,`graph-edges`),m=f.append(`g`).attr(`class`,`graph-edge-labels`),h=f.append(`g`).attr(`class`,`graph-nodes`),g=p.selectAll(`line.graph-edge`).data(c).join(`line`).attr(`class`,e=>{let t=Xs(e.raw);return[`graph-edge`,t?`weight-tier-${t}`:null,e.invalid_at?`historical`:null,Uc(e)?`human-change-pending`:null,e.human_change_status===`viewed`?`human-change-viewed`:null].filter(Boolean).join(` `)}).attr(`data-relation-type`,e=>e.type).attr(`data-weight-tier`,e=>Xs(e.raw)??null).attr(`marker-end`,`url(#${d})`),_=p.selectAll(`line.graph-edge-hit`).data(c).join(`line`).attr(`class`,`graph-edge-hit`).attr(`role`,`button`).attr(`tabindex`,0).attr(`aria-label`,e=>{let t=Je(e.type),n=Xs(e.raw);return`${n?`${Zs(n)} · `:``}${t.label}:${qe(e.fact||t.description)}`});_.append(`title`).text(e=>{let t=Je(e.type),n=Xs(e.raw);return`${n?`${Zs(n)} · `:``}${t.label}:${qe(e.fact||t.description)}`});let v=c.length<=90?m.selectAll(`g.graph-edge-label`).data(c).join(`g`).attr(`class`,e=>{let t=Xs(e.raw);return[`graph-edge-label`,t?`weight-tier-${t}`:null].filter(Boolean).join(` `)}).attr(`data-relation-type`,e=>e.type).attr(`data-weight-tier`,e=>Xs(e.raw)??null):m.selectAll(`g.graph-edge-label`);v.append(`rect`).attr(`class`,`graph-edge-label-bg`).attr(`x`,e=>-Zc(e)/2).attr(`y`,-10).attr(`width`,Zc).attr(`height`,20).attr(`rx`,10),v.append(`path`).attr(`class`,`graph-edge-label-icon`).attr(`d`,e=>Je(e.type).iconPath).attr(`transform`,e=>`translate(${-Zc(e)/2+6},-6) scale(.5)`),v.append(`text`).attr(`class`,`graph-edge-label-text`).attr(`x`,e=>-Zc(e)/2+22).attr(`y`,3.5).text(e=>Xc(e)),v.append(`title`).text(e=>{let t=Je(e.type),n=Xs(e.raw);return n?`${Zs(n)}(${t.label}):${t.description}`:`${t.label}:${t.description}`});let y=h.selectAll(`g.graph-node`).data(l).join(`g`).attr(`class`,e=>[`graph-node`,$(e)?`project-node`:null,Uc(e)?`human-change-pending`:null,e.human_change_status===`viewed`?`human-change-viewed`:null].filter(Boolean).join(` `)).attr(`tabindex`,0).attr(`role`,`button`).attr(`aria-label`,e=>`${qe(e.name)},ID ${Be(e)}`);y.filter(e=>!$(e)).append(`circle`).attr(`class`,`graph-node-shape`).attr(`r`,Wc).attr(`fill`,e=>Hc(e.type)),y.filter($).append(`circle`).attr(`class`,`graph-project-ring`).attr(`r`,Nc),y.filter($).append(`circle`).attr(`class`,`graph-node-shape`).attr(`r`,19),y.filter($).append(`path`).attr(`class`,`graph-project-icon`).attr(`d`,`M-9,-7H-3L0,-4H9V7H-9Z`),y.filter(Uc).append(`circle`).attr(`class`,`graph-node-human-marker`).attr(`cx`,e=>$(e)?20:12).attr(`cy`,e=>$(e)?-20:-12).attr(`r`,4),y.append(`text`).attr(`class`,`graph-node-label`).attr(`y`,Gc).text(e=>hc(qe(e.name),Ac)),y.append(`text`).attr(`class`,`graph-node-id`).attr(`y`,Kc).text(e=>`#${Be(e)}`);let x=y.append(`g`).attr(`class`,`graph-search-badge`).attr(`transform`,e=>`translate(0,${qc(e)})`);x.append(`rect`).attr(`x`,-Fc.width/2).attr(`y`,-Fc.above).attr(`width`,Fc.width).attr(`height`,Fc.height).attr(`rx`,4),x.append(`text`).attr(`y`,3).text(b(`knowledge.domain.graph.hit`)),y.append(`title`).text(e=>[qe(e.name),e.type,`ID: ${e.id}`,$(e)?b(`knowledge.domain.graph.projectMarked`):null,Uc(e)?e.human_change_status===`unseen`?b(`knowledge.domain.graph.humanUnseen`):b(`knowledge.domain.graph.humanViewed`):null].filter(Boolean).join(`
|
|
1
|
+
import{D as e,E as t,En as n,F as r,In as i,L as a,O as o,Ot as s,P as c,St as l,T as u,Xt as d,ar as f,ft as p,gt as m,lr as h,lt as g,m as _,r as v,rn as y,s as b,t as x,tn as S,w as C,wn as w}from"./_plugin-vue_export-helper-eI1tYej5.js";import{S as T,_ as E,w as D,x as O,y as k}from"./runtime-dom.esm-bundler-hGmI7vEu.js";import{t as A}from"./console-NADovARn.js";import{h as j,m as M}from"./useApi-CROJJdhE-C1eOl8U7.js";import{t as N}from"./vue-router-C8L9ZtNP.js";import{t as P}from"./button-xqhURBmo.js";import{n as F,t as I}from"./RadioGroupItem-CSU0NIZR.js";import{t as L}from"./Switch-BSWYlK7-.js";import{n as R,r as ee,t as z}from"./TabsTrigger-C4wTZx6P.js";import{t as B}from"./GrowthLoading-PsR-4keQ.js";import{a as te,c as V,l as H,n as U,r as ne,t as re}from"./client-jLIUhqvq.js";import{i as ie,n as ae,r as oe,t as se}from"./project-origin-DHxPJqQL.js";import{n as ce}from"./ui-CJi-7Kxt.js";import{t as le}from"./UiDialog-D7qpj9MO.js";import{t as ue}from"./UiIconButton-CVb_NsPj.js";import{t as de}from"./UiNotice-KRFYU6Na.js";import{t as fe}from"./UiSelect-BiPBjvEa.js";import{t as pe}from"./agent-avatar-CBfHZX_0.js";import{n as me,t as he}from"./paths-CDREouhi.js";import{a as ge,i as _e,n as ve,o as ye,r as be,t as xe}from"./attach-closest-edge-B5hSH5Q1.js";import{t as W}from"./task-board-model-DSr4P56O.js";import{a as G,c as Se,d as K,i as Ce,l as we,n as Te,o as Ee,r as De,s as Oe,t as ke,u as Ae}from"./project-board-settings-CuMRwQ6d.js";import{t as je}from"./Input-Ccayh8y4.js";import{n as Me,t as Ne}from"./useMinimumLoadingDisplay-DPHiYCLH.js";import{t as Pe}from"./debounce-CFk-gEUl.js";import{T as Fe}from"./model-D7hnFInc.js";import{t as Ie}from"./UiDisclosure-B3G1FxjZ.js";import{t as Le}from"./AgentName-2dUKeHT9.js";import{t as Re}from"./project-team-api-DwxUWQON.js";import{t as ze}from"./CreateProjectDialog-XTakMEGP.js";import{n as Be,r as Ve,t as He}from"./identity-B_PUXajn.js";import{t as Ue}from"./ProjectJudgmentPolicy-B9uz6uiq.js";import{t as We}from"./VirtualDirectoryList-Dd4h-9AA.js";import{C as Ge,E as Ke,F as qe,I as Je,L as Ye,M as Xe,O as Ze,P as Qe,S as $e,_ as et,b as tt,c as nt,d as rt,f as it,g as at,h as ot,j as st,k as ct,l as lt,p as ut,s as dt,u as ft,v as pt,w as mt,x as ht,y as q}from"./model-D-D84fzk.js";import{i as gt,n as _t,r as vt,t as yt}from"./KnowledgePeek-Bl62ODGt.js";import{a as bt,o as xt,r as St}from"./project-capture-CX4wzdCd.js";function Ct(e,t){return e.status===`archived`||e.profile.lifecycle===`archived`?!1:t.showTemporary||e.project_id===t.selectedProjectId||ae(e)}function wt(e,t,n){let r=new Map(t.map(e=>[e.project_id,e])),i=new Set(t.filter(e=>!Ct(e,n)).map(e=>e.project_id)),a=new Set;for(let t of e.nodes){let e=t.attributes??{};if(t.type!==`PersonalProject`&&t.type!==`RelatedPersonalProject`)continue;let o=String(e.projectId??(t.id.split(`:`).slice(2).join(`:`)||t.id));Ct(r.get(o)??{project_id:o,scope_type:e.scope_type??e.scopeType,status:String(e.status??``),profile:{name:t.name,lifecycle:String(e.lifecycle??``),origin:String(e.origin??``)}},n)||(a.add(t.id),i.add(o),t.id.startsWith(`personal-project:`)&&i.add(t.id.slice(17)))}let o=[...i].map(e=>`project-profile:${e}:`),s=e.nodes.filter(e=>!a.has(e.id)&&!o.some(t=>e.id.startsWith(t))),c=new Set(s.map(e=>e.id)),l=e.edges.filter(e=>c.has(lt(e.source))&&c.has(lt(e.target)));return{...e,nodes:s,edges:l}}var Tt={value:()=>{}};function Et(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Dt(n)}function Dt(e){this._=e}function Ot(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Dt.prototype=Et.prototype={constructor:Dt,on:function(e,t){var n=this._,r=Ot(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=kt(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=At(n[i],e.name,t);else if(t==null)for(i in n)n[i]=At(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Dt(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function kt(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function At(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Tt,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jt={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Mt(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),jt.hasOwnProperty(t)?{space:jt[t],local:e}:e}function Nt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Pt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ft(e){var t=Mt(e);return(t.local?Pt:Nt)(t)}function It(){}function Lt(e){return e==null?It:function(){return this.querySelector(e)}}function Rt(e){typeof e!=`function`&&(e=Lt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Dr(r,this._parents)}function zt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Bt(){return[]}function Vt(e){return e==null?Bt:function(){return this.querySelectorAll(e)}}function Ht(e){return function(){return zt(e.apply(this,arguments))}}function Ut(e){e=typeof e==`function`?Ht(e):Vt(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Dr(r,i)}function Wt(e){return function(){return this.matches(e)}}function Gt(e){return function(t){return t.matches(e)}}var Kt=Array.prototype.find;function qt(e){return function(){return Kt.call(this.children,e)}}function Jt(){return this.firstElementChild}function Yt(e){return this.select(e==null?Jt:qt(typeof e==`function`?e:Gt(e)))}var Xt=Array.prototype.filter;function Zt(){return Array.from(this.children)}function Qt(e){return function(){return Xt.call(this.children,e)}}function $t(e){return this.selectAll(e==null?Zt:Qt(typeof e==`function`?e:Gt(e)))}function en(e){typeof e!=`function`&&(e=Wt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Dr(r,this._parents)}function tn(e){return Array(e.length)}function nn(){return new Dr(this._enter||this._groups.map(tn),this._parents)}function rn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}rn.prototype={constructor:rn,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 an(e){return function(){return e}}function on(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new rn(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function sn(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new rn(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function cn(e){return e.__data__}function ln(e,t){if(!arguments.length)return Array.from(this,cn);var n=t?sn:on,r=this._parents,i=this._groups;typeof e!=`function`&&(e=an(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=un(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Dr(o,r),o._enter=s,o._exit=c,o}function un(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function dn(){return new Dr(this._exit||this._groups.map(tn),this._parents)}function fn(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function pn(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Dr(s,this._parents)}function mn(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function hn(e){e||=gn;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Dr(i,this._parents).order()}function gn(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _n(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vn(){return Array.from(this)}function yn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function bn(){let e=0;for(let t of this)++e;return e}function xn(){return!this.node()}function Sn(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Cn(e){return function(){this.removeAttribute(e)}}function wn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tn(e,t){return function(){this.setAttribute(e,t)}}function En(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Dn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function On(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 kn(e,t){var n=Mt(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?wn:Cn:typeof t==`function`?n.local?On:Dn:n.local?En:Tn)(n,t))}function An(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jn(e){return function(){this.style.removeProperty(e)}}function Mn(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Nn(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Pn(e,t,n){return arguments.length>1?this.each((t==null?jn:typeof t==`function`?Nn:Mn)(e,t,n??``)):Fn(this.node(),e)}function Fn(e,t){return e.style.getPropertyValue(t)||An(e).getComputedStyle(e,null).getPropertyValue(t)}function In(e){return function(){delete this[e]}}function Ln(e,t){return function(){this[e]=t}}function Rn(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zn(e,t){return arguments.length>1?this.each((t==null?In:typeof t==`function`?Rn:Ln)(e,t)):this.node()[e]}function Bn(e){return e.trim().split(/^|\s+/)}function Vn(e){return e.classList||new Hn(e)}function Hn(e){this._node=e,this._names=Bn(e.getAttribute(`class`)||``)}Hn.prototype={add:function(e){this._names.indexOf(e)<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 Un(e,t){for(var n=Vn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Wn(e,t){for(var n=Vn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Gn(e){return function(){Un(this,e)}}function Kn(e){return function(){Wn(this,e)}}function qn(e,t){return function(){(t.apply(this,arguments)?Un:Wn)(this,e)}}function Jn(e,t){var n=Bn(e+``);if(arguments.length<2){for(var r=Vn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?qn:t?Gn:Kn)(n,t))}function Yn(){this.textContent=``}function Xn(e){return function(){this.textContent=e}}function Zn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Qn(e){return arguments.length?this.each(e==null?Yn:(typeof e==`function`?Zn:Xn)(e)):this.node().textContent}function $n(){this.innerHTML=``}function er(e){return function(){this.innerHTML=e}}function tr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function nr(e){return arguments.length?this.each(e==null?$n:(typeof e==`function`?tr:er)(e)):this.node().innerHTML}function rr(){this.nextSibling&&this.parentNode.appendChild(this)}function ir(){return this.each(rr)}function ar(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function or(){return this.each(ar)}function sr(e){var t=typeof e==`function`?e:Ft(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function cr(){return null}function lr(e,t){var n=typeof e==`function`?e:Ft(e),r=t==null?cr:typeof t==`function`?t:Lt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ur(){var e=this.parentNode;e&&e.removeChild(this)}function dr(){return this.each(ur)}function fr(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pr(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mr(e){return this.select(e?pr:fr)}function hr(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function gr(e){return function(t){e.call(this,t,this.__data__)}}function _r(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function vr(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function yr(e,t,n){return function(){var r=this.__on,i,a=gr(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function br(e,t,n){var r=_r(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?yr:vr,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function xr(e,t,n){var r=An(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Sr(e,t){return function(){return xr(this,e,t)}}function Cr(e,t){return function(){return xr(this,e,t.apply(this,arguments))}}function wr(e,t){return this.each((typeof t==`function`?Cr:Sr)(e,t))}function*Tr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Er=[null];function Dr(e,t){this._groups=e,this._parents=t}function Or(){return new Dr([[document.documentElement]],Er)}function kr(){return this}Dr.prototype=Or.prototype={constructor:Dr,select:Rt,selectAll:Ut,selectChild:Yt,selectChildren:$t,filter:en,data:ln,enter:nn,exit:dn,join:fn,merge:pn,selection:kr,order:mn,sort:hn,call:_n,nodes:vn,node:yn,size:bn,empty:xn,each:Sn,attr:kn,style:Pn,property:zn,classed:Jn,text:Qn,html:nr,raise:ir,lower:or,append:sr,insert:lr,remove:dr,clone:mr,datum:hr,on:br,dispatch:wr,[Symbol.iterator]:Tr};function J(e){return typeof e==`string`?new Dr([[document.querySelector(e)]],[document.documentElement]):new Dr([[e]],Er)}function Ar(e){let t;for(;t=e.sourceEvent;)e=t;return e}function jr(e,t){if(e=Ar(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Mr={passive:!1},Nr={capture:!0,passive:!1};function Pr(e){e.stopImmediatePropagation()}function Fr(e){e.preventDefault(),e.stopImmediatePropagation()}function Ir(e){var t=e.document.documentElement,n=J(e).on(`dragstart.drag`,Fr,Nr);`onselectstart`in t?n.on(`selectstart.drag`,Fr,Nr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Lr(e,t){var n=e.document.documentElement,r=J(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Fr,Nr),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Rr=e=>()=>e;function zr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}zr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Br(e){return!e.ctrlKey&&!e.button}function Vr(){return this.parentNode}function Hr(e,t){return t??{x:e.x,y:e.y}}function Ur(){return navigator.maxTouchPoints||`ontouchstart`in this}function Wr(){var e=Br,t=Vr,n=Hr,r=Ur,i={},a=Et(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Mr).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(J(n.view).on(`mousemove.drag`,m,Nr).on(`mouseup.drag`,h,Nr),Ir(n.view),Pr(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Fr(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){J(e.view).on(`mousemove.drag mouseup.drag`,null),Lr(e.view,l),Fr(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Pr(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Fr(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Pr(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=jr(l||r,t),p,m,h;if((h=n.call(e,new zr(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=jr(l||a,t),_=o}u.call(r,e,new zr(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Rr(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Rr(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Rr(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Rr(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Gr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Kr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qr(){}var Jr=.7,Yr=1/Jr,Xr=`\\s*([+-]?\\d+)\\s*`,Zr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Qr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,$r=/^#([0-9a-f]{3,8})$/,ei=RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),ti=RegExp(`^rgb\\(${Qr},${Qr},${Qr}\\)$`),ni=RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Zr}\\)$`),ri=RegExp(`^rgba\\(${Qr},${Qr},${Qr},${Zr}\\)$`),ii=RegExp(`^hsl\\(${Zr},${Qr},${Qr}\\)$`),ai=RegExp(`^hsla\\(${Zr},${Qr},${Qr},${Zr}\\)$`),oi={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};Gr(qr,di,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:si,formatHex:si,formatHex8:ci,formatHsl:li,formatRgb:ui,toString:ui});function si(){return this.rgb().formatHex()}function ci(){return this.rgb().formatHex8()}function li(){return Ci(this).formatHsl()}function ui(){return this.rgb().formatRgb()}function di(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=$r.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fi(t):n===3?new Y(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pi(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=ei.exec(e))?new Y(t[1],t[2],t[3],1):(t=ti.exec(e))?new Y(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ni.exec(e))?pi(t[1],t[2],t[3],t[4]):(t=ri.exec(e))?pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ii.exec(e))?Si(t[1],t[2]/100,t[3]/100,1):(t=ai.exec(e))?Si(t[1],t[2]/100,t[3]/100,t[4]):oi.hasOwnProperty(e)?fi(oi[e]):e===`transparent`?new Y(NaN,NaN,NaN,0):null}function fi(e){return new Y(e>>16&255,e>>8&255,e&255,1)}function pi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Y(e,t,n,r)}function mi(e){return e instanceof qr||(e=di(e)),e?(e=e.rgb(),new Y(e.r,e.g,e.b,e.opacity)):new Y}function hi(e,t,n,r){return arguments.length===1?mi(e):new Y(e,t,n,r??1)}function Y(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Gr(Y,hi,Kr(qr,{brighter(e){return e=e==null?Yr:Yr**+e,new Y(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jr:Jr**+e,new Y(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Y(bi(this.r),bi(this.g),bi(this.b),yi(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:gi,formatHex:gi,formatHex8:_i,formatRgb:vi,toString:vi}));function gi(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}`}function _i(){return`#${xi(this.r)}${xi(this.g)}${xi(this.b)}${xi((isNaN(this.opacity)?1:this.opacity)*255)}`}function vi(){let e=yi(this.opacity);return`${e===1?`rgb(`:`rgba(`}${bi(this.r)}, ${bi(this.g)}, ${bi(this.b)}${e===1?`)`:`, ${e})`}`}function yi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function bi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xi(e){return e=bi(e),(e<16?`0`:``)+e.toString(16)}function Si(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ti(e,t,n,r)}function Ci(e){if(e instanceof Ti)return new Ti(e.h,e.s,e.l,e.opacity);if(e instanceof qr||(e=di(e)),!e)return new Ti;if(e instanceof Ti)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ti(o,s,c,e.opacity)}function wi(e,t,n,r){return arguments.length===1?Ci(e):new Ti(e,t,n,r??1)}function Ti(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Gr(Ti,wi,Kr(qr,{brighter(e){return e=e==null?Yr:Yr**+e,new Ti(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jr:Jr**+e,new Ti(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Y(Oi(e>=240?e-240:e+120,i,r),Oi(e,i,r),Oi(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ti(Ei(this.h),Di(this.s),Di(this.l),yi(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(){let e=yi(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Ei(this.h)}, ${Di(this.s)*100}%, ${Di(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Ei(e){return e=(e||0)%360,e<0?e+360:e}function Di(e){return Math.max(0,Math.min(1,e||0))}function Oi(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ki=e=>()=>e;function Ai(e,t){return function(n){return e+n*t}}function ji(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Mi(e){return(e=+e)==1?Ni:function(t,n){return n-t?ji(t,n,e):ki(isNaN(t)?n:t)}}function Ni(e,t){var n=t-e;return n?Ai(e,n):ki(isNaN(e)?t:e)}var Pi=(function e(t){var n=Mi(t);function r(e,t){var r=n((e=hi(e)).r,(t=hi(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Ni(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Fi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Li=new RegExp(Ii.source,`g`);function Ri(e){return function(){return e}}function zi(e){return function(t){return e(t)+``}}function Bi(e,t){var n=Ii.lastIndex=Li.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Ii.exec(e))&&(i=Li.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Fi(r,i)})),n=Li.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?zi(c[0].x):Ri(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var Vi=180/Math.PI,Hi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ui(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Vi,skewX:Math.atan(c)*Vi,scaleX:o,scaleY:s}}var Wi;function Gi(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Hi:Ui(t.a,t.b,t.c,t.d,t.e,t.f)}function Ki(e){return e==null||(Wi||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Wi.setAttribute(`transform`,e),!(e=Wi.transform.baseVal.consolidate()))?Hi:(e=e.matrix,Ui(e.a,e.b,e.c,e.d,e.e,e.f))}function qi(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Fi(e,i)},{i:c-2,x:Fi(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Fi(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Fi(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Fi(e,n)},{i:s-2,x:Fi(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Ji=qi(Gi,`px, `,`px)`,`deg)`),Yi=qi(Ki,`, `,`)`,`)`),Xi=1e-12;function Zi(e){return((e=Math.exp(e))+1/e)/2}function Qi(e){return((e=Math.exp(e))-1/e)/2}function $i(e){return((e=Math.exp(2*e))-1)/(e+1)}var ea=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Xi)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Zi(y),c=s/(n*g)*(i*$i(t*r+y)-Qi(y));return[a+c*d,o+c*f,s*i/Zi(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),ta=0,na=0,ra=0,ia=1e3,aa,oa,sa=0,ca=0,la=0,ua=typeof performance==`object`&&performance.now?performance:Date,da=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function fa(){return ca||=(da(pa),ua.now()+la)}function pa(){ca=0}function ma(){this._call=this._time=this._next=null}ma.prototype=ha.prototype={constructor:ma,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?fa():+n)+(t==null?0:+t),!this._next&&oa!==this&&(oa?oa._next=this:aa=this,oa=this),this._call=e,this._time=n,ba()},stop:function(){this._call&&(this._call=null,this._time=1/0,ba())}};function ha(e,t,n){var r=new ma;return r.restart(e,t,n),r}function ga(){fa(),++ta;for(var e=aa,t;e;)(t=ca-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ta}function _a(){ca=(sa=ua.now())+la,ta=na=0;try{ga()}finally{ta=0,ya(),ca=0}}function va(){var e=ua.now(),t=e-sa;t>ia&&(la-=t,sa=e)}function ya(){for(var e,t=aa,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:aa=n);oa=e,ba(r)}function ba(e){ta||(na&&=clearTimeout(na),e-ca>24?(e<1/0&&(na=setTimeout(_a,e-ua.now()-la)),ra&&=clearInterval(ra)):(ra||=(sa=ua.now(),setInterval(va,ia)),ta=1,da(_a)))}function xa(e,t,n){var r=new ma;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Sa=Et(`start`,`end`,`cancel`,`interrupt`),Ca=[];function wa(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Oa(e,n,{name:t,index:r,group:i,on:Sa,tween:Ca,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Ta(e,t){var n=Da(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Ea(e,t){var n=Da(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Da(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Oa(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ha(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return xa(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(xa(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function ka(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function Aa(e){return this.each(function(){ka(this,e)})}function ja(e,t){var n,r;return function(){var i=Ea(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ma(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ea(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Na(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Da(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ja:Ma)(n,e,t))}function Pa(e,t,n){var r=e._id;return e.each(function(){var e=Ea(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Da(e,r).value[t]}}function Fa(e,t){var n;return(typeof t==`number`?Fi:t instanceof di?Pi:(n=di(t))?(t=n,Pi):Bi)(e,t)}function Ia(e){return function(){this.removeAttribute(e)}}function La(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ra(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function za(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Ba(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Va(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ha(e,t){var n=Mt(e),r=n===`transform`?Yi:Fa;return this.attrTween(e,typeof t==`function`?(n.local?Va:Ba)(n,r,Pa(this,`attr.`+e,t)):t==null?(n.local?La:Ia)(n):(n.local?za:Ra)(n,r,t))}function Ua(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Wa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ga(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Wa(e,i)),n}return i._value=t,i}function Ka(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ua(e,i)),n}return i._value=t,i}function qa(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 Error();var r=Mt(e);return this.tween(n,(r.local?Ga:Ka)(r,t))}function Ja(e,t){return function(){Ta(this,e).delay=+t.apply(this,arguments)}}function Ya(e,t){return t=+t,function(){Ta(this,e).delay=t}}function Xa(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ja:Ya)(t,e)):Da(this.node(),t).delay}function Za(e,t){return function(){Ea(this,e).duration=+t.apply(this,arguments)}}function Qa(e,t){return t=+t,function(){Ea(this,e).duration=t}}function $a(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Za:Qa)(t,e)):Da(this.node(),t).duration}function eo(e,t){if(typeof t!=`function`)throw Error();return function(){Ea(this,e).ease=t}}function to(e){var t=this._id;return arguments.length?this.each(eo(t,e)):Da(this.node(),t).ease}function no(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ea(this,e).ease=n}}function ro(e){if(typeof e!=`function`)throw Error();return this.each(no(this._id,e))}function io(e){typeof e!=`function`&&(e=Wt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Po(r,this._parents,this._name,this._id)}function ao(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Po(o,this._parents,this._name,this._id)}function oo(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function so(e,t,n){var r,i,a=oo(t)?Ta:Ea;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function co(e,t){var n=this._id;return arguments.length<2?Da(this.node(),n).on.on(e):this.each(so(n,e,t))}function lo(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function uo(){return this.on(`end.remove`,lo(this._id))}function fo(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Lt(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,wa(l[f],t,n,f,l,Da(u,n)));return new Po(a,this._parents,t,n)}function po(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Vt(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Da(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&wa(p,t,n,h,f,m);a.push(f),o.push(u)}return new Po(a,o,t,n)}var mo=Or.prototype.constructor;function ho(){return new mo(this._groups,this._parents)}function go(e,t){var n,r,i;return function(){var a=Fn(this,e),o=(this.style.removeProperty(e),Fn(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function _o(e){return function(){this.style.removeProperty(e)}}function vo(e,t,n){var r,i=n+``,a;return function(){var o=Fn(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function yo(e,t,n){var r,i,a;return function(){var o=Fn(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Fn(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function bo(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ea(this,e),l=c.on,u=c.value[a]==null?s||=_o(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function xo(e,t,n){var r=(e+=``)==`transform`?Ji:Fa;return t==null?this.styleTween(e,go(e,r)).on(`end.style.`+e,_o(e)):typeof t==`function`?this.styleTween(e,yo(e,r,Pa(this,`style.`+e,t))).each(bo(this._id,e)):this.styleTween(e,vo(e,r,t),n).on(`end.style.`+e,null)}function So(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Co(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&So(e,a,n)),r}return a._value=t,a}function wo(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Co(e,t,n??``))}function To(e){return function(){this.textContent=e}}function Eo(e){return function(){var t=e(this);this.textContent=t??``}}function Do(e){return this.tween(`text`,typeof e==`function`?Eo(Pa(this,`text`,e)):To(e==null?``:e+``))}function Oo(e){return function(t){this.textContent=e.call(this,t)}}function ko(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Oo(r)),t}return r._value=e,r}function Ao(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 Error();return this.tween(t,ko(e))}function jo(){for(var e=this._name,t=this._id,n=Fo(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Da(c,t);wa(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Po(r,this._parents,e,n)}function Mo(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ea(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var No=0;function Po(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Fo(){return++No}var Io=Or.prototype;Po.prototype={constructor:Po,select:fo,selectAll:po,selectChild:Io.selectChild,selectChildren:Io.selectChildren,filter:io,merge:ao,selection:ho,transition:jo,call:Io.call,nodes:Io.nodes,node:Io.node,size:Io.size,empty:Io.empty,each:Io.each,on:co,attr:Ha,attrTween:qa,style:xo,styleTween:wo,text:Do,textTween:Ao,remove:uo,tween:Na,delay:Xa,duration:$a,ease:to,easeVarying:ro,end:Mo,[Symbol.iterator]:Io[Symbol.iterator]};function Lo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ro={time:null,delay:0,duration:250,ease:Lo};function zo(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Bo(e){var t,n;e instanceof Po?(t=e._id,e=e._name):(t=Fo(),(n=Ro).time=fa(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&wa(c,e,t,l,o,n||zo(c,t));return new Po(r,this._parents,e,t)}Or.prototype.interrupt=Aa,Or.prototype.transition=Bo;var{abs:Vo,max:Ho,min:Uo}=Math;[`w`,`e`].map(Wo),[`n`,`s`].map(Wo),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Wo);function Wo(e){return{type:e}}function Go(e,t){var n,r=1;e??=0,t??=0;function i(){var i,a=n.length,o,s=0,c=0;for(i=0;i<a;++i)o=n[i],s+=o.x,c+=o.y;for(s=(s/a-e)*r,c=(c/a-t)*r,i=0;i<a;++i)o=n[i],o.x-=s,o.y-=c}return i.initialize=function(e){n=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i.strength=function(e){return arguments.length?(r=+e,i):r},i}function Ko(e){let t=+this._x.call(null,e),n=+this._y.call(null,e);return qo(this.cover(t,n),t,n,e)}function qo(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,a=e._root,o={data:r},s=e._x0,c=e._y0,l=e._x1,u=e._y1,d,f,p,m,h,g,_,v;if(!a)return e._root=o,e;for(;a.length;)if((h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f,i=a,!(a=a[_=g<<1|h]))return i[_]=o,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),t===p&&n===m)return o.next=a,i?i[_]=o:e._root=o,e;do i=i?i[_]=[,,,,]:e._root=[,,,,],(h=t>=(d=(s+l)/2))?s=d:l=d,(g=n>=(f=(c+u)/2))?c=f:u=f;while((_=g<<1|h)==(v=(m>=f)<<1|p>=d));return i[v]=a,i[_]=o,e}function Jo(e){var t,n,r=e.length,i,a,o=Array(r),s=Array(r),c=1/0,l=1/0,u=-1/0,d=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(a=+this._y.call(null,t))||(o[n]=i,s[n]=a,i<c&&(c=i),i>u&&(u=i),a<l&&(l=a),a>d&&(d=a));if(c>u||l>d)return this;for(this.cover(c,l).cover(u,d),n=0;n<r;++n)qo(this,o[n],s[n],e[n]);return this}function Yo(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,a=(r=Math.floor(t))+1;else{for(var o=i-n||1,s=this._root,c,l;n>e||e>=i||r>t||t>=a;)switch(l=(t<r)<<1|e<n,c=[,,,,],c[l]=s,s=c,o*=2,l){case 0:i=n+o,a=r+o;break;case 1:n=i-o,a=r+o;break;case 2:i=n+o,r=a-o;break;case 3:n=i-o,r=a-o}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function Xo(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Zo(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function X(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Qo(e,t,n){var r,i=this._x0,a=this._y0,o,s,c,l,u=this._x1,d=this._y1,f=[],p=this._root,m,h;for(p&&f.push(new X(p,i,a,u,d)),n==null?n=1/0:(i=e-n,a=t-n,u=e+n,d=t+n,n*=n);m=f.pop();)if(!(!(p=m.node)||(o=m.x0)>u||(s=m.y0)>d||(c=m.x1)<i||(l=m.y1)<a)){if(p.length){var g=(o+c)/2,_=(s+l)/2;f.push(new X(p[3],g,_,c,l),new X(p[2],o,_,g,l),new X(p[1],g,s,c,_),new X(p[0],o,s,g,_)),(h=(t>=_)<<1|e>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=m)}else{var v=e-+this._x.call(null,p.data),y=t-+this._y.call(null,p.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);i=e-x,a=t-x,u=e+x,d=t+x,r=p.data}}}return r}function $o(e){if(isNaN(u=+this._x.call(null,e))||isNaN(d=+this._y.call(null,e)))return this;var t,n=this._root,r,i,a,o=this._x0,s=this._y0,c=this._x1,l=this._y1,u,d,f,p,m,h,g,_;if(!n)return this;if(n.length)for(;;){if((m=u>=(f=(o+c)/2))?o=f:c=f,(h=d>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[g=h<<1|m]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,_=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[_]=n:this._root=n),this):(this._root=a,this)}function es(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function ts(){return this._root}function ns(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function rs(e){var t=[],n,r=this._root,i,a,o,s,c;for(r&&t.push(new X(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,a=n.x0,o=n.y0,s=n.x1,c=n.y1)&&r.length){var l=(a+s)/2,u=(o+c)/2;(i=r[3])&&t.push(new X(i,l,u,s,c)),(i=r[2])&&t.push(new X(i,a,u,l,c)),(i=r[1])&&t.push(new X(i,l,o,s,u)),(i=r[0])&&t.push(new X(i,a,o,l,u))}return this}function is(e){var t=[],n=[],r;for(this._root&&t.push(new X(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,c=r.x1,l=r.y1,u=(o+c)/2,d=(s+l)/2;(a=i[0])&&t.push(new X(a,o,s,u,d)),(a=i[1])&&t.push(new X(a,u,s,c,d)),(a=i[2])&&t.push(new X(a,o,d,u,l)),(a=i[3])&&t.push(new X(a,u,d,c,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function as(e){return e[0]}function os(e){return arguments.length?(this._x=e,this):this._x}function ss(e){return e[1]}function cs(e){return arguments.length?(this._y=e,this):this._y}function ls(e,t,n){var r=new us(t??as,n??ss,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function us(e,t,n,r,i,a){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function ds(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Z=ls.prototype=us.prototype;Z.copy=function(){var e=new us(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=ds(t),e;for(n=[{source:t,target:e._root=[,,,,]}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=[,,,,]}):t.target[i]=ds(r));return e},Z.add=Ko,Z.addAll=Jo,Z.cover=Yo,Z.data=Xo,Z.extent=Zo,Z.find=Qo,Z.remove=$o,Z.removeAll=es,Z.root=ts,Z.size=ns,Z.visit=rs,Z.visitAfter=is,Z.x=os,Z.y=cs;function Q(e){return function(){return e}}function fs(e){return(e()-.5)*1e-6}function ps(e){return e.x+e.vx}function ms(e){return e.y+e.vy}function hs(e){var t,n,r,i=1,a=1;typeof e!=`function`&&(e=Q(e==null?1:+e));function o(){for(var e,o=t.length,c,l,u,d,f,p,m=0;m<a;++m)for(c=ls(t,ps,ms).visitAfter(s),e=0;e<o;++e)l=t[e],f=n[l.index],p=f*f,u=l.x+l.vx,d=l.y+l.vy,c.visit(h);function h(e,t,n,a,o){var s=e.data,c=e.r,m=f+c;if(s){if(s.index>l.index){var h=u-s.x-s.vx,g=d-s.y-s.vy,_=h*h+g*g;_<m*m&&(h===0&&(h=fs(r),_+=h*h),g===0&&(g=fs(r),_+=g*g),_=(m-(_=Math.sqrt(_)))/_*i,l.vx+=(h*=_)*(m=(c*=c)/(p+c)),l.vy+=(g*=_)*m,s.vx-=h*(m=1-m),s.vy-=g*m)}}else return t>u+m||a<u-m||n>d+m||o<d-m}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function c(){if(t){var r,i=t.length,a;for(n=Array(i),r=0;r<i;++r)a=t[r],n[a.index]=+e(a,r,t)}}return o.initialize=function(e,n){t=e,r=n,c()},o.iterations=function(e){return arguments.length?(a=+e,o):a},o.strength=function(e){return arguments.length?(i=+e,o):i},o.radius=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),c(),o):e},o}function gs(e){return e.index}function _s(e,t){var n=e.get(t);if(!n)throw Error(`node not found: `+t);return n}function vs(e){var t=gs,n=d,r,i=Q(30),a,o,s,c,l,u=1;e??=[];function d(e){return 1/Math.min(s[e.source.index],s[e.target.index])}function f(t){for(var n=0,i=e.length;n<u;++n)for(var o=0,s,d,f,p,m,h,g;o<i;++o)s=e[o],d=s.source,f=s.target,p=f.x+f.vx-d.x-d.vx||fs(l),m=f.y+f.vy-d.y-d.vy||fs(l),h=Math.sqrt(p*p+m*m),h=(h-a[o])/h*t*r[o],p*=h,m*=h,f.vx-=p*(g=c[o]),f.vy-=m*g,d.vx+=p*(g=1-g),d.vy+=m*g}function p(){if(o){var n,i=o.length,l=e.length,u=new Map(o.map((e,n)=>[t(e,n,o),e])),d;for(n=0,s=Array(i);n<l;++n)d=e[n],d.index=n,typeof d.source!=`object`&&(d.source=_s(u,d.source)),typeof d.target!=`object`&&(d.target=_s(u,d.target)),s[d.source.index]=(s[d.source.index]||0)+1,s[d.target.index]=(s[d.target.index]||0)+1;for(n=0,c=Array(l);n<l;++n)d=e[n],c[n]=s[d.source.index]/(s[d.source.index]+s[d.target.index]);r=Array(l),m(),a=Array(l),h()}}function m(){if(o)for(var t=0,i=e.length;t<i;++t)r[t]=+n(e[t],t,e)}function h(){if(o)for(var t=0,n=e.length;t<n;++t)a[t]=+i(e[t],t,e)}return f.initialize=function(e,t){o=e,l=t,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(t=e,f):t},f.iterations=function(e){return arguments.length?(u=+e,f):u},f.strength=function(e){return arguments.length?(n=typeof e==`function`?e:Q(+e),m(),f):n},f.distance=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),h(),f):i},f}var ys=1664525,bs=1013904223,xs=4294967296;function Ss(){let e=1;return()=>(e=(ys*e+bs)%xs)/xs}function Cs(e){return e.x}function ws(e){return e.y}var Ts=10,Es=Math.PI*(3-Math.sqrt(5));function Ds(e){var t,n=1,r=.001,i=1-r**(1/300),a=0,o=.6,s=new Map,c=ha(d),l=Et(`tick`,`end`),u=Ss();e??=[];function d(){f(),l.call(`tick`,t),n<r&&(c.stop(),l.call(`end`,t))}function f(r){var c,l=e.length,u;r===void 0&&(r=1);for(var d=0;d<r;++d)for(n+=(a-n)*i,s.forEach(function(e){e(n)}),c=0;c<l;++c)u=e[c],u.fx==null?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),u.fy==null?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t=0,n=e.length,r;t<n;++t){if(r=e[t],r.index=t,r.fx!=null&&(r.x=r.fx),r.fy!=null&&(r.y=r.fy),isNaN(r.x)||isNaN(r.y)){var i=Ts*Math.sqrt(.5+t),a=t*Es;r.x=i*Math.cos(a),r.y=i*Math.sin(a)}(isNaN(r.vx)||isNaN(r.vy))&&(r.vx=r.vy=0)}}function m(t){return t.initialize&&t.initialize(e,u),t}return p(),t={tick:f,restart:function(){return c.restart(d),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),s.forEach(m),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(i=+e,t):+i},alphaTarget:function(e){return arguments.length?(a=+e,t):a},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(u=e,s.forEach(m),t):u},force:function(e,n){return arguments.length>1?(n==null?s.delete(e):s.set(e,m(n)),t):s.get(e)},find:function(t,n,r){var i=0,a=e.length,o,s,c,l,u;for(r==null?r=1/0:r*=r,i=0;i<a;++i)l=e[i],o=t-l.x,s=n-l.y,c=o*o+s*s,c<r&&(u=l,r=c);return u},on:function(e,n){return arguments.length>1?(l.on(e,n),t):l.on(e)}}}function Os(){var e,t,n,r,i=Q(-30),a,o=1,s=1/0,c=.81;function l(n){var i,a=e.length,o=ls(e,Cs,ws).visitAfter(d);for(r=n,i=0;i<a;++i)t=e[i],o.visit(f)}function u(){if(e){var t,n=e.length,r;for(a=Array(n),t=0;t<n;++t)r=e[t],a[r.index]=+i(r,t,e)}}function d(e){var t=0,n,r,i=0,o,s,c;if(e.length){for(o=s=c=0;c<4;++c)(n=e[c])&&(r=Math.abs(n.value))&&(t+=n.value,i+=r,o+=r*n.x,s+=r*n.y);e.x=o/i,e.y=s/i}else{n=e,n.x=n.data.x,n.y=n.data.y;do t+=a[n.data.index];while(n=n.next)}e.value=t}function f(e,i,l,u){if(!e.value)return!0;var d=e.x-t.x,f=e.y-t.y,p=u-i,m=d*d+f*f;if(p*p/c<m)return m<s&&(d===0&&(d=fs(n),m+=d*d),f===0&&(f=fs(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)),t.vx+=d*e.value*r/m,t.vy+=f*e.value*r/m),!0;if(!(e.length||m>=s)){(e.data!==t||e.next)&&(d===0&&(d=fs(n),m+=d*d),f===0&&(f=fs(n),m+=f*f),m<o&&(m=Math.sqrt(o*m)));do e.data!==t&&(p=a[e.data.index]*r/m,t.vx+=d*p,t.vy+=f*p);while(e=e.next)}}return l.initialize=function(t,r){e=t,n=r,u()},l.strength=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),u(),l):i},l.distanceMin=function(e){return arguments.length?(o=e*e,l):Math.sqrt(o)},l.distanceMax=function(e){return arguments.length?(s=e*e,l):Math.sqrt(s)},l.theta=function(e){return arguments.length?(c=e*e,l):Math.sqrt(c)},l}function ks(e,t,n){var r,i=Q(.1),a,o;typeof e!=`function`&&(e=Q(+e)),t??=0,n??=0;function s(e){for(var i=0,s=r.length;i<s;++i){var c=r[i],l=c.x-t||1e-6,u=c.y-n||1e-6,d=Math.sqrt(l*l+u*u),f=(o[i]-d)*a[i]*e/d;c.vx+=l*f,c.vy+=u*f}}function c(){if(r){var t,n=r.length;for(a=Array(n),o=Array(n),t=0;t<n;++t)o[t]=+e(r[t],t,r),a[t]=isNaN(o[t])?0:+i(r[t],t,r)}}return s.initialize=function(e){r=e,c()},s.strength=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),c(),s):i},s.radius=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),c(),s):e},s.x=function(e){return arguments.length?(t=+e,s):t},s.y=function(e){return arguments.length?(n=+e,s):n},s}function As(e){var t=Q(.1),n,r,i;typeof e!=`function`&&(e=Q(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vx+=(i[t]-o.x)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:Q(+e),o(),a):t},a.x=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),o(),a):e},a}function js(e){var t=Q(.1),n,r,i;typeof e!=`function`&&(e=Q(e==null?0:+e));function a(e){for(var t=0,a=n.length,o;t<a;++t)o=n[t],o.vy+=(i[t]-o.y)*r[t]*e}function o(){if(n){var a,o=n.length;for(r=Array(o),i=Array(o),a=0;a<o;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return a.initialize=function(e){n=e,o()},a.strength=function(e){return arguments.length?(t=typeof e==`function`?e:Q(+e),o(),a):t},a.y=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),o(),a):e},a}var Ms=e=>()=>e;function Ns(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ps(e,t,n){this.k=e,this.x=t,this.y=n}Ps.prototype={constructor:Ps,scale:function(e){return e===1?this:new Ps(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ps(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 Fs=new Ps(1,0,0);Is.prototype=Ps.prototype;function Is(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fs;return e.__zoom}function Ls(e){e.stopImmediatePropagation()}function Rs(e){e.preventDefault(),e.stopImmediatePropagation()}function zs(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Bs(){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 Vs(){return this.__zoom||Fs}function Hs(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Us(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ws(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Gs(){var e=zs,t=Bs,n=Ws,r=Hs,i=Us,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ea,l=Et(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Vs).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Vs),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Fs.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Ps(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Ps(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Ps(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=J(this.that).datum();l.call(e,this.that,new Ns(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=jr(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],ka(this),s.start();Rs(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=J(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=jr(t,i),l=t.clientX,u=t.clientY;Ir(t.view),Ls(t),a.mouse=[c,this.__zoom.invert(c)],ka(this),a.start();function d(e){if(Rs(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=jr(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Lr(e.view,a.moved),Rs(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=jr(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Rs(r),s>0?J(this).transition().duration(s).call(x,d,c,r):J(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Ls(t),s=0;s<i;++s)c=r[s],l=jr(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),ka(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Rs(e),s=0;s<a;++s)c=i[s],l=jr(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Ls(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=jr(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=J(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Ms(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Ms(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Ms(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Ms([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Ks=new Set([`related`,`frequent`,`close`]),qs=new Set([`temporary`,`session`,`conversation`]),Js=new Set([`archived`]);function Ys(e){if(!e)return null;let t=typeof e.tier==`string`?e.tier.trim().toLowerCase():``;if(Ks.has(t))return t;let n=nc(e.recent30dCount),r=nc(e.totalCount),i=n>0?n:r;return i>=10?`close`:i>=3?`frequent`:i>=1?`related`:null}function Xs(e){return e?Ys(e.attributes)||(e.type===`PROJECT_MEMORY_ACCESS`?`related`:null):null}function Zs(e){return b(`knowledge.domain.weightTiers.${e}`)}function Qs(e,t){let n=String(e??``).trim();if(!n||se({project_id:n}))return!1;let r=t?.find(e=>e.project_id===n);if(r){let e=String(r.profile?.lifecycle??``).trim().toLowerCase();if(Js.has(e))return!1}return!0}function $s(e,t){if(!e)return!1;if(e.type!==`PersonalProject`&&e.type!==`RelatedPersonalProject`)return!0;let n=e.attributes??{},r=typeof n.projectId==`string`&&n.projectId.trim()?n.projectId.trim():rc(e.id);if(se({project_id:r})||se({project_id:e.id}))return!1;let i=String(n.scope_type??n.scopeType??``).trim().toLowerCase();if(qs.has(i))return!1;let a=String(n.lifecycle??n.status??``).trim().toLowerCase();return!Js.has(a)&&Qs(r,t)}function ec(e,t){let n=e.nodes.filter(e=>$s(e,t)),r=new Set(n.map(({id:e})=>e)),i=e.edges.filter(e=>r.has(ic(e.source))&&r.has(ic(e.target)));return{...e,nodes:n,edges:i}}function tc(e,t,n){let r=String(t??``).trim();if(!e||!r)return[];let i=e.nodes.find(e=>e.type===`PersonalProject`&&String(e.attributes?.projectId??``).trim()===r);if(!i)return[];let a=new Map(e.nodes.map(e=>[e.id,e])),o=new Map((n??[]).map(e=>[e.project_id,e])),s=new Map,c=Array.isArray(i.attributes?.frequentProjects)?i.attributes.frequentProjects:[];for(let t of c){if(!t||typeof t!=`object`)continue;let i=t,a=String(i.projectId??i.project_id??``).trim();if(!a||a===r||!Qs(a,n))continue;let c=e.nodes.find(e=>(e.type===`PersonalProject`||e.type===`RelatedPersonalProject`)&&String(e.attributes?.projectId??``).trim()===a);if(c&&!$s(c,n))continue;let l=nc(i.recent30dCount),u=Math.max(l,nc(i.totalCount)),d=Ys({tier:i.tier,recent30dCount:l,totalCount:u});if(!d)continue;let f=String(i.name??c?.name??o.get(a)?.profile.name??a).trim()||a;s.set(a,{projectId:a,name:f,totalCount:u,recent30dCount:l,lastUsedAt:typeof i.lastUsedAt==`string`?i.lastUsedAt:null,tier:d,suggestKnowledgeReuse:!!(i.suggestKnowledgeReuse??d===`close`),requiresHumanConfirmation:i.requiresHumanConfirmation!==!1,grantsAccess:!1})}for(let t of e.edges){if(t.type!==`PROJECT_MEMORY_ACCESS`||ic(t.source)!==i.id)continue;let e=a.get(ic(t.target));if(!e||!$s(e,n))continue;let c=String(e.attributes?.projectId??rc(e.id)).trim();if(!c||c===r||s.has(c)||!Qs(c,n))continue;let l=t.attributes??{},u=nc(l.recent30dCount),d=Math.max(u,nc(l.totalCount)),f=Xs(t);f&&s.set(c,{projectId:c,name:e.name||o.get(c)?.profile.name||c,totalCount:d,recent30dCount:u,lastUsedAt:typeof l.lastUsedAt==`string`?l.lastUsedAt:null,tier:f,suggestKnowledgeReuse:!!(l.suggestKnowledgeReuse??f===`close`),requiresHumanConfirmation:l.requiresHumanConfirmation!==!1,grantsAccess:!1})}return[...s.values()].sort((e,t)=>t.recent30dCount-e.recent30dCount||t.totalCount-e.totalCount||e.projectId.localeCompare(t.projectId)).slice(0,3)}function nc(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):0}function rc(e){let t=String(e??``).split(`:`);return t.length>=3?t.slice(2).join(`:`):String(e??``)}function ic(e){return typeof e==`object`&&e?e.id:e}var ac=.62,oc=3,sc=.28,cc=10,lc=240,uc=8,dc=4,fc={top:52,right:24,bottom:24,left:24};function pc(e,t){let n=0;for(let t of e)wc(t.codePointAt(0)??0)?n+=1:/[A-Z@#%&mwMW]/.test(t)?n+=.74:/[ilIjtf.,:;'!|\s]/.test(t)?n+=.36:n+=.6;return n*t}function mc(e,t){return[...e].length*t*ac}function hc(e,t,n=168){if(pc(e,t)<=n)return e;let r=n-pc(`…`,t),i=``;for(let n of e){if(pc(i+n,t)>r)break;i+=n}return`${i}…`}function gc({shapeRadius:e,labelWidth:t,labelBaseline:n,labelFontSize:r,idWidth:i,idBaseline:a,idFontSize:o,badgeTop:s,badgeWidth:c}){let l=Math.max(e,t/2+oc,i/2+oc,c/2),u=Math.max(e,n+r*sc+oc,a+o*sc+oc);return{left:-l,right:l,top:Math.min(-e,s),bottom:u}}function _c(e){return Math.hypot(Math.max(-e.left,e.right),Math.max(-e.top,e.bottom))+cc/2}function vc(e){let t=e.x??0,n=e.y??0,{left:r,top:i,right:a,bottom:o}=e.footprint;return{left:t+r,top:n+i,right:t+a,bottom:n+o}}function yc(e){if(e.length<2)return;let t=Ds(e).velocityDecay(.5).force(`collide`,hs(e=>_c(e.footprint)).strength(1).iterations(4)).stop();for(let n=0;n<lc&&(n%uc!==0||bc(e));n+=1)t.tick();for(let t of e)t.vx=0,t.vy=0}function bc(e){let t=e.map(e=>_c(e.footprint));for(let n=0;n<e.length;n+=1)for(let r=n+1;r<e.length;r+=1)if(Math.hypot((e[n].x??0)-(e[r].x??0),(e[n].y??0)-(e[r].y??0))<t[n]+t[r]-cc)return!0;return!1}function xc(e,t,n,{minScale:r,maxScale:i}){if(!e.length)return null;let a=e.map(vc),o=Math.min(...a.map(e=>e.left)),s=Math.max(...a.map(e=>e.right)),c=Math.min(...a.map(e=>e.top)),l=Math.max(...a.map(e=>e.bottom)),u=t-fc.left-fc.right,d=n-fc.top-fc.bottom,f=Math.max(r,Math.min(i,u/(s-o),d/(l-c))),p=fc.left+u/2,m=fc.top+d/2;return{k:f,x:p-f*(o+s)/2,y:m-f*(c+l)/2}}function Sc(e,t,n,r,i){let a=e.x??0,o=e.y??0,s=(t.x??0)-a,c=(t.y??0)-o,l=Math.hypot(s,c)||1,u=_c(e.footprint),d=_c(t.footprint),f=l-u-d,p=u+Math.max(f,0)/2,m=a+s/l*p,h=o+c/l*p,g={left:m-n.width/2-dc,right:m+n.width/2+dc,top:h-n.height/2-dc,bottom:h+n.height/2+dc};return{x:m,y:h,fits:f>=Math.hypot(n.width,n.height)+8&&!r.some(n=>n!==e&&n!==t&&Cc(g,vc(n)))&&!i.some(e=>Cc(g,{left:e.x-e.width/2,right:e.x+e.width/2,top:e.y-e.height/2,bottom:e.y+e.height/2}))}}function Cc(e,t){return e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom}function wc(e){return e>=4352&&e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744}var Tc=[`blue`,`teal`,`violet`,`amber`,`rose`,`cyan`,`slate`].map(e=>`var(--color-chart-${e})`),Ec=.05,Dc=5,Oc=1.5,kc=.72,Ac=12,jc=7,Mc=20,Nc=24,Pc=28,Fc={width:30,height:15,above:8},Ic=38;function Lc(e,t,n={}){let r=typeof n==`function`?{onNodeSelect:n}:n,i=Math.max(e.clientWidth||0,760),a=Math.max(e.clientHeight||0,520),o=r.projectVisibility===`provided`?t:ec(t),s=new Set(o.nodes.map(({id:e})=>e)),c=o.edges.map(Rc).filter(({sourceId:e,targetId:t})=>s.has(e)&&s.has(t)),l=o.nodes.map(e=>({...e,degree:Yc(e.id,c),footprint:{left:0,top:0,right:0,bottom:0}})),u=J(e);u.selectAll(`*`).remove(),u.attr(`viewBox`,`0 0 ${i} ${a}`).attr(`preserveAspectRatio`,`xMidYMid meet`);let d=`graph-arrow-${Math.random().toString(36).slice(2)}`;u.append(`defs`).append(`marker`).attr(`id`,d).attr(`viewBox`,`0 -5 10 10`).attr(`refX`,28).attr(`refY`,0).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,-5L10,0L0,5`).attr(`class`,`graph-arrow`);let f=u.append(`g`).attr(`class`,`graph-viewport`),p=f.append(`g`).attr(`class`,`graph-edges`),m=f.append(`g`).attr(`class`,`graph-edge-labels`),h=f.append(`g`).attr(`class`,`graph-nodes`),g=p.selectAll(`line.graph-edge`).data(c).join(`line`).attr(`class`,e=>{let t=Xs(e.raw);return[`graph-edge`,t?`weight-tier-${t}`:null,e.invalid_at?`historical`:null,Uc(e)?`human-change-pending`:null,e.human_change_status===`viewed`?`human-change-viewed`:null].filter(Boolean).join(` `)}).attr(`data-relation-type`,e=>e.type).attr(`data-weight-tier`,e=>Xs(e.raw)??null).attr(`marker-end`,`url(#${d})`),_=p.selectAll(`line.graph-edge-hit`).data(c).join(`line`).attr(`class`,`graph-edge-hit`).attr(`role`,`button`).attr(`tabindex`,0).attr(`aria-label`,e=>{let t=Je(e.type),n=Xs(e.raw);return`${n?`${Zs(n)} · `:``}${t.label}:${qe(e.fact||t.description)}`});_.append(`title`).text(e=>{let t=Je(e.type),n=Xs(e.raw);return`${n?`${Zs(n)} · `:``}${t.label}:${qe(e.fact||t.description)}`});let v=c.length<=90?m.selectAll(`g.graph-edge-label`).data(c).join(`g`).attr(`class`,e=>{let t=Xs(e.raw);return[`graph-edge-label`,t?`weight-tier-${t}`:null].filter(Boolean).join(` `)}).attr(`data-relation-type`,e=>e.type).attr(`data-weight-tier`,e=>Xs(e.raw)??null):m.selectAll(`g.graph-edge-label`);v.append(`rect`).attr(`class`,`graph-edge-label-bg`).attr(`x`,e=>-Zc(e)/2).attr(`y`,-10).attr(`width`,Zc).attr(`height`,20).attr(`rx`,10),v.append(`path`).attr(`class`,`graph-edge-label-icon`).attr(`d`,e=>Je(e.type).iconPath).attr(`transform`,e=>`translate(${-Zc(e)/2+6},-6) scale(.5)`),v.append(`text`).attr(`class`,`graph-edge-label-text`).attr(`x`,e=>-Zc(e)/2+22).attr(`y`,3.5).text(e=>Xc(e)),v.append(`title`).text(e=>{let t=Je(e.type),n=Xs(e.raw);return n?`${Zs(n)}(${t.label}):${t.description}`:`${t.label}:${t.description}`});let y=h.selectAll(`g.graph-node`).data(l).join(`g`).attr(`class`,e=>[`graph-node`,$(e)?`project-node`:null,Uc(e)?`human-change-pending`:null,e.human_change_status===`viewed`?`human-change-viewed`:null].filter(Boolean).join(` `)).attr(`tabindex`,0).attr(`role`,`button`).attr(`aria-label`,e=>`${qe(e.name)},ID ${Be(e)}`);y.filter(e=>!$(e)).append(`circle`).attr(`class`,`graph-node-shape`).attr(`r`,Wc).attr(`fill`,e=>Hc(e.type)),y.filter($).append(`circle`).attr(`class`,`graph-project-ring`).attr(`r`,Nc),y.filter($).append(`circle`).attr(`class`,`graph-node-shape`).attr(`r`,19),y.filter($).append(`path`).attr(`class`,`graph-project-icon`).attr(`d`,`M-9,-7H-3L0,-4H9V7H-9Z`),y.filter(Uc).append(`circle`).attr(`class`,`graph-node-human-marker`).attr(`cx`,e=>$(e)?20:12).attr(`cy`,e=>$(e)?-20:-12).attr(`r`,4),y.append(`text`).attr(`class`,`graph-node-label`).attr(`y`,Gc).text(e=>hc(qe(e.name),Ac)),y.append(`text`).attr(`class`,`graph-node-id`).attr(`y`,Kc).text(e=>`#${Be(e)}`);let x=y.append(`g`).attr(`class`,`graph-search-badge`).attr(`transform`,e=>`translate(0,${qc(e)})`);x.append(`rect`).attr(`x`,-Fc.width/2).attr(`y`,-Fc.above).attr(`width`,Fc.width).attr(`height`,Fc.height).attr(`rx`,4),x.append(`text`).attr(`y`,3).text(b(`knowledge.domain.graph.hit`)),y.append(`title`).text(e=>[qe(e.name),e.type,`ID: ${e.id}`,$(e)?b(`knowledge.domain.graph.projectMarked`):null,Uc(e)?e.human_change_status===`unseen`?b(`knowledge.domain.graph.humanUnseen`):b(`knowledge.domain.graph.humanViewed`):null].filter(Boolean).join(`
|
|
2
2
|
`)),y.each(function(e){let t=this.querySelector(`.graph-node-label`),n=this.querySelector(`.graph-node-id`);e.footprint=gc({shapeRadius:Wc(e),labelWidth:Jc(t,e=>pc(e,Ac)),labelBaseline:Gc(e),labelFontSize:Ac,idWidth:Jc(n,e=>mc(e,jc)),idBaseline:Kc(e),idFontSize:jc,badgeTop:qc(e)-Fc.above,badgeWidth:Fc.width})});let S=Gs().scaleExtent([Ec,Dc]).on(`zoom`,e=>{f.attr(`transform`,e.transform.toString()).classed(`graph-viewport--compact-labels`,e.transform.k<kc)});u.call(S).on(`dblclick.zoom`,null);let C=l.filter($).map(({footprint:e})=>_c(e)),w=C.length>1?C.reduce((e,t)=>e+t,0)/Math.PI:0,T=Ds(l).force(`link`,vs(c).id(({id:e})=>e).distance(e=>_c(Bc(e.source).footprint)+_c(Bc(e.target).footprint)+Pc).strength(.42)).force(`charge`,Os().strength(-390).distanceMax(620)).force(`collide`,hs().radius(e=>_c(e.footprint)).iterations(2)).force(`project-focus`,ks(e=>$(e)?w:w+210,i/2,a/2).strength(e=>$(e)?.3:.008)).force(`center`,Go(i/2,a/2)).force(`x`,As(i/2).strength(.025)).force(`y`,js(a/2).strength(.025)).stop();for(let e=0;e<220;e+=1)T.tick();yc(l),M();let E=null,D=null,O=e=>$(e)&&!!r.organize?.enabled(),k=(e,t,n)=>r.organize?.onProjectDrag({phase:e,node:t,over:D?.find(n.x,n.y,Ic)??null,clientX:n.sourceEvent?.clientX??0,clientY:n.sourceEvent?.clientY??0}),A=Wr().on(`start`,(e,t)=>{e.sourceEvent?.stopPropagation(),t.dragMoved=!1,O(t)&&(t.dragOrigin={x:t.x??0,y:t.y??0,fx:t.fx??null,fy:t.fy??null}),t.fx=t.x,t.fy=t.y}).on(`drag`,function(e,t){let n=!t.dragMoved;t.dragMoved=!0,t.fx=e.x,t.fy=e.y,t.x=e.x,t.y=e.y,J(this).classed(`pinned`,!0),M(),t.dragOrigin&&(n&&(D=ls().x(e=>e.x??0).y(e=>e.y??0).addAll(l.filter(e=>$(e)&&e!==t)),J(this).classed(`organize-dragging`,!0),k(`start`,t,e)),k(`move`,t,e))}).on(`end`,function(e,t){t.dragOrigin?(J(this).classed(`organize-dragging`,!1),t.dragMoved?k(`end`,t,e):j(t.id),D=null,delete t.dragMoved):(t.dragMoved?(t.fx=t.x,t.fy=t.y):(t.fx=null,t.fy=null,J(this).classed(`pinned`,!1)),delete t.dragMoved)});return y.call(A),y.on(`click`,(e,t)=>{e.stopPropagation(),N(t)}).on(`keydown`,(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N(t))}).on(`dblclick`,(e,t)=>{e.stopPropagation(),t.fx=null,t.fy=null,J(e.currentTarget).classed(`pinned`,!1),T.alpha(.35).restart(),E!==null&&window.clearTimeout(E),E=window.setTimeout(()=>{E=null,T.stop(),yc(l),M()},700)}),_.on(`click`,(e,t)=>{e.stopPropagation(),F(t)}).on(`keydown`,(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),F(t))}).on(`mouseenter.labels`,(e,t)=>I(t,`hovered`,!0)).on(`mouseleave.labels`,(e,t)=>I(t,`hovered`,!1)).on(`focus.labels`,(e,t)=>I(t,`focused`,!0)).on(`blur.labels`,(e,t)=>I(t,`focused`,!1)),u.on(`click.selection`,t=>{t.target===e&&ee()}),B(l,0),{zoomIn:()=>z(1.32),zoomOut:()=>z(.76),fit:()=>B(l),reset:()=>{ee(),u.transition().duration(220).call(S.transform,Fs)},selectItem(e,t){if(e===`entity`){let e=l.find(e=>e.id===t);return e?(P(e),B([e]),!0):!1}let n=c.find(e=>e.id===t);return n?(L(n),B([Bc(n.source),Bc(n.target)]),!0):!1},focusByNames(e,{projectOnly:t=!1,searchMatch:n=!1}={}){let r=l.filter(n=>e.has(n.name)&&(!t||$(n)));if(!r.length)return n?R({nodeIds:new Set,edgeIds:new Set,selectedNodeId:null,selectedEdgeId:null,searchMatch:n}):ee(),0;let i=new Set(r.map(({id:e})=>e));return R({nodeIds:i,edgeIds:new Set(c.filter(({sourceId:e,targetId:t})=>i.has(e)&&i.has(t)).map(({id:e})=>e)),selectedNodeId:null,selectedEdgeId:null,searchMatch:n}),B(r),r.length},clearSelection:ee,markDropTarget(e){y.classed(`drop-target`,({id:t})=>t===e)},restoreNode:j,destroy(){E!==null&&(window.clearTimeout(E),E=null),T.stop(),u.on(`.zoom`,null).on(`.selection`,null),u.selectAll(`*`).remove()}};function j(e){let t=l.find(({id:t})=>t===e),n=t?.dragOrigin;t&&n&&(t.x=n.x,t.y=n.y,t.fx=n.fx,t.fy=n.fy,delete t.dragOrigin,y.filter(({id:t})=>t===e).classed(`pinned`,n.fx!==null),M())}function M(){g.attr(`x1`,e=>Vc(e.source,`x`)).attr(`y1`,e=>Vc(e.source,`y`)).attr(`x2`,e=>Vc(e.target,`x`)).attr(`y2`,e=>Vc(e.target,`y`)),_.attr(`x1`,e=>Vc(e.source,`x`)).attr(`y1`,e=>Vc(e.source,`y`)).attr(`x2`,e=>Vc(e.target,`x`)).attr(`y2`,e=>Vc(e.target,`y`));let e=[];v.each(function(t){let n={width:Zc(t),height:Mc},r=Sc(Bc(t.source),Bc(t.target),n,l,e);r.fits&&e.push({x:r.x,y:r.y,...n}),J(this).attr(`transform`,`translate(${r.x},${r.y})`).classed(`crowded`,!r.fits)}),y.attr(`transform`,e=>`translate(${e.x??i/2},${e.y??a/2})`)}function N(e){P(e),r.onNodeSelect?.(e)}function P(e){let t=new Set([e.id]),n=new Set;for(let r of c)(r.sourceId===e.id||r.targetId===e.id)&&(n.add(r.id),t.add(r.sourceId),t.add(r.targetId));R({nodeIds:t,edgeIds:n,selectedNodeId:e.id,selectedEdgeId:null})}function F(e){L(e),r.onEdgeSelect?.(e.raw)}function I(e,t,n){v.filter(({id:t})=>t===e.id).classed(t,n)}function L(e){R({nodeIds:new Set([e.sourceId,e.targetId]),edgeIds:new Set([e.id]),selectedNodeId:null,selectedEdgeId:e.id})}function R({nodeIds:e,edgeIds:t,selectedNodeId:n,selectedEdgeId:r,searchMatch:i=!1}){y.classed(`selected`,({id:e})=>e===n).classed(`related`,({id:t})=>e.has(t)&&t!==n).classed(`dimmed`,({id:t})=>!e.has(t)).classed(`search-match`,({id:t})=>i&&e.has(t)),g.classed(`selected`,({id:e})=>e===r).classed(`related`,({id:e})=>t.has(e)).classed(`dimmed`,({id:e})=>t.size>0?!t.has(e):!0).classed(`search-match`,({id:e})=>i&&t.has(e)),v.classed(`selected`,({id:e})=>e===r).classed(`related`,({id:e})=>t.has(e)).classed(`dimmed`,({id:e})=>t.size>0?!t.has(e):!0).classed(`search-match`,({id:e})=>i&&t.has(e))}function ee(){y.classed(`selected related dimmed search-match`,!1),g.classed(`selected related dimmed search-match`,!1),v.classed(`selected related dimmed search-match`,!1)}function z(e){u.transition().duration(180).call(S.scaleBy,e)}function B(e,t=220){let n=xc(e,i,a,{minScale:Ec,maxScale:Oc});if(!n)return;let r=Fs.translate(n.x,n.y).scale(n.k);t?u.transition().duration(t).call(S.transform,r):u.call(S.transform,r)}}function Rc(e,t){let n=zc(e.source),r=zc(e.target);return{id:e.id||`edge-${t}-${n}-${r}`,sourceId:n,targetId:r,source:n,target:r,type:e.type,fact:e.fact,invalid_at:e.invalid_at,human_change_status:e.human_change_status,raw:e}}function zc(e){return typeof e==`object`&&e?e.id:e}function Bc(e){if(typeof e==`object`&&e)return e;throw Error(`Graph edge endpoint was not linked: ${e}`)}function Vc(e,t){return Bc(e)[t]??0}function Hc(e){return Tc[Math.floor(Qc(e)*Tc.length)%Tc.length]}function $(e){return e?.type===`PersonalProject`||e?.type===`RelatedPersonalProject`}function Uc(e){return e?.human_change_status===`unseen`||e?.human_change_status===`viewed`}function Wc(e){return $(e)?Nc:10+Math.min(7,e.degree)}function Gc(e){return $(e)?39:26+Math.min(7,e.degree)}function Kc(e){return Gc(e)+12}function qc(e){return $(e)?-36:-28}function Jc(e,t){if(!e)return 0;let n=typeof e.getComputedTextLength==`function`?e.getComputedTextLength():0;return n>0?n:t(e.textContent??``)}function Yc(e,t){return t.reduce((t,n)=>t+Number(n.sourceId===e||n.targetId===e),0)}function Xc(e){let t=Xs(e.raw);return t&&e.type===`PROJECT_MEMORY_ACCESS`?Zs(t):Je(e.type).label}function Zc(e){return Math.max(54,31+[...Xc(e)].length*10)}function Qc(e=``){let t=2166136261;for(let n of e)t=Math.imul(t^n.charCodeAt(0),16777619);return(t>>>0)%1e4/1e4}var $c=[`aria-label`],el=a({__name:`GraphCanvas`,props:{graph:{},projectVisibility:{},organizeProjects:{type:Boolean},selectedItem:{}},emits:[`selectNode`,`selectEdge`,`projectDrag`],setup(e,{expose:t,emit:r}){let a=e,s=r,c=n(null),u=null;m(f),d([()=>a.graph,()=>a.projectVisibility],f,{deep:!1}),d(()=>v(),f),d([()=>a.selectedItem?.itemKind,()=>a.selectedItem?.id],h),p(()=>u?.destroy()),t({zoomIn:()=>u?.zoomIn(),zoomOut:()=>u?.zoomOut(),fit:()=>u?.fit(),reset:()=>u?.reset(),clearSelection:()=>u?.clearSelection(),markDropTarget:e=>u?.markDropTarget(e),restoreNode:e=>u?.restoreNode(e),selectItem:(e,t)=>u?.selectItem(e,t)??!1,focusByNames:(e,t)=>u?.focusByNames(e,t)??0});async function f(){await g(),c.value&&(u?.destroy(),u=Lc(c.value,a.graph,{projectVisibility:a.projectVisibility,onNodeSelect:e=>s(`selectNode`,e),onEdgeSelect:e=>s(`selectEdge`,e),organize:{enabled:()=>!!a.organizeProjects,onProjectDrag:e=>s(`projectDrag`,e)}}),h())}function h(){let e=a.selectedItem;e&&u?.selectItem(e.itemKind,e.id)}return(e,t)=>(l(),o(`svg`,{id:`knowledge-graph`,ref_key:`svg`,ref:c,class:`knowledge-graph-canvas`,viewBox:`0 0 1000 620`,role:`img`,"aria-label":i(b)(`knowledge.workspace.graph.aria`)},null,8,$c))}}),tl={key:0,class:`graph-relation-legend`},nl=[`viewBox`],rl={class:`graph-relation-legend-panel`},il=[`viewBox`],al=[`d`],ol=a({__name:`GraphRelationLegend`,props:{relationTypes:{}},setup(t){let n=t,r=C(()=>Ye(n.relationTypes));return(t,n)=>r.value.length?(l(),o(`details`,tl,[u(`summary`,null,[(l(),o(`svg`,{viewBox:i(Qe),"aria-hidden":`true`},[...n[0]||=[u(`path`,{d:`M5 5h4v4H5zM15 15h4v4h-4zM9 7h4a4 4 0 0 1 4 4v4`},null,-1)]],8,nl)),u(`span`,null,h(i(b)(`knowledge.workspace.graph.legend`)),1),u(`small`,null,h(r.value.length),1),n[1]||=u(`i`,{"aria-hidden":`true`},null,-1)]),u(`div`,rl,[u(`header`,null,[u(`strong`,null,h(i(b)(`knowledge.workspace.graph.legend`)),1),u(`span`,null,h(i(b)(`knowledge.workspace.graph.legendCopy`)),1)]),u(`ul`,null,[(l(!0),o(_,null,s(r.value,e=>(l(),o(`li`,{key:e.type},[(l(),o(`svg`,{viewBox:i(Qe),"aria-hidden":`true`},[u(`path`,{d:e.iconPath},null,8,al)],8,il)),u(`span`,null,[u(`strong`,null,h(e.label),1),u(`small`,null,h(e.description),1)])]))),128))])])])):e(``,!0)}}),sl=15,cl=4;async function ll({personalSpaceId:e,projects:t,query:n,baseline:r,signal:i,limit:a=sl,request:o=te}){let s=dl(r),c=t.slice(0,a),l=[];for(let t=0;t<c.length;t+=cl){i?.throwIfAborted();let r=c.slice(t,t+cl);l.push(...await Promise.all(r.map(async t=>{try{let r=fl(await o(`/api/search?${new URLSearchParams({personalSpaceId:e,personalProjectId:t.project_id,q:n,limit:`30`})}`,{signal:i})).filter(({key:e})=>!s.has(e));return r.length?{status:`matched`,project:t,count:r.length,score:Math.max(...r.map(({score:e})=>e??0))}:{status:`empty`,project:t}}catch(e){if(i?.aborted)throw e;return{status:`failed`,project:t}}})))}return{matches:l.filter(e=>e.status===`matched`).sort((e,t)=>t.score-e.score||t.count-e.count||e.project.profile.name.localeCompare(t.project.profile.name)),checked:l.length,total:t.length,failed:l.filter(({status:e})=>e===`failed`).length}}function ul(e){let t=e.failed?b(`knowledge.domain.discovery.failedSuffix`,{count:e.failed}):``;return e.matches.length?b(`knowledge.domain.discovery.matches`,{failure:t}):e.total?e.failed===e.checked?b(`knowledge.domain.discovery.allFailed`):e.checked<e.total?b(`knowledge.domain.discovery.checkedPartial`,{checked:e.checked,total:e.total,failure:t}):b(`knowledge.domain.discovery.checkedAll`,{failure:t}):b(`knowledge.domain.discovery.noOtherProjects`)}function dl(e){return new Set(fl(e).map(({key:e})=>e))}function fl(e){return[...(e.entities??[]).map(e=>({key:`entity:${e.id}`,score:e.score})),...(e.facts??[]).map(e=>({key:`fact:${e.id}`,score:e.score}))]}var pl={class:`graph-search-status`,"aria-live":`polite`},ml={class:`graph-search-status-kicker`},hl={class:`graph-search-status-title`},gl={key:1,class:`graph-search-status-copy`},_l={key:2,class:`graph-search-suggestions`},vl=a({__name:`GraphSearchStatus`,props:{discovery:{},spaceId:{}},setup(n){let r=n,a=C(()=>r.discovery.checking?b(`knowledge.workspace.workspace.discovery.checking`):r.discovery.result?ul(r.discovery.result):b(`knowledge.workspace.workspace.discovery.retry`));return(r,c)=>(l(),o(`aside`,pl,[u(`span`,ml,h(i(b)(`knowledge.workspace.workspace.discovery.noHitKicker`)),1),u(`strong`,hl,h(i(b)(`knowledge.workspace.workspace.discovery.noResults`,{query:n.discovery.query})),1),n.discovery.checking?(l(),t(B,{key:0,variant:`inline`,label:a.value},null,8,[`label`])):(l(),o(`p`,gl,h(a.value),1)),n.discovery.result?.matches.length?(l(),o(`div`,_l,[(l(!0),o(_,null,s(n.discovery.result.matches.slice(0,5),e=>(l(),t(i(N),{key:e.project.project_id,class:`graph-search-suggestion`,to:{path:i(me)(n.spaceId,`graph`,e.project.project_id),query:{q:n.discovery.query}}},{default:S(()=>[u(`span`,null,[u(`strong`,null,h(e.project.profile.name),1),u(`small`,null,h(i(b)(`knowledge.workspace.workspace.discovery.candidateCount`,{count:e.count})),1)]),u(`b`,null,h(i(b)(`knowledge.workspace.workspace.discovery.enterProject`)),1)]),_:2},1032,[`to`]))),128))])):e(``,!0)]))}}),yl=[`aria-label`],bl=[`aria-label`],xl=[`aria-selected`],Sl=[`aria-selected`],Cl={key:1,id:`directory-panel-knowledge`,class:`directory-tab-panel`,role:`tabpanel`,"aria-labelledby":`directory-tab-knowledge`},wl={class:`directory-section-heading`},Tl={class:`directory-section-copy`},El={class:`knowledge-table-head`,"aria-hidden":`true`},Dl={class:`knowledge-column-content`},Ol={class:`knowledge-column-quadrant`},kl={class:`knowledge-column-review`},Al={class:`knowledge-column-type`},jl={class:`knowledge-column-source`},Ml={class:`knowledge-column-time`},Nl={class:`knowledge-column-validity`},Pl=[`data-item-key`,`onClick`],Fl={class:`knowledge-row-content`},Il={class:`knowledge-row-title`},Ll=[`title`],Rl={key:0,"data-unknown-type":``},zl={class:`knowledge-row-source`},Bl=[`title`],Vl={class:`knowledge-time-minute`},Hl={class:`knowledge-time-day`},Ul={class:`empty-state`},Wl={key:2,id:`directory-panel-materials`,class:`directory-tab-panel`,role:`tabpanel`,"aria-labelledby":`directory-tab-materials`},Gl={class:`directory-section-heading`},Kl={class:`directory-section-copy`},ql={class:`directory-section-count`},Jl={class:`project-material-head`,"aria-hidden":`true`},Yl={class:`project-material-head-description`},Xl={class:`project-material-head-type`},Zl=[`data-item-key`,`onClick`],Ql={class:`project-material-copy`},$l={class:`project-material-type`},eu={class:`project-material-link`},tu={class:`empty-state`},nu=a({__name:`KnowledgeDirectoryPanel`,props:{personalProjectsOnly:{type:Boolean},directorySection:{},knowledgeTabCount:{},materialTabCount:{},contentStatus:{},currentItemCount:{},historicalItemCount:{},allItems:{},visibleItems:{},projectMaterialItems:{},visibleProjectMaterialItems:{},selectedItem:{},listResetKey:{},sourceLabel:{type:Function}},emits:[`change-section`,`update-status`,`select-item`],setup(t,{emit:n}){let a=t,s=C(()=>[{key:`current`,label:b(`common.status.current`),value:a.currentItemCount,tone:`success`,pressed:a.contentStatus===`current`,term:`memory.current`},{key:`historical`,label:b(`knowledge.workspace.workspace.view.history`),value:a.historicalItemCount,pressed:a.contentStatus===`historical`,term:`memory.history`},{key:`all`,label:b(`common.status.all`),value:a.allItems.length,pressed:a.contentStatus===`all`,term:`memory.all`}]),d=n,p=C(()=>a.selectedItem?a.visibleItems.findIndex(e=>et(e)===et(a.selectedItem)):-1),m=C(()=>a.selectedItem?a.visibleProjectMaterialItems.findIndex(e=>et(e)===et(a.selectedItem)):-1);return(n,a)=>(l(),o(`section`,{class:f([`knowledge-directory-panel`,{"has-directory-tabs":t.personalProjectsOnly}]),"aria-label":t.directorySection===`materials`?i(b)(`knowledge.workspace.workspace.view.materialDirectory`):i(b)(`knowledge.workspace.workspace.view.knowledgeDirectory`)},[t.personalProjectsOnly?(l(),o(`div`,{key:0,class:`directory-kind-tabs`,role:`tablist`,"aria-label":i(b)(`knowledge.workspace.workspace.view.directoryTypeAria`)},[u(`button`,{id:`directory-tab-knowledge`,class:`directory-kind-tab`,type:`button`,role:`tab`,"aria-controls":`directory-panel-knowledge`,"aria-selected":t.directorySection===`knowledge`,onClick:a[0]||=e=>d(`change-section`,`knowledge`)},[u(`span`,null,h(i(b)(`knowledge.workspace.workspace.view.knowledgeContent`)),1),u(`small`,null,h(t.knowledgeTabCount),1)],8,xl),u(`button`,{id:`directory-tab-materials`,class:`directory-kind-tab`,type:`button`,role:`tab`,"aria-controls":`directory-panel-materials`,"aria-selected":t.directorySection===`materials`,onClick:a[1]||=e=>d(`change-section`,`materials`)},[u(`span`,null,h(i(b)(`knowledge.workspace.workspace.view.projectMaterials`)),1),u(`small`,null,h(t.materialTabCount),1)],8,Sl)],8,bl)):e(``,!0),t.directorySection===`knowledge`?(l(),o(`div`,Cl,[u(`header`,wl,[u(`div`,Tl,[u(`strong`,null,h(i(b)(`knowledge.workspace.workspace.view.knowledgeContent`)),1)]),r(i(ce),{class:`knowledge-status-filter`,items:s.value,label:i(b)(`knowledge.workspace.workspace.view.knowledgeStatusAria`),onSelect:a[2]||=e=>d(`update-status`,e)},null,8,[`items`,`label`])]),r(We,{class:`knowledge-directory-virtual-list`,"scrolls-with":`page`,items:t.visibleItems,"row-height":68,"active-index":p.value,"reset-key":t.listResetKey,"item-key":i(et),label:i(b)(`knowledge.workspace.workspace.view.knowledgeDirectory`)},{header:S(()=>[u(`div`,El,[u(`span`,Dl,h(i(b)(`knowledge.workspace.workspace.view.columns.content`)),1),u(`span`,Ol,h(i(b)(`knowledge.workspace.workspace.view.columns.quadrant`)),1),u(`span`,kl,h(i(b)(`knowledge.workspace.workspace.view.columns.review`)),1),u(`span`,Al,h(i(b)(`knowledge.workspace.workspace.view.columns.type`)),1),u(`span`,jl,h(i(b)(`knowledge.workspace.workspace.view.columns.source`)),1),u(`span`,Ml,h(i(b)(`knowledge.workspace.workspace.view.columns.updated`)),1),u(`span`,Nl,h(i(b)(`knowledge.workspace.workspace.view.columns.validity`)),1)])]),default:S(({item:n})=>[u(`button`,{class:f([`knowledge-row`,{selected:t.selectedItem?.itemKind===n.itemKind&&t.selectedItem?.id===n.id}]),type:`button`,"data-item-key":i(et)(n),onClick:e=>d(`select-item`,n)},[u(`span`,Fl,[u(`span`,Il,[u(`strong`,null,h(n.title),1),n.humanChangeStatus===`unseen`||n.humanChangeStatus===`viewed`?(l(),o(`em`,{key:0,class:f([`human-change-badge`,`state-${n.humanChangeStatus}`])},h(i(it)(n.humanChangeStatus)),3)):e(``,!0)]),u(`small`,null,h([n.profileAspect?i(Ze)(n.profileAspect):``,i(nt)(n)].filter(Boolean).join(` · `)),1)]),u(`span`,{class:f([`knowledge-row-quadrant`,n.originQuadrant])},h(i(st)(n.originQuadrant)),3),u(`span`,{class:f([`knowledge-review-state`,`state-${i(q)(n)}`])},h(i(Xe)(n)),3),u(`span`,{class:`knowledge-row-type`,title:n.type},[c(h(i(tt)(n).label)+` `,1),i(tt)(n).unknownType?(l(),o(`small`,Rl,h(i(tt)(n).unknownType),1)):e(``,!0)],8,Ll),u(`span`,zl,h(t.sourceLabel(n)),1),u(`span`,{class:`knowledge-row-time`,title:i(rt)(i($e)(n))},[u(`span`,Vl,h(i(rt)(i($e)(n),`minute`)),1),u(`span`,Hl,h(i(rt)(i($e)(n),`day`)),1)],8,Bl),u(`span`,{class:f([`knowledge-status`,n.invalidAt?`historical`:`current`])},h(n.invalidAt?i(Fe)(n.versionStatus??`inactive`):i(b)(`knowledge.workspace.workspace.view.active`)),3)],10,Pl)]),empty:S(()=>[u(`div`,Ul,h(t.allItems.length?i(b)(`knowledge.workspace.workspace.view.noFilteredKnowledge`):i(b)(`knowledge.workspace.workspace.view.noKnowledge`)),1)]),_:1},8,[`items`,`active-index`,`reset-key`,`item-key`,`label`])])):(l(),o(`div`,Wl,[u(`header`,Gl,[u(`div`,Kl,[u(`strong`,null,h(i(b)(`knowledge.workspace.workspace.view.projectMaterials`)),1)]),u(`small`,ql,h(i(b)(`common.counts.items`,{count:t.visibleProjectMaterialItems.length})),1)]),r(We,{class:`project-material-virtual-list`,"scrolls-with":`page`,items:t.visibleProjectMaterialItems,"row-height":48,"active-index":m.value,"reset-key":t.listResetKey,"item-key":i(et),label:i(b)(`knowledge.workspace.workspace.view.materialDirectory`)},{header:S(()=>[u(`div`,Jl,[u(`span`,null,h(i(b)(`knowledge.workspace.workspace.view.columns.name`)),1),u(`span`,Yl,h(i(b)(`knowledge.workspace.workspace.view.columns.description`)),1),u(`span`,Xl,h(i(b)(`knowledge.workspace.workspace.view.columns.type`)),1),a[3]||=u(`span`,null,null,-1)])]),default:S(({item:e})=>[u(`button`,{class:f([`project-material-row`,{selected:t.selectedItem?.itemKind===e.itemKind&&t.selectedItem?.id===e.id}]),type:`button`,"data-item-key":i(et)(e),onClick:t=>d(`select-item`,e)},[u(`span`,Ql,[u(`strong`,null,h(e.itemKind===`entity`?e.title:i(tt)(e).label),1),u(`small`,null,h(e.body),1)]),u(`span`,$l,h(i(ct)(e)),1),u(`span`,eu,h(i(b)(`knowledge.workspace.workspace.view.viewDetails`)),1)],10,Zl)]),empty:S(()=>[u(`div`,tu,h(t.projectMaterialItems.length?i(b)(`knowledge.workspace.workspace.view.noFilteredMaterials`):i(b)(`knowledge.workspace.workspace.view.noMaterials`)),1)]),_:1},8,[`items`,`active-index`,`reset-key`,`item-key`,`label`])]))],10,yl))}}),ru=[`disabled`],iu={class:`knowledge-project-source`},au={class:`ui-meta`},ou={class:`knowledge-project-mode`},su=[`disabled`],cu={key:0,class:`knowledge-project-fields`},lu={class:`ui-field`},uu={class:`ui-field`},du={class:`ui-field knowledge-project-wide`},fu={key:2,class:`knowledge-project-relation`},pu={class:`ui-check`},mu={class:`ui-meta`},hu={class:`knowledge-project-preview`},gu={key:1},_u={class:`ui-meta`},vu={key:2,class:`knowledge-project-compare`},yu={class:`ui-meta`},bu={class:`ui-meta`},xu={key:3,class:`knowledge-project-conflict-options`},Su={class:`ui-check`},Cu={class:`ui-check`},wu={class:`ui-check`},Tu={class:`ui-check`},Eu={class:`ui-field`},Du=x(a({__name:`KnowledgeProjectDialog`,props:{item:{},personalSpaceId:{},personalProjectId:{},projects:{}},emits:[`close`,`saved`],setup(a,{emit:s}){let p=a,m=s,g=A(),_=n(`create`),v=n(``),x=n(``),w=n(``),T=n(``),D=n(!0),j=n(`RELATED_TO`),M=n(`defer`),N=n(``),F=n(null),I=n(!1),L=n(!1),R=n(``),ee=n(!1),z=0,te=C(()=>p.item?.itemKind===`entity`?p.item.raw:null),H=C(()=>p.item?.assignments.at(0)?.project_id??p.item?.evidence.find(({personal_project_id:e})=>e)?.personal_project_id??p.personalProjectId??null),U=C(()=>p.projects.filter(({project_id:e})=>e!==H.value)),ne=C(()=>U.value.map(e=>({value:e.project_id,label:e.profile.name,meta:`#${He(e.project_id,26)}`,search:Ve(e.project_id)}))),re=C(()=>U.value.find(({project_id:e})=>e===v.value)??null),ie=C(()=>{if(_.value===`create`)return{label:b(`projects.knowledgeDialog.previews.create.label`),title:b(`projects.knowledgeDialog.previews.create.title`),copy:H.value?b(`projects.knowledgeDialog.previews.create.linkedCopy`):b(`projects.knowledgeDialog.previews.create.ownedCopy`)};if(I.value)return{label:b(`projects.knowledgeDialog.previews.checking.label`),title:b(`projects.knowledgeDialog.previews.checking.title`),copy:b(`projects.knowledgeDialog.previews.checking.copy`)};if(!F.value)return{label:b(`projects.knowledgeDialog.previews.waiting.label`),title:b(`projects.knowledgeDialog.previews.waiting.title`),copy:b(`projects.knowledgeDialog.previews.waiting.copy`)};let e=Object.fromEntries([`none`,`already_linked`,`exact_duplicate`,`conflict`].map(e=>[e,[b(`projects.knowledgeDialog.previews.outcomes.${e}.title`),b(`projects.knowledgeDialog.previews.outcomes.${e}.copy`)]])),[t,n]=e[F.value.match.kind]??e.none;return{label:t,title:n,copy:F.value.match.reason}}),ae=C(()=>{let e=_.value===`existing`?b(`projects.knowledgeDialog.relationActors.sourceProject`):b(`projects.knowledgeDialog.relationActors.newProject`),t=_.value===`existing`?b(`projects.knowledgeDialog.relationActors.targetProject`):b(`projects.knowledgeDialog.relationActors.sourceProject`);return{RELATED_TO:b(`projects.knowledgeDialog.relations.related`,{object:t}),PART_OF:b(`projects.knowledgeDialog.relations.partOf`,{subject:e,object:t}),USES_KNOWLEDGE_FROM:b(`projects.knowledgeDialog.relations.usesKnowledge`,{subject:e,object:t}),DEPENDS_ON:b(`projects.knowledgeDialog.relations.dependsOn`,{subject:e,object:t}),PROVIDES_TO:b(`projects.knowledgeDialog.relations.providesTo`,{subject:e,object:t}),SHARES_CAPABILITY_WITH:b(`projects.knowledgeDialog.relations.sharesCapability`,{object:t}),SUCCESSOR_OF:b(`projects.knowledgeDialog.relations.successorOf`,{subject:e,object:t})}}),oe=C(()=>Object.entries(ae.value).map(([e,t])=>({value:e,label:t}))),se=C(()=>_.value===`create`?b(`projects.knowledgeDialog.actions.create`):F.value?.match.kind===`exact_duplicate`?b(`projects.knowledgeDialog.actions.reuse`):b(`projects.knowledgeDialog.actions.add`)),ce=C(()=>_.value===`create`?b(`projects.knowledgeDialog.actions.creating`):F.value?.match.kind===`exact_duplicate`?b(`projects.knowledgeDialog.actions.reusing`):b(`projects.knowledgeDialog.actions.adding`)),ue=C(()=>L.value||_.value===`existing`&&(I.value||!F.value));d(()=>p.item,e=>{z+=1,F.value=null,I.value=!1,R.value=``,_.value=`create`,ee.value=!1;let t=e?.itemKind===`entity`?e.raw:null;x.value=t?.name??``,w.value=me(t?.name??``),T.value=t?.summary??``,N.value=t?b(`projects.knowledgeDialog.defaultReason`,{name:t.name}):``,D.value=!0,j.value=`RELATED_TO`,M.value=`defer`,v.value=U.value[0]?.project_id??``},{immediate:!0}),d(x,e=>{ee.value||(w.value=me(e))}),d([_,v,()=>p.item],()=>{_.value===`existing`?de():(z+=1,F.value=null,I.value=!1,R.value=``)});async function de(){let e=p.item;if(!e||e.itemKind!==`entity`||!v.value)return;let t=++z;I.value=!0,F.value=null,R.value=``;try{let n=await V(`/api/knowledge/entity/${encodeURIComponent(e.id)}/project-action/preview`,{personalSpaceId:p.personalSpaceId,targetProjectId:v.value});if(t!==z||p.item?.id!==e.id)return;F.value=n,n.match.kind===`conflict`&&(M.value=`defer`)}catch(e){if(t!==z)return;ge(he(e)),g.reportError(e)}finally{t===z&&(I.value=!1)}}async function pe(){if(L.value)return;let e=p.item;if(e&&e.itemKind===`entity`){if(_.value===`create`&&(!x.value.trim()||!w.value.trim()))return ge(b(`projects.knowledgeDialog.errors.projectIdentityRequired`));if(_.value===`existing`&&!v.value)return ge(b(`projects.knowledgeDialog.errors.targetRequired`));if(_.value===`existing`&&!F.value)return ge(b(`projects.knowledgeDialog.errors.previewRequired`));if(!N.value.trim())return ge(b(`projects.knowledgeDialog.errors.reasonRequired`));L.value=!0,R.value=``;try{let t=await V(`/api/knowledge/entity/${encodeURIComponent(e.id)}/project-action`,{personalSpaceId:p.personalSpaceId,mode:_.value,targetProjectId:_.value===`existing`?v.value:null,newProjectId:_.value===`create`?w.value.trim():null,newProjectName:_.value===`create`?x.value.trim():null,newProjectPurpose:_.value===`create`?T.value.trim():null,keepSourceRelation:!!(H.value&&D.value),relationType:j.value,conflictResolution:M.value,reason:N.value.trim()}),n=_.value===`create`?x.value.trim():re.value?.profile.name??b(`projects.knowledgeDialog.relationActors.targetProject`);m(`close`),m(`saved`,t,n)}catch(e){ge(he(e)),g.reportError(e)}finally{L.value=!1}}}function me(e){return e.normalize(`NFKC`).toLocaleLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``).slice(0,128)||`new-project`}function he(e){let t=e instanceof Error?e.message:String(e);try{let e=JSON.parse(t);return e.message??e.detail??t}catch{return t}}function ge(e){R.value=e}return(n,s)=>a.item?(l(),t(le,{key:0,open:``,class:`knowledge-project-dialog`,size:`lg`,form:``,busy:L.value,error:R.value,title:i(b)(`projects.knowledgeDialog.title`),description:i(b)(`projects.knowledgeDialog.intro`),onClose:s[15]||=e=>m(`close`),onSubmit:pe},{footer:S(()=>[r(i(P),{variant:`ghost`,disabled:L.value,onClick:s[14]||=e=>m(`close`)},{default:S(()=>[c(h(i(b)(`common.actions.cancel`)),1)]),_:1},8,[`disabled`]),r(i(P),{type:`submit`,disabled:ue.value,loading:L.value,"loading-label":ce.value},{default:S(()=>[c(h(se.value),1)]),_:1},8,[`disabled`,`loading`,`loading-label`])]),default:S(()=>[u(`fieldset`,{class:`knowledge-project-body`,disabled:L.value},[u(`div`,iu,[u(`span`,au,h(i(b)(`projects.knowledgeDialog.sourceNode`)),1),u(`strong`,null,h(te.value?.name),1),u(`p`,null,h(te.value?.summary||i(b)(`common.status.noDescription`)),1)]),u(`fieldset`,ou,[u(`legend`,null,h(i(b)(`projects.knowledgeDialog.chooseAction`)),1),u(`label`,null,[y(u(`input`,{"onUpdate:modelValue":s[0]||=e=>_.value=e,type:`radio`,value:`create`},null,512),[[k,_.value]]),u(`span`,null,[u(`strong`,null,h(i(b)(`projects.knowledgeDialog.createNew`)),1),u(`small`,null,h(i(b)(`projects.knowledgeDialog.createNewCopy`)),1)])]),u(`label`,{class:f({disabled:U.value.length===0})},[y(u(`input`,{"onUpdate:modelValue":s[1]||=e=>_.value=e,type:`radio`,value:`existing`,disabled:U.value.length===0},null,8,su),[[k,_.value]]),u(`span`,null,[u(`strong`,null,h(i(b)(`projects.knowledgeDialog.addExisting`)),1),u(`small`,null,h(i(b)(`projects.knowledgeDialog.addExistingCopy`)),1)])],2)]),_.value===`create`?(l(),o(`section`,cu,[u(`label`,lu,[c(h(i(b)(`projects.knowledgeDialog.projectName`))+` `,1),y(u(`input`,{"onUpdate:modelValue":s[2]||=e=>x.value=e,maxlength:`512`,required:``},null,512),[[O,x.value]])]),u(`label`,uu,[c(h(i(b)(`projects.knowledgeDialog.projectId`))+` `,1),y(u(`input`,{"onUpdate:modelValue":s[3]||=e=>w.value=e,maxlength:`128`,required:``,onInput:s[4]||=e=>ee.value=!0},null,544),[[O,w.value]])]),u(`label`,du,[c(h(i(b)(`projects.knowledgeDialog.purpose`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":s[5]||=e=>T.value=e,maxlength:`4096`,rows:`3`},null,512),[[O,T.value]])])])):(l(),t(fe,{key:1,modelValue:v.value,"onUpdate:modelValue":s[6]||=e=>v.value=e,field:``,options:ne.value,label:i(b)(`projects.knowledgeDialog.targetPersonalProject`),searchable:``,required:``},null,8,[`modelValue`,`options`,`label`])),H.value?(l(),o(`section`,fu,[u(`label`,pu,[y(u(`input`,{"onUpdate:modelValue":s[7]||=e=>D.value=e,type:`checkbox`},null,512),[[E,D.value]]),u(`span`,null,[u(`strong`,null,h(i(b)(`projects.knowledgeDialog.preserveRelation`)),1),u(`small`,mu,h(i(b)(`projects.knowledgeDialog.preserveRelationCopy`)),1)])]),r(fe,{modelValue:j.value,"onUpdate:modelValue":s[8]||=e=>j.value=e,field:``,options:oe.value,label:i(b)(`projects.knowledgeDialog.projectRelation`),disabled:!D.value},null,8,[`modelValue`,`options`,`label`,`disabled`])])):e(``,!0),u(`section`,hu,[I.value?(l(),t(B,{key:0,variant:`compact`,label:i(b)(`projects.knowledgeDialog.previews.checking.title`)},null,8,[`label`])):(l(),o(`div`,gu,[u(`span`,_u,h(ie.value.label),1),u(`strong`,null,h(ie.value.title),1),u(`p`,null,h(ie.value.copy),1)])),F.value&&[`exact_duplicate`,`conflict`].includes(F.value.match.kind)?(l(),o(`div`,vu,[u(`article`,null,[u(`span`,yu,h(i(b)(`projects.knowledgeDialog.currentNode`)),1),u(`strong`,null,h(F.value.item_name),1),u(`p`,null,h(F.value.item_summary||i(b)(`common.status.noDescription`)),1)]),u(`article`,null,[u(`span`,bu,h(i(b)(`projects.knowledgeDialog.targetContent`)),1),u(`strong`,null,h(F.value.match.item_name||i(b)(`projects.knowledgeDialog.targetContentFallback`)),1),u(`p`,null,h(F.value.match.item_summary||i(b)(`common.status.noDescription`)),1)])])):e(``,!0),F.value?.match.kind===`conflict`?(l(),o(`fieldset`,xu,[u(`legend`,null,h(i(b)(`projects.knowledgeDialog.conflictResolution`)),1),u(`label`,Su,[y(u(`input`,{"onUpdate:modelValue":s[9]||=e=>M.value=e,type:`radio`,value:`defer`},null,512),[[k,M.value]]),u(`span`,null,h(i(b)(`projects.knowledgeDialog.defer`)),1)]),u(`label`,Cu,[y(u(`input`,{"onUpdate:modelValue":s[10]||=e=>M.value=e,type:`radio`,value:`keep_target`},null,512),[[k,M.value]]),u(`span`,null,h(i(b)(`projects.knowledgeDialog.keepTarget`)),1)]),u(`label`,wu,[y(u(`input`,{"onUpdate:modelValue":s[11]||=e=>M.value=e,type:`radio`,value:`use_source`},null,512),[[k,M.value]]),u(`span`,null,h(i(b)(`projects.knowledgeDialog.useSource`)),1)]),u(`label`,Tu,[y(u(`input`,{"onUpdate:modelValue":s[12]||=e=>M.value=e,type:`radio`,value:`coexist`},null,512),[[k,M.value]]),u(`span`,null,h(i(b)(`projects.knowledgeDialog.coexist`)),1)])])):e(``,!0)]),u(`label`,Eu,[c(h(i(b)(`projects.knowledgeDialog.operationReason`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":s[13]||=e=>N.value=e,maxlength:`2048`,rows:`3`,required:``},null,512),[[O,N.value]])])],8,ru)]),_:1},8,[`busy`,`error`,`title`,`description`])):e(``,!0)}}),[[`__scopeId`,`data-v-e0ea9662`]]),Ou={class:`project-profile-fields`},ku={class:`ui-field`},Au={class:`ui-field project-profile-wide-field`},ju=[`autofocus`,`placeholder`],Mu={class:`ui-field project-profile-wide-field`},Nu=[`autofocus`,`placeholder`],Pu={class:`ui-field project-profile-wide-field`},Fu=[`placeholder`],Iu={class:`ui-field project-profile-wide-field`},Lu=[`autofocus`,`placeholder`],Ru={class:`ui-field-hint`},zu={class:`project-source-editor`},Bu=[`autofocus`],Vu={class:`ui-meta`},Hu={key:0,class:`project-source-list`},Uu={class:`ui-field`},Wu=[`onUpdate:modelValue`],Gu={class:`ui-field project-source-wide-field`},Ku=[`onUpdate:modelValue`,`placeholder`],qu={class:`ui-field project-source-wide-field`},Ju=[`onUpdate:modelValue`],Yu={key:1,class:`ui-meta`},Xu={class:`ui-meta`},Zu=x(a({__name:`PersonalProjectProfileDialog`,props:{project:{},materialType:{}},emits:[`close`,`saved`],setup(a,{emit:f}){let p=a,m=f,g=n(``),v=n(``),x=n(``),w=n(``),T=n(`planned`),E=n(``),D=n([]),k=n(``),A=n(!1),j=new Set([`ProjectPurpose`,`ProjectScope`,`ProjectSource`,`ProjectBoundary`,`ProjectAssessment`,`AssessmentDimension`,`PersonalProject`,`RelatedPersonalProject`]),M=C(()=>{let e=p.materialType??``;return j.has(e)?b(`projects.profileDialog.materialTypes.${e}`):b(`projects.profileDialog.materialTypes.fallback`)}),N=[`prd`,`product_document`,`technical_document`,`frontend_repository`,`backend_repository`,`repository`,`design`,`runbook`,`monitoring`,`issue_tracker`,`other`],F=C(()=>N.map(e=>({value:e,label:e===`prd`?`PRD`:b(`projects.profileDialog.sourceTypes.${e}`)}))),I=C(()=>[`planned`,`active`,`maintenance`,`archived`].map(e=>({value:e,label:b(`projects.profileDialog.lifecycles.${e}`)}))),L=[`normal`,`private`,`restricted`],R=C(()=>L.map(e=>({value:e,label:b(`projects.profileDialog.sensitivities.${e}`)}))),ee=new Set(N),z=new Set(L);d(()=>[p.project,p.materialType],([e])=>{if(!e)return;let t=e.profile;g.value=t.name,v.value=t.purpose??``,x.value=t.scope??``,w.value=t.technical_summary??``,T.value=t.lifecycle??`planned`,E.value=(t.boundaries??[]).map(e=>String(e)).join(`
|
|
3
3
|
`),D.value=(t.sources??[]).map(B),k.value=``},{immediate:!0});function B(e,t){let n=typeof e.kind==`string`&&ee.has(e.kind)?e.kind:`other`,r=typeof e.sensitivity==`string`&&z.has(e.sensitivity)?e.sensitivity:`normal`;return{key:te(e.key)||`source-${t+1}`,kind:n,title:te(e.title)||te(e.name),uri:te(e.uri),summary:te(e.summary),sensitivity:r}}function te(e){return typeof e==`string`?e:``}function V(e){return e.trim()||null}function U(){return[...new Set(E.value.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(Boolean))].slice(0,64)}function ne(){D.value.push({key:`source-${Date.now().toString(36)}-${D.value.length+1}`,kind:`other`,title:``,uri:``,summary:``,sensitivity:`normal`})}function re(e){D.value.splice(e,1)}async function ie(){if(!p.project||A.value)return;let e=g.value.trim();if(!e)k.value=b(`projects.profileDialog.errors.nameRequired`);else if(D.value.some(e=>!e.title.trim()))k.value=b(`projects.profileDialog.errors.sourceNameRequired`);else{A.value=!0,k.value=``;try{let t=await H(`/api/personal-projects`,{personalSpaceId:p.project.personal_space_id,projectId:p.project.project_id,profile:{name:e,purpose:V(v.value),scope:V(x.value),technicalSummary:V(w.value),lifecycle:T.value,sources:D.value.map(e=>({key:e.key,kind:e.kind,title:e.title.trim(),uri:V(e.uri),summary:V(e.summary),sensitivity:e.sensitivity})),boundaries:U(),assessment:p.project.profile.assessment??null}});m(`saved`,t),m(`close`)}catch(e){k.value=e instanceof Error?e.message:b(`projects.profileDialog.errors.saveFailed`)}finally{A.value=!1}}}return(n,d)=>a.project?(l(),t(le,{key:0,open:``,class:`project-profile-dialog`,size:`lg`,form:``,busy:A.value,error:k.value,title:i(b)(`projects.profileDialog.title`,{material:M.value}),description:i(b)(`projects.profileDialog.intro`),onClose:d[7]||=e=>m(`close`),onSubmit:ie},{footer:S(()=>[r(i(P),{variant:`ghost`,disabled:A.value,onClick:d[6]||=e=>m(`close`)},{default:S(()=>[c(h(i(b)(`common.actions.cancel`)),1)]),_:1},8,[`disabled`]),r(i(P),{type:`submit`,loading:A.value,"loading-label":i(b)(`projects.profileDialog.saving`)},{default:S(()=>[c(h(i(b)(`projects.profileDialog.save`)),1)]),_:1},8,[`loading`,`loading-label`])]),default:S(()=>[u(`div`,Ou,[u(`label`,ku,[c(h(i(b)(`projects.profileDialog.projectName`))+` `,1),y(u(`input`,{"onUpdate:modelValue":d[0]||=e=>g.value=e,name:`project-name`,maxlength:`160`,required:``},null,512),[[O,g.value]])]),r(fe,{modelValue:T.value,"onUpdate:modelValue":d[1]||=e=>T.value=e,field:``,name:`project-lifecycle`,label:i(b)(`projects.profileDialog.lifecycle`),options:I.value},null,8,[`modelValue`,`label`,`options`]),u(`label`,Au,[c(h(i(b)(`projects.profileDialog.purpose`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":d[2]||=e=>v.value=e,name:`project-purpose`,maxlength:`4096`,rows:`4`,autofocus:a.materialType===`ProjectPurpose`,placeholder:i(b)(`projects.profileDialog.purposePlaceholder`)},null,8,ju),[[O,v.value]])]),u(`label`,Mu,[c(h(i(b)(`projects.profileDialog.scope`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":d[3]||=e=>x.value=e,name:`project-scope`,maxlength:`4096`,rows:`4`,autofocus:a.materialType===`ProjectScope`,placeholder:i(b)(`projects.profileDialog.scopePlaceholder`)},null,8,Nu),[[O,x.value]])]),u(`label`,Pu,[c(h(i(b)(`projects.profileDialog.technicalSummary`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":d[4]||=e=>w.value=e,name:`project-technical-summary`,maxlength:`4096`,rows:`4`,placeholder:i(b)(`projects.profileDialog.technicalPlaceholder`)},null,8,Fu),[[O,w.value]])]),u(`label`,Iu,[c(h(i(b)(`projects.profileDialog.boundary`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":d[5]||=e=>E.value=e,name:`project-boundaries`,maxlength:`8192`,rows:`5`,autofocus:a.materialType===`ProjectBoundary`,placeholder:i(b)(`projects.profileDialog.boundaryPlaceholder`)},null,8,Lu),[[O,E.value]]),u(`small`,Ru,h(i(b)(`projects.profileDialog.boundaryHint`)),1)])]),u(`section`,zu,[u(`div`,{class:`project-source-editor-heading`,tabindex:`-1`,autofocus:a.materialType===`ProjectSource`},[u(`div`,null,[u(`h3`,null,h(i(b)(`projects.profileDialog.sources`)),1),u(`p`,Vu,h(i(b)(`projects.profileDialog.sourcesCopy`)),1)]),r(i(P),{variant:`outline`,size:`sm`,onClick:ne},{default:S(()=>[c(h(i(b)(`projects.profileDialog.addSource`)),1)]),_:1})],8,Bu),D.value.length?(l(),o(`div`,Hu,[(l(!0),o(_,null,s(D.value,(e,t)=>(l(),o(`article`,{key:e.key,class:`project-source-row`},[u(`label`,Uu,[c(h(i(b)(`projects.profileDialog.sourceName`))+` `,1),y(u(`input`,{"onUpdate:modelValue":t=>e.title=t,maxlength:`512`,required:``},null,8,Wu),[[O,e.title]])]),r(fe,{modelValue:e.kind,"onUpdate:modelValue":t=>e.kind=t,field:``,label:i(b)(`projects.profileDialog.sourceType`),options:F.value},null,8,[`modelValue`,`onUpdate:modelValue`,`label`,`options`]),u(`label`,Gu,[c(h(i(b)(`projects.profileDialog.sourceUri`))+` `,1),y(u(`input`,{"onUpdate:modelValue":t=>e.uri=t,maxlength:`2048`,placeholder:i(b)(`projects.profileDialog.sourceUriPlaceholder`)},null,8,Ku),[[O,e.uri]])]),u(`label`,qu,[c(h(i(b)(`projects.profileDialog.sourceSummary`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":t=>e.summary=t,maxlength:`4096`,rows:`2`},null,8,Ju),[[O,e.summary]])]),r(fe,{modelValue:e.sensitivity,"onUpdate:modelValue":t=>e.sensitivity=t,field:``,label:i(b)(`projects.profileDialog.sensitivity`),options:R.value},null,8,[`modelValue`,`onUpdate:modelValue`,`label`,`options`]),r(i(P),{class:`project-source-remove`,size:`sm`,variant:`destructive`,onClick:e=>re(t)},{default:S(()=>[c(h(i(b)(`common.actions.remove`)),1)]),_:1},8,[`onClick`])]))),128))])):(l(),o(`p`,Yu,h(i(b)(`projects.profileDialog.noSources`)),1))]),u(`p`,Xu,h(i(b)(`projects.profileDialog.stateBoundary`)),1)]),_:1},8,[`busy`,`error`,`title`,`description`])):e(``,!0)}}),[[`__scopeId`,`data-v-38e24c10`]]),Qu={class:`publish-dialog-project`},$u={class:`ui-field`},ed=[`placeholder`],td={class:`ui-field-hint`},nd={class:`ui-field`},rd=[`placeholder`],id=[`aria-label`],ad=x(a({__name:`PublishProjectDialog`,props:{project:{}},emits:[`close`,`published`],setup(a,{emit:o}){let s=a,f=o,p=A(),m=n(``),g=n(``),_=n(``),v=n(!1),x=C(()=>p.state?.projects.find(({publication_key:e})=>e&&e===s.project?.publication_key)??null),w=C(()=>x.value?.current_release?.version??null),T=C(()=>p.state?.providers?.workspaces?.find(({status:e})=>e===`ready`)?.providerUrl??null);d(()=>s.project,e=>{e&&(m.value=D(w.value),g.value=``,_.value=``)},{immediate:!0});async function E(){if(!v.value&&s.project){if(!T.value)_.value=b(`projects.publishDialog.errors.providerUnavailable`);else if(!m.value.trim())_.value=b(`projects.publishDialog.errors.versionRequired`);else if(!g.value.trim())_.value=b(`projects.publishDialog.errors.summaryRequired`);else{v.value=!0,_.value=``;try{await V(`/api/projects/publish`,{personalSpaceId:p.activePersonalSpace?.id,localProjectId:s.project.project_id,providerUrl:T.value,releaseVersion:m.value.trim(),updateSummary:g.value.trim()}),p.notify(b(`projects.publishDialog.published`,{name:s.project.profile.name,version:m.value.trim()})),await p.refresh(),f(`close`),f(`published`)}catch(e){_.value=e instanceof Error?e.message:b(`projects.publishDialog.errors.failed`),p.reportError(e)}finally{v.value=!1}}}}function D(e){if(!e||e===`legacy`)return`v1.0.0`;let t=e.match(/^(v?)(\d+)\.(\d+)\.(\d+)$/);return t?`${t[1]}${t[2]}.${t[3]}.${Number(t[4])+1}`:``}return(n,o)=>a.project?(l(),t(le,{key:0,open:``,class:`publish-dialog`,title:i(b)(`projects.publishDialog.title`),description:i(b)(`projects.publishDialog.warning`),busy:v.value,error:_.value,onClose:o[3]||=e=>f(`close`)},{footer:S(()=>[r(i(P),{variant:`ghost`,disabled:v.value,onClick:o[2]||=e=>f(`close`)},{default:S(()=>[c(h(i(b)(`common.actions.cancel`)),1)]),_:1},8,[`disabled`]),r(i(P),{loading:v.value,"loading-label":i(b)(`projects.publishDialog.publishing`),onClick:E},{default:S(()=>[c(h(i(b)(`projects.publishDialog.confirm`)),1)]),_:1},8,[`loading`,`loading-label`])]),default:S(()=>[u(`p`,Qu,h(a.project.profile.name),1),u(`label`,$u,[c(h(i(b)(`projects.publishDialog.version`))+` `,1),y(u(`input`,{"onUpdate:modelValue":o[0]||=e=>m.value=e,maxlength:`64`,placeholder:i(b)(`projects.publishDialog.versionPlaceholder`)},null,8,ed),[[O,m.value]]),u(`small`,td,h(w.value?i(b)(`projects.publishDialog.currentVersion`,{version:w.value}):i(b)(`projects.publishDialog.firstRelease`)),1)]),u(`label`,nd,[c(h(i(b)(`projects.publishDialog.summary`))+` `,1),y(u(`textarea`,{"onUpdate:modelValue":o[1]||=e=>g.value=e,maxlength:`4096`,rows:`4`,placeholder:i(b)(`projects.publishDialog.summaryPlaceholder`)},null,8,rd),[[O,g.value]])]),u(`dl`,{class:`publish-impact`,"aria-label":i(b)(`projects.publishDialog.impactAria`)},[u(`div`,null,[u(`dt`,null,h(i(b)(`projects.publishDialog.discoverable`)),1),u(`dd`,null,h(i(b)(`projects.publishDialog.discoverableCopy`)),1)]),u(`div`,null,[u(`dt`,null,h(i(b)(`projects.publishDialog.owner`)),1),u(`dd`,null,h(i(b)(`projects.publishDialog.ownerCopy`)),1)]),u(`div`,null,[u(`dt`,null,h(i(b)(`projects.publishDialog.syncProfile`)),1),u(`dd`,null,h(i(b)(`projects.publishDialog.syncProfileCopy`)),1)])],8,id)]),_:1},8,[`title`,`description`,`busy`,`error`])):e(``,!0)}}),[[`__scopeId`,`data-v-27cde856`]]),od=a({__name:`KnowledgeWorkspaceDialogs`,props:{editingItem:{},confirmingItem:{},projectActionItem:{},publishingProject:{},managingProject:{},managingMaterialType:{},personalSpaceId:{},editingProjectId:{},confirmingProjectId:{},currentProjectId:{},projects:{},replacementItems:{}},emits:[`close-edit`,`close-confirm`,`close-project-action`,`close-publish`,`close-profile`,`refresh`,`access-denied`,`project-saved`,`profile-saved`],setup(e,{emit:t}){let n=t;function i(e,t){n(`project-saved`,e,t)}function a(e){n(`profile-saved`,e)}return(t,s)=>(l(),o(_,null,[r(_t,{item:e.editingItem,"personal-space-id":e.personalSpaceId,"personal-project-id":e.editingProjectId,projects:e.projects,"replacement-items":e.replacementItems,onClose:s[0]||=e=>n(`close-edit`),onSaved:s[1]||=e=>n(`refresh`),onReload:s[2]||=e=>n(`refresh`),onAccessDenied:s[3]||=e=>n(`access-denied`)},null,8,[`item`,`personal-space-id`,`personal-project-id`,`projects`,`replacement-items`]),r(vt,{item:e.confirmingItem,"personal-space-id":e.personalSpaceId,"personal-project-id":e.confirmingProjectId,onClose:s[4]||=e=>n(`close-confirm`),onSaved:s[5]||=e=>n(`refresh`),onReload:s[6]||=e=>n(`refresh`),onAccessDenied:s[7]||=e=>n(`access-denied`)},null,8,[`item`,`personal-space-id`,`personal-project-id`]),r(Du,{item:e.projectActionItem,"personal-space-id":e.personalSpaceId,"personal-project-id":e.currentProjectId,projects:e.projects,onClose:s[8]||=e=>n(`close-project-action`),onSaved:i},null,8,[`item`,`personal-space-id`,`personal-project-id`,`projects`]),r(ad,{project:e.publishingProject,onClose:s[9]||=e=>n(`close-publish`),onPublished:s[10]||=e=>n(`refresh`)},null,8,[`project`]),r(Zu,{project:e.managingProject,"material-type":e.managingMaterialType,onClose:s[11]||=e=>n(`close-profile`),onSaved:a},null,8,[`project`,`material-type`])],64))}}),sd=[`aria-label`],cd=[`aria-label`],ld=a({__name:`ProjectHierarchyAside`,props:{parents:{},activeProjectName:{},spaceId:{}},setup(n){let r=n;function a(){return r.activeProjectName||b(`knowledge.workspace.hierarchy.currentProject`)}return(r,c)=>n.parents.length?(l(),o(`aside`,{key:0,class:`project-hierarchy-aside`,"aria-label":i(b)(`knowledge.workspace.hierarchy.aria`)},[u(`header`,null,[u(`span`,null,h(i(b)(`knowledge.workspace.hierarchy.level`)),1),u(`strong`,null,h(i(b)(`knowledge.workspace.hierarchy.parents`)),1),u(`small`,null,h(i(b)(`common.counts.projects`,{count:n.parents.length})),1)]),u(`p`,null,h(i(b)(`knowledge.workspace.hierarchy.belongsTo`,{name:a()})),1),u(`nav`,{"aria-label":i(b)(`knowledge.workspace.hierarchy.listAria`)},[(l(!0),o(_,null,s(n.parents,e=>(l(),t(i(N),{key:e.nodeId,class:`project-parent-link`,to:i(me)(n.spaceId,`graph`,e.projectId),"aria-label":i(b)(`knowledge.workspace.hierarchy.openParent`,{name:e.name})},{default:S(()=>[c[0]||=u(`span`,{class:`project-parent-icon`,"aria-hidden":`true`},[u(`svg`,{viewBox:`0 0 24 24`},[u(`path`,{d:`M3 6h7l2 2h9v11H3zM12 16V9M9 12l3-3 3 3`})])],-1),u(`span`,null,[u(`small`,null,h(i(b)(`knowledge.workspace.hierarchy.parents`)),1),u(`strong`,null,h(e.name),1),u(`em`,null,h(i(b)(`knowledge.workspace.hierarchy.belongsToParent`,{name:a()})),1)]),c[1]||=u(`b`,{"aria-hidden":`true`},`→`,-1)]),_:2},1032,[`to`,`aria-label`]))),128))],8,cd)],8,sd)):e(``,!0)}});function ud(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(t===-1||r===-1||t===r)return t;if(n==null)return r;var a=i===`vertical`&&n===`bottom`||i===`horizontal`&&n===`right`;return t<r?a?r:r-1:a?r+1:r}var dd=`project-board-column`,fd=(e,t)=>t.type===dd&&t.listId===e&&typeof t.index==`number`;function pd(e){let{listId:t,element:n,handle:r,row:i}=e;return ye(be({element:n,dragHandle:r,getInitialData:()=>({type:dd,listId:t,index:i.index})}),_e({element:n,canDrop:({source:e})=>fd(t,e.data),getData:({input:e})=>xe({type:dd,listId:t,index:i.index},{element:n,input:e,allowedEdges:[`top`,`bottom`]})}))}function md(e){let{listId:t}=e;return ge({canMonitor:({source:e})=>fd(t,e.data),onDrop:({source:n,location:r})=>{let i=r.current.dropTargets.find(({data:e})=>fd(t,e));if(!i)return;let a=n.data.index,o=ud({startIndex:a,indexOfTarget:i.data.index,closestEdgeOfTarget:ve(i.data),axis:`vertical`});o!==a&&e.onReorder(a,o)}})}var hd={class:`project-board-settings`,"aria-labelledby":`project-board-heading`,"data-project-board-settings":``},gd={class:`project-board-header`},_d={id:`project-board-heading`},vd={key:1,class:`project-board-state`,role:`status`,"data-project-board-not-managed":``},yd={key:2,class:`project-board-state`,role:`alert`},bd={class:`project-board-manager`},xd={class:`ui-meta`},Sd={key:2,class:`project-board-recruit`},Cd={class:`project-board-field`},wd={class:`project-board-kind`},Td={id:`project-board-kind-label`,class:`project-board-label`},Ed=[`data-board-kind`],Dd={key:0,class:`project-board-columns`},Od={class:`ui-meta`},kd={key:0,class:`project-board-empty`},Ad={class:`ui-meta`},jd=[`aria-label`],Md=[`data-column-row`],Nd={class:`project-board-column-actions`},Pd={key:1,class:`project-board-external`},Fd={class:`project-board-field`},Id={class:`project-board-field`},Ld={class:`project-board-footer`},Rd={key:0,class:`project-board-error`,role:`alert`},zd={key:1,class:`ui-meta`,role:`status`},Bd=``,Vd=x(a({__name:`ProjectBoardSettings`,props:{spaceId:{},projectId:{},projectName:{}},setup(a){let f=a,g=n(null),v=n(null),x=n({kind:`builtin`,columns:[],url:``,label:``}),w=n(``),T=n(null),E=n(``),O=n(``),k=n(!1),A=n(!1),j=n(``),M=Symbol(`project-board-columns`),L=0,R=C(()=>G(v.value)),ee=C(()=>[{value:Bd,label:b(`employees.projectBoard.managerJefa`)},...R.value.map(e=>({value:e.agentId,label:e.name}))]),z=C(()=>{let e=g.value?.managerAgentId;return e&&v.value&&!R.value.some(t=>t.agentId===e)?e:null}),te=C(()=>W.map(({value:e,labelKey:t})=>({value:e,label:b(t)}))),V=C(()=>T.value?b(`employees.projectBoard.${T.value}`):``),H=C(()=>T.value!==null),ne=C(()=>({path:`/employees/jefa`,query:{project:f.projectId}}));d(()=>[f.spaceId,f.projectId],()=>{ae()},{immediate:!0});function ie(e){g.value=e,x.value=De(e),w.value=e.managerAgentId??Bd}async function ae(){if(!f.spaceId||!f.projectId)return;let e=++L;T.value=`loading`,E.value=``,k.value=!1;try{let[t,n]=await Promise.all([we(f.spaceId,f.projectId),Re(f.spaceId,f.projectId)]);if(e!==L)return;v.value=n,ie(t)}catch(t){if(e!==L)return;g.value=null,t instanceof re&&t.status===403&&U(t)===`assignment_required`?k.value=!0:E.value=Se(t)}finally{e===L&&(T.value=null)}}function oe(){let e=Ce(x.value);return E.value=e?b(e):``,!!e}async function se(){if(!(!g.value||H.value||oe())){T.value=`saving`,O.value=``;try{ie(await K(f.spaceId,f.projectId,{expectedRevision:g.value.revision,managerAgentId:w.value||null,board:ke(x.value)})),O.value=b(`employees.projectBoard.saved`)}catch(e){let t=Se(e);T.value=null,U(e)===`version_conflict`&&await ae(),E.value=t}finally{T.value===`saving`&&(T.value=null)}}}function ce(){j.value=b(`employees.projectBoard.recruitDefaultName`,{project:f.projectName}),A.value=!0}async function le(){let e=j.value.trim();if(!(!e||H.value||oe())){T.value=`recruiting`,O.value=``;try{await Ae({personalSpaceId:f.spaceId,projectId:f.projectId,projectName:f.projectName,name:e,board:ke(x.value)}),A.value=!1,T.value=null,await ae(),O.value=b(`employees.projectBoard.saved`)}catch(e){E.value=Se(e)}finally{T.value===`recruiting`&&(T.value=null)}}}function pe(e){(e===`builtin`||e===`external`)&&(x.value={...x.value,kind:e})}function me(){x.value={...x.value,columns:Te()}}function he(){x.value={...x.value,columns:[...x.value.columns,Oe()]}}function ge(e){x.value={...x.value,columns:x.value.columns.filter((t,n)=>n!==e)}}function _e(e,t){t<0||t>=x.value.columns.length||(x.value={...x.value,columns:Ee(x.value.columns,e,t)})}let ve=new WeakMap,ye={mounted(e,{value:t}){let n=e.querySelector(`[data-column-handle]`);if(!n)return;let r={index:t};ve.set(e,{row:r,cleanup:pd({listId:M,element:e,handle:n,row:r})})},updated(e,{value:t}){let n=ve.get(e);n&&(n.row.index=t)},beforeUnmount(e){ve.get(e)?.cleanup(),ve.delete(e)}},be=()=>{};return m(()=>{be=md({listId:M,onReorder:_e})}),p(()=>be()),(n,a)=>(l(),o(`section`,hd,[u(`header`,gd,[u(`h3`,_d,h(i(b)(`employees.projectBoard.title`)),1),r(i(N),{class:`project-board-open`,to:ne.value},{default:S(()=>[c(h(i(b)(`employees.projectBoard.openBoard`)),1)]),_:1},8,[`to`])]),T.value===`loading`&&!g.value?(l(),t(B,{key:0,variant:`compact`,label:V.value},null,8,[`label`])):k.value?(l(),o(`p`,vd,h(i(b)(`employees.projectBoard.notManaged`)),1)):g.value?(l(),o(`form`,{key:3,class:`project-board-form`,onSubmit:D(se,[`prevent`])},[u(`div`,bd,[r(i(fe),{modelValue:w.value,"onUpdate:modelValue":a[0]||=e=>w.value=e,field:``,size:`sm`,name:`project-board-manager`,label:i(b)(`employees.projectBoard.manager`),options:ee.value,disabled:H.value},null,8,[`modelValue`,`label`,`options`,`disabled`]),u(`p`,xd,h(i(b)(`employees.projectBoard.managerHint`)),1),z.value?(l(),t(i(de),{key:0,tone:`warning`,"data-manager-gone":``},{default:S(()=>[c(h(i(b)(`employees.projectBoard.managerGone`,{name:z.value})),1)]),_:1})):e(``,!0),A.value?(l(),o(`div`,Sd,[u(`label`,Cd,[u(`span`,null,h(i(b)(`employees.projectBoard.recruitName`)),1),r(i(je),{modelValue:j.value,"onUpdate:modelValue":a[1]||=e=>j.value=e,maxlength:`160`,disabled:H.value,"data-recruit-name":``},null,8,[`modelValue`,`disabled`])]),r(i(P),{type:`button`,size:`sm`,disabled:!j.value.trim()||H.value,loading:T.value===`recruiting`,"loading-label":V.value,"data-action":`recruit`,onClick:le},{default:S(()=>[c(h(i(b)(`employees.projectBoard.recruitConfirm`)),1)]),_:1},8,[`disabled`,`loading`,`loading-label`]),r(i(P),{type:`button`,size:`sm`,variant:`ghost`,disabled:H.value,onClick:a[2]||=e=>A.value=!1},{default:S(()=>[c(h(i(b)(`employees.projectBoard.recruitCancel`)),1)]),_:1},8,[`disabled`])])):(l(),t(i(P),{key:1,type:`button`,size:`sm`,variant:`outline`,disabled:H.value,"data-action":`open-recruit`,onClick:ce},{default:S(()=>[c(h(i(b)(`employees.projectBoard.recruit`)),1)]),_:1},8,[`disabled`]))]),u(`div`,wd,[u(`span`,Td,h(i(b)(`employees.projectBoard.kind`)),1),r(i(F),{"model-value":x.value.kind,"aria-labelledby":`project-board-kind-label`,class:`project-board-kinds`,disabled:H.value,"onUpdate:modelValue":pe},{default:S(()=>[(l(),o(_,null,s([`builtin`,`external`],e=>u(`label`,{key:e,class:`project-board-kind-option`,"data-board-kind":e},[r(i(I),{value:e},null,8,[`value`]),u(`span`,null,h(i(b)(e===`builtin`?`employees.projectBoard.kindBuiltin`:`employees.projectBoard.kindExternal`)),1)],8,Ed)),64))]),_:1},8,[`model-value`,`disabled`])]),x.value.kind===`builtin`?(l(),o(`div`,Dd,[u(`p`,Od,h(i(b)(`employees.projectBoard.columnsHint`)),1),x.value.columns.length?(l(),o(`ol`,{key:1,class:`project-board-column-list`,"aria-label":i(b)(`employees.projectBoard.columns`)},[(l(!0),o(_,null,s(x.value.columns,(e,t)=>y((l(),o(`li`,{key:e.key,class:`project-board-column`,"data-column-row":t},[r(i(P),{type:`button`,variant:`ghost`,size:`icon-sm`,class:`project-board-handle`,"data-column-handle":``,disabled:H.value,"aria-label":i(b)(`employees.projectBoard.dragColumn`,{label:e.label}),title:i(b)(`employees.projectBoard.dragColumn`,{label:e.label})},{default:S(()=>[...a[5]||=[u(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`},[u(`circle`,{cx:`5`,cy:`4`,r:`1`}),u(`circle`,{cx:`11`,cy:`4`,r:`1`}),u(`circle`,{cx:`5`,cy:`8`,r:`1`}),u(`circle`,{cx:`11`,cy:`8`,r:`1`}),u(`circle`,{cx:`5`,cy:`12`,r:`1`}),u(`circle`,{cx:`11`,cy:`12`,r:`1`})],-1)]]),_:1},8,[`disabled`,`aria-label`,`title`]),r(i(je),{modelValue:e.label,"onUpdate:modelValue":t=>e.label=t,class:`project-board-column-label`,maxlength:`40`,disabled:H.value,"aria-label":i(b)(`employees.projectBoard.columnLabel`),"data-column-label":``},null,8,[`modelValue`,`onUpdate:modelValue`,`disabled`,`aria-label`]),r(i(fe),{modelValue:e.mapsTo,"onUpdate:modelValue":t=>e.mapsTo=t,size:`sm`,name:`project-board-maps-to-${t}`,label:i(b)(`employees.projectBoard.columnMapsTo`),options:te.value,disabled:H.value},null,8,[`modelValue`,`onUpdate:modelValue`,`name`,`label`,`options`,`disabled`]),u(`span`,Nd,[r(i(ue),{icon:`chevron-up`,size:`sm`,label:i(b)(`employees.projectBoard.moveUp`,{label:e.label}),disabled:H.value||t===0,onClick:e=>_e(t,t-1)},null,8,[`label`,`disabled`,`onClick`]),r(i(ue),{icon:`chevron-down`,size:`sm`,label:i(b)(`employees.projectBoard.moveDown`,{label:e.label}),disabled:H.value||t===x.value.columns.length-1,onClick:e=>_e(t,t+1)},null,8,[`label`,`disabled`,`onClick`]),r(i(ue),{icon:`close`,size:`sm`,label:i(b)(`employees.projectBoard.removeColumn`,{label:e.label}),disabled:H.value,"data-action":`remove-column`,onClick:e=>ge(t)},null,8,[`label`,`disabled`,`onClick`])])],8,Md)),[[ye,t]])),128))],8,jd)):(l(),o(`div`,kd,[u(`span`,Ad,h(i(b)(`employees.projectBoard.defaultColumns`)),1),r(i(P),{type:`button`,size:`sm`,variant:`outline`,disabled:H.value,"data-action":`start-defaults`,onClick:me},{default:S(()=>[c(h(i(b)(`employees.projectBoard.startFromDefaults`)),1)]),_:1},8,[`disabled`])])),x.value.columns.length&&x.value.columns.length<12?(l(),t(i(P),{key:2,type:`button`,size:`sm`,variant:`ghost`,disabled:H.value,"data-action":`add-column`,onClick:he},{default:S(()=>[c(`+ `+h(i(b)(`employees.projectBoard.addColumn`)),1)]),_:1},8,[`disabled`])):e(``,!0)])):(l(),o(`div`,Pd,[u(`label`,Fd,[u(`span`,null,h(i(b)(`employees.projectBoard.externalUrl`)),1),r(i(je),{modelValue:x.value.url,"onUpdate:modelValue":a[3]||=e=>x.value.url=e,type:`url`,inputmode:`url`,maxlength:`2048`,placeholder:`https://`,disabled:H.value,"data-external-url":``},null,8,[`modelValue`,`disabled`])]),u(`label`,Id,[u(`span`,null,h(i(b)(`employees.projectBoard.externalLabel`)),1),r(i(je),{modelValue:x.value.label,"onUpdate:modelValue":a[4]||=e=>x.value.label=e,maxlength:`80`,disabled:H.value,"data-external-label":``},null,8,[`modelValue`,`disabled`])])])),u(`div`,Ld,[E.value?(l(),o(`p`,Rd,h(E.value),1)):O.value?(l(),o(`p`,zd,h(O.value),1)):e(``,!0),r(i(P),{type:`submit`,size:`sm`,disabled:H.value,loading:T.value===`saving`,"loading-label":V.value,"data-action":`save-board`},{default:S(()=>[c(h(i(b)(`employees.projectBoard.save`)),1)]),_:1},8,[`disabled`,`loading`,`loading-label`])]),T.value===`loading`?(l(),t(B,{key:2,variant:`inline`,label:V.value},null,8,[`label`])):e(``,!0)],32)):(l(),o(`div`,yd,[u(`p`,null,h(E.value),1),r(i(P),{size:`sm`,variant:`ghost`,onClick:ae},{default:S(()=>[c(h(i(b)(`employees.retry`)),1)]),_:1})]))]))}}),[[`__scopeId`,`data-v-6d810983`]]),Hd={class:`project-team`,"aria-labelledby":`project-team-heading`},Ud={class:`project-team-header`},Wd={id:`project-team-heading`},Gd={key:1,class:`project-team-stale`,role:`alert`},Kd={key:1,class:`project-team-state`,role:`alert`},qd=[`aria-expanded`,`aria-controls`,`aria-label`],Jd={class:`project-team-avatar`,"aria-hidden":`true`},Yd=[`src`],Xd={class:`project-team-lead-text`},Zd={class:`project-team-lead-name`},Qd={class:`ui-meta`},$d={key:0,class:`project-team-responsibility`},ef={class:`ui-meta project-team-preview`},tf={key:1,class:`project-team-state`,role:`status`},nf=[`id`],rf={key:0,class:`project-team-list`},af={class:`ui-meta`},of=[`data-team-group`],sf={key:0,class:`project-team-sub-lead`},cf={class:`project-team-avatar is-small`,"aria-hidden":`true`},lf=[`src`],uf={class:`ui-meta`},df={key:1,class:`ui-meta project-team-sub-lead is-unavailable`,role:`status`},ff={key:2,class:`project-team-list`},pf={class:`project-team-avatar is-small`,"aria-hidden":`true`},mf=[`src`],hf={class:`project-team-person`},gf={key:0,class:`ui-meta`},_f={key:0,class:`project-team-responsibility`},vf={key:1,class:`ui-meta project-team-suggestion`,"data-sub-team-suggestion":``},yf={class:`project-team-list`},bf={class:`project-team-avatar is-small`,"aria-hidden":`true`},xf=[`src`],Sf={class:`project-team-person`},Cf={key:0,class:`ui-meta`},wf={key:0,class:`project-team-responsibility`},Tf={key:2,class:`ui-meta`},Ef=a({__name:`ProjectTeamSummary`,props:{spaceId:{},projectId:{}},setup(a){let p=a,m=n(null),g=n(!1),x=n(!1),w=n(!1),E=Me(C(()=>g.value&&!m.value)),D=Me(C(()=>g.value&&!!m.value)),O=0,k=C(()=>`project-team-organization-${p.projectId}`),A=C(()=>{let e=m.value;if(!e)return[];let t=e.subTeams??[];if(!t.length)return[{key:`members`,title:b(`projects.overview.members`),lead:null,unavailableLead:null,people:e.members}];let n=new Set(t.flatMap(e=>[e.lead?.agentId,...e.members.map(e=>e.agentId)]));return[...t.map(e=>({key:`sub-${e.id}`,title:e.name,lead:e.lead,unavailableLead:e.unavailableLead,people:e.members.filter(t=>t.agentId!==e.lead?.agentId)})),{key:`direct`,title:b(`projects.overview.directReports`),lead:null,unavailableLead:null,people:e.members.filter(e=>!n.has(e.agentId))}].filter(e=>e.lead||e.unavailableLead||e.people.length)}),j=C(()=>({path:`/project-agents/manage`,query:{project:p.projectId}})),M=C(()=>{let e=m.value;if(!e)return``;let t=[];if(e.members.length){let n=new Intl.ListFormat(v(),{type:`conjunction`}).format(e.members.map(({name:e})=>e));t.push(`${b(`projects.overview.memberCount`,{count:e.members.length})} · ${n}`)}return e.collaborators.length&&t.push(b(`projects.overview.collaboratorCount`,{count:e.collaborators.length})),e.peers.length&&t.push(b(`projects.overview.peerCount`,{count:e.peers.length})),t.length?t.join(v()===`zh-CN`?`;`:`; `):b(`projects.overview.noMembers`)});d(()=>[p.spaceId,p.projectId],()=>{m.value=null,w.value=!1,F()},{immediate:!0});async function F(){if(!p.spaceId||!p.projectId)return;let e=++O;g.value=!0,x.value=!1;try{let t=await Re(p.spaceId,p.projectId);e===O&&(m.value=t)}catch{e===O&&(x.value=!0)}finally{e===O&&(g.value=!1)}}function I(e){return e.employeeNumber?b(`projects.overview.employeeNumber`,{number:e.employeeNumber}):``}return(n,d)=>(l(),o(`section`,Hd,[u(`header`,Ud,[u(`h3`,Wd,h(i(b)(`projects.overview.team`)),1),i(D)?(l(),t(B,{key:0,variant:`inline`,label:i(b)(`projects.overview.refreshingTeam`)},null,8,[`label`])):x.value&&m.value?(l(),o(`p`,Gd,[c(h(i(b)(`projects.overview.refreshFailed`))+` `,1),r(i(P),{size:`sm`,variant:`ghost`,onClick:F},{default:S(()=>[c(h(i(b)(`projects.overview.retry`)),1)]),_:1})])):e(``,!0),r(i(P),{size:`icon-sm`,variant:`ghost`,"aria-label":i(b)(`projects.overview.refresh`),title:i(b)(`projects.overview.refresh`),disabled:g.value,onClick:F},{default:S(()=>[...d[1]||=[u(`svg`,{class:`project-team-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`},[u(`path`,{d:`M20 12a8 8 0 1 1-2.34-5.66M20 4v5h-5`})],-1)]]),_:1},8,[`aria-label`,`title`,`disabled`])]),i(E)?(l(),t(B,{key:0,variant:`compact`,label:i(b)(`projects.overview.loadingTeam`)},null,8,[`label`])):x.value&&!m.value?(l(),o(`div`,Kd,[u(`p`,null,h(i(b)(`projects.overview.teamFailed`)),1),r(i(P),{size:`sm`,variant:`ghost`,onClick:F},{default:S(()=>[c(h(i(b)(`projects.overview.retry`)),1)]),_:1})])):m.value?(l(),o(_,{key:2},[m.value.lead?(l(),o(`button`,{key:0,class:`project-team-lead`,type:`button`,"aria-expanded":w.value,"aria-controls":k.value,"aria-label":`${i(b)(`projects.overview.lead`)} ${m.value.lead.name}. ${w.value?i(b)(`projects.overview.hideOrganization`):i(b)(`projects.overview.showOrganization`)}`,onClick:d[0]||=e=>w.value=!w.value},[u(`span`,Jd,[u(`img`,{src:i(pe)(m.value.lead.agentId),alt:``},null,8,Yd)]),u(`span`,Xd,[u(`span`,Zd,[u(`strong`,null,h(m.value.lead.name),1),u(`span`,Qd,[c(h(i(b)(`projects.overview.lead`)),1),I(m.value.lead)?(l(),o(_,{key:0},[c(` · `+h(I(m.value.lead)),1)],64)):e(``,!0)])]),m.value.lead.responsibility?(l(),o(`span`,$d,h(m.value.lead.responsibility),1)):e(``,!0),u(`span`,ef,h(M.value),1)]),d[2]||=u(`svg`,{class:`project-team-chevron`,viewBox:`0 0 24 24`,"aria-hidden":`true`},[u(`path`,{d:`m6 9 6 6 6-6`})],-1)],8,qd)):(l(),o(`div`,tf,[u(`p`,null,[m.value.status===`lead_unavailable`?(l(),o(_,{key:0},[c(h(m.value.unavailableLead?.name?i(b)(`projects.overview.leadUnavailable`,{name:m.value.unavailableLead.name}):i(b)(`projects.overview.leadUnavailableUnnamed`)),1)],64)):(l(),o(_,{key:1},[c(h(i(b)(`projects.overview.noLead`)),1)],64))]),r(i(P),{"as-child":``},{default:S(()=>[r(i(N),{to:j.value},{default:S(()=>[c(h(m.value.status===`lead_unavailable`?i(b)(`projects.overview.changeLead`):i(b)(`projects.overview.setLead`)),1)]),_:1},8,[`to`])]),_:1})])),y(u(`div`,{id:k.value,class:`project-team-organization`},[m.value.lead?(l(),o(`ul`,rf,[u(`li`,null,[r(Le,{"space-id":a.spaceId,"agent-id":m.value.lead.agentId,name:m.value.lead.name},null,8,[`space-id`,`agent-id`,`name`]),u(`span`,af,[c(h(i(b)(`projects.overview.lead`)),1),I(m.value.lead)?(l(),o(_,{key:0},[c(` · `+h(I(m.value.lead)),1)],64)):e(``,!0)])])])):e(``,!0),(l(!0),o(_,null,s(A.value,t=>(l(),o(`div`,{key:t.key,class:f([`project-team-group`,[`is-${t.key}`,{"is-sub-team":t.lead||t.unavailableLead}]]),"data-team-group":t.key},[u(`h4`,null,h(t.title),1),t.lead?(l(),o(`p`,sf,[u(`span`,cf,[u(`img`,{src:i(pe)(t.lead.agentId),alt:``},null,8,lf)]),r(Le,{"space-id":a.spaceId,"agent-id":t.lead.agentId,name:t.lead.name},null,8,[`space-id`,`agent-id`,`name`]),u(`span`,uf,h(i(b)(`projects.overview.subLead`)),1)])):t.unavailableLead?(l(),o(`p`,df,h(i(b)(`projects.overview.subLeadUnavailable`,{name:t.unavailableLead.name??``})),1)):e(``,!0),t.people.length?(l(),o(`ul`,ff,[(l(!0),o(_,null,s(t.people,t=>(l(),o(`li`,{key:t.agentId},[u(`span`,pf,[u(`img`,{src:i(pe)(t.agentId),alt:``},null,8,mf)]),u(`span`,hf,[u(`span`,null,[r(Le,{"space-id":a.spaceId,"agent-id":t.agentId,name:t.name},null,8,[`space-id`,`agent-id`,`name`]),I(t)?(l(),o(`span`,gf,` · `+h(I(t)),1)):e(``,!0)]),t.responsibility?(l(),o(`span`,_f,h(t.responsibility),1)):e(``,!0)])]))),128))])):e(``,!0)],10,of))),128)),m.value.subTeamSuggestion?.suggested?(l(),o(`p`,vf,[c(h(i(b)(`projects.overview.subTeamSuggestion`,{count:m.value.subTeamSuggestion.memberCount}))+` `,1),r(i(N),{to:j.value},{default:S(()=>[c(h(i(b)(`projects.overview.subTeamSuggestionLink`)),1)]),_:1},8,[`to`])])):e(``,!0),(l(!0),o(_,null,s([{key:`collaborators`,title:i(b)(`projects.overview.collaborators`),people:m.value.collaborators},{key:`peers`,title:i(b)(`projects.overview.peers`),people:m.value.peers}],t=>(l(),o(_,{key:t.key},[t.people.length?(l(),o(`div`,{key:0,class:f([`project-team-group`,`is-${t.key}`])},[u(`h4`,null,h(t.title),1),u(`ul`,yf,[(l(!0),o(_,null,s(t.people,t=>(l(),o(`li`,{key:t.agentId},[u(`span`,bf,[u(`img`,{src:i(pe)(t.agentId),alt:``},null,8,xf)]),u(`span`,Sf,[u(`span`,null,[r(Le,{"space-id":a.spaceId,"agent-id":t.agentId,name:t.name},null,8,[`space-id`,`agent-id`,`name`]),I(t)?(l(),o(`span`,Cf,` · `+h(I(t)),1)):e(``,!0)]),t.responsibility?(l(),o(`span`,wf,h(t.responsibility),1)):e(``,!0)])]))),128))])],2)):e(``,!0)],64))),128)),m.value.unavailableMemberIds.length?(l(),o(`p`,Tf,[c(h(i(b)(`projects.overview.unavailableMembers`,{count:m.value.unavailableMemberIds.length}))+` `,1),r(i(N),{to:j.value},{default:S(()=>[c(h(i(b)(`projects.overview.unavailableMembersLink`)),1)]),_:1},8,[`to`])])):e(``,!0)],8,nf),[[T,w.value||!m.value.lead]])],64)):e(``,!0)]))}}),Df=[`data-project-capture`,`data-recorded`],Of={class:`project-capture-row`},kf={key:1,class:`project-capture-failure`,role:`alert`,"data-project-capture-error":``},Af={key:2,class:`project-capture-state`},jf={key:3,class:`project-capture-state`,"data-project-capture-global-off":``},Mf=x(a({__name:`ProjectCaptureSwitch`,props:{projectId:{},projectName:{}},setup(a){let s=a,c=A(),d=C(()=>c.state?.capturePolicy),f=n(null),p=n(``),g=C(()=>f.value??xt(d.value,s.projectId)),_=C(()=>bt(d.value,s.projectId)),v=C(()=>d.value?.enabled===!1),y=C(()=>g.value?b(`capture.project.on`):_.value&&f.value===null?b(`capture.project.offSince`,{day:_.value}):b(`capture.project.off`));m(()=>{c.loadCapturePolicy().catch(()=>{})});async function x(e){if(f.value===null){f.value=e,p.value=``;try{await c.changeCapturePolicy({recordProjects:{[s.projectId]:e}})}catch(e){p.value=await St(e,()=>c.settledCapturePolicy())}finally{f.value=null}}}return(n,s)=>(l(),o(`section`,{class:`project-capture-switch`,"data-project-capture":a.projectId,"data-recorded":g.value},[u(`label`,Of,[u(`strong`,null,h(i(b)(`capture.project.label`)),1),r(i(L),{"model-value":g.value,"aria-label":i(b)(`capture.project.label`),disabled:f.value!==null,"onUpdate:modelValue":x},null,8,[`model-value`,`aria-label`,`disabled`])]),f.value===null?p.value?(l(),o(`p`,kf,h(p.value),1)):(l(),o(`p`,Af,h(y.value),1)):(l(),t(B,{key:0,variant:`inline`,"data-project-capture-pending":``,label:i(b)(f.value?`capture.project.turningOn`:`capture.project.turningOff`,{name:a.projectName})},null,8,[`label`])),v.value?(l(),o(`p`,jf,h(i(b)(`capture.project.globalOff`)),1)):e(``,!0)],8,Df))}}),[[`__scopeId`,`data-v-b6871a8d`]]),Nf={class:`project-overview`},Pf={class:`project-overview-header`},Ff={class:`project-overview-title`},If={key:0,class:`project-overview-purpose`},Lf={key:1,class:`ui-meta`},Rf={class:`project-overview-actions`},zf=[`aria-label`],Bf={class:`project-frequent-header`},Vf={class:`ui-meta`},Hf={key:0,class:`ui-meta`,"data-frequent-projects-empty":``},Uf={key:1,class:`project-frequent-list`},Wf=[`data-frequent-project`,`data-weight-tier`],Gf={class:`project-frequent-main`},Kf={class:`ui-meta project-frequent-counts`},qf={key:0,class:`project-frequent-reuse-hint`,"data-suggest-knowledge-reuse":``},Jf=a({__name:`ProjectOverview`,props:{spaceId:{},project:{},frequentProjects:{default:()=>[]},canPublish:{type:Boolean,default:!1}},emits:[`edit-profile`,`publish`],setup(n){let a=n,d=C(()=>(a.frequentProjects??[]).slice(0,3));return(a,p)=>(l(),o(`div`,Nf,[u(`header`,Pf,[u(`div`,Ff,[u(`h2`,null,h(n.project.profile.name),1),n.project.profile.purpose?(l(),o(`p`,If,h(n.project.profile.purpose),1)):(l(),o(`p`,Lf,h(i(b)(`projects.overview.noPurpose`)),1))]),u(`div`,Rf,[n.canPublish?(l(),t(i(P),{key:0,size:`sm`,variant:`ghost`,onClick:p[0]||=e=>a.$emit(`publish`)},{default:S(()=>[c(h(i(b)(`knowledge.workspace.workspace.view.publishProject`)),1)]),_:1})):e(``,!0),r(i(P),{size:`icon-sm`,variant:`ghost`,"aria-label":i(b)(`projects.overview.editProfile`),title:i(b)(`projects.overview.editProfile`),onClick:p[1]||=e=>a.$emit(`edit-profile`)},{default:S(()=>[...p[2]||=[u(`svg`,{class:`project-team-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`},[u(`path`,{d:`M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4`})],-1)]]),_:1},8,[`aria-label`,`title`])])]),(l(),t(Mf,{key:n.project.project_id,class:`project-capture-card`,"project-id":n.project.project_id,"project-name":n.project.profile.name},null,8,[`project-id`,`project-name`])),(l(),t(Ue,{key:`judgment-${n.project.project_id}`,class:`project-judgment-card`,"personal-space-id":n.spaceId,"project-id":n.project.project_id,"project-name":n.project.profile.name,heading:i(b)(`judgment.project.heading`)},null,8,[`personal-space-id`,`project-id`,`project-name`,`heading`])),r(Ef,{"space-id":n.spaceId,"project-id":n.project.project_id},null,8,[`space-id`,`project-id`]),(l(),t(Vd,{key:`board-${n.project.project_id}`,"space-id":n.spaceId,"project-id":n.project.project_id,"project-name":n.project.profile.name},null,8,[`space-id`,`project-id`,`project-name`])),u(`section`,{class:`project-frequent-projects`,"data-frequent-projects":``,"aria-label":i(b)(`projects.overview.frequentProjects`)},[u(`header`,Bf,[u(`h3`,null,h(i(b)(`projects.overview.frequentProjects`)),1),u(`span`,Vf,h(i(b)(`projects.overview.frequentProjectsHint`)),1)]),d.value.length?(l(),o(`ul`,Uf,[(l(!0),o(_,null,s(d.value,t=>(l(),o(`li`,{key:t.projectId,class:`project-frequent-item`,"data-frequent-project":t.projectId,"data-weight-tier":t.tier},[u(`div`,Gf,[r(i(N),{class:`project-frequent-link`,to:i(me)(n.spaceId,`overview`,t.projectId)},{default:S(()=>[c(h(t.name),1)]),_:2},1032,[`to`]),u(`span`,{class:f([`project-frequent-tier`,`is-${t.tier}`])},h(i(Zs)(t.tier)),3),u(`span`,Kf,h(i(b)(`projects.overview.frequentProjectCounts`,{recent:t.recent30dCount,total:t.totalCount})),1)]),t.suggestKnowledgeReuse?(l(),o(`p`,qf,h(i(b)(`projects.overview.suggestKnowledgeReuse`)),1)):e(``,!0)],8,Wf))),128))])):(l(),o(`p`,Hf,h(i(b)(`projects.overview.noFrequentProjects`)),1))],8,zf)]))}}),Yf=a({__name:`CreateProjectEntry`,props:{spaceId:{}},setup(e){let t=e,a=A(),s=j(),u=n(!1),d=C(()=>(a.state?.personalProjects??[]).filter(e=>e.personal_space_id===t.spaceId).map(e=>e.project_id));async function f(e){u.value=!1,await a.refresh(),await s.push(me(t.spaceId,`overview`,e.project_id))}return(t,n)=>(l(),o(_,null,[r(i(P),{size:`sm`,variant:`ghost`,"data-create-project":``,onClick:n[0]||=e=>u.value=!0},{default:S(()=>[c(`+ `+h(i(b)(`projects.createDialog.open`)),1)]),_:1}),r(ze,{open:u.value,"personal-space-id":e.spaceId,"existing-project-ids":d.value,onClose:n[1]||=e=>u.value=!1,onCreated:f},null,8,[`open`,`personal-space-id`,`existing-project-ids`])],64))}}),Xf=`data-project-drop`,Zf=6;function Qf(e){let t=[],n=new Map;for(let r of e?.nodes??[]){let e=r.attributes?.projectId;r.type===`PersonalProject`&&typeof e==`string`&&e&&(t.push({projectId:e,name:r.name,nodeId:r.id}),n.set(r.id,e))}let r=new Map;for(let t of e?.edges??[]){if(t.type!==`PART_OF`||t.invalid_at||t.attributes?.status!==`active`)continue;let e=n.get(lt(t.source)),i=n.get(lt(t.target));e&&i&&!r.has(e)&&r.set(e,i)}return{projects:t,parentOf:r}}function $f(e,t){return e.projects.find(e=>e.nodeId===t)??null}function ep(e,t){return e.projects.find(e=>e.projectId===t)?.name??t??``}function tp(e,t,n){let r=e.parentOf.get(t)??null;return n.kind===`under`?n.projectId===t?{refusal:`self`}:sp(e,t).has(n.projectId)?{refusal:`cycle`}:n.projectId===r?{refusal:`unchanged`}:{move:{projectId:t,parentProjectId:n.projectId}}:r?n.kind===`top`?{move:{projectId:t,parentProjectId:null}}:{move:{projectId:t,parentProjectId:e.parentOf.get(r)??null}}:{refusal:`unchanged`}}function np(e,t,n){return`move`in tp(e,t,n)}function rp(e,t,n){let r=n.trim().toLocaleLowerCase();return r?e.projects.filter(e=>[e.name,e.projectId].some(e=>e.toLocaleLowerCase().includes(r))).filter(n=>np(e,t,{kind:`under`,projectId:n.projectId})).slice(0,Zf):[]}function ip(e){return e.kind===`under`?`under:${e.projectId}`:e.kind}function ap(e){let t=e?.closest(`[${Xf}]`)?.getAttribute(Xf);return t===`sibling`||t===`top`?{kind:t}:t?.startsWith(`under:`)?{kind:`under`,projectId:t.slice(6)}:null}function op(e,t){return!!(e&&t)&&ip(e)===ip(t)}function sp(e,t){let n=new Map;for(let[t,r]of e.parentOf)n.set(r,[...n.get(r)??[],t]);let r=new Set,i=[t];for(;i.length;)for(let e of n.get(i.pop())??[])r.has(e)||(r.add(e),i.push(e));return r}var cp=[`aria-label`],lp={class:`project-drop-heading`},up=[`data-project-drop`],dp=[`data-project-drop`],fp={key:1,class:`project-drop-results`},pp=[`data-project-drop`],mp={key:2,class:`project-drop-empty`},hp=x(a({__name:`ProjectDropPanel`,props:{tree:{},project:{},hovered:{}},setup(t){let a=t,c=n(``),d=n(null),p=C(()=>a.tree.parentOf.get(a.project.projectId)??null),g=C(()=>rp(a.tree,a.project.projectId,c.value)),v=`project-drop-search-${a.project.projectId}`;m(()=>d.value?.querySelector(`input`)?.focus());function y(e){return{hovered:op(a.hovered,e)}}return(n,a)=>(l(),o(`aside`,{class:`project-drop-panel`,"aria-label":i(b)(`projects.organize.panelAria`)},[u(`p`,lp,h(i(b)(`projects.organize.heading`,{name:t.project.name})),1),p.value?(l(),o(_,{key:0},[u(`div`,{class:f([`project-drop-target`,y({kind:`sibling`})]),"data-project-drop":i(ip)({kind:`sibling`})},[u(`strong`,null,h(i(b)(`projects.organize.sibling`)),1),u(`small`,null,h(i(b)(`projects.organize.siblingOf`,{name:i(ep)(t.tree,p.value)})),1)],10,up),u(`div`,{class:f([`project-drop-target`,y({kind:`top`})]),"data-project-drop":i(ip)({kind:`top`})},[u(`strong`,null,h(i(b)(`projects.organize.top`)),1),u(`small`,null,h(i(b)(`projects.organize.topHint`)),1)],10,dp)],64)):e(``,!0),u(`div`,{ref_key:`searchField`,ref:d,class:`project-drop-search`},[u(`label`,{for:v},h(i(b)(`projects.organize.search`)),1),r(i(je),{id:v,modelValue:c.value,"onUpdate:modelValue":a[0]||=e=>c.value=e,type:`search`,autocomplete:`off`,placeholder:i(b)(`projects.organize.searchPlaceholder`)},null,8,[`modelValue`,`placeholder`])],512),g.value.length?(l(),o(`ul`,fp,[(l(!0),o(_,null,s(g.value,e=>(l(),o(`li`,{key:e.projectId,class:f([`project-drop-target`,y({kind:`under`,projectId:e.projectId})]),"data-project-drop":i(ip)({kind:`under`,projectId:e.projectId})},[u(`strong`,null,h(e.name),1),u(`small`,null,`#`+h(e.projectId),1)],10,pp))),128))])):c.value.trim()?(l(),o(`p`,mp,h(i(b)(`projects.organize.noMatches`)),1)):e(``,!0)],8,cp))}}),[[`__scopeId`,`data-v-e24be3e8`]]),gp={project_hierarchy_cycle:`cycle`,project_hierarchy_self:`self`,project_hierarchy_changed:`changed`,project_not_found:`notFound`,parent_not_found:`notFound`};function _p({graph:e,spaceId:t,canvas:r,onMoved:i}){let a=n(!1),o=n(null),s=n(null),c=n(``),l=n(``),u=C(()=>Qf(e.value));function d(e){let t=$f(u.value,e.node.id);if(!t)return;if(c.value){e.phase===`end`&&r.value?.restoreNode(t.nodeId);return}if(e.phase===`start`){o.value=t,s.value=null,l.value=``;return}let n=f(e);if(e.phase===`move`){let e=n&&`move`in tp(u.value,t.projectId,n)?n:null;s.value=e,r.value?.markDropTarget(e?.kind===`under`?u.value.projects.find(({projectId:t})=>t===e.projectId)?.nodeId??null:null)}else o.value=null,s.value=null,r.value?.markDropTarget(null),p(t,n)}function f(e){let t=ap(typeof document.elementFromPoint==`function`?document.elementFromPoint(e.clientX,e.clientY):null);if(t)return t;let n=e.over?$f(u.value,e.over.id):null;return n?{kind:`under`,projectId:n.projectId}:null}async function p(e,n){let a=n?tp(u.value,e.projectId,n):{refusal:`unchanged`};if(`refusal`in a){r.value?.restoreNode(e.nodeId),a.refusal!==`unchanged`&&(l.value=m(e,a.refusal,n));return}let{parentProjectId:o}=a.move;c.value=o?b(`projects.organize.movingUnder`,{name:e.name,parent:ep(u.value,o)}):b(`projects.organize.movingTop`,{name:e.name});try{await V(`/api/personal-projects/${encodeURIComponent(e.projectId)}/parent`,{personalSpaceId:t.value,parentProjectId:o}),await i()}catch(t){r.value?.restoreNode(e.nodeId);let n=gp[U(t)??``];l.value=b(`projects.organize.failed`,{name:e.name,reason:n?h(n,e,o):ne(t)})}finally{c.value=``}}function m(e,t,n){let r=n?.kind===`under`?n.projectId:null;return b(`projects.organize.failed`,{name:e.name,reason:h(t,e,r)})}function h(e,t,n){return b(`projects.organize.reasons.${e}`,{name:t.name,parent:ep(u.value,n)})}function g(e){a.value=e,l.value=``}return{enabled:a,setEnabled:g,dragging:o,hovered:s,pendingLabel:c,failure:l,tree:u,onProjectDrag:d}}function vp(e,t){if(!t)return{graph:e,parents:[]};let n=e.nodes.find(e=>e.type===`PersonalProject`&&e.attributes?.projectId===t);if(!n)return{graph:e,parents:[]};let r=new Map(e.nodes.map(e=>[e.id,e])),i=new Map;for(let t of e.edges){if(t.type!==`PART_OF`||yp(t.source)!==n.id)continue;let e=r.get(yp(t.target));if(!e||!bp(e))continue;let a=e.attributes?.projectId;typeof a==`string`&&a&&(i.has(e.id)||i.set(e.id,{projectId:a,name:e.name,summary:e.summary||b(`knowledge.domain.hierarchy.parentSummary`),nodeId:e.id,relationId:t.id}))}if(!i.size)return{graph:e,parents:[]};let a=new Set(i.keys()),o=e.nodes.filter(({id:e})=>!a.has(e)),s=new Set(o.map(({id:e})=>e)),c=e.edges.filter(e=>s.has(yp(e.source))&&s.has(yp(e.target)));return{graph:{...e,nodes:o,edges:c},parents:[...i.values()]}}function yp(e){return typeof e==`object`&&e?e.id:e}function bp(e){return e.type===`PersonalProject`||e.type===`RelatedPersonalProject`}var xp={class:`knowledge-canvas`},Sp={class:`knowledge-view-heading`},Cp={key:1,class:`organize-failure`,role:`alert`},wp={key:4,class:`muted`},Tp={key:2,class:`project-overview-failed`,role:`alert`},Ep={key:3,class:`muted`,role:`status`},Dp={class:`graph-toolbar`},Op={key:0,class:`project-visibility-toggle`},kp={key:1,class:`project-visibility-toggle`},Ap={key:3,class:`personal-context-picker`},jp={class:`personal-context-panel`},Mp={class:`personal-context-list`},Np=[`value`,`checked`],Pp=[`aria-label`],Fp={class:`graph-view-actions`},Ip=[`aria-label`],Lp={class:`knowledge-filter-controls`},Rp={key:2,class:`view-loading`,"aria-busy":`true`},zp={key:3,class:`knowledge-layout`},Bp={key:3,class:`graph-empty`},Vp={key:4,class:`graph-hint`},Hp=x(a({__name:`KnowledgeWorkspace`,props:{personalProjectsOnly:{type:Boolean,default:!1}},setup(a){let m=a,v=A(),y=M(),x=j(),T=n(!1),E=n(!1),O=n(null),k=Ne(),N=C(()=>k||T.value&&!O.value),F=Me(N),I=n(null),V=n(null),H=n(yn(y.query.q)),U=n(``),ne=n(!1),re=n(null),ae=n(null),se=n(null),ce=n(null),le=n(null),ue=n(null),de=n(null),pe=new Set,ge=0,_e=0,ve=null,ye=null,be=!1,xe=C(()=>m.personalProjectsOnly?`personal`:y.params.scope===`public`?`public`:`personal`),W=C(()=>String(y.params.spaceId??v.activePersonalSpace?.id??``)),G=C(()=>{let e=y.params.projectId;return typeof e==`string`&&e?e:null}),Se=C(()=>m.personalProjectsOnly&&!!G.value),K=C(()=>y.params.mode===`graph`?`graph`:y.params.mode===`overview`&&Se.value?`overview`:`directory`),Ce=C(()=>bn(y.query.context)),we=C(()=>JSON.stringify([m.personalProjectsOnly,xe.value,W.value,G.value,Ce.value])),Te=C(()=>({showTemporary:E.value,selectedProjectId:G.value})),Ee=C(()=>O.value&&m.personalProjectsOnly?wt(O.value,St.value,Te.value):O.value),De=C(()=>pt(Ee.value)),Oe=C(()=>m.personalProjectsOnly?Ge(Ee.value):[]),ke=C(()=>{let e=H.value.trim().toLocaleLowerCase();return e?Oe.value.filter(t=>[t.title,t.body,t.type,ct(t)].some(t=>t.toLocaleLowerCase().includes(e))):Oe.value}),Ae=C(()=>[...m.personalProjectsOnly?Ge(O.value):[],...pt(O.value)]),Fe=C(()=>m.personalProjectsOnly?K.value===`directory`&&I.value?ut(I.value)?`materials`:`knowledge`:yn(y.query.section)===`materials`?`materials`:`knowledge`:`knowledge`),Le=C(()=>[{value:`all`,label:b(`knowledge.workspace.workspace.filters.allTypes`)},...ht(De.value)]),Re=C(()=>[{value:`all`,label:b(`knowledge.workspace.workspace.filters.allQuadrants`)},...[`known_known`,`known_unknown`,`unknown_known`,`unknown_unknown`].map(e=>({value:e,label:st(e)}))]),ze=C(()=>[{value:`all`,label:b(`knowledge.workspace.workspace.filters.allKnowledge`)},{value:`profile`,label:b(`knowledge.workspace.workspace.filters.preferences`)},{value:`regular`,label:b(`knowledge.workspace.workspace.filters.projectKnowledge`)}]),Be=C(()=>[{value:`all`,label:b(`knowledge.workspace.workspace.filters.allHumanStates`)},{value:`human_changed`,label:b(`knowledge.workspace.workspace.filters.allHumanChanged`)},{value:`unseen`,label:b(`knowledge.workspace.workspace.filters.agentUnseen`)},{value:`viewed`,label:b(`knowledge.workspace.workspace.filters.viewedPending`)},{value:`reviewed`,label:b(`knowledge.workspace.workspace.filters.agentReviewed`)}]),Ue=C(()=>{let e=yn(y.query.status);return e===`historical`||e===`all`?e:`current`}),We=C(()=>({query:H.value,type:yn(y.query.type)||`all`,quadrant:yn(y.query.quadrant)||`all`,profile:yn(y.query.profile)||`all`,status:Ue.value,humanChange:yn(y.query.human)||`all`})),qe=C(()=>JSON.stringify([Fe.value,We.value])),Je=C(()=>ft(De.value,We.value)),Ye=C(()=>De.value.filter(({invalidAt:e})=>!e).length),Xe=C(()=>De.value.length-Ye.value),Ze=C(()=>Ue.value===`current`?Ye.value:Ue.value===`historical`?Xe.value:De.value.length),Qe=C(()=>Ue.value===`current`?b(`common.status.current`):Ue.value===`historical`?b(`common.status.invalid`):b(`knowledge.workspace.workspace.status.all`)),$e=C(()=>Ee.value?m.personalProjectsOnly?dt(Ee.value):ec(dt(Ee.value),St.value):null),tt=C(()=>tc(O.value,G.value,St.value)),nt=C(()=>$e.value?vp($e.value,G.value):null),rt=C(()=>nt.value?.graph??null),it=C(()=>nt.value?.parents??[]),lt=C(()=>m.personalProjectsOnly&&!G.value&&K.value===`graph`),q=w(_p({graph:rt,spaceId:W,canvas:V,onMoved:()=>Rt()})),_t=C(()=>rt.value?.edges.map(({type:e})=>e)??[]),vt=C(()=>{if(!O.value)return T.value?b(`common.status.loadingKnowledge`):b(`knowledge.workspace.workspace.status.graphUnread`);if(K.value===`graph`){let e=rt.value;return U.value||b(`knowledge.workspace.workspace.counts.graph`,{nodes:e?.nodes.length??0,edges:e?.edges.length??0})}return Fe.value===`materials`?ke.value.length===Oe.value.length?b(`knowledge.workspace.workspace.counts.materials`,{count:Oe.value.length}):b(`knowledge.workspace.workspace.counts.visibleMaterials`,{visible:ke.value.length,total:Oe.value.length}):Je.value.length===Ze.value?b(`knowledge.workspace.workspace.counts.knowledge`,{status:Qe.value,count:Ze.value}):b(`knowledge.workspace.workspace.counts.visibleKnowledge`,{status:Qe.value,visible:Je.value.length,total:Ze.value})}),bt=C(()=>String(De.value.length)),xt=C(()=>String(Oe.value.length)),St=C(()=>(v.state?.personalProjects??[]).filter(({personal_space_id:e})=>e===W.value)),Tt=C(()=>St.value.filter(e=>e.project_id!==G.value&&(!m.personalProjectsOnly||Ct(e,Te.value)))),Et=C(()=>{let e=v.state;if(!e)return[];let t=e.personalSpaces.flatMap(t=>[{key:vn(`personal`,t.id,null),scope:`personal`,spaceId:t.id,projectId:null,providerUrl:null,label:b(`knowledge.workspace.workspace.spaces.allPersonalProjects`,{name:t.name})},...oe((e.personalProjects??[]).filter(e=>e.personal_space_id===t.id&&(!m.personalProjectsOnly||Ct(e,{...Te.value,selectedProjectId:t.id===W.value?G.value:null})))).map(e=>({key:vn(`personal`,t.id,e.project_id),scope:`personal`,spaceId:t.id,projectId:e.project_id,providerUrl:null,label:b(`knowledge.workspace.workspace.spaces.personalProject`,{name:ie(e)})}))]);if(m.personalProjectsOnly)return t;let n=e.projects.map(e=>({key:vn(`public`,e.id,null),scope:`public`,spaceId:e.id,projectId:null,providerUrl:e.providerUrl,label:b(`knowledge.workspace.workspace.spaces.publicProject`,{name:e.name})}));return[...t,...n]}),Dt=C(()=>vn(xe.value,W.value,G.value)),Ot=C(()=>Et.value.map(e=>{let t=e.projectId??e.spaceId;return{value:e.key,label:e.label,meta:`#${He(t,26)}`,search:Ve(t)}})),kt=C(()=>xe.value===`personal`),At=C(()=>St.value.find(({project_id:e})=>e===G.value)??null),jt=C(()=>!!(ae.value||re.value||se.value||ce.value||le.value)),Mt=C(()=>pn(I.value)),Nt=Pe(()=>{Yt()},300);d([()=>v.state,()=>y.name,()=>y.params.mode,()=>y.params.spaceId],async([e])=>{e&&await Pt()},{immediate:!0}),d([()=>v.state,we],async([e])=>{e&&await Rt()},{immediate:!0}),d(()=>yn(y.query.q),e=>{e===H.value||pe.has(e)||(Nt.cancel(),Zt(),H.value=e,Qt(),K.value===`graph`&&e.trim()&&O.value&&!T.value&&ye===we.value&&$t(e.trim()))},{flush:`sync`}),d(K,async()=>{Nt.cancel(),Zt(),Qt(),await g(),an(),Yt()}),d([()=>y.params.itemKind,()=>y.params.itemId],([,e])=>{e||(be=!1),an()}),p(()=>{Nt.cancel(),Zt()});async function Pt(){let e=v.activePersonalSpace;if(e){if(y.name===`knowledge-default`)await x.replace(he(`personal`,e.id,`directory`));else if(W.value===`current`){let t=m.personalProjectsOnly?me(e.id,K.value,G.value):he(xe.value,e.id,K.value,{projectId:G.value});await x.replace({path:t,query:y.query})}else y.params.mode===`directory`||y.params.mode===`graph`||y.params.mode===`overview`&&Se.value||await Ut(m.personalProjectsOnly?`graph`:`directory`,!0)}}function Ft(e){if(!m.personalProjectsOnly||G.value||K.value!==`directory`||!e||e.itemKind!==`entity`||e.type!==`PersonalProject`)return null;let t=Ke(e);return St.value.some(({project_id:e})=>e===t)?t:null}async function It(e,t){await x[t?`replace`:`push`](me(W.value,`overview`,e))}function Lt(){++ge,Zt(),O.value=null,ye=null,I.value=null,ae.value=null,re.value=null,se.value=null,ce.value=null,le.value=null,T.value=!1,Qt(),v.reportError(Error(b(`preferences.detail.accessDenied`)))}async function Rt(){if(!W.value||W.value===`current`)return;let e=we.value,t=++ge;Zt(),T.value=!0,ae.value=null,re.value=null,I.value=null,Qt();try{let n=G.value&&xe.value===`personal`?await zt():await Bt(G.value);if(t!==ge)return;gt(v.activePersonalSpace?.id??W.value,pt(n)),O.value=n,ye=e,an(),K.value===`graph`&&H.value.trim()&&(await g(),$t(H.value.trim()))}catch(e){if(t!==ge)return;O.value=null,ye=null,v.reportError(e)}finally{t===ge&&(T.value=!1)}}async function zt(){let[e,...t]=await Promise.all([Bt(G.value),...Ce.value.map(e=>Bt(e))]);return mt([e,...t])}function Bt(e){let t=new URLSearchParams({spaceId:W.value,limit:`360`});if(xe.value===`public`){let e=Vt();e?.providerUrl&&t.set(`providerUrl`,e.providerUrl)}return e&&t.set(`personalProjectId`,e),te(`/api/graph?${t}`)}function Vt(){return v.state?.projects.find(({id:e})=>e===W.value)??null}function Ht(e,t){let n={itemKind:t?.itemKind,itemId:t?.id};return m.personalProjectsOnly?me(W.value,e,G.value,n):he(xe.value,W.value,e,{projectId:G.value,...n})}async function Ut(e,t=!1){let n=I.value,r=Ht(e,n),i={...y.query};e===`graph`?delete i.section:m.personalProjectsOnly&&n&&(ut(n)?i.section=`materials`:delete i.section),await x[t?`replace`:`push`]({path:r,query:i})}async function Wt(e){if(!m.personalProjectsOnly||e===Fe.value)return;I.value=null;let t={...y.query};e===`materials`?t.section=`materials`:delete t.section,await x.push({path:me(W.value,`directory`,G.value),query:t})}async function Gt(e){let t=Et.value.find(({key:t})=>t===e);if(!t)return;let n=m.personalProjectsOnly?me(t.spaceId,K.value,t.projectId):he(t.scope,t.spaceId,K.value,{projectId:t.projectId});await x.push({path:n})}async function Kt(e,t){let n={...y.query};!t||t===`all`&&e!==`status`||e===`status`&&t===`current`?delete n[e]:n[e]=t,await x.replace({query:n})}function qt(e){H.value=e,Zt(),Qt(),Nt.schedule()}function Jt(){Nt.cancel(),Yt()}async function Yt(){let e=H.value,t=e.trim();await Xt(e),H.value===e&&K.value===`graph`&&(t?!T.value&&O.value&&ye===we.value&&await $t(t):(Zt(),Qt()))}async function Xt(e){if(yn(y.query.q)!==e){pe.add(e);try{await Kt(`q`,e)}catch(e){v.reportError(e)}finally{await g(),pe.delete(e)}}}function Zt(){ne.value=!1,_e+=1,ve?.abort(),ve=null}function Qt(){U.value=``,de.value=null,V.value?.clearSelection();let e=I.value;K.value===`graph`&&e&&V.value?.selectItem(e.itemKind,e.id)}async function $t(e){let t=v.activePersonalSpace?.id;if(!t)return;Zt();let n=_e,r=new AbortController;ve=r,de.value=null,ne.value=!0,U.value=``;let i=new URLSearchParams({personalSpaceId:t,q:e,limit:`30`});G.value&&i.set(`personalProjectId`,G.value);for(let e of Ce.value)i.append(`contextPersonalProjectId`,e);xe.value===`public`&&i.append(`projectId`,W.value);try{let a=await te(`/api/search?${i}`,{signal:r.signal});if(n!==_e)return;let o=a.facts??[],s=new Set([...(a.entities??[]).map(({name:e})=>e),...o.flatMap(({source_entity:e,target_entity:t})=>[e,t])]),c=V.value?.focusByNames(s,{searchMatch:!0})??0;if(c){U.value=b(`knowledge.workspace.workspace.search.results`,{entities:a.entities?.length??0,relationships:o.length,nodes:c});return}U.value=b(`knowledge.workspace.workspace.search.noResults`);let l=xe.value===`personal`&&!G.value;if(de.value={query:e,checking:l,result:null},!l)return;let u=await ll({personalSpaceId:t,projects:St.value,query:e,baseline:a,signal:r.signal});if(n!==_e)return;de.value={query:e,checking:!1,result:u}}catch(e){if(r.signal.aborted||n!==_e)return;U.value=b(`knowledge.workspace.workspace.search.failed`),v.reportError(e)}finally{ve===r&&(ve=null,ne.value=!1)}}async function en(e){let t=Ft(e);if(t){await It(t,!1);return}let n=!!I.value;I.value=e;let r=Ht(K.value,e),i={...y.query};K.value===`directory`&&m.personalProjectsOnly&&(ut(e)?i.section=`materials`:delete i.section),be||=!n,await x[n?`replace`:`push`]({path:r,query:i})}async function tn(){be?(be=!1,x.back()):await x.replace({path:Ht(K.value),query:y.query})}function nn(e){en(Ae.value.find(({itemKind:t,id:n})=>t===`entity`&&n===e.id)??at(e))}function rn(e){en(Ae.value.find(({itemKind:t,id:n})=>t===`relationship`&&n===e.id)??ot(e,new Map(O.value?.nodes.map(e=>[e.id,e.name])??[])))}function an(){let e=y.params.itemKind,t=y.params.itemId;if(typeof e!=`string`||typeof t!=`string`){I.value=null;return}let n=Ae.value.find(n=>n.itemKind===e&&n.id===t),r=e===`entity`?O.value?.nodes.find(({id:e})=>e===t):O.value?.edges.find(({id:e})=>e===t);I.value=n??(e===`entity`&&r?at(r):e===`relationship`&&r?ot(r,new Map(O.value?.nodes.map(e=>[e.id,e.name])??[])):null);let i=Ft(I.value);if(i)It(i,!0);else if(I.value&&K.value===`directory`){let e=et(I.value);g(()=>{let t=[...document.querySelectorAll(`[data-item-key]`)].find(t=>t.dataset.itemKey===e);t?.scrollIntoView?.({block:`center`}),t?.focus({preventScroll:!0})})}}function on(e){let t=e.currentTarget,n=new Set(Ce.value);t.checked?n.add(t.value):n.delete(t.value),Kt(`context`,[...n])}async function sn(e){await It(e,!1)}function cn(){At.value&&(ue.value=`PersonalProject`,le.value=At.value)}async function ln(e,t){let n=Ht(t,e),r={...y.query};if(t===`directory`&&m.personalProjectsOnly&&ut(e)?r.section=`materials`:delete r.section,t===`directory`&&!ut(e)&&!ft([e],We.value).length)for(let e of[`q`,`type`,`quadrant`,`profile`,`status`,`human`])delete r[e];be=!1,await x.push({path:n,query:r})}async function un(e){let t=Ht(`directory`,e),n={...y.query};for(let e of[`q`,`type`,`quadrant`,`profile`,`human`,`section`])delete n[e];e.invalidAt?n.status=`historical`:delete n.status,be=!1,await x.push({path:t,query:n})}function dn(e){let t=pn(e);t?(ue.value=e.itemKind===`entity`?e.type:`PersonalProject`,le.value=t):v.reportError(Error(b(`knowledge.workspace.workspace.errors.projectUnknown`)))}function fn(e){return e?.profileAspect?null:G.value}function pn(e){if(!e||!ut(e))return null;let t=Ke(e),n=G.value,r=new Set;if(e.itemKind===`entity`)r.add(e.id);else{let t=e.raw;r.add(typeof t.source==`string`?t.source:t.source.id),r.add(typeof t.target==`string`?t.target:t.target.id)}for(let e of O.value?.nodes??[]){if(!r.has(e.id))continue;let t=e.attributes?.projectId;typeof t==`string`&&t&&r.add(t)}if(!t&&!n)for(let e of O.value?.edges??[]){if(!String(e.id).startsWith(`project-profile-edge:`))continue;let t=typeof e.source==`string`?e.source:e.source.id,n=typeof e.target==`string`?e.target:e.target.id;if(!r.has(t)&&!r.has(n))continue;let i=r.has(t)?n:t,a=(O.value?.nodes.find(({id:e})=>e===i))?.attributes?.projectId;typeof a==`string`&&a&&r.add(a)}let i=t??n??[...r].find(e=>St.value.some(({project_id:t})=>t===e));return St.value.find(({project_id:e})=>e===i)??null}async function mn(e){await v.refresh(),await Rt(),v.notify(b(`knowledge.workspace.workspace.notices.materialUpdated`,{name:e.profile.name}))}function hn(e){let t=St.value.find(({project_id:t})=>t===e);t&&(ce.value=t)}async function gn(e,t){let n={created:b(`knowledge.workspace.workspace.notices.projectCreated`,{name:t}),linked:b(`knowledge.workspace.workspace.notices.linked`,{name:t}),already_linked:b(`knowledge.workspace.workspace.notices.alreadyLinked`,{name:t}),duplicate_reused:b(`knowledge.workspace.workspace.notices.duplicateReused`,{name:t}),conflict_pending:b(`knowledge.workspace.workspace.notices.conflictPending`,{name:t}),conflict_resolved:b(`knowledge.workspace.workspace.notices.conflictResolved`)};await v.refresh(),await Rt(),v.notify(n[e.status]??b(`knowledge.workspace.workspace.notices.scopeUpdated`))}function _n(e){if(e.profileAspect)return`${e.preferenceScope===`project`?b(`knowledge.workspace.workspace.source.projectPreference`):b(`knowledge.workspace.workspace.source.personalGlobal`)} · ${e.evidence.length?b(`common.counts.sources`,{count:e.evidence.length}):b(`knowledge.workspace.workspace.source.noSources`)}`;let t=e.assignments.at(0),n=e.evidence.find(({personal_project_id:e})=>e)?.personal_project_id,r=t?.project_id??n,i=St.value.find(({project_id:e})=>e===r)?.profile.name;return`${i?b(`knowledge.workspace.workspace.source.primaryProject`,{name:i}):b(`knowledge.workspace.workspace.source.personalGlobal`)} · ${b(`common.counts.sources`,{count:e.evidence.length})}`}function vn(e,t,n){return JSON.stringify([e,t,n])}function yn(e){return typeof e==`string`?e:``}function bn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):typeof e==`string`?[e]:[]}return(n,d)=>(l(),o(`section`,{class:f([`view graph-view vue-knowledge-view`,{"graph-canvas-active":K.value===`graph`,"is-project-overview":K.value===`overview`,"is-directory":K.value===`directory`}])},[u(`div`,xp,[u(`div`,Sp,[r(i(ee),{"model-value":K.value,class:`knowledge-mode-tabs`,"onUpdate:modelValue":d[0]||=e=>Ut(e)},{default:S(()=>[r(i(R),{"aria-label":i(b)(`knowledge.workspace.workspace.view.modeAria`)},{default:S(()=>[Se.value?(l(),t(i(z),{key:0,value:`overview`,"data-knowledge-mode":`overview`},{default:S(()=>[c(h(i(b)(`projects.overview.tab`)),1)]),_:1})):e(``,!0),r(i(z),{value:`directory`,"data-knowledge-mode":`directory`},{default:S(()=>[c(h(i(b)(`knowledge.workspace.workspace.view.directory`)),1)]),_:1}),r(i(z),{value:`graph`,"data-knowledge-mode":`graph`},{default:S(()=>[c(h(i(b)(`knowledge.workspace.workspace.view.graph`)),1)]),_:1})]),_:1},8,[`aria-label`])]),_:1},8,[`model-value`]),K.value===`overview`?e(``,!0):(l(),o(_,{key:0},[q.pendingLabel?(l(),t(B,{key:0,variant:`inline`,label:q.pendingLabel},null,8,[`label`])):q.failure&<.value?(l(),o(`span`,Cp,h(q.failure),1)):ne.value&&!de.value?.checking?(l(),t(B,{key:2,variant:`inline`,label:i(b)(`knowledge.workspace.workspace.search.searching`)},null,8,[`label`])):T.value&&O.value&&!i(F)&&(K.value!==`graph`||rt.value?.nodes.length)?(l(),t(B,{key:3,variant:`inline`,label:i(b)(`common.status.loadingKnowledge`)},null,8,[`label`])):K.value===`graph`&&!i(F)?(l(),o(`span`,wp,h(vt.value),1)):e(``,!0)],64))]),K.value===`overview`?(l(),o(_,{key:0},[At.value?(l(),t(Jf,{key:0,"space-id":W.value,project:At.value,"frequent-projects":tt.value,"can-publish":!!i(v).state?.capabilities?.publishProject,onEditProfile:cn,onPublish:d[1]||=e=>ce.value=At.value},null,8,[`space-id`,`project`,`frequent-projects`,`can-publish`])):!i(v).state&&i(v).runtimeStatus!==`error`||i(v).runtimeStatus===`loading`?(l(),t(B,{key:1,label:i(b)(`common.status.loadingConsole`)},null,8,[`label`])):i(v).state?(l(),o(`p`,Ep,h(i(b)(`knowledge.workspace.workspace.errors.projectUnknown`)),1)):(l(),o(`div`,Tp,[u(`p`,null,h(i(b)(`common.errors.loadFailed`)),1),r(i(P),{variant:`outline`,onClick:i(v).refresh},{default:S(()=>[c(h(i(b)(`common.actions.retry`)),1)]),_:1},8,[`onClick`])]))],64)):(l(),o(_,{key:1},[u(`div`,Dp,[r(fe,{"model-value":Dt.value,options:Ot.value,label:i(b)(`knowledge.workspace.workspace.view.graphSpace`),"control-id":`graph-space`,searchable:``,"onUpdate:modelValue":Gt},null,8,[`model-value`,`options`,`label`]),a.personalProjectsOnly?(l(),o(`label`,Op,[r(i(L),{modelValue:E.value,"onUpdate:modelValue":d[2]||=e=>E.value=e,"aria-label":i(b)(`knowledge.workspace.workspace.view.showTemporaryProjects`)},null,8,[`modelValue`,`aria-label`]),u(`span`,null,h(i(b)(`knowledge.workspace.workspace.view.showTemporaryProjects`)),1)])):e(``,!0),lt.value?(l(),o(`label`,kp,[r(i(L),{"model-value":q.enabled,"aria-label":i(b)(`projects.organize.toggle`),"onUpdate:modelValue":q.setEnabled},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`]),u(`span`,null,h(i(b)(`projects.organize.toggle`)),1)])):e(``,!0),a.personalProjectsOnly&&W.value?(l(),t(Yf,{key:2,"space-id":W.value},null,8,[`space-id`])):e(``,!0),G.value&&Tt.value.length?(l(),o(`details`,Ap,[u(`summary`,null,[c(h(i(b)(`knowledge.workspace.workspace.view.borrowProjects`))+` `,1),u(`span`,null,h(Ce.value.length?i(b)(`knowledge.workspace.workspace.view.selectedContexts`,{count:Ce.value.length}):i(b)(`knowledge.workspace.workspace.view.noneSelected`)),1),d[24]||=u(`i`,{class:`picker-chevron`,"aria-hidden":`true`},null,-1)]),u(`div`,jp,[u(`strong`,null,h(i(b)(`knowledge.workspace.workspace.view.currentContext`)),1),u(`p`,null,h(i(b)(`knowledge.workspace.workspace.view.contextCopy`)),1),u(`div`,Mp,[(l(!0),o(_,null,s(Tt.value,e=>(l(),o(`label`,{key:e.project_id,class:`personal-context-option`},[u(`input`,{type:`checkbox`,value:e.project_id,checked:Ce.value.includes(e.project_id),onChange:on},null,40,Np),u(`span`,null,[u(`strong`,null,h(e.profile.name),1),u(`small`,null,h(i(b)(`knowledge.workspace.workspace.view.currentScopeOnly`)),1)])]))),128))])])])):e(``,!0),u(`form`,{class:`search-form`,role:`search`,"aria-label":i(b)(`knowledge.workspace.workspace.search.aria`),onSubmit:D(Jt,[`prevent`])},[r(i(je),{type:`search`,placeholder:K.value===`directory`&&Fe.value===`materials`?i(b)(`knowledge.workspace.workspace.search.materialsPlaceholder`):i(b)(`knowledge.workspace.workspace.search.contentPlaceholder`),"aria-label":K.value===`directory`&&Fe.value===`materials`?i(b)(`knowledge.workspace.workspace.search.materialsPlaceholder`):i(b)(`knowledge.workspace.workspace.search.knowledgeAria`),autocomplete:`off`,enterkeyhint:`search`,"model-value":H.value,"onUpdate:modelValue":d[3]||=e=>qt(String(e))},null,8,[`placeholder`,`aria-label`,`model-value`])],40,Pp),u(`div`,Fp,[a.personalProjectsOnly&&At.value&&i(v).state?.capabilities?.publishProject?(l(),t(i(P),{key:0,size:`sm`,variant:`ghost`,onClick:d[4]||=e=>ce.value=At.value},{default:S(()=>[c(h(i(b)(`knowledge.workspace.workspace.view.publishProject`)),1)]),_:1})):e(``,!0),K.value===`graph`?(l(),o(`div`,{key:1,class:`graph-controls`,role:`group`,"aria-label":i(b)(`knowledge.workspace.workspace.view.graphControls`)},[r(i(P),{size:`sm`,variant:`ghost`,"aria-label":i(b)(`knowledge.workspace.workspace.view.zoomOut`),onClick:d[5]||=e=>V.value?.zoomOut()},{default:S(()=>[...d[25]||=[c(`−`,-1)]]),_:1},8,[`aria-label`]),r(i(P),{size:`sm`,variant:`ghost`,"aria-label":i(b)(`knowledge.workspace.workspace.view.zoomIn`),onClick:d[6]||=e=>V.value?.zoomIn()},{default:S(()=>[...d[26]||=[c(`+`,-1)]]),_:1},8,[`aria-label`]),r(i(P),{size:`sm`,variant:`ghost`,onClick:d[7]||=e=>V.value?.fit()},{default:S(()=>[c(h(i(b)(`knowledge.workspace.workspace.view.fit`)),1)]),_:1}),r(i(P),{size:`sm`,variant:`ghost`,onClick:d[8]||=e=>V.value?.reset()},{default:S(()=>[c(h(i(b)(`knowledge.workspace.workspace.view.reset`)),1)]),_:1})],8,Ip)):e(``,!0),r(i(P),{size:`icon-sm`,variant:`ghost`,"aria-label":i(b)(`common.actions.refresh`),title:i(b)(`common.actions.refresh`),onClick:Rt},{default:S(()=>[...d[27]||=[u(`span`,{"aria-hidden":`true`},`↻`,-1)]]),_:1},8,[`aria-label`,`title`])])]),K.value===`directory`&&Fe.value===`knowledge`?(l(),t(Ie,{key:0,class:`knowledge-filter-disclosure`,title:i(b)(`ui.filters`),open:We.value.type!==`all`||We.value.quadrant!==`all`||We.value.profile!==`all`||We.value.humanChange!==`all`},{default:S(()=>[u(`div`,Lp,[r(fe,{"model-value":We.value.type,options:Le.value,label:i(b)(`knowledge.workspace.workspace.view.contentType`),"control-id":`knowledge-type-filter`,"onUpdate:modelValue":d[9]||=e=>Kt(`type`,e)},null,8,[`model-value`,`options`,`label`]),r(fe,{"model-value":We.value.quadrant,options:Re.value,label:i(b)(`knowledge.workspace.workspace.view.discoveryQuadrant`),"control-id":`knowledge-quadrant-filter`,"onUpdate:modelValue":d[10]||=e=>Kt(`quadrant`,e)},null,8,[`model-value`,`options`,`label`]),r(fe,{"model-value":We.value.profile,options:ze.value,label:i(b)(`knowledge.workspace.workspace.view.classification`),"control-id":`knowledge-profile-filter`,"onUpdate:modelValue":d[11]||=e=>Kt(`profile`,e)},null,8,[`model-value`,`options`,`label`]),r(fe,{"model-value":We.value.humanChange,options:Be.value,label:i(b)(`knowledge.workspace.workspace.view.humanChangeStatus`),"control-id":`knowledge-human-change-filter`,"onUpdate:modelValue":d[12]||=e=>Kt(`human`,e)},null,8,[`model-value`,`options`,`label`])])]),_:1},8,[`title`,`open`])):e(``,!0),i(F)?(l(),t(B,{key:1,label:i(b)(`common.status.loadingKnowledge`)},null,8,[`label`])):N.value?(l(),o(`div`,Rp)):(l(),o(`div`,zp,[K.value===`directory`?(l(),t(nu,{key:0,"personal-projects-only":a.personalProjectsOnly,"directory-section":Fe.value,"knowledge-tab-count":bt.value,"material-tab-count":xt.value,"content-status":Ue.value,"current-item-count":Ye.value,"historical-item-count":Xe.value,"all-items":De.value,"visible-items":Je.value,"project-material-items":Oe.value,"visible-project-material-items":ke.value,"selected-item":I.value,"list-reset-key":qe.value,"source-label":_n,onChangeSection:Wt,onUpdateStatus:d[13]||=e=>Kt(`status`,e),onSelectItem:en},null,8,[`personal-projects-only`,`directory-section`,`knowledge-tab-count`,`material-tab-count`,`content-status`,`current-item-count`,`historical-item-count`,`all-items`,`visible-items`,`project-material-items`,`visible-project-material-items`,`selected-item`,`list-reset-key`])):(l(),o(`div`,{key:1,class:f([`graph-stage`,{"has-parent-projects":it.value.length}])},[r(ld,{parents:it.value,"active-project-name":At.value?.profile.name,"space-id":W.value},null,8,[`parents`,`active-project-name`,`space-id`]),u(`div`,{class:f([`graph-canvas-panel`,{"is-organizing":lt.value&&q.enabled}])},[de.value?(l(),t(vl,{key:0,discovery:de.value,"space-id":W.value},null,8,[`discovery`,`space-id`])):e(``,!0),r(ol,{"relation-types":_t.value},null,8,[`relation-types`]),rt.value?.nodes.length?(l(),t(el,{key:1,"project-visibility":a.personalProjectsOnly?`provided`:`formal`,ref_key:`graphCanvas`,ref:V,graph:rt.value,"selected-item":I.value,"organize-projects":lt.value&&q.enabled,onSelectNode:nn,onSelectEdge:rn,onProjectDrag:q.onProjectDrag},null,8,[`project-visibility`,`graph`,`selected-item`,`organize-projects`,`onProjectDrag`])):T.value?(l(),t(B,{key:2,variant:`compact`,label:i(b)(`common.status.loadingKnowledge`)},null,8,[`label`])):(l(),o(`div`,Bp,h(i(b)(`knowledge.workspace.workspace.view.noGraph`)),1)),q.dragging?(l(),t(hp,{key:4,tree:q.tree,project:q.dragging,hovered:q.hovered},null,8,[`tree`,`project`,`hovered`])):e(``,!0)],2)],2))])),K.value===`graph`?(l(),o(`p`,Vp,h(i(b)(`knowledge.workspace.workspace.view.graphHint`)),1)):e(``,!0),r(yt,{item:I.value,suspended:jt.value,graph:O.value,editable:kt.value,"current-project-id":G.value,"can-publish-project":i(v).state?.capabilities?.publishProject,"can-manage-project":!!Mt.value,mode:K.value,onConfirm:d[14]||=e=>re.value=e,onEdit:d[15]||=e=>ae.value=e,onCreateProject:d[16]||=e=>se.value=e,onOpenProject:sn,onPublishProject:hn,onOpenDirectory:d[17]||=e=>ln(e,`directory`),onOpenGraph:d[18]||=e=>ln(e,`graph`),onOpenReplacement:un,onManageProject:dn,onClose:tn},null,8,[`item`,`suspended`,`graph`,`editable`,`current-project-id`,`can-publish-project`,`can-manage-project`,`mode`])],64))]),r(od,{"editing-item":ae.value,"confirming-item":re.value,"project-action-item":se.value,"publishing-project":ce.value,"managing-project":le.value,"managing-material-type":ue.value,"personal-space-id":i(v).activePersonalSpace?.id??W.value,"editing-project-id":fn(ae.value),"confirming-project-id":fn(re.value),"current-project-id":G.value,projects:i(v).state?.personalProjects??[],"replacement-items":De.value,onCloseEdit:d[19]||=e=>ae.value=null,onCloseConfirm:d[20]||=e=>re.value=null,onCloseProjectAction:d[21]||=e=>se.value=null,onClosePublish:d[22]||=e=>ce.value=null,onCloseProfile:d[23]||=e=>le.value=null,onRefresh:Rt,onAccessDenied:Lt,onProjectSaved:gn,onProfileSaved:mn},null,8,[`editing-item`,`confirming-item`,`project-action-item`,`publishing-project`,`managing-project`,`managing-material-type`,`personal-space-id`,`editing-project-id`,`confirming-project-id`,`current-project-id`,`projects`,`replacement-items`])],2))}}),[[`__scopeId`,`data-v-879bebb3`]]);export{Hp as t};
|