@tickernelz/wardmote-ui 2026.1117.3 → 2026.1117.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/assets/{AdapterManager-C59AKY0f.js → AdapterManager-Dn6r8M3v.js} +1 -1
  2. package/dist/assets/{AdvancedToolsRoute-Bg4KowJU.js → AdvancedToolsRoute-tleFHTcB.js} +1 -1
  3. package/dist/assets/{AgentActionButtons-BBhJXLbY.js → AgentActionButtons-Dd6alMqq.js} +1 -1
  4. package/dist/assets/{AgentChat--rcr73Ls.js → AgentChat-BHjA0PWW.js} +1 -1
  5. package/dist/assets/{AgentChats-56CMlXmb.js → AgentChats-IEiJJtdg.js} +1 -1
  6. package/dist/assets/{AgentDetail-NfA1gamX.js → AgentDetail-D7joo2rc.js} +1 -1
  7. package/dist/assets/{AgentTodoCard-CGUyYht3.js → AgentTodoCard-Brh8SSVE.js} +1 -1
  8. package/dist/assets/{Agents-BjPLaL-p.js → Agents-hJqeQN6A.js} +3 -3
  9. package/dist/assets/{AppDetail-CwyYWsvw.js → AppDetail-B8ZBWzk8.js} +1 -1
  10. package/dist/assets/{AppNotConnected-DzDZR0-8.js → AppNotConnected-NVgEwEYJ.js} +1 -1
  11. package/dist/assets/{ApprovalCard-DyxP9tMM.js → ApprovalCard-DTIm5U9W.js} +1 -1
  12. package/dist/assets/{ApprovalDetail-Cxhx_U0d.js → ApprovalDetail-eGGSB0_Q.js} +1 -1
  13. package/dist/assets/{ApprovalPayload-C7jnoOLa.js → ApprovalPayload-m4AnE9rE.js} +1 -1
  14. package/dist/assets/{Approvals-CF4K0bD1.js → Approvals-Zxq0yDz0.js} +1 -1
  15. package/dist/assets/{AppsReview-Chv6Jms5.js → AppsReview-BlGCgr9w.js} +1 -1
  16. package/dist/assets/{ArtifactCard-CAlD_gkp.js → ArtifactCard-pKhZhgLB.js} +1 -1
  17. package/dist/assets/{Artifacts-47GmGXVx.js → Artifacts-BvvQffcj.js} +1 -1
  18. package/dist/assets/{AssistantConnection-BCrEgmJR.js → AssistantConnection-XWq_Gvxh.js} +1 -1
  19. package/dist/assets/{AttentionInteractionResolver-DUg8FwhJ.js → AttentionInteractionResolver-BmiwiFlx.js} +1 -1
  20. package/dist/assets/{AuditHub-DNmGrEzV.js → AuditHub-DCksM6Df.js} +1 -1
  21. package/dist/assets/{BoardChat-BenJSqr6.js → BoardChat-Bp_P56xH.js} +1 -1
  22. package/dist/assets/{BootstrapSetupUxLab-DO03bmwI.js → BootstrapSetupUxLab-CcxoPa2W.js} +1 -1
  23. package/dist/assets/{Browse-gMVDtSCz.js → Browse-DQJ6Gj80.js} +1 -1
  24. package/dist/assets/{BudgetPolicyCard-CbkwslmQ.js → BudgetPolicyCard-D-aZ30F6.js} +1 -1
  25. package/dist/assets/{CaseDetail-k79_F25A.js → CaseDetail-CYIIqjOz.js} +1 -1
  26. package/dist/assets/{Cases-C5IE_YuB.js → Cases-Bd2Ckeh9.js} +1 -1
  27. package/dist/assets/{ChatEndpointDetail-DPiCCvto.js → ChatEndpointDetail-DdbIST5k.js} +1 -1
  28. package/dist/assets/{ChatEndpointSetup-CTntfzjg.js → ChatEndpointSetup-BZGnK0W7.js} +1 -1
  29. package/dist/assets/{Companies-Cr0mZy2B.js → Companies-CQ_mUV6-.js} +1 -1
  30. package/dist/assets/{CompanyAccess-BQZD0MZf.js → CompanyAccess-CZAfSbtD.js} +1 -1
  31. package/dist/assets/{CompanyActivity-BhNtXl8c.js → CompanyActivity-CBwdj3In.js} +1 -1
  32. package/dist/assets/{CompanyConnections-BwCkXXZK.js → CompanyConnections-D7x76vZy.js} +1 -1
  33. package/dist/assets/{CompanyEnvironments-CyrghjsN.js → CompanyEnvironments-fJh3Mt-u.js} +1 -1
  34. package/dist/assets/{CompanyExport-BlQuIvDU.js → CompanyExport-B9FgX5uJ.js} +1 -1
  35. package/dist/assets/{CompanyImport-5M7yWHR-.js → CompanyImport-D3UlNq4i.js} +1 -1
  36. package/dist/assets/{CompanySettings-C6FNik3j.js → CompanySettings-D4-cqzil.js} +1 -1
  37. package/dist/assets/{CompanySettingsPluginPage-DPHNF4sp.js → CompanySettingsPluginPage-DQeyVIjI.js} +1 -1
  38. package/dist/assets/{CompanySkills-DsgjKlp7.js → CompanySkills-Doub2oUz.js} +1 -1
  39. package/dist/assets/{ConfigureBuiltInAgentModal-reyr1Tds.js → ConfigureBuiltInAgentModal-CHCXXZ3A.js} +1 -1
  40. package/dist/assets/{CopyableGatewayUrl-B4EYBk9t.js → CopyableGatewayUrl-DtEeRG6_.js} +1 -1
  41. package/dist/assets/{Dashboard-B0JjQSAg.js → Dashboard-b22e7HsQ.js} +1 -1
  42. package/dist/assets/{DecisionDateChips-BaRZkOU2.js → DecisionDateChips-BPqVvaQ7.js} +1 -1
  43. package/dist/assets/{DecisionQueuePage-DtzH_oQI.js → DecisionQueuePage-BxiBix3d.js} +1 -1
  44. package/dist/assets/{DesignGuide-CXHLyL_C.js → DesignGuide-5uuu_1IQ.js} +1 -1
  45. package/dist/assets/{EmailEndpointSetup-hb_Hewoa.js → EmailEndpointSetup-FXzIFk9y.js} +1 -1
  46. package/dist/assets/{ExecutionWorkspaceDetail-BxA_kWKs.js → ExecutionWorkspaceDetail-2AFXb_-1.js} +1 -1
  47. package/dist/assets/{GatewayDetail-CUcpw4Hj.js → GatewayDetail-BRId71b2.js} +1 -1
  48. package/dist/assets/{GatewaysList-Ad1dZuwC.js → GatewaysList-BgwbsqYZ.js} +1 -1
  49. package/dist/assets/{GoalDetail-C-uH9eNu.js → GoalDetail-C8NwbVu0.js} +1 -1
  50. package/dist/assets/{GoalTree-BZUt4xZ3.js → GoalTree-BF1J-Wd-.js} +1 -1
  51. package/dist/assets/{Goals-UrfBAjOT.js → Goals-BWNWwYmd.js} +1 -1
  52. package/dist/assets/{ImageGalleryModal-D3SH_FYj.js → ImageGalleryModal-B_H2699L.js} +1 -1
  53. package/dist/assets/{Inbox-BzkFmAxU.js → Inbox-cm1ulHkR.js} +1 -1
  54. package/dist/assets/{InstanceAdvanced-DYZ50o97.js → InstanceAdvanced-DHBs71Ii.js} +1 -1
  55. package/dist/assets/{InviteLanding-Bqp1ulQV.js → InviteLanding-DTNcs2-Z.js} +1 -1
  56. package/dist/assets/{IssueChatLongThreadPerf-BJ_Hr2PT.js → IssueChatLongThreadPerf-Bw21NogO.js} +1 -1
  57. package/dist/assets/{IssueChatThread-qDc-9yA9.js → IssueChatThread-aO8MN-x0.js} +1 -1
  58. package/dist/assets/{IssueDetail-C0hCFL-i.js → IssueDetail-BTGIxWc1.js} +1 -1
  59. package/dist/assets/{IssueOutputSection-D7QbMiqq.js → IssueOutputSection-EDMuhye2.js} +1 -1
  60. package/dist/assets/{IssueRecoveryActionCard-DeJbfGm1.js → IssueRecoveryActionCard-DgG9K5yf.js} +1 -1
  61. package/dist/assets/{IssueReferencePill-BTH42QmE.js → IssueReferencePill-eeVd9x72.js} +1 -1
  62. package/dist/assets/{IssueThreadInteractionCard-D9QAYhuJ.js → IssueThreadInteractionCard-C8Bu2LL1.js} +1 -1
  63. package/dist/assets/{Issues-DtYFX9i_.js → Issues-B4mFVMjr.js} +1 -1
  64. package/dist/assets/{LiveNowTodoLine-IsmhMx5O.js → LiveNowTodoLine-BaBvpVxD.js} +1 -1
  65. package/dist/assets/{ManagedAiConnectionDetails-BrX9Q9t2.js → ManagedAiConnectionDetails-CFL872M2.js} +1 -1
  66. package/dist/assets/{McpConnect-BYYMfbhs.js → McpConnect-Dqx0rBQk.js} +1 -1
  67. package/dist/assets/{MembershipAction-Esk0pndF.js → MembershipAction-Cn7I3sEB.js} +1 -1
  68. package/dist/assets/{ModelsAndProviders-C7VZHvPR.js → ModelsAndProviders-Bzd4NZcX.js} +1 -1
  69. package/dist/assets/{NewAgent-BzZI-FBE.js → NewAgent-wSr42KiN.js} +1 -1
  70. package/dist/assets/{PipelineSettings-BgfMR73P.js → PipelineSettings-CoFzH1-c.js} +1 -1
  71. package/dist/assets/{Pipelines-DAuqtVqc.js → Pipelines-CBrVkNVf.js} +1 -1
  72. package/dist/assets/{PixelsOffice-CaQYQilp.js → PixelsOffice-D1vo-0wW.js} +1 -1
  73. package/dist/assets/{PluginPage-C-W3lTd9.js → PluginPage-BtaYd9AD.js} +1 -1
  74. package/dist/assets/{PluginSettings-D365WG22.js → PluginSettings-Hcx5yZJk.js} +1 -1
  75. package/dist/assets/{ProfileDetailRoute-YzeVN0Ko.js → ProfileDetailRoute-nVOQkxal.js} +1 -1
  76. package/dist/assets/{ProfileSettings-BLh9EdSK.js → ProfileSettings-D_ZrTEBL.js} +1 -1
  77. package/dist/assets/{ProfileWizardRoute-DvOWuvrG.js → ProfileWizardRoute-Bk8tx6UC.js} +1 -1
  78. package/dist/assets/{ProjectDetail-OirlXEA4.js → ProjectDetail-BCjyXt2s.js} +1 -1
  79. package/dist/assets/{ProjectWorkspaceDetail-C9_liq4q.js → ProjectWorkspaceDetail-BcyMO75Z.js} +1 -1
  80. package/dist/assets/{ProjectWorkspacesContent-DRAIVofy.js → ProjectWorkspacesContent-B0vZEtt2.js} +1 -1
  81. package/dist/assets/{Projects-B6UgAQ3Z.js → Projects-Ck08UWc-.js} +1 -1
  82. package/dist/assets/{PublicIssueSharePage-Cg0GqSVM.js → PublicIssueSharePage-D28zKQ4N.js} +1 -1
  83. package/dist/assets/{ReviewQueueCard-MNEVuxSA.js → ReviewQueueCard-CQJtenHf.js} +1 -1
  84. package/dist/assets/{RichWorkProductCard-D4Qq1gRh.js → RichWorkProductCard-DvhYE1cH.js} +1 -1
  85. package/dist/assets/{RoutineDetail-DPzql29w.js → RoutineDetail-CM_C8njY.js} +1 -1
  86. package/dist/assets/{RoutineRunVariablesDialog-C8OHcazq.js → RoutineRunVariablesDialog-BKrZPW5U.js} +1 -1
  87. package/dist/assets/{Routines-pnhQk9RN.js → Routines-BB5zkfap.js} +1 -1
  88. package/dist/assets/{ScrollToBottom-C_k4p-hC.js → ScrollToBottom-CT7fjpoT.js} +1 -1
  89. package/dist/assets/{Search-DjpKZIsB.js → Search-BgSHY-QB.js} +1 -1
  90. package/dist/assets/{Secrets-BOZydXaY.js → Secrets-zu14ajI8.js} +1 -1
  91. package/dist/assets/{SkillSourceTree-Cuv3EWpo.js → SkillSourceTree-Cm9N2xW8.js} +1 -1
  92. package/dist/assets/{SkillSources-CYYp9Mds.js → SkillSources-BG_dPDP8.js} +1 -1
  93. package/dist/assets/{SkillStudio-Dl28fokd.js → SkillStudio-D4GvrYEe.js} +1 -1
  94. package/dist/assets/{SourceTrustBadge-BYpC1Kw9.js → SourceTrustBadge-BUmQZ6VD.js} +1 -1
  95. package/dist/assets/{StatusCards-Bqkb18QJ.js → StatusCards-BQYp9_rr.js} +1 -1
  96. package/dist/assets/{SummarySlotCard-DlwG6iRT.js → SummarySlotCard-_MpN7TiK.js} +1 -1
  97. package/dist/assets/{TaskChatLab-vnFP7gcJ.js → TaskChatLab-BtodeACE.js} +1 -1
  98. package/dist/assets/{TaskChatMarker-KUR-n-7D.js → TaskChatMarker-LLCNK3e-.js} +1 -1
  99. package/dist/assets/{TaskChatProtocolCard-CuyApwWM.js → TaskChatProtocolCard-CdeGEtdY.js} +1 -1
  100. package/dist/assets/{TaskChatThreadView-B2LR9geW.js → TaskChatThreadView-BxvoJvZk.js} +1 -1
  101. package/dist/assets/{TaskTreeControls-CRzAjVlt.js → TaskTreeControls-Cqhs5wQ9.js} +1 -1
  102. package/dist/assets/{Terminal-YAhWrMv9.js → Terminal-D_PTBqFk.js} +1 -1
  103. package/dist/assets/{TerminalView-7diHxQOx.js → TerminalView-Du4ncjRe.js} +1 -1
  104. package/dist/assets/{TrustPresetSection-DCiCKRh0.js → TrustPresetSection-Dkv__1Qr.js} +1 -1
  105. package/dist/assets/{UserProfile-CEpSKMzS.js → UserProfile-6tR8KBkI.js} +1 -1
  106. package/dist/assets/{WhatNeedsMe-D0yh5L5H.js → WhatNeedsMe-CokwG-qz.js} +1 -1
  107. package/dist/assets/{Workspaces-uDkUYVN3.js → Workspaces-z0KIx4hI.js} +1 -1
  108. package/dist/assets/{connection-owner-rjoh3jce.js → connection-owner-Bhzm673Y.js} +1 -1
  109. package/dist/assets/{index-BcwxLap4.js → index-b1wwaMjV.js} +3 -3
  110. package/dist/assets/{issue-properties-D64PIhST.js → issue-properties-DxJFyYY9.js} +1 -1
  111. package/dist/assets/{issue-workspace-selection-BY0sBaN6.js → issue-workspace-selection-CyOTHbLN.js} +1 -1
  112. package/dist/assets/{pipeline-stage-presentation-DDdch-G7.js → pipeline-stage-presentation-COuyOfPG.js} +1 -1
  113. package/dist/assets/{shared-BjSrBoPt.js → shared-c4dzLU_x.js} +1 -1
  114. package/dist/assets/{transcript-adapter-C1RGcJFu.js → transcript-adapter-D3tQN7Tw.js} +1 -1
  115. package/dist/assets/{useSummaryDraftStream-DOcsGLEm.js → useSummaryDraftStream-DLjyfaIh.js} +1 -1
  116. package/dist/index.html +1 -1
  117. package/dist/sw.js +1 -1
  118. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prod-COP_vZWu.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/TaskChatLab-vnFP7gcJ.js","assets/createLucideIcon-CgrPXnTY.js","assets/check-Bis3vECb.js","assets/circle-DCDVf2v0.js","assets/copy-C1cfcpxY.js","assets/button-DI4w5WP7.js","assets/dist-Cfwg8Fpq.js","assets/dist-BdDa0b16.js","assets/minus-BttANimQ.js","assets/pause-B6AkvDer.js","assets/play-Czm7OCYh.js","assets/plus-CwNlqadt.js","assets/rotate-ccw-DpzLJhXT.js","assets/TaskChatThreadView-B2LR9geW.js","assets/star-eem0qj3E.js","assets/preload-helper-CceJXRIF.js","assets/ArtifactCard-CAlD_gkp.js","assets/router-BKzUF9uf.js","assets/queryKeys-BzT8CD34.js","assets/CompanyContext-fQCNWI_f.js","assets/companies-query-BEdFiAhG.js","assets/popover-CWlBonqy.js","assets/dist-DW0z82oc.js","assets/dist-DYoIyA63.js","assets/dist-C48HB-LT.js","assets/es2015-I559Yimy.js","assets/boxes-DVB7wdRh.js","assets/circle-dot-EfQ00xK3.js","assets/package-G5arH6JJ.js","assets/search-CgZSuGC8.js","assets/shield-DC6LuDUy.js","assets/terminal-i6UlT3R6.js","assets/external-link-BIcMNNSN.js","assets/attachment-icon-_1iz_saB.js","assets/use-copy-action-DFzauB4H.js","assets/ToastContext-DyVJ6bCh.js","assets/clipboard-CTLKYvRL.js","assets/arrow-down-C_oYEUXL.js","assets/chevron-down-nRcQ7bok.js","assets/chevron-right-BP8JjEC_.js","assets/MarkdownBody-D7qCQaU_.js","assets/mention-chips-COg-185l.js","assets/agent-avatar-url-BSxCmIBZ.js","assets/color-contrast-BHHcEMtO.js","assets/archive-CvT6i844.js","assets/circle-question-mark-CasEGiDp.js","assets/circle-x-oLE71NY3.js","assets/clock-D2UFngg7.js","assets/file-code-corner-CwcL9g2p.js","assets/folder-open-Dkshp3J4.js","assets/git-pull-request-DXoACxvx.js","assets/key-round-CGxQxRtN.js","assets/octagon-alert-BGGMATMK.js","assets/agents-B8n-p0aX.js","assets/github-icon-Cf0axVvi.js","assets/usePrefersReducedMotion-BLkUT2m6.js","assets/ThemeContext-Ca30E6O4.js","assets/StatusIcon-Bx4H7RuA.js","assets/task-chat-attachments-DNPQ-jOG.js","assets/file-text-CsPKrMTp.js","assets/file-CcVMTQhg.js","assets/TaskChatMarker-KUR-n-7D.js","assets/book-open-i_DxEUXC.js","assets/bot-kSfD9MPZ.js","assets/flag-i_D610oD.js","assets/info-Clx4FKz9.js","assets/octagon-x-ZKE_ZOe_.js","assets/TaskChatProtocolCard-CuyApwWM.js","assets/RichWorkProductCard-D4Qq1gRh.js","assets/maximize-2-c8H5WcEB.js","assets/server-NjSlblAR.js","assets/ImageGalleryModal-D3SH_FYj.js","assets/dist-CEXsZ2vP.js","assets/chevron-left-DnUVccc_.js","assets/x-6E1yeU3Q.js","assets/issue-output-BM-lLts2.js","assets/QuestionForm-DF6R7lYE.js","assets/MarkdownEditor-ubJimjUH.js","assets/dist-BJ09fDjD.js","assets/dist-Kk1Xaco5.js","assets/dist--9cFpXne.js","assets/dist-9zjsMxaY.js","assets/dist-DMGv3m4L.js","assets/dist-JmBbJxI1.js","assets/calendar-clock-CXtB0BA2.js","assets/user-D5V640s5.js","assets/AgentAvatar-BZiiDlCN.js","assets/Identity-8eG_HXAH.js","assets/avatar-qO_h93F8.js","assets/routines-DteAuK7S.js","assets/activity-CudcEDwO.js","assets/dist-BhxPxuMy.js","assets/message-square-plus-BQNp2QTu.js","assets/input-BBNGmECW.js","assets/TaskChatComposerTakeoverContext-C68QVO36.js","assets/shield-check-RPyaLAc-.js","assets/triangle-alert-CnHMpmva.js","assets/dialog-CeH7rDcv.js","assets/textarea-CTx68BDs.js","assets/square-CDo6rOf8.js","assets/users-CEZ1U5q9.js","assets/presentation-mode-ZjtUUsSS.js","assets/list-todo-DfkI9JDS.js","assets/shield-question-mark-Dl8dxzUU.js","assets/shield-x-DaFG-JUd.js","assets/system-notice-comment-DPCHQ4-Y.js","assets/label-B707hSFt.js","assets/heartbeats-D96c9g2n.js","assets/email-hX48MODm.js","assets/transcript-adapter-C1RGcJFu.js","assets/AgentBubbleActionRow-Dqrx638X.js","assets/dropdown-menu-rUbU8QKw.js","assets/dist-Bn32UOVm.js","assets/ellipsis-DyXbAp4P.js","assets/thumbs-down-BVZskfHA.js","assets/thumbs-up-Cqj30fzj.js","assets/tooltip-CW50mEoC.js","assets/segmented-tuNVx49H.js","assets/Cases-C5IE_YuB.js","assets/checkbox-Cf2_HXDG.js","assets/arrow-up-down-Ci6AcwB0.js","assets/columns-3-CsveFAYd.js","assets/funnel-BoiZeTWw.js","assets/badge-jeXr866I.js","assets/projects-l3kQxnTp.js","assets/BreadcrumbContext-DNbB7zWn.js","assets/cases-lkyebfpY.js","assets/CaseIdentifierKey-CIGzqAfo.js","assets/FilterBar-CIPYvHzR.js","assets/CaseDetail-k79_F25A.js","assets/IssueDocumentAnnotations-DjcRXcEw.js","assets/sheet-D5sUsyfT.js","assets/tabs-CjHzZxtD.js","assets/ellipsis-vertical-DzWImTnI.js","assets/issue-properties-D64PIhST.js","assets/issue-attribution-DfN_3u2W.js","assets/WorkspaceRuntimeControls-Cp5E1FME.js","assets/activity-BwGRpduS.js","assets/useManagedSandboxOnly-KE5BJrr7.js","assets/instanceSettings-D1nNVWU0.js","assets/archive-restore-tP0pyaei.js","assets/arrow-right-W0iJ_-Zs.js","assets/arrow-up-right-CFNgVoQj.js","assets/repeat-DzPORJjX.js","assets/inboxArchiveCache-CxaLM1R8.js","assets/access-DhB95qNC.js","assets/assignees-DkQNbPzi.js","assets/AgentIdentity-DBHRFgMM.js","assets/recent-selections-BnN_nb6Y.js","assets/recent-assignees-DmalYaLf.js","assets/InlineEntitySelector-BboofK18.js","assets/useMobileEntityPickerViewportStyle-BG2vZMIz.js","assets/issue-blockers-t3wlvg4M.js","assets/eye-D8HiVtuU.js","assets/refresh-cw-CfzWP9se.js","assets/IssueReferencePill-BTH42QmE.js","assets/query-placeholder-data-Bg4z2kcq.js","assets/SourceTrustBadge-BYpC1Kw9.js","assets/badge-check-BNLpGDnd.js","assets/circle-alert-C7T1cdKm.js","assets/shield-alert-BAXWoBTh.js","assets/InlineBanner-DYx7A02D.js","assets/runRetryState-p_i4Mh7u.js","assets/review-policy-B1PowuVV.js","assets/user-check-DcbSRa0r.js","assets/user-minus-DSZK8_9n.js","assets/separator-6cvFqhvW.js","assets/issue-workspace-selection-BY0sBaN6.js","assets/list-filter-BjVYqW16.js","assets/trash-QxFF084e.js","assets/select-DNiRU1d9.js","assets/chevron-up-C1TOE3pP.js","assets/chip-yHjfSD46.js","assets/card-BVZvs7aX.js","assets/useAutosaveIndicator-D3owckCV.js","assets/FoldCurtain-H4DNjYLl.js","assets/line-diff-DAcZgvm2.js","assets/DocumentFrameHeader-B8A6eaJb.js","assets/Dashboard-B0JjQSAg.js","assets/flask-conical-BxspRG7d.js","assets/layout-dashboard-CGcwI_3-.js","assets/MootMark-BZOhYsK8.js","assets/useSharedPolling-CFeiZe2t.js","assets/slots-DZ1hj5sG.js","assets/SidebarContext-bEtg0ItG.js","assets/plugins-C7Akvi81.js","assets/instance-settings-QXUWVmQs.js","assets/MetricCard-DlcBTKQs.js","assets/smoke-lab-matrix-Cjauo09x.js","assets/Companies-Cr0mZy2B.js","assets/Agents-BjPLaL-p.js","assets/useQueries-K6OPYBvC.js","assets/network-D_6qRf8m.js","assets/upload-Dk7oXJof.js","assets/useAgentChatEnabled-DMbd4JDE.js","assets/useHiddenSettings-D0HL2tkE.js","assets/health-Cn-5LIwb.js","assets/model-picker-fields-D_I_l2UI.js","assets/arrow-up-BMN1ZnS1.js","assets/adapter-display-registry-9qBBJi9B.js","assets/environments-xuhuvnTt.js","assets/managed-sandbox-environment-B8DewKvK.js","assets/AgentRoleEditor-DnibPmmw.js","assets/alert-dialog-DNbnZgRz.js","assets/EntityRow-B24YmFE7.js","assets/AgentDetail-NfA1gamX.js","assets/useInfiniteQuery-DTEIZ1gz.js","assets/ConnectionSetupFlow-g6asOGFg.js","assets/connection-identity-ch7QDvun.js","assets/queryClient-CojHFSot.js","assets/collapsible-D_rwONtV.js","assets/PathInstructionsModal-BJAqF7vQ.js","assets/arrow-left-CnGEiANj.js","assets/SearchableSelect-BbuRtdzg.js","assets/command-BnJHDVFJ.js","assets/searchable-select-fvMNMcqm.js","assets/environment-variables-editor-D6Ylcd74.js","assets/eye-off-DTXvEIMp.js","assets/save-Blub8a14.js","assets/user-round-B87hENhM.js","assets/model-DidtFy-U.js","assets/proposal-review-D9ye_2Px.js","assets/server-cog-cefxr54v.js","assets/secrets-D17QEm13.js","assets/inbox-BbL3s2C7.js","assets/link-2-Cn4f4xsG.js","assets/SetupWizard-92wVRG6Y.js","assets/skeleton-BAAoD7cz.js","assets/tools-MhVvhrz_.js","assets/AppLogo-BLq8BpKi.js","assets/assets-BOhIBphq.js","assets/toggle-switch-Dj5GORxn.js","assets/AgentMultiSelect-BlUaNdZZ.js","assets/radio-card-DCobJXTD.js","assets/JsonSchemaForm-Dkh3zdL9.js","assets/schema-config-fields-B8ha5h4A.js","assets/agent-config-primitives-BJlDiwaH.js","assets/AgentSetupPrompt-CaafK5_w.js","assets/dynamic-loader-ehitOaJV.js","assets/adapters-D3NHXckp.js","assets/use-adapter-capabilities-BNfGiTEP.js","assets/AgentCharacter-DAAMv7-c.js","assets/app-connect-policy-DqQf5knn.js","assets/responsible-user-denial-Dyl0BwU5.js","assets/ScrollToBottom-C_k4p-hC.js","assets/scroll-area-Ci3PubY2.js","assets/braces-CpXTT0w9.js","assets/chatEndpoints-Bj-keCuw.js","assets/ConfigureBuiltInAgentModal-reyr1Tds.js","assets/run-log-chunks-ZnzOvrXs.js","assets/IssueRecoveryActionCard-DeJbfGm1.js","assets/execution-projection-BGI5f3kX.js","assets/workspace-restore-BIbDC_O8.js","assets/model-fallback-CwykjJWn.js","assets/ResponsibleUserDenialNotice-dXyOLtYP.js","assets/user-x-CZ1ImNac.js","assets/omp-settings-model-B06pdqQR.js","assets/ChoiceControls-CzMMk2Iy.js","assets/SkillCardIcon-Byzb3JuD.js","assets/CopyText-BbOm2I6t.js","assets/MembershipAction-Esk0pndF.js","assets/log-in-C4giPkVk.js","assets/AgentActionButtons-BBhJXLbY.js","assets/TrustPresetSection-DCiCKRh0.js","assets/EnforcementBanner-qtVCLyJo.js","assets/shared-BjSrBoPt.js","assets/OmpAllSettings-DTJLATQL.js","assets/Projects-B6UgAQ3Z.js","assets/ProjectDetail-OirlXEA4.js","assets/link-0uKX-OmT.js","assets/BudgetPolicyCard-CbkwslmQ.js","assets/AccessSelectIdentity-C-iVX_EX.js","assets/InlineEditor-BJTE1pyF.js","assets/SummarySlotCard-DlwG6iRT.js","assets/useSummaryDraftStream-DOcsGLEm.js","assets/budgets-C2LtVWph.js","assets/ProjectWorkspacesContent-DRAIVofy.js","assets/ProjectWorkspaceDetail-C9_liq4q.js","assets/MissingPluginTabPlaceholder-l1R-Q4nh.js","assets/Workspaces-uDkUYVN3.js","assets/Issues-DtYFX9i_.js","assets/Inbox-BzkFmAxU.js","assets/issue-filters-Ce8v1l6U.js","assets/ApprovalPayload-C7jnoOLa.js","assets/scroll-text-DfBz82Kz.js","assets/useSecondTick-BRYNTPNI.js","assets/LiveNowTodoLine-IsmhMx5O.js","assets/AgentTodoCard-CGUyYht3.js","assets/Search-DjpKZIsB.js","assets/file-question-mark-BCVjQ2mM.js","assets/IssueDetail-C0hCFL-i.js","assets/IssueWriteDenialNotice-Bf0ZFSBV.js","assets/TerminalView-7diHxQOx.js","assets/clipboard-paste-B7AvxL_k.js","assets/rotate-cw-D1cKBtZK.js","assets/terminal-font-B-qtwS34.js","assets/cloud-DX1fkQ6i.js","assets/file-search-Ccb88q3t.js","assets/folder-search-B_Hz17IO.js","assets/IssueThreadInteractionCard-D9QAYhuJ.js","assets/plug-UFf0xCI3.js","assets/interaction-card-visibility-CUHRz7le.js","assets/interaction-audience-B74UGNaN.js","assets/AgentMailCredentialField-DNclWIul.js","assets/radio-BqjASC1E.js","assets/settings-DuRZr7gk.js","assets/browser-use-BwBUHG71.js","assets/TaskTreeControls-CRzAjVlt.js","assets/code-xml-CZhhm_-P.js","assets/IssueChatThread-qDc-9yA9.js","assets/ComposerAddMenu-BPPkbm0o.js","assets/CommentAttributionChip-BdllZVtJ.js","assets/issueActiveRun-s6f-GUHq.js","assets/ApprovalCard-DyxP9tMM.js","assets/issue-share-W3K_cYZY.js","assets/artifacts-4t_LL-lA.js","assets/activity-format-CYYHRbLo.js","assets/AgentChats-56CMlXmb.js","assets/recent-agent-chats-BUso0Smv.js","assets/AgentChat--rcr73Ls.js","assets/agentChats-C8o51WiF.js","assets/IssueChatLongThreadPerf-BJ_Hr2PT.js","assets/Routines-pnhQk9RN.js","assets/audit-navigation-IalprBz0.js","assets/FolderControls-DI7QVvPv.js","assets/RoutineRunVariablesDialog-C8OHcazq.js","assets/Pipelines-DAuqtVqc.js","assets/pipeline-stage-presentation-DDdch-G7.js","assets/folder-git-2-igHQBSOf.js","assets/pipelines-0Lb8D7gt.js","assets/PipelineSettings-BgfMR73P.js","assets/RoutineVariablesEditor-CHogduM9.js","assets/StatusCards-Bqkb18QJ.js","assets/wand-sparkles-CONrztQy.js","assets/PixelsOffice-CaQYQilp.js","assets/coins-DeD2KB8A.js","assets/AttentionInteractionResolver-DUg8FwhJ.js","assets/RoutineDetail-DPzql29w.js","assets/pen-line-CKsWWDy2.js","assets/webhook-nurKUWEn.js","assets/WebhookUrlWarning-CbkWHsPb.js","assets/RoutineActivityRow-D16b-qFh.js","assets/UserProfile-CEpSKMzS.js","assets/ExecutionWorkspaceDetail-BxA_kWKs.js","assets/Goals-UrfBAjOT.js","assets/GoalTree-BZUt4xZ3.js","assets/Artifacts-47GmGXVx.js","assets/GoalDetail-C-uH9eNu.js","assets/Approvals-CF4K0bD1.js","assets/ApprovalDetail-Cxhx_U0d.js","assets/CompanyActivity-BhNtXl8c.js","assets/AuditHub-DNmGrEzV.js","assets/arrow-down-left-B8lHKNrs.js","assets/decision-models-DBtkxtYF.js","assets/fast-responses-B5vx8axv.js","assets/QuotaBar-Ch_rM0X1.js","assets/WhatNeedsMe-D0yh5L5H.js","assets/DecisionDateChips-BaRZkOU2.js","assets/sun-2LJX7Tad.js","assets/DecisionQueuePage-DtzH_oQI.js","assets/BoardChat-BenJSqr6.js","assets/circle-slash-DP3-64k6.js","assets/send-DfQbMfo9.js","assets/CompanySettings-C6FNik3j.js","assets/DecisionModelSettings-HEZJ0E6n.js","assets/CompanyConnections-BwCkXXZK.js","assets/CompanyEnvironments-CyrghjsN.js","assets/BootstrapSetupUxLab-DO03bmwI.js","assets/ResponsibleUserDenialUxLab-DGWo-GoD.js","assets/CrossIssueCollaborationUxLab-D2bB9GTl.js","assets/CompanySettingsPluginPage-DPHNF4sp.js","assets/CompanyAccess-BQZD0MZf.js","assets/AdvancedToolsRoute-Bg4KowJU.js","assets/power-CJfOYd7k.js","assets/profile-summary-BwdvqPGE.js","assets/useProfilesData-Bs6IpD6I.js","assets/ProfileWizardRoute-DvOWuvrG.js","assets/ToolsAdminGate-C5dQpL4C.js","assets/ProfileDetailRoute-YzeVN0Ko.js","assets/Browse-gMVDtSCz.js","assets/ManagedAiConnectionDetails-BrX9Q9t2.js","assets/retired-composio-DrxhEOpx.js","assets/connection-owner-rjoh3jce.js","assets/AssistantConnection-BCrEgmJR.js","assets/AppsConnect-D7l2xnv-.js","assets/skill-source-connect-return-C3vV7DQP.js","assets/ChatEndpointSetup-CTntfzjg.js","assets/EmailEndpointSetup-hb_Hewoa.js","assets/OpenwaGatewayManager-BQpxxJOa.js","assets/ChatEndpointDetail-DPiCCvto.js","assets/EmailConnectionAccess-BcI7_br0.js","assets/ChatIdentityConfirm-Dc4AnYX8.js","assets/AppsReview-Chv6Jms5.js","assets/ReviewQueueCard-MNEVuxSA.js","assets/AppDetail-CwyYWsvw.js","assets/AppNotConnected-DzDZR0-8.js","assets/GatewaysList-Ad1dZuwC.js","assets/CopyableGatewayUrl-B4EYBk9t.js","assets/GatewayDetail-CUcpw4Hj.js","assets/CompanySkills-DsgjKlp7.js","assets/SkillBinaryFile-N7sK2ZTh.js","assets/company-skill-routes-D5LJ1l8M.js","assets/SkillSources-CYYp9Mds.js","assets/SkillSourceTree-Cuv3EWpo.js","assets/SkillStudio-Dl28fokd.js","assets/AgentIconPicker-BJerBmcL.js","assets/resizable-panels-DkafPiQi.js","assets/IssueOutputSection-D7QbMiqq.js","assets/Secrets-BOZydXaY.js","assets/CompanyImport-5M7yWHR-.js","assets/agent-order-BE-pAWdx.js","assets/sidebarPreferences-CIMvMX-W.js","assets/portable-files-CloN_vbk.js","assets/DesignGuide-CXHLyL_C.js","assets/RepositoryEditor-BuV4JRgV.js","assets/ThemeToggle-BzQNYD1J.js","assets/InstanceFeatures-C1eqcxDI.js","assets/useInstanceFeatureSettings-1h06E3Mh.js","assets/AgentDefaults-C0WFwQky.js","assets/ModelsAndProviders-C7VZHvPR.js","assets/InstanceAdvanced-DYZ50o97.js","assets/InstanceAccess-D4ZbGCeK.js","assets/ProfileSettings-BLh9EdSK.js","assets/PluginManager-DkADWuR8.js","assets/PluginSettings-D365WG22.js","assets/AdapterManager-C59AKY0f.js","assets/PluginPage-C-W3lTd9.js","assets/NewAgent-BzZI-FBE.js","assets/Auth-D0lGuVnd.js","assets/invite-memory-CHGcQdLs.js","assets/BoardClaim-CbYY66Qd.js","assets/McpConnect-BYYMfbhs.js","assets/CliAuth-CatEsBxW.js","assets/InviteLanding-Bqp1ulQV.js","assets/PublicIssueSharePage-Cg0GqSVM.js","assets/JoinRequestQueue-DyPP4DL2.js","assets/CompanyExport-BlQuIvDU.js","assets/Terminal-YAhWrMv9.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prod-COP_vZWu.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/TaskChatLab-BtodeACE.js","assets/createLucideIcon-CgrPXnTY.js","assets/check-Bis3vECb.js","assets/circle-DCDVf2v0.js","assets/copy-C1cfcpxY.js","assets/button-DI4w5WP7.js","assets/dist-Cfwg8Fpq.js","assets/dist-BdDa0b16.js","assets/minus-BttANimQ.js","assets/pause-B6AkvDer.js","assets/play-Czm7OCYh.js","assets/plus-CwNlqadt.js","assets/rotate-ccw-DpzLJhXT.js","assets/TaskChatThreadView-BxvoJvZk.js","assets/star-eem0qj3E.js","assets/preload-helper-CceJXRIF.js","assets/ArtifactCard-pKhZhgLB.js","assets/router-BKzUF9uf.js","assets/queryKeys-BzT8CD34.js","assets/CompanyContext-fQCNWI_f.js","assets/companies-query-BEdFiAhG.js","assets/popover-CWlBonqy.js","assets/dist-DW0z82oc.js","assets/dist-DYoIyA63.js","assets/dist-C48HB-LT.js","assets/es2015-I559Yimy.js","assets/boxes-DVB7wdRh.js","assets/circle-dot-EfQ00xK3.js","assets/package-G5arH6JJ.js","assets/search-CgZSuGC8.js","assets/shield-DC6LuDUy.js","assets/terminal-i6UlT3R6.js","assets/external-link-BIcMNNSN.js","assets/attachment-icon-_1iz_saB.js","assets/use-copy-action-DFzauB4H.js","assets/ToastContext-DyVJ6bCh.js","assets/clipboard-CTLKYvRL.js","assets/arrow-down-C_oYEUXL.js","assets/chevron-down-nRcQ7bok.js","assets/chevron-right-BP8JjEC_.js","assets/MarkdownBody-D7qCQaU_.js","assets/mention-chips-COg-185l.js","assets/agent-avatar-url-BSxCmIBZ.js","assets/color-contrast-BHHcEMtO.js","assets/archive-CvT6i844.js","assets/circle-question-mark-CasEGiDp.js","assets/circle-x-oLE71NY3.js","assets/clock-D2UFngg7.js","assets/file-code-corner-CwcL9g2p.js","assets/folder-open-Dkshp3J4.js","assets/git-pull-request-DXoACxvx.js","assets/key-round-CGxQxRtN.js","assets/octagon-alert-BGGMATMK.js","assets/agents-B8n-p0aX.js","assets/github-icon-Cf0axVvi.js","assets/usePrefersReducedMotion-BLkUT2m6.js","assets/ThemeContext-Ca30E6O4.js","assets/StatusIcon-Bx4H7RuA.js","assets/task-chat-attachments-DNPQ-jOG.js","assets/file-text-CsPKrMTp.js","assets/file-CcVMTQhg.js","assets/TaskChatMarker-LLCNK3e-.js","assets/book-open-i_DxEUXC.js","assets/bot-kSfD9MPZ.js","assets/flag-i_D610oD.js","assets/info-Clx4FKz9.js","assets/octagon-x-ZKE_ZOe_.js","assets/TaskChatProtocolCard-CdeGEtdY.js","assets/RichWorkProductCard-DvhYE1cH.js","assets/maximize-2-c8H5WcEB.js","assets/server-NjSlblAR.js","assets/ImageGalleryModal-B_H2699L.js","assets/dist-CEXsZ2vP.js","assets/chevron-left-DnUVccc_.js","assets/x-6E1yeU3Q.js","assets/issue-output-BM-lLts2.js","assets/QuestionForm-DF6R7lYE.js","assets/MarkdownEditor-ubJimjUH.js","assets/dist-BJ09fDjD.js","assets/dist-Kk1Xaco5.js","assets/dist--9cFpXne.js","assets/dist-9zjsMxaY.js","assets/dist-DMGv3m4L.js","assets/dist-JmBbJxI1.js","assets/calendar-clock-CXtB0BA2.js","assets/user-D5V640s5.js","assets/AgentAvatar-BZiiDlCN.js","assets/Identity-8eG_HXAH.js","assets/avatar-qO_h93F8.js","assets/routines-DteAuK7S.js","assets/activity-CudcEDwO.js","assets/dist-BhxPxuMy.js","assets/message-square-plus-BQNp2QTu.js","assets/input-BBNGmECW.js","assets/TaskChatComposerTakeoverContext-C68QVO36.js","assets/shield-check-RPyaLAc-.js","assets/triangle-alert-CnHMpmva.js","assets/dialog-CeH7rDcv.js","assets/textarea-CTx68BDs.js","assets/square-CDo6rOf8.js","assets/users-CEZ1U5q9.js","assets/presentation-mode-ZjtUUsSS.js","assets/list-todo-DfkI9JDS.js","assets/shield-question-mark-Dl8dxzUU.js","assets/shield-x-DaFG-JUd.js","assets/system-notice-comment-DPCHQ4-Y.js","assets/label-B707hSFt.js","assets/heartbeats-D96c9g2n.js","assets/email-hX48MODm.js","assets/transcript-adapter-D3tQN7Tw.js","assets/AgentBubbleActionRow-Dqrx638X.js","assets/dropdown-menu-rUbU8QKw.js","assets/dist-Bn32UOVm.js","assets/ellipsis-DyXbAp4P.js","assets/thumbs-down-BVZskfHA.js","assets/thumbs-up-Cqj30fzj.js","assets/tooltip-CW50mEoC.js","assets/segmented-tuNVx49H.js","assets/Cases-Bd2Ckeh9.js","assets/checkbox-Cf2_HXDG.js","assets/arrow-up-down-Ci6AcwB0.js","assets/columns-3-CsveFAYd.js","assets/funnel-BoiZeTWw.js","assets/badge-jeXr866I.js","assets/projects-l3kQxnTp.js","assets/BreadcrumbContext-DNbB7zWn.js","assets/cases-lkyebfpY.js","assets/CaseIdentifierKey-CIGzqAfo.js","assets/FilterBar-CIPYvHzR.js","assets/CaseDetail-CYIIqjOz.js","assets/IssueDocumentAnnotations-DjcRXcEw.js","assets/sheet-D5sUsyfT.js","assets/tabs-CjHzZxtD.js","assets/ellipsis-vertical-DzWImTnI.js","assets/issue-properties-DxJFyYY9.js","assets/issue-attribution-DfN_3u2W.js","assets/WorkspaceRuntimeControls-Cp5E1FME.js","assets/activity-BwGRpduS.js","assets/useManagedSandboxOnly-KE5BJrr7.js","assets/instanceSettings-D1nNVWU0.js","assets/archive-restore-tP0pyaei.js","assets/arrow-right-W0iJ_-Zs.js","assets/arrow-up-right-CFNgVoQj.js","assets/repeat-DzPORJjX.js","assets/inboxArchiveCache-CxaLM1R8.js","assets/access-DhB95qNC.js","assets/assignees-DkQNbPzi.js","assets/AgentIdentity-DBHRFgMM.js","assets/recent-selections-BnN_nb6Y.js","assets/recent-assignees-DmalYaLf.js","assets/InlineEntitySelector-BboofK18.js","assets/useMobileEntityPickerViewportStyle-BG2vZMIz.js","assets/issue-blockers-t3wlvg4M.js","assets/eye-D8HiVtuU.js","assets/refresh-cw-CfzWP9se.js","assets/IssueReferencePill-eeVd9x72.js","assets/query-placeholder-data-Bg4z2kcq.js","assets/SourceTrustBadge-BUmQZ6VD.js","assets/badge-check-BNLpGDnd.js","assets/circle-alert-C7T1cdKm.js","assets/shield-alert-BAXWoBTh.js","assets/InlineBanner-DYx7A02D.js","assets/runRetryState-p_i4Mh7u.js","assets/review-policy-B1PowuVV.js","assets/user-check-DcbSRa0r.js","assets/user-minus-DSZK8_9n.js","assets/separator-6cvFqhvW.js","assets/issue-workspace-selection-CyOTHbLN.js","assets/list-filter-BjVYqW16.js","assets/trash-QxFF084e.js","assets/select-DNiRU1d9.js","assets/chevron-up-C1TOE3pP.js","assets/chip-yHjfSD46.js","assets/card-BVZvs7aX.js","assets/useAutosaveIndicator-D3owckCV.js","assets/FoldCurtain-H4DNjYLl.js","assets/line-diff-DAcZgvm2.js","assets/DocumentFrameHeader-B8A6eaJb.js","assets/Dashboard-b22e7HsQ.js","assets/flask-conical-BxspRG7d.js","assets/layout-dashboard-CGcwI_3-.js","assets/MootMark-BZOhYsK8.js","assets/useSharedPolling-CFeiZe2t.js","assets/slots-DZ1hj5sG.js","assets/SidebarContext-bEtg0ItG.js","assets/plugins-C7Akvi81.js","assets/instance-settings-QXUWVmQs.js","assets/MetricCard-DlcBTKQs.js","assets/smoke-lab-matrix-Cjauo09x.js","assets/Companies-CQ_mUV6-.js","assets/Agents-hJqeQN6A.js","assets/useQueries-K6OPYBvC.js","assets/network-D_6qRf8m.js","assets/upload-Dk7oXJof.js","assets/useAgentChatEnabled-DMbd4JDE.js","assets/useHiddenSettings-D0HL2tkE.js","assets/health-Cn-5LIwb.js","assets/model-picker-fields-D_I_l2UI.js","assets/arrow-up-BMN1ZnS1.js","assets/adapter-display-registry-9qBBJi9B.js","assets/environments-xuhuvnTt.js","assets/managed-sandbox-environment-B8DewKvK.js","assets/AgentRoleEditor-DnibPmmw.js","assets/alert-dialog-DNbnZgRz.js","assets/EntityRow-B24YmFE7.js","assets/AgentDetail-D7joo2rc.js","assets/useInfiniteQuery-DTEIZ1gz.js","assets/ConnectionSetupFlow-g6asOGFg.js","assets/connection-identity-ch7QDvun.js","assets/queryClient-CojHFSot.js","assets/collapsible-D_rwONtV.js","assets/PathInstructionsModal-BJAqF7vQ.js","assets/arrow-left-CnGEiANj.js","assets/SearchableSelect-BbuRtdzg.js","assets/command-BnJHDVFJ.js","assets/searchable-select-fvMNMcqm.js","assets/environment-variables-editor-D6Ylcd74.js","assets/eye-off-DTXvEIMp.js","assets/save-Blub8a14.js","assets/user-round-B87hENhM.js","assets/model-DidtFy-U.js","assets/proposal-review-D9ye_2Px.js","assets/server-cog-cefxr54v.js","assets/secrets-D17QEm13.js","assets/inbox-BbL3s2C7.js","assets/link-2-Cn4f4xsG.js","assets/SetupWizard-92wVRG6Y.js","assets/skeleton-BAAoD7cz.js","assets/tools-MhVvhrz_.js","assets/AppLogo-BLq8BpKi.js","assets/assets-BOhIBphq.js","assets/toggle-switch-Dj5GORxn.js","assets/AgentMultiSelect-BlUaNdZZ.js","assets/radio-card-DCobJXTD.js","assets/JsonSchemaForm-Dkh3zdL9.js","assets/schema-config-fields-B8ha5h4A.js","assets/agent-config-primitives-BJlDiwaH.js","assets/AgentSetupPrompt-CaafK5_w.js","assets/dynamic-loader-ehitOaJV.js","assets/adapters-D3NHXckp.js","assets/use-adapter-capabilities-BNfGiTEP.js","assets/AgentCharacter-DAAMv7-c.js","assets/app-connect-policy-DqQf5knn.js","assets/responsible-user-denial-Dyl0BwU5.js","assets/ScrollToBottom-CT7fjpoT.js","assets/scroll-area-Ci3PubY2.js","assets/braces-CpXTT0w9.js","assets/chatEndpoints-Bj-keCuw.js","assets/ConfigureBuiltInAgentModal-CHCXXZ3A.js","assets/run-log-chunks-ZnzOvrXs.js","assets/IssueRecoveryActionCard-DgG9K5yf.js","assets/execution-projection-BGI5f3kX.js","assets/workspace-restore-BIbDC_O8.js","assets/model-fallback-CwykjJWn.js","assets/ResponsibleUserDenialNotice-dXyOLtYP.js","assets/user-x-CZ1ImNac.js","assets/omp-settings-model-B06pdqQR.js","assets/ChoiceControls-CzMMk2Iy.js","assets/SkillCardIcon-Byzb3JuD.js","assets/CopyText-BbOm2I6t.js","assets/MembershipAction-Cn7I3sEB.js","assets/log-in-C4giPkVk.js","assets/AgentActionButtons-Dd6alMqq.js","assets/TrustPresetSection-Dkv__1Qr.js","assets/EnforcementBanner-qtVCLyJo.js","assets/shared-c4dzLU_x.js","assets/OmpAllSettings-DTJLATQL.js","assets/Projects-Ck08UWc-.js","assets/ProjectDetail-BCjyXt2s.js","assets/link-0uKX-OmT.js","assets/BudgetPolicyCard-D-aZ30F6.js","assets/AccessSelectIdentity-C-iVX_EX.js","assets/InlineEditor-BJTE1pyF.js","assets/SummarySlotCard-_MpN7TiK.js","assets/useSummaryDraftStream-DLjyfaIh.js","assets/budgets-C2LtVWph.js","assets/ProjectWorkspacesContent-B0vZEtt2.js","assets/ProjectWorkspaceDetail-BcyMO75Z.js","assets/MissingPluginTabPlaceholder-l1R-Q4nh.js","assets/Workspaces-z0KIx4hI.js","assets/Issues-B4mFVMjr.js","assets/Inbox-cm1ulHkR.js","assets/issue-filters-Ce8v1l6U.js","assets/ApprovalPayload-m4AnE9rE.js","assets/scroll-text-DfBz82Kz.js","assets/useSecondTick-BRYNTPNI.js","assets/LiveNowTodoLine-BaBvpVxD.js","assets/AgentTodoCard-Brh8SSVE.js","assets/Search-BgSHY-QB.js","assets/file-question-mark-BCVjQ2mM.js","assets/IssueDetail-BTGIxWc1.js","assets/IssueWriteDenialNotice-Bf0ZFSBV.js","assets/TerminalView-Du4ncjRe.js","assets/clipboard-paste-B7AvxL_k.js","assets/rotate-cw-D1cKBtZK.js","assets/terminal-font-B-qtwS34.js","assets/cloud-DX1fkQ6i.js","assets/file-search-Ccb88q3t.js","assets/folder-search-B_Hz17IO.js","assets/IssueThreadInteractionCard-C8Bu2LL1.js","assets/plug-UFf0xCI3.js","assets/interaction-card-visibility-CUHRz7le.js","assets/interaction-audience-B74UGNaN.js","assets/AgentMailCredentialField-DNclWIul.js","assets/radio-BqjASC1E.js","assets/settings-DuRZr7gk.js","assets/browser-use-BwBUHG71.js","assets/TaskTreeControls-Cqhs5wQ9.js","assets/code-xml-CZhhm_-P.js","assets/IssueChatThread-aO8MN-x0.js","assets/ComposerAddMenu-BPPkbm0o.js","assets/CommentAttributionChip-BdllZVtJ.js","assets/issueActiveRun-s6f-GUHq.js","assets/ApprovalCard-DTIm5U9W.js","assets/issue-share-W3K_cYZY.js","assets/artifacts-4t_LL-lA.js","assets/activity-format-CYYHRbLo.js","assets/AgentChats-IEiJJtdg.js","assets/recent-agent-chats-BUso0Smv.js","assets/AgentChat-BHjA0PWW.js","assets/agentChats-C8o51WiF.js","assets/IssueChatLongThreadPerf-Bw21NogO.js","assets/Routines-BB5zkfap.js","assets/audit-navigation-IalprBz0.js","assets/FolderControls-DI7QVvPv.js","assets/RoutineRunVariablesDialog-BKrZPW5U.js","assets/Pipelines-CBrVkNVf.js","assets/pipeline-stage-presentation-COuyOfPG.js","assets/folder-git-2-igHQBSOf.js","assets/pipelines-0Lb8D7gt.js","assets/PipelineSettings-CoFzH1-c.js","assets/RoutineVariablesEditor-CHogduM9.js","assets/StatusCards-BQYp9_rr.js","assets/wand-sparkles-CONrztQy.js","assets/PixelsOffice-D1vo-0wW.js","assets/coins-DeD2KB8A.js","assets/AttentionInteractionResolver-BmiwiFlx.js","assets/RoutineDetail-CM_C8njY.js","assets/pen-line-CKsWWDy2.js","assets/webhook-nurKUWEn.js","assets/WebhookUrlWarning-CbkWHsPb.js","assets/RoutineActivityRow-D16b-qFh.js","assets/UserProfile-6tR8KBkI.js","assets/ExecutionWorkspaceDetail-2AFXb_-1.js","assets/Goals-BWNWwYmd.js","assets/GoalTree-BF1J-Wd-.js","assets/Artifacts-BvvQffcj.js","assets/GoalDetail-C8NwbVu0.js","assets/Approvals-Zxq0yDz0.js","assets/ApprovalDetail-eGGSB0_Q.js","assets/CompanyActivity-CBwdj3In.js","assets/AuditHub-DCksM6Df.js","assets/arrow-down-left-B8lHKNrs.js","assets/decision-models-DBtkxtYF.js","assets/fast-responses-B5vx8axv.js","assets/QuotaBar-Ch_rM0X1.js","assets/WhatNeedsMe-CokwG-qz.js","assets/DecisionDateChips-BPqVvaQ7.js","assets/sun-2LJX7Tad.js","assets/DecisionQueuePage-BxiBix3d.js","assets/BoardChat-Bp_P56xH.js","assets/circle-slash-DP3-64k6.js","assets/send-DfQbMfo9.js","assets/CompanySettings-D4-cqzil.js","assets/DecisionModelSettings-HEZJ0E6n.js","assets/CompanyConnections-D7x76vZy.js","assets/CompanyEnvironments-fJh3Mt-u.js","assets/BootstrapSetupUxLab-CcxoPa2W.js","assets/ResponsibleUserDenialUxLab-DGWo-GoD.js","assets/CrossIssueCollaborationUxLab-D2bB9GTl.js","assets/CompanySettingsPluginPage-DQeyVIjI.js","assets/CompanyAccess-CZAfSbtD.js","assets/AdvancedToolsRoute-tleFHTcB.js","assets/power-CJfOYd7k.js","assets/profile-summary-BwdvqPGE.js","assets/useProfilesData-Bs6IpD6I.js","assets/ProfileWizardRoute-Bk8tx6UC.js","assets/ToolsAdminGate-C5dQpL4C.js","assets/ProfileDetailRoute-nVOQkxal.js","assets/Browse-DQJ6Gj80.js","assets/ManagedAiConnectionDetails-CFL872M2.js","assets/retired-composio-DrxhEOpx.js","assets/connection-owner-Bhzm673Y.js","assets/AssistantConnection-XWq_Gvxh.js","assets/AppsConnect-D7l2xnv-.js","assets/skill-source-connect-return-C3vV7DQP.js","assets/ChatEndpointSetup-BZGnK0W7.js","assets/EmailEndpointSetup-FXzIFk9y.js","assets/OpenwaGatewayManager-BQpxxJOa.js","assets/ChatEndpointDetail-DdbIST5k.js","assets/EmailConnectionAccess-BcI7_br0.js","assets/ChatIdentityConfirm-Dc4AnYX8.js","assets/AppsReview-BlGCgr9w.js","assets/ReviewQueueCard-CQJtenHf.js","assets/AppDetail-B8ZBWzk8.js","assets/AppNotConnected-NVgEwEYJ.js","assets/GatewaysList-BgwbsqYZ.js","assets/CopyableGatewayUrl-DtEeRG6_.js","assets/GatewayDetail-BRId71b2.js","assets/CompanySkills-Doub2oUz.js","assets/SkillBinaryFile-N7sK2ZTh.js","assets/company-skill-routes-D5LJ1l8M.js","assets/SkillSources-BG_dPDP8.js","assets/SkillSourceTree-Cm9N2xW8.js","assets/SkillStudio-D4GvrYEe.js","assets/AgentIconPicker-BJerBmcL.js","assets/resizable-panels-DkafPiQi.js","assets/IssueOutputSection-EDMuhye2.js","assets/Secrets-zu14ajI8.js","assets/CompanyImport-D3UlNq4i.js","assets/agent-order-BE-pAWdx.js","assets/sidebarPreferences-CIMvMX-W.js","assets/portable-files-CloN_vbk.js","assets/DesignGuide-5uuu_1IQ.js","assets/RepositoryEditor-BuV4JRgV.js","assets/ThemeToggle-BzQNYD1J.js","assets/InstanceFeatures-C1eqcxDI.js","assets/useInstanceFeatureSettings-1h06E3Mh.js","assets/AgentDefaults-C0WFwQky.js","assets/ModelsAndProviders-Bzd4NZcX.js","assets/InstanceAdvanced-DHBs71Ii.js","assets/InstanceAccess-D4ZbGCeK.js","assets/ProfileSettings-D_ZrTEBL.js","assets/PluginManager-DkADWuR8.js","assets/PluginSettings-Hcx5yZJk.js","assets/AdapterManager-Dn6r8M3v.js","assets/PluginPage-BtaYd9AD.js","assets/NewAgent-wSr42KiN.js","assets/Auth-D0lGuVnd.js","assets/invite-memory-CHGcQdLs.js","assets/BoardClaim-CbYY66Qd.js","assets/McpConnect-Dqx0rBQk.js","assets/CliAuth-CatEsBxW.js","assets/InviteLanding-DTNcs2-Z.js","assets/PublicIssueSharePage-D28zKQ4N.js","assets/JoinRequestQueue-DyPP4DL2.js","assets/CompanyExport-B9FgX5uJ.js","assets/Terminal-D_PTBqFk.js"])))=>i.map(i=>d[i]);
2
2
  var pE=Object.defineProperty;var r=(e,t)=>pE(e,"name",{value:t,configurable:!0});import{i as m0,n as mE,t as go}from"./rolldown-runtime-ZpX3ckPj.js";import{Ar as hE,At as gE,Bi as h0,C as Zk,Fr as Zh,Hi as Bc,Ir as xE,Ji as bE,Lt as vE,Ni as yE,Nr as jE,Or as wE,Ot as kE,P as SE,Pi as NE,Pr as Jk,Qt as g0,Yi as zy,_ as CE,_n as AE,ci as e1,i as Dd,kr as _E,kt as t1,l as Y,la as EE,li as Xs,n as n1,r as dr,rr as IE,t as He,ua as x0,ui as a1,vn as TE,w as Py,x as RE,zt as qd}from"./createLucideIcon-CgrPXnTY.js";import{l as s1}from"./dist-DYoIyA63.js";import{t as ke}from"./preload-helper-CceJXRIF.js";import{_ as ME,a as Jh,c as DE,d as xo,f as L,h as hn,n as eg,p as OE,r as _i,s as LE,t as b0,v as zs,y as i1}from"./star-eem0qj3E.js";import{J as v0,X as kn,Y as zE,_ as Bt,c as Pr,d as y0,f as PE,g as r1,h as Kc,n as Ii,r as je,t as P,u as $E,v as me}from"./queryKeys-BzT8CD34.js";import{t as Af}from"./queryClient-CojHFSot.js";import{t as _f}from"./useQueries-K6OPYBvC.js";import{a as UE,c as BE,i as j0,l as KE,o as Zn,u as $y}from"./companies-query-BEdFiAhG.js";import{H as l1,I as Uy,M as qE,g as FE,gt as HE,h as VE,ht as WE,mt as QE,n as GE}from"./ConnectionSetupFlow-g6asOGFg.js";import{t as o1}from"./issue-attribution-DfN_3u2W.js";import{t as YE}from"./execution-projection-BGI5f3kX.js";import{C as c1,D as XE,O as ZE,T as JE,d as u1,f as w0,k as tg,w as d1}from"./connection-identity-ch7QDvun.js";import{n as vt,r as eI,t as tI}from"./CompanyContext-fQCNWI_f.js";import{A as nI,B as Fd,Bt as aI,C as sI,Ct as iI,E as rI,G as Ef,H as lI,J as oI,Jt as ng,L as ld,O as cI,Q as f1,Qt as uI,Rt as dI,Ut as Hd,Yt as k0,Z as By,_t as fI,an as pI,b as mI,dt as p1,f as Vd,i as hI,in as gI,n as m1,nt as Jm,o as ja,on as xI,ot as hc,p as If,q as S0,r as We,t as mn,tt as Tf,u as h1,ut as g1,v as x1,zt as on}from"./router-BKzUF9uf.js";import{t as bI}from"./dist-Cfwg8Fpq.js";import{n as b1,r as vI,t as v1}from"./collapsible-D_rwONtV.js";import{a as y1,c as j1,i as w1,l as yI,n as k1,o as S1,r as N1,s as C1,t as A1}from"./alert-dialog-DNbnZgRz.js";import{a as Wd,n as Qd,t as Gd}from"./avatar-qO_h93F8.js";import{t as Qs}from"./checkbox-Cf2_HXDG.js";import{a as _1,c as Ei,i as Sn,n as Ky,o as jI,p as Jr,r as el,s as wI,t as tl}from"./dropdown-menu-rUbU8QKw.js";import{t as kI}from"./scroll-area-Ci3PubY2.js";import{i as SI,r as NI,t as CI}from"./tabs-CjHzZxtD.js";import{a as AI,o as _I,r as EI,s as II,t as E1}from"./MarkdownEditor-ubJimjUH.js";import{o as vs,r as ys,t as js}from"./popover-CWlBonqy.js";import{t as Rf}from"./activity-BwGRpduS.js";import{n as TI}from"./PathInstructionsModal-BJAqF7vQ.js";import{t as I1}from"./archive-CvT6i844.js";import{t as RI}from"./arrow-down-C_oYEUXL.js";import{t as N0}from"./arrow-left-CnGEiANj.js";import{t as MI}from"./arrow-right-W0iJ_-Zs.js";import{t as DI}from"./arrow-up-down-Ci6AcwB0.js";import{t as OI}from"./arrow-up-right-CFNgVoQj.js";import{t as T1}from"./arrow-up-BMN1ZnS1.js";import{t as R1}from"./book-open-i_DxEUXC.js";import{t as Nc}from"./bot-kSfD9MPZ.js";import{t as M1}from"./boxes-DVB7wdRh.js";import{t as LI}from"./braces-CpXTT0w9.js";import{t as zI}from"./calendar-clock-CXtB0BA2.js";import{t as Rs}from"./check-Bis3vECb.js";import{t as Qr}from"./chevron-down-nRcQ7bok.js";import{t as D1}from"./chevron-left-DnUVccc_.js";import{t as cr}from"./chevron-right-BP8JjEC_.js";import{t as PI}from"./chevron-up-C1TOE3pP.js";import{n as O1,t as $I}from"./SearchableSelect-BbuRtdzg.js";import{t as L1}from"./circle-alert-C7T1cdKm.js";import{t as Yd}from"./circle-dot-EfQ00xK3.js";import{t as ag}from"./circle-question-mark-CasEGiDp.js";import{t as UI}from"./circle-DCDVf2v0.js";import{t as sg}from"./AgentIconPicker-BJerBmcL.js";import{a as BI,c as KI,d as ig,i as eh,l as qI,n as FI,o as z1,r as HI,s as VI,t as WI,u as od}from"./ComposerAddMenu-BPPkbm0o.js";import{t as QI}from"./clipboard-paste-B7AvxL_k.js";import{t as GI}from"./clock-D2UFngg7.js";import{C as YI,D as XI,F as ZI,O as P1,P as qy,k as JI,t as e3,w as t3}from"./MarkdownBody-D7qCQaU_.js";import{t as n3}from"./columns-3-CsveFAYd.js";import{t as a3}from"./copy-C1cfcpxY.js";import{n as s3,t as i3}from"./package-G5arH6JJ.js";import{t as Mf}from"./ellipsis-DyXbAp4P.js";import{t as $1}from"./external-link-BIcMNNSN.js";import{a as r3,d as l3,f as o3,g as c3,h as u3,i as d3,l as f3,m as p3,p as m3,u as h3}from"./task-chat-attachments-DNPQ-jOG.js";import{t as U1}from"./file-code-corner-CwcL9g2p.js";import{t as B1}from"./file-text-CsPKrMTp.js";import{t as C0}from"./flag-i_D610oD.js";import{t as g3}from"./flask-conical-BxspRG7d.js";import{t as K1}from"./folder-open-Dkshp3J4.js";import{t as x3}from"./funnel-BoiZeTWw.js";import{t as b3}from"./git-pull-request-DXoACxvx.js";import{t as A0}from"./inbox-BbL3s2C7.js";import{t as _0}from"./key-round-CGxQxRtN.js";import{t as E0}from"./layout-dashboard-CGcwI_3-.js";import{t as v3}from"./link-2-Cn4f4xsG.js";import{r as Ta,t as oe}from"./button-DI4w5WP7.js";import{t as y3}from"./RepositoryEditor-BuV4JRgV.js";import{t as q1}from"./maximize-2-c8H5WcEB.js";import{t as j3}from"./minus-BttANimQ.js";import{n as Ms,t as w3}from"./ThemeToggle-BzQNYD1J.js";import{t as F1}from"./network-D_6qRf8m.js";import{t as I0}from"./play-Czm7OCYh.js";import{t as ns}from"./plus-CwNlqadt.js";import{t as nl}from"./refresh-cw-CfzWP9se.js";import{t as H1}from"./repeat-DzPORJjX.js";import{t as gc}from"./rotate-ccw-DpzLJhXT.js";import{t as k3}from"./scroll-text-DfBz82Kz.js";import{t as fr}from"./search-CgZSuGC8.js";import{t as S3}from"./send-DfQbMfo9.js";import{t as V1}from"./settings-DuRZr7gk.js";import{t as N3}from"./shield-alert-BAXWoBTh.js";import{t as Cc}from"./shield-check-RPyaLAc-.js";import{t as C3}from"./shield-question-mark-Dl8dxzUU.js";import{t as A3}from"./shield-DC6LuDUy.js";import{t as _3}from"./square-CDo6rOf8.js";import{t as W1}from"./terminal-i6UlT3R6.js";import{t as rg}from"./trash-QxFF084e.js";import{t as ni}from"./triangle-alert-CnHMpmva.js";import{t as E3}from"./upload-Dk7oXJof.js";import{t as I3}from"./user-round-B87hENhM.js";import{t as so}from"./user-D5V640s5.js";import{t as Gr}from"./users-CEZ1U5q9.js";import{t as ia}from"./x-6E1yeU3Q.js";import{a as T3,i as R3,n as M3,r as D3}from"./SetupWizard-92wVRG6Y.js";import{i as O3,n as L3,r as Jn,t as z3}from"./SidebarContext-bEtg0ItG.js";import{t as T0}from"./MootMark-BZOhYsK8.js";import{a as Df,c as P3,i as $3,n as Ye,o as Fy,r as U3,s as B3,t as Q1}from"./SidebarNavItem-afEXEFeo.js";import{n as oo,t as lr}from"./primary-sidebar-styles-BdMiagDc.js";import{i as Es,n as Is,r as K3,t as Ts}from"./tooltip-CW50mEoC.js";import{t as Dn}from"./badge-jeXr866I.js";import{n as q3,t as lg}from"./Identity-8eG_HXAH.js";import{t as pr}from"./AgentAvatar-BZiiDlCN.js";import{a as Ti,n as Of,o as F3,r as H3,t as V3}from"./ToastContext-DyVJ6bCh.js";import{t as Fa}from"./agents-B8n-p0aX.js";import{t as Lf}from"./heartbeats-D96c9g2n.js";import{t as pa}from"./instanceSettings-D1nNVWU0.js";import{a as th,c as W3,i as Q3,l as G3,n as Hy,o as nh,r as Y3,s as og,t as Vy}from"./agent-order-BE-pAWdx.js";import{n as Ac,t as _c}from"./useSharedPolling-CFeiZe2t.js";import{m as X3,s as Z3}from"./inboxArchiveCache-CxaLM1R8.js";import{n as Wy,t as mr}from"./projects-l3kQxnTp.js";import{t as zf}from"./useAgentChatEnabled-DMbd4JDE.js";import{a as bo,i as Pf,n as Ps,o as J3,r as vo,s as Ds,t as ws}from"./dialog-CeH7rDcv.js";import{t as Wn}from"./input-BBNGmECW.js";import{t as ei}from"./access-DhB95qNC.js";import{a as eT,c as cg,d as tT,f as Qy,h as tr,i as nT,l as aT,m as Gy,n as sT,o as iT,p as ah,r as G1,s as ug,t as dg,u as Xd}from"./issue-filters-Ce8v1l6U.js";import{a as io,n as Y1,r as Vr,t as Kr}from"./assignees-DkQNbPzi.js";import{t as R0}from"./plugins-C7Akvi81.js";import{n as rT,r as lT,t as ar}from"./instance-settings-QXUWVmQs.js";import{a as oT,c as M0,d as cT,f as uT,i as Yy,l as dT,m as fT,n as fg,o as qc,p as pT,r as mT,s as hT,t as D0,u as gT}from"./slots-DZ1hj5sG.js";import{t as Fc}from"./health-Cn-5LIwb.js";import{t as hr}from"./useHiddenSettings-D0HL2tkE.js";import{t as Zd}from"./sidebarPreferences-CIMvMX-W.js";import{t as rt}from"./skeleton-BAAoD7cz.js";import{t as X1}from"./chatEndpoints-Bj-keCuw.js";import{t as Yl}from"./tools-MhVvhrz_.js";import{t as xT}from"./AppLogo-BLq8BpKi.js";import{r as bT}from"./audit-navigation-IalprBz0.js";import{t as vT}from"./routines-DteAuK7S.js";import{t as yT}from"./github-icon-Cf0axVvi.js";import{n as Z1,t as jT}from"./BreadcrumbContext-DNbB7zWn.js";import{a as O0,c as sr,i as Ys,l as wT,n as kT,o as wn,r as L0,s as z0,t as J1}from"./command-BnJHDVFJ.js";import{t as co}from"./AgentIdentity-DBHRFgMM.js";import{t as pg}from"./secrets-D17QEm13.js";import{t as eS}from"./textarea-CTx68BDs.js";import{t as tS}from"./assets-BOhIBphq.js";import{n as ST,r as NT}from"./recent-selections-BnN_nb6Y.js";import{a as Jd,i as ef,n as mg,r as nS,t as CT}from"./recent-assignees-DmalYaLf.js";import{t as AT}from"./attachment-icon-_1iz_saB.js";import{t as aS}from"./toggle-switch-Dj5GORxn.js";import{n as _T,t as ET}from"./presentation-mode-ZjtUUsSS.js";import{a as sh,c as Xy,d as $r,g as cd,h as Zy,m as Ci,o as IT,s as Jy,t as TT,v as ej}from"./TaskChatComposerTakeoverContext-C68QVO36.js";import{t as RT}from"./interaction-card-visibility-CUHRz7le.js";import{r as MT}from"./useMobileEntityPickerViewportStyle-BG2vZMIz.js";import{i as tj,n as DT,t as OT}from"./color-contrast-BHHcEMtO.js";import{t as P0}from"./InlineEntitySelector-BboofK18.js";import{r as LT}from"./searchable-select-fvMNMcqm.js";import{t as nj}from"./InlineBanner-DYx7A02D.js";import{t as hg}from"./select-DNiRU1d9.js";import{t as zT}from"./chip-yHjfSD46.js";import{t as PT}from"./environments-xuhuvnTt.js";import{t as $0}from"./clipboard-CTLKYvRL.js";import{n as $T,r as UT,t as BT}from"./AgentSetupPrompt-CaafK5_w.js";import{t as U0}from"./usePrefersReducedMotion-BLkUT2m6.js";import{t as KT}from"./use-copy-action-DFzauB4H.js";import{i as qT}from"./app-connect-policy-DqQf5knn.js";import{n as FT,t as HT}from"./segmented-tuNVx49H.js";import{t as Hc}from"./card-BVZvs7aX.js";import{t as sS}from"./agentChats-C8o51WiF.js";import{t as VT}from"./ThemeContext-Ca30E6O4.js";import{t as Js}from"./StatusIcon-Bx4H7RuA.js";import{a as WT,d as QT,i as GT,l as YT,s as XT,t as ZT}from"./issue-blockers-t3wlvg4M.js";r((function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const p of u.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function s(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}r(s,"getFetchOpts");function l(c){if(c.ep)return;c.ep=!0;const u=s(c);fetch(c.href,u)}r(l,"processPreload")}),"polyfill")();function iS(e){return(typeof e=="string"?e:e?.name??"").trim()}r(iS,"rawNameOf");function rS(e){const t=e.toLowerCase();return!!(t.includes("://")||t==="localhost"||t.startsWith("localhost:")||/^\d{1,3}(\.\d{1,3}){3}(:\d+)?$/.test(t)||/^[a-z0-9.-]+:\d+$/.test(t))}r(rS,"looksLikeNetworkAddress");function gg(e){return e.split(/[\s._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}r(gg,"titleCaseIdentifier");function JT(e){const t=/^plugin:\s*(.+)$/i.exec(e);if(!t)return null;let s=t[1].trim();return s=s.slice(s.lastIndexOf(".")+1),s=s.replace(/^plugin[-_]/i,""),gg(s)||"Custom app"}r(JT,"pluginPackageLabel");function eR(e,t={}){const s=t.title?.trim();if(s)return s;const l=iS(e);if(!l||rS(l))return"Custom app";const c=JT(l);if(c)return c;if(l.includes(":")&&!l.includes("://")){const u=l.slice(l.lastIndexOf(":")+1).trim();if(u)return gg(u)}return/\s/.test(l)||/[A-Z]/.test(l)?l:/[._-]/.test(l)?gg(l):l}r(eR,"humanizeConnectionDisplayName");function ZQ(e){const t=iS(e);return t&&rS(t)?`hosted at ${t}`:null}r(ZQ,"connectionDisplaySecondaryHint");var tR=864e5;function Xl(e){return e?.phase==="waiting"||e?.phase==="installing"}r(Xl,"isUpdateJobActive");function nR(e){return e+3*tR}r(nR,"updateNoticeHiddenUntil");function aR(e,t){return typeof e=="number"&&Number.isFinite(e)&&t<e}r(aR,"isUpdateNoticeHidden");var lS={name:"badge-dollar-sign",size:24,node:[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]};lS.node;var sR=He(lS),oS={name:"book-open-text",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M16 13h2",key:"weia3s"}],["path",{d:"M16 9h2",key:"1n7gjm"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}],["path",{d:"M6 13h2",key:"1cckiz"}],["path",{d:"M6 9h2",key:"1k7j9f"}]]};oS.node;var iR=He(oS),cS={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};cS.node;var rR=He(cS),uS={name:"chevrons-left-right-ellipsis",size:24,node:[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"m17 7 5 5-5 5",key:"1xlxn0"}],["path",{d:"m7 7-5 5 5 5",key:"19njba"}],["path",{d:"M8 12h.01",key:"czm47f"}]]};uS.node;var lR=He(uS),dS={name:"circle-arrow-up",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],aliases:["arrow-up-circle"]};dS.node;var aj=He(dS),fS={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};fS.node;var B0=He(fS),pS={name:"circle-play",size:24,node:[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["play-circle"]};pS.node;var mS=He(pS),hS={name:"circle-slash-2",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]],aliases:["circle-slashed"]};hS.node;var oR=He(hS),gS={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};gS.node;var xS=He(gS),bS={name:"cloud-download",size:24,node:[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],aliases:["download-cloud"]};bS.node;var cR=He(bS),vS={name:"dollar-sign",size:24,node:[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]};vS.node;var yS=He(vS),jS={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};jS.node;var xg=He(jS),wS={name:"file-diff",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]};wS.node;var uR=He(wS),kS={name:"file-pen-line",size:24,node:[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],aliases:["file-signature"]};kS.node;var dR=He(kS),SS={name:"file-terminal",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]]};SS.node;var fR=He(SS),NS={name:"gamepad-2",size:24,node:[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]};NS.node;var pR=He(NS),CS={name:"git-branch-plus",size:24,node:[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]};CS.node;var mR=He(CS),AS={name:"git-commit-horizontal",size:24,node:[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],aliases:["git-commit"]};AS.node;var hR=He(AS),_S={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};_S.node;var gR=He(_S),ES={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};ES.node;var xR=He(ES),IS={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};IS.node;var bR=He(IS),TS={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};TS.node;var vR=He(TS),RS={name:"library",size:24,node:[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]};RS.node;var bg=He(RS),MS={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};MS.node;var DS=He(MS),OS={name:"list-collapse",size:24,node:[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]]};OS.node;var yR=He(OS),LS={name:"list-tree",size:24,node:[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]};LS.node;var zS=He(LS),PS={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};PS.node;var jR=He(PS),$S={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};$S.node;var $f=He($S),US={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};US.node;var BS=He(US),KS={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};KS.node;var vg=He(KS),qS={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};qS.node;var wR=He(qS),FS={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};FS.node;var kR=He(FS),HS={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};HS.node;var VS=He(HS),WS={name:"monitor-cog",size:24,node:[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]};WS.node;var SR=He(WS),QS={name:"panel-right-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]};QS.node;var GS=He(QS),YS={name:"panel-right-open",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]};YS.node;var XS=He(YS),ZS={name:"panel-top-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"m9 16 3-3 3 3",key:"1idcnm"}]]};ZS.node;var NR=He(ZS),JS={name:"pencil-ruler",size:24,node:[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};JS.node;var CR=He(JS),eN={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};eN.node;var K0=He(eN),tN={name:"receipt-text",size:24,node:[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]]};tN.node;var AR=He(tN),nN={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};nN.node;var q0=He(nN),aN={name:"search-code",size:24,node:[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};aN.node;var _R=He(aN),sN={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};sN.node;var ER=He(sN),iN={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};iN.node;var IR=He(iN),rN={name:"share",size:24,node:[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]]};rN.node;var TR=He(rN),lN={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};lN.node;var oN=He(lN),cN={name:"square-kanban",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]],aliases:["kanban-square"]};cN.node;var RR=He(cN),uN={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};uN.node;var F0=He(uN),dN={name:"square-plus",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-square"]};dN.node;var MR=He(dN),fN={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};fN.node;var DR=He(fN),pN={name:"store",size:24,node:[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]]};pN.node;var OR=He(pN),mN={name:"timer-reset",size:24,node:[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]]};mN.node;var LR=He(mN),hN={name:"toggle-right",size:24,node:[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]};hN.node;var gN=He(hN),xN={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};xN.node;var zR=He(xN),bN={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};bN.node;var vN=He(bN),yN={name:"user-round-pen",size:24,node:[["path",{d:"M2 21a8 8 0 0 1 10.821-7.487",key:"1c8h7z"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}]]};yN.node;var PR=He(yN),jN={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};jN.node;var $R=He(jN),Zl=m0(s1()),x=m0(x0(),1),wN="wardmote.staleChunkReload";function UR(){try{return window.sessionStorage}catch{return null}}r(UR,"sessionStore");function BR(e){try{e?.removeItem(wN)}catch{return}}r(BR,"clearReloadMark");function KR(e,t){if(!e)return!1;try{return e.getItem("wardmote.staleChunkReload")===t?!1:(e.setItem(wN,t),!0)}catch{return!1}}r(KR,"markReloadOnce");function Ce(e,t={}){const s=t.reload??(()=>window.location.reload()),l=t.path??(()=>window.location.pathname);return(0,x.lazy)(async()=>{const c=t.storage===void 0?UR():t.storage;try{const u=await e();return BR(c),{default:u}}catch(u){if(!KR(c,l()))throw u;return s(),new Promise(()=>{})}})}r(Ce,"lazyPage");var nt=r(e=>typeof e=="string","isString$1"),cc=r(()=>{let e,t;const s=new Promise((l,c)=>{e=l,t=c});return s.resolve=e,s.reject=t,s},"defer"),ih=r(e=>e==null?"":String(e),"makeString"),qR=r((e,t,s)=>{e.forEach(l=>{t[l]&&(s[l]=t[l])})},"copy"),FR=/###/g,sj=r(e=>e&&e.includes("###")?e.replace(FR,"."):e,"cleanKey"),ij=r(e=>!e||nt(e),"canNotTraverseDeeper"),xc=r((e,t,s)=>{const l=nt(t)?t.split("."):t;let c=0;for(;c<l.length-1;){if(ij(e))return{};const u=sj(l[c]);!e[u]&&s&&(e[u]=new s),Object.prototype.hasOwnProperty.call(e,u)?e=e[u]:e={},++c}return ij(e)?{}:{obj:e,k:sj(l[c])}},"getLastOfPath"),rj=r((e,t,s)=>{const{obj:l,k:c}=xc(e,t,Object);if(l!==void 0||t.length===1){l[c]=s;return}let u=t[t.length-1],p=t.slice(0,t.length-1),f=xc(e,p,Object);for(;f.obj===void 0&&p.length;)u=`${p[p.length-1]}.${u}`,p=p.slice(0,p.length-1),f=xc(e,p,Object),f?.obj&&typeof f.obj[`${f.k}.${u}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${u}`]=s},"setPath"),HR=r((e,t,s,l)=>{const{obj:c,k:u}=xc(e,t,Object);c[u]=c[u]||[],c[u].push(s)},"pushPath"),tf=r((e,t)=>{const{obj:s,k:l}=xc(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,l))return s[l]},"getPath"),VR=r((e,t,s)=>{const l=tf(e,s);return l!==void 0?l:tf(t,s)},"getPathWithDefaults"),kN=r((e,t,s)=>{for(const l in t)l!=="__proto__"&&l!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,l)?nt(e[l])||e[l]instanceof String||nt(t[l])||t[l]instanceof String?s&&(e[l]=t[l]):kN(e[l],t[l],s):e[l]=t[l]);return e},"deepExtend"),Ai=r(e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),"regexEscape"),WR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},QR=r(e=>nt(e)?e.replace(/[&<>"'\/]/g,t=>WR[t]):e,"escape"),GR=class{static{r(this,"RegExpCache")}constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}},YR=[" ",",","?","!",";"],XR=new GR(20),ZR=r((e,t,s)=>{t=t||"",s=s||"";const l=YR.filter(p=>!t.includes(p)&&!s.includes(p));if(l.length===0)return!0;const c=XR.getRegExp(`(${l.map(p=>p==="?"?"\\?":p).join("|")})`);let u=!c.test(e);if(!u){const p=e.indexOf(s);p>0&&!c.test(e.substring(0,p))&&(u=!0)}return u},"looksLikeObjectPath"),yg=r((e,t,s=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const l=t.split(s);let c=e;for(let u=0;u<l.length;){if(!c||typeof c!="object")return;let p,f="";for(let h=u;h<l.length;++h)if(h!==u&&(f+=s),f+=l[h],p=c[f],p!==void 0){if(["string","number","boolean"].includes(typeof p)&&h<l.length-1)continue;u+=h-u+1;break}c=p}return c},"deepFind"),Ec=r(e=>e?.replace(/_/g,"-"),"getCleanedCode"),JR={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}},eM=class jg{static{r(this,"Logger")}constructor(t,s={}){this.init(t,s)}init(t,s={}){this.prefix=s.prefix||"i18next:",this.logger=t||JR,this.options=s,this.debug=s.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,s,l,c){return c&&!this.debug?null:(t=t.map(u=>nt(u)?u.replace(/[\r\n\x00-\x1F\x7F]/g," "):u),nt(t[0])&&(t[0]=`${l}${this.prefix} ${t[0]}`),this.logger[s](t))}create(t){return new jg(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new jg(this.logger,t)}},Zs=new eM,Uf=class{static{r(this,"EventEmitter")}constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const l=this.observers[s].get(t)||0;this.observers[s].set(t,l+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const s=r((...l)=>{t(...l),this.off(e,s)},"wrapper");return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,l])=>{for(let c=0;c<l;c++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,l])=>{for(let c=0;c<l;c++)s(e,...t)})}},lj=class extends Uf{static{r(this,"ResourceStore")}constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,l={}){const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;e.includes(".")?p=e.split("."):(p=[e,t],s&&(Array.isArray(s)?p.push(...s):nt(s)&&c?p.push(...s.split(c)):p.push(s)));const f=tf(this.data,p);return!f&&!t&&!s&&e.includes(".")&&(e=p[0],t=p[1],s=p.slice(2).join(".")),f||!u||!nt(s)?f:yg(this.data?.[e]?.[t],s,c)}addResource(e,t,s,l,c={silent:!1}){const u=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let p=[e,t];s&&(p=p.concat(u?s.split(u):s)),e.includes(".")&&(p=e.split("."),l=t,t=p[1]),this.addNamespaces(t),rj(this.data,p,l),c.silent||this.emit("added",e,t,s,l)}addResources(e,t,s,l={silent:!1}){for(const c in s)(nt(s[c])||Array.isArray(s[c]))&&this.addResource(e,t,c,s[c],{silent:!0});l.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,l,c,u={silent:!1,skipCopy:!1}){let p=[e,t];e.includes(".")&&(p=e.split("."),l=s,s=t,t=p[1]),this.addNamespaces(t);let f=tf(this.data,p)||{};u.skipCopy||(s=JSON.parse(JSON.stringify(s))),l?kN(f,s,c):f={...f,...s},rj(this.data,p,f),u.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}},SN={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,l,c){return e.forEach(u=>{t=this.processors[u]?.process(t,s,l,c)??t}),t}},NN=Symbol("i18next/PATH_KEY");function tM(){const e=[],t=Object.create(null);let s;return t.get=(l,c)=>(s?.revoke?.(),c===NN?e:(e.push(c),s=Proxy.revocable(l,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}r(tM,"createProxy");function ro(e,t){const{[NN]:s}=e(tM()),l=t?.keySeparator??".",c=t?.nsSeparator??":",u=t?.enableSelector==="strict";if(s.length>1&&c){const p=t?.ns,f=u?Array.isArray(p)?p:p?[p]:null:Array.isArray(p)?p:null;if(f&&(u?f:f.length>1?f.slice(1):[]).includes(s[0]))return`${s[0]}${c}${s.slice(1).join(l)}`}return s.join(l)}r(ro,"keysFromSelector");var rh=r(e=>!nt(e)&&typeof e!="boolean"&&typeof e!="number","shouldHandleAsObject"),oj=class CN extends Uf{static{r(this,"Translator")}constructor(t,s={}){super(),qR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Zs.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,s={interpolation:{}}){const l={...s};if(t==null)return!1;const c=this.resolve(t,l);if(c?.res===void 0)return!1;const u=rh(c.res);return!(l.returnObjects===!1&&u)}extractFromKey(t,s){let l=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=s.ns||this.options.defaultNS||[];const p=l&&t.includes(l),f=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!ZR(t,l,c);if(p&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:nt(u)?[u]:u};const g=t.split(l);(l!==c||l===c&&this.options.ns.includes(g[0]))&&(u=g.shift()),t=g.join(c)}return{key:t,namespaces:nt(u)?[u]:u}}translate(t,s,l){let c=typeof s=="object"?{...s}:s;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),t==null)return"";typeof t=="function"&&(t=ro(t,{...this.options,...c})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?ro(V,{...this.options,...c}):String(V));const u=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,p=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:f,namespaces:h}=this.extractFromKey(t[t.length-1],c),g=h[h.length-1];let v=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const y=c.lng||this.language,j=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(y?.toLowerCase()==="cimode")return j?u?{res:`${g}${v}${f}`,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:g,usedParams:this.getUsedParamsDetails(c)}:`${g}${v}${f}`:u?{res:f,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:g,usedParams:this.getUsedParamsDetails(c)}:f;const k=this.resolve(t,c);let S=k?.res;const N=k?.usedKey||f,I=k?.exactUsedKey||f,C=["[object Number]","[object Function]","[object RegExp]"],M=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,_=c.count!==void 0&&!nt(c.count),D=CN.hasDefaultValue(c),U=_?this.pluralResolver.getSuffix(y,c.count,c):"",K=c.ordinal&&_?this.pluralResolver.getSuffix(y,c.count,{ordinal:!1}):"",z=_&&!c.ordinal&&c.count===0,E=z&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${U}`]||c[`defaultValue${K}`]||c.defaultValue;let B=S;R&&!S&&D&&(B=E);const O=rh(B),Q=Object.prototype.toString.apply(B);if(R&&B&&O&&!C.includes(Q)&&!(nt(M)&&Array.isArray(B))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,B,{...c,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return u?(k.res=V,k.usedParams=this.getUsedParamsDetails(c),k):V}if(p){const V=Array.isArray(B),ue=V?[]:{},ce=V?I:N;for(const X in B)if(Object.prototype.hasOwnProperty.call(B,X)){const A=`${ce}${p}${X}`;D&&!S?ue[X]=this.translate(A,{...c,defaultValue:rh(E)?E[X]:void 0,joinArrays:!1,ns:h}):ue[X]=this.translate(A,{...c,joinArrays:!1,ns:h}),ue[X]===A&&(ue[X]=B[X])}S=ue}}else if(R&&nt(M)&&Array.isArray(S))S=S.join(M),S&&(S=this.extendTranslation(S,t,c,l));else{let V=!1,ue=!1;!this.isValidLookup(S)&&D&&(V=!0,S=E),this.isValidLookup(S)||(ue=!0,S=f);const ce=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ue?void 0:S,X=D&&E!==S&&this.options.updateMissing;if(ue||V||X){if(this.logger.log(X?"updateKey":"missingKey",y,g,_&&!X?`${f}${this.pluralResolver.getSuffix(y,c.count,c)}`:f,X?E:S),p){const le=this.resolve(f,{...c,keySeparator:!1});le&&le.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let A=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let le=0;le<ee.length;le++)A.push(ee[le]);else this.options.saveMissingTo==="all"?A=this.languageUtils.toResolveHierarchy(c.lng||this.language):A.push(c.lng||this.language);const ie=r((le,Ae,de)=>{const we=D&&de!==S?de:ce;this.options.missingKeyHandler?this.options.missingKeyHandler(le,g,Ae,we,X,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(le,g,Ae,we,X,c),this.emit("missingKey",le,g,Ae,S)},"send");this.options.saveMissing&&(this.options.saveMissingPlurals&&_?A.forEach(le=>{const Ae=this.pluralResolver.getSuffixes(le,c);z&&c[`defaultValue${this.options.pluralSeparator}zero`]&&!Ae.includes(`${this.options.pluralSeparator}zero`)&&Ae.push(`${this.options.pluralSeparator}zero`),Ae.forEach(de=>{ie([le],f+de,c[`defaultValue${de}`]||E)})}):ie(A,f,E))}S=this.extendTranslation(S,t,c,k,l),ue&&S===f&&this.options.appendNamespaceToMissingKey&&(S=`${g}${v}${f}`),(ue||V)&&this.options.parseMissingKeyHandler&&(S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${v}${f}`:f,V?S:void 0,c))}return u?(k.res=S,k.usedParams=this.getUsedParamsDetails(c),k):S}extendTranslation(t,s,l,c,u){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...l},l.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!l.skipInterpolation){l.interpolation&&this.interpolator.init({...l,interpolation:{...this.options.interpolation,...l.interpolation}});const h=nt(t)&&(l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(h){const y=t.match(this.interpolator.nestingRegexp);g=y&&y.length}let v=l.replace&&!nt(l.replace)?l.replace:l;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,l.lng||this.language||c.usedLng,l),h){const y=t.match(this.interpolator.nestingRegexp),j=y&&y.length;g<j&&(l.nest=!1)}!l.lng&&c&&c.res&&(l.lng=this.language||c.usedLng),l.nest!==!1&&(t=this.interpolator.nest(t,(...y)=>u?.[0]===y[0]&&!l.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${s[0]}`),null):this.translate(...y,s),l)),l.interpolation&&this.interpolator.reset()}const p=l.postProcess||this.options.postProcess,f=nt(p)?[p]:p;return t!=null&&f?.length&&l.applyPostProcessor!==!1&&(t=SN.handle(f,t,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(l)},...l}:l,this)),t}resolve(t,s={}){let l,c,u,p,f;return nt(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(h=>typeof h=="function"?ro(h,{...this.options,...s}):h)),t.forEach(h=>{if(this.isValidLookup(l))return;const g=this.extractFromKey(h,s),v=g.key;c=v;let y=g.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const j=s.count!==void 0&&!nt(s.count),k=j&&!s.ordinal&&s.count===0,S=s.context!==void 0&&(nt(s.context)||typeof s.context=="number")&&s.context!=="",N=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);y.forEach(I=>{this.isValidLookup(l)||(f=I,!this.checkedLoadedFor[`${N[0]}-${I}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&(this.checkedLoadedFor[`${N[0]}-${I}`]=!0,this.logger.warn(`key "${c}" for languages "${N.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),N.forEach(C=>{if(this.isValidLookup(l))return;p=C;const M=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(M,v,C,I,s);else{let _;j&&(_=this.pluralResolver.getSuffix(C,s.count,s));const D=`${this.options.pluralSeparator}zero`,U=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(j&&(s.ordinal&&_.startsWith(U)&&M.push(v+_.replace(U,this.options.pluralSeparator)),M.push(v+_),k&&M.push(v+D)),S){const K=`${v}${this.options.contextSeparator||"_"}${s.context}`;M.push(K),j&&(s.ordinal&&_.startsWith(U)&&M.push(K+_.replace(U,this.options.pluralSeparator)),M.push(K+_),k&&M.push(K+D))}}let R;for(;R=M.pop();)this.isValidLookup(l)||(u=R,l=this.getResource(C,I,R,s))}))})}),{res:l,usedKey:c,exactUsedKey:u,usedLng:p,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,s,l,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,s,l,c):this.resourceStore.getResource(t,s,l,c)}getUsedParamsDetails(t={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],l=t.replace&&!nt(t.replace);let c=l?t.replace:t;if(l&&typeof t.count<"u"&&(c={...c,count:t.count}),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!l){c={...c};for(const u of s)delete c[u]}return c}static hasDefaultValue(t){const s="defaultValue";for(const l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&l.startsWith(s)&&t[l]!==void 0)return!0;return!1}},cj=class{static{r(this,"LanguageUtil")}constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Zs.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=Ec(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Ec(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(nt(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const l=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(l))&&(t=l)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const l=this.getScriptPartFromCode(s);if(this.isSupportedCode(l))return t=l;const c=this.getLanguagePartFromCode(s);if(this.isSupportedCode(c))return t=c;t=this.options.supportedLngs.find(u=>u===c?!0:!u.includes("-")&&!c.includes("-")?!1:!!(u.includes("-")&&!c.includes("-")&&u.slice(0,u.indexOf("-"))===c||u.startsWith(c)&&c.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),nt(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.options.fallbackLng,l=Array.isArray(s)?s.join("|"):s;l!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=l);const c=t===void 0||t===!1||nt(t),u=t===void 0&&typeof this.options.fallbackLng=="function",p=nt(e)&&c&&!u;let f=null;if(p){let y;t===void 0?y="undefined":t===!1?y="boolean:false":y=`string:${t}`,f=`${e.length}:${e}|${y}`}if(f!==null){const y=this.resolveHierarchyCache[f];if(y!==void 0)return y.slice()}const h=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),g=[],v=r(y=>{y&&(this.isSupportedCode(y)?g.push(y):this.logger.warn(`rejecting language code not found in supportedLngs: ${y}`))},"addCode");return nt(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&v(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&v(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&v(this.getLanguagePartFromCode(e))):nt(e)&&v(this.formatLanguageCode(e)),h.forEach(y=>{g.includes(y)||v(this.formatLanguageCode(y))}),f!==null?(this.resolveHierarchyCache[f]=g,g.slice()):g}},uj={zero:0,one:1,two:2,few:3,many:4,other:5},dj={select:r(e=>e===1?"one":"other","select"),resolvedOptions:r(()=>({pluralCategories:["one","other"]}),"resolvedOptions")},nM=class{static{r(this,"PluralResolver")}constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Zs.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=Ec(e==="dev"?"en":e),l=t.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:s,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let u;try{u=new Intl.PluralRules(s,{type:l})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),dj;if(!e.match(/-|_/))return dj;const f=this.languageUtils.getLanguagePartFromCode(e);u=this.getRule(f,t)}return this.pluralRulesCache[c]=u,u}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(l=>`${t}${l}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((l,c)=>uj[l]-uj[c]).map(l=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(e,t,s={}){const l=this.getRule(e,s);return l?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${l.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}},fj=r((e,t,s,l=".",c=!0)=>{let u=VR(e,t,s);return!u&&c&&nt(s)&&(u=yg(e,s,l),u===void 0&&(u=yg(t,s,l))),u},"deepFindWithDefaults"),pj=r(e=>e.replace(/\$/g,"$$$$"),"regexSafe"),mj=class{static{r(this,"Interpolator")}constructor(e={}){this.logger=Zs.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:l,prefix:c,prefixEscaped:u,suffix:p,suffixEscaped:f,formatSeparator:h,unescapeSuffix:g,unescapePrefix:v,nestingPrefix:y,nestingPrefixEscaped:j,nestingSuffix:k,nestingSuffixEscaped:S,nestingOptionsSeparator:N,maxReplaces:I,alwaysFormat:C}=e.interpolation;this.escape=t!==void 0?t:QR,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?Ai(c):u||"{{",this.suffix=p?Ai(p):f||"}}",this.formatSeparator=h||",",this.unescapePrefix=g?"":v?Ai(v):"-",this.unescapeSuffix=this.unescapePrefix?"":g?Ai(g):"",this.nestingPrefix=y?Ai(y):j||Ai("$t("),this.nestingSuffix=k?Ai(k):S||Ai(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=I||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=r((t,s)=>t?.source===s?(t.lastIndex=0,t):new RegExp(s,"g"),"getOrResetRegExp");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,l){let c,u,p;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=r(y=>{if(!y.includes(this.formatSeparator)){const N=fj(t,f,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,s,{...l,...t,interpolationkey:y}):N}const j=y.split(this.formatSeparator),k=j.shift().trim(),S=j.join(this.formatSeparator).trim();return this.format(fj(t,f,k,this.options.keySeparator,this.options.ignoreJSONStructure),S,s,{...l,...t,interpolationkey:k})},"handleFormat");this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const g=l?.missingInterpolationHandler||this.options.missingInterpolationHandler,v=l?.interpolation?.skipOnVariables!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:r(y=>y,"safeValue")},{regex:this.regexp,safeValue:r(y=>this.escapeValue?this.escape(y):y,"safeValue")}].forEach(y=>{for(p=0;c=y.regex.exec(e);){const j=c[1].trim();if(u=h(j),u===void 0)if(typeof g=="function"){const S=g(e,c,l);u=nt(S)?S:""}else if(l&&Object.prototype.hasOwnProperty.call(l,j))u="";else if(v){u=c[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${e}`),u="";else!nt(u)&&!this.useRawValueToEscape&&(u=ih(u));const k=y.safeValue(u);if(e=e.replace(c[0],pj(k)),v?(y.regex.lastIndex+=k.length,y.regex.lastIndex-=c[0].length):y.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),e}nest(e,t,s={}){let l,c,u;const p=r((f,h)=>{const g=this.nestingOptionsSeparator;if(!f.includes(g))return f;const v=f.split(new RegExp(`${Ai(g)}[ ]*{`));let y=`{${v[1]}`;f=v[0],y=this.interpolate(y,u);const j=y.match(/'/g),k=y.match(/"/g);((j?.length??0)%2===0&&!k||(k?.length??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{u=JSON.parse(y),h&&(u={...h,...u})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,S),`${f}${g}${y}`}return u.defaultValue&&u.defaultValue.includes(this.prefix)&&delete u.defaultValue,f},"handleHasOptions");for(;l=this.nestingRegexp.exec(e);){let f=[];u={...s},u=u.replace&&!nt(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const h=/{.*}/s.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(h!==-1&&(f=l[1].slice(h).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),l[1]=l[1].slice(0,h)),c=t(p.call(this,l[1].trim(),u),u),c&&l[0]===e&&!nt(c))return c;nt(c)||(c=ih(c)),c||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${e}`),c=""),f.length&&(c=f.reduce((g,v)=>this.format(g,v,s.lng,{...s,interpolationkey:l[1].trim()}),c.trim())),e=e.replace(l[0],pj(ih(c))),this.regexp.lastIndex=0}return e}},aM=r(e=>{let t=e.toLowerCase().trim();const s={};if(e.includes("(")){const l=e.split("(");t=l[0].toLowerCase().trim();const c=l[1].slice(0,-1);t==="currency"&&!c.includes(":")?s.currency||(s.currency=c.trim()):t==="relativetime"&&!c.includes(":")?s.range||(s.range=c.trim()):c.split(";").forEach(u=>{if(u){const[p,...f]=u.split(":"),h=f.join(":").trim().replace(/^'+|'+$/g,""),g=p.trim();s[g]||(s[g]=h),h==="false"&&(s[g]=!1),h==="true"&&(s[g]=!0),isNaN(h)||(s[g]=parseInt(h,10))}})}return{formatName:t,formatOptions:s}},"parseFormatStr"),hj=r(e=>{const t={};return(s,l,c)=>{let u=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(u={...u,[c.interpolationkey]:void 0});const p=l+JSON.stringify(u);let f=t[p];return f||(f=e(Ec(l),c),t[p]=f),f(s)}},"createCachedFormatter"),sM=r(e=>(t,s,l)=>e(Ec(s),l)(t),"createNonCachedFormatter"),iM=class{static{r(this,"Formatter")}constructor(e={}){this.logger=Zs.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?hj:sM;this.formats={number:s((l,c)=>{const u=new Intl.NumberFormat(l,{...c});return p=>u.format(p)}),currency:s((l,c)=>{const u=new Intl.NumberFormat(l,{...c,style:"currency"});return p=>u.format(p)}),datetime:s((l,c)=>{const u=new Intl.DateTimeFormat(l,{...c});return p=>u.format(p)}),relativetime:s((l,c)=>{const u=new Intl.RelativeTimeFormat(l,{...c});return p=>u.format(p,c.range||"day")}),list:s((l,c)=>{const u=new Intl.ListFormat(l,{...c});return p=>u.format(p)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=hj(t)}format(e,t,s,l={}){if(!t||e==null)return e;const c=t.split(this.formatSeparator),u=[];for(let p=0;p<c.length;p++){let f=c[p];for(;f.indexOf("(")>-1&&!f.includes(")")&&p+1<c.length;)f=`${f}${this.formatSeparator}${c[++p]}`;u.push(f)}return u.reduce((p,f)=>{const{formatName:h,formatOptions:g}=aM(f);if(this.formats[h]){let v=p;try{const y=l?.formatParams?.[l.interpolationkey]||{},j=y.locale||y.lng||l.locale||l.lng||s;v=this.formats[h](p,j,{...g,...l,...y})}catch(y){this.logger.warn(y)}return v}else this.logger.warn(`there was no format function for ${h}`);return p},e)}},rM=r((e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},"removePending"),lM=class extends Uf{static{r(this,"Connector")}constructor(e,t,s,l={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=l,this.logger=Zs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,l.backend,l)}queueLoad(e,t,s,l){const c={},u={},p={},f={};return e.forEach(h=>{let g=!0;t.forEach(v=>{const y=`${h}|${v}`;!s.reload&&this.store.hasResourceBundle(h,v)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?u[y]===void 0&&(u[y]=!0):(this.state[y]=1,g=!1,u[y]===void 0&&(u[y]=!0),c[y]===void 0&&(c[y]=!0),f[v]===void 0&&(f[v]=!0)))}),g||(p[h]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(f)}}loaded(e,t,s){const l=e.split("|"),c=l[0],u=l[1];t&&this.emit("failedLoading",c,u,t),!t&&s&&this.store.addResourceBundle(c,u,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const p={};this.queue.forEach(f=>{HR(f.loaded,[c],u),rM(f,e),t&&f.errors.push(t),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(h=>{p[h]||(p[h]={});const g=f.loaded[h];g.length&&g.forEach(v=>{p[h][v]===void 0&&(p[h][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(f=>!f.done)}read(e,t,s,l=0,c=this.retryTimeout,u){if(!e.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:l,wait:c,callback:u});return}this.readingCalls++;const p=r((h,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(h&&g&&l<this.maxRetries){setTimeout(()=>{this.read(e,t,s,l+1,c*2,u)},c);return}u(h,g)},"resolver"),f=this.backend[s].bind(this.backend);if(f.length===2){try{const h=f(e,t);h&&typeof h.then=="function"?h.then(g=>p(null,g)).catch(p):p(null,h)}catch(h){p(h)}return}return f(e,t,p)}prepareLoading(e,t,s={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();nt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),nt(t)&&(t=[t]);const c=this.queueLoad(e,t,s,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(u=>{this.loadOne(u)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),l=s[0],c=s[1];this.read(l,c,"read",void 0,void 0,(u,p)=>{u&&this.logger.warn(`${t}loading namespace ${c} for language ${l} failed`,u),!u&&p&&this.logger.log(`${t}loaded namespace ${c} for language ${l}`,p),this.loaded(e,u,p)})}saveMissing(e,t,s,l,c,u={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const f={...u,isUpdate:c},h=this.backend.create.bind(this.backend);if(h.length<6)try{let g;h.length===5?g=h(e,t,s,l,f):g=h(e,t,s,l),g&&typeof g.then=="function"?g.then(v=>p(null,v)).catch(p):p(null,g)}catch(g){p(g)}else h(e,t,s,l,p,f)}!e||!e[0]||this.store.addResource(e[0],t,s,l)}}},lh=r(()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r(e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),nt(e[1])&&(t.defaultValue=e[1]),nt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const s=e[3]||e[2];Object.keys(s).forEach(l=>{t[l]=s[l]})}return t},"overloadTranslationOptionHandler"),interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),"get"),gj=r(e=>(nt(e.ns)&&(e.ns=[e.ns]),nt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),nt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),"transformOptions"),ud=r(()=>{},"noop$1"),oM=r(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})},"bindMemberFunctions"),cM=class Od extends Uf{static{r(this,"I18n")}constructor(t={},s){if(super(),this.options=gj(t),this.services={},this.logger=Zs,this.modules={external:[]},oM(this),s&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,s),this;setTimeout(()=>{this.init(t,s)},0)}}init(t={},s){this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),t.defaultNS==null&&t.ns&&(nt(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const l=lh();this.options={...l,...this.options,...gj(t)},this.options.interpolation={...l.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=l.overloadTranslationOptionHandler);const c=r(f=>f?typeof f=="function"?new f:f:null,"createClassOnDemand");if(!this.options.isClone){this.modules.logger?Zs.init(c(this.modules.logger),this.options):Zs.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=iM;const h=new cj(this.options);this.store=new lj(this.options.resources,this.options);const g=this.services;g.logger=Zs,g.resourceStore=this.store,g.languageUtils=h,g.pluralResolver=new nM(h,{prepend:this.options.pluralSeparator}),f&&(g.formatter=c(f),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new mj(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new lM(c(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(v,...y)=>{this.emit(v,...y)}),this.modules.languageDetector&&(g.languageDetector=c(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=c(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new oj(this.services,this.options),this.translator.on("*",(v,...y)=>{this.emit(v,...y)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,s||(s=ud),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...h)=>this.store[f](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...h)=>(this.store[f](...h),this)});const u=cc(),p=r(()=>{const f=r((h,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(g),s(h,g)},"finish");if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)},"load");return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),u}loadResources(t,s=ud){let l=s;const c=nt(t)?t:this.language;if(typeof t=="function"&&(l=t),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return l();const u=[],p=r(f=>{f&&f!=="cimode"&&this.services.languageUtils.toResolveHierarchy(f).forEach(h=>{h!=="cimode"&&(u.includes(h)||u.push(h))})},"append");c?p(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>p(f)),this.options.preload?.forEach?.(f=>p(f)),this.services.backendConnector.load(u,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),l(f)})}else l(null)}reloadResources(t,s,l){const c=cc();return typeof t=="function"&&(l=t,t=void 0),typeof s=="function"&&(l=s,s=void 0),t||(t=this.languages),s||(s=this.options.ns),l||(l=ud),this.services.backendConnector.reload(t,s,u=>{c.resolve(),l(u)}),c}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&SN.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let s=0;s<this.languages.length;s++){const l=this.languages[s];if(!["cimode","dev"].includes(l)&&this.store.hasLanguageSomeTranslations(l)){this.resolvedLanguage=l;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,s){this.isLanguageChangingTo=t;const l=cc();this.emit("languageChanging",t);const c=r(f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},"setLngProps"),u=r((f,h)=>{h?this.isLanguageChangingTo===t&&(c(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,l.resolve((...g)=>this.t(...g)),s&&s(f,(...g)=>this.t(...g))},"done"),p=r(f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=nt(f)?f:f&&f[0],g=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(nt(f)?[f]:f);g&&(this.language||c(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,v=>{u(v,g)})},"setLng");return!t&&this.services.languageDetector&&!this.services.languageDetector.async?p(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(p):this.services.languageDetector.detect(p):p(t),l}getFixedT(t,s,l,c){const u=c?.scopeNs,p=r((f,h,...g)=>{let v;typeof h!="object"?v=this.options.overloadTranslationOptionHandler([f,h].concat(g)):v={...h},v.lng=v.lng||p.lng,v.lngs=v.lngs||p.lngs;const y=v.ns!==void 0&&v.ns!==null;v.ns=v.ns||p.ns,v.keyPrefix!==""&&(v.keyPrefix=v.keyPrefix||l||p.keyPrefix);const j={...this.options,...v};Array.isArray(u)&&!y&&(j.ns=u),typeof v.keyPrefix=="function"&&(v.keyPrefix=ro(v.keyPrefix,j));const k=this.options.keySeparator||".";let S;return v.keyPrefix&&Array.isArray(f)?S=f.map(N=>(typeof N=="function"&&(N=ro(N,j)),`${v.keyPrefix}${k}${N}`)):(typeof f=="function"&&(f=ro(f,j)),S=v.keyPrefix?`${v.keyPrefix}${k}${f}`:f),this.t(S,v)},"fixedT");return nt(t)?p.lng=t:p.lngs=t,p.ns=s,p.keyPrefix=l,p}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const l=s.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;const p=r((f,h)=>{const g=this.services.backendConnector.state[`${f}|${h}`];return g===-1||g===0||g===2},"loadNotPending");if(s.precheck){const f=s.precheck(this,p);if(f!==void 0)return f}return!!(this.hasResourceBundle(l,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||p(l,t)&&(!c||p(u,t)))}loadNamespaces(t,s){const l=cc();return this.options.ns?(nt(t)&&(t=[t]),t.forEach(c=>{this.options.ns.includes(c)||this.options.ns.push(c)}),this.loadResources(c=>{l.resolve(),s&&s(c)}),l):(s&&s(),Promise.resolve())}loadLanguages(t,s){const l=cc();nt(t)&&(t=[t]);const c=this.options.preload||[],u=t.filter(p=>!c.includes(p)&&this.services.languageUtils.isSupportedCode(p));return u.length?(this.options.preload=c.concat(u),this.loadResources(p=>{l.resolve(),s&&s(p)}),l):(s&&s(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const u=c.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],l=this.services?.languageUtils||new cj(lh());return t.toLowerCase().indexOf("-latn")>1?"ltr":s.includes(l.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},s){const l=new Od(t,s);return l.createInstance=Od.createInstance,l}cloneInstance(t={},s=ud){const l=t.forkResourceStore;l&&delete t.forkResourceStore;const c={...this.options,...t,isClone:!0},u=new Od(c);if((t.debug!==void 0||t.prefix!==void 0)&&(u.logger=u.logger.clone(t)),["store","services","language"].forEach(p=>{u[p]=this[p]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},l){const p=Object.keys(this.store.data).reduce((f,h)=>(f[h]={...this.store.data[h]},f[h]=Object.keys(f[h]).reduce((g,v)=>(g[v]={...f[h][v]},g),f[h]),f),{});u.store=new lj(p,c),u.services.resourceStore=u.store}if(t.interpolation){const p={...lh().interpolation,...this.options.interpolation,...t.interpolation},f={...c,interpolation:p};u.services.interpolator=new mj(f)}return u.translator=new oj(u.services,c),u.translator.on("*",(p,...f)=>{u.emit(p,...f)}),u.init(c,s),u.translator.options=c,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},Ra=cM.createInstance(),JQ=Ra.createInstance,eG=Ra.dir,tG=Ra.init,nG=Ra.loadResources,aG=Ra.reloadResources,sG=Ra.use,iG=Ra.changeLanguage,rG=Ra.getFixedT,lG=Ra.t,oG=Ra.exists,cG=Ra.setDefaultNamespace,uG=Ra.hasLoadedNamespace,dG=Ra.loadNamespaces,fG=Ra.loadLanguages,uM=r((e,t,s,l)=>{const c=[s,{code:t,...l||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(c,"warn","react-i18next::",!0);Yr(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),e?.services?.logger?.warn&&e.services.logger.warn(...c)},"warn"),xj={},Ld=r((e,t,s,l)=>{Yr(s)&&xj[s]||(Yr(s)&&(xj[s]=new Date),uM(e,t,s,l))},"warnOnce"),AN=r((e,t)=>()=>{if(e.isInitialized)t();else{const s=r(()=>{setTimeout(()=>{e.off("initialized",s)},0),t()},"initialized");e.on("initialized",s)}},"loadedClb"),wg=r((e,t,s)=>{e.loadNamespaces(t,AN(e,s))},"loadNamespaces"),bj=r((e,t,s,l)=>{if(Yr(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return wg(e,s,l);s.forEach(c=>{e.options.ns.indexOf(c)<0&&e.options.ns.push(c)}),e.loadLanguages(t,AN(e,l))},"loadLanguages"),dM=r((e,t,s={})=>!t.languages||!t.languages.length?(Ld(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:s.lng,precheck:r((l,c)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&l.services.backendConnector.backend&&l.isLanguageChangingTo&&!c(l.isLanguageChangingTo,e))return!1},"precheck")}),"hasLoadedNamespace"),Yr=r(e=>typeof e=="string","isString"),fM=r(e=>typeof e=="object"&&e!==null,"isObject"),pM=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,mM={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},hM=r(e=>mM[e],"unescapeHtmlEntity"),gM=r(e=>e.replace(pM,hM),"unescape"),kg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:gM,transDefaultProps:void 0},xM=r((e={})=>{kg={...kg,...e}},"setDefaults"),bM=r(()=>kg,"getDefaults"),_N,vM=r(e=>{_N=e},"setI18n"),yM=r(()=>_N,"getI18n"),jM={type:"3rdParty",init(e){xM(e.options.react),vM(e)}},wM=(0,x.createContext)(),kM=class{static{r(this,"ReportNamespaces")}constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},SM=go((e=>{var t=x0();function s(j,k){return j===k&&(j!==0||1/j===1/k)||j!==j&&k!==k}r(s,"is");var l=typeof Object.is=="function"?Object.is:s,c=t.useState,u=t.useEffect,p=t.useLayoutEffect,f=t.useDebugValue;function h(j,k){var S=k(),N=c({inst:{value:S,getSnapshot:k}}),I=N[0].inst,C=N[1];return p(function(){I.value=S,I.getSnapshot=k,g(I)&&C({inst:I})},[j,S,k]),u(function(){return g(I)&&C({inst:I}),j(function(){g(I)&&C({inst:I})})},[j]),f(S),S}r(h,"useSyncExternalStore$2");function g(j){var k=j.getSnapshot;j=j.value;try{var S=k();return!l(j,S)}catch{return!0}}r(g,"checkIfSnapshotChanged");function v(j,k){return k()}r(v,"useSyncExternalStore$1");var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v:h;e.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y})),NM=go(((e,t)=>{t.exports=SM()})),CM=NM(),AM=r((e,t)=>{if(Yr(t))return t;if(fM(t)&&Yr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const s=e[e.length-1];return typeof s=="function"?"":s}return e},"notReadyT"),_M={t:AM,ready:!1},EM=r(()=>()=>{},"dummySubscribe"),IM=r((e,t={})=>{const{i18n:s}=t,{i18n:l,defaultNS:c}=(0,x.useContext)(wM)||{},u=s||l||yM();u&&!u.reportNamespaces&&(u.reportNamespaces=new kM),u||Ld(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const p=(0,x.useMemo)(()=>({...bM(),...u?.options?.react,...t}),[u,t]),{useSuspense:f,keyPrefix:h}=p,g=e||c||u?.options?.defaultNS,v=Yr(g)?[g]:g||["translation"],y=(0,x.useMemo)(()=>v,v);u?.reportNamespaces?.addUsedNamespaces?.(y);const j=(0,x.useRef)(0),k=(0,x.useCallback)(B=>{if(!u)return EM;const{bindI18n:O,bindI18nStore:Q}=p,V=r(()=>{j.current+=1,B()},"wrappedCallback");return O&&u.on(O,V),Q&&u.store.on(Q,V),()=>{O&&O.split(" ").forEach(ue=>u.off(ue,V)),Q&&Q.split(" ").forEach(ue=>u.store.off(ue,V))}},[u,p]),S=(0,x.useRef)(),N=(0,x.useCallback)(()=>{if(!u)return _M;const B=!!(u.isInitialized||u.initializedStoreOnce)&&y.every(ce=>dM(ce,u,p)),O=t.lng||u.language,Q=j.current,V=S.current;if(V&&V.ready===B&&V.lng===O&&V.keyPrefix===h&&V.revision===Q)return V;const ue={t:u.getFixedT(O,p.nsMode==="fallback"?y:y[0],h,{scopeNs:y}),ready:B,lng:O,keyPrefix:h,revision:Q};return S.current=ue,ue},[u,y,h,p,t.lng]),[I,C]=(0,x.useState)(0),{t:M,ready:R}=(0,CM.useSyncExternalStore)(k,N,N);(0,x.useEffect)(()=>{if(u&&!R&&!f){const B=r(()=>C(O=>O+1),"onLoaded");t.lng?bj(u,t.lng,y,B):wg(u,y,B)}},[u,t.lng,y,R,f,I]);const _=u||{},D=(0,x.useRef)(null),U=(0,x.useRef)(),K=r(B=>`${B.language}|${B.resolvedLanguage}|${B.languages?.join(",")}`,"languageKey"),z=r(B=>{const O=Object.getOwnPropertyDescriptors(B);O.__original&&delete O.__original;const Q=Object.create(Object.getPrototypeOf(B),O);if(!Object.prototype.hasOwnProperty.call(Q,"__original"))try{Object.defineProperty(Q,"__original",{value:B,writable:!1,enumerable:!1,configurable:!1})}catch{}return Q},"createI18nWrapper"),E=(0,x.useMemo)(()=>{const B=_,O=B&&K(B);let Q=B;B&&(D.current&&D.current.__original===B?U.current!==O?(Q=z(B),D.current=Q,U.current=O):Q=D.current:(Q=z(B),D.current=Q,U.current=O));const V=!R&&!f?(...ce)=>(Ld(u,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),M(...ce)):M,ue=[V,Q,R];return ue.t=V,ue.i18n=Q,ue.ready=R,ue},[M,_,R,_.resolvedLanguage,_.language,_.languages]);if(u&&f&&!R){let B=!1;try{B=!1}catch{}throw B&&Ld(u,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(O=>{const Q=r(()=>O(),"onLoaded");t.lng?bj(u,t.lng,y,Q):wg(u,y,Q)})}return E},"useTranslation$1"),TM={noCompanies:{title:"أنشئ شركتك الأولى",description:"ابدأ بإنشاء شركة.",newCompany:"شركة جديدة"}},RM={app:TM},MM={noCompanies:{title:"আপনার প্রথম কোম্পানি তৈরি করুন",description:"একটি কোম্পানি তৈরি করে শুরু করুন।",newCompany:"নতুন কোম্পানি"}},DM={app:MM},OM={noCompanies:{title:"Vytvořte svou první společnost",description:"Začněte vytvořením společnosti.",newCompany:"Nová společnost"}},LM={app:OM},zM={noCompanies:{title:"Opret din første virksomhed",description:"Kom i gang ved at oprette en virksomhed.",newCompany:"Ny virksomhed"}},PM={app:zM},$M={noCompanies:{title:"Erstellen Sie Ihr erstes Unternehmen",description:"Beginnen Sie, indem Sie ein Unternehmen erstellen.",newCompany:"Neues Unternehmen"}},UM={app:$M},BM={noCompanies:{title:"Δημιουργήστε την πρώτη σας εταιρεία",description:"Ξεκινήστε δημιουργώντας μια εταιρεία.",newCompany:"Νέα εταιρεία"}},KM={app:BM},qM={noCompanies:{title:"Create your first organization",description:"Get started by creating an organization.",newCompany:"New Organization"}},H0={app:qM},FM={noCompanies:{title:"Crea tu primera empresa",description:"Comienza creando una empresa.",newCompany:"Nueva empresa"}},HM={app:FM},VM={noCompanies:{title:"اولین شرکت خود را ایجاد کنید",description:"با ایجاد یک شرکت شروع کنید.",newCompany:"شرکت جدید"}},WM={app:VM},QM={noCompanies:{title:"Luo ensimmäinen yrityksesi",description:"Aloita luomalla yritys.",newCompany:"Uusi yritys"}},GM={app:QM},YM={noCompanies:{title:"Gumawa ng iyong unang kumpanya",description:"Magsimula sa paggawa ng kumpanya.",newCompany:"Bagong Kumpanya"}},XM={app:YM},ZM={noCompanies:{title:"Créez votre première entreprise",description:"Commencez par créer une entreprise.",newCompany:"Nouvelle entreprise"}},JM={app:ZM},eD={noCompanies:{title:"צרו את החברה הראשונה שלכם",description:"התחילו ביצירת חברה.",newCompany:"חברה חדשה"}},tD={app:eD},nD={noCompanies:{title:"अपनी पहली कंपनी बनाएं",description:"कंपनी बनाकर शुरुआत करें.",newCompany:"नई कंपनी"}},aD={app:nD},sD={noCompanies:{title:"Hozza létre első vállalatát",description:"Kezdje egy vállalat létrehozásával.",newCompany:"Új vállalat"}},iD={app:sD},rD={noCompanies:{title:"Buat perusahaan pertama Anda",description:"Mulai dengan membuat perusahaan.",newCompany:"Perusahaan Baru"}},lD={app:rD},oD={noCompanies:{title:"Crea la tua prima azienda",description:"Inizia creando un'azienda.",newCompany:"Nuova azienda"}},cD={app:oD},uD={noCompanies:{title:"最初の会社を作成",description:"会社を作成して始めましょう。",newCompany:"新しい会社"}},dD={app:uD},fD={noCompanies:{title:"첫 회사를 만드세요",description:"회사를 만들어 시작하세요.",newCompany:"새 회사"}},pD={app:fD},mD={noCompanies:{title:"तुमची पहिली कंपनी तयार करा",description:"कंपनी तयार करून सुरुवात करा.",newCompany:"नवीन कंपनी"}},hD={app:mD},gD={noCompanies:{title:"Cipta syarikat pertama anda",description:"Mulakan dengan mencipta syarikat.",newCompany:"Syarikat Baharu"}},xD={app:gD},bD={noCompanies:{title:"Opprett ditt første selskap",description:"Kom i gang ved å opprette et selskap.",newCompany:"Nytt selskap"}},vD={app:bD},yD={noCompanies:{title:"Maak uw eerste bedrijf aan",description:"Begin door een bedrijf aan te maken.",newCompany:"Nieuw bedrijf"}},jD={app:yD},wD={noCompanies:{title:"ਆਪਣੀ ਪਹਿਲੀ ਕੰਪਨੀ ਬਣਾਓ",description:"ਕੰਪਨੀ ਬਣਾਕੇ ਸ਼ੁਰੂ ਕਰੋ।",newCompany:"ਨਵੀਂ ਕੰਪਨੀ"}},kD={app:wD},SD={noCompanies:{title:"Utwórz swoją pierwszą firmę",description:"Zacznij od utworzenia firmy.",newCompany:"Nowa firma"}},ND={app:SD},CD={noCompanies:{title:"Crie sua primeira empresa",description:"Comece criando uma empresa.",newCompany:"Nova empresa"}},AD={app:CD},_D={noCompanies:{title:"Crie a sua primeira empresa",description:"Comece por criar uma empresa.",newCompany:"Nova empresa"}},ED={app:_D},ID={noCompanies:{title:"Creați prima companie",description:"Începeți prin crearea unei companii.",newCompany:"Companie nouă"}},TD={app:ID},RD={noCompanies:{title:"Создайте свою первую компанию",description:"Начните с создания компании.",newCompany:"Новая компания"}},MD={app:RD},DD={noCompanies:{title:"Skapa ditt första företag",description:"Kom igång genom att skapa ett företag.",newCompany:"Nytt företag"}},OD={app:DD},LD={noCompanies:{title:"Unda kampuni yako ya kwanza",description:"Anza kwa kuunda kampuni.",newCompany:"Kampuni Mpya"}},zD={app:LD},PD={noCompanies:{title:"உங்கள் முதல் நிறுவனத்தை உருவாக்குங்கள்",description:"ஒரு நிறுவனத்தை உருவாக்கி தொடங்குங்கள்.",newCompany:"புதிய நிறுவனம்"}},$D={app:PD},UD={noCompanies:{title:"మీ మొదటి కంపెనీని సృష్టించండి",description:"కంపెనీని సృష్టించడం ద్వారా ప్రారంభించండి.",newCompany:"కొత్త కంపెనీ"}},BD={app:UD},KD={noCompanies:{title:"สร้างบริษัทแรกของคุณ",description:"เริ่มต้นด้วยการสร้างบริษัท",newCompany:"บริษัทใหม่"}},qD={app:KD},FD={noCompanies:{title:"İlk şirketinizi oluşturun",description:"Bir şirket oluşturarak başlayın.",newCompany:"Yeni Şirket"}},HD={app:FD},VD={noCompanies:{title:"Створіть свою першу компанію",description:"Почніть зі створення компанії.",newCompany:"Нова компанія"}},WD={app:VD},QD={noCompanies:{title:"اپنی پہلی کمپنی بنائیں",description:"کمپنی بنا کر شروع کریں۔",newCompany:"نئی کمپنی"}},GD={app:QD},YD={noCompanies:{title:"Tạo công ty đầu tiên của bạn",description:"Bắt đầu bằng cách tạo một công ty.",newCompany:"Công ty mới"}},XD={app:YD},ZD={noCompanies:{title:"创建您的第一家公司",description:"通过创建公司开始。",newCompany:"新公司"}},JD={app:ZD},e5={noCompanies:{title:"建立您的第一家公司",description:"從建立公司開始。",newCompany:"新公司"}},t5={app:e5},n5=2e3;function vj(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}r(vj,"isPlainObject");function rr(e){return e.length>0?e.join("."):"<root>"}r(rr,"formatPath");function yj(e){return Array.from(e.matchAll(/{{\s*([A-Za-z0-9_.-]+)\s*}}/g),t=>t[1]).sort()}r(yj,"interpolationPlaceholders");function jj(e){return/<\/?[A-Za-z][A-Za-z0-9:-]*(?:\s[^>]*)?>/.test(e)}r(jj,"hasRawHtml");function wj(e){return/\son[A-Za-z]+\s*=/i.test(e)}r(wj,"hasEventHandlerAttribute");function kj(e){return Array.from(e.matchAll(/\bhttps?:\/\/[^\s<>"')]+/gi),t=>t[0]).sort()}r(kj,"urlsIn");function a5(e,t){const s=[[/<script\b/i.test(e),/<script\b/i.test(t),"<script"],[wj(e),wj(t),"event-handler attribute"],[/\bjavascript\s*:/i.test(e),/\bjavascript\s*:/i.test(t),"javascript:"],[/\bdata\s*:/i.test(e),/\bdata\s*:/i.test(t),"data:"],[jj(e),jj(t),"raw HTML tag"]].filter(([c,u])=>c&&!u).map(([,,c])=>c),l=new Set(kj(t));return kj(e).find(c=>!l.has(c))&&s.push("unexpected URL"),s}r(a5,"hasBlockedData");function s5(e,t,s,l){const c=yj(t),u=yj(s);c.join("\0")!==u.join("\0")&&l.push(`${rr(e)} interpolation placeholders must match English exactly: expected ${JSON.stringify(u)}, received ${JSON.stringify(c)}`);for(const h of a5(t,s))l.push(`${rr(e)} contains disallowed ${h}`);const p=Math.max(s.length*4+64,s.length+128),f=Math.min(n5,p);t.length>f&&l.push(`${rr(e)} is too long: ${t.length} characters exceeds ${f}`)}r(s5,"validateString");function EN(e,t,s,l){if(typeof s=="string"){if(typeof t!="string"){l.push(`${rr(e)} must be a string`);return}s5(e,t,s,l);return}if(!vj(s)){l.push(`${rr(e)} has unsupported English reference type`);return}if(!vj(t)){l.push(`${rr(e)} must be an object`);return}const c=Object.keys(s).sort(),u=Object.keys(t).sort(),p=c.filter(h=>!u.includes(h)),f=u.filter(h=>!c.includes(h));for(const h of p)l.push(`${rr([...e,h])} is missing`);for(const h of f)l.push(`${rr([...e,h])} is not defined in English`);for(const h of c)h in t&&EN([...e,h],t[h],s[h],l)}r(EN,"validateNode");function i5(e,t=H0){const s=[];return EN([],e,t,s),s}r(i5,"validateLocaleMessages");function r5(e,t=H0){const s=i5(e,t);if(s.length>0)throw new Error(`Invalid locale messages:
3
3
  ${s.join(`
4
4
  `)}`)}r(r5,"assertValidLocaleMessages");var l5=Object.assign({"./locales/ar.json":RM,"./locales/bn.json":DM,"./locales/cs.json":LM,"./locales/da.json":PM,"./locales/de.json":UM,"./locales/el.json":KM,"./locales/en.json":H0,"./locales/es.json":HM,"./locales/fa.json":WM,"./locales/fi.json":GM,"./locales/fil.json":XM,"./locales/fr.json":JM,"./locales/he.json":tD,"./locales/hi.json":aD,"./locales/hu.json":iD,"./locales/id.json":lD,"./locales/it.json":cD,"./locales/ja.json":dD,"./locales/ko.json":pD,"./locales/mr.json":hD,"./locales/ms.json":xD,"./locales/nb.json":vD,"./locales/nl.json":jD,"./locales/pa.json":kD,"./locales/pl.json":ND,"./locales/pt-BR.json":AD,"./locales/pt-PT.json":ED,"./locales/ro.json":TD,"./locales/ru.json":MD,"./locales/sv.json":OD,"./locales/sw.json":zD,"./locales/ta.json":$D,"./locales/te.json":BD,"./locales/th.json":qD,"./locales/tr.json":HD,"./locales/uk.json":WD,"./locales/ur.json":GD,"./locales/vi.json":XD,"./locales/zh-CN.json":JD,"./locales/zh-TW.json":t5}),Bf=Object.fromEntries(Object.entries(l5).map(([e,t])=>{const s=e.match(/\/([A-Za-z0-9_-]+)\.json$/)?.[1];if(!s)throw new Error(`Invalid locale file path: ${e}`);return[s,t]}));if(!("en"in Bf))throw new Error("Missing default locale messages for en");for(const[e,t]of Object.entries(Bf))try{r5(t)}catch(s){const l=s instanceof Error?s.message:String(s);throw new Error(`Invalid ${e} locale messages: ${l}`)}var o5=Object.keys(Bf),c5=Object.fromEntries(Object.entries(Bf).map(([e,t])=>[e,{translation:t}])),u5={resources:c5,lng:"en",fallbackLng:"en",supportedLngs:o5,defaultNS:"translation",interpolation:{escapeValue:!1},returnObjects:!1,initAsync:!1};Ra.use(jM).init(u5).catch(e=>{});var IN=IM,a=m0(EE(),1);function Sj({collapsible:e,headerAction:t,label:s,menu:l}){const{isMobile:c}=Jn(),[u,p]=(0,x.useState)(!1),f=!!(l&&((l.actions?.length??0)>0||(l.radioChoices?.length??0)>0)),h="text-(length:--text-nano) font-medium uppercase tracking-widest font-mono text-ink-3/60",g=c?"opacity-100":"opacity-0 group-hover/sidebar-section:opacity-100 group-focus-within/sidebar-section:opacity-100",v=Y("h-3 w-3 shrink-0 text-ink-3/60 transition-all",g,e?.open&&"rotate-90",u&&"opacity-100"),y=Y("h-5 w-5 shrink-0 text-ink-3/60 transition-opacity hover:text-ink data-[state=open]:opacity-100",g),j=(0,a.jsx)("span",{className:h,children:s}),k=t?.icon,S=f?(0,a.jsxs)(tl,{open:u,onOpenChange:p,children:[(0,a.jsx)(Jr,{asChild:!0,children:(0,a.jsx)("button",{type:"button","data-slot":"icon-button",className:Y("inline-flex min-w-0 max-w-full items-center rounded-md px-1 py-0.5 text-left outline-none transition-colors","hover:bg-bg-3/50 focus-visible:bg-bg-3/50 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-1",u&&"bg-bg-3/50"),"aria-label":l?.ariaLabel??`${s} actions`,children:j})}),(0,a.jsxs)(el,{align:"start",className:"w-48",children:[l?.actions?.map((N,I)=>{if(N.type==="separator")return(0,a.jsx)(Ei,{},`separator-${I}`);const C=N.icon,M=(0,a.jsxs)(a.Fragment,{children:[C?(0,a.jsx)(C,{className:"size-4"}):null,(0,a.jsx)("span",{children:N.label})]});return N.href?(0,a.jsx)(Sn,{asChild:!0,children:(0,a.jsx)(mn,{to:N.href,children:M})},`${N.label}-${I}`):(0,a.jsx)(Sn,{onSelect:N.onSelect,children:M},`${N.label}-${I}`)}),l?.radioChoices&&l.radioChoices.length>0?(0,a.jsx)(jI,{value:l.radioValue,onValueChange:l.onRadioValueChange,"aria-label":l.radioLabel,children:l.radioChoices.map(N=>(0,a.jsx)(wI,{value:N.value,children:N.label},N.value))}):null]})]}):(0,a.jsx)("div",{className:"inline-flex min-w-0 max-w-full items-center px-1 py-0.5",children:j});return(0,a.jsx)("div",{className:"group/sidebar-section px-3 py-1.5 pointer-coarse:py-1",children:(0,a.jsxs)("div",{className:"relative flex min-h-6 min-w-0 items-center gap-1",children:[e?(0,a.jsx)(vI,{asChild:!0,children:(0,a.jsx)("button",{type:"button","data-slot":"icon-button",className:"absolute -left-4 flex h-5 w-5 items-center justify-center rounded-sm outline-none transition-colors hover:bg-bg-3 focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-1","aria-label":e.open?`Collapse ${s}`:`Expand ${s}`,children:(0,a.jsx)(cr,{className:v,"aria-hidden":"true"})})}):null,S,t&&k?(0,a.jsx)(oe,{variant:"ghost",size:"icon-xs",className:y,"aria-label":t.ariaLabel,onClick:t.onClick,children:(0,a.jsx)(k,{className:"h-3.5 w-3.5"})}):null]})})}r(Sj,"SidebarSectionHeader");function nf({label:e,children:t,collapsible:s,menu:l,headerAction:c}){const{collapsed:u,peeking:p}=Jn(),f=U3(),h=u&&!p&&!f,g=(0,a.jsx)("div",{className:"flex flex-col gap-0.5 mt-0.5",children:t});return h?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"px-3 py-1.5 pointer-coarse:py-1",children:(0,a.jsxs)("div",{className:"flex min-h-6 items-center",children:[(0,a.jsx)("span",{className:"sr-only",children:e}),(0,a.jsx)("div",{className:"h-px w-full bg-line/60","aria-hidden":"true"})]})}),g]}):s?(0,a.jsxs)(v1,{open:s.open,onOpenChange:s.onOpenChange,children:[(0,a.jsx)(Sj,{label:e,collapsible:s,menu:l,headerAction:c}),(0,a.jsx)(b1,{children:g})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(Sj,{label:e,menu:l,headerAction:c}),g]})}r(nf,"SidebarSection");var TN=(0,x.createContext)(null),d5=TN.Provider;function Kf(e){const t=(0,x.useContext)(TN);return t&&(!e||t.companyId===e)?t:null}r(Kf,"usePrimaryAgentPresentation");function pG({agentId:e,companyId:t}){const s=Kf(t);return!s||s.loading||s.primaryAgentId!==e?null:(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("span",{role:"img","aria-label":"My primary agent",className:"inline-flex shrink-0 text-accent",children:(0,a.jsx)(g1,{"aria-hidden":"true",className:"size-3.5"})})}),(0,a.jsx)(Is,{children:"My primary agent"})]})}r(pG,"PrimaryAgentIndicator");function mG({agent:e}){const t=Kf(e.companyId);if(!t||e.status==="terminated"||e.status==="pending_approval")return null;if(t.error)return(0,a.jsx)(oe,{type:"button",variant:"danger",size:"sm",onClick:t.onRetry,className:"h-auto justify-start p-0 text-xs",children:"Retry loading primary agent"});const s=t.primaryAgentId===e.id,l=t.pendingAgentId===e.id;if(s&&!l&&!t.loading)return null;const c=t.primaryAgent?.id===t.primaryAgentId?t.primaryAgent:null,u=t.loading||!!(t.primaryAgentId&&!c),p=u||!!t.pendingAgentId,f=(0,a.jsxs)(oe,{type:"button",variant:"link",size:"sm",disabled:p,onClick:t.primaryAgentId?void 0:()=>t.onChange(e.id),className:"h-auto justify-start p-0 text-xs",children:[l||u?(0,a.jsx)(Ta,{"aria-hidden":"true",className:"size-3 motion-safe:animate-spin"}):null,u?"Loading primary…":l?"Setting primary…":"Set as my primary"]});return c?(0,a.jsxs)(A1,{children:[(0,a.jsx)(yI,{asChild:!0,children:f}),(0,a.jsxs)(w1,{children:[(0,a.jsxs)("div",{className:"flex items-start justify-center gap-5 pt-2",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col items-center gap-2 text-center",children:[(0,a.jsx)(pr,{agent:c,size:64,label:`${c.name} avatar`}),(0,a.jsx)("span",{className:"max-w-full break-words text-sm font-medium",children:c.name})]}),(0,a.jsx)(MI,{"aria-hidden":"true",className:"mt-5 size-6 shrink-0 text-ink-3"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col items-center gap-2 text-center",children:[(0,a.jsx)(pr,{agent:e,size:64,label:`${e.name} avatar`,className:"rounded-xl ring-1 ring-accent ring-offset-2 ring-offset-bg"}),(0,a.jsxs)("span",{className:"flex max-w-full items-center justify-center gap-1.5 text-sm font-medium",children:[(0,a.jsx)("span",{className:"min-w-0 break-words",children:e.name}),(0,a.jsx)("span",{role:"img","aria-label":"New primary agent",className:"inline-flex shrink-0 text-accent",children:(0,a.jsx)(g1,{"aria-hidden":"true",className:"size-3.5"})})]})]})]}),(0,a.jsxs)(C1,{children:[(0,a.jsx)(j1,{children:"Change your primary agent?"}),(0,a.jsxs)(y1,{className:"break-words",children:["This will make ",e.name," your primary agent, do you want to do this?"]})]}),(0,a.jsxs)(S1,{className:"flex-row justify-between sm:justify-between",children:[(0,a.jsx)(N1,{children:"Cancel"}),(0,a.jsx)(k1,{disabled:p,onClick:r(()=>t.onChange(e.id),"onClick"),children:"Set as my primary"})]})]})]},c.id):f}r(mG,"SetPrimaryAgentButton");var RN=(0,x.createContext)(null),MN=(0,x.createContext)(null);function f5({children:e}){const[t,s]=(0,x.useState)(!1),[l,c]=(0,x.useState)({}),[u,p]=(0,x.useState)(!1),[f,h]=(0,x.useState)(!1),[g,v]=(0,x.useState)({}),[y,j]=(0,x.useState)(!1),[k,S]=(0,x.useState)(!1),[N,I]=(0,x.useState)({}),[C,M]=(0,x.useState)(!1),R=(0,x.useCallback)((ce={})=>{c(ce),s(!0)},[]),_=(0,x.useCallback)(()=>{s(!1),c({})},[]),D=(0,x.useCallback)(()=>{p(!0)},[]),U=(0,x.useCallback)(()=>{p(!1)},[]),K=(0,x.useCallback)((ce={})=>{v(ce),h(!0)},[]),z=(0,x.useCallback)(()=>{h(!1),v({})},[]),E=(0,x.useCallback)(()=>{j(!0)},[]),B=(0,x.useCallback)(()=>{j(!1)},[]),O=(0,x.useCallback)((ce={})=>{I(ce),S(!0)},[]),Q=(0,x.useCallback)(()=>{S(!1),I({})},[]),V=(0,x.useMemo)(()=>({newIssueOpen:t,newIssueDefaults:l,newProjectOpen:u,newGoalOpen:f,newGoalDefaults:g,newAgentOpen:y,onboardingOpen:k,onboardingOptions:N,onboardingRouteDismissed:C}),[t,l,u,f,g,y,k,N,C]),ue=(0,x.useMemo)(()=>({openNewIssue:R,closeNewIssue:_,openNewProject:D,closeNewProject:U,openNewGoal:K,closeNewGoal:z,openNewAgent:E,closeNewAgent:B,openOnboarding:O,closeOnboarding:Q,setOnboardingRouteDismissed:M}),[R,_,D,U,K,z,E,B,O,Q,M]);return(0,a.jsx)(MN.Provider,{value:ue,children:(0,a.jsx)(RN.Provider,{value:V,children:e})})}r(f5,"DialogProvider");function $s(){const e=(0,x.useContext)(MN);if(!e)throw new Error("useDialogActions must be used within DialogProvider");return e}r($s,"useDialogActions");function qf(){const e=(0,x.useContext)(RN);if(!e)throw new Error("useDialogState must be used within DialogProvider");return e}r(qf,"useDialogState");function Vc(){return{...qf(),...$s()}}r(Vc,"useDialog");var p5={list:r(e=>je.get(`/companies/${e}/built-in-agents`),"list"),provision:r((e,t,s={})=>je.post(`/companies/${e}/built-in-agents/${t}/provision`,s),"provision"),reset:r((e,t,s)=>je.post(`/companies/${e}/built-in-agents/${t}/reset`,s?{resources:s}:{}),"reset"),reconcile:r((e,t)=>je.post(`/companies/${e}/built-in-agents/${t}/reconcile`,{}),"reconcile"),runRoutine:r((e,t,s)=>je.post(`/companies/${e}/built-in-agents/${t}/routines/${s}/run`,{}),"runRoutine"),enableRoutineSchedule:r((e,t,s)=>je.post(`/companies/${e}/built-in-agents/${t}/routines/${s}/enable`,{}),"enableRoutineSchedule"),disableRoutineSchedule:r((e,t,s)=>je.post(`/companies/${e}/built-in-agents/${t}/routines/${s}/disable`,{}),"disableRoutineSchedule")};function m5({status:e,compact:t=!1,className:s}){if(e!=="needs_setup"&&e!=="pending_approval")return null;const l=e==="pending_approval";return(0,a.jsx)(Dn,{variant:"outline",className:Y(rI.amber,t&&"px-1.5 py-0 text-(length:--text-nano)",s),title:l?"Waiting on board hire approval before the feature can run":"Needs adapter/model setup before the feature can run",children:l?t?"Approval":"Pending approval":t?"Setup":"Needs setup"})}r(m5,"BuiltInLifecycleChip");function oh(e,t){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1)if(e[s]!==t[s])return!1;return!0}r(oh,"areEqual$2");function ch(e,t,s){return og(e,t,s).map(l=>l.id)}r(ch,"buildOrderIds$2");function h5({agents:e,companyId:t,userId:s}){const l=(0,x.useMemo)(()=>({leadershipFirst:!0}),[]),c=(0,x.useMemo)(()=>t?Y3(t,s):null,[t,s]),[u,p]=(0,x.useState)(()=>c?ch(e,th(c),l):e.map(f=>f.id));return(0,x.useEffect)(()=>{const f=c?ch(e,th(c),l):e.map(h=>h.id);p(h=>oh(h,f)?h:f)},[e,c,l]),(0,x.useEffect)(()=>{if(!c)return;const f=r(v=>{const y=ch(e,v,l);p(j=>oh(j,y)?j:y)},"syncFromIds"),h=r(v=>{v.key===c&&f(th(c))},"onStorage"),g=r(v=>{const y=v.detail;!y||y.storageKey!==c||f(y.orderedIds)},"onCustomEvent");return window.addEventListener("storage",h),window.addEventListener(Vy,g),()=>{window.removeEventListener("storage",h),window.removeEventListener(Vy,g)}},[e,c,l]),{orderedAgents:(0,x.useMemo)(()=>og(e,u,l),[e,u,l]),orderedIds:u,persistOrder:(0,x.useCallback)(f=>{const h=new Set(e.map(v=>v.id)),g=f.filter(v=>h.has(v));for(const v of og(e,[],l))g.includes(v.id)||g.push(v.id);p(v=>oh(v,g)?v:g),c&&W3(c,g)},[e,c,l])}}r(h5,"useAgentOrder");var Sg={listMine:r(e=>je.get(`/companies/${e}/resource-memberships/me`),"listMine"),updateProject:r((e,t,s)=>je.put(`/companies/${e}/resource-memberships/me/projects/${t}`,s),"updateProject"),updateAgent:r((e,t,s)=>je.put(`/companies/${e}/resource-memberships/me/agents/${t}`,s),"updateAgent")};function g5(){return{projectMemberships:{},agentMemberships:{},starredProjectIds:[],starredAgentIds:[],starredDocumentIds:[],projectStarredAt:{},agentStarredAt:{},documentStarredAt:{},updatedAt:null}}r(g5,"emptyMemberships");function x5(e){return e==="project"?{ids:"starredProjectIds",at:"projectStarredAt",state:"projectMemberships"}:{ids:"starredAgentIds",at:"agentStarredAt",state:"agentMemberships"}}r(x5,"starKeys");function Nj(e,t,s,l){const c=e??g5(),u=x5(t),p=c[u.state]??{},f=p[s]==="left"?"left":"joined",h=l.starred===!0?"joined":l.state??f,g=c[u.ids]??[],v={...c[u.at]??{}},y=g.includes(s),j=h==="left"?!1:l.starred===!0?!0:l.starred===!1?!1:y;let k=g;return j&&!y?(k=[s,...g],v[s]=new Date):!j&&y&&(k=g.filter(S=>S!==s),delete v[s]),{...c,[u.state]:{...p,[s]:h},[u.ids]:k,[u.at]:v,updatedAt:new Date}}r(Nj,"applyMembershipChange");function DN(e,t,s){return(t==="project"?e?.projectMemberships[s]:e?.agentMemberships[s])==="left"?"left":"joined"}r(DN,"resourceMembershipState");function ON(e,t,s){const l=t==="project"?e?.starredProjectIds:t==="agent"?e?.starredAgentIds:e?.starredDocumentIds;return Array.isArray(l)&&l.includes(s)}r(ON,"isStarred");function LN(e,t){const s=t==="project"?e?.starredProjectIds:t==="agent"?e?.starredAgentIds:e?.starredDocumentIds;return Array.isArray(s)?s:[]}r(LN,"starredResourceIds");function V0(e){return me({queryKey:P.resourceMemberships.mine(e??"__none__"),queryFn:r(()=>Sg.listMine(e),"queryFn"),enabled:!!e})}r(V0,"useResourceMemberships");function zN(e){const t=kn(),{pushToast:s}=Ti(),l=P.resourceMemberships.mine(e??"__none__");return Bt({mutationFn:r(c=>{if(!e)throw new Error("Select an organization first.");const u={state:c.state,starred:c.starred};return c.resourceType==="project"?Sg.updateProject(e,c.resourceId,u):Sg.updateAgent(e,c.resourceId,u)},"mutationFn"),onMutate:r(async c=>{await t.cancelQueries({queryKey:l});const u=t.getQueryData(l);return t.setQueryData(l,Nj(u,c.resourceType,c.resourceId,{state:c.state,starred:c.starred})),{previous:u}},"onMutate"),onError:r((c,u,p)=>{p?.previous&&t.setQueryData(l,p.previous);const f=u.starred!==void 0?u.starred?"star":"unstar":u.state==="left"?"leave":"join";s({title:`Couldn't ${f} ${u.resourceName}.`,body:c instanceof Error?c.message:"Try again.",tone:"error"})},"onError"),onSuccess:r((c,u)=>{t.setQueryData(l,p=>Nj(p,u.resourceType,c.resourceId,{state:c.state,starred:c.starredAt!=null}))},"onSuccess"),onSettled:r(()=>{t.invalidateQueries({queryKey:["primary-agent",e]}),t.invalidateQueries({queryKey:l})},"onSettled")})}r(zN,"useResourceMembershipMutation");var b5={healthy:"bg-emerald-500/90 text-white",warning:"bg-amber-500/95 text-amber-950",critical:"bg-red-500/90 text-white"},v5={healthy:"Budget healthy",warning:"Budget warning",critical:"Paused by budget"};function PN({title:e,level:t="critical"}){const s=e??v5[t];return(0,a.jsx)("span",{title:s,"aria-label":s,className:`ml-auto inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full shadow-(--shadow-extract-3) ${b5[t]}`,children:(0,a.jsx)(yS,{className:"h-3 w-3"})})}r(PN,"BudgetSidebarMarker");var y5="opacity-100 sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100";function $N({starred:e,resourceName:t,pending:s=!1,error:l=!1,size:c="row",onToggle:u,quiet:p=!1,className:f,revealClassName:h}){const g=e?`Unstar ${t}`:`Star ${t}`,v=s?Ta:b0;function y(j){j.preventDefault(),j.stopPropagation(),!s&&u(!e)}return r(y,"handleClick"),c==="button"?(0,a.jsx)(oe,{type:"button",size:"icon-sm",variant:"ghost","aria-label":g,"aria-pressed":e,"aria-busy":s?"true":void 0,disabled:s,onClick:y,title:l?"Couldn't save — retry":void 0,className:f,children:(0,a.jsx)(v,{className:Y("h-4 w-4",s&&"motion-safe:animate-spin",!s&&l&&"text-bad",!s&&e&&!l&&"fill-amber-500 text-amber-500",!s&&l&&"text-red-500")})}):(0,a.jsx)(oe,{type:"button",size:"icon-xs",variant:"ghost","aria-label":g,"aria-pressed":e,"aria-busy":s?"true":void 0,disabled:s,onClick:y,title:l?"Couldn't save — retry":void 0,className:Y("h-6 w-6 shrink-0",l||s||e&&!p?"opacity-100":h??y5,f),children:(0,a.jsx)(v,{className:Y("h-3.5 w-3.5",s&&"motion-safe:animate-spin",!s&&l&&"text-red-500",!s&&!l&&e&&"fill-amber-500 text-amber-500",!s&&!l&&!e&&"text-ink-3")})})}r($N,"StarToggle");var j5=3,Cj=12e4,w5=[{value:"top",label:"Top"},{value:"alphabetical",label:"Alphabetical"},{value:"recent",label:"Recent"}];function Fl(e,t){const s=e[t];if(!s)return 0;const l=new Date(s).getTime();return Number.isFinite(l)?l:0}r(Fl,"agentTimestamp");function Aj(e,t){if(t==="top")return e;const s=[...e];return t==="alphabetical"?(s.sort((l,c)=>l.name.localeCompare(c.name,void 0,{sensitivity:"base"})),s):(s.sort((l,c)=>{const u=Fl(c,"lastHeartbeatAt")-Fl(l,"lastHeartbeatAt");if(u!==0)return u;const p=Fl(c,"updatedAt")-Fl(l,"updatedAt");if(p!==0)return p;const f=Fl(c,"createdAt")-Fl(l,"createdAt");return f!==0?f:l.name.localeCompare(c.name,void 0,{sensitivity:"base"})}),s)}r(Aj,"sortAgents");var k5="opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-within/agent:opacity-100";function S5({activeAgentId:e,activeTab:t,agent:s,disabled:l,isMobile:c,leaving:u,onLeaveAgent:p,onPauseResume:f,rail:h,runCount:g,setSidebarOpen:v,builtInStatus:y,starred:j=!1,onToggleStar:k,starPending:S=!1}){const N=dr(s),I=t?`${Dd(s)}/${t}`:Dd(s),C=`${Dd(s)}/configuration`,M=e===N,R=s.status==="paused",_=R&&s.pauseReason==="budget",D=s.orgChainHealth?.status==="invalid_org_chain",U=R?"Resume agent":"Pause agent",K=l||s.status==="pending_approval"||_||R&&D,z=l?"Updating...":_?"Budget paused":R&&D?"Invalid org chain":U,E=y==="needs_setup"||y==="pending_approval",B=[E?`Built-in agent ${y.replace(/_/g," ")}`:null,D?"Invalid reporting chain":null].filter(Boolean).join(", ")||void 0,O=(0,a.jsx)(Ye,{to:I,label:s.name,iconNode:(0,a.jsx)(pr,{agent:s,size:16,className:"shrink-0 h-4 w-4"}),active:M,liveCount:g,labelClassName:E?"min-w-(--sz-4_5rem) flex-initial":void 0,className:Y("min-w-0 flex-1",j&&!c?"pr-14":"pr-8"),trailing:E||D?(0,a.jsxs)("span",{className:"ml-1 flex shrink-0 items-center gap-1",children:[E?(0,a.jsx)(m5,{status:y,compact:!0}):null,D?(0,a.jsx)(ni,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):null]}):void 0,trailingLabel:B,liveAccessory:s.pauseReason==="budget"?(0,a.jsx)(PN,{title:"Agent paused by budget"}):void 0});return h?O:(0,a.jsxs)("div",{className:"group/agent relative flex items-center",children:[O,j&&!c&&k?(0,a.jsx)("span",{className:"absolute right-10 top-1/2 -translate-y-1/2",children:(0,a.jsx)($N,{size:"row",quiet:!0,starred:!0,pending:S,resourceName:s.name,onToggle:r(()=>k(s,!1),"onToggle"),revealClassName:k5})}):null,(0,a.jsxs)(tl,{children:[(0,a.jsx)(Jr,{asChild:!0,children:(0,a.jsx)(oe,{variant:"ghost",size:"icon-xs",className:Y("absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 transition-opacity data-[state=open]:pointer-events-auto data-[state=open]:opacity-100",c?"opacity-100":"pointer-events-none opacity-0 group-hover/agent:pointer-events-auto group-hover/agent:opacity-100 group-focus-within/agent:pointer-events-auto group-focus-within/agent:opacity-100"),"aria-label":`Open actions for ${s.name}`,children:(0,a.jsx)(Mf,{className:"h-3.5 w-3.5"})})}),(0,a.jsxs)(el,{align:"end",className:"w-48",children:[k?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(Sn,{onClick:r(()=>{S||k(s,!j)},"onClick"),disabled:S,children:[S?(0,a.jsx)(Ta,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)(b0,{className:Y("size-4",j&&"fill-amber-500 text-amber-500")}),(0,a.jsx)("span",{children:j?"Remove from starred":"Star agent"})]}),(0,a.jsx)(Ei,{})]}):null,(0,a.jsx)(Sn,{asChild:!0,children:(0,a.jsxs)(mn,{to:C,onClick:r(()=>{c&&v(!1)},"onClick"),children:[(0,a.jsx)(K0,{className:"size-4"}),(0,a.jsx)("span",{children:"Edit agent"})]})}),(0,a.jsx)(Ei,{}),(0,a.jsxs)(Sn,{onClick:r(()=>{K||f(s,R?"resume":"pause")},"onClick"),disabled:K,title:_?"Agent was paused by budget limits":void 0,children:[R?(0,a.jsx)(mS,{className:"size-4"}):(0,a.jsx)(B0,{className:"size-4"}),(0,a.jsx)("span",{children:z})]}),(0,a.jsx)(Ei,{}),(0,a.jsxs)(Sn,{onClick:r(()=>{u||p(s)},"onClick"),disabled:u,children:[u?(0,a.jsx)(Ta,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)($f,{className:"size-4"}),(0,a.jsx)("span",{children:u?"Leaving...":"Leave agent"})]})]})]})]})}r(S5,"SidebarAgentItem");function N5({streamlined:e=!1}={}){const[t,s]=(0,x.useState)(!0),[l,c]=(0,x.useState)(()=>new Set),[u,p]=(0,x.useState)(0),f=(0,x.useRef)(new Map),h=kn(),{selectedCompanyId:g}=vt(),v=Kf(g),{openNewAgent:y}=$s(),{isMobile:j,setSidebarOpen:k,collapsed:S,peeking:N}=Jn(),I=S&&!N,{pushToast:C}=Ti(),M=hn(),{data:R}=me({queryKey:P.agents.list(g),queryFn:r(()=>Fa.list(g),"queryFn"),enabled:!!g}),{data:_}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn"),enabled:!!g}),D=_?.enableBuiltInAgents===!0,{data:U}=me({queryKey:P.builtInAgents.list(g),queryFn:r(()=>p5.list(g),"queryFn"),enabled:!!g&&D}),K=(0,x.useMemo)(()=>{const $=new Map;if(!D)return $;for(const qe of U??[])qe.agentId&&$.set(qe.agentId,qe.status);return $},[U,D]),{data:z}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),E=V0(g),B=zN(g),O=P.liveRuns(g),Q=Ac({companyId:g,resourceKey:"live-runs",queryKey:O,enabled:!!g,refetchInterval:!1,leaderOnly:!0}),{data:V,dataUpdatedAt:ue}=me({queryKey:O,queryFn:r(()=>Lf.liveRunsForCompany(g),"queryFn"),enabled:Q.enabled,refetchInterval:Q.refetchInterval});_c(Q,V,ue);const ce=(0,x.useMemo)(()=>{const $=new Map;for(const qe of V??[])$.set(qe.agentId,($.get(qe.agentId)??0)+1);return $},[V]),X=(0,x.useMemo)(()=>{const $=new Set;for(const[qe,Xe]of ce)Xe>0&&$.add(qe);return $},[ce]),A=(0,x.useMemo)(()=>(R??[]).filter($=>$.status!=="terminated"&&(!E.isSuccess||DN(E.data,"agent",$.id)!=="left")),[R,E.data,E.isSuccess]),ee=z?.user?.id??z?.session?.userId??null,ie=(0,x.useMemo)(()=>g?Q3(g,ee):null,[ee,g]),[le,Ae]=(0,x.useState)(()=>ie?nh(ie):"top"),{orderedAgents:de}=h5({agents:A,companyId:g,userId:ee}),we=(0,x.useMemo)(()=>Aj(de,le),[de,le]),ye=(0,x.useMemo)(()=>new Set(we.map($=>$.id)),[we]);(0,x.useEffect)(()=>{const $=Date.now();for(const qe of X)f.current.set(qe,$);for(const qe of f.current.keys())ye.has(qe)||f.current.delete(qe)},[X,ye]);const Me=(0,x.useMemo)(()=>{const $=Date.now(),qe=f.current;return we.filter(Xe=>{if((ce.get(Xe.id)??0)>0)return!0;const xt=qe.get(Xe.id);return xt!==void 0&&$-xt<=Cj})},[ce,u,we]),he=Me.length>0,ve=e?he?Me:we.slice(0,j5):we,et=e&&we.length>0,Pe=M.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/),Ee=Pe?.[1]??null,ct=Pe?.[2]??null;(0,x.useEffect)(()=>{if(!ie){Ae("top");return}Ae(nh(ie))},[ie]),(0,x.useEffect)(()=>{if(!ie)return;const $=r(Xe=>{Xe.key===ie&&Ae(nh(ie))},"onStorage"),qe=r(Xe=>{const xt=Xe.detail;!xt||xt.storageKey!==ie||Ae(xt.sortMode)},"onCustomEvent");return window.addEventListener("storage",$),window.addEventListener(Hy,qe),()=>{window.removeEventListener("storage",$),window.removeEventListener(Hy,qe)}},[ie]),(0,x.useEffect)(()=>{if(!e)return;const $=Date.now();let qe=null;for(const xt of we){if((ce.get(xt.id)??0)>0)continue;const at=f.current.get(xt.id);if(at===void 0)continue;const Kt=at+Cj;Kt<$||(qe=qe===null?Kt:Math.min(qe,Kt))}if(qe===null)return;const Xe=window.setTimeout(()=>{p(xt=>xt+1)},Math.max(0,qe-$+1));return()=>{window.clearTimeout(Xe)}},[e,we,ce,u]);const Ve=(0,x.useCallback)($=>{const qe=$==="alphabetical"||$==="recent"?$:"top";Ae(qe),ie&&G3(ie,qe)},[ie]),yt=Bt({mutationFn:r(({agent:$,action:qe})=>qe==="pause"?Fa.pause($.id,g??void 0):Fa.resume($.id,g??void 0),"mutationFn"),onMutate:r(({agent:$})=>{c(qe=>{const Xe=new Set(qe);return Xe.add($.id),Xe})},"onMutate"),onSuccess:r(async($,{agent:qe,action:Xe})=>{g&&await Promise.all([h.invalidateQueries({queryKey:P.agents.list(g)}),h.invalidateQueries({queryKey:P.liveRuns(g)}),h.invalidateQueries({queryKey:P.dashboard(g)})]),await Promise.all([h.invalidateQueries({queryKey:P.agents.detail(qe.id)}),h.invalidateQueries({queryKey:P.agents.detail(dr(qe))})]),C({title:Xe==="pause"?"Agent paused":"Agent resumed",body:qe.name,tone:"success"})},"onSuccess"),onError:r(($,{agent:qe,action:Xe})=>{C({title:Xe==="pause"?"Could not pause agent":"Could not resume agent",body:$ instanceof Error?$.message:qe.name,tone:"error"})},"onError"),onSettled:r(($,qe,{agent:Xe})=>{c(xt=>{const at=new Set(xt);return at.delete(Xe.id),at})},"onSettled")}),Zt=(0,x.useCallback)($=>B.mutate({resourceType:"agent",resourceId:$.id,resourceName:$.name,state:"left"}),[B]),ge=(0,x.useCallback)($=>B.isPending&&B.variables?.resourceType==="agent"&&B.variables.resourceId===$.id,[B.isPending,B.variables]),Oe=(0,x.useCallback)(($,qe)=>B.mutate({resourceType:"agent",resourceId:$.id,resourceName:$.name,starred:qe}),[B]),De=(0,x.useCallback)($=>B.isPending&&B.variables?.resourceType==="agent"&&B.variables.resourceId===$.id&&B.variables.starred!==void 0,[B.isPending,B.variables]),ut=(0,x.useMemo)(()=>new Set(LN(E.data,"agent")),[E.data]),Ht=(0,x.useMemo)(()=>Aj(A.filter($=>ut.has($.id)),"alphabetical"),[A,ut]),Vt=(0,x.useMemo)(()=>ve.filter($=>!ut.has($.id)),[ve,ut]),gt=v&&!v.loading?A.find($=>$.id===v.primaryAgentId):void 0,cn=r(($,qe)=>(0,a.jsx)(S5,{activeAgentId:Ee,activeTab:ct,agent:$,disabled:l.has($.id),isMobile:j,leaving:ge($),onLeaveAgent:Zt,onPauseResume:r((Xe,xt)=>yt.mutate({agent:Xe,action:xt}),"onPauseResume"),rail:I,runCount:ce.get($.id)??0,setSidebarOpen:k,builtInStatus:K.get($.id),starred:qe||ON(E.data,"agent",$.id),onToggleStar:Oe,starPending:De($)},$.id),"renderAgentRow");return(0,a.jsxs)(nf,{label:"Agents",collapsible:{open:t,onOpenChange:s},headerAction:{ariaLabel:"New agent",icon:ns,onClick:y},menu:{ariaLabel:"Agents section actions",actions:[{type:"item",label:"Browse agents",icon:Gr,href:"/agents/all"},{type:"separator"}],radioLabel:"Agent sort",radioChoices:w5,radioValue:le,onRadioValueChange:Ve},children:[[...gt?[gt]:[],...Ht.filter($=>$.id!==gt?.id),...Vt.filter($=>$.id!==gt?.id)].map($=>cn($,ut.has($.id))),et&&(()=>{const $=(0,a.jsxs)(mn,{to:"/agents/all",state:Df,"aria-label":I?"See all agents":void 0,onClick:r(()=>{j&&k(!1)},"onClick"),className:"flex items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink",children:[(0,a.jsx)(Gr,{className:"shrink-0 h-4 w-4"}),(0,a.jsx)("span",{className:I?"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none":void 0,children:"See all agents"})]});return I?(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:$}),(0,a.jsx)(Is,{side:"right",children:"See all agents"})]}):$})()]})}r(N5,"SidebarAgents");var C5="opacity-0 transition-opacity group-hover/starred-project:opacity-100 group-focus-within/starred-project:opacity-100";function A5(){const{selectedCompanyId:e}=vt(),{isMobile:t,setSidebarOpen:s,collapsed:l,peeking:c}=Jn(),u=l&&!c,p=hn(),{data:f}=me({queryKey:P.projects.list(e),queryFn:r(()=>mr.list(e),"queryFn"),enabled:!!e}),h=V0(e),g=zN(e),v=p.pathname.match(/^\/(?:[^/]+\/)?projects\/([^/]+)/)?.[1]??null,y=(0,x.useMemo)(()=>{if(!h.isSuccess)return[];const N=new Set(LN(h.data,"project"));if(N.size===0)return[];const I=new Map((f??[]).map(C=>[C.id,C]));return Array.from(N).map(C=>I.get(C)).filter(C=>!!C).sort((C,M)=>C.name.localeCompare(M.name,void 0,{sensitivity:"base"}))},[h.data,h.isSuccess,f]),j=(0,x.useCallback)(N=>g.mutate({resourceType:"project",resourceId:N.id,resourceName:N.name,starred:!1}),[g]),k=(0,x.useCallback)(N=>g.mutate({resourceType:"project",resourceId:N.id,resourceName:N.name,state:"left"}),[g]),S=(0,x.useCallback)(N=>g.isPending&&g.variables?.resourceType==="project"&&g.variables.resourceId===N.id,[g.isPending,g.variables]);return!h.isSuccess||y.length===0?null:(0,a.jsx)("div",{className:"flex flex-col gap-0.5","aria-label":"Starred projects",children:y.map(N=>{const I=Zk(N),C=v===I||v===N.id,M=S(N),R=M&&g.variables?.starred===!1,_=M&&g.variables?.state==="left",D=ON(h.data,"project",N.id),U=(0,a.jsx)(_5,{project:N,active:C,rail:u,onNavigate:r(()=>{t&&s(!1)},"onNavigate")});return(0,a.jsxs)("div",{className:"group/starred-project relative flex items-center",children:[u?(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("div",{className:"min-w-0 flex-1",children:U})}),(0,a.jsx)(Is,{side:"right",children:N.name})]}):U,!u&&!t?(0,a.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,a.jsx)($N,{size:"row",quiet:!0,starred:D,pending:R,resourceName:N.name,onToggle:r(()=>j(N),"onToggle"),revealClassName:C5})}):null,!u&&t?(0,a.jsxs)(tl,{children:[(0,a.jsx)(Jr,{asChild:!0,children:(0,a.jsx)(oe,{variant:"ghost",size:"icon-xs",className:"absolute right-3 top-1/2 h-6 w-6 -translate-y-1/2 opacity-100","aria-label":`Open actions for ${N.name}`,children:(0,a.jsx)(Mf,{className:"h-3.5 w-3.5"})})}),(0,a.jsxs)(el,{align:"end",className:"w-48",children:[(0,a.jsxs)(Sn,{onClick:r(()=>{M||j(N)},"onClick"),disabled:M,children:[R?(0,a.jsx)(Ta,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)(b0,{className:"size-4 fill-amber-500 text-amber-500"}),(0,a.jsx)("span",{children:"Remove from starred"})]}),(0,a.jsx)(Ei,{}),(0,a.jsxs)(Sn,{onClick:r(()=>{M||k(N)},"onClick"),disabled:M,children:[_?(0,a.jsx)(Ta,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)($f,{className:"size-4"}),(0,a.jsx)("span",{children:"Leave project"})]})]})]}):null]},N.id)})})}r(A5,"SidebarStarredProjects");function _5({project:e,active:t,rail:s,onNavigate:l}){return(0,a.jsxs)(mn,{to:`/projects/${Zk(e)}/issues`,state:Df,"aria-current":t?"page":void 0,onClick:l,className:Y("flex min-w-0 flex-1 items-center gap-2.5 mx-2 rounded-lg px-2 py-1.5 pointer-coarse:py-1 text-(length:--text-compact) font-medium transition-colors",!s&&"pl-6 pr-8",t?oo.active:Y(oo.rest,"text-ink/80")),children:[(0,a.jsx)(x1,{color:e.color??null,icon:e.icon??null,size:"xs"}),(0,a.jsx)("span",{className:s?n1:"flex-1 truncate",children:e.name}),!s&&e.visibility==="private"?(0,a.jsx)(eg,{className:"size-3.5 shrink-0 text-ink-3","aria-label":"Private project"}):null,!s&&e.pauseReason==="budget"?(0,a.jsx)(PN,{title:"Project paused by budget"}):null]})}r(_5,"SidebarStarredProjectLink");var Ng="wardmote:recent-tasks-updated",UN="wardmote.recentTasks.v2:",E5="wardmote.recentTasks:";function BN(e,t){return`${UN}${e}:${t??"__local_board__"}`}r(BN,"getRecentTasksStorageKey");function I5(e,t){if(!e||typeof e!="object")return!1;const s=e;return s.companyId===t&&typeof s.id=="string"&&s.id.length>0&&typeof s.title=="string"&&(s.identifier===null||typeof s.identifier=="string")&&typeof s.status=="string"&&typeof s.recordedAt=="number"&&Number.isFinite(s.recordedAt)&&(s.snapshotUpdatedAt===void 0||typeof s.snapshotUpdatedAt=="number"&&Number.isFinite(s.snapshotUpdatedAt))}r(I5,"isRecentTaskEntry");function Wr(e,t){if(typeof window>"u")return[];try{const s=e.startsWith(UN)?E5+e.slice(24):e,l=window.localStorage.getItem(e)??window.localStorage.getItem(s),c=JSON.parse(l??"[]");return Array.isArray(c)?KN(c.filter(u=>I5(u,t))):[]}catch{return[]}}r(Wr,"readRecentTasks");function T5(e,t){if(!(typeof window>"u")){try{if(window.localStorage.getItem(e)!==null)return}catch{return}Ff(e,Wr(e,t))}}r(T5,"migrateRecentTasks");function KN(e){const t=new Set;return[...e].sort((s,l)=>l.recordedAt-s.recordedAt).filter(s=>t.has(s.id)?!1:(t.add(s.id),!0)).slice(0,5)}r(KN,"normalizeRecentTasks");function R5(e,t){typeof window>"u"||window.dispatchEvent(new CustomEvent(Ng,{detail:{storageKey:e,entries:t}}))}r(R5,"publishRecentTasks");function Ff(e,t){if(typeof window>"u")return;const s=KN(t);try{const l=JSON.stringify(s);if(window.localStorage.getItem(e)===l)return;window.localStorage.setItem(e,l)}catch{}R5(e,s)}r(Ff,"writeRecentTasks");function W0(e,t){if(e.id!==t.id||e.companyId!==t.companyId)return e;const s=new Date(t.updatedAt).getTime();return!Number.isFinite(s)||e.snapshotUpdatedAt!==void 0&&s<e.snapshotUpdatedAt?e:s===e.snapshotUpdatedAt?t.externalConversationState!==void 0&&t.externalConversationState!==e.externalConversationState?{...e,status:t.status,externalConversationState:t.externalConversationState}:e:{...e,title:t.title,identifier:t.identifier,status:t.status,externalConversationState:t.externalConversationState,snapshotUpdatedAt:s,recordedAt:Math.max(e.recordedAt,s)}}r(W0,"mergeRecentTaskSnapshot");function M5(e,t,s=new Date(e.updatedAt).getTime()){if(e.conversationAgentId)return;const l=BN(e.companyId,t),c=Wr(l,e.companyId),u=c.find(v=>v.id===e.id),p=Number.isFinite(s)?s:u?.recordedAt??Date.now(),f=new Date(e.updatedAt).getTime(),h=u?W0(u,e):{id:e.id,companyId:e.companyId,title:e.title,identifier:e.identifier,status:e.status,externalConversationState:e.externalConversationState,recordedAt:p,...Number.isFinite(f)?{snapshotUpdatedAt:f}:{}},g={...h,recordedAt:Math.max(p,h.recordedAt)};u&&u.title===g.title&&u.identifier===g.identifier&&u.status===g.status&&u.externalConversationState===g.externalConversationState&&u.recordedAt===g.recordedAt&&u.snapshotUpdatedAt===g.snapshotUpdatedAt||Ff(l,u?c.map(v=>v.id===e.id?g:v):[g,...c])}r(M5,"recordRecentTask");function D5(e,t,s){if(s.size===0)return;const l=Wr(e,t),c=l.filter(u=>!s.has(u.id));c.length!==l.length&&Ff(e,c)}r(D5,"pruneRecentTasks");function qN(e,t,s){const l=new Map(s.map(f=>[f.id,f])),c=Wr(e,t);let u=!1;const p=c.map(f=>{const h=l.get(f.id);if(!h||h.companyId!==t)return f;const g=W0(f,h);return g!==f&&(u=!0),g});u&&Ff(e,p)}r(qN,"updateRecentTaskSnapshots");var O5=1e3;function L5({companyId:e,userId:t}){const s=(0,x.useMemo)(()=>e?BN(e,t):null,[e,t]),[l,c]=(0,x.useState)(()=>s&&e?Wr(s,e):[]);(0,x.useEffect)(()=>{s&&e&&T5(s,e),c(s&&e?Wr(s,e):[])},[e,s]),(0,x.useEffect)(()=>{if(!s||!e)return;const N=r(()=>c(Wr(s,e)),"sync"),I=r(M=>{M.key===s&&N()},"onStorage"),C=r(M=>{const R=M.detail;R?.storageKey===s&&c(R.entries)},"onRecentTasksUpdated");return window.addEventListener("storage",I),window.addEventListener(Ng,C),()=>{window.removeEventListener("storage",I),window.removeEventListener(Ng,C)}},[e,s]);const u=[...l].sort((N,I)=>N.id.localeCompare(I.id)),p=JSON.stringify(u.map(N=>N.id)),f=_f({queries:u.map(N=>({queryKey:P.issues.detail(N.id),queryFn:r(()=>on.get(N.id),"queryFn"),retry:!1,staleTime:3e4}))}),h=new Map(f.flatMap(N=>N.data?[[N.data.id,N.data]]:[])),g=l.map(N=>{const I=h.get(N.id);return!I||I.companyId!==e||I.hiddenAt?N:W0(N,I)}),v=f.map(N=>`${N.dataUpdatedAt}:${N.errorUpdatedAt}:${N.status}`).join("|");(0,x.useEffect)(()=>{if(!s||!e||f.length===0)return;const N=[],I=new Set;f.forEach((C,M)=>{const R=u[M];R&&(C.data?C.data.companyId!==e||C.data.hiddenAt?I.add(R.id):N.push(C.data):C.error instanceof Ii&&[403,404].includes(C.error.status)&&I.add(R.id))}),qN(s,e,N),D5(s,e,I)},[e,p,v,s]);const[y,j]=(0,x.useState)(()=>l.map(N=>N.id)),k=JSON.stringify(l.map(N=>[N.id,N.recordedAt]));(0,x.useEffect)(()=>{const N=JSON.parse(k).map(([C])=>C);if(JSON.stringify([...y].sort((C,M)=>C.localeCompare(M)))!==p){j(N);return}if(N.every((C,M)=>C===y[M]))return;const I=window.setTimeout(()=>j(N),O5);return()=>window.clearTimeout(I)},[k,p,y,s]);const S=new Map(g.map(N=>[N.id,N]));return{entries:y.length===l.length&&y.every(N=>S.has(N))?y.map(N=>S.get(N)):g,storageKey:s}}r(L5,"useRecentTasks");var uh="h-(--profile-popover-row-height) gap-(--profile-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) focus:bg-bg-3/50 focus:text-ink",z5=":restart-wake-retry";function P5(e,t){return`wardmote.recentTasks:${e}:${t??"__local_board__"}${z5}`}r(P5,"restartWakeRetryStorageKey");function FN(e){if(!e)return new Set;try{const t=JSON.parse(window.localStorage.getItem(e)??"[]");return new Set(Array.isArray(t)?t.filter(s=>typeof s=="string"):[])}catch{return new Set}}r(FN,"readRestartWakeRetryIssueIds");function dh(e,t,s){if(!e)return;const l=FN(e);s?l.add(t):l.delete(t);try{l.size>0?window.localStorage.setItem(e,JSON.stringify([...l])):window.localStorage.removeItem(e)}catch{}}r(dh,"setRestartWakeRetryPending");function fh(e,t){return e instanceof Error&&e.message.trim()?e.message:t}r(fh,"errorMessage$2");function $5({companyId:e,liveIssueIds:t}){const{collapsed:s,peeking:l}=Jn(),c=s&&!l,{data:u,isPending:p}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1});if(!e||p)return null;const f=u?.user?.id??u?.session?.userId??null;return(0,a.jsx)(U5,{companyId:e,userId:f,liveIssueIds:t,rail:c},`${e}:${f??"__local_board__"}`)}r($5,"SidebarRecentTasks");function U5({companyId:e,userId:t,liveIssueIds:s,rail:l}){const{entries:c,storageKey:u}=L5({companyId:e,userId:t}),p=kn(),f=Of(),[h,g]=(0,x.useState)(null),[v,y]=(0,x.useState)(""),[j,k]=(0,x.useState)(null),S=P5(e,t);if(c.length===0)return null;const N=r(async _=>{await Promise.all([p.invalidateQueries({queryKey:P.issues.detail(_)}),p.invalidateQueries({queryKey:P.issues.list(e)}),p.invalidateQueries({queryKey:P.issues.activity(_)})])},"refreshIssueQueries"),I=r(_=>{g(_),y(_.title)},"beginRename"),C=r(async _=>{_.preventDefault();const D=v.trim();if(!h||!D||D===h.title){g(null);return}k("rename");try{const U=await on.update(h.id,{title:D});p.setQueryData(P.issues.detail(h.id),U),u&&qN(u,e,[U]),await N(h.id),g(null),f?.pushToast({title:"Task renamed",tone:"success"})}catch(U){f?.pushToast({title:"Task rename failed",body:fh(U,"Unable to rename this task."),tone:"error"})}finally{k(null)}},"submitRename"),M=r(async _=>{k("archive");try{await on.archiveFromInbox(_.id),await N(_.id),await p.invalidateQueries({queryKey:P.sidebarBadges(e)}),f?.pushToast({title:"Task archived from inbox",tone:"success"})}catch(D){f?.pushToast({title:"Task archive failed",body:fh(D,"Unable to archive this task from the inbox."),tone:"error"})}finally{k(null)}},"archiveTask"),R=r(async _=>{k("pause");try{const D=await on.getTreeControlState(_.id);if(D.activePauseHold?.isRoot){const U=await on.get(_.id);if(dh(S,_.id,!0),await on.releaseTreeHold(_.id,D.activePauseHold.holdId,{reason:"Restarted from Recent Tasks."}),U.assigneeAgentId){const K=await Fa.wakeup(U.assigneeAgentId,{source:"assignment",triggerDetail:"manual",reason:"recent_task_restart",payload:{issueId:U.id}},U.companyId);if(!("id"in K))throw new Error(K.message??"The assignee wake was skipped.")}dh(S,_.id,!1),f?.pushToast({title:"Task restarted",tone:"success"})}else{if(D.activePauseHold)throw new Error("This task is paused by a parent task. Restart it from the pause root.");if(FN(S).has(_.id)){const U=await on.get(_.id);if(U.assigneeAgentId){const K=await Fa.wakeup(U.assigneeAgentId,{source:"assignment",triggerDetail:"manual",reason:"recent_task_restart_retry",payload:{issueId:U.id}},U.companyId);if(!("id"in K))throw new Error(K.message??"The assignee wake was skipped.")}dh(S,_.id,!1),f?.pushToast({title:"Task restarted",tone:"success"})}else await on.createTreeHold(_.id,{mode:"pause",reason:"Paused from Recent Tasks.",releasePolicy:{strategy:"manual"}}),f?.pushToast({title:"Task paused",tone:"success"})}await p.invalidateQueries({queryKey:["issues","tree-control-state",_.id]})}catch(D){f?.pushToast({title:"Task pause update failed",body:fh(D,"Unable to pause or restart this task."),tone:"error"})}finally{k(null)}},"toggleTaskPause");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(nf,{label:"Recent Tasks",children:c.map(_=>(0,a.jsxs)("div",{className:"sidebar-action-row group/recent-task relative",children:[(0,a.jsx)(Ye,{to:`/issues/${_.id}`,label:_.title,trailing:_.status==="in_review"&&_.externalConversationState==="waiting"?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Idle"}):void 0,trailingLabel:_.status==="in_review"&&_.externalConversationState==="waiting"?"Idle":void 0,className:l?void 0:"sidebar-action-link pointer-coarse:pr-8 [.sidebar-action-row:is(:hover,:focus-within)_&]:text-ink [.sidebar-action-row:has(.sidebar-action-menu[data-state=open])_&]:text-ink",liveCount:s.has(_.id)?1:void 0}),l?null:(0,a.jsxs)(tl,{children:[(0,a.jsx)(Jr,{asChild:!0,children:(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`More actions for ${_.title}`,className:"sidebar-action-menu absolute right-2 top-(--pct-50) z-10 -translate-y-(--pct-50) pointer-events-none opacity-0 transition-opacity focus-visible:pointer-events-auto focus-visible:opacity-100 pointer-coarse:pointer-events-auto pointer-coarse:opacity-100 pointer-coarse:before:hidden group-hover/recent-task:pointer-events-auto group-hover/recent-task:opacity-100 group-focus-within/recent-task:pointer-events-auto group-focus-within/recent-task:opacity-100 data-[state=open]:pointer-events-auto data-[state=open]:opacity-100",children:(0,a.jsx)(Mf,{"aria-hidden":"true"})})}),(0,a.jsxs)(el,{side:"right",align:"start",className:"w-(--profile-popover-width) rounded-xl p-1.5 shadow-(--shadow-profile-popover)",children:[(0,a.jsxs)(Sn,{className:uh,onSelect:r(()=>I(_),"onSelect"),children:[(0,a.jsx)(K0,{"aria-hidden":"true"}),"Rename"]}),(0,a.jsxs)(Sn,{className:uh,disabled:j!==null,onSelect:r(()=>{M(_)},"onSelect"),children:[(0,a.jsx)(I1,{"aria-hidden":"true"}),"Archive"]}),(0,a.jsxs)(Sn,{className:uh,disabled:j!==null,onSelect:r(()=>{R(_)},"onSelect"),children:[(0,a.jsx)(nl,{"aria-hidden":"true"}),"Pause/Restart"]})]})]})]},_.id))}),(0,a.jsx)(ws,{open:h!==null,onOpenChange:r(_=>{!_&&j!=="rename"&&g(null)},"onOpenChange"),children:(0,a.jsx)(Ps,{className:"sm:max-w-md",children:(0,a.jsxs)("form",{className:"grid gap-4",onSubmit:r(_=>{C(_)},"onSubmit"),children:[(0,a.jsxs)(bo,{children:[(0,a.jsx)(Ds,{children:"Rename task"}),(0,a.jsx)(vo,{children:"Choose a short, clear name for this task."})]}),(0,a.jsx)(Wn,{autoFocus:!0,"aria-label":"Task name",value:v,disabled:j==="rename",onChange:r(_=>y(_.target.value),"onChange")}),(0,a.jsxs)(Pf,{children:[(0,a.jsx)(oe,{type:"button",variant:"secondary",disabled:j==="rename",onClick:r(()=>g(null),"onClick"),children:"Cancel"}),(0,a.jsx)(oe,{type:"submit",disabled:j==="rename"||!v.trim(),children:j==="rename"?"Saving...":"Save"})]})]})})})]})}r(U5,"RecentTasksList");var B5={list:r((e,t={})=>{const s=new URLSearchParams;t.includeDismissed&&s.set("includeDismissed","true"),t.archived&&s.set("archived","true"),t.all&&s.set("all","true"),t.activitySince&&s.set("activitySince",t.activitySince),t.activityUntil&&s.set("activityUntil",t.activityUntil),t.queue&&s.set("queue",t.queue),t.sort&&s.set("sort",t.sort),t.cursor&&s.set("cursor",t.cursor),t.limit!==void 0&&s.set("limit",String(t.limit));const l=s.toString();return je.get(`/companies/${e}/attention${l?`?${l}`:""}`)},"list"),count:r(e=>je.get(`/companies/${e}/attention/count`),"count")},dd={list:r(e=>je.get(`/companies/${e}/inbox-dismissals`),"list"),dismiss:r((e,t)=>je.post(`/companies/${e}/inbox-dismissals`,{itemKey:t}),"dismiss"),snooze:r((e,t,s)=>je.post(`/companies/${e}/inbox-dismissals`,{itemKey:t,kind:"snooze",snoozedUntil:s}),"snooze"),restore:r((e,t)=>je.delete(`/companies/${e}/inbox-dismissals/${encodeURIComponent(t)}`),"restore")},HN={list:r((e,t)=>je.get(`/companies/${e}/approvals${t?`?status=${encodeURIComponent(t)}`:""}`),"list"),create:r((e,t)=>je.post(`/companies/${e}/approvals`,t),"create"),get:r(e=>je.get(`/approvals/${e}`),"get"),approve:r((e,t)=>je.post(`/approvals/${e}/approve`,{decisionNote:t}),"approve"),reject:r((e,t)=>je.post(`/approvals/${e}/reject`,{decisionNote:t}),"reject"),requestRevision:r((e,t)=>je.post(`/approvals/${e}/request-revision`,{decisionNote:t}),"requestRevision"),resubmit:r((e,t)=>je.post(`/approvals/${e}/resubmit`,{payload:t}),"resubmit"),listComments:r(e=>je.get(`/approvals/${e}/comments`),"listComments"),addComment:r((e,t)=>je.post(`/approvals/${e}/comments`,{body:t}),"addComment"),listIssues:r(e=>je.get(`/approvals/${e}/issues`),"listIssues")},K5={summary:r(e=>je.get(`/companies/${e}/dashboard`),"summary")},VN={get:r(e=>je.get(`/companies/${e}/sidebar-badges`),"get")};var q5=new Set(["failed","timed_out"]),af=new Set(["pending","revision_requested"]),WN="wardmote:inbox:dismissed",QN="wardmote:inbox:read-items",GN="wardmote:inbox:last-tab",hG="wardmote:inbox:issue-columns",YN="wardmote:inbox:nesting",XN="wardmote:inbox:group-by",gG="wardmote:inbox:filters",F5="wardmote:inbox:collapsed-groups",H5="wardmote:inbox:collapsed-parents",Cg=["status","id","assignee","kickedOffBy","project","workspace","parent","labels","updated"],ZN=["status","id","updated"];function JN(e){return e?`${F5}:${e}`:null}r(JN,"getInboxCollapsedGroupsStorageKey");function eC(e){return e?`${H5}:${e}`:null}r(eC,"getInboxCollapsedParentsStorageKey");function xG(e){const t=JN(e);if(!t)return new Set;try{const s=localStorage.getItem(t);if(!s)return new Set;const l=JSON.parse(s);return new Set(Array.isArray(l)?l.filter(c=>typeof c=="string"):[])}catch{return new Set}}r(xG,"loadCollapsedInboxGroupKeys");function bG(e,t){const s=JN(e);if(s)try{localStorage.setItem(s,JSON.stringify([...t]))}catch{}}r(bG,"saveCollapsedInboxGroupKeys");function vG(e){const t=eC(e);if(!t)return new Set;try{const s=localStorage.getItem(t);if(!s)return new Set;const l=JSON.parse(s);return new Set(Array.isArray(l)?l.filter(c=>typeof c=="string"):[])}catch{return new Set}}r(vG,"loadCollapsedInboxParentIds");function yG(e,t){const s=eC(e);if(s)try{localStorage.setItem(s,JSON.stringify([...t]))}catch{}}r(yG,"saveCollapsedInboxParentIds");function _j(){try{const e=localStorage.getItem(WN);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(s=>typeof s=="string"&&s.startsWith("alert:"))):new Set}catch{return new Set}}r(_j,"loadDismissedInboxAlerts");function V5(e){try{localStorage.setItem(WN,JSON.stringify([...e]))}catch{}}r(V5,"saveDismissedInboxAlerts");function W5(e){return new Map(e.map(t=>[t.itemKey,as(t.dismissedAt)]))}r(W5,"buildInboxDismissedAtByKey");function Ej(e,t,s){const l=e.get(t);return l==null?!1:l>=as(s)}r(Ej,"isInboxEntityDismissed");function Ij(){try{const e=localStorage.getItem(QN);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}r(Ij,"loadReadInboxItems");function Tj(e){try{localStorage.setItem(QN,JSON.stringify([...e]))}catch{}}r(Tj,"saveReadInboxItems");function tC(e){const t=new Set(e);return Cg.filter(s=>t.has(s))}r(tC,"normalizeInboxIssueColumns");function Q5(e){return e?[...Cg]:Cg.filter(t=>t!=="workspace")}r(Q5,"getAvailableInboxIssueColumns");function jG(){try{const e=localStorage.getItem(XN);return e==="type"||e==="assignee"||e==="project"||e==="workspace"?e:"none"}catch{return"none"}}r(jG,"loadInboxWorkItemGroupBy");function wG(e){try{localStorage.setItem(XN,e)}catch{}}r(wG,"saveInboxWorkItemGroupBy");function kG(e,t,s){return s&&e==="workspace"&&!t}r(kG,"shouldResetInboxWorkspaceGrouping");function G5(e,t,{isolatedWorkspacesEnabled:s=!1,executionWorkspaceById:l,projectWorkspaceById:c,defaultProjectWorkspaceIdByProjectId:u}={}){const p=t.trim().toLowerCase();return!p||e.title.toLowerCase().includes(p)||e.identifier?.toLowerCase().includes(p)||e.description?.toLowerCase().includes(p)?!0:s?nC(e,{executionWorkspaceById:l,projectWorkspaceById:c,defaultProjectWorkspaceIdByProjectId:u})?.toLowerCase().includes(p)??!1:!1}r(G5,"matchesInboxIssueSearch");function SG({visibleIssues:e,searchableIssues:t,query:s,isolatedWorkspacesEnabled:l=!1,executionWorkspaceById:c,projectWorkspaceById:u,defaultProjectWorkspaceIdByProjectId:p}){const f=s.trim();if(!f)return[];const h=new Set(e.map(g=>g.id));return t.filter(g=>!h.has(g.id)).filter(g=>G5(g,f,{isolatedWorkspacesEnabled:l,executionWorkspaceById:c,projectWorkspaceById:u,defaultProjectWorkspaceIdByProjectId:p})).sort(Ic)}r(SG,"getArchivedInboxSearchIssues");function NG({query:e,filteredWorkItems:t,archivedSearchIssues:s,remoteIssues:l,issueFilters:c,currentUserId:u,enableRoutineVisibilityFilter:p=!1,liveIssueIds:f,issueFilterContext:h={}}){if(!e.trim())return[];const g=new Set([...t.filter(v=>v.kind==="issue").map(v=>v.issue.id),...s.map(v=>v.id)]);return dg(l,c,u,p,f,h).filter(v=>!g.has(v.id))}r(NG,"getInboxSearchSupplementIssues");function Y5(e){const t=e?.trim();return t?`${t} (default)`:"Default workspace"}r(Y5,"formatDefaultWorkspaceGroupLabel");function X5(e,{projectWorkspaceById:t,defaultProjectWorkspaceIdByProjectId:s}){if(!e.projectId)return null;const l=s?.get(e.projectId)??null;return l?{id:l,label:Y5(t?.get(l)?.name)}:null}r(X5,"resolveDefaultProjectWorkspaceInfo");function nC(e,{executionWorkspaceById:t,projectWorkspaceById:s,defaultProjectWorkspaceIdByProjectId:l}){const c=e.projectId?l?.get(e.projectId)??null:null;if(e.executionWorkspaceId){const u=t?.get(e.executionWorkspaceId)??null,p=u?.projectWorkspaceId??e.projectWorkspaceId??null;if(u?.mode==="shared_workspace"&&p===c)return null;const f=u?.name;if(f)return f}if(e.projectWorkspaceId){if(e.projectWorkspaceId===c)return null;const u=s?.get(e.projectWorkspaceId)?.name;if(u)return u}return null}r(nC,"resolveIssueWorkspaceName");function Z5(e,{executionWorkspaceById:t,projectWorkspaceById:s,defaultProjectWorkspaceIdByProjectId:l}={}){const c=X5(e,{projectWorkspaceById:s,defaultProjectWorkspaceIdByProjectId:l});if(e.executionWorkspaceId){const u=t?.get(e.executionWorkspaceId)??null,p=u?.projectWorkspaceId??e.projectWorkspaceId??null;if(u?.mode==="shared_workspace"&&p!=null&&p===c?.id&&c)return{key:`workspace:project:${c.id}`,label:c.label};const f=u?.name?.trim();if(f)return{key:`workspace:execution:${e.executionWorkspaceId}`,label:f}}if(e.projectWorkspaceId){if(e.projectWorkspaceId===c?.id)return{key:`workspace:project:${c.id}`,label:c.label};const u=s?.get(e.projectWorkspaceId)?.name?.trim();if(u)return{key:`workspace:project:${e.projectWorkspaceId}`,label:u}}return c?{key:`workspace:project:${c.id}`,label:c.label}:{key:"workspace:none",label:"No workspace"}}r(Z5,"resolveIssueWorkspaceGroup");function CG(){try{return localStorage.getItem(YN)!=="false"}catch{return!0}}r(CG,"loadInboxNesting");function AG(e){try{localStorage.setItem(YN,String(e))}catch{}}r(AG,"saveInboxNesting");function _G(e,t){return e&&!t}r(_G,"resolveInboxNestingEnabled");function Rj(){try{const e=localStorage.getItem(GN);return e==="all"||e==="unread"||e==="recent"||e==="mine"||e==="blocked"?e:"mine"}catch{return"mine"}}r(Rj,"loadLastInboxTab");function EG(e){try{localStorage.setItem(GN,e)}catch{}}r(EG,"saveLastInboxTab");function IG(e){return e==="mine"}r(IG,"isMineInboxTab");function TG(e){return e==="all"}r(TG,"shouldShowCompanyAlerts");function RG(e,t){return t===0||e<0?-1:Math.min(e,t-1)}r(RG,"resolveInboxSelectionIndex");function J5(e,t,s){return t===0?-1:e<0?0:s==="next"?Math.min(e+1,t-1):Math.max(e-1,0)}r(J5,"getInboxKeyboardSelectionIndex");function MG(e){const t=[...e].sort((l,c)=>new Date(c.createdAt).getTime()-new Date(l.createdAt).getTime()),s=new Map;for(const l of t)s.has(l.agentId)||s.set(l.agentId,l);return Array.from(s.values()).filter(l=>q5.has(l.status))}r(MG,"getLatestFailedRunsByAgent");function as(e){if(!e)return 0;const t=new Date(e).getTime();return Number.isFinite(t)?t:0}r(as,"normalizeTimestamp");function sf(e){const t=as(e.lastActivityAt);if(t>0)return t;const s=as(e.lastExternalCommentAt);return s>0?s:as(e.updatedAt)}r(sf,"issueLastActivityTimestamp");function Ic(e,t){const s=sf(t)-sf(e);return s!==0?s:as(t.updatedAt)-as(e.updatedAt)}r(Ic,"sortIssuesByMostRecentActivity");function eO(e){return[...e].sort(Ic).slice(0,100)}r(eO,"getRecentTouchedIssues");function DG(e,t,s,l){const c=[...e].sort((u,p)=>as(p.updatedAt)-as(u.updatedAt));return t==="mine"?c.filter(u=>aC(u,l)):t==="recent"?c:t==="unread"?c.filter(u=>af.has(u.status)):s==="all"?c:c.filter(u=>{const p=af.has(u.status);return s==="actionable"?p:!p})}r(DG,"getApprovalsForTab");function aC(e,t){return af.has(e.status)?!0:t?e.requestedByUserId===t||e.decidedByUserId===t:!1}r(aC,"isApprovalVisibleInMine");function ph(e){const t=as(e.updatedAt);return t>0?t:as(e.createdAt)}r(ph,"approvalActivityTimestamp");function OG({issues:e,approvals:t,failedRuns:s=[],joinRequests:l=[]}){return[...e.map(c=>({kind:"issue",timestamp:sf(c),issue:c})),...t.map(c=>({kind:"approval",timestamp:ph(c),approval:c})),...s.map(c=>({kind:"failed_run",timestamp:as(c.createdAt),run:c})),...l.map(c=>({kind:"join_request",timestamp:as(c.createdAt),joinRequest:c}))].sort((c,u)=>{const p=u.timestamp-c.timestamp;return p!==0?p:c.kind==="issue"&&u.kind==="issue"?Ic(c.issue,u.issue):c.kind==="approval"&&u.kind==="approval"?ph(u.approval)-ph(c.approval):c.kind==="approval"?-1:1})}r(OG,"getInboxWorkItems");var tO=["issue","approval","failed_run","join_request"],sC={issue:"Tasks",approval:"Approvals",failed_run:"Failed runs",join_request:"Join requests"};function nO(e,{agentById:t,currentUserId:s,userLabelById:l}){if(e.assigneeAgentId){const c=t?.get(e.assigneeAgentId)?.trim();return{key:`assignee:agent:${e.assigneeAgentId}`,label:c||e.assigneeAgentId.slice(0,8)}}return e.assigneeUserId?{key:`assignee:user:${e.assigneeUserId}`,label:Vr(e.assigneeUserId,s,l)??"User"}:{key:"assignee:none",label:"Unassigned"}}r(nO,"resolveIssueAssigneeGroup");function aO(e,{projectById:t}){if(!e.projectId)return{key:"project:none",label:"No project"};const s=t?.get(e.projectId)?.name?.trim();return{key:`project:${e.projectId}`,label:s||e.projectId.slice(0,8)}}r(aO,"resolveIssueProjectGroup");function mh(e,t){const s=new Map;for(const l of e){const c=l.kind==="issue"?t(l.issue):{key:`kind:${l.kind}`,label:sC[l.kind]},u=s.get(c.key);u?(u.items.push(l),u.latestTimestamp=Math.max(u.latestTimestamp,l.timestamp)):s.set(c.key,{label:c.label,items:[l],latestTimestamp:l.timestamp})}return[...s.entries()].map(([l,c])=>({key:l,label:c.label,items:c.items,latestTimestamp:c.latestTimestamp})).sort((l,c)=>{const u=c.latestTimestamp-l.latestTimestamp;return u!==0?u:l.label.localeCompare(c.label)}).map(({key:l,label:c,items:u})=>({key:l,label:c,items:u}))}r(mh,"groupInboxWorkItemsByIssueGroup");function sO(e,t,s={}){if(t==="none")return[{key:"__all",label:null,items:e}];if(t==="workspace")return mh(e,u=>Z5(u,s));if(t==="assignee")return mh(e,u=>nO(u,s));if(t==="project")return mh(e,u=>aO(u,s));const l=new Map;for(const u of e){const p=l.get(u.kind)??[];p.push(u),l.set(u.kind,p)}const c=[];for(const u of tO){const p=l.get(u)??[];p.length!==0&&c.push({key:u,label:sC[u],items:p})}return c}r(sO,"groupInboxWorkItems");function iO(e){return e.replace(/^archived-search:/,"").replace(/^other-search:/,"")}r(iO,"stripInboxSearchGroupPrefix");function rO(e){return e.find(t=>t.kind==="issue")?.issue??null}r(rO,"firstIssueFromInboxWorkItems");function Mj(e,t,s){return e?t.projectWorkspaceById?.get(e)?.projectId??(s?.projectWorkspaceId===e?s.projectId:null):s?.projectId??null}r(Mj,"projectIdForProjectWorkspace");function LG(e,t,s,l={}){const c=rO(s);if(!c)return null;const u=iO(e);if(t==="project"){if(!u.startsWith("project:"))return{};const p=u.slice(8);return p&&p!=="none"?{projectId:p}:{}}if(t==="assignee"){if(u.startsWith("assignee:agent:")){const p=u.slice(15);return p?{assigneeAgentId:p}:{}}if(u.startsWith("assignee:user:")){const p=u.slice(14);return p?{assigneeUserId:p}:{}}return{}}if(t==="workspace"){if(u.startsWith("workspace:execution:")){const p=u.slice(20);if(!p)return{};const f=l.executionWorkspaceById?.get(p)??null,h=f?.projectWorkspaceId??(c.executionWorkspaceId===p?c.projectWorkspaceId:null),g=f?.projectId??Mj(h,l,c);return{executionWorkspaceId:p,executionWorkspaceMode:"reuse_existing",...g?{projectId:g}:{},...h?{projectWorkspaceId:h}:{}}}if(u.startsWith("workspace:project:")){const p=u.slice(18);if(!p)return{};const f=Mj(p,l,c);return{...f?{projectId:f}:{},projectWorkspaceId:p}}}return{}}r(LG,"buildInboxIssueGroupCreateDefaults");function lO(e){const t=[],s=[];for(const f of e)f.kind==="issue"?t.push(f):s.push(f);const l=new Set(t.map(f=>f.issue.id)),c=new Map,u=new Set;for(const f of t){const{issue:h}=f;if(h.parentId&&l.has(h.parentId)){u.add(h.id);const g=c.get(h.parentId)??[];g.push(h),c.set(h.parentId,g)}}const p=r((f,h=new Set)=>{const g=sf(f);if(h.has(f.id))return g;const v=new Set(h);v.add(f.id);const y=c.get(f.id)??[];return y.length===0?g:Math.max(g,...y.map(j=>p(j,v)))},"subtreeActivityTimestamp");for(const f of c.values())f.sort((h,g)=>{const v=p(g)-p(h);return v!==0?v:Ic(h,g)});return{displayItems:[...t.filter(f=>!u.has(f.issue.id)).map(f=>{const h=c.get(f.issue.id);if(!h?.length)return f;const g=Math.max(...h.map(v=>p(v)));return{...f,timestamp:Math.max(f.timestamp,g)}}),...s].sort((f,h)=>{const g=h.timestamp-f.timestamp;return g!==0?g:f.kind==="issue"&&h.kind==="issue"?Ic(f.issue,h.issue):0}),childrenByIssueId:c}}r(lO,"buildInboxNesting");function zG(e,t,s,l){const c=l?.keyPrefix??"",u=l?.searchSection??"none",p=l?.nestingEnabled??!1;return u!=="none"&&e.length===0?[]:sO(e,t,s).map(f=>{const h=p&&f.items.some(g=>g.kind==="issue")?lO(f.items):{displayItems:f.items,childrenByIssueId:new Map};return{key:`${c}${f.key}`,label:f.label,displayItems:h.displayItems,childrenByIssueId:h.childrenByIssueId,searchSection:u}})}r(zG,"buildGroupedInboxSections");function oO(e){return e.kind==="issue"?`issue:${e.issue.id}`:e.kind==="approval"?`approval:${e.approval.id}`:e.kind==="failed_run"?`run:${e.run.id}`:`join:${e.joinRequest.id}`}r(oO,"getInboxWorkItemKey");function PG(e,t,s){const l=[];for(const c of e){const u=t.has(c.key);if(c.label&&l.push({type:"group",groupKey:c.key,label:c.label,collapsed:u}),u)continue;const p=r((f,h)=>{const g=c.childrenByIssueId.get(f);if(!(!g?.length||s.has(f)))for(const v of g){if(h.has(v.id))continue;const y=new Set(h);y.add(v.id),l.push({type:"child",issueId:v.id,issue:v}),p(v.id,y)}},"addIssueChildren");for(const f of c.displayItems)l.push({type:"top",itemKey:`${c.key}:${oO(f)}`,item:f}),f.kind==="issue"&&p(f.issue.id,new Set([f.issue.id]))}return l}r(PG,"buildInboxKeyboardNavEntries");function $G({tab:e,hasItems:t,showOnMine:s,showOnRecent:l,showOnUnread:c,showOnAll:u}){return t?e==="mine"?s:e==="recent"?l:e==="unread"?c:u:!1}r($G,"shouldShowInboxSection");function cO({approvals:e,joinRequests:t,dashboard:s,failedRuns:l,mineIssues:c,dismissedAlerts:u,dismissedAtByKey:p,currentUserId:f}){const h=e.filter(C=>aC(C,f)&&af.has(C.status)&&!Ej(p,`approval:${C.id}`,C.updatedAt)).length,g=t.filter(C=>!Ej(p,`join:${C.id}`,C.updatedAt??C.createdAt)).length,v=c.filter(C=>C.isUnreadForMe).length,y=s?.agents.error??0,j=s?.costs.monthBudgetCents??0,k=s?.costs.monthUtilizationPercent??0,S=y>0&&l===0&&!u.has("alert:agent-errors"),N=j>0&&k>=80&&!u.has("alert:budget"),I=Number(S)+Number(N);return{inbox:h+g+l+v,approvals:h,failedRuns:l,joinRequests:g,mineIssues:v,alerts:I}}r(cO,"computeInboxBadgeData");var uO="backlog,todo,in_progress,in_review,blocked,done",dO=500,fO=3e4;function pO(){const[e,t]=(0,x.useState)(_j);return(0,x.useEffect)(()=>{const l=r(c=>{c.key==="wardmote:inbox:dismissed"&&t(_j())},"handleStorage");return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]),{dismissed:e,dismiss:r(l=>{t(c=>{const u=new Set(c);return u.add(l),V5(u),u})},"dismiss")}}r(pO,"useDismissedInboxAlerts");function mO(e){const t=kn(),s=e?P.inboxDismissals(e):["inbox-dismissals","__disabled__"],{data:l=[]}=me({queryKey:s,queryFn:r(()=>dd.list(e),"queryFn"),enabled:!!e}),c=Bt({mutationFn:r(({itemKey:j})=>dd.dismiss(e,j),"mutationFn"),onMutate:r(async({itemKey:j})=>{if(!e)return{previous:[]};await t.cancelQueries({queryKey:s});const k=t.getQueryData(s)??[],S=new Date;return t.setQueryData(s,[{id:`optimistic:${j}`,companyId:e,userId:"me",itemKey:j,dismissedAt:S,createdAt:S,updatedAt:S},...k.filter(N=>N.itemKey!==j)]),{previous:k}},"onMutate"),onError:r((j,k,S)=>{S&&t.setQueryData(s,S.previous)},"onError"),onSettled:r(()=>{e&&u()},"onSettled")});function u(){e&&(t.invalidateQueries({queryKey:s}),t.invalidateQueries({queryKey:P.sidebarBadges(e)}),t.invalidateQueries({queryKey:P.attention(e)}))}r(u,"invalidateDismissalConsumers");const p=Bt({mutationFn:r(({itemKey:j,snoozedUntil:k})=>dd.snooze(e,j,k),"mutationFn"),onSettled:u}),f=Bt({mutationFn:r(({itemKey:j})=>dd.restore(e,j),"mutationFn"),onSettled:u}),h=(0,x.useMemo)(()=>W5(l),[l]),g=c.mutate,v=p.mutate,y=f.mutate;return{dismissals:l,dismissedAtByKey:h,dismiss:(0,x.useCallback)(j=>g({itemKey:j}),[g]),snooze:(0,x.useCallback)((j,k)=>v({itemKey:j,snoozedUntil:k}),[v]),restore:(0,x.useCallback)(j=>y({itemKey:j}),[y]),isPending:c.isPending||p.isPending||f.isPending}}r(mO,"useInboxDismissals");function UG(){const[e,t]=(0,x.useState)(Ij);return(0,x.useEffect)(()=>{const c=r(u=>{u.key==="wardmote:inbox:read-items"&&t(Ij())},"handleStorage");return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[]),{readItems:e,markRead:r(c=>{t(u=>{const p=new Set(u);return p.add(c),Tj(p),p})},"markRead"),markUnread:r(c=>{t(u=>{const p=new Set(u);return p.delete(c),Tj(p),p})},"markUnread")}}r(UG,"useReadInboxItems");function Q0(e){const t=X3(e),{dismissed:s}=pO(),{dismissedAtByKey:l}=mO(e),{data:c}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),{data:u=[]}=me({queryKey:P.approvals.list(e),queryFn:r(()=>HN.list(e),"queryFn"),enabled:!!e}),{data:p=[]}=me({queryKey:P.access.joinRequests(e),queryFn:r(async()=>{try{return await ei.listJoinRequests(e,"pending_approval")}catch(R){if(R instanceof Ii&&(R.status===401||R.status===403))return[];throw R}},"queryFn"),enabled:!!e,retry:!1}),f=P.dashboard(e),h=Ac({companyId:e,resourceKey:"dashboard",queryKey:f,enabled:!!e}),{data:g,dataUpdatedAt:v}=me({queryKey:f,queryFn:r(()=>K5.summary(e),"queryFn"),enabled:!!e});_c(h,g,v);const y=P.issues.listMineByMe(e),j=Ac({companyId:e,resourceKey:"inbox-badge:mine-issues",queryKey:y,enabled:!!e}),{data:k=[],dataUpdatedAt:S}=me({queryKey:y,queryFn:r(()=>on.listCompact(e,{touchedByUserId:"me",inboxArchivedByUserId:"me",status:uO,limit:dO}).then(R=>R),"queryFn"),enabled:!!e,refetchOnWindowFocus:!1,staleTime:fO});_c(j,k,S);const N=(0,x.useMemo)(()=>eO(Z3(e,k)),[e,t,k]),I=c?.user.id??c?.session.userId??null,{data:C}=me({queryKey:e?P.sidebarBadges(e):["sidebar-badges","__disabled__"],queryFn:r(async()=>{try{return await VN.get(e)}catch(R){if(R instanceof Ii&&(R.status===401||R.status===403))return null;throw R}},"queryFn"),enabled:!!e,retry:!1}),M=C?.failedRuns??0;return(0,x.useMemo)(()=>cO({approvals:u,joinRequests:p,dashboard:g,failedRuns:M,mineIssues:N,dismissedAlerts:s,dismissedAtByKey:l,currentUserId:I}),[u,p,g,M,N,s,l,I])}r(Q0,"useInboxBadge");var hO=new Set(["detailTab","taskDetailView","contextMenuItem","commentAnnotation","commentContextMenuItem","projectSidebarItem","toolbarButton"]),iC=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),gO=1e3,xO=new Set(bE),rC=(0,x.createContext)(null);function bO(e){return e instanceof Error&&e.message?e.message:"Unknown error"}r(bO,"getErrorMessage");function vO(e,t,s){return{companyId:e.companyId??null,companyPrefix:e.companyPrefix??null,projectId:e.projectId??(e.entityType==="project"?e.entityId??null:null),entityId:e.entityId??null,entityType:e.entityType??null,userId:s,renderEnvironment:t}}r(vO,"buildLauncherHostContext");function yO(e){if(!e)return;const t=e.querySelector(iC);if(t){t.focus();return}e.focus()}r(yO,"focusFirstElement");function Dj(e,t){if(/^https?:\/\//.test(e)||e.startsWith("/")||e.startsWith("#")||e.startsWith(".")||e.startsWith("?"))return e;const s=t.companyPrefix?.trim();return s?`/${s}/${e}`:e}r(Dj,"resolveLauncherNavigationTarget");function jO(e){if(e.action.type!=="navigate"&&e.action.type!=="deepLink"||/^https?:\/\//.test(e.action.target))return null;const[t]=e.action.target.split(/[?#]/,1),s=t?.split("/").filter(Boolean).at(-1);return s?s.toLowerCase():null}r(jO,"launcherRoutePath");function wO(e,t){if(e.placementZone!=="sidebar"||!t)return e.displayName;const s=jO(e);return s?t.slots.find(l=>l.type==="routeSidebar"&&l.routePath?.toLowerCase()===s)?.displayName??e.displayName:e.displayName}r(wO,"launcherDisplayName");function kO(e,t){if(t.key!=="Tab")return;const s=Array.from(e.querySelectorAll(iC)).filter(p=>!p.hasAttribute("disabled")&&p.tabIndex!==-1);if(s.length===0){t.preventDefault(),e.focus();return}const l=s[0],c=s[s.length-1],u=document.activeElement;if(t.shiftKey&&u===l){t.preventDefault(),c.focus();return}!t.shiftKey&&u===c&&(t.preventDefault(),l.focus())}r(kO,"trapFocus");function SO(e){switch(e){case"projectSidebarItem":return"justify-start h-auto px-3 py-1 text-[12px] font-normal text-ink-3 hover:text-ink";case"contextMenuItem":case"commentContextMenuItem":return"justify-start h-7 w-full px-2 text-xs font-normal";case"sidebar":case"sidebarPanel":return"justify-start h-8 w-full";case"toolbarButton":case"globalToolbarButton":return"h-8";default:return"h-8"}}r(SO,"launcherTriggerClassName");function lC(e){switch(e){case"compact":return{width:"min(28rem, calc(100vw - 2rem))"};case"wide":return{width:"min(64rem, calc(100vw - 2rem))"};case"full":return{width:"calc(100vw - 2rem)",height:"calc(100vh - 2rem)"};case"inline":return{width:"min(24rem, calc(100vw - 2rem))"};default:return{width:"min(40rem, calc(100vw - 2rem))"}}}r(lC,"launcherShellBoundsStyle");function NO(e){const t=e.sourceRect,s=lC(e.bounds).width??"min(24rem, calc(100vw - 2rem))";return t?{width:s,maxHeight:"min(70vh, 36rem)",top:Math.min(t.bottom+8,window.innerHeight-32),left:Math.min(Math.max(t.left,16),Math.max(16,window.innerWidth-360))}:{width:s,maxHeight:"min(70vh, 36rem)",top:"4rem",left:"50%",transform:"translateX(-50%)"}}r(NO,"launcherPopoverStyle");function CO(e){return typeof e=="string"&&xO.has(e)}r(CO,"isPluginLauncherBounds");function oC(e){const t=e.enabled??!0,{data:s,isLoading:l,error:c}=me({queryKey:P.plugins.uiContributions,queryFn:r(()=>R0.listUiContributions(),"queryFn"),enabled:t}),u=(0,x.useMemo)(()=>[...e.placementZones].sort().join("|"),[e.placementZones]),p=(0,x.useMemo)(()=>{const f=new Map;for(const h of s??[])f.set(h.pluginId,h);return f},[s]);return{launchers:(0,x.useMemo)(()=>{const f=new Set(u.split("|").filter(Boolean)),h=[];for(const g of s??[])for(const v of g.launchers)f.has(v.placementZone)&&(hO.has(v.placementZone)&&(!e.entityType||!v.entityTypes?.includes(e.entityType))||h.push({...v,pluginId:g.pluginId,pluginKey:g.pluginKey,pluginDisplayName:g.displayName,pluginVersion:g.version,uiEntryFile:g.uiEntryFile}));return h.sort((g,v)=>{const y=g.order??Number.MAX_SAFE_INTEGER,j=v.order??Number.MAX_SAFE_INTEGER;if(y!==j)return y-j;const k=g.pluginDisplayName.localeCompare(v.pluginDisplayName);return k!==0?k:g.displayName.localeCompare(v.displayName)}),h},[s,e.entityType,u]),contributionsByPluginId:p,isLoading:t&&l,errorMessage:c?bO(c):null}}r(oC,"usePluginLaunchers");async function AO(e,t){const s=t.action.target,l=Yy(t.pluginKey,s);return l||(await mT(e),Yy(t.pluginKey,s))}r(AO,"resolveLauncherComponent");function _O({pluginId:e,hostContext:t,children:s}){const l=(0,x.useMemo)(()=>({pluginId:e,hostContext:t}),[e,t]);return(0,a.jsx)(hT.Provider,{value:l,children:s})}r(_O,"PluginLauncherBridgeScope");var EO=class extends x.Component{static{r(this,"LauncherErrorBoundary")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?(0,a.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 p-3 text-sm text-bad",children:[this.props.launcher.pluginDisplayName,": failed to render"]}):this.props.children}};function IO({instance:e,renderEnvironment:t}){const s=e.component,{data:l}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),c=l?.user?.id??l?.session?.userId??null,u=(0,x.useMemo)(()=>vO(e.hostContext,t,c),[e.hostContext,t,c]);if(!s)return t.environment==="iframe"?(0,a.jsx)("iframe",{src:`/_plugins/${encodeURIComponent(e.launcher.pluginId)}/ui/${e.launcher.action.target}`,title:`${e.launcher.pluginDisplayName} ${e.launcher.displayName}`,className:"h-full min-h-[24rem] w-full rounded-md border border-line bg-bg"}):(0,a.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 p-3 text-sm text-bad",children:[e.launcher.pluginDisplayName,': could not resolve launcher target "',e.launcher.action.target,'".']});if(s.kind==="web-component")return(0,x.createElement)(s.tagName,{className:"block w-full",pluginLauncher:e.launcher,pluginContext:u});const p=(0,x.createElement)(s.component,{launcher:e.launcher,context:u});return(0,a.jsx)(EO,{launcher:e.launcher,children:(0,a.jsx)(_O,{pluginId:e.launcher.pluginId,hostContext:u,children:p})})}r(IO,"LauncherRenderContent");function TO({instance:e,stackIndex:t,isTopmost:s,requestBounds:l,closeLauncher:c}){const u=(0,x.useRef)(null),p=(0,x.useId)();(0,x.useEffect)(()=>{if(!s)return;const y=requestAnimationFrame(()=>{yO(u.current)});return()=>cancelAnimationFrame(y)},[s]),(0,x.useEffect)(()=>{if(!s)return;const y=r(j=>{if(u.current){if(j.key==="Escape"){j.preventDefault(),c(e.key,{reason:"escapeKey",nativeEvent:j});return}kO(u.current,j)}},"handleKeyDown");return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c,e.key,s]);const f=(0,x.useMemo)(()=>({environment:e.launcher.render?.environment??"hostOverlay",launcherId:e.launcher.id,bounds:e.bounds,requestModalBounds:r(y=>l(e.key,y),"requestModalBounds"),closeLifecycle:{onBeforeClose:r(y=>(e.beforeCloseHandlers.add(y),()=>e.beforeCloseHandlers.delete(y)),"onBeforeClose"),onClose:r(y=>(e.closeHandlers.add(y),()=>e.closeHandlers.delete(y)),"onClose")}}),[e,l]),h=gO+t*20,g=e.launcher.action.type,v=g==="openPopover"?NO(e):lC(e.bounds);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black/45",style:{zIndex:h},"aria-hidden":"true",onMouseDown:r(y=>{s&&y.target===y.currentTarget&&c(e.key,{reason:"backdrop",nativeEvent:y})},"onMouseDown")}),(0,a.jsxs)("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":p,tabIndex:-1,className:g==="openDrawer"?"fixed right-0 top-0 h-full max-w-[min(44rem,100vw)] overflow-hidden border-l border-line bg-bg shadow-2xl":g==="openPopover"?"fixed overflow-hidden rounded-xl border border-line bg-bg shadow-2xl":"fixed left-1/2 top-1/2 max-h-[calc(100vh-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl border border-line bg-bg shadow-2xl",style:{zIndex:h+1,...g==="openDrawer"?{width:v.width??"min(44rem, 100vw)"}:v},onMouseDown:r(y=>y.stopPropagation(),"onMouseDown"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-line px-4 py-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{id:p,className:"truncate text-sm font-semibold",children:e.launcher.displayName}),(0,a.jsx)("p",{className:"truncate text-xs text-ink-3",children:e.launcher.pluginDisplayName})]}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"sm",className:"ml-auto",onClick:r(()=>{c(e.key,{reason:"programmatic"})},"onClick"),children:"Close"})]}),(0,a.jsx)("div",{className:Y("overflow-auto p-4",g==="openDrawer"?"h-[calc(100%-3.5rem)]":"max-h-[calc(100vh-7rem)]"),children:(0,a.jsx)(IO,{instance:e,renderEnvironment:f})})]})]})}r(TO,"LauncherModalShell");function RO({children:e}){const[t,s]=(0,x.useState)([]),l=(0,x.useRef)(t);l.current=t;const c=hn(),u=ja(),p=(0,x.useCallback)(async(v,y)=>{const j=l.current.find(k=>k.key===v);if(j){for(const k of[...j.beforeCloseHandlers])await k(y);s(k=>k.filter(S=>S.key!==v)),queueMicrotask(()=>{for(const k of[...j.closeHandlers])k(y);j.sourceElement&&document.contains(j.sourceElement)&&j.sourceElement.focus()})}},[]);(0,x.useEffect)(()=>{t.length!==0&&Promise.all(t.map(v=>p(v.key,{reason:"hostNavigation"})))},[c.key]);const f=(0,x.useCallback)(async(v,y)=>{CO(y.bounds)&&s(j=>j.map(k=>k.key===v?{...k,bounds:y.bounds}:k))},[]),h=(0,x.useCallback)(async(v,y,j,k)=>{switch(v.action.type){case"navigate":u(Dj(v.action.target,y));return;case"deepLink":/^https?:\/\//.test(v.action.target)?window.open(v.action.target,"_blank","noopener,noreferrer"):u(Dj(v.action.target,y));return;case"performAction":await R0.bridgePerformAction(v.pluginId,v.action.target,v.action.params,y.companyId??null);return;case"openModal":case"openDrawer":case"openPopover":{const S=await AO(j,v),N=k?.getBoundingClientRect()??null,I={key:`${v.pluginId}:${v.id}:${Date.now()}:${Math.random().toString(36).slice(2,8)}`,launcher:v,hostContext:y,contribution:j,component:S,sourceElement:k??null,sourceRect:N,bounds:v.render?.bounds??"default",beforeCloseHandlers:new Set,closeHandlers:new Set};s(C=>[...C,I]);return}}},[u]),g=(0,x.useMemo)(()=>({activateLauncher:h}),[h]);return(0,a.jsxs)(rC.Provider,{value:g,children:[e,t.map((v,y)=>(0,a.jsx)(TO,{instance:v,stackIndex:y,isTopmost:y===t.length-1,requestBounds:f,closeLauncher:p},v.key))]})}r(RO,"PluginLauncherProvider");function MO(){const e=(0,x.useContext)(rC);if(!e)throw new Error("usePluginLauncherRuntime must be used within PluginLauncherProvider");return e}r(MO,"usePluginLauncherRuntime");function DO({displayName:e,launcher:t,placementZone:s,onClick:l}){return(0,a.jsx)(oe,{type:"button",variant:s==="toolbarButton"||s==="globalToolbarButton"?"secondary":"ghost",size:"sm",className:SO(s),onClick:l,children:e??t.displayName})}r(DO,"DefaultLauncherTrigger");function cC({placementZones:e,context:t,entityType:s,className:l,itemClassName:c,errorClassName:u,errorBehavior:p="inline"}){const{activateLauncher:f}=MO(),{launchers:h,contributionsByPluginId:g,errorMessage:v}=oC({placementZones:e,entityType:s,companyId:t.companyId,enabled:!!t.companyId});return v&&p==="inline"?(0,a.jsxs)("div",{className:Y("rounded-md border border-bad/30 bg-bad/5 px-2 py-1 text-xs text-bad",u),children:["Plugin launchers unavailable: ",v]}):h.length===0?null:(0,a.jsx)("div",{className:l,children:h.map(y=>(0,a.jsx)("div",{className:c,children:(0,a.jsx)(DO,{displayName:wO(y,g.get(y.pluginId)),launcher:y,placementZone:y.placementZone,onClick:r(j=>{const k=g.get(y.pluginId);k&&f(y,t,k,j.currentTarget)},"onClick")})},`${y.pluginKey}:${y.id}`))})}r(cC,"PluginLauncherOutlet");function OO(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,x.useMemo)(()=>l=>{t.forEach(c=>c(l))},t)}r(OO,"useCombinedRefs");var Hf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yo(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}r(yo,"isWindow");function G0(e){return"nodeType"in e}r(G0,"isNode");function Ma(e){var t,s;return e?yo(e)?e:G0(e)&&(t=(s=e.ownerDocument)==null?void 0:s.defaultView)!=null?t:window:window}r(Ma,"getWindow");function Y0(e){const{Document:t}=Ma(e);return e instanceof t}r(Y0,"isDocument");function Wc(e){return yo(e)?!1:e instanceof Ma(e).HTMLElement}r(Wc,"isHTMLElement");function uC(e){return e instanceof Ma(e).SVGElement}r(uC,"isSVGElement");function jo(e){return e?yo(e)?e.document:G0(e)?Y0(e)?e:Wc(e)||uC(e)?e.ownerDocument:document:document:document}r(jo,"getOwnerDocument");var Os=Hf?x.useLayoutEffect:x.useEffect;function Vf(e){const t=(0,x.useRef)(e);return Os(()=>{t.current=e}),(0,x.useCallback)(function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return t.current==null?void 0:t.current(...l)},[])}r(Vf,"useEvent");function LO(){const e=(0,x.useRef)(null);return[(0,x.useCallback)((t,s)=>{e.current=setInterval(t,s)},[]),(0,x.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}r(LO,"useInterval");function Tc(e,t){t===void 0&&(t=[e]);const s=(0,x.useRef)(e);return Os(()=>{s.current!==e&&(s.current=e)},t),s}r(Tc,"useLatestValue");function Qc(e,t){const s=(0,x.useRef)();return(0,x.useMemo)(()=>{const l=e(s.current);return s.current=l,l},[...t])}r(Qc,"useLazyMemo");function rf(e){const t=Vf(e),s=(0,x.useRef)(null);return[s,(0,x.useCallback)(l=>{l!==s.current&&t?.(l,s.current),s.current=l},[])]}r(rf,"useNodeRef");function lf(e){const t=(0,x.useRef)();return(0,x.useEffect)(()=>{t.current=e},[e]),t.current}r(lf,"usePrevious");var hh={};function Gc(e,t){return(0,x.useMemo)(()=>{if(t)return t;const s=hh[e]==null?0:hh[e]+1;return hh[e]=s,e+"-"+s},[e,t])}r(Gc,"useUniqueId");function dC(e){return function(t){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];return l.reduce((u,p)=>{const f=Object.entries(p);for(const[h,g]of f){const v=u[h];v!=null&&(u[h]=v+e*g)}return u},{...t})}}r(dC,"createAdjustmentFn");var lo=dC(1),Rc=dC(-1);function zO(e){return"clientX"in e&&"clientY"in e}r(zO,"hasViewportRelativeCoordinates");function Wf(e){if(!e)return!1;const{KeyboardEvent:t}=Ma(e.target);return t&&e instanceof t}r(Wf,"isKeyboardEvent");function PO(e){if(!e)return!1;const{TouchEvent:t}=Ma(e.target);return t&&e instanceof t}r(PO,"isTouchEvent");function of(e){if(PO(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:s}=e.touches[0];return{x:t,y:s}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:s}=e.changedTouches[0];return{x:t,y:s}}}return zO(e)?{x:e.clientX,y:e.clientY}:null}r(of,"getEventCoordinates");var ti=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:s}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:s}=e;return"scaleX("+t+") scaleY("+s+")"}},Transform:{toString(e){if(e)return[ti.Translate.toString(e),ti.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:s,easing:l}=e;return t+" "+s+"ms "+l}}}),Oj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $O(e){return e.matches(Oj)?e:e.querySelector(Oj)}r($O,"findFirstFocusableNode");var UO={display:"none"};function BO(e){let{id:t,value:s}=e;return x.createElement("div",{id:t,style:UO},s)}r(BO,"HiddenText");function KO(e){let{id:t,announcement:s,ariaLiveType:l="assertive"}=e;return x.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":l,"aria-atomic":!0},s)}r(KO,"LiveRegion");function qO(){const[e,t]=(0,x.useState)("");return{announce:(0,x.useCallback)(s=>{s!=null&&t(s)},[]),announcement:e}}r(qO,"useAnnouncement$1");var fC=(0,x.createContext)(null);function FO(e){const t=(0,x.useContext)(fC);(0,x.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}r(FO,"useDndMonitor");function HO(){const[e]=(0,x.useState)(()=>new Set),t=(0,x.useCallback)(s=>(e.add(s),()=>e.delete(s)),[e]);return[(0,x.useCallback)(s=>{let{type:l,event:c}=s;e.forEach(u=>{var p;return(p=u[l])==null?void 0:p.call(u,c)})},[e]),t]}r(HO,"useDndMonitorProvider");var VO={draggable:`
@@ -51,11 +51,11 @@ ${SE}
51
51
  `}r(D$,"buildAgentOnboardingPrompt");function O$(e){const t=(e.connectionCandidates??[]).map(u=>u.trim()).filter(Boolean),s=new Set;let l=null;try{l=new URL(e.onboardingTextUrl),s.add(l.toString())}catch{const u=e.onboardingTextUrl.trim();u&&s.add(u)}if(!l){for(const u of t)s.add(u);return Array.from(s)}const c=`${l.pathname}${l.search}`;for(const u of t)try{const p=new URL(u);s.add(`${p.origin}${c}`)}catch{s.add(u)}return Array.from(s)}r(O$,"buildCandidateOnboardingUrls");function L$(e){const t=e.testResolutionUrl?.trim();if(t)return t;try{const s=new URL(e.onboardingTextUrl),l=s.pathname.replace(/\/onboarding\.txt$/,"/test-resolution");return`${s.origin}${l}`}catch{return null}}r(L$,"buildResolutionTestUrl");function z$({children:e,className:t,...s}){const[l,c]=(0,x.useState)(null),u=(0,x.useRef)(null),p=U0();return(0,x.useLayoutEffect)(()=>{const f=l,h=u.current;if(!f||!h||typeof ResizeObserver>"u")return;let g,v;const y=new ResizeObserver(()=>{const j=getComputedStyle(f),k=h.getBoundingClientRect().height+parseFloat(j.borderTopWidth)+parseFloat(j.borderBottomWidth);if(k===g)return;const S=v?.playState==="running"?f.getBoundingClientRect().height:g;if(v?.cancel(),g=k,S===void 0||p||typeof f.animate!="function")return;const N=$T("--motion-ease-out-expo");v=f.animate([{height:`${S}px`},{height:`${k}px`}],{duration:UT("--onboarding-motion-step"),easing:Array.isArray(N)?`cubic-bezier(${N.join(",")})`:N})});return y.observe(h),()=>{y.disconnect(),v?.cancel()}},[l,p]),(0,a.jsx)(Ps,{...s,ref:c,className:Y("overflow-hidden p-0",t),children:(0,a.jsx)("div",{ref:u,className:"flex max-h-(--sz-calc-18) shrink-0 flex-col",children:e})})}r(z$,"AnimatedDialogContent");var hA=[{id:"dot",name:"Dot",adapter:"openai_dot",description:"Your Dot in ChatGPT"},{id:"other",name:"Other",adapter:"http",description:"Any agent that can connect to Wardmote"}];function P$({onSelect:e,dotDisabledReason:t}){return(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:hA.map(s=>(0,a.jsxs)("button",{type:"button",onClick:r(()=>e(s.id),"onClick"),disabled:s.id==="dot"&&!!t,title:s.id==="dot"?t:void 0,className:"flex aspect-square flex-col items-center justify-center gap-3 rounded-lg border border-line bg-bg-2 px-3 py-4 text-center transition-colors disabled:opacity-50 hover:bg-bg-3/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,a.jsx)(l1,{type:s.adapter,className:"size-8"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:s.name}),(0,a.jsx)("span",{className:"sr-only",children:s.description})]},s.id))})}r(P$,"ExternalAgentPresetPicker");var $$=[{title:"Connected to Wardmote",description:"Your Dot has connected to this agent."},{title:"Task updates enabled",description:"Your Dot is subscribed to new assignments and messages."},{title:"Test event confirmed",description:"Your Dot received our test and replied to Wardmote."}];function U$({state:e}){const t={waiting:0,connected:1,subscribed:2,testing:2,finishing:3,ready:3}[e.phase],s=e.problem==="agent_unavailable"?"Connection checks passed, but this agent cannot receive tasks. Resolve the agent’s setup blocker in Wardmote.":e.problem==="offline"?"Connection updates paused. Reconnect to check the latest status.":e.problem==="prompt_unavailable"?"This setup prompt was replaced in another window. Create a fresh prompt to continue.":e.problem==="event_timeout"?"Your Dot connected, but hasn’t confirmed the test event. Ask it to check Wardmote, then retry.":e.phase==="finishing"?"Your Dot confirmed the test event. Wardmote is finishing agent setup.":e.phase==="ready"?"Your Dot is ready for tasks. Messages can travel both ways.":e.phase==="waiting"?"Watching for your Dot. Updates will appear here automatically.":e.phase==="connected"?"Your Dot connected. Waiting for it to enable task updates.":"Waiting for your Dot to confirm a test event. No task will be created.";return(0,a.jsxs)("section",{"aria-label":"Dot connection checks",className:"space-y-4",children:[(0,a.jsx)("ol",{className:"space-y-4",children:$$.map((l,c)=>{const u=c<t,p=c===t&&e.problem==="event_timeout",f=c===t&&!e.problem,h=u?Rs:p?L1:f?Ta:UI;return(0,a.jsxs)("li",{className:"flex items-start gap-3","aria-current":f?"step":void 0,children:[(0,a.jsx)("span",{className:Y("flex size-6 shrink-0 items-center justify-center rounded-full",u?"bg-bg-3 text-ink":p?"text-bad":"text-ink-3"),children:(0,a.jsx)(h,{className:Y("size-4",f&&"animate-spin motion-reduce:animate-none")})}),(0,a.jsxs)("div",{className:"min-w-0 pt-0.5",children:[(0,a.jsxs)("p",{className:Y("text-sm",u||f||p?"font-medium":"text-ink-3"),children:[l.title,(0,a.jsx)("span",{className:"sr-only",children:u?": complete":p?": needs attention":f?": in progress":": waiting"})]}),u&&(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-ink-3",children:l.description})]})]},l.title)})}),(0,a.jsx)("p",{role:e.problem&&e.problem!=="prompt_unavailable"?"alert":"status","aria-live":"polite",className:Y("text-sm leading-relaxed",e.problem&&e.problem!=="prompt_unavailable"?"text-bad":"text-ink-3"),children:s})]})}r(U$,"DotConnectionChecks");function B$({preset:e,prompt:t,companyName:s,connection:l,onSelect:c,onBack:u,onClose:p,onCopied:f,onRetry:h,onNewPrompt:g,dotDisabledReason:v,busy:y=!1,error:j,approvalHref:k}){const S=hA.find(R=>R.id===e),N=e==="dot",I=N&&l.phase==="ready"&&!l.problem,C=N&&l.phase!=="waiting",M=l.problem==="agent_unavailable"?"Agent unavailable":l.problem==="offline"?"Updates paused":l.problem==="event_timeout"?"Needs attention":l.phase==="finishing"?"Finishing setup…":l.phase==="connected"?"Connecting…":"Confirming connection…";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"min-h-0 space-y-6 overflow-y-auto px-6 pb-6 pt-8 sm:px-8",children:[(0,a.jsxs)("div",{className:"space-y-3 pr-5",children:[S&&(0,a.jsx)(l1,{type:S.adapter,className:"size-10"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(Ds,{className:"text-xl font-semibold tracking-tight",children:S?N?I?"Your Dot is connected":"Connect your Dot":"Invite your agent":"Invite an external agent"}),(0,a.jsx)(vo,{className:"text-sm leading-relaxed",children:S?I?`Your Dot can now receive assignments and work with ${s}.`:l.problem==="agent_unavailable"?"Your Dot is connected. This agent must be available in Wardmote before it can receive assignments.":l.phase==="finishing"?"Your Dot has connected and confirmed task updates. Wardmote is preparing it for assignments.":C?"Your Dot has connected. We’re checking that task updates can travel both ways.":N?"Copy the setup prompt and send it to your Dot in ChatGPT. Your Dot will connect itself; we’ll watch for it here.":"Copy the invitation prompt and send it to your agent. Approve its join request in Wardmote when it’s ready.":`Bring an agent you already use into ${s}.`})]})]}),j&&(0,a.jsxs)("div",{role:"alert",className:"space-y-3 text-sm text-bad",children:[(0,a.jsx)("p",{children:j}),(0,a.jsx)(oe,{variant:"secondary",disabled:y,onClick:h,children:"Try again"})]}),S?k?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"An organization admin needs to approve this agent before Dot can connect. This page will update after approval."}):y&&!t&&l.phase==="waiting"?(0,a.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Preparing your invitation…"}):N?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"border-t pt-6",children:[(0,a.jsx)(U$,{state:l}),l.phase==="waiting"&&(0,a.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Dot uses your OpenAI account. Provider usage and cost aren’t reported to Wardmote."})]}),l.problem==="event_timeout"&&(0,a.jsx)(oe,{variant:"secondary",disabled:y,onClick:h,children:"Retry test event"}),l.problem==="offline"&&(0,a.jsx)(oe,{variant:"secondary",disabled:y,onClick:h,children:"Reconnect updates"})]}):(0,a.jsxs)("p",{className:"text-sm leading-relaxed text-ink-3",children:["The invitation includes everything your agent needs to join ",s,". You can review its request before granting access."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P$,{onSelect:c,dotDisabledReason:v}),v&&(0,a.jsx)("p",{className:"text-sm text-ink-3",children:v})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t px-6 py-4 sm:px-8",children:[(0,a.jsxs)(oe,{variant:"ghost",onClick:S?u:p,children:[S&&(0,a.jsx)(N0,{className:"size-4"}),S?"Back":"Cancel"]}),S&&(k?(0,a.jsx)(oe,{asChild:!0,children:(0,a.jsx)(mn,{to:k,onClick:p,children:"Review approval"})}):I?(0,a.jsx)(oe,{onClick:p,children:"Done"}):C?(0,a.jsxs)(oe,{disabled:!0,"aria-live":"polite",children:[!l.problem&&(0,a.jsx)(Ta,{className:"size-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),M]}):N&&l.problem==="prompt_unavailable"?(0,a.jsx)(oe,{disabled:y,onClick:g,children:"Create a new prompt"}):!t||y?(0,a.jsx)(oe,{disabled:!0,children:y?"Preparing…":"Waiting for Dot…"}):(0,a.jsx)(BT,{prompt:t,label:N?"Copy setup prompt":"Copy invitation prompt",title:N?"Connect your Dot":"Invite your agent",description:N?"Send this whole prompt to your Dot in ChatGPT.":"Send this whole prompt to your agent.",agent:N?{name:"Dot",src:"/brands/adapters/openai-dot.svg"}:void 0,align:"end",className:"min-w-0 shrink",onCopied:f},e))]})]})}r(B$,"ExternalAgentInviteContent");function K$({companyId:e,onClose:t,onBack:s}){const l=kn(),{selectedCompany:c}=vt(),[u,p]=(0,x.useState)(null),[f,h]=(0,x.useState)(null),[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),[k,S]=(0,x.useState)(""),N=(0,x.useRef)(!1),I=me({queryKey:P.instance.experimentalSettings,queryFn:pa.getExperimental}),C=I.isPending?"Loading available agents…":I.error?"Unable to load feature settings. Try again after refreshing.":!I.data?.enableOpenAiDot||!I.data.enablePublicMcp?"Turn on OpenAI Dot and Assistant connections in Settings > Features.":void 0,M=["dot-binding",e,f?.agent.id],R=me({queryKey:M,queryFn:r(({signal:ie})=>bd.connection(e,f.agent.id,ie),"queryFn"),enabled:u==="dot"&&!!f,retry:!1,staleTime:0,refetchInterval:r(ie=>ie.state.error||ie.state.data?.agentLifecycleState==="ready"&&ie.state.data.canConfigureConnection&&ie.state.data.binding?.status==="ready"&&ie.state.data.binding.subscriptionVerified?!1:2500,"refetchInterval")}),_=Bt({mutationFn:r(async ie=>{if(ie==="dot"){const we=await bd.create(e);h(we),await l.invalidateQueries({queryKey:P.agents.list(e)});return}const le=await ei.createCompanyInvite(e,{allowedJoinTypes:"agent",humanRole:null,agentMessage:null});l.invalidateQueries({queryKey:P.access.invites(e,"all",5)});const Ae=le.onboardingTextUrl??le.onboardingTextPath??`/api/invites/${le.token}/onboarding.txt`,de=await ei.getInviteOnboarding(le.token).catch(()=>null);S(D$({onboardingTextUrl:new URL(Ae,window.location.origin).href,connectionCandidates:de?.onboarding.connectivity?.connectionCandidates??null,testResolutionUrl:de?.onboarding.connectivity?.testResolutionEndpoint?.url??null}))},"mutationFn"),gcTime:0}),D=Bt({mutationFn:r(async ie=>{const le=await bd.pair(e,f.agent.id,ie);v(le),j(null)},"mutationFn"),onSuccess:r(()=>{l.invalidateQueries({queryKey:M})},"onSuccess"),onError:r(()=>{R.refetch()},"onError"),gcTime:0}),U=Bt({mutationFn:r(()=>bd.retry(e,f.agent.id,R.data.binding.id),"mutationFn"),onSuccess:r(()=>{l.invalidateQueries({queryKey:M})},"onSuccess")}),K=R.data?.binding,z=u==="dot"&&R.data?.enabled&&!!R.data.resourceUrl&&R.data.canConfigureConnection&&(!K||K.status==="pairing")&&!g&&!R.error&&!D.isError&&!N.current&&(!y||K?.id===y);(0,x.useEffect)(()=>{z&&R.isFetchedAfterMount&&!R.isFetching&&!D.isPending&&(N.current=!0,D.mutate(K?.id))},[z,R.isFetchedAfterMount,R.isFetching,D.isPending,D.mutate,K?.id]),(0,x.useEffect)(()=>{if(!g)return;const ie=window.setTimeout(()=>{N.current=!1,j(g.bindingId),v(null)},Math.max(0,Date.parse(g.expiresAt)-Date.now()));return()=>window.clearTimeout(ie)},[g]);const E=K?.status==="ready"&&K.subscriptionVerified,B=R.data?.agentLifecycleState==="ready"&&R.data.canConfigureConnection,O=["preparing","verifying"].includes(R.data?.agentLifecycleState??"")&&R.data?.canConfigureConnection,Q={phase:E?B?"ready":O?"finishing":"ready":K?.hasPendingChallenge?"testing":K?.subscriptionVerified?"subscribed":K?.connected?"connected":"waiting",problem:R.error?"offline":E&&!B&&!O?"agent_unavailable":K?.status==="pairing"&&!z&&!D.isPending&&!R.isFetching&&!D.isError&&g?.bindingId!==K.id?"prompt_unavailable":K?.challengeExpiresAt&&!K.hasPendingChallenge&&K.status!=="ready"?"event_timeout":void 0},V=(R.data?.agentStatus??f?.agent.status)==="pending_approval",ue=R.data&&!R.data.canConfigureConnection&&!V,ce=u==="dot"?g&&g.bindingId===K?.id&&R.data?.resourceUrl&&f?qE({companyId:e,agentId:f.agent.id,resourceUrl:R.data.resourceUrl,...g}):"":k,X=(_.variables===u?_.error:null)??(u==="dot"?(K?.connected?null:D.error)??U.error:null),A=_.isPending||D.isPending||U.isPending||z||u==="dot"&&!!f&&(R.isPending||!ce&&R.isFetching),ee=r(()=>{if(ue){R.refetch();return}if(R.error){R.refetch();return}if(_.error||!f){u&&_.mutate(u);return}if(D.error&&!K?.connected){D.mutate(K?.status==="pairing"?K.id:void 0);return}U.mutate()},"retry");return(0,a.jsx)(ws,{open:!0,onOpenChange:r(ie=>{ie||t()},"onOpenChange"),children:(0,a.jsx)(z$,{className:"sm:max-w-(--sz-560px)",children:(0,a.jsx)(B$,{preset:u,prompt:ce,companyName:c?.name??"your organization",connection:Q,dotDisabledReason:C,busy:A,error:X?.message??(ue?R.data?.agentLifecycleState==="terminated"?"This agent was terminated. Invite another agent to connect Dot.":"Resume this agent before connecting Dot.":void 0),approvalHref:V&&f?.approvalId?`/approvals/${f.approvalId}`:void 0,onSelect:r(ie=>{p(ie),(ie==="dot"?!f:!k)&&_.mutate(ie)},"onSelect"),onBack:r(()=>p(null),"onBack"),onClose:u?t:s,onCopied:r(()=>{u==="dot"&&R.refetch()},"onCopied"),onRetry:ee,onNewPrompt:r(()=>D.mutate(K?.id),"onNewPrompt")})})})}r(K$,"ExternalAgentInviteDialog");function q$(){const{newAgentOpen:e,closeNewAgent:t}=Vc(),{selectedCompanyId:s}=vt();return e?(0,a.jsx)(F$,{companyId:s,onClose:t},s):null}r(q$,"NewAgentDialog");function F$({companyId:e,onClose:t}){const s=ja(),[l,c]=(0,x.useState)(!1);return l&&e?(0,a.jsx)(K$,{companyId:e,onClose:t,onBack:r(()=>c(!1),"onBack")}):(0,a.jsx)(VE,{open:!0,onClose:t,onInvite:e?()=>c(!0):void 0,onContinue:r(u=>{t(),s(`/agents/new?${FE(u)}`)},"onContinue")})}r(F$,"NewAgentDialogContent");var H$=[{title:"Inbox",shortcuts:[{keys:["j"],label:"Move down"},{keys:["↓"],label:"Move down"},{keys:["k"],label:"Move up"},{keys:["↑"],label:"Move up"},{keys:["←"],label:"Collapse selected group"},{keys:["→"],label:"Expand selected group"},{keys:["Enter"],label:"Open selected item"},{keys:["a"],label:"Archive item"},{keys:["y"],label:"Archive item"},{keys:["r"],label:"Mark as read"},{keys:["U"],label:"Mark as unread"}]},{title:"Task detail",shortcuts:[{keys:["y"],label:"Quick-archive back to inbox"},{keys:["g","i"],label:"Go to inbox"},{keys:["g","c"],label:"Focus comment composer"}]},{title:"Decisions",shortcuts:[{keys:["j"],label:"Move down"},{keys:["↓"],label:"Move down"},{keys:["k"],label:"Move up"},{keys:["↑"],label:"Move up"},{keys:["Enter"],label:"Open or close selected decision"},{keys:["x"],label:"Dismiss selected decision"}]},{title:"Global",shortcuts:[{keys:["/"],label:"Search current page or quick search"},{keys:["c"],label:"New task"},{keys:["["],label:"Toggle sidebar"},{keys:["]"],label:"Toggle panel"},{keys:["?"],label:"Show keyboard shortcuts"}]}];function Sw({children:e}){return(0,a.jsx)("kbd",{className:"inline-flex h-6 min-w-6 items-center justify-center rounded border border-line bg-bg-3 px-1.5 font-mono text-xs font-medium text-ink shadow-(--shadow-extract-10)",children:e})}r(Sw,"KeyCap");function V$(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"divide-y divide-line border-t border-line",children:H$.map(e=>(0,a.jsxs)("div",{className:"px-5 py-3",children:[(0,a.jsx)("h3",{className:"mb-2 text-(length:--text-micro) font-semibold uppercase tracking-wider text-ink-3",children:e.title}),(0,a.jsx)("div",{className:"space-y-1.5",children:e.shortcuts.map(t=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("span",{className:"text-sm text-ink/90",children:t.label}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:t.keys.map((s,l)=>(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[l>0&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:t.combo?"+":"then"}),(0,a.jsx)(Sw,{children:s})]},s))})]},t.label+t.keys.join()))})]},e.title))}),(0,a.jsx)("div",{className:"border-t border-line px-5 py-3",children:(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Press ",(0,a.jsx)(Sw,{children:"Esc"})," to close · Shortcuts are disabled in text fields"]})})]})}r(V$,"KeyboardShortcutsCheatsheetContent");function W$({open:e,onOpenChange:t}){return(0,a.jsx)(ws,{open:e,onOpenChange:t,children:(0,a.jsxs)(Ps,{className:"sm:max-w-md gap-0 p-0 overflow-hidden",showCloseButton:!1,children:[(0,a.jsx)(bo,{className:"px-5 pt-5 pb-3",children:(0,a.jsx)(Ds,{className:"text-base",children:"Keyboard shortcuts"})}),(0,a.jsx)(V$,{})]})})}r(W$,"KeyboardShortcutsCheatsheet");var Q$={info:"border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-500/25 dark:bg-sky-950/60 dark:text-sky-100",success:"border-emerald-300 bg-emerald-50 text-emerald-900 dark:border-emerald-500/25 dark:bg-emerald-950/60 dark:text-emerald-100",warn:"border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-500/25 dark:bg-amber-950/60 dark:text-amber-100",error:"border-red-300 bg-red-50 text-red-900 dark:border-red-500/30 dark:bg-red-950/60 dark:text-red-100"},G$={info:"bg-sky-500 dark:bg-sky-400",success:"bg-emerald-500 dark:bg-emerald-400",warn:"bg-amber-500 dark:bg-amber-400",error:"bg-red-500 dark:bg-red-400"};function Y$({toast:e,onDismiss:t}){const[s,l]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{const c=requestAnimationFrame(()=>l(!0));return()=>cancelAnimationFrame(c)},[]),(0,a.jsx)("li",{className:Y("pointer-events-auto rounded-sm border shadow-lg backdrop-blur-xl transition-(--tp-transform-opacity) duration-200 ease-out",s?"translate-y-0 opacity-100":"translate-y-3 opacity-0",Q$[e.tone]),children:(0,a.jsxs)("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[e.actor?.type==="agent"?(0,a.jsx)(pr,{agent:{id:e.actor.id,name:e.actor.name,appearance:e.actor.appearance},size:24}):e.actor?.type==="user"?(0,a.jsxs)(Gd,{size:"sm","aria-hidden":"true",children:[e.actor.image&&(0,a.jsx)(Wd,{src:e.actor.image,alt:""}),(0,a.jsx)(Qd,{children:q3(e.actor.name)})]}):(0,a.jsx)("span",{className:Y("mt-1 h-2 w-2 shrink-0 rounded-full",G$[e.tone])}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold leading-5",children:e.title}),e.body&&(0,a.jsx)("p",{className:"mt-1 text-xs leading-4 opacity-70",children:e.body}),e.action&&(e.action.onClick?(0,a.jsx)("button",{type:"button",onClick:r(()=>{e.action?.onClick?.(),t(e.id)},"onClick"),className:"mt-2 inline-flex text-xs font-medium underline underline-offset-4 hover:opacity-90",children:e.action.label}):e.action.href?(0,a.jsx)(mn,{to:e.action.href,onClick:r(()=>t(e.id),"onClick"),className:"mt-2 inline-flex text-xs font-medium underline underline-offset-4 hover:opacity-90",children:e.action.label}):null)]}),(0,a.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:r(()=>t(e.id),"onClick"),className:"mt-0.5 shrink-0 rounded p-1 opacity-50 hover:bg-black/10 hover:opacity-100 dark:hover:bg-white/10",children:(0,a.jsx)(ia,{className:"h-3.5 w-3.5"})})]})})}r(Y$,"AnimatedToast");function X$(){const e=F3(),{dismissToast:t}=Ti();return e.length===0?null:(0,a.jsx)("aside",{"aria-live":"polite","aria-atomic":"false",className:"pointer-events-none fixed bottom-3 left-3 z-(--z-120) w-full max-w-sm px-1",children:(0,a.jsx)("ol",{className:"flex w-full flex-col-reverse gap-2",children:e.map(s=>(0,a.jsx)(Y$,{toast:s,onDismiss:t},s.id))})})}r(X$,"ToastViewport");async function Nw(e,t){const s=await fetch(`/api/announcements/${e}`,{credentials:"same-origin",cache:"no-store",...t});if(!s.ok)throw new Ii("Announcement request failed",s.status,null);return s}r(Nw,"request");var Cw={async current(e){const t=await(await Nw("current",{signal:e})).json();return t===null?null:gE.parse(t)},async dismiss(e,t,s){await Nw(`${encodeURIComponent(e)}/dismiss`,{method:"POST",signal:s,headers:{"Content-Type":"application/json"},body:JSON.stringify({companyId:t})})}},Mg=new Map;function px(e){return`wardmote.announcement-dismissals.v1:${encodeURIComponent(e)}:`}r(px,"announcementStoragePrefix");function vd(e){const t=px(e),s=new Map;try{for(let l=0;l<localStorage.length;l++){const c=localStorage.key(l);if(!c?.startsWith(t))continue;const u=c.slice(t.length),p=localStorage.getItem(c);t1.safeParse(u).success&&(p==="pending"||p==="synced")&&Mg.set(c,p==="pending")}}catch{}for(const[l,c]of Mg)l.startsWith(t)&&s.set(l.slice(t.length),c);return s}r(vd,"readAnnouncementDismissals");function Nh(e,t,s){const l=`${px(e)}${t}`;Mg.set(l,s);try{return localStorage.setItem(l,s?"pending":"synced"),!0}catch{return!1}}r(Nh,"saveAnnouncementDismissal");var Z$=3e3;function J$(e){const{userId:t,enabled:s}=e,l=(0,x.useRef)(e);l.current=e;const[c,u]=(0,x.useState)(null),p=(0,x.useRef)(()=>{});(0,x.useEffect)(()=>{if(u(null),!t||!s)return;let h=!1,g=0,v=null,y;const j=new Map,k=new Set,S=px(t);let N=null;try{N=new BroadcastChannel(S)}catch{}const I=r(()=>!h&&l.current.userId===t&&l.current.enabled,"active");async function C(E,B=!0){if(!I()||j.has(E)||!l.current.companyId)return;const O=new AbortController;j.set(E,O);const Q=setTimeout(()=>O.abort(),1e4);try{await Cw.dismiss(E,l.current.companyId,O.signal),I()&&Nh(t,E,!1)}catch{I()&&!k.has(E)&&(k.add(E),l.current.onSaveFailure(B))}finally{clearTimeout(Q),j.delete(E)}}r(C,"sync");async function M(){for(const[E,B]of vd(t)){if(!I())return;B&&await C(E)}}r(M,"flush");function R(){g++,clearTimeout(y),v?.abort(),v=null,u(null)}r(R,"suspend");function _(){if(!I()||document.visibilityState==="hidden")return;R();const E=g,B=new AbortController;v=B;const O=r(()=>I()&&g===E&&!B.signal.aborted,"stillCurrent");let Q=!1,V=!1,ue=null;const ce=r(()=>{!O()||!Q||!V||ue&&!vd(t).has(ue.id)&&(!ue.expiresAt||Date.parse(ue.expiresAt)>Date.now())&&u({userId:t,announcement:ue})},"show");y=setTimeout(()=>{Q=!0,ce()},Z$),M(),Cw.current(B.signal).then(X=>{ue=X,V=!0,ce()}).catch(()=>{})}r(_,"resume");function D(){const E=vd(t);u(B=>B?.userId===t&&E.has(B.announcement.id)?null:B)}r(D,"receive");function U(E){E.key?.startsWith(S)&&D()}r(U,"onStorage");function K(){document.visibilityState==="hidden"?R():_()}r(K,"onVisibility");function z(){M()}return r(z,"onOnline"),N&&(N.onmessage=E=>{const B=t1.safeParse(E.data);B.success&&(vd(t).has(B.data)||Nh(t,B.data,!0),D())}),p.current=E=>{if(!I())return;const B=Nh(t,E,!0);u(null),g++,v?.abort();try{N?.postMessage(E)}catch{}C(E,B)},document.addEventListener("visibilitychange",K),window.addEventListener("online",z),window.addEventListener("storage",U),_(),()=>{h=!0,g++,clearTimeout(y),v?.abort();for(const E of j.values())E.abort();N?.close(),document.removeEventListener("visibilitychange",K),window.removeEventListener("online",z),window.removeEventListener("storage",U),p.current=()=>{}}},[t,s]);const f=s&&c?.userId===t?c.announcement:null;return(0,x.useEffect)(()=>{if(!f?.expiresAt)return;let h;const g=r(()=>{const v=Date.parse(f.expiresAt)-Date.now();v<=0?u(null):h=setTimeout(g,Math.min(v,2147483647))},"check");return g(),()=>clearTimeout(h)},[f]),{announcement:f,dismiss:(0,x.useCallback)(h=>p.current(h),[])}}r(J$,"useAnnouncement");function eU(e,t){const s=U0(),l=t??`/api/announcements/${encodeURIComponent(e.id)}/animation`,c=`${l}:${e.animation?.path??""}`,[u,p]=(0,x.useState)(null),f=!!e.animation&&!s;return(0,x.useEffect)(()=>{if(!f)return;const h=new AbortController,g=setTimeout(()=>h.abort(),5e3);return(async()=>{try{const v=await fetch(l,{credentials:"same-origin",cache:"no-store",redirect:"error",referrerPolicy:"no-referrer",signal:h.signal});if(!v.ok||v.headers.get("content-type")?.split(";")[0]!=="text/html")return;const y=await v.text();h.signal.aborted||p({key:c,document:`<meta http-equiv="Content-Security-Policy" content="${kE}">${y}`})}catch{}finally{clearTimeout(g)}})(),()=>{h.abort(),clearTimeout(g)}},[f,c,l]),f&&u?.key===c?u.document:null}r(eU,"useAnnouncementAnimation");function Aw({action:e,primary:t,onClick:s}){const l=(0,a.jsxs)(a.Fragment,{children:[e.label,!t&&e.kind==="external"&&(0,a.jsx)(OI,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}),c=r(u=>{u.button===1&&s()},"onAuxClick");return(0,a.jsx)(oe,{asChild:!0,variant:t?"primary":"ghost",size:"sm",className:"h-auto min-h-9 min-w-0 whitespace-normal py-2 text-left",children:e.kind==="external"?(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:s,onAuxClick:c,children:l}):(0,a.jsx)(mn,{to:e.path,onClick:s,onAuxClick:c,children:l})})}r(Aw,"Action");function tU({announcement:e,onDismiss:t,imageSrc:s,animationSrc:l,className:c}){const u=(0,x.useId)(),[p,f]=(0,x.useState)(null),h=s??`/api/announcements/${encodeURIComponent(e.id)}/image`,g=!!(e.image&&p!==h),v=eU(e,l),y=!!v;return(0,a.jsxs)(Hc,{role:"region","aria-labelledby":u,className:Y("relative w-full max-w-(--announcement-width) gap-0 overflow-hidden rounded-xl p-0 shadow-sm",c),onKeyDown:r(j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),t())},"onKeyDown"),children:[(g||v)&&(0,a.jsxs)("div",{className:"relative h-(--announcement-image-mobile-height) w-full shrink-0 overflow-hidden bg-bg-3 md:h-(--announcement-image-height)",children:[g&&(0,a.jsx)("img",{src:h,alt:y?"":e.image.alt,referrerPolicy:"no-referrer",onError:r(()=>f(h),"onError"),className:"h-full w-full object-cover"}),y&&(0,a.jsx)("div",{role:"img","aria-label":e.animation.alt,className:"pointer-events-none absolute inset-0",children:(0,a.jsx)("iframe",{title:e.animation.alt,"aria-hidden":"true",tabIndex:-1,sandbox:"",referrerPolicy:"no-referrer",srcDoc:v,className:"h-full w-full border-0"})})]}),(0,a.jsx)(oe,{variant:"secondary",size:"icon","aria-label":"Dismiss announcement",onClick:t,className:"absolute right-2 top-2 z-10 size-8 rounded-full shadow-sm",children:(0,a.jsx)(ia,{className:"size-4","aria-hidden":"true"})}),(0,a.jsxs)("div",{className:Y("flex flex-col gap-1 px-4 py-4",!g&&!v&&"pr-12"),children:[(0,a.jsx)("p",{className:"text-xs text-ink-3",children:e.eyebrow}),(0,a.jsx)("h2",{id:u,className:"break-words text-base font-semibold leading-snug",children:e.title}),(0,a.jsx)("p",{className:"break-words text-sm leading-snug text-ink-3",children:e.description})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t px-3 py-2",children:[e.secondaryLink&&(0,a.jsx)(Aw,{action:e.secondaryLink,onClick:t}),(0,a.jsx)("div",{className:"ml-auto min-w-0 max-w-full",children:(0,a.jsx)(Aw,{action:e.primaryAction,primary:!0,onClick:t})})]})]})}r(tU,"AnnouncementCard");var nU='[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"], [aria-modal="true"]:not([data-state="closed"]), dialog[open]';function aU(e){const[t,s]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(!e)return;const l=r(()=>s(!!document.querySelector(nU)),"scan");l();const c=new MutationObserver(l);return c.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","aria-modal","open"]}),()=>c.disconnect()},[e]),t}r(aU,"useModalOpen");function sU({health:e}){const{userId:t,settled:s}=j0(),{selectedCompanyId:l,loading:c}=vt(),{onboardingOpen:u}=qf(),p=Of(),f=H3(),h=e?.deploymentMode==="local_trusted"?"local-board":s?t:null,{announcement:g,dismiss:v}=J$({userId:h,companyId:l,enabled:!!(h&&!c&&l&&!u),onSaveFailure:r(j=>p?.pushToast({title:j?"Dismissed in this browser":"Dismissed for this visit",body:"Couldn’t save across devices. We’ll retry when you reconnect or return.",tone:"info",dedupeKey:"announcement-dismissal-sync"}),"onSaveFailure")}),y=aU(!!g);return!g||y||(f?.length??0)>0?null:(0,a.jsx)("aside",{"aria-label":"Wardmote announcements",className:"announcement-well fixed left-3 bottom-(--announcement-mobile-bottom) z-40 w-(--announcement-available-width) max-w-(--announcement-width) max-h-(--announcement-mobile-max-height) overflow-y-auto md:bottom-3 md:max-h-(--announcement-max-height)",children:(0,a.jsx)(tU,{announcement:g,onDismiss:r(()=>v(g.id),"onDismiss")},g.id)})}r(sU,"AnnouncementWell");function ep(e){const t=e.split("/").filter(Boolean);return t.length===1?t[0]?.toLowerCase()==="onboarding":t.length===2?t[1]?.toLowerCase()==="onboarding":!1}r(ep,"isOnboardingPath");function iU(e){const t=e.split("/").filter(Boolean);if(t.length===2&&t[1]?.toLowerCase()==="onboarding")return t[0]}r(iU,"companyPrefixFromOnboardingPath");function gA(){return 3}r(gA,"onboardingStepForCompany");function rU(e){const{pathname:t,companyPrefix:s,companies:l}=e;if(!ep(t))return null;if(!s)return{initialStep:1};const c=l.find(u=>u.issuePrefix.toUpperCase()===s.toUpperCase())??null;return c?{initialStep:gA(),companyId:c.id}:{initialStep:1}}r(rU,"resolveRouteOnboardingOptions");function bY(e){return!e.agentsLoaded||e.agentsRefreshing||e.agentCount>0?!1:!ep(e.pathname)}r(bY,"shouldRouteAgentlessCompanyToOnboarding");function mx(e){return!e.hasCompanies&&!ep(e.pathname)}r(mx,"shouldRedirectCompanylessRouteToOnboarding");function lU(e){return e.onboardingOpen||!e.routeDismissed}r(lU,"isOnboardingWizardActive");function oU({context:e}){const{slots:t,errorMessage:s}=qc({slotTypes:["appShellOverlay"],companyId:e.companyId});return s||t.length===0?null:(0,a.jsx)("aside",{className:"plugin-app-shell-overlays","aria-label":"Application extensions",children:t.map(l=>(0,a.jsx)(D0,{slot:l,context:e,className:"plugin-app-shell-overlay"},`${l.pluginId}:${l.pluginVersion}:${l.id}`))})}r(oU,"AppShellEntries");function cU({localTrusted:e=!1}){const{userId:t,settled:s}=j0(),{selectedCompanyId:l,selectedCompany:c,loading:u}=vt(),{onboardingOpen:p,onboardingRouteDismissed:f}=qf(),{pathname:h}=hn(),g=s?t??(e?"local-board":null):null,v=p||!f&&ep(h);if(!g||u||v)return null;const y={companyId:l,companyPrefix:c?.issuePrefix??null,projectId:null,entityId:null,entityType:null,parentEntityId:null,userId:t};return(0,a.jsx)(oU,{context:y},JSON.stringify([g,l]))}r(cU,"PluginAppShellOverlays");var _w="relative flex min-h-(--sz-calc-11) min-w-0 flex-col items-center justify-center gap-1 rounded-md text-(length:--text-nano) font-medium transition-colors";function uU({visible:e}){const{selectedCompanyId:t}=vt(),{sidebarOpen:s,setSidebarOpen:l}=Jn(),c=Q0(t),{enabled:u}=zf(),{enabled:p}=Zf(),f=(0,x.useMemo)(()=>[{to:"/dashboard",label:"Home",icon:xR},...p?[]:[{to:"/inbox",label:"Inbox",icon:A0,badge:c.inbox}],{to:"/issues",label:"Tasks",icon:Jh,badge:p?c.inbox:void 0},...u?[{to:"/chats",label:"Chat",icon:vg}]:[]],[c.inbox,u,p]);return(0,a.jsx)("nav",{className:"mobile-bottom-nav fixed inset-x-0 bottom-0 z-30 bg-bg-3 pb-(--sz-safe-bottom)","data-visible":e,inert:!e,"aria-label":"Mobile navigation",children:(0,a.jsxs)("div",{className:"grid h-16 px-1",style:{gridTemplateColumns:`repeat(${f.length+1}, minmax(0, 1fr))`},children:[f.map(h=>{const g=h.icon;return(0,a.jsx)(m1,{to:h.to,state:Df,className:r(({isActive:v})=>Y(_w,v?"text-ink":"text-ink-3"),"className"),children:r(({isActive:v})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"relative",children:[(0,a.jsx)(g,{className:Y("h-(--sz-18px) w-(--sz-18px)",v&&"stroke-(length:--sw-2_3)")}),h.badge!=null&&h.badge>0&&(0,a.jsx)(Dn,{variant:"ghost",className:"absolute -end-2 -top-2 bg-accent px-1.5 text-(length:--text-nano) leading-none text-accent-ink",children:h.badge>99?"99+":h.badge})]}),(0,a.jsx)("span",{className:"truncate",children:h.label})]}),"children")},h.label)}),(0,a.jsxs)("button",{type:"button","aria-expanded":s,onClick:r(()=>l(!0),"onClick"),className:Y(_w,s?"text-ink":"text-ink-3"),children:[(0,a.jsx)(BS,{className:"h-(--sz-18px) w-(--sz-18px)"}),(0,a.jsx)("span",{className:"truncate",children:"More"})]})]})})}r(uU,"MobileBottomNav");function Jl(e){if(typeof document>"u")return null;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content")?.trim();return t||null}r(Jl,"readMetaContent");function Dg(e){if(!e)return null;const t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]{3}$/.test(t)?`#${t.split("").map(s=>`${s}${s}`).join("").toLowerCase()}`:/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:null}r(Dg,"normalizeHexColor");function dU(e){const t=Dg(e)??"#000000";return{r:Number.parseInt(t.slice(1,3),16),g:Number.parseInt(t.slice(3,5),16),b:Number.parseInt(t.slice(5,7),16)}}r(dU,"hexToRgb");function Ch(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}r(Ch,"relativeLuminanceChannel");function fU(e){const{r:t,g:s,b:l}=dU(e),c=.2126*Ch(t)+.7152*Ch(s)+.0722*Ch(l);return 1.05/(c+.05)>=(c+.05)/.05?DT:OT}r(fU,"pickReadableTextColor");function vY(){return Jl("wardmote-worktree-enabled")==="true"}r(vY,"isWorktreeRuntime");function yY(){return Jl("wardmote-instance-id")}r(yY,"getWorktreeInstanceId");function pU(){if(Jl("wardmote-worktree-enabled")!=="true")return null;const e=Jl("wardmote-worktree-name"),t=Dg(Jl("wardmote-worktree-color"));return!e||!t?null:{enabled:!0,name:e,color:t,textColor:Dg(Jl("wardmote-worktree-text-color"))??fU(t)}}r(pU,"getWorktreeUiBranding");function mU(){const e=pU(),{copied:t,failed:s,copy:l}=KT(),c=(0,x.useCallback)(()=>{e&&l(e.name)},[e,l]);return e?(0,a.jsx)("div",{className:"relative overflow-hidden border-b px-3 py-1.5 text-(length:--text-micro) font-medium tracking-(--tracking-caps) uppercase",style:{backgroundColor:e.color,color:e.textColor,borderColor:`${e.textColor}22`,boxShadow:`inset 0 -1px 0 ${e.textColor}18`,backgroundImage:`linear-gradient(90deg, ${e.textColor}14, transparent 28%, transparent 72%, ${e.textColor}12), repeating-linear-gradient(135deg, transparent 0 10px, ${e.textColor}08 10px 20px)`},children:(0,a.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden whitespace-nowrap",children:[(0,a.jsx)("span",{className:"shrink-0 opacity-70",children:"Worktree"}),(0,a.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-70","aria-hidden":"true"}),(0,a.jsx)("button",{type:"button",onClick:c,title:"Click to copy worktree name",className:"truncate font-semibold tracking-(--tracking-eyebrow) cursor-pointer hover:opacity-80 transition-opacity bg-transparent border-none p-0 text-current uppercase text-(length:--text-micro)",children:t?"Copied!":s?"Copy failed":e.name})]})}):null}r(mU,"WorktreeBanner");var hU=3e4;function gU(e){if(!e)return null;const t=new Date(e).getTime();if(Number.isNaN(t))return null;const s=Date.now()-t;if(s<6e4)return"just now";const l=Math.round(s/6e4);if(l<60)return`${l}m ago`;const c=Math.round(l/60);return c<24?`${c}h ago`:`${Math.round(c/24)}d ago`}r(gU,"formatRelativeTimestamp");function xU(e){return e.reason==="backend_changes_and_pending_migrations"?"backend files changed and migrations are pending":e.reason==="pending_migrations"?"pending migrations need a fresh boot":"backend files changed since this server booted"}r(xU,"describeReason");function bU({devServer:e}){const[t,s]=(0,x.useState)(!1);if((0,x.useEffect)(()=>{if(!t)return;const h=window.setTimeout(()=>{s(!1)},hU);return()=>window.clearTimeout(h)},[t]),!e?.enabled||!e.restartRequired)return null;const l=e,c=gU(e.lastChangedAt),u=e.changedPathsSample.slice(0,3),p=`${e.activeRunCount} live run${e.activeRunCount===1?"":"s"}`;async function f(){const h=l.activeRunCount>0?`Restart Wardmote now? This may interrupt ${p}.`:"Restart Wardmote now?";if(window.confirm(h)){s(!0);try{await Fc.requestDevServerRestart()}catch(g){s(!1),window.alert(g instanceof Error?g.message:"Failed to request restart")}}}return r(f,"requestRestartNow"),(0,a.jsx)("div",{className:"border-b border-amber-300/60 bg-amber-50 text-amber-950 dark:border-amber-500/25 dark:bg-amber-500/10 dark:text-amber-100",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 px-3 py-2.5 md:flex-row md:items-center md:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-(--tracking-caps)",children:[(0,a.jsx)(ni,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{children:"Restart Required"}),e.autoRestartEnabled?(0,a.jsx)(Dn,{variant:"ghost",className:"bg-amber-900/10 text-(length:--text-nano) tracking-(--tracking-eyebrow) dark:bg-amber-100/10",children:"Auto-Restart On"}):null]}),(0,a.jsxs)("p",{className:"mt-1 text-sm",children:[xU(e),c?` · updated ${c}`:""]}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-amber-900/80 dark:text-amber-100/75",children:[u.length>0?(0,a.jsxs)("span",{children:["Changed: ",u.join(", "),e.changedPathCount>u.length?` +${e.changedPathCount-u.length} more`:""]}):null,e.pendingMigrations.length>0?(0,a.jsxs)("span",{children:["Pending migrations: ",e.pendingMigrations.slice(0,2).join(", "),e.pendingMigrations.length>2?` +${e.pendingMigrations.length-2} more`:""]}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs font-medium md:justify-end",children:[e.waitingForIdle?(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-amber-900/10 px-3 py-1.5 dark:bg-amber-100/10",children:[(0,a.jsx)(LR,{className:"h-3.5 w-3.5"}),(0,a.jsxs)("span",{children:["Waiting for ",p," to finish"]})]}):e.autoRestartEnabled?(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-amber-900/10 px-3 py-1.5 dark:bg-amber-100/10",children:[(0,a.jsx)(gc,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"Auto-restart will trigger when the instance is idle"})]}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-amber-900/10 px-3 py-1.5 dark:bg-amber-100/10",children:[(0,a.jsx)(gc,{className:"h-3.5 w-3.5"}),(0,a.jsxs)("span",{children:["Restart ",(0,a.jsx)("code",{children:"pnpm dev:once"})," after the active work is safe to interrupt"]})]}),(0,a.jsxs)(oe,{variant:"primary",size:"sm",type:"button",onClick:r(()=>{f()},"onClick"),disabled:t,children:[(0,a.jsx)(gc,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:t?"Restart requested":"Restart now"})]})]})]})})}r(bU,"DevRestartBanner");var vU=new Set(["disk_space_low","database_backup_skipped_low_disk"]);function yU({diskSpace:e,warnings:t}){const s=(t??[]).filter(u=>vU.has(u.code)),l=e?.level==="emergency",c=l?"Disk space critical":"Disk space low";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"sr-only","aria-live":l?"assertive":"polite","aria-atomic":"true",children:s.length>0?`${c}. ${s.map(u=>u.message).join(" ")}`:""}),s.length>0&&(0,a.jsx)("section",{"aria-label":c,className:l?"border-b border-red-300/60 bg-red-50 text-red-950 dark:border-red-500/25 dark:bg-red-500/10 dark:text-red-100":"border-b border-amber-300/60 bg-amber-50 text-amber-950 dark:border-amber-500/25 dark:bg-amber-500/10 dark:text-amber-100",children:(0,a.jsxs)("div",{className:"px-3 py-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-(--tracking-caps)",children:[(0,a.jsx)(ni,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{children:c})]}),s.map(u=>(0,a.jsx)("p",{className:"mt-1 text-sm",children:u.message},u.code))]})})]})}r(yU,"DiskSpaceBanner");var eo={getStatus:r(()=>je.get("/instance/updates"),"getStatus"),getInstall:r(()=>je.get("/instance/updates/install",{cache:"no-store"}),"getInstall"),liveRuns:r(()=>je.get("/instance/live-runs",{cache:"no-store"}),"liveRuns"),startInstall:r((e,t)=>je.post("/instance/updates/install",{version:e,mode:t}),"startInstall"),forceInstall:r(()=>je.post("/instance/updates/install/force",{}),"forceInstall"),cancelInstall:r(()=>je.delete("/instance/updates/install"),"cancelInstall")};function Og(e,t){return`${e} ${t}${e===1?"":"s"}`}r(Og,"plural");function jU(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}r(jU,"formatTime$1");function wU({job:e,serverReachable:t}){switch(e.phase){case"waiting":return(0,a.jsxs)("p",{children:["Waiting for ",Og(e.liveRuns,"run")," to finish. New runs wait until the update is done.",e.waitDeadline?` Gives up at ${jU(e.waitDeadline)} without changing anything.`:""]});case"installing":return(0,a.jsx)("p",{children:t?`Installing Wardmote ${e.toVersion}: database backup, install, then a restart. Database migrations can take a few minutes.`:"The server is restarting. This page reconnects by itself."});case"succeeded":return(0,a.jsxs)("p",{children:["Wardmote ",e.installedVersion??e.toVersion," is installed and running."]});case"cancelled":return(0,a.jsx)("p",{children:e.error??"The update was cancelled. Nothing was installed."});case"failed":return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("p",{children:e.rolledBackTo?`Updating to ${e.toVersion} failed and Wardmote was rolled back to ${e.rolledBackTo}.`:`Updating to ${e.toVersion} failed.`}),e.error?(0,a.jsx)("p",{className:"text-ink-3",children:e.error}):null,e.logHint?(0,a.jsxs)("p",{className:"text-ink-3",children:["Log: ",(0,a.jsx)("code",{className:"rounded bg-bg-3 px-1 py-0.5 text-xs",children:e.logHint})]}):null]})}}r(wU,"UpdateJobSummary");function kU({open:e,onOpenChange:t,status:s,job:l,serverReachable:c,showResult:u=!1}){const p=kn(),[f,h]=(0,x.useState)(null),[g,v]=(0,x.useState)(null);(0,x.useEffect)(()=>{Xl(l)&&v(l.id)},[l]);const y=l!==null&&(Xl(l)||u||l.id===g),j=me({queryKey:[...P.instance.updates,"live-runs"],queryFn:r(()=>eo.liveRuns(),"queryFn"),enabled:e&&!y,staleTime:0,refetchInterval:e&&!y?3e3:!1}),k=r(({job:_})=>{h(null),v(_.id),p.setQueryData([...P.instance.updates,"install"],{job:_})},"onJob"),S=r(_=>h(_ instanceof Error?_.message:String(_)),"onError"),N=Bt({mutationFn:r(_=>eo.startInstall(s.latestVersion,_),"mutationFn"),onSuccess:k,onError:S}),I=Bt({mutationFn:r(()=>eo.forceInstall(),"mutationFn"),onSuccess:k,onError:S}),C=Bt({mutationFn:r(()=>eo.cancelInstall(),"mutationFn"),onSuccess:k,onError:S}),M=N.isPending||I.isPending||C.isPending,R=j.data?j.data.count+j.data.pendingWakes:null;return(0,a.jsx)(ws,{open:e,onOpenChange:t,children:(0,a.jsxs)(Ps,{"data-testid":"update-install-dialog",children:[(0,a.jsxs)(bo,{children:[(0,a.jsxs)(Ds,{children:["Update Wardmote to ",l&&y?l.toVersion:s.latestVersion]}),(0,a.jsxs)(vo,{children:["Installed ",s.currentVersion,". The update backs up the database, installs the new version and restarts the server. If the new version fails its health check, Wardmote rolls back automatically."]})]}),(0,a.jsxs)("div",{className:"text-sm text-ink","aria-live":"polite",children:[y&&l?(0,a.jsx)(wU,{job:l,serverReachable:c}):R===null?(0,a.jsx)("p",{children:j.isError?"Could not count the active runs.":"Counting active runs..."}):R>0?(0,a.jsx)("p",{children:R===1?"1 run is active now. Stopping it restarts it from its last checkpoint after the update; waiting lets it finish first.":`${R} runs are active now. Stopping them restarts each from its last checkpoint after the update; waiting lets them finish first.`}):(0,a.jsx)("p",{children:"No runs are active. The server restarts briefly."}),f?(0,a.jsx)("p",{role:"alert",className:"mt-2 text-bad",children:f}):null]}),(0,a.jsx)(Pf,{children:y&&l?l.phase==="waiting"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(oe,{type:"button",variant:"secondary",disabled:M,onClick:r(()=>C.mutate(),"onClick"),children:"Cancel update"}),(0,a.jsxs)(oe,{type:"button",variant:"danger",disabled:M,onClick:r(()=>I.mutate(),"onClick"),children:["Stop ",Og(l.liveRuns,"run")," and update now"]})]}):l.phase==="succeeded"?(0,a.jsx)(oe,{type:"button",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload"}):(0,a.jsx)(oe,{type:"button",variant:"secondary",onClick:r(()=>t(!1),"onClick"),children:"Close"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(oe,{type:"button",variant:"secondary",disabled:M,onClick:r(()=>t(!1),"onClick"),children:"Cancel"}),R!==null&&R>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(oe,{type:"button",variant:"secondary",disabled:M,onClick:r(()=>N.mutate("wait"),"onClick"),children:"Wait for runs to finish"}),(0,a.jsxs)(oe,{type:"button",variant:"primary",autoFocus:!0,disabled:M,onClick:r(()=>N.mutate("force"),"onClick"),children:["Update and stop ",Og(R,"run")]})]}):(0,a.jsx)(oe,{type:"button",variant:"primary",autoFocus:!0,disabled:M||R===null,onClick:r(()=>N.mutate("wait"),"onClick"),children:"Update now"})]})})]})})}r(kU,"UpdateInstallDialog");var xA="wardmote.updateNotice.hiddenUntil",Ew="wardmote.updateNotice.seenJob",Iw=36e5,SU=2e3,NU=864e5;function CU(e){return e?.source==="local_implicit"||e?.source==="session"&&e.isInstanceAdmin===!0}r(CU,"canSeeUpdateNotice");function bA(e){try{return window.localStorage.getItem(e)}catch{return null}}r(bA,"readStored$1");function Tw(e,t){try{window.localStorage.setItem(e,t)}catch{}}r(Tw,"writeStored");function Rw(){const e=Number(bA(xA));return Number.isFinite(e)&&e>0?e:null}r(Rw,"readHiddenUntil");var Mw="flex min-w-0 items-center gap-2 border-b border-line bg-accent-soft px-3 py-1.5 text-sm text-ink";function AU({now:e=Date.now}){const t=CU(me({queryKey:P.access.currentBoardAccess,queryFn:r(()=>ei.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4}).data),s=me({queryKey:P.instance.updates,queryFn:r(()=>eo.getStatus(),"queryFn"),enabled:t,retry:!1,staleTime:Iw,refetchInterval:Iw}),l=s.data?.install.canInstall===!0,c=me({queryKey:[...P.instance.updates,"install"],queryFn:r(()=>eo.getInstall(),"queryFn"),enabled:t&&l,retry:!1,refetchInterval:r(_=>Xl(_.state.data?.job)||_.state.status==="error"?SU:!1,"refetchInterval")}),u=c.data?.job??null,p=!c.isError,[f,h]=(0,x.useState)(null),[g,v]=(0,x.useState)(Rw),[y,j]=(0,x.useState)(()=>bA(Ew)),k=aR(g,e());(0,x.useEffect)(()=>{if(!k||g===null)return;const _=window.setTimeout(()=>v(Rw()),Math.max(0,g-e())+1e3);return()=>window.clearTimeout(_)},[k,g,e]);const S=s.data;if(!t||!S)return null;const N=u?.finishedAt?e()-Date.parse(u.finishedAt)<NU&&y!==u.id:!1,I=u?.phase==="succeeded"?!S.updateAvailable:u?.phase==="failed"&&S.latestVersion===u.toVersion,C=u!==null&&(Xl(u)||N&&I),M=l?(0,a.jsx)(kU,{open:f!==null,onOpenChange:r(_=>h(_?f??"start":null),"onOpenChange"),status:S,job:u,serverReachable:p,showResult:f==="result"}):null;if(C&&u){const _=u.trigger==="auto"?"Automatic update":"Update",D=u.phase==="waiting"?`${_} to ${u.toVersion} is waiting for ${u.liveRuns} run${u.liveRuns===1?"":"s"} to finish`:u.phase==="installing"?p?`Installing Wardmote ${u.toVersion}...`:"Wardmote is restarting...":u.phase==="succeeded"?`Wardmote ${u.installedVersion??u.toVersion} is installed`:u.rolledBackTo?`${_} to ${u.toVersion} failed and was rolled back to ${u.rolledBackTo}`:`${_} to ${u.toVersion} failed`,U=r(()=>{Tw(Ew,u.id),j(u.id)},"dismiss");return(0,a.jsxs)("section",{"aria-label":"Wardmote update","data-testid":"update-notice","data-phase":u.phase,className:Mw,children:[Xl(u)?(0,a.jsx)(Ta,{className:"size-4 shrink-0 animate-spin text-accent","aria-hidden":"true"}):(0,a.jsx)(aj,{className:`size-4 shrink-0 ${u.phase==="failed"?"text-bad":"text-accent"}`,"aria-hidden":"true"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 truncate font-semibold",role:"status",children:D}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"xs",onClick:r(()=>h("result"),"onClick"),children:"Details"}),Xl(u)?null:(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"xs",onClick:U,children:"Dismiss"}),M]})}if(!S.updateAvailable||!S.latestVersion||k)return null;const R=r(()=>{const _=nR(e());Tw(xA,String(_)),v(_)},"hide");return(0,a.jsxs)("section",{"aria-label":"Wardmote update available","data-testid":"update-notice",className:Mw,children:[(0,a.jsx)(aj,{className:"size-4 shrink-0 text-accent","aria-hidden":"true"}),(0,a.jsxs)("p",{className:"min-w-0 flex-1 truncate",title:`Installed ${S.currentVersion}. ${S.install.command}`,children:[(0,a.jsxs)("b",{className:"font-semibold",children:["Wardmote ",S.latestVersion,(0,a.jsx)("span",{className:"hidden sm:inline",children:" is available"})]}),(0,a.jsxs)("span",{className:"hidden sm:inline",children:[" · installed ",S.currentVersion]}),l?null:(0,a.jsxs)("span",{className:"hidden lg:inline",children:[" · ",(0,a.jsx)("code",{className:"rounded bg-bg px-1 py-0.5 text-xs",children:S.install.command})]})]}),S.releaseNotesUrl?(0,a.jsxs)("a",{href:S.releaseNotesUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-sm font-medium text-accent underline-offset-2 hover:underline",children:[(0,a.jsx)("span",{className:"sm:hidden",children:"Notes"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Release notes"})]}):null,l?(0,a.jsx)(oe,{type:"button",variant:"primary",size:"xs",onClick:r(()=>h("start"),"onClick"),children:"Update now"}):null,(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"xs",onClick:R,title:"Hide for 3 days","aria-label":"Hide the update notice for 3 days",children:"Hide"}),M]})}r(AU,"UpdateNotice");var vA=["standalone","fullscreen","window-controls-overlay"];function _U(e){return`(display-mode: ${e})`}r(_U,"displayModeQuery");function EU(){if(!(typeof window>"u"||typeof window.matchMedia!="function"))return window.matchMedia.bind(window)}r(EU,"defaultMatchMedia");function Lg(e=EU(),t=typeof navigator>"u"?void 0:navigator.standalone){return t===!0?!0:e?vA.some(s=>e(_U(s)).matches):!1}r(Lg,"isChromelessDisplayMode");function yd({label:e,children:t,onClick:s}){return(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm",className:"size-8","aria-label":e,onClick:r(()=>{s()},"onClick"),children:t})}),(0,a.jsx)(Is,{children:e})]})}r(yd,"ControlButton");function IU(e=typeof window>"u"?null:window.history.state){const t=e?.idx;return typeof t=="number"&&t>0}r(IU,"hasInAppHistory");function TU(){const[e,t]=(0,x.useState)(()=>typeof window<"u"?Lg():!1);return(0,x.useEffect)(()=>{if(typeof window>"u")return;const s=r(()=>t(Lg()),"update");if(s(),typeof window.matchMedia!="function")return;const l=vA.map(c=>window.matchMedia(`(display-mode: ${c})`));return l.every(c=>typeof c.addEventListener=="function")?(l.forEach(c=>c.addEventListener("change",s)),()=>l.forEach(c=>c.removeEventListener("change",s))):(l.forEach(c=>c.addListener(s)),()=>l.forEach(c=>c.removeListener(s)))},[]),e}r(TU,"useChromeless");function Dw({mobile:e,onNavigateHome:t}){const s=TU(),l=Of(),c=(0,x.useCallback)(()=>{if(IU()){window.history.back();return}t?t():window.location.assign("/dashboard")},[t]),u=(0,x.useCallback)(()=>{window.location.reload()},[]),p=(0,x.useCallback)(async()=>{const h=window.location.href;try{if(navigator.share){await navigator.share({title:document.title||"Wardmote",url:h});return}await $0(h),l?.pushToast({title:"Link copied",tone:"success"})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;l?.pushToast({title:"Share failed",body:"Try opening the page in your browser.",tone:"error"})}},[l]),f=(0,x.useCallback)(()=>{window.open(window.location.href,"_blank","noopener,noreferrer")},[]);return s?(0,a.jsxs)("div",{className:Y("flex items-center gap-1",e?"h-10 border-b border-line bg-bg/95 px-3 backdrop-blur supports-[backdrop-filter]:bg-bg/85":"h-9 border-b border-line px-2"),children:[(0,a.jsx)(yd,{label:"Back",onClick:c,children:(0,a.jsx)(N0,{className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)(yd,{label:"Refresh",onClick:u,children:(0,a.jsx)(nl,{className:"h-4 w-4"})}),(0,a.jsx)(yd,{label:"Share",onClick:p,children:(0,a.jsx)(IR,{className:"h-4 w-4"})}),(0,a.jsx)(yd,{label:"Open in Browser",onClick:f,children:(0,a.jsx)($1,{className:"h-4 w-4"})})]}):null}r(Dw,"StandaloneBrowserControls");function RU(e){return e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}r(RU,"formatTime");function MU(){const e=y0(),[t,s]=(0,x.useState)(null);return(0,x.useEffect)(()=>{if(!e){s(null);return}let l=!1;const c=new Date;return KE().then(u=>{l||s(u&&u<c?u:c)}),()=>{l=!0}},[e]),e?(0,a.jsxs)("div",{role:"status",className:"flex items-start gap-2 border-b border-line bg-warn-soft px-4 py-2 text-sm text-ink",children:[(0,a.jsx)($R,{className:"mt-0.5 size-4 shrink-0 text-warn","aria-hidden":"true"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("b",{className:"font-semibold",children:"You are offline."})," ",t?`Showing what was loaded at ${RU(t)}. `:"Showing what was already loaded. ","Approvals and replies wait until you are back."]})]}):null}r(MU,"OfflineBanner");function yA(){return typeof navigator>"u"?null:navigator.windowControlsOverlay??null}r(yA,"overlay");function DU(e){const t=yA();return t?.addEventListener("geometrychange",e),()=>t?.removeEventListener("geometrychange",e)}r(DU,"subscribe$2");function OU(){return(0,x.useSyncExternalStore)(DU,()=>yA()?.visible===!0,()=>!1)}r(OU,"useWindowControlsOverlayVisible");var LU={WebkitAppRegion:"drag",appRegion:"drag"},zU={WebkitAppRegion:"no-drag",appRegion:"no-drag"};function PU(){const{selectedCompanyId:e}=vt(),{inbox:t}=Q0(e);return(0,a.jsxs)("div",{"data-slot":"window-titlebar",className:"flex shrink-0 items-center gap-2 border-b border-line bg-bg px-3 text-xs text-ink-2",style:{...LU,marginLeft:"env(titlebar-area-x, 0px)",width:"env(titlebar-area-width, 100%)",height:"env(titlebar-area-height, 33px)"},children:[(0,a.jsx)(T0,{className:"size-4 shrink-0 text-ink","aria-hidden":"true"}),(0,a.jsx)("span",{className:"font-semibold text-ink",children:"Wardmote"}),(0,a.jsxs)(mn,{to:"/inbox",style:zU,className:"ml-1 inline-flex items-center gap-1 rounded-(--r-sm) px-1.5 py-0.5 hover:bg-bg-3 hover:text-ink","aria-label":t>0?`Inbox, ${t} waiting`:"Inbox",children:["Inbox",t>0?(0,a.jsx)("span",{className:"rounded-(--r-pill) bg-accent px-1.5 text-(length:--text-micro) font-semibold text-accent-ink tabular-nums",children:t}):null]})]})}r(PU,"TitleBarContent");function $U(){return OU()?(0,a.jsx)(PU,{}):null}r($U,"WindowTitleBar");var UU=16384,BU=40;function KU(e){if(!e)return;const t=[];for(const s of e.slice(0,UU).split(`
52
52
  `).slice(0,41)){const l=/^\s*(?:at|in) ([A-Za-z_$][\w$.-]{0,99})(?:\s|$)/.exec(s)?.[1]??/^([A-Za-z_$][\w$.-]{0,99})@/.exec(s)?.[1];if(l&&t.push(` at ${l}`),t.length===BU)break}return t.length?`
53
53
  ${t.join(`
54
- `)}`:void 0}r(KU,"sanitizeComponentStack");function jA(){const e={};if(typeof document<"u"){try{const t=document.readyState;(t==="loading"||t==="interactive"||t==="complete")&&(e.ready_state=t)}catch{}try{const t=document.visibilityState;(t==="visible"||t==="hidden")&&(e.visibility_state=t)}catch{}try{const t=document.documentElement.classList;e.translation_marker=t.contains("translated-ltr")||t.contains("translated-rtl")}catch{}}return e}r(jA,"readBrowserErrorState");function qU(e){const t=KU(e.componentStack);return{tags:{react_error_boundary:e.boundary},contexts:{react:t?{componentStack:t}:{},browser_state:jA()}}}r(qU,"buildBrowserErrorContext");var Ow=Promise.resolve();function hx(e){const t=Ow.then(e);return Ow=t.catch(()=>{}),t}r(hx,"enqueue");var po=null;function FU(e,t){return hx(async()=>{if(!po)try{const s=await ke(()=>import("./prod-COP_vZWu.js"),__vite__mapDeps([0,1]));s.init(VU(e,t)),po=s}catch{}})}r(FU,"initBrowserErrorMonitoring");function HU(){return hx(async()=>{const e=po;if(po=null,!e)return;const t=e.getClient();try{e.getCurrentScope().setClient(void 0)}catch{}try{await t?.close(2e3)}catch{}})}r(HU,"teardownBrowserErrorMonitoring");function wA(e,t){let s;try{t&&(s=qU(t))}catch{}hx(async()=>{try{s?po?.captureException(e,s):po?.captureException(e)}catch{}})}r(wA,"captureBrowserException");function VU(e,t){return{dsn:e,environment:t??void 0,release:"df4d06257c976e1d9d07ad949cf70dfac529c490",tracesSampleRate:0,sendDefaultPii:!1,beforeSend:r((s,l)=>{try{if(s.contexts={...s.contexts,browser_state:s.contexts?.browser_state??jA()},s.tags={...s.tags,browser_build_mode:"production"},s.exception?.values?.some(c=>c.mechanism?.type==="onunhandledrejection"||c.mechanism?.type==="auto.browser.global_handlers.onunhandledrejection")){const c=l.originalException;s.tags.browser_rejection_kind=c===null?"null":typeof c}}catch{}return s},"beforeSend"),integrations:r(s=>s.filter(l=>l.name!=="HttpContext"&&l.name!=="Breadcrumbs"),"integrations")}}r(VU,"buildBrowserSentryInitOptions");var WU=class extends x.Component{static{r(this,"RouteErrorBoundaryInner")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){wA(e,{boundary:"route",componentStack:t.componentStack})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){const{error:e}=this.state;return e?(0,a.jsxs)("div",{className:"mx-auto max-w-2xl space-y-4 px-4 py-10",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-semibold",children:"This page hit an error"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while rendering this page. You can go back and try again, or reload."})]}),(0,a.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:this.props.onReset,children:"Go back"}),(0,a.jsx)(oe,{size:"sm",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})]})]}):this.props.children}};function QU({children:e}){const t=hn(),s=ja(),l=`${t.pathname}${t.search}`;return(0,a.jsx)(WU,{resetKey:l,onReset:r(()=>s(-1),"onReset"),children:e})}r(QU,"RouteErrorBoundary");function GU({open:e,onOpenChange:t,...s}){return(0,a.jsx)(ws,{open:e,onOpenChange:t,children:(0,a.jsxs)(Ps,{"aria-describedby":void 0,className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[(0,a.jsxs)("div",{className:"px-4 pt-4 pb-3",children:[(0,a.jsx)(Ds,{children:"Chat with an agent"}),s.existingChatAgentIds&&(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"One conversation per agent. Pick up where you left off."})]}),(0,a.jsx)(YU,{...s,onComplete:r(()=>t(!1),"onComplete")},String(e))]})})}r(GU,"AgentChatPicker");function YU({agents:e,onSelect:t,onComplete:s,loading:l,error:c,onRetry:u,existingChatAgentIds:p,renderAgentIcon:f}){const h=(0,x.useRef)(!1),g=(0,x.useRef)(null);(0,x.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current?.abort()}),[]);const[v,y]=(0,x.useState)(""),[j,k]=(0,x.useState)(null),[S,N]=(0,x.useState)(null);async function I(C){if(j)return;k(C.id),N(null);const M=new AbortController;g.current=M;try{await t(C,M.signal),h.current&&s()}catch(R){N(R instanceof Error?R.message:"Couldn’t open chat. Try again.")}finally{k(null)}}return r(I,"selectAgent"),(0,a.jsxs)(J1,{children:[(0,a.jsx)(O0,{"aria-label":"Search agents by name or role",placeholder:"Search by name or role…",value:v,onValueChange:y}),S&&(0,a.jsx)("p",{role:"alert",className:"px-4 py-3 text-sm text-bad",children:S}),j&&(0,a.jsx)("p",{role:"status",className:"sr-only",children:"Opening conversation…"}),c?(0,a.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 p-4 text-sm",children:[(0,a.jsx)("p",{children:"Couldn’t load agents. Try again."}),u&&(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:u,children:"Retry"})]}):l?(0,a.jsx)("p",{role:"status",className:"p-4 text-sm text-ink-3",children:"Loading agents…"}):(0,a.jsxs)(z0,{children:[(0,a.jsx)(L0,{children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 px-4",children:[(0,a.jsx)("span",{children:e.length?`No agents match “${v}”`:"No agents yet."}),e.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Try another name or role."}),(0,a.jsx)(oe,{variant:"ghost",size:"sm",onClick:r(()=>y(""),"onClick"),children:"Clear search"})]}):(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Create an agent from the Agents page to start chatting."})]})}),(0,a.jsx)(Ys,{children:e.map(C=>(0,a.jsxs)(wn,{value:C.id,keywords:[C.name,C.title??"",C.role],onSelect:r(()=>{I(C)},"onSelect"),disabled:j!==null,className:"gap-3 px-3 py-3",children:[f?f(C):(0,a.jsx)(sg,{icon:C.icon,className:"size-4 shrink-0"}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"truncate font-medium",children:C.name}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:C.title??C.role})]}),p&&(0,a.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:p.includes(C.id)?"Open chat":"New chat"}),C.status==="paused"&&(0,a.jsx)("span",{className:"text-xs text-(--status-agent-paused)",children:"Paused"}),C.status==="terminated"&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Terminated"}),C.status==="pending_approval"&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Awaiting approval"})]},C.id))})]})]})}r(YU,"AgentChatPickerResults");function XU({agents:e,existingChatAgentIds:t,availableAgents:s=e,activeId:l,previews:c={},loading:u=!1,error:p,onRetry:f,initialSearch:h="",onSelect:g,onBrowse:v,onAddChat:y,historyLoading:j,historyError:k,onRetryHistory:S}){const N=ja(),[I,C]=(0,x.useState)(!1),[M,R]=(0,x.useState)(h),_=(0,x.useRef)(null),D=(0,x.useId)(),U=M.trim().toLocaleLowerCase(),K=e.filter(E=>`${E.name} ${E.title??""} ${E.role}`.toLocaleLowerCase().includes(U));function z(){R(""),_.current?.focus()}return r(z,"focusSearch"),(0,a.jsxs)("aside",{"aria-labelledby":D,className:"flex h-full min-h-0 flex-col border-r border-line bg-bg",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col gap-4 px-3 pb-4 pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("h2",{id:D,className:"text-sm font-semibold",children:"Chat"}),(0,a.jsx)(oe,{variant:"secondary",size:"icon-sm","aria-label":"Add chat",title:"Add chat",onClick:r(()=>C(!0),"onClick"),children:(0,a.jsx)(ns,{className:"size-4"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(fr,{"aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-ink-3"}),(0,a.jsx)(Wn,{ref:_,"aria-label":"Search agents",placeholder:"Find an agent",value:M,onChange:r(E=>R(E.target.value),"onChange"),onKeyDown:r(E=>{E.key==="Escape"&&(E.stopPropagation(),R(""))},"onKeyDown"),className:"h-8 pl-8 pr-8 text-xs md:text-xs"}),M&&(0,a.jsx)(oe,{variant:"ghost",size:"icon-xs","aria-label":"Clear search",className:"absolute right-1 top-1/2 -translate-y-1/2",onClick:z,children:(0,a.jsx)(ia,{className:"size-3"})})]})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pb-3 scrollbar-auto-hide",children:[(0,a.jsx)("p",{className:"px-2 text-(length:--text-micro) font-medium uppercase tracking-widest text-ink-3",children:U?"Search results":"Teammates"}),(0,a.jsx)("span",{role:"status",className:"sr-only",children:u?"Loading agents":`${K.length} ${K.length===1?"agent":"agents"}`}),j&&(0,a.jsx)("p",{role:"status",className:"px-2 text-xs text-ink-3",children:"Loading chat history…"}),k&&(0,a.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-3",children:[(0,a.jsx)("p",{className:"text-xs text-ink-3",children:"Some chat history couldn’t load."}),(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:S,children:"Retry chat history"})]}),p?(0,a.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,a.jsx)("p",{className:"text-sm",children:"Couldn’t load your chats."}),(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:f,children:"Try again"})]}):u?(0,a.jsx)("div",{"aria-hidden":"true",className:"flex flex-col gap-1",children:[0,1,2,3].map(E=>(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-md px-2 py-3 motion-safe:animate-pulse",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg bg-bg-3"}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,a.jsx)("div",{className:"h-3 w-2/3 rounded-sm bg-bg-3"}),(0,a.jsx)("div",{className:"h-2 w-full rounded-sm bg-bg-3"})]})]},E))}):K.length?(0,a.jsx)("nav",{"aria-label":"Agent conversations",className:"flex flex-col gap-1",children:K.map(E=>(0,a.jsxs)(mn,{to:`/chats/${encodeURIComponent(E.status==="terminated"?E.id:dr(E))}`,"aria-current":l===E.id?"page":void 0,title:`${E.name}${E.title?` · ${E.title}`:""}`,onClick:r(B=>{g&&(B.preventDefault(),g(E))},"onClick"),className:Y("flex min-w-0 items-center gap-3 rounded-md px-2 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus",l===E.id?oo.active:oo.rest),children:[(0,a.jsx)(pr,{agent:E,size:32}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:E.name}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:E.status==="terminated"?"Terminated":E.status==="paused"?"Paused":c[E.id]??E.title??"Start a conversation"})]})]},E.id))}):!e.length&&(j||k)?null:(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.length?"No agents found":"No chats yet"}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-ink-3",children:e.length?"Try another name or role.":"Choose an agent to start a conversation."}),!e.length&&(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:r(()=>C(!0),"onClick"),children:"Choose an agent"}),e.length>0&&(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:z,children:"Clear search"})]})]}),(0,a.jsx)("div",{className:"shrink-0 px-3 py-4",children:(0,a.jsx)(oe,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2 px-2",asChild:!v,onClick:v,children:v?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Gr,{className:"size-4"}),"Browse all agents"]}):(0,a.jsxs)(mn,{to:"/agents/all",children:[(0,a.jsx)(Gr,{className:"size-4"}),"Browse all agents"]})})}),(0,a.jsx)(GU,{agents:s,open:I,onOpenChange:C,existingChatAgentIds:t??e.map(E=>E.id),loading:u,error:p,onRetry:f,renderAgentIcon:r(E=>(0,a.jsx)(pr,{agent:E,size:32}),"renderAgentIcon"),onSelect:r(async(E,B)=>{y?await y(E,B):g?await g(E,B):N(`/chats/${encodeURIComponent(dr(E))}`),B?.aborted||R("")},"onSelect")})]})}r(XU,"AgentConversationSidebar");function ZU(){const{selectedCompanyId:e}=vt(),{enabled:t,loaded:s}=zf(),l=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),c=l.data?.user?.id??l.data?.session?.userId??null;return{companyId:e,userId:c,enabled:t,loaded:s,agents:me({queryKey:P.agents.list(e),queryFn:r(()=>Fa.list(e),"queryFn"),enabled:t&&!!e}),chats:me({queryKey:P.agentChats.list(e,c),queryFn:r(()=>sS.list(e),"queryFn"),enabled:t&&!!e&&l.isSuccess}),session:l}}r(ZU,"useAgentChatNavigation");function JU(e,t){const s=kn(),l=ja(),{isMobile:c,setSidebarOpen:u}=Jn(),p=(0,x.useRef)({companyId:e,userId:t,mounted:!0});return(0,x.useEffect)(()=>{const f={companyId:e,userId:t,mounted:!0};return p.current=f,()=>{f.mounted=!1}},[e,t]),(0,x.useCallback)(async(f,h)=>{if(!e||f.companyId!==e)throw new Error("Choose an agent from this company.");const g=p.current,v=await sS.ensure(e,f.id);s.setQueryData(P.agentChats.detail(e,t,f.id),v),s.setQueryData(P.issues.detail(v.id),v),s.setQueryData(P.agentChats.list(e,t),y=>[v,...(y??[]).filter(j=>j.id!==v.id)].sort((j,k)=>new Date(k.updatedAt).getTime()-new Date(j.updatedAt).getTime()||k.id.localeCompare(j.id))),!(!g.mounted||p.current!==g||h?.aborted)&&(l(`/chats/${encodeURIComponent(dr(f))}`),c&&u(!1))},[s,e,t,l,c,u])}r(JU,"useOpenAgentChat");function e8(){const{companyId:e,userId:t,agents:s,chats:l,session:c}=ZU(),u=JU(e,t),p=ja(),f=V0(e),{isMobile:h,setSidebarOpen:g}=Jn(),{pathname:v}=hn(),y=v.split("/chats/")[1]?.split("/")[0],j=s.data??[],k=s.isSuccess?[...new Set((l.data??[]).flatMap(D=>D.conversationAgentId&&!j.some(U=>U.id===D.conversationAgentId)?[D.conversationAgentId]:[]))]:[],S=_f({queries:k.map(D=>({queryKey:P.agents.detail(D),queryFn:r(()=>Fa.get(D,e),"queryFn")}))}),N=new Map(j.map(D=>[D.id,D]));for(const D of S)D.data&&N.set(D.data.id,D.data);const I=[...N.values()].find(D=>D.id===y||D.status!=="terminated"&&encodeURIComponent(dr(D))===y),C=(l.data??[]).flatMap(D=>{const U=D.conversationAgentId?N.get(D.conversationAgentId):void 0;return U?[U]:[]});I&&!C.some(D=>D.id===I.id)&&C.unshift(I);const M=new Set(C.map(D=>D.id)),R=j.filter(D=>!M.has(D.id)&&D.status!=="terminated"&&(!f.isSuccess||DN(f.data,"agent",D.id)!=="left")).sort((D,U)=>D.name.localeCompare(U.name,void 0,{sensitivity:"base"})),_=Object.fromEntries((l.data??[]).filter(D=>D.conversationState==="active").map(D=>[D.conversationAgentId,"Working…"]));return(0,a.jsx)(XU,{agents:[...C,...R],availableAgents:j,existingChatAgentIds:C.map(D=>D.id),activeId:I?.id,previews:_,loading:s.isPending||l.isPending||c.isPending,error:s.error??l.error??c.error,onRetry:r(()=>{s.refetch(),l.refetch(),c.refetch()},"onRetry"),historyLoading:S.some(D=>D.isPending),historyError:S.find(D=>D.error)?.error,onRetryHistory:r(()=>{S.filter(D=>D.isError).forEach(D=>{D.refetch()})},"onRetryHistory"),onAddChat:u,onSelect:r(D=>{p(`/chats/${encodeURIComponent(D.status==="terminated"?D.id:dr(D))}`),h&&g(!1)},"onSelect")},`${e}:${t}`)}r(e8,"AgentConversationsSidebar");var jd=232,zg=208,Pg=420,Lw=16;function hf(e){return Math.min(Pg,Math.max(zg,e))}r(hf,"clampSidebarWidth");function zw(e){if(typeof window>"u")return jd;try{const t=window.localStorage.getItem(e);if(!t)return jd;const s=Number.parseInt(t,10);return Number.isFinite(s)?hf(s):jd}catch{return jd}}r(zw,"readStoredSidebarWidth");function Pw(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(hf(t)))}catch{}}r(Pw,"writeStoredSidebarWidth");function t8({children:e,open:t,collapsed:s=!1,peeking:l=!1,resizable:c=!1,storageKey:u="wardmote.sidebar.width",className:p,onPanelMouseEnter:f,onPanelMouseLeave:h,onPanelFocusCapture:g,onPanelBlurCapture:v}){const[y,j]=(0,x.useState)(()=>zw(u)),[k,S]=(0,x.useState)(!1),N=(0,x.useRef)(y),I=(0,x.useRef)(null);(0,x.useEffect)(()=>{const V=zw(u);N.current=V,j(V)},[u]);const C=t?y:0,M=t?s?72:C:0,R=t?s&&!l?72:C:0,_=R>M,D=c&&t&&!s,U=(0,x.useMemo)(()=>({width:`${M}px`}),[M]),K=(0,x.useMemo)(()=>({width:`${R}px`}),[R]),z=(0,x.useCallback)(V=>{const ue=hf(V);N.current=ue,j(ue),Pw(u,ue)},[u]),E=(0,x.useCallback)(V=>{D&&(V.preventDefault(),V.currentTarget.setPointerCapture(V.pointerId),I.current={startX:V.clientX,startWidth:N.current},S(!0))},[D]),B=(0,x.useCallback)(V=>{if(!I.current)return;const ue=hf(I.current.startWidth+V.clientX-I.current.startX);N.current=ue,j(ue)},[]),O=(0,x.useCallback)(()=>{I.current&&(I.current=null,S(!1),Pw(u,N.current))},[u]),Q=(0,x.useCallback)(V=>{D&&(V.key==="ArrowLeft"?(V.preventDefault(),z(y-Lw)):V.key==="ArrowRight"?(V.preventDefault(),z(y+Lw)):V.key==="Home"?(V.preventDefault(),z(zg)):V.key==="End"&&(V.preventDefault(),z(Pg)))},[D,z,y]);return(0,a.jsxs)("div",{className:Y("relative h-full shrink-0",p),style:U,children:[(0,a.jsx)("div",{className:Y("absolute inset-y-0 left-0 flex flex-col overflow-hidden",_?"z-30 border-r border-line bg-bg shadow-lg":"z-0"),style:K,"data-sidebar-overlay":_?"":void 0,onMouseEnter:f,onMouseLeave:h,onFocusCapture:g,onBlurCapture:v,children:e}),D?(0,a.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":zg,"aria-valuemax":Pg,"aria-valuenow":y,tabIndex:0,"data-dragging":k?"":void 0,className:"group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none",style:{right:-4,width:8},onPointerDown:E,onPointerMove:B,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,onKeyDown:Q,children:(0,a.jsx)("div",{className:Y("mx-auto h-full w-0.5 transition-colors",k?"bg-focus":"bg-transparent group-hover:bg-focus group-focus-visible:bg-focus")})}):null]})}r(t8,"SidebarShell");function wd({children:e,className:t}){return(0,a.jsx)("div",{"data-secondary-sidebar":"",className:Y("h-full w-full min-w-0 overflow-hidden",t),children:(0,a.jsx)(Q1,{children:e})})}r(wd,"SecondarySidebar");function n8(e,t){if(!t)return!1;if(t.source==="local_implicit"||t.isInstanceAdmin)return!0;if(!e)return!1;const s=t.memberships?.find(l=>l.companyId===e&&l.status==="active");return s?.membershipRole==="owner"||s?.membershipRole==="admin"||s?.membershipRole==="operator"||s?.membershipRole==="member"}r(n8,"canInviteCompanyMembers");function a8(){const e=eI(),t=me({queryKey:P.access.currentBoardAccess,queryFn:r(()=>ei.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4});return n8(e?.selectedCompanyId,t.data)}r(a8,"useCanInviteCompanyMembers");function s8(e){return e?.trim().toLowerCase().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||null}r(s8,"slugifyUserPart");function i8(e){const t=[e?.id,e?.name,e?.email?.split("@")[0],e?.email];for(const s of t){const l=s8(s);if(l)return`/u/${l}`}return"/u/me"}r(i8,"userProfilePath");var zc=null,kA=!1,$g=!1,Ug=new Set;function Pc(){for(const e of Ug)e()}r(Pc,"emit");function r8(e=typeof navigator>"u"?"":navigator.userAgent,t=typeof navigator>"u"?0:navigator.maxTouchPoints){return/iPhone|iPad|iPod/i.test(e)?!0:/Macintosh/i.test(e)&&t>1}r(r8,"isIosSafariLike");function l8(e=window){const t=r(l=>{l.preventDefault(),zc=l,Pc()},"onPrompt"),s=r(()=>{zc=null,kA=!0,Pc()},"onInstalled");return e.addEventListener("beforeinstallprompt",t),e.addEventListener("appinstalled",s),()=>{e.removeEventListener("beforeinstallprompt",t),e.removeEventListener("appinstalled",s)}}r(l8,"captureInstallPrompt");function o8(){return kA||Lg()?"installed":zc?"prompt":r8()?"ios-manual":"unavailable"}r(o8,"installAvailability");async function c8(){const e=zc;if(!e)return"unavailable";zc=null,Pc(),await e.prompt();const{outcome:t}=await e.userChoice;return t}r(c8,"promptInstall");function Bg(e){$g!==e&&($g=e,Pc())}r(Bg,"setIosInstallHelpOpen");function u8(){return $g}r(u8,"iosInstallHelpOpen");function d8(){return(0,x.useSyncExternalStore)(gx,u8,()=>!1)}r(d8,"useIosInstallHelpOpen");function gx(e){return Ug.add(e),()=>{Ug.delete(e)}}r(gx,"subscribe$1");function SA(){return(0,x.useSyncExternalStore)(gx,o8,()=>"unavailable")}r(SA,"useInstallAvailability");function jY(e){const t=SA();return(0,x.useSyncExternalStore)(gx,()=>m8(t,e),()=>!1)}r(jY,"useInstallNudgeVisible");var f8=2592e6,Kg="wardmote.install.visits",$w="wardmote.install.visit-counted",NA="wardmote.install.snoozed-until";function qg(e,t){const s=Number(e.getItem(t));return Number.isFinite(s)?s:0}r(qg,"readNumber");function p8(e=window.localStorage,t=window.sessionStorage){try{if(t.getItem($w))return;t.setItem($w,"1"),e.setItem(Kg,String(qg(e,Kg)+1))}catch{return}}r(p8,"recordAppVisit");function m8(e,t,s=Date.now(),l=window.localStorage){if(e!=="prompt"&&e!=="ios-manual"||/^\/(?:[^/]+\/)?onboarding(?:\/|$)/.test(t))return!1;try{return qg(l,Kg)>=3&&qg(l,NA)<=s}catch{return!1}}r(m8,"installNudgeVisible");function wY(e=Date.now(),t=window.localStorage){try{t.setItem(NA,String(e+f8))}catch{return}finally{Pc()}}r(wY,"snoozeInstallNudge");var Uw="Install app",h8="Add Wardmote to your home screen or dock.";function g8({variant:e,onAfterAction:t}){const s=SA();if(s==="installed"||s==="unavailable")return null;const l=r(()=>{s==="ios-manual"?Bg(!0):c8(),t?.()},"handleClick");return e==="compact-menu-action"?(0,a.jsxs)("button",{type:"button",className:"flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",onClick:l,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(xg,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Uw})]}):(0,a.jsxs)("button",{type:"button",className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-bg-3/60",onClick:l,children:[(0,a.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,a.jsx)(xg,{className:"size-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-ink",children:Uw}),(0,a.jsx)("span",{className:"block text-xs text-ink-3",children:h8})]})]})}r(g8,"InstallAppMenuAction");function x8(){const e=d8();return(0,a.jsx)(ws,{open:e,onOpenChange:Bg,children:(0,a.jsxs)(Ps,{children:[(0,a.jsxs)(bo,{children:[(0,a.jsx)(Ds,{children:"Install Wardmote"}),(0,a.jsx)(vo,{children:"Add Wardmote to your Home Screen from Safari."})]}),(0,a.jsxs)("ol",{className:"space-y-3 text-sm text-ink",children:[(0,a.jsxs)(Ah,{index:1,icon:(0,a.jsx)(TR,{className:"size-4"}),children:["Tap ",(0,a.jsx)("strong",{children:"Share"})," in the Safari toolbar."]}),(0,a.jsxs)(Ah,{index:2,icon:(0,a.jsx)(MR,{className:"size-4"}),children:["Choose ",(0,a.jsx)("strong",{children:"Add to Home Screen"}),"."]}),(0,a.jsxs)(Ah,{index:3,children:["Keep ",(0,a.jsx)("strong",{children:"Open as Web App"})," on, then tap ",(0,a.jsx)("strong",{children:"Add"}),"."]})]}),(0,a.jsx)(Pf,{children:(0,a.jsx)(oe,{type:"button",onClick:r(()=>Bg(!1),"onClick"),children:"Done"})})]})})}r(x8,"IosInstallHelpDialog");function Ah({index:e,icon:t,children:s}){return(0,a.jsxs)("li",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-line text-xs font-semibold text-ink-3",children:e}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t?(0,a.jsx)("span",{className:"text-ink-3",children:t}):null,(0,a.jsx)("span",{children:s})]})]})}r(Ah,"InstallStep");function b8(e){if(!e)return"Unavailable";const t=new Date(e);return Number.isNaN(t.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(t)}r(b8,"formatTimestamp");function v8(e){return!!e&&!Number.isNaN(new Date(e).getTime())}r(v8,"isValidTimestamp");function y8(e){return e?.devServer?.lastRestartAt??e?.serverInfo?.processStartedAt??null}r(y8,"restartTimestamp");function j8(e){const t=e?.serverInfo?.git;return t?.available?`${t.shortSha} · ${t.subject}`:"Commit unavailable"}r(j8,"commitLabel");function w8(e){const t=e?.serverInfo?.git;if(!t?.available)return"Unavailable";const s=t.localChanges;if(!s||!s.available)return"Change status unavailable";if(!s.hasLocalChanges)return"Clean checkout";const l=[[s.stagedFileCount,"staged"],[s.unstagedFileCount,"unstaged"],[s.untrackedFileCount,"untracked"]].filter(([c])=>Number(c)>0).map(([c,u])=>`${c} ${u}`);return l.length>0?`Local changes present (${l.join(", ")})`:"Local changes present"}r(w8,"localChangesLabel");function _h({icon:e,label:t,value:s,dateTime:l}){return(0,a.jsxs)("div",{className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left",children:[(0,a.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,a.jsx)(e,{className:"size-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-ink",children:t}),l?(0,a.jsx)("time",{dateTime:l,className:"block break-words text-xs text-ink-3",children:s}):(0,a.jsx)("span",{className:"block break-words text-xs text-ink-3",children:s})]})]})}r(_h,"ServerInfoRow");function k8(){const e=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")}).data?.enableServerInfoDebugView===!0,t=me({queryKey:P.health,queryFn:r(()=>Fc.get(),"queryFn"),enabled:e,refetchOnMount:"always",refetchInterval:r(v=>v.state.data?.devServer?.enabled?2e3:!1,"refetchInterval")});if(!e)return null;const s=t.data,l=t.isLoading&&!s,c=t.isError,u=y8(s),p=v8(u),f=c?"Health unavailable":l?"Loading...":b8(u),h=c?"Health unavailable":l?"Loading...":j8(s),g=c?"Health unavailable":l?"Loading...":w8(s);return(0,a.jsxs)("div",{className:"mt-2 border-t border-line pt-2",children:[(0,a.jsx)("p",{className:"px-3 pb-1 pt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"Server"}),(0,a.jsx)(_h,{icon:xS,label:"Last restarted",value:f,dateTime:!c&&!l&&p?u:null}),(0,a.jsx)(_h,{icon:hR,label:"Running commit",value:h}),(0,a.jsx)(_h,{icon:uR,label:"Checkout state",value:g})]})}r(k8,"SidebarServerInfo");var S8="/company/settings/members?tab=invites",N8="https://github.com/tickernelz/wardmote/tree/main/docs",C8="https://github.com/tickernelz/wardmote/issues";function A8(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length>=2?`${t[0]?.[0]??""}${t[t.length-1]?.[0]??""}`.toUpperCase():e.slice(0,2).toUpperCase()}r(A8,"deriveInitials");function Eh({label:e,icon:t,onClick:s,href:l,external:c=!1}){const u="flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",p=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(t,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})]});return l?c?(0,a.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",className:u,onClick:s,children:p}):(0,a.jsx)(mn,{to:l,className:u,onClick:s,children:p}):(0,a.jsx)("button",{type:"button",className:u,onClick:s,children:p})}r(Eh,"MenuAction");function Bw({deploymentMode:e,open:t,onOpenChange:s,forceExpanded:l=!1}){const{hidden:c,loaded:u}=hr(),p=a8()?S8:null,f=u&&p!==null&&!qd(c,"company.members")&&!qd(c,"company.invites"),[h,g]=(0,x.useState)(!1),{isMobile:v,setSidebarOpen:y,collapsed:j,peeking:k}=Jn(),S=j&&!k&&!l,N=t??h,I=s??g,{data:C}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),M=rx({onSignedOut:K}),R=C?.user.name?.trim()||"Board",_=C?.user.email?.trim()||(e==="authenticated"?"Signed in":"Local workspace board"),D=A8(R),U=i8(C?.user);function K(){I(!1),v&&y(!1)}r(K,"closeNavigationChrome");function z(){M.mutate()}return r(z,"handleSignOut"),(0,a.jsx)("div",{className:"bg-line/50 px-3 py-2 dark:bg-bg-3",children:(0,a.jsxs)("div",{className:Y("flex items-center gap-0.5",!S&&"px-2"),children:[(0,a.jsxs)(js,{open:N,onOpenChange:I,children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:Y("flex min-w-0 items-center gap-2.5 rounded-lg text-left text-(length:--text-compact) font-medium text-ink/80 transition-colors hover:bg-bg-3 hover:text-ink",S?"w-full px-3 py-2":"flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,a.jsxs)(Gd,{size:"sm",children:[C?.user.image?(0,a.jsx)(Wd,{src:C.user.image,alt:R}):null,(0,a.jsx)(Qd,{children:D})]}),(0,a.jsx)("span",{className:Y("min-w-0 flex-1 truncate",S&&"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none"),children:R})]})}),(0,a.jsxs)(ys,{side:"top",align:"start",sideOffset:10,className:"min-h-(--profile-popover-min-height) w-(--profile-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-line bg-bg-2 p-0 shadow-(--shadow-profile-popover)",children:[(0,a.jsxs)("div",{className:"relative flex h-(--profile-popover-header-height) shrink-0 items-center gap-2.5 px-3.5",children:[(0,a.jsx)(mn,{to:U,"aria-label":"View profile",onClick:K,className:"absolute inset-0 transition-colors hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus"}),(0,a.jsxs)(Gd,{className:"pointer-events-none relative size-9",children:[C?.user.image?(0,a.jsx)(Wd,{src:C.user.image,alt:R}):null,(0,a.jsx)(Qd,{className:"text-xs text-ink",children:D})]}),(0,a.jsxs)("div",{className:"pointer-events-none relative min-w-0 flex-1",children:[(0,a.jsx)("h2",{className:"truncate text-sm font-semibold leading-(--profile-popover-label-line-height) text-ink",children:R}),(0,a.jsx)("p",{className:"truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-ink-3",children:_})]})]}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-0.5 border-t border-line px-2.5 pb-2.5 pt-2",children:[(0,a.jsx)(Eh,{label:"Settings",icon:V1,href:"/company/settings",onClick:K}),f&&p?(0,a.jsx)(Eh,{label:"Invite",icon:vN,href:p,onClick:K}):null,(0,a.jsx)(Eh,{label:"Documentation",icon:R1,href:N8,external:!0,onClick:r(()=>I(!1),"onClick")}),(0,a.jsx)(w3,{variant:"compact-menu-action",onAfterToggle:r(()=>I(!1),"onAfterToggle")}),(0,a.jsx)(g8,{variant:"compact-menu-action",onAfterAction:r(()=>I(!1),"onAfterAction")}),e==="authenticated"?(0,a.jsxs)("button",{type:"button",className:Y("flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bad/10",M.isPending&&"cursor-not-allowed opacity-60"),onClick:z,disabled:M.isPending,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)($f,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:M.isPending?"Signing out...":"Sign out"})]}):null,(0,a.jsx)(k8,{})]})]})]}),S?null:(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("a",{href:C8,target:"_blank",rel:"noreferrer","aria-label":"Share feedback",className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-ink-3/50 transition-colors hover:bg-bg-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,a.jsx)(C0,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,a.jsx)(Is,{side:"top",children:"Share feedback"})]})]})})}r(Bw,"SidebarAccountMenu");var _8=["input","textarea","select","[contenteditable='true']","[contenteditable='plaintext-only']","[role='textbox']","[role='combobox']"].join(", "),E8="[data-page-search-target='true']",I8=new Set(["Shift","Meta","Control","Alt"]);function ko(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(_8):!1}r(ko,"isKeyboardShortcutTextInputTarget");function Fg(e=document){return!!e.querySelector("[role='dialog'][aria-modal='true']")}r(Fg,"hasBlockingShortcutDialog");function T8(e){if(!e.isConnected||"disabled"in e&&typeof e.disabled=="boolean"&&e.disabled||e.closest("[hidden], [aria-hidden='true'], [inert]")||e.closest("[role='dialog'][aria-modal='true']"))return!1;const t=window.getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"?!1:e.getClientRects().length>0||e===document.activeElement}r(T8,"isVisibleShortcutTarget");function R8(e=document){return Array.from(e.querySelectorAll(E8)).find(t=>T8(t))??null}r(R8,"findPageSearchShortcutTarget");function M8(e=document){const t=R8(e);return t?(t.focus(),(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select(),!0):!1}r(M8,"focusPageSearchShortcutTarget");function D8({key:e,isComposing:t}){return e==="Enter"&&!t}r(D8,"shouldBlurPageSearchOnEnter");function O8({key:e,isComposing:t,currentValue:s}){return e==="Escape"&&!t&&s.length===0}r(O8,"shouldBlurPageSearchOnEscape");function tp(e){return I8.has(e)}r(tp,"isModifierOnlyKey");function kY({defaultPrevented:e,key:t,metaKey:s,ctrlKey:l,altKey:c,target:u,hasOpenDialog:p,hasSelection:f}){if(e||s||l||c||tp(t)||p||ko(u))return"ignore";switch(t){case"j":case"ArrowDown":return"next";case"k":case"ArrowUp":return"previous";case"Enter":return f?"toggle":"ignore";case"x":return f?"dismiss":"ignore";default:return"ignore"}}r(kY,"resolveAttentionQueueKeyAction");function SY({armed:e,defaultPrevented:t,key:s,metaKey:l,ctrlKey:c,altKey:u,target:p,hasOpenDialog:f}){return!e||t||l||c||u||tp(s)||f||ko(p)?"ignore":s.toLowerCase()==="y"?"archive":"ignore"}r(SY,"resolveInboxQuickArchiveKeyAction");function NY({hasUndoableArchive:e,defaultPrevented:t,key:s,metaKey:l,ctrlKey:c,altKey:u,target:p,hasOpenDialog:f}){return!e||t||l||c||u||tp(s)||f||ko(p)?"ignore":s==="u"?"undo_archive":"ignore"}r(NY,"resolveInboxUndoArchiveKeyAction");function L8({armed:e,defaultPrevented:t,key:s,metaKey:l,ctrlKey:c,altKey:u,target:p,hasOpenDialog:f}){if(t)return e?"disarm":"ignore";if(l||c||u||tp(s))return"ignore";if(f||ko(p))return e?"disarm":"ignore";const h=s.toLowerCase();return e?h==="i"?"navigate_inbox":h==="c"?"focus_comment":h==="f"?"open_file_viewer":h==="g"?"arm":"disarm":h==="g"?"arm":"ignore"}r(L8,"resolveIssueDetailGoKeyAction");function z8({onNewIssue:e,onSearch:t,onToggleSidebar:s,onTogglePanel:l,onShowShortcuts:c,onGoToInbox:u}){(0,x.useEffect)(()=>{let p=!1,f=null;const h=r(()=>{f!==null&&(window.clearTimeout(f),f=null)},"clearGoChordTimeout"),g=r(()=>{p=!1,h()},"disarmGoChord"),v=r(()=>{p=!0,h(),f=window.setTimeout(()=>{p=!1,f=null},1200)},"armGoChord");function y(S){if(S.defaultPrevented){g();return}if(u){const N=L8({armed:p,defaultPrevented:S.defaultPrevented,key:S.key,metaKey:S.metaKey,ctrlKey:S.ctrlKey,altKey:S.altKey,target:S.target,hasOpenDialog:Fg()});if(N==="arm"){v();return}if(N==="navigate_inbox"){g(),S.preventDefault(),u();return}if(N==="focus_comment"||N==="open_file_viewer"){g(),S.preventDefault();return}N==="disarm"&&g()}if(!ko(S.target)&&!Fg()){if(S.key==="/"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),M8()||t?.();return}if(S.key==="?"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),c?.();return}S.key==="c"&&!S.metaKey&&!S.ctrlKey&&!S.altKey&&(S.preventDefault(),e?.()),S.key==="["&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),s?.()),S.key==="]"&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),l?.())}}r(y,"handleKeyDown");const j=r(()=>g(),"handlePointerDown"),k=r(S=>{S.target instanceof HTMLElement&&S.target!==document.body&&g()},"handleFocusIn");return document.addEventListener("pointerdown",j,!0),document.addEventListener("focusin",k,!0),document.addEventListener("keydown",y),()=>{g(),document.removeEventListener("pointerdown",j,!0),document.removeEventListener("focusin",k,!0),document.removeEventListener("keydown",y)}},[e,t,s,l,c,u])}r(z8,"useKeyboardShortcuts");var P8=new Set(["auth","invite","board-claim","cli-auth","docs","s"]);function CA(e){const t=(e.split("?")[0]??"").split("/").filter(Boolean);if(t.length===0)return!0;const[s]=t;return!P8.has(s)}r(CA,"isRememberableCompanyPath");function $8(e){const t=Vd(e.companyPrefix);return e.companies.find(s=>Vd(s.issuePrefix)===t)??null}r($8,"findCompanyByPrefix");function U8(e){const t=h1(e.pathname);return t?$8({companies:e.companies,companyPrefix:t})?.id??null:e.fallbackCompanyId}r(U8,"getRememberedPathOwnerCompanyId");function B8(e){const t=e.path?If(e.path):"/dashboard";if(!CA(t))return"/dashboard";const[s,l]=(t.split("?")[0]??"").split("/").filter(Boolean);if(s==="issues"&&l){const c=/^([A-Za-z]+)-\d+$/.exec(l);if(c&&Vd(c[1]??"")!==Vd(e.companyPrefix))return"/dashboard"}return t}r(B8,"sanitizeRememberedPathForCompany");var AA="wardmote.companyPaths";function _A(){try{const e=localStorage.getItem(AA);if(e)return JSON.parse(e)}catch{}return{}}r(_A,"getCompanyPaths");function K8(e,t){const s=_A();s[e]=t,localStorage.setItem(AA,JSON.stringify(s))}r(K8,"saveCompanyPath");function q8(){const{companies:e,selectedCompanyId:t,selectedCompany:s,selectionSource:l}=vt(),c=hn(),u=ja(),p=(0,x.useRef)(t),f=(0,x.useMemo)(()=>U8({companies:e,pathname:c.pathname,fallbackCompanyId:p.current}),[e,c.pathname]),h=c.pathname+c.search;(0,x.useEffect)(()=>{const g=f,v=If(h);g&&CA(v)&&K8(g,v)},[h,f]),(0,x.useEffect)(()=>{if(t){if(p.current!==null&&t!==p.current&&l!=="route_sync"&&s){const g=_A(),v=B8({path:g[t],companyPrefix:s.issuePrefix});u(`/${s.issuePrefix}${v}`,{replace:!0})}p.current=t}},[s,t,l,u])}r(q8,"useCompanyPageMemory");var F8=class{static{r(this,"MobileNavScrollTracker")}options;lastTop;lastMaxTop;visible=!0;direction=0;distance=0;constructor(e,t,s){this.options=e,this.lastTop=t,this.lastMaxTop=s}update(e,t){const s=Math.max(0,Math.min(e,t)),l=s-Math.max(this.lastTop,this.options.topZone),c=t!==this.lastMaxTop;if(this.lastTop=s,this.lastMaxTop=t,s<=this.options.topZone)this.visible=!0,this.direction=0,this.distance=0;else if(c)this.direction=0,this.distance=0;else if(l!==0){const u=Math.sign(l);u!==this.direction&&(this.distance=0),this.direction=u,this.distance+=Math.abs(l);const p=u>0?this.options.hideDistance:this.options.showDistance;this.distance>=p&&(this.visible=u<0,this.distance=0)}return this.visible}};function H8(e,t){const[s,l]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{if(l(!0),!e)return;const c=getComputedStyle(document.documentElement),u=r(y=>Number.parseFloat(c.getPropertyValue(y))||0,"distance"),p=r(()=>{const y=document.scrollingElement??document.documentElement;return{top:window.scrollY||y.scrollTop||0,max:Math.max(0,y.scrollHeight-y.clientHeight)}},"scrollBounds"),f=p(),h=new F8({topZone:u("--mobile-nav-scroll-top-zone"),hideDistance:u("--mobile-nav-scroll-hide-distance"),showDistance:u("--mobile-nav-scroll-show-distance")},f.top,f.max);let g=null;const v=r(()=>{g===null&&(g=requestAnimationFrame(()=>{g=null;const{top:y,max:j}=p(),k=h.visible,S=h.update(y,j);S!==k&&l(S)}))},"onScroll");return window.addEventListener("scroll",v,{passive:!0}),()=>{window.removeEventListener("scroll",v),g!==null&&cancelAnimationFrame(g)}},[e,t]),s}r(H8,"useMobileNavVisibility");function V8(e){const{matchedCompany:t,selectedCompanyId:s,companies:l}=e;return!t||t.status!=="archived"||s===t.id?null:l.find(c=>c.id===s&&c.status!=="archived")??l.find(c=>c.status!=="archived")??null}r(V8,"resolveArchivedCompanyBounce");function CY(e){const{archivedCompanyId:t,companies:s}=e,l=s.find(c=>c.id!==t&&c.status!=="archived");return l?{kind:"company",company:l}:{kind:"companies_list"}}r(CY,"resolveCompanyArchiveDeparture");function W8(e){const{selectionSource:t,selectedCompanyId:s,routeCompanyId:l}=e;return!(s===l||t==="manual"&&s)}r(W8,"shouldSyncCompanySelectionFromRoute");function Q8(e,t){return e instanceof HTMLElement?!(t instanceof HTMLElement)||!document.contains(t)||t===document.body||t===document.documentElement?!0:!e.contains(t):!1}r(Q8,"shouldFocusMainContentAfterNavigation");function G8(e){if(!(e instanceof HTMLElement))return()=>{};const t=window.requestAnimationFrame(()=>{Q8(e,document.activeElement)&&e.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(t)}r(G8,"scheduleMainContentFocus");function Y8(e=document,t=window){const s=r(()=>{e.documentElement.scrollTop!==0&&(e.documentElement.scrollTop=0),e.body.scrollTop!==0&&(e.body.scrollTop=0)},"onScroll");return t.addEventListener("scroll",s,{capture:!0}),()=>t.removeEventListener("scroll",s,{capture:!0})}r(Y8,"pinDocumentScrollToZero");var X8=mE({NotFoundPage:r(()=>ur,"NotFoundPage")});function ur({scope:e="global",requestedPrefix:t}){const s=hn(),{setBreadcrumbs:l}=Z1(),{companies:c,selectedCompany:u}=vt();(0,x.useEffect)(()=>{l([{label:"Not Found"}])},[l]);const p=u??c[0]??null,f=p?`/${p.issuePrefix}/dashboard`:"/",h=`${s.pathname}${s.search}${s.hash}`,g=t?.toUpperCase(),v=e==="invalid_company_prefix"?"Organization not found":"Page not found",y=e==="invalid_company_prefix"?`No organization matches prefix "${g??"unknown"}".`:"This route does not exist.";return(0,a.jsx)("div",{className:"mx-auto max-w-2xl py-10",children:(0,a.jsxs)(Hc,{className:"block p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"rounded-md border border-bad/20 bg-bad/10 p-2",children:(0,a.jsx)(ni,{className:"h-5 w-5 text-bad"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:v}),(0,a.jsx)("p",{className:"text-sm text-ink-3",children:y})]})]}),(0,a.jsxs)("div",{className:"mt-4 rounded-md border border-line bg-bg-3/20 px-3 py-2 text-xs text-ink-3",children:["Requested path: ",(0,a.jsx)("code",{className:"font-mono",children:h})]}),(0,a.jsxs)("div",{className:"mt-5 flex flex-wrap gap-2",children:[(0,a.jsx)(oe,{asChild:!0,children:(0,a.jsxs)(mn,{to:f,children:[(0,a.jsx)(p1,{className:"mr-1.5 h-4 w-4"}),"Open dashboard"]})}),(0,a.jsx)(oe,{variant:"secondary",asChild:!0,children:(0,a.jsx)(mn,{to:"/",children:"Go home"})})]})]})})}r(ur,"NotFoundPage$1");function Z8(e,t){return VC(e,t)[0]?.toLowerCase()??null}r(Z8,"getCompanyRouteSegment");var J8=new Set(["browse","connections","assistant-connection","connect","chat","vercel-connect","review","attention","gateways","advanced","app"]);function e6(e){const t=(0,x.useRef)(null);return(0,x.useLayoutEffect)(()=>{const s=t.current,l=s?.parentElement;if(!e||!s||!l)return;const c=r(()=>l.style.setProperty("--mobile-topbar-h",`${s.offsetHeight}px`),"apply");if(c(),typeof ResizeObserver>"u")return()=>l.style.removeProperty("--mobile-topbar-h");const u=new ResizeObserver(c);return u.observe(s),()=>{u.disconnect(),l.style.removeProperty("--mobile-topbar-h")}},[e]),t}r(e6,"useMobileTopbarHeightVar");function t6({sidebarSections:e}){const{sidebarOpen:t,setSidebarOpen:s,toggleSidebar:l,collapsed:c,peeking:u,setPeeking:p,isMobile:f,isTablet:h}=Jn(),g=e6(f),{openNewIssue:v,openOnboarding:y}=$s(),{togglePanelVisible:j}=lx(),k=Of()?.pushToast??null,{companies:S,loading:N,selectedCompany:I,selectedCompanyId:C,selectionSource:M,setSelectedCompanyId:R}=vt(),{companyPrefix:_,pluginRoutePath:D,agentId:U,routineId:K}=zs(),z=ja(),E=hn(),B=ME(),O=U4(E.pathname,_),Q=O.builtInContextualSurface==="settings",V=O.companySegments,ue=O.isTaskDetail,{enabled:ce}=zf(),X=ce&&V[0]?.toLowerCase()==="chats",A=ue||X,ee=V[0]?.toLowerCase()==="tools",ie=V[0]?.toLowerCase()==="apps",le=ie&&V[1]&&!J8.has(V[1].toLowerCase())?V[1]:null,Ae=ie&&V[1]?.toLowerCase()==="app"&&V[2]?V[2]:null,de=(0,x.useRef)(!1),we=(0,x.useRef)(null),ye=(0,x.useRef)(null),Me=(0,x.useRef)(new $3),he=(0,x.useRef)(E.key),ve=H8(f&&!ue,E.pathname),[et,Pe]=(0,x.useState)(!1),Ee=(0,x.useMemo)(()=>{if(!_)return null;const _e=_.toUpperCase();return S.find(Re=>Re.issuePrefix.toUpperCase()===_e)??null},[S,_]),ct=!!_&&!N&&S.length>0&&!Ee,Ve=(0,x.useMemo)(()=>D?.toLowerCase()??Z8(E.pathname,_),[_,E.pathname,D]),yt=Ee?.id??null,Zt=Ee?.issuePrefix??null,{slots:ge}=qc({slotTypes:["page","routeSidebar"],companyId:yt,enabled:!!(yt&&Ve)}),Oe=(0,x.useMemo)(()=>oT(ge,Ve),[Ve,ge]),De=(0,x.useMemo)(()=>({companyId:yt,companyPrefix:Zt}),[yt,Zt]),ut=Q?(0,a.jsx)(F4,{}):le?(0,a.jsx)(ew,{kind:"connection",connectionId:le}):Ae?(0,a.jsx)(ew,{kind:"application",applicationId:Ae}):ie||ee?(0,a.jsx)(sz,{}):Oe?(0,a.jsx)(Xc,{surface:`plugin:${Oe.id}`,title:Oe.displayName,children:(0,a.jsx)(D0,{slot:Oe,context:De,className:"min-h-0 flex-1",missingBehavior:"placeholder"})}):null,Ht=X?(0,a.jsx)(e8,{}):O.builtInContextualSurface==="agent"&&U?(0,a.jsx)(pz,{agentRef:U}):O.builtInContextualSurface==="routine"&&K?(0,a.jsx)(R3,{children:(0,a.jsx)(xz,{routineId:K})}):O.builtInContextualSurface==="skills"?(0,a.jsx)(yz,{}):ut,Vt=Ht!=null,gt=Vt&&(X||O.builtInContextualSurface==="skills"||O.builtInContextualSurface==="agent"||O.builtInContextualSurface==="routine"||ie||ee),cn=Q&&(f||h),$=Vt&&!gt&&!(h&&Q),qe=gt,Xe=Vt?Oe&&!O.builtInContextualSurface?`plugin:${Oe.id}`:O.builtInContextualSurface:null,xt=(0,x.useRef)(null),{data:at}=me({queryKey:P.health,queryFn:r(()=>Fc.get(),"queryFn"),retry:!1,refetchInterval:r(_e=>_e.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,x.useEffect)(()=>{const _e=xt.current;Xe&&_&&_e&&_e.surface!==Xe&&_e.pathname!==E.pathname&&B4({surface:Xe,companyPrefix:_,previousPathname:_e.pathname}),xt.current={pathname:E.pathname,surface:Xe}},[_,Xe,E.pathname]),(0,x.useEffect)(()=>{N||de.current||at?.deploymentMode!=="authenticated"&&S.length===0&&(de.current=!0,y())},[S,N,y,at?.deploymentMode]),(0,x.useEffect)(()=>{if(!_||N||S.length===0)return;if(!Ee){const Re=(C?S.find(lt=>lt.id===C):null)??S[0]??null;Re&&C!==Re.id&&R(Re.id,{source:"route_sync"});return}if(_!==Ee.issuePrefix){const Re=E.pathname.replace(/^\/[^/]+/,"");z(`/${Ee.issuePrefix}${Re}${E.search}`,{replace:!0});return}const _e=V8({matchedCompany:Ee,selectedCompanyId:C,companies:S});if(_e){k?.({title:`${Ee.name} is archived`,body:`Switched to ${_e.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${Ee.id}`}),R(_e.id,{source:"route_sync"}),z(`/${_e.issuePrefix}/dashboard`,{replace:!0});return}W8({selectionSource:M,selectedCompanyId:C,routeCompanyId:Ee.id})&&R(Ee.id,{source:"route_sync"})},[_,S,N,Ee,E.pathname,E.search,z,k,M,C,R]);const Kt=j,ea=(0,x.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]),Jt=(0,x.useRef)(null),Mt=(0,x.useRef)(!1),Gt=(0,x.useRef)(!1),dt=(0,x.useCallback)(()=>{Jt.current!==null&&(window.clearTimeout(Jt.current),Jt.current=null)},[]),On=(0,x.useCallback)(()=>{dt(),Jt.current=window.setTimeout(()=>p(!0),50)},[dt,p]),mt=(0,x.useCallback)(()=>{dt(),p(!0)},[dt,p]),Nn=(0,x.useCallback)(()=>{dt(),Jt.current=window.setTimeout(()=>p(!1),120)},[dt,p]),It=(0,x.useCallback)(()=>{Mt.current=!0,c&&!Gt.current&&On()},[c,On]),en=(0,x.useCallback)(()=>{Mt.current=!1,Gt.current=!1,Nn()},[Nn]),qt=(0,x.useCallback)(()=>{Gt.current||mt()},[mt]),Tt=(0,x.useCallback)(()=>{Mt.current||Nn()},[Nn]);(0,x.useEffect)(()=>dt,[dt]);const At=(0,x.useRef)(c);return(0,x.useEffect)(()=>{c!==At.current&&(c?(dt(),p(!1),Gt.current=Mt.current):Gt.current=!1,At.current=c)},[c,dt,p]),(0,x.useEffect)(()=>{if(!u)return;const _e=r(Re=>{Re.key==="Escape"&&(dt(),p(!1))},"onKeyDown");return window.addEventListener("keydown",_e),()=>window.removeEventListener("keydown",_e)},[u,dt,p]),q8(),z8({onNewIssue:r(()=>v(),"onNewIssue"),onSearch:ea,onToggleSidebar:l,onTogglePanel:Kt,onShowShortcuts:r(()=>Pe(!0),"onShowShortcuts"),onGoToInbox:r(()=>z("/inbox"),"onGoToInbox")}),(0,x.useEffect)(()=>{if(!f)return;const _e=30,Re=50,lt=75;let Dt=0,Le=0;const Ot=r(Lt=>{const tn=Lt.touches[0];Dt=tn.clientX,Le=tn.clientY},"onTouchStart"),Rt=r(Lt=>{const tn=Lt.changedTouches[0],Wt=tn.clientX-Dt;if(!(Math.abs(tn.clientY-Le)>lt)){if(!t&&Dt<_e&&Wt>Re){s(!0);return}t&&Wt<-50&&s(!1)}},"onTouchEnd");return document.addEventListener("touchstart",Ot,{passive:!0}),document.addEventListener("touchend",Rt,{passive:!0}),()=>{document.removeEventListener("touchstart",Ot),document.removeEventListener("touchend",Rt)}},[f,t,s]),(0,x.useEffect)(()=>{const _e=document.body.style.overflow;return document.body.style.overflow=f?"visible":"clip",()=>{document.body.style.overflow=_e}},[f]),(0,x.useEffect)(()=>{if(!f)return Y8()},[f]),(0,x.useEffect)(()=>{if(typeof document>"u")return;const _e=ye.current;return G8(_e)},[E.pathname]),(0,x.useEffect)(()=>{const _e=ye.current;if(!_e)return;const Re=r(()=>{Me.current.remember(he.current,_e.scrollTop)},"recordScroll");return _e.addEventListener("scroll",Re,{passive:!0}),()=>_e.removeEventListener("scroll",Re)},[]),(0,x.useLayoutEffect)(()=>{const _e=ye.current,Re=P3({previousPathname:we.current,pathname:E.pathname,navigationType:B,state:E.state});we.current=E.pathname;const lt=B==="POP",Dt=lt?Me.current.recall(E.key):0;if(he.current=E.key,lt){Fy(_e,Dt);const Le=requestAnimationFrame(()=>Fy(_e,Dt));return()=>cancelAnimationFrame(Le)}Re&&B3(_e)},[E.key,E.pathname,E.state,B]),(0,a.jsx)(T3,{children:(0,a.jsxs)("div",{"data-app-shell":"",className:Y("bg-bg text-ink pt-(--sz-safe-top)",f?"min-h-dvh overflow-x-clip":"flex h-dvh flex-col overflow-clip"),children:[(0,a.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-bg focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:"Skip to Main Content"}),(0,a.jsx)($U,{}),(0,a.jsx)(mU,{}),(0,a.jsx)(bU,{devServer:at?.devServer}),(0,a.jsx)(yU,{diskSpace:at?.diskSpace,warnings:at?.warnings}),(0,a.jsx)(AU,{}),(0,a.jsx)(MU,{}),(0,a.jsxs)("div",{className:Y("min-h-0 flex-1",f?"w-full":"flex overflow-clip"),children:[f&&t&&(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/50",onClick:r(()=>s(!1),"onClick"),"aria-label":"Close sidebar"}),f?(0,a.jsxs)("div",{className:Y("fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",t?"translate-x-0":"-translate-x-full"),children:[(0,a.jsx)("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:(0,a.jsx)("div",{className:"w-60 shrink-0 overflow-hidden",children:Vt?(0,a.jsx)(wd,{children:Ht}):(0,a.jsx)(Zj,{children:e})})}),(0,a.jsx)(Bw,{deploymentMode:at?.deploymentMode,forceExpanded:$})]}):(0,a.jsxs)(t8,{open:t,collapsed:$?!1:c,peeking:$?!1:u,resizable:!0,onPanelMouseEnter:$?void 0:It,onPanelMouseLeave:$?void 0:en,onPanelFocusCapture:!$&&c?qt:void 0,onPanelBlurCapture:!$&&c?Tt:void 0,children:[(0,a.jsx)("div",{className:"flex flex-1 min-h-0",children:$?(0,a.jsx)(wd,{children:Ht}):(0,a.jsx)(Zj,{children:e})}),(0,a.jsx)(Bw,{deploymentMode:at?.deploymentMode,forceExpanded:$})]}),!f&&qe&&!gt?(0,a.jsx)(wd,{className:"w-60 shrink-0",children:Ht}):null,(0,a.jsxs)("div",{className:Y("flex min-w-0 flex-col",f?"w-full":"h-full flex-1"),children:[(0,a.jsxs)("div",{ref:g,"data-slot":f?"mobile-topbar":void 0,className:Y(!f&&A&&"hidden",f&&"sticky top-0 z-20 bg-bg/95 backdrop-blur supports-[backdrop-filter]:bg-bg/85"),children:[(0,a.jsx)(Dw,{mobile:f,onNavigateHome:r(()=>z("/dashboard"),"onNavigateHome")}),(0,a.jsx)(aw,{}),cn?(0,a.jsx)("div",{className:"border-b border-line px-4 pb-3",children:(0,a.jsx)(G4,{})}):null]}),(0,a.jsxs)("div",{className:Y(f?"block":"relative flex flex-1 min-h-0",!f&&A&&"streamlined-task-detail-surface"),children:[!f&&gt?(0,a.jsx)(wd,{className:"w-60 shrink-0 bg-bg",children:Ht}):null,(0,a.jsxs)("div",{className:Y(!f&&A?"flex min-w-0 flex-1 flex-col":"contents"),children:[!f&&A?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Dw,{mobile:!1,onNavigateHome:r(()=>z("/dashboard"),"onNavigateHome")}),(0,a.jsx)(aw,{taskDetailLayout:!0})]}):null,(0,a.jsx)("main",{id:"main-content",ref:ye,tabIndex:-1,style:f?{"--tc-composer-bottom":"var(--sz-calc-14)"}:void 0,className:Y("flex-1 p-4 outline-none md:p-6",!f&&A&&"pt-0 md:pt-0",f?"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:ct?(0,a.jsx)(ur,{scope:"invalid_company_prefix",requestedPrefix:_??I?.issuePrefix}):(0,a.jsx)(QU,{children:(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:(0,a.jsx)(xo,{})})})})]}),(0,a.jsx)($z,{taskDetailLayout:!f&&A})]})]})]}),f&&(0,a.jsx)(uU,{visible:ve}),(0,a.jsx)(AP,{}),(0,a.jsx)(A$,{}),(0,a.jsx)(E$,{}),(0,a.jsx)(M$,{}),(0,a.jsx)(q$,{}),(0,a.jsx)(W$,{open:et,onOpenChange:Pe}),(0,a.jsx)(X$,{}),(0,a.jsx)(sU,{health:at}),(0,a.jsx)(cU,{localTrusted:at?.deploymentMode==="local_trusted"})]})})}r(t6,"Layout");var Kw=null;function n6(){return Kw??=new Af,Kw}r(n6,"getDetachedClient");function a6(){const e=(0,x.useContext)(v0),{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn"),enabled:e!=null},e??n6());return e?{enabled:t?.enableConferenceRoomChat===!0,loaded:s}:{enabled:!1,loaded:!0}}r(a6,"useConferenceRoomChatEnabled");function s6(){const{enabled:e,loaded:t}=a6();return t?e?(0,a.jsx)(xo,{}):(0,a.jsx)(We,{to:"/dashboard",replace:!0}):null}r(s6,"ConferenceRoomChatGate");function nr({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enablePipelines!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(nr,"PipelinesExperimentalGate");function qw({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enableCases!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(qw,"CasesExperimentalGate");function Fw({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enableStatusCards!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(Fw,"StatusCardsExperimentalGate");function i6({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enablePixelsOffice!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(i6,"PixelsOfficeExperimentalGate");function _s({pageKey:e}){const{hidden:t,loaded:s}=hr();return s?t.has(e)?(0,a.jsx)(We,{to:"/company/settings",replace:!0}):(0,a.jsx)(xo,{}):null}r(_s,"HiddenSettingsPageGate");function Ih(){const{data:e,isFetched:t}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return t?e?.enableIsolatedWorkspaces!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(xo,{}):null}r(Ih,"IsolatedWorkspacesRouteGate");function Vl(){const e=hn(),{workspaceId:t}=zs(),{companies:s,loading:l}=vt(),c=me({queryKey:P.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Jf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t)return(0,a.jsx)(ur,{scope:"global"});if(l||c.isPending)return(0,a.jsx)(Ms,{});if(c.isError)return(0,a.jsx)(ur,{scope:"global"});const u=s.find(p=>p.id===c.data.companyId);return u?(0,a.jsx)(We,{to:`/${u.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):(0,a.jsx)(ur,{scope:"global"})}r(Vl,"UnprefixedExecutionWorkspaceRedirect");function r6(){const{companyPrefix:e,workspaceId:t}=zs(),{companies:s,loading:l}=vt(),c=me({queryKey:P.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Jf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t||!e)return(0,a.jsx)(ur,{scope:"global"});if(l||c.isPending)return(0,a.jsx)(Ms,{});if(c.isError)return(0,a.jsx)(ur,{scope:"global"});const u=s.find(p=>p.issuePrefix.toUpperCase()===e.toUpperCase());return!u||u.id!==c.data.companyId?(0,a.jsx)(ur,{scope:"global"}):(0,a.jsx)(xo,{})}r(r6,"ExecutionWorkspaceCompanyGate");var ya={status:r((e={})=>{const t=new URLSearchParams;e.command&&t.set("command",e.command),e.network&&t.set("network","1");const s=t.toString();return je.get(`/onboarding/omp${s?`?${s}`:""}`)},"status"),browse:r(e=>je.get(`/onboarding/omp/browse${e?`?path=${encodeURIComponent(e)}`:""}`),"browse"),loginProviders:r((e=!1)=>je.get(`/onboarding/omp/login/providers${e?"?refresh=1":""}`),"loginProviders"),startLogin:r(e=>je.post("/onboarding/omp/login",{provider:e}),"startLogin"),login:r(e=>je.get(`/onboarding/omp/login/${encodeURIComponent(e)}`),"login"),answerLogin:r((e,t)=>je.post(`/onboarding/omp/login/${encodeURIComponent(e)}/input`,{value:t}),"answerLogin"),cancelLogin:r(e=>je.delete(`/onboarding/omp/login/${encodeURIComponent(e)}`),"cancelLogin"),customProviders:r(()=>je.get("/onboarding/omp/custom-providers"),"customProviders"),saveCustomProvider:r((e,t)=>je.put(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`,t),"saveCustomProvider"),removeCustomProvider:r(e=>je.delete(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`),"removeCustomProvider"),fetchCustomProviderModels:r(e=>je.post("/onboarding/omp/custom-providers/models",e),"fetchCustomProviderModels"),probeCustomProvider:r(e=>je.post("/onboarding/omp/custom-providers/probe",e),"probeCustomProvider"),remote:r(e=>je.post("/onboarding/omp/remote",{address:e}),"remote")};function l6(e){return{heartbeat:{enabled:e?.heartbeatEnabled??Uy.heartbeatEnabled,intervalSec:e?.intervalSec??Uy.intervalSec,wakeOnDemand:!0,skipTimerWhenNoActionableWork:!0,cooldownSec:10,maxConcurrentRuns:20}}}r(l6,"buildNewAgentRuntimeConfig");var o6="input:not([type=hidden]):not(:disabled), select:not(:disabled), textarea:not(:disabled)",c6="Discard your unsaved changes?",u6=2/3;function d6(e,t){const[s,l]=(0,x.useState)(null),c=(0,x.useRef)(!1),u=(0,x.useRef)(new Map),p=(0,x.useRef)(e);p.current=e;const f=(0,x.useRef)(s);f.current=s;const h=(0,x.useId)(),g=s===null?null:e(s),v=(0,x.useCallback)(M=>`${h}-row-editor-${M.replace(/\s+/g,"_")}`,[h]),y=r(()=>!c.current||window.confirm(c6),"mayDiscard"),j=(0,x.useCallback)((M=!0)=>{const R=f.current;if(c.current=!1,l(null),R===null||!M)return;const _=p.current(R);requestAnimationFrame(()=>{const D=u.current.get(_);(D?.isConnected?D:t?.current)?.focus()})},[t]),k=r(M=>g===e(M)?!0:g!==null&&!y()?!1:(c.current=!1,l(M),!0),"request"),S=r(M=>{if(g!==e(M)){k(M);return}y()&&j()},"toggle"),N=r(()=>{y()&&j()},"dismiss"),I=(0,x.useCallback)(M=>{c.current=M},[]);return{open:s,openKey:g,request:k,toggle:S,close:j,dismiss:N,setDirty:I,triggerProps:r(M=>({ref:r(R=>{R?u.current.set(M,R):u.current.delete(M)},"ref"),"aria-expanded":g===M,"aria-controls":g===M?v(M):void 0}),"triggerProps"),panelId:v}}r(d6,"useInlineRowEditor");function Hw({id:e,onEscape:t,className:s,children:l}){const c=(0,x.useRef)(null);(0,x.useEffect)(()=>{const p=c.current;if(!p)return;p.querySelector(o6)?.focus({preventScroll:!0});const f=p.getBoundingClientRect().top;if(f>=0&&f<=window.innerHeight*u6)return;const h=p.parentElement?.tagName==="LI"?p.previousElementSibling:null;h?h.scrollIntoView?.({block:"center"}):p.scrollIntoView?.({block:"start"})},[]);const u=r(p=>{p.key!=="Escape"||p.defaultPrevented||(p.preventDefault(),p.stopPropagation(),t())},"onKeyDown");return(0,a.jsx)("div",{ref:c,id:e,className:Y("scroll-mt-16",s),onKeyDown:u,children:l})}r(Hw,"InlineRowEditorPanel");var f6=2e3,Vw=["omp","login-providers"];function Th(e){return e instanceof Error?e.message:"Something went wrong"}r(Th,"errorText");function Ia({tone:e,children:t}){return(0,a.jsx)("div",{role:e==="bad"?"alert":"status",className:Y("rounded-md border px-3 py-2 text-sm",e==="bad"?"border-bad text-ink":e==="ok"?"border-ok text-ink":"border-line text-ink-2"),children:t})}r(Ia,"OmpNote");function p6({onSignedIn:e,autoFocus:t=!1}){const s=kn(),l=me({queryKey:Vw,queryFn:r(()=>ya.loginProviders(),"queryFn"),staleTime:6e5}),[c,u]=(0,x.useState)(""),[p,f]=(0,x.useState)(null),[h,g]=(0,x.useState)(""),v=c||l.data?.providers[0]||"",y=Bt({mutationFn:r(_=>ya.startLogin(_.name),"mutationFn"),onSuccess:r((_,{popup:D})=>{g(""),f(_),D&&_.url&&_.state==="waiting"?D.location.href=_.url:D?.close()},"onSuccess"),onError:r((_,{popup:D})=>D?.close(),"onError")}),j=Bt({mutationFn:r(_=>ya.answerLogin(p.id,_),"mutationFn"),onSuccess:r(_=>{g(""),f(_)},"onSuccess")}),k=Bt({mutationFn:r(_=>ya.cancelLogin(_),"mutationFn"),onSettled:r(()=>f(null),"onSettled")}),S=p?.state==="waiting",N=me({queryKey:["omp","login",p?.id??""],queryFn:r(()=>ya.login(p.id),"queryFn"),enabled:S,refetchInterval:f6});(0,x.useEffect)(()=>{N.data&&N.data.id===p?.id&&f(N.data)},[N.data,p?.id]);const I=(0,x.useRef)(null),C=(0,x.useRef)(e);C.current=e;const M=p?.state==="succeeded"?p.id:null;(0,x.useEffect)(()=>{!M||I.current===M||(I.current=M,s.invalidateQueries({queryKey:["agents"]}),C.current?.())},[M,s]);function R(_){_.preventDefault(),h.trim()&&j.mutate(h.trim())}return r(R,"submitAnswer"),l.isLoading?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Asking OMP which providers it can sign in to..."}):l.error?(0,a.jsxs)(Ia,{tone:"bad",children:[Th(l.error)," ",(0,a.jsx)(oe,{type:"button",variant:"link",size:"xs",onClick:r(()=>{l.refetch()},"onClick"),children:"Try again"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[!p||!S?(0,a.jsxs)("form",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",onSubmit:r(_=>{_.preventDefault(),v&&y.mutate({name:v,popup:window.open("about:blank","_blank")})},"onSubmit"),children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:["Provider",(0,a.jsx)(hg,{value:v,onChange:r(_=>u(_.target.value),"onChange"),autoFocus:t,className:"w-full",children:l.data?.providers.map(_=>(0,a.jsx)("option",{value:_,children:_},_))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(oe,{type:"submit",disabled:!v||y.isPending,className:"flex-1 sm:flex-none",children:y.isPending?"Starting...":"Sign in"}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon","aria-label":"Reload provider list",title:"Reload provider list",onClick:r(()=>{ya.loginProviders(!0).then(_=>s.setQueryData(Vw,_))},"onClick"),children:(0,a.jsx)(nl,{"aria-hidden":"true"})})]})]}):null,y.error?(0,a.jsx)(Ia,{tone:"bad",children:Th(y.error)}):null,p?(0,a.jsxs)("section",{"aria-label":`Sign-in to ${p.provider}`,className:"flex flex-col gap-3 rounded-lg border border-line bg-bg-2 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("b",{className:"text-sm font-semibold",children:p.provider}),S?(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"xs",disabled:k.isPending,onClick:r(()=>k.mutate(p.id),"onClick"),children:"Cancel"}):null]}),S&&p.url?(0,a.jsxs)("ol",{className:"flex list-decimal flex-col gap-1.5 ps-5 text-sm text-ink-2",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("a",{href:p.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-medium text-accent underline underline-offset-4",children:["Open the sign-in page ",(0,a.jsx)($1,{"aria-hidden":"true",className:"size-3.5"})]})," ","(already opened in a new tab unless the browser blocked it) and approve access."]}),p.prompt&&!p.prompt.secret?(0,a.jsx)("li",{children:"If the page ends on an address that does not load (it starts with http://localhost), copy that whole address from the browser bar and paste it below. On the machine that runs Wardmote this step finishes by itself."}):(0,a.jsx)("li",{children:"Enter the code OMP shows below if the page asks for one. This panel moves on by itself once you approve."})]}):null,S&&p.prompt?(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:[p.prompt.label.replace(/:$/,""),(0,a.jsx)(Wn,{value:h,onChange:r(_=>g(_.target.value),"onChange"),type:p.prompt.secret?"password":"text",autoComplete:"off",spellCheck:!1,autoFocus:!p.url})]}),(0,a.jsx)(oe,{type:"submit",disabled:!h.trim()||j.isPending,children:j.isPending?"Sending...":"Send"})]}):null,S&&!p.prompt&&!p.url?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Waiting for OMP..."}):null,S&&p.message?(0,a.jsx)(Ia,{tone:"bad",children:p.message}):null,j.error?(0,a.jsx)(Ia,{tone:"bad",children:Th(j.error)}):null,p.state==="succeeded"?(0,a.jsxs)(Ia,{tone:"ok",children:[p.message??"Signed in",". Models from this provider are ready."]}):null,p.state==="failed"?(0,a.jsxs)(Ia,{tone:"bad",children:[p.message??"Sign-in failed",". Check the account on the provider's page, then press Sign in again."]}):null,S&&!p.prompt&&p.lines.length?(0,a.jsx)("pre",{"aria-label":"OMP output",className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-bg-3 px-3 py-2 font-mono text-xs text-ink-2",children:p.lines.join(`
54
+ `)}`:void 0}r(KU,"sanitizeComponentStack");function jA(){const e={};if(typeof document<"u"){try{const t=document.readyState;(t==="loading"||t==="interactive"||t==="complete")&&(e.ready_state=t)}catch{}try{const t=document.visibilityState;(t==="visible"||t==="hidden")&&(e.visibility_state=t)}catch{}try{const t=document.documentElement.classList;e.translation_marker=t.contains("translated-ltr")||t.contains("translated-rtl")}catch{}}return e}r(jA,"readBrowserErrorState");function qU(e){const t=KU(e.componentStack);return{tags:{react_error_boundary:e.boundary},contexts:{react:t?{componentStack:t}:{},browser_state:jA()}}}r(qU,"buildBrowserErrorContext");var Ow=Promise.resolve();function hx(e){const t=Ow.then(e);return Ow=t.catch(()=>{}),t}r(hx,"enqueue");var po=null;function FU(e,t){return hx(async()=>{if(!po)try{const s=await ke(()=>import("./prod-COP_vZWu.js"),__vite__mapDeps([0,1]));s.init(VU(e,t)),po=s}catch{}})}r(FU,"initBrowserErrorMonitoring");function HU(){return hx(async()=>{const e=po;if(po=null,!e)return;const t=e.getClient();try{e.getCurrentScope().setClient(void 0)}catch{}try{await t?.close(2e3)}catch{}})}r(HU,"teardownBrowserErrorMonitoring");function wA(e,t){let s;try{t&&(s=qU(t))}catch{}hx(async()=>{try{s?po?.captureException(e,s):po?.captureException(e)}catch{}})}r(wA,"captureBrowserException");function VU(e,t){return{dsn:e,environment:t??void 0,release:"4c8a018c4bd76b2df435282d958dc0f429cf2087",tracesSampleRate:0,sendDefaultPii:!1,beforeSend:r((s,l)=>{try{if(s.contexts={...s.contexts,browser_state:s.contexts?.browser_state??jA()},s.tags={...s.tags,browser_build_mode:"production"},s.exception?.values?.some(c=>c.mechanism?.type==="onunhandledrejection"||c.mechanism?.type==="auto.browser.global_handlers.onunhandledrejection")){const c=l.originalException;s.tags.browser_rejection_kind=c===null?"null":typeof c}}catch{}return s},"beforeSend"),integrations:r(s=>s.filter(l=>l.name!=="HttpContext"&&l.name!=="Breadcrumbs"),"integrations")}}r(VU,"buildBrowserSentryInitOptions");var WU=class extends x.Component{static{r(this,"RouteErrorBoundaryInner")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){wA(e,{boundary:"route",componentStack:t.componentStack})}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){const{error:e}=this.state;return e?(0,a.jsxs)("div",{className:"mx-auto max-w-2xl space-y-4 px-4 py-10",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-semibold",children:"This page hit an error"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while rendering this page. You can go back and try again, or reload."})]}),(0,a.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:this.props.onReset,children:"Go back"}),(0,a.jsx)(oe,{size:"sm",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})]})]}):this.props.children}};function QU({children:e}){const t=hn(),s=ja(),l=`${t.pathname}${t.search}`;return(0,a.jsx)(WU,{resetKey:l,onReset:r(()=>s(-1),"onReset"),children:e})}r(QU,"RouteErrorBoundary");function GU({open:e,onOpenChange:t,...s}){return(0,a.jsx)(ws,{open:e,onOpenChange:t,children:(0,a.jsxs)(Ps,{"aria-describedby":void 0,className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[(0,a.jsxs)("div",{className:"px-4 pt-4 pb-3",children:[(0,a.jsx)(Ds,{children:"Chat with an agent"}),s.existingChatAgentIds&&(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"One conversation per agent. Pick up where you left off."})]}),(0,a.jsx)(YU,{...s,onComplete:r(()=>t(!1),"onComplete")},String(e))]})})}r(GU,"AgentChatPicker");function YU({agents:e,onSelect:t,onComplete:s,loading:l,error:c,onRetry:u,existingChatAgentIds:p,renderAgentIcon:f}){const h=(0,x.useRef)(!1),g=(0,x.useRef)(null);(0,x.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current?.abort()}),[]);const[v,y]=(0,x.useState)(""),[j,k]=(0,x.useState)(null),[S,N]=(0,x.useState)(null);async function I(C){if(j)return;k(C.id),N(null);const M=new AbortController;g.current=M;try{await t(C,M.signal),h.current&&s()}catch(R){N(R instanceof Error?R.message:"Couldn’t open chat. Try again.")}finally{k(null)}}return r(I,"selectAgent"),(0,a.jsxs)(J1,{children:[(0,a.jsx)(O0,{"aria-label":"Search agents by name or role",placeholder:"Search by name or role…",value:v,onValueChange:y}),S&&(0,a.jsx)("p",{role:"alert",className:"px-4 py-3 text-sm text-bad",children:S}),j&&(0,a.jsx)("p",{role:"status",className:"sr-only",children:"Opening conversation…"}),c?(0,a.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 p-4 text-sm",children:[(0,a.jsx)("p",{children:"Couldn’t load agents. Try again."}),u&&(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:u,children:"Retry"})]}):l?(0,a.jsx)("p",{role:"status",className:"p-4 text-sm text-ink-3",children:"Loading agents…"}):(0,a.jsxs)(z0,{children:[(0,a.jsx)(L0,{children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 px-4",children:[(0,a.jsx)("span",{children:e.length?`No agents match “${v}”`:"No agents yet."}),e.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Try another name or role."}),(0,a.jsx)(oe,{variant:"ghost",size:"sm",onClick:r(()=>y(""),"onClick"),children:"Clear search"})]}):(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Create an agent from the Agents page to start chatting."})]})}),(0,a.jsx)(Ys,{children:e.map(C=>(0,a.jsxs)(wn,{value:C.id,keywords:[C.name,C.title??"",C.role],onSelect:r(()=>{I(C)},"onSelect"),disabled:j!==null,className:"gap-3 px-3 py-3",children:[f?f(C):(0,a.jsx)(sg,{icon:C.icon,className:"size-4 shrink-0"}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"truncate font-medium",children:C.name}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:C.title??C.role})]}),p&&(0,a.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:p.includes(C.id)?"Open chat":"New chat"}),C.status==="paused"&&(0,a.jsx)("span",{className:"text-xs text-(--status-agent-paused)",children:"Paused"}),C.status==="terminated"&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Terminated"}),C.status==="pending_approval"&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Awaiting approval"})]},C.id))})]})]})}r(YU,"AgentChatPickerResults");function XU({agents:e,existingChatAgentIds:t,availableAgents:s=e,activeId:l,previews:c={},loading:u=!1,error:p,onRetry:f,initialSearch:h="",onSelect:g,onBrowse:v,onAddChat:y,historyLoading:j,historyError:k,onRetryHistory:S}){const N=ja(),[I,C]=(0,x.useState)(!1),[M,R]=(0,x.useState)(h),_=(0,x.useRef)(null),D=(0,x.useId)(),U=M.trim().toLocaleLowerCase(),K=e.filter(E=>`${E.name} ${E.title??""} ${E.role}`.toLocaleLowerCase().includes(U));function z(){R(""),_.current?.focus()}return r(z,"focusSearch"),(0,a.jsxs)("aside",{"aria-labelledby":D,className:"flex h-full min-h-0 flex-col border-r border-line bg-bg",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col gap-4 px-3 pb-4 pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("h2",{id:D,className:"text-sm font-semibold",children:"Chat"}),(0,a.jsx)(oe,{variant:"secondary",size:"icon-sm","aria-label":"Add chat",title:"Add chat",onClick:r(()=>C(!0),"onClick"),children:(0,a.jsx)(ns,{className:"size-4"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(fr,{"aria-hidden":"true",className:"pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-ink-3"}),(0,a.jsx)(Wn,{ref:_,"aria-label":"Search agents",placeholder:"Find an agent",value:M,onChange:r(E=>R(E.target.value),"onChange"),onKeyDown:r(E=>{E.key==="Escape"&&(E.stopPropagation(),R(""))},"onKeyDown"),className:"h-8 pl-8 pr-8 text-xs md:text-xs"}),M&&(0,a.jsx)(oe,{variant:"ghost",size:"icon-xs","aria-label":"Clear search",className:"absolute right-1 top-1/2 -translate-y-1/2",onClick:z,children:(0,a.jsx)(ia,{className:"size-3"})})]})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pb-3 scrollbar-auto-hide",children:[(0,a.jsx)("p",{className:"px-2 text-(length:--text-micro) font-medium uppercase tracking-widest text-ink-3",children:U?"Search results":"Teammates"}),(0,a.jsx)("span",{role:"status",className:"sr-only",children:u?"Loading agents":`${K.length} ${K.length===1?"agent":"agents"}`}),j&&(0,a.jsx)("p",{role:"status",className:"px-2 text-xs text-ink-3",children:"Loading chat history…"}),k&&(0,a.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-3",children:[(0,a.jsx)("p",{className:"text-xs text-ink-3",children:"Some chat history couldn’t load."}),(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:S,children:"Retry chat history"})]}),p?(0,a.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,a.jsx)("p",{className:"text-sm",children:"Couldn’t load your chats."}),(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:f,children:"Try again"})]}):u?(0,a.jsx)("div",{"aria-hidden":"true",className:"flex flex-col gap-1",children:[0,1,2,3].map(E=>(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-md px-2 py-3 motion-safe:animate-pulse",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg bg-bg-3"}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,a.jsx)("div",{className:"h-3 w-2/3 rounded-sm bg-bg-3"}),(0,a.jsx)("div",{className:"h-2 w-full rounded-sm bg-bg-3"})]})]},E))}):K.length?(0,a.jsx)("nav",{"aria-label":"Agent conversations",className:"flex flex-col gap-1",children:K.map(E=>(0,a.jsxs)(mn,{to:`/chats/${encodeURIComponent(E.status==="terminated"?E.id:dr(E))}`,"aria-current":l===E.id?"page":void 0,title:`${E.name}${E.title?` · ${E.title}`:""}`,onClick:r(B=>{g&&(B.preventDefault(),g(E))},"onClick"),className:Y("flex min-w-0 items-center gap-3 rounded-md px-2 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus",l===E.id?oo.active:oo.rest),children:[(0,a.jsx)(pr,{agent:E,size:32}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:E.name}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:E.status==="terminated"?"Terminated":E.status==="paused"?"Paused":c[E.id]??E.title??"Start a conversation"})]})]},E.id))}):!e.length&&(j||k)?null:(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2 px-2 py-6",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.length?"No agents found":"No chats yet"}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-ink-3",children:e.length?"Try another name or role.":"Choose an agent to start a conversation."}),!e.length&&(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:r(()=>C(!0),"onClick"),children:"Choose an agent"}),e.length>0&&(0,a.jsx)(oe,{variant:"secondary",size:"sm",onClick:z,children:"Clear search"})]})]}),(0,a.jsx)("div",{className:"shrink-0 px-3 py-4",children:(0,a.jsx)(oe,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2 px-2",asChild:!v,onClick:v,children:v?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Gr,{className:"size-4"}),"Browse all agents"]}):(0,a.jsxs)(mn,{to:"/agents/all",children:[(0,a.jsx)(Gr,{className:"size-4"}),"Browse all agents"]})})}),(0,a.jsx)(GU,{agents:s,open:I,onOpenChange:C,existingChatAgentIds:t??e.map(E=>E.id),loading:u,error:p,onRetry:f,renderAgentIcon:r(E=>(0,a.jsx)(pr,{agent:E,size:32}),"renderAgentIcon"),onSelect:r(async(E,B)=>{y?await y(E,B):g?await g(E,B):N(`/chats/${encodeURIComponent(dr(E))}`),B?.aborted||R("")},"onSelect")})]})}r(XU,"AgentConversationSidebar");function ZU(){const{selectedCompanyId:e}=vt(),{enabled:t,loaded:s}=zf(),l=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),c=l.data?.user?.id??l.data?.session?.userId??null;return{companyId:e,userId:c,enabled:t,loaded:s,agents:me({queryKey:P.agents.list(e),queryFn:r(()=>Fa.list(e),"queryFn"),enabled:t&&!!e}),chats:me({queryKey:P.agentChats.list(e,c),queryFn:r(()=>sS.list(e),"queryFn"),enabled:t&&!!e&&l.isSuccess}),session:l}}r(ZU,"useAgentChatNavigation");function JU(e,t){const s=kn(),l=ja(),{isMobile:c,setSidebarOpen:u}=Jn(),p=(0,x.useRef)({companyId:e,userId:t,mounted:!0});return(0,x.useEffect)(()=>{const f={companyId:e,userId:t,mounted:!0};return p.current=f,()=>{f.mounted=!1}},[e,t]),(0,x.useCallback)(async(f,h)=>{if(!e||f.companyId!==e)throw new Error("Choose an agent from this company.");const g=p.current,v=await sS.ensure(e,f.id);s.setQueryData(P.agentChats.detail(e,t,f.id),v),s.setQueryData(P.issues.detail(v.id),v),s.setQueryData(P.agentChats.list(e,t),y=>[v,...(y??[]).filter(j=>j.id!==v.id)].sort((j,k)=>new Date(k.updatedAt).getTime()-new Date(j.updatedAt).getTime()||k.id.localeCompare(j.id))),!(!g.mounted||p.current!==g||h?.aborted)&&(l(`/chats/${encodeURIComponent(dr(f))}`),c&&u(!1))},[s,e,t,l,c,u])}r(JU,"useOpenAgentChat");function e8(){const{companyId:e,userId:t,agents:s,chats:l,session:c}=ZU(),u=JU(e,t),p=ja(),f=V0(e),{isMobile:h,setSidebarOpen:g}=Jn(),{pathname:v}=hn(),y=v.split("/chats/")[1]?.split("/")[0],j=s.data??[],k=s.isSuccess?[...new Set((l.data??[]).flatMap(D=>D.conversationAgentId&&!j.some(U=>U.id===D.conversationAgentId)?[D.conversationAgentId]:[]))]:[],S=_f({queries:k.map(D=>({queryKey:P.agents.detail(D),queryFn:r(()=>Fa.get(D,e),"queryFn")}))}),N=new Map(j.map(D=>[D.id,D]));for(const D of S)D.data&&N.set(D.data.id,D.data);const I=[...N.values()].find(D=>D.id===y||D.status!=="terminated"&&encodeURIComponent(dr(D))===y),C=(l.data??[]).flatMap(D=>{const U=D.conversationAgentId?N.get(D.conversationAgentId):void 0;return U?[U]:[]});I&&!C.some(D=>D.id===I.id)&&C.unshift(I);const M=new Set(C.map(D=>D.id)),R=j.filter(D=>!M.has(D.id)&&D.status!=="terminated"&&(!f.isSuccess||DN(f.data,"agent",D.id)!=="left")).sort((D,U)=>D.name.localeCompare(U.name,void 0,{sensitivity:"base"})),_=Object.fromEntries((l.data??[]).filter(D=>D.conversationState==="active").map(D=>[D.conversationAgentId,"Working…"]));return(0,a.jsx)(XU,{agents:[...C,...R],availableAgents:j,existingChatAgentIds:C.map(D=>D.id),activeId:I?.id,previews:_,loading:s.isPending||l.isPending||c.isPending,error:s.error??l.error??c.error,onRetry:r(()=>{s.refetch(),l.refetch(),c.refetch()},"onRetry"),historyLoading:S.some(D=>D.isPending),historyError:S.find(D=>D.error)?.error,onRetryHistory:r(()=>{S.filter(D=>D.isError).forEach(D=>{D.refetch()})},"onRetryHistory"),onAddChat:u,onSelect:r(D=>{p(`/chats/${encodeURIComponent(D.status==="terminated"?D.id:dr(D))}`),h&&g(!1)},"onSelect")},`${e}:${t}`)}r(e8,"AgentConversationsSidebar");var jd=232,zg=208,Pg=420,Lw=16;function hf(e){return Math.min(Pg,Math.max(zg,e))}r(hf,"clampSidebarWidth");function zw(e){if(typeof window>"u")return jd;try{const t=window.localStorage.getItem(e);if(!t)return jd;const s=Number.parseInt(t,10);return Number.isFinite(s)?hf(s):jd}catch{return jd}}r(zw,"readStoredSidebarWidth");function Pw(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(hf(t)))}catch{}}r(Pw,"writeStoredSidebarWidth");function t8({children:e,open:t,collapsed:s=!1,peeking:l=!1,resizable:c=!1,storageKey:u="wardmote.sidebar.width",className:p,onPanelMouseEnter:f,onPanelMouseLeave:h,onPanelFocusCapture:g,onPanelBlurCapture:v}){const[y,j]=(0,x.useState)(()=>zw(u)),[k,S]=(0,x.useState)(!1),N=(0,x.useRef)(y),I=(0,x.useRef)(null);(0,x.useEffect)(()=>{const V=zw(u);N.current=V,j(V)},[u]);const C=t?y:0,M=t?s?72:C:0,R=t?s&&!l?72:C:0,_=R>M,D=c&&t&&!s,U=(0,x.useMemo)(()=>({width:`${M}px`}),[M]),K=(0,x.useMemo)(()=>({width:`${R}px`}),[R]),z=(0,x.useCallback)(V=>{const ue=hf(V);N.current=ue,j(ue),Pw(u,ue)},[u]),E=(0,x.useCallback)(V=>{D&&(V.preventDefault(),V.currentTarget.setPointerCapture(V.pointerId),I.current={startX:V.clientX,startWidth:N.current},S(!0))},[D]),B=(0,x.useCallback)(V=>{if(!I.current)return;const ue=hf(I.current.startWidth+V.clientX-I.current.startX);N.current=ue,j(ue)},[]),O=(0,x.useCallback)(()=>{I.current&&(I.current=null,S(!1),Pw(u,N.current))},[u]),Q=(0,x.useCallback)(V=>{D&&(V.key==="ArrowLeft"?(V.preventDefault(),z(y-Lw)):V.key==="ArrowRight"?(V.preventDefault(),z(y+Lw)):V.key==="Home"?(V.preventDefault(),z(zg)):V.key==="End"&&(V.preventDefault(),z(Pg)))},[D,z,y]);return(0,a.jsxs)("div",{className:Y("relative h-full shrink-0",p),style:U,children:[(0,a.jsx)("div",{className:Y("absolute inset-y-0 left-0 flex flex-col overflow-hidden",_?"z-30 border-r border-line bg-bg shadow-lg":"z-0"),style:K,"data-sidebar-overlay":_?"":void 0,onMouseEnter:f,onMouseLeave:h,onFocusCapture:g,onBlurCapture:v,children:e}),D?(0,a.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":zg,"aria-valuemax":Pg,"aria-valuenow":y,tabIndex:0,"data-dragging":k?"":void 0,className:"group absolute inset-y-0 z-20 cursor-col-resize touch-none outline-none",style:{right:-4,width:8},onPointerDown:E,onPointerMove:B,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,onKeyDown:Q,children:(0,a.jsx)("div",{className:Y("mx-auto h-full w-0.5 transition-colors",k?"bg-focus":"bg-transparent group-hover:bg-focus group-focus-visible:bg-focus")})}):null]})}r(t8,"SidebarShell");function wd({children:e,className:t}){return(0,a.jsx)("div",{"data-secondary-sidebar":"",className:Y("h-full w-full min-w-0 overflow-hidden",t),children:(0,a.jsx)(Q1,{children:e})})}r(wd,"SecondarySidebar");function n8(e,t){if(!t)return!1;if(t.source==="local_implicit"||t.isInstanceAdmin)return!0;if(!e)return!1;const s=t.memberships?.find(l=>l.companyId===e&&l.status==="active");return s?.membershipRole==="owner"||s?.membershipRole==="admin"||s?.membershipRole==="operator"||s?.membershipRole==="member"}r(n8,"canInviteCompanyMembers");function a8(){const e=eI(),t=me({queryKey:P.access.currentBoardAccess,queryFn:r(()=>ei.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4});return n8(e?.selectedCompanyId,t.data)}r(a8,"useCanInviteCompanyMembers");function s8(e){return e?.trim().toLowerCase().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||null}r(s8,"slugifyUserPart");function i8(e){const t=[e?.id,e?.name,e?.email?.split("@")[0],e?.email];for(const s of t){const l=s8(s);if(l)return`/u/${l}`}return"/u/me"}r(i8,"userProfilePath");var zc=null,kA=!1,$g=!1,Ug=new Set;function Pc(){for(const e of Ug)e()}r(Pc,"emit");function r8(e=typeof navigator>"u"?"":navigator.userAgent,t=typeof navigator>"u"?0:navigator.maxTouchPoints){return/iPhone|iPad|iPod/i.test(e)?!0:/Macintosh/i.test(e)&&t>1}r(r8,"isIosSafariLike");function l8(e=window){const t=r(l=>{l.preventDefault(),zc=l,Pc()},"onPrompt"),s=r(()=>{zc=null,kA=!0,Pc()},"onInstalled");return e.addEventListener("beforeinstallprompt",t),e.addEventListener("appinstalled",s),()=>{e.removeEventListener("beforeinstallprompt",t),e.removeEventListener("appinstalled",s)}}r(l8,"captureInstallPrompt");function o8(){return kA||Lg()?"installed":zc?"prompt":r8()?"ios-manual":"unavailable"}r(o8,"installAvailability");async function c8(){const e=zc;if(!e)return"unavailable";zc=null,Pc(),await e.prompt();const{outcome:t}=await e.userChoice;return t}r(c8,"promptInstall");function Bg(e){$g!==e&&($g=e,Pc())}r(Bg,"setIosInstallHelpOpen");function u8(){return $g}r(u8,"iosInstallHelpOpen");function d8(){return(0,x.useSyncExternalStore)(gx,u8,()=>!1)}r(d8,"useIosInstallHelpOpen");function gx(e){return Ug.add(e),()=>{Ug.delete(e)}}r(gx,"subscribe$1");function SA(){return(0,x.useSyncExternalStore)(gx,o8,()=>"unavailable")}r(SA,"useInstallAvailability");function jY(e){const t=SA();return(0,x.useSyncExternalStore)(gx,()=>m8(t,e),()=>!1)}r(jY,"useInstallNudgeVisible");var f8=2592e6,Kg="wardmote.install.visits",$w="wardmote.install.visit-counted",NA="wardmote.install.snoozed-until";function qg(e,t){const s=Number(e.getItem(t));return Number.isFinite(s)?s:0}r(qg,"readNumber");function p8(e=window.localStorage,t=window.sessionStorage){try{if(t.getItem($w))return;t.setItem($w,"1"),e.setItem(Kg,String(qg(e,Kg)+1))}catch{return}}r(p8,"recordAppVisit");function m8(e,t,s=Date.now(),l=window.localStorage){if(e!=="prompt"&&e!=="ios-manual"||/^\/(?:[^/]+\/)?onboarding(?:\/|$)/.test(t))return!1;try{return qg(l,Kg)>=3&&qg(l,NA)<=s}catch{return!1}}r(m8,"installNudgeVisible");function wY(e=Date.now(),t=window.localStorage){try{t.setItem(NA,String(e+f8))}catch{return}finally{Pc()}}r(wY,"snoozeInstallNudge");var Uw="Install app",h8="Add Wardmote to your home screen or dock.";function g8({variant:e,onAfterAction:t}){const s=SA();if(s==="installed"||s==="unavailable")return null;const l=r(()=>{s==="ios-manual"?Bg(!0):c8(),t?.()},"handleClick");return e==="compact-menu-action"?(0,a.jsxs)("button",{type:"button",className:"flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",onClick:l,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(xg,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Uw})]}):(0,a.jsxs)("button",{type:"button",className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left transition-colors hover:bg-bg-3/60",onClick:l,children:[(0,a.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,a.jsx)(xg,{className:"size-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-ink",children:Uw}),(0,a.jsx)("span",{className:"block text-xs text-ink-3",children:h8})]})]})}r(g8,"InstallAppMenuAction");function x8(){const e=d8();return(0,a.jsx)(ws,{open:e,onOpenChange:Bg,children:(0,a.jsxs)(Ps,{children:[(0,a.jsxs)(bo,{children:[(0,a.jsx)(Ds,{children:"Install Wardmote"}),(0,a.jsx)(vo,{children:"Add Wardmote to your Home Screen from Safari."})]}),(0,a.jsxs)("ol",{className:"space-y-3 text-sm text-ink",children:[(0,a.jsxs)(Ah,{index:1,icon:(0,a.jsx)(TR,{className:"size-4"}),children:["Tap ",(0,a.jsx)("strong",{children:"Share"})," in the Safari toolbar."]}),(0,a.jsxs)(Ah,{index:2,icon:(0,a.jsx)(MR,{className:"size-4"}),children:["Choose ",(0,a.jsx)("strong",{children:"Add to Home Screen"}),"."]}),(0,a.jsxs)(Ah,{index:3,children:["Keep ",(0,a.jsx)("strong",{children:"Open as Web App"})," on, then tap ",(0,a.jsx)("strong",{children:"Add"}),"."]})]}),(0,a.jsx)(Pf,{children:(0,a.jsx)(oe,{type:"button",onClick:r(()=>Bg(!1),"onClick"),children:"Done"})})]})})}r(x8,"IosInstallHelpDialog");function Ah({index:e,icon:t,children:s}){return(0,a.jsxs)("li",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-line text-xs font-semibold text-ink-3",children:e}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t?(0,a.jsx)("span",{className:"text-ink-3",children:t}):null,(0,a.jsx)("span",{children:s})]})]})}r(Ah,"InstallStep");function b8(e){if(!e)return"Unavailable";const t=new Date(e);return Number.isNaN(t.getTime())?"Unavailable":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(t)}r(b8,"formatTimestamp");function v8(e){return!!e&&!Number.isNaN(new Date(e).getTime())}r(v8,"isValidTimestamp");function y8(e){return e?.devServer?.lastRestartAt??e?.serverInfo?.processStartedAt??null}r(y8,"restartTimestamp");function j8(e){const t=e?.serverInfo?.git;return t?.available?`${t.shortSha} · ${t.subject}`:"Commit unavailable"}r(j8,"commitLabel");function w8(e){const t=e?.serverInfo?.git;if(!t?.available)return"Unavailable";const s=t.localChanges;if(!s||!s.available)return"Change status unavailable";if(!s.hasLocalChanges)return"Clean checkout";const l=[[s.stagedFileCount,"staged"],[s.unstagedFileCount,"unstaged"],[s.untrackedFileCount,"untracked"]].filter(([c])=>Number(c)>0).map(([c,u])=>`${c} ${u}`);return l.length>0?`Local changes present (${l.join(", ")})`:"Local changes present"}r(w8,"localChangesLabel");function _h({icon:e,label:t,value:s,dateTime:l}){return(0,a.jsxs)("div",{className:"flex w-full items-start gap-3 rounded-xl px-3 py-3 text-left",children:[(0,a.jsx)("span",{className:"mt-0.5 rounded-lg border border-line bg-bg/70 p-2 text-ink-3",children:(0,a.jsx)(e,{className:"size-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-ink",children:t}),l?(0,a.jsx)("time",{dateTime:l,className:"block break-words text-xs text-ink-3",children:s}):(0,a.jsx)("span",{className:"block break-words text-xs text-ink-3",children:s})]})]})}r(_h,"ServerInfoRow");function k8(){const e=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")}).data?.enableServerInfoDebugView===!0,t=me({queryKey:P.health,queryFn:r(()=>Fc.get(),"queryFn"),enabled:e,refetchOnMount:"always",refetchInterval:r(v=>v.state.data?.devServer?.enabled?2e3:!1,"refetchInterval")});if(!e)return null;const s=t.data,l=t.isLoading&&!s,c=t.isError,u=y8(s),p=v8(u),f=c?"Health unavailable":l?"Loading...":b8(u),h=c?"Health unavailable":l?"Loading...":j8(s),g=c?"Health unavailable":l?"Loading...":w8(s);return(0,a.jsxs)("div",{className:"mt-2 border-t border-line pt-2",children:[(0,a.jsx)("p",{className:"px-3 pb-1 pt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"Server"}),(0,a.jsx)(_h,{icon:xS,label:"Last restarted",value:f,dateTime:!c&&!l&&p?u:null}),(0,a.jsx)(_h,{icon:hR,label:"Running commit",value:h}),(0,a.jsx)(_h,{icon:uR,label:"Checkout state",value:g})]})}r(k8,"SidebarServerInfo");var S8="/company/settings/members?tab=invites",N8="https://github.com/tickernelz/wardmote/tree/main/docs",C8="https://github.com/tickernelz/wardmote/issues";function A8(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length>=2?`${t[0]?.[0]??""}${t[t.length-1]?.[0]??""}`.toUpperCase():e.slice(0,2).toUpperCase()}r(A8,"deriveInitials");function Eh({label:e,icon:t,onClick:s,href:l,external:c=!1}){const u="flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bg-3",p=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(t,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e})]});return l?c?(0,a.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",className:u,onClick:s,children:p}):(0,a.jsx)(mn,{to:l,className:u,onClick:s,children:p}):(0,a.jsx)("button",{type:"button",className:u,onClick:s,children:p})}r(Eh,"MenuAction");function Bw({deploymentMode:e,open:t,onOpenChange:s,forceExpanded:l=!1}){const{hidden:c,loaded:u}=hr(),p=a8()?S8:null,f=u&&p!==null&&!qd(c,"company.members")&&!qd(c,"company.invites"),[h,g]=(0,x.useState)(!1),{isMobile:v,setSidebarOpen:y,collapsed:j,peeking:k}=Jn(),S=j&&!k&&!l,N=t??h,I=s??g,{data:C}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),M=rx({onSignedOut:K}),R=C?.user.name?.trim()||"Board",_=C?.user.email?.trim()||(e==="authenticated"?"Signed in":"Local workspace board"),D=A8(R),U=i8(C?.user);function K(){I(!1),v&&y(!1)}r(K,"closeNavigationChrome");function z(){M.mutate()}return r(z,"handleSignOut"),(0,a.jsx)("div",{className:"bg-line/50 px-3 py-2 dark:bg-bg-3",children:(0,a.jsxs)("div",{className:Y("flex items-center gap-0.5",!S&&"px-2"),children:[(0,a.jsxs)(js,{open:N,onOpenChange:I,children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:Y("flex min-w-0 items-center gap-2.5 rounded-lg text-left text-(length:--text-compact) font-medium text-ink/80 transition-colors hover:bg-bg-3 hover:text-ink",S?"w-full px-3 py-2":"flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,a.jsxs)(Gd,{size:"sm",children:[C?.user.image?(0,a.jsx)(Wd,{src:C.user.image,alt:R}):null,(0,a.jsx)(Qd,{children:D})]}),(0,a.jsx)("span",{className:Y("min-w-0 flex-1 truncate",S&&"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none"),children:R})]})}),(0,a.jsxs)(ys,{side:"top",align:"start",sideOffset:10,className:"min-h-(--profile-popover-min-height) w-(--profile-popover-width) max-w-(--sz-calc-24) overflow-hidden rounded-xl border-line bg-bg-2 p-0 shadow-(--shadow-profile-popover)",children:[(0,a.jsxs)("div",{className:"relative flex h-(--profile-popover-header-height) shrink-0 items-center gap-2.5 px-3.5",children:[(0,a.jsx)(mn,{to:U,"aria-label":"View profile",onClick:K,className:"absolute inset-0 transition-colors hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus"}),(0,a.jsxs)(Gd,{className:"pointer-events-none relative size-9",children:[C?.user.image?(0,a.jsx)(Wd,{src:C.user.image,alt:R}):null,(0,a.jsx)(Qd,{className:"text-xs text-ink",children:D})]}),(0,a.jsxs)("div",{className:"pointer-events-none relative min-w-0 flex-1",children:[(0,a.jsx)("h2",{className:"truncate text-sm font-semibold leading-(--profile-popover-label-line-height) text-ink",children:R}),(0,a.jsx)("p",{className:"truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-ink-3",children:_})]})]}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-0.5 border-t border-line px-2.5 pb-2.5 pt-2",children:[(0,a.jsx)(Eh,{label:"Settings",icon:V1,href:"/company/settings",onClick:K}),f&&p?(0,a.jsx)(Eh,{label:"Invite",icon:vN,href:p,onClick:K}):null,(0,a.jsx)(Eh,{label:"Documentation",icon:R1,href:N8,external:!0,onClick:r(()=>I(!1),"onClick")}),(0,a.jsx)(w3,{variant:"compact-menu-action",onAfterToggle:r(()=>I(!1),"onAfterToggle")}),(0,a.jsx)(g8,{variant:"compact-menu-action",onAfterAction:r(()=>I(!1),"onAfterAction")}),e==="authenticated"?(0,a.jsxs)("button",{type:"button",className:Y("flex h-(--profile-popover-row-height) w-full items-center gap-(--profile-popover-row-gap) rounded-lg px-2.5 text-left text-(length:--text-compact) font-medium leading-(--profile-popover-label-line-height) text-ink transition-colors hover:bg-bad/10",M.isPending&&"cursor-not-allowed opacity-60"),onClick:z,disabled:M.isPending,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)($f,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:M.isPending?"Signing out...":"Sign out"})]}):null,(0,a.jsx)(k8,{})]})]})]}),S?null:(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("a",{href:C8,target:"_blank",rel:"noreferrer","aria-label":"Share feedback",className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-ink-3/50 transition-colors hover:bg-bg-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,a.jsx)(C0,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,a.jsx)(Is,{side:"top",children:"Share feedback"})]})]})})}r(Bw,"SidebarAccountMenu");var _8=["input","textarea","select","[contenteditable='true']","[contenteditable='plaintext-only']","[role='textbox']","[role='combobox']"].join(", "),E8="[data-page-search-target='true']",I8=new Set(["Shift","Meta","Control","Alt"]);function ko(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(_8):!1}r(ko,"isKeyboardShortcutTextInputTarget");function Fg(e=document){return!!e.querySelector("[role='dialog'][aria-modal='true']")}r(Fg,"hasBlockingShortcutDialog");function T8(e){if(!e.isConnected||"disabled"in e&&typeof e.disabled=="boolean"&&e.disabled||e.closest("[hidden], [aria-hidden='true'], [inert]")||e.closest("[role='dialog'][aria-modal='true']"))return!1;const t=window.getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"?!1:e.getClientRects().length>0||e===document.activeElement}r(T8,"isVisibleShortcutTarget");function R8(e=document){return Array.from(e.querySelectorAll(E8)).find(t=>T8(t))??null}r(R8,"findPageSearchShortcutTarget");function M8(e=document){const t=R8(e);return t?(t.focus(),(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select(),!0):!1}r(M8,"focusPageSearchShortcutTarget");function D8({key:e,isComposing:t}){return e==="Enter"&&!t}r(D8,"shouldBlurPageSearchOnEnter");function O8({key:e,isComposing:t,currentValue:s}){return e==="Escape"&&!t&&s.length===0}r(O8,"shouldBlurPageSearchOnEscape");function tp(e){return I8.has(e)}r(tp,"isModifierOnlyKey");function kY({defaultPrevented:e,key:t,metaKey:s,ctrlKey:l,altKey:c,target:u,hasOpenDialog:p,hasSelection:f}){if(e||s||l||c||tp(t)||p||ko(u))return"ignore";switch(t){case"j":case"ArrowDown":return"next";case"k":case"ArrowUp":return"previous";case"Enter":return f?"toggle":"ignore";case"x":return f?"dismiss":"ignore";default:return"ignore"}}r(kY,"resolveAttentionQueueKeyAction");function SY({armed:e,defaultPrevented:t,key:s,metaKey:l,ctrlKey:c,altKey:u,target:p,hasOpenDialog:f}){return!e||t||l||c||u||tp(s)||f||ko(p)?"ignore":s.toLowerCase()==="y"?"archive":"ignore"}r(SY,"resolveInboxQuickArchiveKeyAction");function NY({hasUndoableArchive:e,defaultPrevented:t,key:s,metaKey:l,ctrlKey:c,altKey:u,target:p,hasOpenDialog:f}){return!e||t||l||c||u||tp(s)||f||ko(p)?"ignore":s==="u"?"undo_archive":"ignore"}r(NY,"resolveInboxUndoArchiveKeyAction");function L8({armed:e,defaultPrevented:t,key:s,metaKey:l,ctrlKey:c,altKey:u,target:p,hasOpenDialog:f}){if(t)return e?"disarm":"ignore";if(l||c||u||tp(s))return"ignore";if(f||ko(p))return e?"disarm":"ignore";const h=s.toLowerCase();return e?h==="i"?"navigate_inbox":h==="c"?"focus_comment":h==="f"?"open_file_viewer":h==="g"?"arm":"disarm":h==="g"?"arm":"ignore"}r(L8,"resolveIssueDetailGoKeyAction");function z8({onNewIssue:e,onSearch:t,onToggleSidebar:s,onTogglePanel:l,onShowShortcuts:c,onGoToInbox:u}){(0,x.useEffect)(()=>{let p=!1,f=null;const h=r(()=>{f!==null&&(window.clearTimeout(f),f=null)},"clearGoChordTimeout"),g=r(()=>{p=!1,h()},"disarmGoChord"),v=r(()=>{p=!0,h(),f=window.setTimeout(()=>{p=!1,f=null},1200)},"armGoChord");function y(S){if(S.defaultPrevented){g();return}if(u){const N=L8({armed:p,defaultPrevented:S.defaultPrevented,key:S.key,metaKey:S.metaKey,ctrlKey:S.ctrlKey,altKey:S.altKey,target:S.target,hasOpenDialog:Fg()});if(N==="arm"){v();return}if(N==="navigate_inbox"){g(),S.preventDefault(),u();return}if(N==="focus_comment"||N==="open_file_viewer"){g(),S.preventDefault();return}N==="disarm"&&g()}if(!ko(S.target)&&!Fg()){if(S.key==="/"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),M8()||t?.();return}if(S.key==="?"&&!S.metaKey&&!S.ctrlKey&&!S.altKey){S.preventDefault(),c?.();return}S.key==="c"&&!S.metaKey&&!S.ctrlKey&&!S.altKey&&(S.preventDefault(),e?.()),S.key==="["&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),s?.()),S.key==="]"&&!S.metaKey&&!S.ctrlKey&&(S.preventDefault(),l?.())}}r(y,"handleKeyDown");const j=r(()=>g(),"handlePointerDown"),k=r(S=>{S.target instanceof HTMLElement&&S.target!==document.body&&g()},"handleFocusIn");return document.addEventListener("pointerdown",j,!0),document.addEventListener("focusin",k,!0),document.addEventListener("keydown",y),()=>{g(),document.removeEventListener("pointerdown",j,!0),document.removeEventListener("focusin",k,!0),document.removeEventListener("keydown",y)}},[e,t,s,l,c,u])}r(z8,"useKeyboardShortcuts");var P8=new Set(["auth","invite","board-claim","cli-auth","docs","s"]);function CA(e){const t=(e.split("?")[0]??"").split("/").filter(Boolean);if(t.length===0)return!0;const[s]=t;return!P8.has(s)}r(CA,"isRememberableCompanyPath");function $8(e){const t=Vd(e.companyPrefix);return e.companies.find(s=>Vd(s.issuePrefix)===t)??null}r($8,"findCompanyByPrefix");function U8(e){const t=h1(e.pathname);return t?$8({companies:e.companies,companyPrefix:t})?.id??null:e.fallbackCompanyId}r(U8,"getRememberedPathOwnerCompanyId");function B8(e){const t=e.path?If(e.path):"/dashboard";if(!CA(t))return"/dashboard";const[s,l]=(t.split("?")[0]??"").split("/").filter(Boolean);if(s==="issues"&&l){const c=/^([A-Za-z]+)-\d+$/.exec(l);if(c&&Vd(c[1]??"")!==Vd(e.companyPrefix))return"/dashboard"}return t}r(B8,"sanitizeRememberedPathForCompany");var AA="wardmote.companyPaths";function _A(){try{const e=localStorage.getItem(AA);if(e)return JSON.parse(e)}catch{}return{}}r(_A,"getCompanyPaths");function K8(e,t){const s=_A();s[e]=t,localStorage.setItem(AA,JSON.stringify(s))}r(K8,"saveCompanyPath");function q8(){const{companies:e,selectedCompanyId:t,selectedCompany:s,selectionSource:l}=vt(),c=hn(),u=ja(),p=(0,x.useRef)(t),f=(0,x.useMemo)(()=>U8({companies:e,pathname:c.pathname,fallbackCompanyId:p.current}),[e,c.pathname]),h=c.pathname+c.search;(0,x.useEffect)(()=>{const g=f,v=If(h);g&&CA(v)&&K8(g,v)},[h,f]),(0,x.useEffect)(()=>{if(t){if(p.current!==null&&t!==p.current&&l!=="route_sync"&&s){const g=_A(),v=B8({path:g[t],companyPrefix:s.issuePrefix});u(`/${s.issuePrefix}${v}`,{replace:!0})}p.current=t}},[s,t,l,u])}r(q8,"useCompanyPageMemory");var F8=class{static{r(this,"MobileNavScrollTracker")}options;lastTop;lastMaxTop;visible=!0;direction=0;distance=0;constructor(e,t,s){this.options=e,this.lastTop=t,this.lastMaxTop=s}update(e,t){const s=Math.max(0,Math.min(e,t)),l=s-Math.max(this.lastTop,this.options.topZone),c=t!==this.lastMaxTop;if(this.lastTop=s,this.lastMaxTop=t,s<=this.options.topZone)this.visible=!0,this.direction=0,this.distance=0;else if(c)this.direction=0,this.distance=0;else if(l!==0){const u=Math.sign(l);u!==this.direction&&(this.distance=0),this.direction=u,this.distance+=Math.abs(l);const p=u>0?this.options.hideDistance:this.options.showDistance;this.distance>=p&&(this.visible=u<0,this.distance=0)}return this.visible}};function H8(e,t){const[s,l]=(0,x.useState)(!0);return(0,x.useEffect)(()=>{if(l(!0),!e)return;const c=getComputedStyle(document.documentElement),u=r(y=>Number.parseFloat(c.getPropertyValue(y))||0,"distance"),p=r(()=>{const y=document.scrollingElement??document.documentElement;return{top:window.scrollY||y.scrollTop||0,max:Math.max(0,y.scrollHeight-y.clientHeight)}},"scrollBounds"),f=p(),h=new F8({topZone:u("--mobile-nav-scroll-top-zone"),hideDistance:u("--mobile-nav-scroll-hide-distance"),showDistance:u("--mobile-nav-scroll-show-distance")},f.top,f.max);let g=null;const v=r(()=>{g===null&&(g=requestAnimationFrame(()=>{g=null;const{top:y,max:j}=p(),k=h.visible,S=h.update(y,j);S!==k&&l(S)}))},"onScroll");return window.addEventListener("scroll",v,{passive:!0}),()=>{window.removeEventListener("scroll",v),g!==null&&cancelAnimationFrame(g)}},[e,t]),s}r(H8,"useMobileNavVisibility");function V8(e){const{matchedCompany:t,selectedCompanyId:s,companies:l}=e;return!t||t.status!=="archived"||s===t.id?null:l.find(c=>c.id===s&&c.status!=="archived")??l.find(c=>c.status!=="archived")??null}r(V8,"resolveArchivedCompanyBounce");function CY(e){const{archivedCompanyId:t,companies:s}=e,l=s.find(c=>c.id!==t&&c.status!=="archived");return l?{kind:"company",company:l}:{kind:"companies_list"}}r(CY,"resolveCompanyArchiveDeparture");function W8(e){const{selectionSource:t,selectedCompanyId:s,routeCompanyId:l}=e;return!(s===l||t==="manual"&&s)}r(W8,"shouldSyncCompanySelectionFromRoute");function Q8(e,t){return e instanceof HTMLElement?!(t instanceof HTMLElement)||!document.contains(t)||t===document.body||t===document.documentElement?!0:!e.contains(t):!1}r(Q8,"shouldFocusMainContentAfterNavigation");function G8(e){if(!(e instanceof HTMLElement))return()=>{};const t=window.requestAnimationFrame(()=>{Q8(e,document.activeElement)&&e.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(t)}r(G8,"scheduleMainContentFocus");function Y8(e=document,t=window){const s=r(()=>{e.documentElement.scrollTop!==0&&(e.documentElement.scrollTop=0),e.body.scrollTop!==0&&(e.body.scrollTop=0)},"onScroll");return t.addEventListener("scroll",s,{capture:!0}),()=>t.removeEventListener("scroll",s,{capture:!0})}r(Y8,"pinDocumentScrollToZero");var X8=mE({NotFoundPage:r(()=>ur,"NotFoundPage")});function ur({scope:e="global",requestedPrefix:t}){const s=hn(),{setBreadcrumbs:l}=Z1(),{companies:c,selectedCompany:u}=vt();(0,x.useEffect)(()=>{l([{label:"Not Found"}])},[l]);const p=u??c[0]??null,f=p?`/${p.issuePrefix}/dashboard`:"/",h=`${s.pathname}${s.search}${s.hash}`,g=t?.toUpperCase(),v=e==="invalid_company_prefix"?"Organization not found":"Page not found",y=e==="invalid_company_prefix"?`No organization matches prefix "${g??"unknown"}".`:"This route does not exist.";return(0,a.jsx)("div",{className:"mx-auto max-w-2xl py-10",children:(0,a.jsxs)(Hc,{className:"block p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"rounded-md border border-bad/20 bg-bad/10 p-2",children:(0,a.jsx)(ni,{className:"h-5 w-5 text-bad"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:v}),(0,a.jsx)("p",{className:"text-sm text-ink-3",children:y})]})]}),(0,a.jsxs)("div",{className:"mt-4 rounded-md border border-line bg-bg-3/20 px-3 py-2 text-xs text-ink-3",children:["Requested path: ",(0,a.jsx)("code",{className:"font-mono",children:h})]}),(0,a.jsxs)("div",{className:"mt-5 flex flex-wrap gap-2",children:[(0,a.jsx)(oe,{asChild:!0,children:(0,a.jsxs)(mn,{to:f,children:[(0,a.jsx)(p1,{className:"mr-1.5 h-4 w-4"}),"Open dashboard"]})}),(0,a.jsx)(oe,{variant:"secondary",asChild:!0,children:(0,a.jsx)(mn,{to:"/",children:"Go home"})})]})]})})}r(ur,"NotFoundPage$1");function Z8(e,t){return VC(e,t)[0]?.toLowerCase()??null}r(Z8,"getCompanyRouteSegment");var J8=new Set(["browse","connections","assistant-connection","connect","chat","vercel-connect","review","attention","gateways","advanced","app"]);function e6(e){const t=(0,x.useRef)(null);return(0,x.useLayoutEffect)(()=>{const s=t.current,l=s?.parentElement;if(!e||!s||!l)return;const c=r(()=>l.style.setProperty("--mobile-topbar-h",`${s.offsetHeight}px`),"apply");if(c(),typeof ResizeObserver>"u")return()=>l.style.removeProperty("--mobile-topbar-h");const u=new ResizeObserver(c);return u.observe(s),()=>{u.disconnect(),l.style.removeProperty("--mobile-topbar-h")}},[e]),t}r(e6,"useMobileTopbarHeightVar");function t6({sidebarSections:e}){const{sidebarOpen:t,setSidebarOpen:s,toggleSidebar:l,collapsed:c,peeking:u,setPeeking:p,isMobile:f,isTablet:h}=Jn(),g=e6(f),{openNewIssue:v,openOnboarding:y}=$s(),{togglePanelVisible:j}=lx(),k=Of()?.pushToast??null,{companies:S,loading:N,selectedCompany:I,selectedCompanyId:C,selectionSource:M,setSelectedCompanyId:R}=vt(),{companyPrefix:_,pluginRoutePath:D,agentId:U,routineId:K}=zs(),z=ja(),E=hn(),B=ME(),O=U4(E.pathname,_),Q=O.builtInContextualSurface==="settings",V=O.companySegments,ue=O.isTaskDetail,{enabled:ce}=zf(),X=ce&&V[0]?.toLowerCase()==="chats",A=ue||X,ee=V[0]?.toLowerCase()==="tools",ie=V[0]?.toLowerCase()==="apps",le=ie&&V[1]&&!J8.has(V[1].toLowerCase())?V[1]:null,Ae=ie&&V[1]?.toLowerCase()==="app"&&V[2]?V[2]:null,de=(0,x.useRef)(!1),we=(0,x.useRef)(null),ye=(0,x.useRef)(null),Me=(0,x.useRef)(new $3),he=(0,x.useRef)(E.key),ve=H8(f&&!ue,E.pathname),[et,Pe]=(0,x.useState)(!1),Ee=(0,x.useMemo)(()=>{if(!_)return null;const _e=_.toUpperCase();return S.find(Re=>Re.issuePrefix.toUpperCase()===_e)??null},[S,_]),ct=!!_&&!N&&S.length>0&&!Ee,Ve=(0,x.useMemo)(()=>D?.toLowerCase()??Z8(E.pathname,_),[_,E.pathname,D]),yt=Ee?.id??null,Zt=Ee?.issuePrefix??null,{slots:ge}=qc({slotTypes:["page","routeSidebar"],companyId:yt,enabled:!!(yt&&Ve)}),Oe=(0,x.useMemo)(()=>oT(ge,Ve),[Ve,ge]),De=(0,x.useMemo)(()=>({companyId:yt,companyPrefix:Zt}),[yt,Zt]),ut=Q?(0,a.jsx)(F4,{}):le?(0,a.jsx)(ew,{kind:"connection",connectionId:le}):Ae?(0,a.jsx)(ew,{kind:"application",applicationId:Ae}):ie||ee?(0,a.jsx)(sz,{}):Oe?(0,a.jsx)(Xc,{surface:`plugin:${Oe.id}`,title:Oe.displayName,children:(0,a.jsx)(D0,{slot:Oe,context:De,className:"min-h-0 flex-1",missingBehavior:"placeholder"})}):null,Ht=X?(0,a.jsx)(e8,{}):O.builtInContextualSurface==="agent"&&U?(0,a.jsx)(pz,{agentRef:U}):O.builtInContextualSurface==="routine"&&K?(0,a.jsx)(R3,{children:(0,a.jsx)(xz,{routineId:K})}):O.builtInContextualSurface==="skills"?(0,a.jsx)(yz,{}):ut,Vt=Ht!=null,gt=Vt&&(X||O.builtInContextualSurface==="skills"||O.builtInContextualSurface==="agent"||O.builtInContextualSurface==="routine"||ie||ee),cn=Q&&(f||h),$=Vt&&!gt&&!(h&&Q),qe=gt,Xe=Vt?Oe&&!O.builtInContextualSurface?`plugin:${Oe.id}`:O.builtInContextualSurface:null,xt=(0,x.useRef)(null),{data:at}=me({queryKey:P.health,queryFn:r(()=>Fc.get(),"queryFn"),retry:!1,refetchInterval:r(_e=>_e.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,x.useEffect)(()=>{const _e=xt.current;Xe&&_&&_e&&_e.surface!==Xe&&_e.pathname!==E.pathname&&B4({surface:Xe,companyPrefix:_,previousPathname:_e.pathname}),xt.current={pathname:E.pathname,surface:Xe}},[_,Xe,E.pathname]),(0,x.useEffect)(()=>{N||de.current||at?.deploymentMode!=="authenticated"&&S.length===0&&(de.current=!0,y())},[S,N,y,at?.deploymentMode]),(0,x.useEffect)(()=>{if(!_||N||S.length===0)return;if(!Ee){const Re=(C?S.find(lt=>lt.id===C):null)??S[0]??null;Re&&C!==Re.id&&R(Re.id,{source:"route_sync"});return}if(_!==Ee.issuePrefix){const Re=E.pathname.replace(/^\/[^/]+/,"");z(`/${Ee.issuePrefix}${Re}${E.search}`,{replace:!0});return}const _e=V8({matchedCompany:Ee,selectedCompanyId:C,companies:S});if(_e){k?.({title:`${Ee.name} is archived`,body:`Switched to ${_e.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${Ee.id}`}),R(_e.id,{source:"route_sync"}),z(`/${_e.issuePrefix}/dashboard`,{replace:!0});return}W8({selectionSource:M,selectedCompanyId:C,routeCompanyId:Ee.id})&&R(Ee.id,{source:"route_sync"})},[_,S,N,Ee,E.pathname,E.search,z,k,M,C,R]);const Kt=j,ea=(0,x.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]),Jt=(0,x.useRef)(null),Mt=(0,x.useRef)(!1),Gt=(0,x.useRef)(!1),dt=(0,x.useCallback)(()=>{Jt.current!==null&&(window.clearTimeout(Jt.current),Jt.current=null)},[]),On=(0,x.useCallback)(()=>{dt(),Jt.current=window.setTimeout(()=>p(!0),50)},[dt,p]),mt=(0,x.useCallback)(()=>{dt(),p(!0)},[dt,p]),Nn=(0,x.useCallback)(()=>{dt(),Jt.current=window.setTimeout(()=>p(!1),120)},[dt,p]),It=(0,x.useCallback)(()=>{Mt.current=!0,c&&!Gt.current&&On()},[c,On]),en=(0,x.useCallback)(()=>{Mt.current=!1,Gt.current=!1,Nn()},[Nn]),qt=(0,x.useCallback)(()=>{Gt.current||mt()},[mt]),Tt=(0,x.useCallback)(()=>{Mt.current||Nn()},[Nn]);(0,x.useEffect)(()=>dt,[dt]);const At=(0,x.useRef)(c);return(0,x.useEffect)(()=>{c!==At.current&&(c?(dt(),p(!1),Gt.current=Mt.current):Gt.current=!1,At.current=c)},[c,dt,p]),(0,x.useEffect)(()=>{if(!u)return;const _e=r(Re=>{Re.key==="Escape"&&(dt(),p(!1))},"onKeyDown");return window.addEventListener("keydown",_e),()=>window.removeEventListener("keydown",_e)},[u,dt,p]),q8(),z8({onNewIssue:r(()=>v(),"onNewIssue"),onSearch:ea,onToggleSidebar:l,onTogglePanel:Kt,onShowShortcuts:r(()=>Pe(!0),"onShowShortcuts"),onGoToInbox:r(()=>z("/inbox"),"onGoToInbox")}),(0,x.useEffect)(()=>{if(!f)return;const _e=30,Re=50,lt=75;let Dt=0,Le=0;const Ot=r(Lt=>{const tn=Lt.touches[0];Dt=tn.clientX,Le=tn.clientY},"onTouchStart"),Rt=r(Lt=>{const tn=Lt.changedTouches[0],Wt=tn.clientX-Dt;if(!(Math.abs(tn.clientY-Le)>lt)){if(!t&&Dt<_e&&Wt>Re){s(!0);return}t&&Wt<-50&&s(!1)}},"onTouchEnd");return document.addEventListener("touchstart",Ot,{passive:!0}),document.addEventListener("touchend",Rt,{passive:!0}),()=>{document.removeEventListener("touchstart",Ot),document.removeEventListener("touchend",Rt)}},[f,t,s]),(0,x.useEffect)(()=>{const _e=document.body.style.overflow;return document.body.style.overflow=f?"visible":"clip",()=>{document.body.style.overflow=_e}},[f]),(0,x.useEffect)(()=>{if(!f)return Y8()},[f]),(0,x.useEffect)(()=>{if(typeof document>"u")return;const _e=ye.current;return G8(_e)},[E.pathname]),(0,x.useEffect)(()=>{const _e=ye.current;if(!_e)return;const Re=r(()=>{Me.current.remember(he.current,_e.scrollTop)},"recordScroll");return _e.addEventListener("scroll",Re,{passive:!0}),()=>_e.removeEventListener("scroll",Re)},[]),(0,x.useLayoutEffect)(()=>{const _e=ye.current,Re=P3({previousPathname:we.current,pathname:E.pathname,navigationType:B,state:E.state});we.current=E.pathname;const lt=B==="POP",Dt=lt?Me.current.recall(E.key):0;if(he.current=E.key,lt){Fy(_e,Dt);const Le=requestAnimationFrame(()=>Fy(_e,Dt));return()=>cancelAnimationFrame(Le)}Re&&B3(_e)},[E.key,E.pathname,E.state,B]),(0,a.jsx)(T3,{children:(0,a.jsxs)("div",{"data-app-shell":"",className:Y("bg-bg text-ink pt-(--sz-safe-top)",f?"min-h-dvh overflow-x-clip":"flex h-dvh flex-col overflow-clip"),children:[(0,a.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:z-(--z-200) focus:rounded-md focus:bg-bg focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:"Skip to Main Content"}),(0,a.jsx)($U,{}),(0,a.jsx)(mU,{}),(0,a.jsx)(bU,{devServer:at?.devServer}),(0,a.jsx)(yU,{diskSpace:at?.diskSpace,warnings:at?.warnings}),(0,a.jsx)(AU,{}),(0,a.jsx)(MU,{}),(0,a.jsxs)("div",{className:Y("min-h-0 flex-1",f?"w-full":"flex overflow-clip"),children:[f&&t&&(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-40 bg-black/50",onClick:r(()=>s(!1),"onClick"),"aria-label":"Close sidebar"}),f?(0,a.jsxs)("div",{className:Y("fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden pt-(--sz-safe-top) transition-transform duration-100 ease-out",t?"translate-x-0":"-translate-x-full"),children:[(0,a.jsx)("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:(0,a.jsx)("div",{className:"w-60 shrink-0 overflow-hidden",children:Vt?(0,a.jsx)(wd,{children:Ht}):(0,a.jsx)(Zj,{children:e})})}),(0,a.jsx)(Bw,{deploymentMode:at?.deploymentMode,forceExpanded:$})]}):(0,a.jsxs)(t8,{open:t,collapsed:$?!1:c,peeking:$?!1:u,resizable:!0,onPanelMouseEnter:$?void 0:It,onPanelMouseLeave:$?void 0:en,onPanelFocusCapture:!$&&c?qt:void 0,onPanelBlurCapture:!$&&c?Tt:void 0,children:[(0,a.jsx)("div",{className:"flex flex-1 min-h-0",children:$?(0,a.jsx)(wd,{children:Ht}):(0,a.jsx)(Zj,{children:e})}),(0,a.jsx)(Bw,{deploymentMode:at?.deploymentMode,forceExpanded:$})]}),!f&&qe&&!gt?(0,a.jsx)(wd,{className:"w-60 shrink-0",children:Ht}):null,(0,a.jsxs)("div",{className:Y("flex min-w-0 flex-col",f?"w-full":"h-full flex-1"),children:[(0,a.jsxs)("div",{ref:g,"data-slot":f?"mobile-topbar":void 0,className:Y(!f&&A&&"hidden",f&&"sticky top-0 z-20 bg-bg/95 backdrop-blur supports-[backdrop-filter]:bg-bg/85"),children:[(0,a.jsx)(Dw,{mobile:f,onNavigateHome:r(()=>z("/dashboard"),"onNavigateHome")}),(0,a.jsx)(aw,{}),cn?(0,a.jsx)("div",{className:"border-b border-line px-4 pb-3",children:(0,a.jsx)(G4,{})}):null]}),(0,a.jsxs)("div",{className:Y(f?"block":"relative flex flex-1 min-h-0",!f&&A&&"streamlined-task-detail-surface"),children:[!f&&gt?(0,a.jsx)(wd,{className:"w-60 shrink-0 bg-bg",children:Ht}):null,(0,a.jsxs)("div",{className:Y(!f&&A?"flex min-w-0 flex-1 flex-col":"contents"),children:[!f&&A?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Dw,{mobile:!1,onNavigateHome:r(()=>z("/dashboard"),"onNavigateHome")}),(0,a.jsx)(aw,{taskDetailLayout:!0})]}):null,(0,a.jsx)("main",{id:"main-content",ref:ye,tabIndex:-1,style:f?{"--tc-composer-bottom":"var(--sz-calc-14)"}:void 0,className:Y("flex-1 p-4 outline-none md:p-6",!f&&A&&"pt-0 md:pt-0",f?"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:ct?(0,a.jsx)(ur,{scope:"invalid_company_prefix",requestedPrefix:_??I?.issuePrefix}):(0,a.jsx)(QU,{children:(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:(0,a.jsx)(xo,{})})})})]}),(0,a.jsx)($z,{taskDetailLayout:!f&&A})]})]})]}),f&&(0,a.jsx)(uU,{visible:ve}),(0,a.jsx)(AP,{}),(0,a.jsx)(A$,{}),(0,a.jsx)(E$,{}),(0,a.jsx)(M$,{}),(0,a.jsx)(q$,{}),(0,a.jsx)(W$,{open:et,onOpenChange:Pe}),(0,a.jsx)(X$,{}),(0,a.jsx)(sU,{health:at}),(0,a.jsx)(cU,{localTrusted:at?.deploymentMode==="local_trusted"})]})})}r(t6,"Layout");var Kw=null;function n6(){return Kw??=new Af,Kw}r(n6,"getDetachedClient");function a6(){const e=(0,x.useContext)(v0),{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn"),enabled:e!=null},e??n6());return e?{enabled:t?.enableConferenceRoomChat===!0,loaded:s}:{enabled:!1,loaded:!0}}r(a6,"useConferenceRoomChatEnabled");function s6(){const{enabled:e,loaded:t}=a6();return t?e?(0,a.jsx)(xo,{}):(0,a.jsx)(We,{to:"/dashboard",replace:!0}):null}r(s6,"ConferenceRoomChatGate");function nr({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enablePipelines!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(nr,"PipelinesExperimentalGate");function qw({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enableCases!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(qw,"CasesExperimentalGate");function Fw({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enableStatusCards!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(Fw,"StatusCardsExperimentalGate");function i6({children:e}){const{data:t,isFetched:s}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return s?t?.enablePixelsOffice!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(i6,"PixelsOfficeExperimentalGate");function _s({pageKey:e}){const{hidden:t,loaded:s}=hr();return s?t.has(e)?(0,a.jsx)(We,{to:"/company/settings",replace:!0}):(0,a.jsx)(xo,{}):null}r(_s,"HiddenSettingsPageGate");function Ih(){const{data:e,isFetched:t}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn")});return t?e?.enableIsolatedWorkspaces!==!0?(0,a.jsx)(We,{to:"/dashboard",replace:!0}):(0,a.jsx)(xo,{}):null}r(Ih,"IsolatedWorkspacesRouteGate");function Vl(){const e=hn(),{workspaceId:t}=zs(),{companies:s,loading:l}=vt(),c=me({queryKey:P.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Jf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t)return(0,a.jsx)(ur,{scope:"global"});if(l||c.isPending)return(0,a.jsx)(Ms,{});if(c.isError)return(0,a.jsx)(ur,{scope:"global"});const u=s.find(p=>p.id===c.data.companyId);return u?(0,a.jsx)(We,{to:`/${u.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):(0,a.jsx)(ur,{scope:"global"})}r(Vl,"UnprefixedExecutionWorkspaceRedirect");function r6(){const{companyPrefix:e,workspaceId:t}=zs(),{companies:s,loading:l}=vt(),c=me({queryKey:P.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Jf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t||!e)return(0,a.jsx)(ur,{scope:"global"});if(l||c.isPending)return(0,a.jsx)(Ms,{});if(c.isError)return(0,a.jsx)(ur,{scope:"global"});const u=s.find(p=>p.issuePrefix.toUpperCase()===e.toUpperCase());return!u||u.id!==c.data.companyId?(0,a.jsx)(ur,{scope:"global"}):(0,a.jsx)(xo,{})}r(r6,"ExecutionWorkspaceCompanyGate");var ya={status:r((e={})=>{const t=new URLSearchParams;e.command&&t.set("command",e.command),e.network&&t.set("network","1");const s=t.toString();return je.get(`/onboarding/omp${s?`?${s}`:""}`)},"status"),browse:r(e=>je.get(`/onboarding/omp/browse${e?`?path=${encodeURIComponent(e)}`:""}`),"browse"),loginProviders:r((e=!1)=>je.get(`/onboarding/omp/login/providers${e?"?refresh=1":""}`),"loginProviders"),startLogin:r(e=>je.post("/onboarding/omp/login",{provider:e}),"startLogin"),login:r(e=>je.get(`/onboarding/omp/login/${encodeURIComponent(e)}`),"login"),answerLogin:r((e,t)=>je.post(`/onboarding/omp/login/${encodeURIComponent(e)}/input`,{value:t}),"answerLogin"),cancelLogin:r(e=>je.delete(`/onboarding/omp/login/${encodeURIComponent(e)}`),"cancelLogin"),customProviders:r(()=>je.get("/onboarding/omp/custom-providers"),"customProviders"),saveCustomProvider:r((e,t)=>je.put(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`,t),"saveCustomProvider"),removeCustomProvider:r(e=>je.delete(`/onboarding/omp/custom-providers/${encodeURIComponent(e)}`),"removeCustomProvider"),fetchCustomProviderModels:r(e=>je.post("/onboarding/omp/custom-providers/models",e),"fetchCustomProviderModels"),probeCustomProvider:r(e=>je.post("/onboarding/omp/custom-providers/probe",e),"probeCustomProvider"),remote:r(e=>je.post("/onboarding/omp/remote",{address:e}),"remote")};function l6(e){return{heartbeat:{enabled:e?.heartbeatEnabled??Uy.heartbeatEnabled,intervalSec:e?.intervalSec??Uy.intervalSec,wakeOnDemand:!0,skipTimerWhenNoActionableWork:!0,cooldownSec:10,maxConcurrentRuns:20}}}r(l6,"buildNewAgentRuntimeConfig");var o6="input:not([type=hidden]):not(:disabled), select:not(:disabled), textarea:not(:disabled)",c6="Discard your unsaved changes?",u6=2/3;function d6(e,t){const[s,l]=(0,x.useState)(null),c=(0,x.useRef)(!1),u=(0,x.useRef)(new Map),p=(0,x.useRef)(e);p.current=e;const f=(0,x.useRef)(s);f.current=s;const h=(0,x.useId)(),g=s===null?null:e(s),v=(0,x.useCallback)(M=>`${h}-row-editor-${M.replace(/\s+/g,"_")}`,[h]),y=r(()=>!c.current||window.confirm(c6),"mayDiscard"),j=(0,x.useCallback)((M=!0)=>{const R=f.current;if(c.current=!1,l(null),R===null||!M)return;const _=p.current(R);requestAnimationFrame(()=>{const D=u.current.get(_);(D?.isConnected?D:t?.current)?.focus()})},[t]),k=r(M=>g===e(M)?!0:g!==null&&!y()?!1:(c.current=!1,l(M),!0),"request"),S=r(M=>{if(g!==e(M)){k(M);return}y()&&j()},"toggle"),N=r(()=>{y()&&j()},"dismiss"),I=(0,x.useCallback)(M=>{c.current=M},[]);return{open:s,openKey:g,request:k,toggle:S,close:j,dismiss:N,setDirty:I,triggerProps:r(M=>({ref:r(R=>{R?u.current.set(M,R):u.current.delete(M)},"ref"),"aria-expanded":g===M,"aria-controls":g===M?v(M):void 0}),"triggerProps"),panelId:v}}r(d6,"useInlineRowEditor");function Hw({id:e,onEscape:t,className:s,children:l}){const c=(0,x.useRef)(null);(0,x.useEffect)(()=>{const p=c.current;if(!p)return;p.querySelector(o6)?.focus({preventScroll:!0});const f=p.getBoundingClientRect().top;if(f>=0&&f<=window.innerHeight*u6)return;const h=p.parentElement?.tagName==="LI"?p.previousElementSibling:null;h?h.scrollIntoView?.({block:"center"}):p.scrollIntoView?.({block:"start"})},[]);const u=r(p=>{p.key!=="Escape"||p.defaultPrevented||(p.preventDefault(),p.stopPropagation(),t())},"onKeyDown");return(0,a.jsx)("div",{ref:c,id:e,className:Y("scroll-mt-16",s),onKeyDown:u,children:l})}r(Hw,"InlineRowEditorPanel");var f6=2e3,Vw=["omp","login-providers"];function Th(e){return e instanceof Error?e.message:"Something went wrong"}r(Th,"errorText");function Ia({tone:e,children:t}){return(0,a.jsx)("div",{role:e==="bad"?"alert":"status",className:Y("rounded-md border px-3 py-2 text-sm",e==="bad"?"border-bad text-ink":e==="ok"?"border-ok text-ink":"border-line text-ink-2"),children:t})}r(Ia,"OmpNote");function p6({onSignedIn:e,autoFocus:t=!1}){const s=kn(),l=me({queryKey:Vw,queryFn:r(()=>ya.loginProviders(),"queryFn"),staleTime:6e5}),[c,u]=(0,x.useState)(""),[p,f]=(0,x.useState)(null),[h,g]=(0,x.useState)(""),v=c||l.data?.providers[0]||"",y=Bt({mutationFn:r(_=>ya.startLogin(_.name),"mutationFn"),onSuccess:r((_,{popup:D})=>{g(""),f(_),D&&_.url&&_.state==="waiting"?D.location.href=_.url:D?.close()},"onSuccess"),onError:r((_,{popup:D})=>D?.close(),"onError")}),j=Bt({mutationFn:r(_=>ya.answerLogin(p.id,_),"mutationFn"),onSuccess:r(_=>{g(""),f(_)},"onSuccess")}),k=Bt({mutationFn:r(_=>ya.cancelLogin(_),"mutationFn"),onSettled:r(()=>f(null),"onSettled")}),S=p?.state==="waiting",N=me({queryKey:["omp","login",p?.id??""],queryFn:r(()=>ya.login(p.id),"queryFn"),enabled:S,refetchInterval:f6});(0,x.useEffect)(()=>{N.data&&N.data.id===p?.id&&f(N.data)},[N.data,p?.id]);const I=(0,x.useRef)(null),C=(0,x.useRef)(e);C.current=e;const M=p?.state==="succeeded"?p.id:null;(0,x.useEffect)(()=>{!M||I.current===M||(I.current=M,s.invalidateQueries({queryKey:["agents"]}),C.current?.())},[M,s]);function R(_){_.preventDefault(),h.trim()&&j.mutate(h.trim())}return r(R,"submitAnswer"),l.isLoading?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Asking OMP which providers it can sign in to..."}):l.error?(0,a.jsxs)(Ia,{tone:"bad",children:[Th(l.error)," ",(0,a.jsx)(oe,{type:"button",variant:"link",size:"xs",onClick:r(()=>{l.refetch()},"onClick"),children:"Try again"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[!p||!S?(0,a.jsxs)("form",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",onSubmit:r(_=>{_.preventDefault(),v&&y.mutate({name:v,popup:window.open("about:blank","_blank")})},"onSubmit"),children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:["Provider",(0,a.jsx)(hg,{value:v,onChange:r(_=>u(_.target.value),"onChange"),autoFocus:t,className:"w-full",children:l.data?.providers.map(_=>(0,a.jsx)("option",{value:_,children:_},_))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(oe,{type:"submit",disabled:!v||y.isPending,className:"flex-1 sm:flex-none",children:y.isPending?"Starting...":"Sign in"}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon","aria-label":"Reload provider list",title:"Reload provider list",onClick:r(()=>{ya.loginProviders(!0).then(_=>s.setQueryData(Vw,_))},"onClick"),children:(0,a.jsx)(nl,{"aria-hidden":"true"})})]})]}):null,y.error?(0,a.jsx)(Ia,{tone:"bad",children:Th(y.error)}):null,p?(0,a.jsxs)("section",{"aria-label":`Sign-in to ${p.provider}`,className:"flex flex-col gap-3 rounded-lg border border-line bg-bg-2 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("b",{className:"text-sm font-semibold",children:p.provider}),S?(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"xs",disabled:k.isPending,onClick:r(()=>k.mutate(p.id),"onClick"),children:"Cancel"}):null]}),S&&p.url?(0,a.jsxs)("ol",{className:"flex list-decimal flex-col gap-1.5 ps-5 text-sm text-ink-2",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("a",{href:p.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-medium text-accent underline underline-offset-4",children:["Open the sign-in page ",(0,a.jsx)($1,{"aria-hidden":"true",className:"size-3.5"})]})," ","(already opened in a new tab unless the browser blocked it) and approve access."]}),p.prompt&&!p.prompt.secret?(0,a.jsx)("li",{children:"If the page ends on an address that does not load (it starts with http://localhost), copy that whole address from the browser bar and paste it below. On the machine that runs Wardmote this step finishes by itself."}):(0,a.jsx)("li",{children:"Enter the code OMP shows below if the page asks for one. This panel moves on by itself once you approve."})]}):null,S&&p.prompt?(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,a.jsxs)("label",{className:"flex min-w-0 flex-1 flex-col gap-1.5 text-sm font-medium",children:[p.prompt.label.replace(/:$/,""),(0,a.jsx)(Wn,{value:h,onChange:r(_=>g(_.target.value),"onChange"),type:p.prompt.secret?"password":"text",autoComplete:"off",spellCheck:!1,autoFocus:!p.url})]}),(0,a.jsx)(oe,{type:"submit",disabled:!h.trim()||j.isPending,children:j.isPending?"Sending...":"Send"})]}):null,S&&!p.prompt&&!p.url?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Waiting for OMP..."}):null,S&&p.message?(0,a.jsx)(Ia,{tone:"bad",children:p.message}):null,j.error?(0,a.jsx)(Ia,{tone:"bad",children:Th(j.error)}):null,p.state==="succeeded"?(0,a.jsxs)(Ia,{tone:"ok",children:[p.message??"Signed in",". Models from this provider are ready."]}):null,p.state==="failed"?(0,a.jsxs)(Ia,{tone:"bad",children:[p.message??"Sign-in failed",". Check the account on the provider's page, then press Sign in again."]}):null,S&&!p.prompt&&p.lines.length?(0,a.jsx)("pre",{"aria-label":"OMP output",className:"max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-bg-3 px-3 py-2 font-mono text-xs text-ink-2",children:p.lines.join(`
55
55
  `)}):null,(!S||p.prompt)&&p.lines.length?(0,a.jsxs)("details",{className:"text-xs text-ink-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer select-none",children:"What OMP printed"}),(0,a.jsx)("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all rounded-md bg-bg-3 px-3 py-2 font-mono",children:p.lines.join(`
56
56
  `)})]}):null]}):null]})}r(p6,"OmpSignIn");var Rh=500,Mh=10,m6=(0,x.memo)(r(function({result:t,savedIds:s,room:l,onAdd:c}){const[u,p]=(0,x.useState)(""),[f,h]=(0,x.useState)(()=>new Set),g=(0,x.useMemo)(()=>t.models.filter(I=>!s.has(I.id)),[t.models,s]),v=(0,x.useMemo)(()=>{if(t.truncated)return[];const I=new Set(t.models.map(C=>C.id));return[...s].filter(C=>!I.has(C))},[t.models,t.truncated,s]),y=(0,x.useMemo)(()=>{const I=u.trim().toLowerCase();return I?t.models.filter(C=>C.id.toLowerCase().includes(I)||C.name?.toLowerCase().includes(I)):t.models},[u,t.models]),j=g.filter(I=>f.has(I.id));function k(I,C){h(M=>{const R=new Set(M);return C?R.add(I):R.delete(I),R})}r(k,"toggle");function S(I){c(I),h(new Set)}r(S,"add");const N=r(I=>I>l,"overLimit");return(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-md border border-line-soft p-3","aria-label":"Upstream models",children:[(0,a.jsxs)("p",{className:"text-sm",children:[t.url," lists ",t.models.length," ",t.models.length===1?"model":"models",t.truncated?" (more exist; only these were read)":"",": ",g.length," new, ",t.models.length-g.length," already added."]}),v.length?(0,a.jsxs)(Ia,{tone:"info",children:[v.length," saved ",v.length===1?"model is":"models are"," not listed upstream and ",v.length===1?"stays":"stay"," until you remove ",v.length===1?"it":"them",": ",v.slice(0,Mh).join(", "),v.length>Mh?`, and ${v.length-Mh} more`:"","."]}):null,(0,a.jsx)(Wn,{value:u,onChange:r(I=>p(I.target.value),"onChange"),placeholder:"Search upstream models","aria-label":"Search upstream models",autoComplete:"off"}),(0,a.jsxs)("ul",{className:"flex max-h-72 flex-col overflow-y-auto rounded-md border border-line-soft",children:[y.slice(0,Rh).map(I=>{const C=s.has(I.id);return(0,a.jsx)("li",{className:"border-b border-line-soft last:border-b-0",children:(0,a.jsxs)("label",{className:"flex items-center gap-2 px-2 py-1.5 text-sm",children:[(0,a.jsx)("input",{type:"checkbox",checked:C||f.has(I.id),disabled:C,onChange:r(M=>k(I.id,M.target.checked),"onChange"),"aria-label":I.id}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:I.id}),I.name?(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:I.name}):null,C?(0,a.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:"Added"}):null]})},I.id)}),y.length===0?(0,a.jsx)("li",{className:"px-2 py-1.5 text-sm text-ink-3",children:"No upstream model matches."}):null]}),y.length>Rh?(0,a.jsxs)("span",{className:"text-xs text-ink-3",children:["Showing ",Rh," of ",y.length,"; search to narrow the list."]}):null,(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(oe,{type:"button",size:"sm",disabled:j.length===0||N(j.length),onClick:r(()=>S(j),"onClick"),children:["Add selected",j.length?` (${j.length})`:""]}),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",disabled:g.length===0||N(g.length),onClick:r(()=>S(g),"onClick"),children:["Add all",g.length?` (${g.length})`:""]}),N(Math.max(j.length,g.length))?(0,a.jsxs)("span",{className:"text-xs text-ink-3",children:["Only ",l," more ",l===1?"model fits":"models fit","; a provider holds at most ",500,"."]}):null]})]})},"UpstreamModelPicker")),Dh=["omp","custom-providers"],h6={"openai-responses":"OpenAI Responses (/responses): most OpenAI-compatible gateways","openai-completions":"OpenAI Chat Completions (/chat/completions): vLLM, LiteLLM, Ollama, llama.cpp","anthropic-messages":"Anthropic Messages (/messages)","openai-codex-responses":"ChatGPT Codex backend: only with a ChatGPT sign-in token","google-generative-ai":"Google Gemini API","google-vertex":"Google Vertex AI","google-gemini-cli":"Gemini CLI backend","azure-openai-responses":"Azure OpenAI Responses","bedrock-converse-stream":"AWS Bedrock Converse"},g6={"openai-models-list":"OpenAI /models list",proxy:"Proxy (models from the gateway)",litellm:"LiteLLM",ollama:"Ollama","llama.cpp":"llama.cpp","lm-studio":"LM Studio","apple-foundation-models":"Apple Foundation Models"},$d={id:"",name:"",api:"",contextWindow:"",maxTokens:"",reasoning:!1,images:!1};function x6(e){return e?{name:e.name,baseUrl:e.baseUrl??"",api:e.api??"",keyMode:e.apiKey.kind==="none"?"none":e.apiKey.kind==="missing"?"literal":"keep",keyValue:"",authHeader:e.authHeader,disableStrictTools:e.disableStrictTools,discovery:e.discovery?.type??"",discoveryTimeout:e.discovery?.timeoutMs?String(e.discovery.timeoutMs):"",injectV1:e.discovery?.injectV1??!1,headers:e.headers.map(t=>({name:t.name,value:"",saved:!0})),models:e.models.map(t=>({id:t.id,name:t.name??"",api:t.api??"",contextWindow:t.contextWindow?String(t.contextWindow):"",maxTokens:t.maxTokens?String(t.maxTokens):"",reasoning:t.reasoning??!1,images:t.images??!1}))}:{name:"",baseUrl:"",api:"openai-responses",keyMode:"literal",keyValue:"",authHeader:!1,disableStrictTools:!1,discovery:"",discoveryTimeout:"",injectV1:!1,headers:[],models:[{...$d}]}}r(x6,"initialState");function Hg(e){switch(e.keyMode){case"keep":return{kind:"keep"};case"none":return{kind:"none"};case"env":return{kind:"env",name:e.keyValue.trim()};case"command":return{kind:"command",command:e.keyValue.trim()};default:return{kind:"literal",value:e.keyValue.trim()}}}r(Hg,"keyInput");function Wl(e){const t=Number(e.replace(/[_,\s]/g,""));return e.trim()&&Number.isInteger(t)&&t>0?t:void 0}r(Wl,"positive");function Vg(e){return e.headers.filter(t=>t.name.trim()).map(t=>t.saved&&!t.value?{name:t.name.trim()}:{name:t.name.trim(),value:t.value})}r(Vg,"headersInput");function b6(e){return{baseUrl:e.baseUrl.trim(),api:e.api||null,apiKey:Hg(e),authHeader:e.authHeader,disableStrictTools:e.disableStrictTools,headers:Vg(e),discovery:e.discovery?{type:e.discovery,...Wl(e.discoveryTimeout)?{timeoutMs:Wl(e.discoveryTimeout)}:{},...e.discovery==="openai-models-list"&&e.injectV1?{injectV1:!0}:{}}:null,models:e.models.filter(t=>t.id.trim()).map(t=>({id:t.id.trim(),...t.name.trim()?{name:t.name.trim()}:{},...t.api?{api:t.api}:{},...Wl(t.contextWindow)?{contextWindow:Wl(t.contextWindow)}:{},...Wl(t.maxTokens)?{maxTokens:Wl(t.maxTokens)}:{},...t.reasoning?{reasoning:!0}:{},...t.images?{images:!0}:{}}))}}r(b6,"toInput");function wc(e){if(e instanceof Ii){const t=e.body?.details;if(Array.isArray(t)){const s=t.map(l=>typeof l?.message=="string"?`${Array.isArray(l.path)?`${l.path.join(".")}: `:""}${l.message}`:null).filter(l=>!!l);if(s.length)return s}return[e.message]}return[e instanceof Error?e.message:"Something went wrong"]}r(wc,"problemsOf");function dc({label:e,hint:t,children:s}){return(0,a.jsxs)("label",{className:"flex min-w-0 flex-col gap-1.5 text-sm font-medium",children:[e,s,t?(0,a.jsx)("span",{className:"text-xs font-normal text-ink-3",children:t}):null]})}r(dc,"Field");function Oh({label:e,hint:t,checked:s,onChange:l}){return(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("span",{className:"flex flex-col gap-0.5 text-sm",children:[(0,a.jsx)("span",{className:"font-medium",children:e}),(0,a.jsx)("span",{className:"text-xs text-ink-3",children:t})]}),(0,a.jsx)(aS,{checked:s,onCheckedChange:l,"aria-label":e})]})}r(Oh,"Toggle");function Ww({provider:e,takenNames:t,onSaved:s,onCancel:l,onDirtyChange:c}){const[u]=(0,x.useState)(()=>x6(e)),[p,f]=(0,x.useState)(u),h=JSON.stringify(p)!==JSON.stringify(u);(0,x.useEffect)(()=>c?.(h),[h,c]);const[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),k=r(O=>f(Q=>({...Q,...O})),"set"),S=r((O,Q)=>f(V=>({...V,models:V.models.map((ue,ce)=>ce===O?{...ue,...Q}:ue)})),"setModel"),N=r((O,Q)=>f(V=>({...V,headers:V.headers.map((ue,ce)=>ce===O?{...ue,...Q}:ue)})),"setHeader"),I=e!==null,C=!I&&p.name&&!hE.test(p.name)?"Use letters, digits, dot, dash or underscore":!I&&t.includes(p.name)?"A provider with this name already exists; edit it instead":null,M=Bt({mutationFn:r(()=>ya.saveCustomProvider(p.name.trim(),b6(p)),"mutationFn"),onSuccess:s}),R=Bt({mutationFn:r(()=>ya.probeCustomProvider({...I?{name:e.name}:{},baseUrl:p.baseUrl.trim(),apiKey:Hg(p),authHeader:p.authHeader,headers:Vg(p),...p.models[0]?.id.trim()?{modelId:p.models[0].id.trim()}:{}}),"mutationFn"),onSuccess:r(O=>{v(O),f(Q=>({...Q,api:O.suggestedApi??Q.api,models:Q.models.some(V=>V.id.trim())||!O.usedModel?Q.models:[{...$d,id:O.usedModel}]}))},"onSuccess"),onError:r(()=>v(null),"onError")}),_=Bt({mutationFn:r(()=>ya.fetchCustomProviderModels({...I?{name:e.name}:{},baseUrl:p.baseUrl.trim(),api:p.api||null,apiKey:Hg(p),authHeader:p.authHeader,headers:Vg(p)}),"mutationFn"),onSuccess:j,onError:r(()=>j(null),"onError")}),D=p.models.map(O=>O.id.trim()).filter(Boolean).join(`
57
57
  `),U=(0,x.useMemo)(()=>new Set(D?D.split(`
58
- `):[]),[D]),K=(0,x.useMemo)(()=>y&&!y.error&&!y.truncated?new Set(y.models.map(O=>O.id)):null,[y]),z=(0,x.useCallback)(O=>{f(Q=>{const V=Q.models.filter(X=>X.id.trim()),ue=new Set(V.map(X=>X.id.trim())),ce=O.filter(X=>!ue.has(X.id)).map(X=>({...$d,id:X.id,name:X.name??""}));return{...Q,models:[...V,...ce]}})},[]);function E(O){O.preventDefault(),C||M.mutate()}r(E,"submit");const B=[...I&&e.apiKey.kind!=="none"&&e.apiKey.kind!=="missing"?[{mode:"keep",label:"Keep saved"}]:[],{mode:"literal",label:"Key"},{mode:"env",label:"Env variable"},{mode:"command",label:"Command"},{mode:"none",label:"No key"}];return(0,a.jsxs)("form",{onSubmit:E,"aria-label":I?`Edit ${e.name}`:"Add a custom provider",className:"flex flex-col gap-4 rounded-lg border border-line bg-bg-2 px-4 py-4 sm:px-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:I?`Edit ${e.name}`:"Add a custom provider"}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:(0,a.jsx)(ia,{"aria-hidden":"true"})})]}),I&&e.otherKeys.length?(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Also kept as written in models.yml: ",e.otherKeys.join(", "),"."]}):null,(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(dc,{label:"Name",hint:C??"Used in model ids, e.g. my-gateway/model",children:(0,a.jsx)(Wn,{value:p.name,onChange:r(O=>k({name:O.target.value}),"onChange"),disabled:I,required:!0,"aria-invalid":!!C,placeholder:"my-gateway",autoComplete:"off"})}),(0,a.jsx)(dc,{label:"Base URL",hint:"Usually ends in /v1",children:(0,a.jsx)(Wn,{value:p.baseUrl,onChange:r(O=>k({baseUrl:O.target.value}),"onChange"),required:!0,type:"url",placeholder:"http://localhost:8000/v1",autoComplete:"off"})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"API key"}),(0,a.jsx)(HT,{"aria-label":"Where the key comes from",className:"flex-wrap self-start",children:B.map(({mode:O,label:Q})=>(0,a.jsx)(FT,{selected:p.keyMode===O,onClick:r(()=>k({keyMode:O,keyValue:""}),"onClick"),children:Q},O))}),p.keyMode==="literal"?(0,a.jsx)(Wn,{value:p.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),type:"password",autoComplete:"off",required:!0,"aria-label":"API key",placeholder:"sk-..."}):p.keyMode==="env"?(0,a.jsx)(Wn,{value:p.keyValue,onChange:r(O=>k({keyValue:O.target.value.toUpperCase()}),"onChange"),required:!0,"aria-label":"Environment variable name",placeholder:"MY_GATEWAY_KEY",autoComplete:"off"}):p.keyMode==="command"?(0,a.jsx)(Wn,{value:p.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),required:!0,"aria-label":"Command that prints the key",placeholder:"op read op://vault/gateway/key",autoComplete:"off",className:"font-mono"}):null,(0,a.jsx)("span",{className:"text-xs text-ink-3",children:p.keyMode==="keep"?`The saved ${e?.apiKey.kind==="env"?`variable ${e.apiKey.name}`:e?.apiKey.kind==="command"?"command":"key"} stays as it is.`:p.keyMode==="env"?"OMP reads the key from this variable on the machine that runs agents.":p.keyMode==="command"?"OMP runs this command and uses what it prints.":p.keyMode==="none"?"For local servers that need no key.":"Saved in OMP's models.yml. Wardmote never shows it again."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(dc,{label:"Wire format (api)",hint:"Picking the wrong one is the most common mistake. Test connection suggests the right one.",children:(0,a.jsxs)(hg,{value:p.api,onChange:r(O=>k({api:O.target.value}),"onChange"),className:"w-full",children:[(0,a.jsx)("option",{value:"",children:"Set per model"}),_E.map(O=>(0,a.jsx)("option",{value:O,children:h6[O]??O},O))]})}),(0,a.jsx)(oe,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!p.baseUrl.trim()||R.isPending,onClick:r(()=>R.mutate(),"onClick"),children:R.isPending?"Testing...":"Test connection"}),R.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(R.error).join(" ")}):null,g?(0,a.jsxs)(Ia,{tone:g.suggestedApi?"ok":"bad",children:[g.suggestedApi?`${g.suggestedApi} answered${g.usedModel?` for ${g.usedModel}`:""}, so the wire format is set to it.`:g.usedModel?`No wire format answered for ${g.usedModel}. Check the base URL, key and model id.`:"The server listed no models. Add a model id below, then test again.",(0,a.jsx)("ul",{className:"mt-1 flex flex-col gap-0.5 text-xs text-ink-3",children:g.attempts.map(O=>(0,a.jsxs)("li",{className:"break-all",children:[O.api,": ",O.status??"no answer",O.detail&&!O.ok?` (${O.detail})`:""]},O.api))})]}):null]}),(0,a.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,a.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Models"}),p.models.map((O,Q)=>(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 rounded-md border border-line-soft p-2 sm:grid-cols-[2fr_2fr_1fr_1fr_auto]",children:[K&&O.id.trim()&&!K.has(O.id.trim())?(0,a.jsx)("span",{className:"col-span-2 text-xs text-ink-3 sm:col-span-5",children:"Not listed upstream any more; kept until you remove it."}):null,(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} id`,value:O.id,onChange:r(V=>S(Q,{id:V.target.value}),"onChange"),placeholder:"model id",className:"col-span-2 sm:col-span-1",autoComplete:"off"}),(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} name`,value:O.name,onChange:r(V=>S(Q,{name:V.target.value}),"onChange"),placeholder:"Display name",className:"col-span-2 sm:col-span-1"}),(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} context window`,value:O.contextWindow,onChange:r(V=>S(Q,{contextWindow:V.target.value}),"onChange"),placeholder:"Context",inputMode:"numeric"}),(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} max output tokens`,value:O.maxTokens,onChange:r(V=>S(Q,{maxTokens:V.target.value}),"onChange"),placeholder:"Max output",inputMode:"numeric"}),(0,a.jsxs)("div",{className:"col-span-2 flex items-center justify-between gap-3 text-xs sm:col-span-1",children:[(0,a.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("input",{type:"checkbox",checked:O.reasoning,onChange:r(V=>S(Q,{reasoning:V.target.checked}),"onChange")}),"Thinks"]}),(0,a.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("input",{type:"checkbox",checked:O.images,onChange:r(V=>S(Q,{images:V.target.checked}),"onChange")}),"Images"]}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove model ${Q+1}`,onClick:r(()=>k({models:p.models.filter((V,ue)=>ue!==Q)}),"onClick"),children:(0,a.jsx)(rg,{"aria-hidden":"true"})})]})]},Q)),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>k({models:[...p.models,{...$d}]}),"onClick"),children:[(0,a.jsx)(ns,{"aria-hidden":"true"}),"Add model"]}),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",disabled:!p.baseUrl.trim()||_.isPending,onClick:r(()=>_.mutate(),"onClick"),children:[(0,a.jsx)(cR,{"aria-hidden":"true"}),_.isPending?"Fetching...":"Fetch models"]})]}),_.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(_.error).join(" ")}):null,y?.error?(0,a.jsx)(Ia,{tone:"bad",children:y.error}):null,y&&!y.error?(0,a.jsx)(m6,{result:y,savedIds:U,room:500-U.size,onAdd:z}):null,(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Leave context and max output empty when unsure; OMP fills known models in."})]}),(0,a.jsxs)("details",{className:"flex flex-col gap-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer select-none text-sm font-medium",children:"Advanced"}),(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[(0,a.jsx)(Oh,{label:"Send the key as an Authorization header",hint:"OpenAI wire formats already do. Turn on for discovery or proxies that need it.",checked:p.authHeader,onChange:r(O=>k({authHeader:O}),"onChange")}),(0,a.jsx)(Oh,{label:"Disable strict tools",hint:"For Anthropic-style proxies that reject strict tool schemas.",checked:p.disableStrictTools,onChange:r(O=>k({disableStrictTools:O}),"onChange")}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(dc,{label:"Model discovery",hint:"Ask the server for its models instead of listing them",children:(0,a.jsxs)(hg,{value:p.discovery,onChange:r(O=>k({discovery:O.target.value}),"onChange"),className:"w-full",children:[(0,a.jsx)("option",{value:"",children:"Off"}),wE.map(O=>(0,a.jsx)("option",{value:O,children:g6[O]??O},O))]})}),p.discovery?(0,a.jsx)(dc,{label:"Discovery timeout (ms)",children:(0,a.jsx)(Wn,{value:p.discoveryTimeout,onChange:r(O=>k({discoveryTimeout:O.target.value}),"onChange"),inputMode:"numeric",placeholder:"OMP default"})}):null]}),p.discovery==="openai-models-list"?(0,a.jsx)(Oh,{label:"Add /v1 to the discovery URL",hint:"Turn on when the base URL has no /v1 but the model list lives under it.",checked:p.injectV1,onChange:r(O=>k({injectV1:O}),"onChange")}):null,(0,a.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,a.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Extra headers"}),p.headers.map((O,Q)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2",children:[(0,a.jsx)(Wn,{"aria-label":`Header ${Q+1} name`,value:O.name,onChange:r(V=>N(Q,{name:V.target.value}),"onChange"),placeholder:"X-Header",disabled:O.saved}),(0,a.jsx)(Wn,{"aria-label":`Header ${Q+1} value`,value:O.value,onChange:r(V=>N(Q,{value:V.target.value}),"onChange"),placeholder:O.saved?"Saved; type to replace":"value",type:"password",autoComplete:"off"}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove header ${Q+1}`,onClick:r(()=>k({headers:p.headers.filter((V,ue)=>ue!==Q)}),"onClick"),children:(0,a.jsx)(rg,{"aria-hidden":"true"})})]},Q)),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",className:"self-start",onClick:r(()=>k({headers:[...p.headers,{name:"",value:"",saved:!1}]}),"onClick"),children:[(0,a.jsx)(ns,{"aria-hidden":"true"}),"Add header"]})]})]})]}),M.error?(0,a.jsx)(Ia,{tone:"bad",children:(0,a.jsx)("ul",{className:"flex flex-col gap-0.5",children:wc(M.error).map(O=>(0,a.jsx)("li",{children:O},O))})}):null,(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(oe,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),(0,a.jsx)(oe,{type:"submit",disabled:M.isPending||!!C,children:M.isPending?"Checking with OMP...":"Save provider"})]})]})}r(Ww,"CustomProviderForm");function v6(e){switch(e.apiKey.kind){case"env":return e.apiKey.present?`key from ${e.apiKey.name}`:`${e.apiKey.name} is not set on the server`;case"literal":return"key saved";case"command":return"key from a command";case"none":return"no key";case"oauth":return"OMP sign-in";default:return"no key set"}}r(v6,"keySummary");var to=":new";function y6(e){return e===to?to:e.name}r(y6,"providerKey");function j6({onChanged:e}){const t=kn(),s=me({queryKey:Dh,queryFn:r(()=>ya.customProviders(),"queryFn")}),l=d6(y6),c=Bt({mutationFn:r(h=>ya.removeCustomProvider(h),"mutationFn"),onSuccess:r((h,g)=>{t.setQueryData(Dh,h),l.openKey===g&&l.close(!1),e?.()},"onSuccess")}),u=s.data?.providers??[],p=u.map(h=>h.name),f=r(h=>{t.setQueryData(Dh,h),l.close(),e?.()},"onSaved");return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[s.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(s.error).join(" ")}):null,s.data?.parseError?(0,a.jsxs)(Ia,{tone:"bad",children:[s.data.parseError,". Fix ",s.data.modelsPath," by hand; Wardmote will not overwrite it."]}):null,u.length?(0,a.jsx)("ul",{"aria-label":"Custom providers",className:"flex flex-col divide-y divide-line rounded-lg border border-line",children:u.map(h=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm",children:[(0,a.jsx)("b",{className:"font-medium",children:h.name}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-ink-3",children:[h.baseUrl,h.api,v6(h),h.discovery?`discovery: ${h.discovery.type}`:`${h.models.length} ${h.models.length===1?"model":"models"}`].filter(Boolean).join(" · ")}),(0,a.jsxs)("span",{className:"flex gap-1",children:[(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Edit ${h.name}`,...l.triggerProps(h.name),onClick:r(()=>l.toggle(h),"onClick"),children:(0,a.jsx)(K0,{"aria-hidden":"true"})}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${h.name}`,disabled:c.isPending,onClick:r(()=>{window.confirm(`Remove ${h.name} from OMP's models.yml? A backup stays in models.yml.bak.`)&&c.mutate(h.name)},"onClick"),children:(0,a.jsx)(rg,{"aria-hidden":"true"})})]})]}),l.openKey===h.name?(0,a.jsx)(Hw,{id:l.panelId(h.name),onEscape:l.dismiss,className:"px-2 pb-2 sm:px-3 sm:pb-3",children:(0,a.jsx)(Ww,{provider:h,takenNames:p,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):null]},h.name))}):s.isLoading?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Reading models.yml..."}):null,c.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(c.error).join(" ")}):null,l.openKey===to?(0,a.jsx)(Hw,{id:l.panelId(to),onEscape:l.dismiss,children:(0,a.jsx)(Ww,{provider:null,takenNames:p,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!!s.data?.parseError,...l.triggerProps(to),onClick:r(()=>l.request(to),"onClick"),children:[(0,a.jsx)(ns,{"aria-hidden":"true"}),"Add custom provider"]}),s.data?(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Saved to ",s.data.modelsPath,", with the previous copy in models.yml.bak."]}):null]})}r(j6,"CustomProviders");var w6=["Check OMP","Connect a model","First task"],Wg="Atlas",k6="general";var S6="Only an instance admin can set up OMP on this server.";function Lh(e){return e?e.status===403?{message:S6,retry:!1}:{message:e.message||"Could not check OMP on this server.",retry:!0}:null}r(Lh,"statusFailure");var N6={anthropic:"Anthropic",openai:"OpenAI","openai-codex":"OpenAI",openrouter:"OpenRouter",google:"Google",deepseek:"DeepSeek"};function C6(e){return e?N6[e]??e:null}r(C6,"providerLabel");function A6(e){return e.state==="ready"?"ready":e.state==="missing"?e.network==="offline"?"offline":"install":"old"}r(A6,"checkView");function _6(e){return(e?.models.length??0)>0}r(_6,"hasModel");function E6(e){return e.state!=="ready"?null:_6(e)?2:1}r(E6,"nextStepAfterCheck");function I6(e){return!e.connected||e.state!=="ready"?null:e.modelCount>0?2:1}r(I6,"nextStepAfterRemote");function T6(e){return e.copies.slice(1).filter(t=>t.version!==e.version)}r(T6,"olderCopies");function R6(e){const t=e.trim().split(/\r?\n/,1)[0]?.trim()??"";return t.length<=120?t:`${t.slice(0,119).trimEnd()}…`}r(R6,"taskTitle");function Qw(e){const t=e?.replace(/[\\/]+$/,"").split(/[\\/]/).pop()?.trim();return t||"My company"}r(Qw,"companyNameForFolder");function M6(e){return e?.recommendedModel?e.models.find(t=>t.id===e.recommendedModel)?.label??e.recommendedModel:null}r(M6,"recommendedModelLabel");function D6(e){return e?.recommendedModel?C6(e.models.find(t=>t.id===e.recommendedModel)?.provider??e.recommendedModel.split("/",1)[0]):null}r(D6,"signedInProvider");var gf="Wardmote",EA=2e3,kd=["onboarding","omp-status"],O6={ok:(0,a.jsx)(Rs,{className:"size-3.5","aria-hidden":!0}),bad:(0,a.jsx)(ia,{className:"size-3.5","aria-hidden":!0}),warn:(0,a.jsx)(ni,{className:"size-3.5","aria-hidden":!0}),wait:(0,a.jsx)(GI,{className:"size-3.5","aria-hidden":!0}),run:(0,a.jsx)(nl,{className:"size-3.5 motion-safe:animate-spin","aria-hidden":!0})},L6={ok:"bg-ok-soft text-ok",bad:"bg-bad-soft text-bad",warn:"bg-warn-soft text-warn",wait:"bg-bg-3 text-ink-3",run:"bg-run-soft text-run"};function no({rows:e,label:t}){return(0,a.jsx)("section",{"aria-label":t,className:"rounded-lg border border-line-soft bg-bg-2 px-4 py-1",children:(0,a.jsx)("ul",{children:e.map(s=>(0,a.jsxs)("li",{"data-check":s.state,className:"flex items-center gap-2.5 border-b border-line-soft py-2 text-(length:--t-13) last:border-b-0",children:[(0,a.jsx)("span",{className:Y("grid size-5.5 shrink-0 place-items-center rounded-full",L6[s.state]),children:O6[s.state]}),(0,a.jsx)("span",{className:"min-w-0",children:s.label}),s.value?(0,a.jsx)("span",{className:"ms-auto min-w-0 truncate font-mono text-xs text-ink-3",children:s.value}):null]},s.label))})})}r(no,"Checks");function Qg({command:e}){const[t,s]=(0,x.useState)(!1);return(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,a.jsx)("code",{className:"block w-full whitespace-pre-wrap break-all rounded-md border border-line-soft bg-bg-3 px-3 py-2.5 font-mono text-(length:--t-13)",children:e}),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>{$0(e).then(()=>s(!0))},"onClick"),children:[t?(0,a.jsx)(Rs,{className:"size-3.5","aria-hidden":!0}):(0,a.jsx)(a3,{className:"size-3.5","aria-hidden":!0}),t?"Copied":"Copy command"]})]})}r(Qg,"CommandBlock");function xf({tone:e,children:t}){return(0,a.jsxs)("div",{role:e==="bad"?"alert":"note",className:Y("flex gap-2.5 rounded-md px-3 py-2.5 text-(length:--t-13)",{warn:"bg-warn-soft",info:"bg-run-soft",bad:"bg-bad-soft"}[e]),children:[(0,a.jsx)(ni,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:t})]})}r(xf,"Note");function z6({step:e}){return(0,a.jsx)("ol",{"aria-label":"Setup steps",className:"flex flex-wrap items-center gap-1.5 text-xs text-ink-2",children:w6.map((t,s)=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5","aria-current":s===e?"step":void 0,children:[s>0?(0,a.jsx)("span",{"aria-hidden":!0,className:"h-px w-5.5 bg-line"}):null,(0,a.jsx)("span",{className:Y("grid size-5 place-items-center rounded-full border border-line-strong text-(length:--text-micro) font-semibold",s<e&&"border-ok bg-ok text-bg",s===e&&"border-accent text-accent"),children:s<e?(0,a.jsx)(Rs,{className:"size-3","aria-hidden":!0}):s+1}),(0,a.jsx)("span",{className:Y(s===e?"font-semibold text-ink":"max-sm:sr-only"),children:t})]},t))})}r(z6,"Steps");function or({title:e,lede:t}){return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("h1",{id:"onboarding-title",className:"text-(length:--t-24) font-semibold tracking-tight sm:text-(length:--t-32) sm:leading-tight",children:e}),(0,a.jsx)("p",{className:"max-w-130 text-base text-ink-2",children:t})]})}r(or,"Heading");function IA({title:e,paragraphs:t}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e}),t.map(s=>(0,a.jsx)("p",{className:"text-sm text-ink-2",children:s},s))]})}r(IA,"SideText");var P6=(0,a.jsx)(IA,{title:"Why OMP",paragraphs:[`${gf} runs every agent on OMP. OMP talks to the model and uses the tools; ${gf} assigns work, keeps the record and holds the settings.`,"You will not need to open OMP's own settings: models, thinking and tools are set here."]});function $c({children:e}){return(0,a.jsx)("div",{className:"mt-auto flex flex-wrap items-center gap-2 pt-2",children:e})}r($c,"Actions");function Gg(e){if(e instanceof Ii){const t=e.body;if(t&&typeof t.error=="string")return t.error}return e instanceof Error?e.message:String(e)}r(Gg,"errorMessage$1");function $6({open:e,onOpenChange:t,onPick:s}){const[l,c]=(0,x.useState)(null),u=me({queryKey:["onboarding","omp-browse",l],queryFn:r(()=>ya.browse(l),"queryFn"),enabled:e});return(0,a.jsx)(ws,{open:e,onOpenChange:t,children:(0,a.jsxs)(Ps,{className:"sm:max-w-lg",children:[(0,a.jsxs)(bo,{children:[(0,a.jsx)(Ds,{children:"Choose omp"}),(0,a.jsx)(vo,{className:"truncate font-mono text-xs",children:u.data?.path??"…"})]}),(0,a.jsxs)("ul",{className:"-mx-2 max-h-80 overflow-y-auto",children:[u.data?.parent?(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>c(u.data?.parent??null),"onClick"),children:[(0,a.jsx)(_i,{className:"size-4 text-ink-3","aria-hidden":!0}),".."]})}):null,u.data?.entries.map(p=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>{p.kind==="directory"?c(p.path):(s(p.path),t(!1))},"onClick"),children:[p.kind==="directory"?(0,a.jsx)(_i,{className:"size-4 text-ink-3","aria-hidden":!0}):(0,a.jsx)(fR,{className:"size-4 text-accent","aria-hidden":!0}),(0,a.jsx)("span",{className:"truncate",children:p.name})]})},p.path)),u.isError?(0,a.jsx)("li",{className:"px-2 py-2 text-sm text-bad",children:Gg(u.error)}):null]})]})})}r($6,"OmpFilePicker");function U6({status:e,failure:t,command:s,onChooseCommand:l,onRemote:c,onRetry:u}){const[p,f]=(0,x.useState)(!1),h=r(v=>v.state==="ready"?{state:"ok",label:`Version ${v.version}`,value:`needs ${v.minVersion} or newer`}:{state:"bad",label:v.version?`Version ${v.version}`:"Version unknown",value:`needs ${v.minVersion}`},"versionRow");if(!e)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Install OMP",lede:"Looking for OMP on this computer."}),(0,a.jsx)(no,{label:"OMP checks",rows:[t&&!t.retry?{state:"bad",label:"Looking for omp",value:"stopped"}:{state:"run",label:"Looking for omp",value:"every 2 s"}]}),t?(0,a.jsx)(xf,{tone:"bad",children:t.message}):null]});const g=A6(e);if(g==="old"){const v=T6(e);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Update OMP",lede:e.version?`OMP ${e.version} is older than ${e.minVersion}, so some settings set here would be ignored.`:`The version of OMP could not be read. ${gf} needs OMP ${e.minVersion} or newer.`}),(0,a.jsx)(Qg,{command:e.updateCommand}),(0,a.jsx)(no,{label:"OMP checks",rows:[{state:"ok",label:"omp found",value:e.path},h(e)]}),v.length>0?(0,a.jsxs)(xf,{tone:"warn",children:["Two copies of omp are installed. The older one in ",e.path," runs first. Remove it, or update it with the command above."]}):null]})}return g==="offline"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"You are offline",lede:"Installing needs the internet once. Connect, or point to an omp you already copied here."}),(0,a.jsx)(no,{label:"OMP checks",rows:[{state:"bad",label:"omp.sh not reachable",value:"3 tries"},s?h(e):{state:"wait",label:"Version check"}]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("span",{id:"omp-path-label",className:"text-sm font-medium",children:"Path to omp"}),(0,a.jsxs)(oe,{type:"button",variant:"secondary","aria-labelledby":"omp-path-label",className:"justify-between font-normal",onClick:r(()=>f(!0),"onClick"),children:[(0,a.jsx)("span",{className:Y("truncate",s?"font-mono text-xs":"text-ink-3"),children:s??"Choose file"}),(0,a.jsx)(_i,{className:"size-4","aria-hidden":!0})]})]}),(0,a.jsx)($6,{open:p,onOpenChange:f,onPick:l}),(0,a.jsx)($c,{children:(0,a.jsxs)(oe,{type:"button",variant:"secondary",onClick:u,children:[(0,a.jsx)(nl,{className:"size-3.5","aria-hidden":!0}),"Try again"]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Install OMP",lede:"Run this in a terminal on this computer. This page moves on by itself."}),(0,a.jsx)(Qg,{command:e.installCommand}),(0,a.jsxs)("p",{className:"text-sm text-ink-2",children:[e.os.label," detected ·"," ",(0,a.jsx)("a",{className:"inline-flex min-h-6 items-center text-accent underline-offset-2 hover:underline",href:"https://omp.sh",target:"_blank",rel:"noreferrer",children:"Other ways"})]}),(0,a.jsx)(no,{label:"OMP checks",rows:[e.state==="ready"?{state:"ok",label:"omp found",value:e.path}:{state:"run",label:"Looking for omp",value:"every 2 s"},e.state==="ready"?h(e):{state:"wait",label:`Version ${e.minVersion} or newer`},e.models.length>0?{state:"ok",label:`${e.models.length} models`}:{state:"wait",label:"At least one model"}]}),e.runtime==="local"?(0,a.jsx)($c,{children:(0,a.jsx)(oe,{type:"button",variant:"ghost",onClick:c,children:"Run agents on another machine"})}):null]})}r(U6,"CheckOmpScreen");function B6({remote:e,pending:t,error:s,onCheck:l,onLocal:c}){const[u,p]=(0,x.useState)(e?.address??""),f=e?[e.connected?{state:"ok",label:"Connected",value:e.latencyMs!==null?`${e.latencyMs} ms`:null}:{state:"bad",label:"Not connected",value:e.error},...e.connected?[e.state==="missing"?{state:"bad",label:"omp not found there"}:e.state==="ready"?{state:"ok",label:`omp ${e.version} found`}:{state:"bad",label:`omp ${e.version??""} is too old`.replace(" "," "),value:"needs 18.1.16"},e.modelCount>0?{state:"ok",label:`${e.modelCount} models signed in there`}:{state:"bad",label:"No model signed in there",value:"next step"}]:[]]:[];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Run agents on another machine",lede:"OMP must be installed where agents run. We check it over SSH."}),(0,a.jsxs)("form",{className:"flex flex-col gap-1.5",onSubmit:r(h=>{h.preventDefault(),l(u.trim())},"onSubmit"),id:"onboarding-remote-form",children:[(0,a.jsx)("label",{htmlFor:"onboarding-ssh-address",className:"text-sm font-medium",children:"SSH address"}),(0,a.jsx)(Wn,{id:"onboarding-ssh-address",value:u,onChange:r(h=>p(h.target.value),"onChange"),placeholder:"user@host",autoComplete:"off",spellCheck:!1,"aria-describedby":"onboarding-ssh-help"}),(0,a.jsx)("span",{id:"onboarding-ssh-help",className:"text-xs text-ink-3",children:"Uses your SSH keys. The working folder is your home folder unless you change it later."})]}),f.length>0?(0,a.jsx)(no,{label:"Remote checks",rows:f}):null,s?(0,a.jsx)(xf,{tone:"bad",children:s}):null,(0,a.jsxs)($c,{children:[(0,a.jsx)(oe,{type:"button",variant:"ghost",onClick:c,children:"Use this computer"}),(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsx)(oe,{type:"submit",form:"onboarding-remote-form",disabled:t||u.trim().length===0,children:t?"Checking…":"Continue"})]})]})}r(B6,"RemoteScreen");function K6({remote:e,onSignedIn:t}){const[s,l]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(!e)return;const c=window.setInterval(t,EA);return()=>window.clearInterval(c)},[e,t]),e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Connect a model",lede:`OMP on ${e.host} has no model signed in yet.`}),(0,a.jsxs)("p",{className:"text-sm text-ink-2",children:["Sign in on ",e.host,". This page moves on by itself."]}),(0,a.jsx)(Qg,{command:`ssh -t ${e.username}@${e.host}${e.port!==22?` -p ${e.port}`:""} omp login`})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Connect a model",lede:s?"Add your own gateway or local server to OMP.":"OMP has no model signed in yet. Sign in to a provider; OMP keeps the sign-in."}),s?(0,a.jsx)(j6,{onChanged:t}):(0,a.jsx)(p6,{autoFocus:!0,onSignedIn:t}),(0,a.jsxs)($c,{children:[(0,a.jsx)(oe,{type:"button",variant:"link",size:"sm",onClick:r(()=>l(c=>!c),"onClick"),children:s?"Sign in to a provider instead":"Use my own server instead"}),(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Moves on by itself once OMP has a model."})]})]})}r(K6,"ConnectScreen");function q6({status:e,remote:t,pending:s,error:l,onStart:c}){const[u,p]=(0,x.useState)(""),f=t?t.homeFolder:e?.projectFolder,h=t?null:M6(e);return(0,a.jsxs)("form",{className:"contents",onSubmit:r(g=>{g.preventDefault(),u.trim()&&c(u.trim())},"onSubmit"),children:[(0,a.jsx)(or,{title:"What should your first agent do?",lede:`${Wg} starts as soon as you press Start. You can rename it and change its setup later.`}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("label",{htmlFor:"onboarding-first-task",className:"text-sm font-medium",children:"First task"}),(0,a.jsx)(eS,{id:"onboarding-first-task",value:u,onChange:r(g=>p(g.target.value),"onChange"),rows:4,placeholder:f?`Read the README in ${f} and list the three riskiest modules.`:void 0,autoFocus:!0})]}),(0,a.jsxs)("section",{"aria-label":"First agent",className:"flex flex-col gap-1.5 rounded-lg border border-line-soft bg-bg-2 px-4 py-3 text-sm",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Agent"}),Wg,", general assistant"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Model"}),h?`${h} (recommended)`:"OMP default"]}),(0,a.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,a.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Folder"}),(0,a.jsx)("span",{className:"min-w-0 truncate font-mono text-xs leading-5",children:f??"~"})]})]}),l?(0,a.jsx)(xf,{tone:"bad",children:l}):null,(0,a.jsxs)($c,{children:[(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsxs)(oe,{type:"submit",disabled:s||u.trim().length===0,children:[(0,a.jsx)(I0,{className:"size-3.5","aria-hidden":!0}),s?"Starting…":"Start"]})]})]})}r(q6,"TaskScreen");function F6(){const{onboardingOpen:e,onboardingOptions:t,closeOnboarding:s,onboardingRouteDismissed:l,setOnboardingRouteDismissed:c}=Vc(),{companies:u,loading:p}=vt(),f=hn(),h=iU(f.pathname),g=h&&p?null:rU({pathname:f.pathname,companyPrefix:h,companies:u});if(!(e||g!==null&&!l))return null;const v=(e?t.companyId:g?.companyId)??null;return(0,a.jsx)(H6,{companyId:v,onClose:r(()=>{s(),c(!0)},"onClose")})}r(F6,"OnboardingFlow");function H6({companyId:e,onClose:t}){const s=kn(),l=ja(),{setSelectedCompanyId:c}=vt(),[u,p]=(0,x.useState)(0),[f,h]=(0,x.useState)("local"),[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),[k,S]=(0,x.useState)(null),N=me({queryKey:[...kd,g],queryFn:r(()=>ya.status({command:g}),"queryFn"),retry:r((z,E)=>(Lh(E)?.retry??!0)&&z<2,"retry"),refetchInterval:r(z=>Lh(z.state.error)?.retry===!1||u===2&&z.state.data?!1:EA,"refetchInterval")}),I=N.data,C=Lh(N.error),M=me({queryKey:[...kd,"network",g],queryFn:r(()=>ya.status({command:g,network:!0}),"queryFn"),enabled:I?.state==="missing"&&f==="local",refetchInterval:3e4}),R=(0,x.useMemo)(()=>{if(I)return I.state!=="missing"?I:{...I,network:M.data?.network??null}},[I,M.data]);(0,x.useEffect)(()=>{if(f!=="local"||!I||u===2)return;const z=E6(I);z!==null&&z>u&&p(z)},[f,I,u]);const _=Bt({mutationFn:r(z=>ya.remote(z),"mutationFn"),onSuccess:r(z=>{j(z);const E=I6(z);E!==null&&p(E)},"onSuccess")}),D=(0,x.useCallback)(()=>{if(!y){s.invalidateQueries({queryKey:kd});return}ya.remote(y.address).then(z=>{j(z),z.modelCount>0&&p(2)}).catch(()=>{})},[y,s]),U=Bt({mutationFn:r(async z=>{const E=f==="remote"?y?.homeFolder??null:I?.projectFolder??null;let B=e;B||(B=(await $y.create({name:Qw(f==="remote"?y?.host:E)})).id,await s.invalidateQueries({queryKey:P.companies.all}));let O=null;f==="remote"&&y?.homeFolder&&(O=(await PT.create(B,{name:y.host,driver:"ssh",config:{host:y.host,port:y.port,username:y.username,remoteWorkspacePath:y.homeFolder}})).id);const Q={};f==="local"&&I?.recommendedModel&&(Q.model=I.recommendedModel),E&&(Q.cwd=E),g&&(Q.command=g);const V=await Fa.hire(B,{name:Wg,role:k6,appearance:AE(),adapterType:"omp_local",adapterConfig:Q,onboardingFirstAgent:!0,runtimeConfig:l6(),...O?{defaultEnvironmentId:O}:{}});V.approval&&await HN.approve(V.approval.id,"Approved during onboarding first-agent setup.");const ue=await mr.create(B,{name:Qw(E),status:"in_progress",...f==="local"&&E?{workspace:{sourceType:"local_path",cwd:E,isPrimary:!0}}:{}}),ce=await on.create(B,{title:R6(z),description:z,status:"todo",assigneeAgentId:V.agent.id,projectId:ue.id});return{companyId:B,issue:ce}},"mutationFn"),onMutate:r(()=>S(null),"onMutate"),onError:r(z=>S(Gg(z)),"onError"),onSuccess:r(async({companyId:z,issue:E})=>{await Promise.all([s.invalidateQueries({queryKey:P.companies.all}),s.invalidateQueries({queryKey:P.agents.list(z)}),s.invalidateQueries({queryKey:P.projects.list(z)}),s.invalidateQueries({queryKey:P.issues.list(z)})]);const B=(await $y.list()).find(Q=>Q.id===z)?.issuePrefix??null;c(z,{source:"route_sync"}),t();const O=E.identifier??E.id;l(B?`/${B}/issues/${O}`:`/issues/${O}`)},"onSuccess")}),K=u===1?(0,a.jsx)(IA,{title:"Skipped when OMP is ready",paragraphs:["If OMP already has a signed-in model on this machine, this step is skipped and the best model is picked for you."]}):u===2?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:f==="remote"?`Found on ${y?.host??"that machine"}`:"Found on this computer"}),(0,a.jsx)(no,{label:"Found",rows:f==="remote"?[{state:"ok",label:`OMP ${y?.version??""}`.trim()},{state:"ok",label:`${y?.modelCount??0} models signed in`},{state:"ok",label:"Working folder",value:y?.homeFolder}]:[{state:"ok",label:`OMP ${I?.version??""}`.trim()},{state:"ok",label:`${D6(I)??"Model"} signed in`,value:"imported"},{state:"ok",label:"Project folder",value:I?.projectFolder}]})]}):P6;return(0,a.jsx)(ws,{open:!0,onOpenChange:r(z=>{z||t()},"onOpenChange"),children:(0,a.jsxs)(J3,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-50 bg-bg"}),(0,a.jsxs)("div",{"data-testid":"onboarding-flow","data-step":u,role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",className:"fixed inset-0 z-50 grid overflow-y-auto lg:grid-cols-2",onKeyDown:r(z=>{z.key==="Escape"&&t()},"onKeyDown"),children:[(0,a.jsxs)("main",{className:"flex min-h-dvh min-w-0 flex-col gap-4.5 px-4 py-5 sm:px-8 sm:py-8 lg:px-14 lg:py-10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(T0,{className:"size-6.5 shrink-0 text-ink","aria-hidden":"true"}),(0,a.jsx)("b",{className:"text-base font-semibold",children:gf})]}),(0,a.jsx)(z6,{step:u}),u===0&&f==="local"?(0,a.jsx)(U6,{status:R,failure:C,command:g,onChooseCommand:v,onRemote:r(()=>h("remote"),"onRemote"),onRetry:r(()=>{s.invalidateQueries({queryKey:kd})},"onRetry")}):null,u===0&&f==="remote"?(0,a.jsx)(B6,{remote:y,pending:_.isPending,error:_.isError?Gg(_.error):null,onCheck:r(z=>_.mutate(z),"onCheck"),onLocal:r(()=>{h("local"),j(null)},"onLocal")}):null,u===1?(0,a.jsx)(K6,{remote:f==="remote"?y:null,onSignedIn:D}):null,u===2?(0,a.jsx)(q6,{status:I,remote:f==="remote"?y:null,pending:U.isPending,error:k,onStart:r(z=>U.mutate(z),"onStart")}):null]}),(0,a.jsx)("aside",{className:"hidden min-w-0 flex-col gap-4 border-s border-line-soft bg-bg-3 px-12 py-10 lg:flex",children:K})]})]})})}r(H6,"OnboardingFlowDialog");function V6(){const{openNewIssue:e}=$s();return(0,x.useEffect)(()=>{e()},[e]),(0,a.jsx)(We,{to:"/issues",replace:!0})}r(V6,"NewTaskShortcut");var W6="npx @tickernelz/wardmote auth bootstrap-ceo";function zh({hasActiveInvite:e=!1}){return(0,a.jsxs)("div",{className:"mt-6 border-t border-line pt-5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,a.jsx)(W1,{className:"size-4 text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{children:"Prefer to finish setup from the host?"})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:e?"A bootstrap invite is already active. Check your Wardmote startup logs for the first-admin URL, or run this command on the host to rotate it:":"Run this command on the host that runs Wardmote to print a one-time first-admin invite URL:"}),(0,a.jsx)("pre",{className:"mt-3 overflow-x-auto rounded-md border border-line bg-bg-3/30 p-3 font-mono text-xs",children:W6})]})}r(zh,"CliFallback");function Sd({children:e}){return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsx)(Hc,{className:"block p-6",children:e})})}r(Sd,"StateChrome");function Q6(e){return e.user.email||e.user.name||e.user.id}r(Q6,"displayIdentity");function G6(e){return e?.status===409?{title:"Someone else has already claimed this instance.",body:"Refresh to sign in, or ask the existing admin to invite you from Settings -> Access."}:e?.status===401?{title:"Your session expired. Sign in again to claim this instance.",body:""}:{title:"We couldn't reach the server. Try again in a moment.",body:""}}r(G6,"claimErrorCopy");function Y6({claimAvailable:e,hasActiveInvite:t=!1,session:s,claimState:l,claimError:c,onClaim:u}){if(!e)return(0,a.jsxs)(Sd,{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"This Wardmote is waiting on its first admin"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This instance runs in invite-only mode. The operator must generate a one-time first-admin invite URL from the host. Once you have the link, open it from this browser to finish setup."}),(0,a.jsx)(zh,{hasActiveInvite:t}),(0,a.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Browser-based claim is intentionally disabled in public mode so anyone on the network can't promote themselves."})]});if(l==="success")return(0,a.jsxs)(Sd,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",children:(0,a.jsx)(Cc,{className:"size-5","aria-hidden":!0})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"You're the instance admin"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Setup is complete. Taking you to onboarding to create your first organization..."})]})]}),(0,a.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,a.jsx)(Ta,{className:"size-4 animate-spin text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{className:"text-sm text-ink-3",children:"Redirecting..."})]}),(0,a.jsx)("div",{className:"mt-5",children:(0,a.jsx)(oe,{asChild:!0,variant:"secondary",children:(0,a.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]});if(!s)return(0,a.jsxs)(Sd,{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Sign in or create your Wardmote account to become the first admin from this browser."}),(0,a.jsx)("div",{className:"mt-5",children:(0,a.jsx)(oe,{asChild:!0,children:(0,a.jsx)(mn,{to:"/auth?next=/",children:"Sign in / Create account"})})}),(0,a.jsx)(zh,{hasActiveInvite:t})]});const p=G6(c),f=l==="claiming";return(0,a.jsxs)(Sd,{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,a.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,a.jsxs)(oe,{onClick:u,disabled:f,children:[f&&(0,a.jsx)(Ta,{className:"mr-2 size-4 animate-spin","aria-hidden":!0}),f?"Claiming...":"Claim this instance"]}),(0,a.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,a.jsx)("span",{className:"font-medium text-ink",children:Q6(s)})]})]}),(0,a.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["Wrong account?"," ",(0,a.jsx)(mn,{to:"/auth?next=/",className:"underline underline-offset-2",children:"Switch account"}),"."]}),c&&(0,a.jsxs)("div",{role:"alert",className:"mt-4 flex items-start gap-2 rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:[(0,a.jsx)(ni,{className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":!0}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:p.title}),p.body&&(0,a.jsx)("p",{className:"mt-1 text-bad/90",children:p.body})]})]}),(0,a.jsx)(zh,{hasActiveInvite:t})]})}r(Y6,"BootstrapPendingPage");var Nd=5e3;function X6({temporary:e,retrying:t,onRetry:s}){return(0,a.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col gap-4 px-4 py-16",children:[(0,a.jsx)(nl,{className:"size-6 text-ink-3","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",role:"status",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:e?"Reconnecting to Wardmote":"Unable to load Wardmote"}),(0,a.jsx)("p",{className:"text-sm text-ink-3",children:e?"The server may be restarting or your connection was interrupted. We’ll try again every few seconds and reconnect automatically.":"We couldn’t check your access to this instance. Try again, or contact your instance administrator if this continues."})]}),(0,a.jsx)("div",{children:(0,a.jsx)(oe,{variant:"secondary",onClick:s,disabled:t,children:t?"Connecting…":"Try again"})})]})}r(X6,"CloudAccessError");function Z6(){return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)(Hc,{className:"block p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"No organization access"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This account is signed in, but it does not have an active organization membership or instance-admin access on this Wardmote instance."}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Use an organization invite or sign in with an account that already belongs to this org."})]})})}r(Z6,"NoBoardAccessPage");function Gw({allowMembershipRequest:e=!1}={}){const t=hn(),s=kn(),[l,c]=(0,x.useState)(!1),u=me({queryKey:P.health,queryFn:r(()=>Fc.get(),"queryFn"),retry:!1,refetchInterval:r(R=>{if(R.state.error)return Pr(R.state.error)?Nd:!1;const _=R.state.data;return _?.status==="starting"?Nd:_?.deploymentMode==="authenticated"&&_.bootstrapStatus==="bootstrap_pending"?2e3:!1},"refetchInterval"),refetchIntervalInBackground:!0}),p=u.data?.deploymentMode==="authenticated",f=p&&u.data?.bootstrapStatus==="bootstrap_pending",h=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),enabled:p,retry:!1,refetchInterval:r(R=>Pr(R.state.error)?Nd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),g=me({queryKey:P.access.currentBoardAccess,queryFn:r(()=>ei.getCurrentBoardAccess(),"queryFn"),enabled:p&&!f&&!!h.data,retry:!1,refetchInterval:r(R=>Pr(R.state.error)?Nd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),v=Bt({mutationFn:r(()=>ei.claimBootstrapAdmin(),"mutationFn"),onSuccess:r(async()=>{await s.invalidateQueries({queryKey:P.auth.session}),await s.invalidateQueries({queryKey:P.health}),await s.invalidateQueries({queryKey:P.companies.all}),await s.invalidateQueries({queryKey:P.companies.stats}),await s.invalidateQueries({queryKey:P.access.currentBoardAccess})},"onSuccess")}),y=[u,...p?[h]:[],...p&&!f&&h.data?[g]:[]],j=u.data?.status==="starting",k=j||y.some(R=>Pr(R.error)),S=y.find(R=>R.error&&!(R.data!==void 0&&Pr(R.error)))?.error,N=u.isLoading||p&&h.isLoading||p&&!f&&!!h.data&&g.isLoading,I=e||!p||!!g.data?.isInstanceAdmin||(g.data?.companyIds.length??0)>0,C=!N&&!S&&!f&&(!p||!!h.data)&&I;(0,x.useEffect)(()=>{C?u.data?.status==="ok"&&c(!0):c(!1)},[C,u.data?.status]);const M=(0,x.useRef)(!1);if((0,x.useEffect)(()=>{k?M.current=!0:M.current&&!N&&!S&&(M.current=!1,s.invalidateQueries({predicate:r(R=>Pr(R.state.error),"predicate")}))},[k,N,S,s]),S||j&&!l)return(0,a.jsx)(X6,{temporary:S?Pr(S):!0,retrying:y.some(R=>R.isFetching),onRetry:r(()=>{for(const R of y)(R.error||R===u&&j)&&R.refetch({cancelRefetch:!1})},"onRetry")});if(N)return(0,a.jsx)(Ms,{});if(f){const R=u.data;if(!R)return(0,a.jsx)(Ms,{});const _=v.error instanceof Ii?{status:v.error.status,message:v.error.message}:v.error instanceof Error?{message:v.error.message}:null;return(0,a.jsx)(Y6,{claimAvailable:R.deploymentExposure==="private",hasActiveInvite:R.bootstrapInviteActive,session:h.data,claimState:v.isSuccess?"success":v.isPending?"claiming":"idle",claimError:_,onClaim:r(()=>v.mutate(),"onClaim")})}if(p&&!h.data){const R=encodeURIComponent(`${t.pathname}${t.search}`);return(0,a.jsx)(We,{to:`/auth?next=${R}`,replace:!0})}return I?(0,a.jsxs)(a.Fragment,{children:[k&&(0,a.jsx)("div",{role:"status",className:"bg-bg-3 px-4 py-2 text-center text-sm text-ink-3",children:"Connection interrupted. Reconnecting automatically…"}),(0,a.jsx)(xo,{})]}):(0,a.jsx)(Z6,{})}r(Gw,"CloudAccessGate");var TA=["all","active","paused","error","builtin"];function J6({endpointId:e,children:t}){const s=me({queryKey:P.chatEndpoints.detail(e),queryFn:r(()=>X1.get(e),"queryFn")}),{enabled:l,githubEnabled:c}=w0();return s.isError?(0,a.jsxs)("div",{className:"space-y-3 p-6",children:[(0,a.jsx)("p",{role:"alert",className:"text-sm text-bad",children:s.error.message}),(0,a.jsx)(oe,{variant:"secondary",onClick:r(()=>{s.refetch()},"onClick"),children:"Retry"})]}):s.data?u1(s.data.provider,l,c)?(0,a.jsx)(a.Fragment,{children:t}):(0,a.jsx)(We,{to:"/apps",replace:!0}):null}r(J6,"ProviderEndpointGate");function Cd({children:e}){const{enabled:t,githubEnabled:s,loaded:l}=w0(),[c]=i1(),{endpointId:u}=zs();return!u&&c.get("provider")==="agentmail"?(0,a.jsx)(a.Fragment,{children:e}):l?u?(0,a.jsx)(J6,{endpointId:u,children:e}):u1(c.get("provider"),t,s)?(0,a.jsx)(a.Fragment,{children:e}):(0,a.jsx)(We,{to:"/apps",replace:!0}):null}r(Cd,"ChatConnectorsExperimentalGate");Ce(()=>ke(()=>import("./TaskChatLab-vnFP7gcJ.js").then(e=>e.TaskChatLab),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119])));var eB=Ce(()=>ke(()=>import("./Cases-C5IE_YuB.js").then(e=>e.Cases),__vite__mapDeps([120,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,122,40,123,124,7,9,125,126,95,127,128,129,38,130,76]))),tB=Ce(()=>ke(()=>import("./CaseDetail-k79_F25A.js").then(e=>e.CaseDetail),__vite__mapDeps([131,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,90,113,114,80,81,4,41,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,94,14,98,76,89,88,100,36,37,133,74,134,79,82,83,84,85,86,66,87,91,92,93,65,40,135,61,136,137,138,139,12,101,125,140,141,142,143,144,75,62,70,18,35,71,72,73,77,13,145,118,146,126,99,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,67,162,163,164,165,166,167,168,169,128,170,116,117,171,95,127,172,173,174,175,176,177,129,178,179]))),nB=Ce(()=>ke(()=>import("./Dashboard-B0JjQSAg.js").then(e=>e.Dashboard),__vite__mapDeps([180,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,139,65,41,181,182,7,9,97,183,55,184,146,185,186,37,187,188,127,163,161,67,98,175,189,190]))),aB=Ce(()=>ke(()=>import("./Companies-Cr0mZy2B.js").then(e=>e.Companies),__vite__mapDeps([191,1,3,20,22,21,113,25,8,26,114,80,27,81,4,41,5,142,29,115,7,9,13,171,102,76,125,95,127,175]))),sB=Ce(()=>ke(()=>import("./Agents-BjPLaL-p.js").then(e=>e.Agents),__vite__mapDeps([192,1,3,17,16,20,193,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,134,80,81,9,65,7,71,10,194,13,98,195,88,44,89,90,37,55,109,141,184,146,196,99,74,76,197,198,127,199,39,200,40,174,163,161,67,172,82,83,173,201,202,203,175,204,205,206]))),Ph=Ce(()=>ke(()=>import("./AgentDetail-NfA1gamX.js").then(e=>e.AgentDetail),__vite__mapDeps([207,1,3,16,17,20,208,193,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,245,246,247,248,69,42,46,48,50,52,54,56,58,59,61,70,18,35,62,71,72,73,75,77,78,94,96,109,147,111,133,183,126,249,250,251,164,252,253,254,154,255,256,106,257,258,259,260,204,261,262,263,264,11,265,266,267,175,268]))),iB=Ce(()=>ke(()=>import("./Projects-B6UgAQ3Z.js").then(e=>e.Projects),__vite__mapDeps([269,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,13,126,127,175,262,263,206]))),Br=Ce(()=>ke(()=>import("./ProjectDetail-OirlXEA4.js").then(e=>e.ProjectDetail),__vite__mapDeps([270,1,3,16,17,20,22,209,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,134,142,46,271,272,175,109,184,146,126,147,185,187,188,273,274,42,48,50,52,54,56,58,59,176,177,168,262,263,275,250,276,251,277,278,101,140,261]))),rB=Ce(()=>ke(()=>import("./ProjectWorkspaceDetail-C9_liq4q.js").then(e=>e.ProjectWorkspaceDetail),__vite__mapDeps([279,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,101,125,140,141,134,80,81,213,99,74,76,214,4,126,185,186,37,187,188,127,175,168,84,280]))),lB=Ce(()=>ke(()=>import("./Workspaces-uDkUYVN3.js").then(e=>e.Workspaces),__vite__mapDeps([281,1,3,20,208,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,141,127,275,65,42,43,44,45,46,4,47,48,49,6,34,50,51,52,53,54,55,56,38,57,58,59,156,125,37,99,74,76,163,161,67,98,172,82,83,80,40,173,250,209,210,211,212,205,121,108,79,81,84,85,86,66,87,88,89,90,91,92,93,213,214,143,144,41,215,216,153,217,218,113,114,115,219,155,13,14,220,162,221,118,174,222,223,224,95,225,100,181,226,227,194,12,97,105,171,195,228,186,229,230,231,232,233,199,39,200,234,235,236,237,238,201,202,239,203,240,241,242,243,36,244,119,276,109,251,278,101,126,140,261]))),oB=Ce(()=>ke(()=>import("./Issues-DtYFX9i_.js").then(e=>e.Issues),__vite__mapDeps([282,1,3,16,17,20,208,283,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,46,122,4,41,48,49,226,7,11,13,14,98,87,76,186,89,90,37,55,109,141,184,146,126,99,74,147,284,148,127,149,88,44,175,59,285,42,43,45,47,6,34,50,51,52,53,54,56,38,57,58,162,97,168,84,205,113,114,79,82,83,85,86,66,91,92,93,144,40,115,12,286,101,125,100,199,39,200,174,237,238,118,233,201,65,119,287,255,288,104,289,69,61,70,18,35,36,62,71,72,73,75,77,78,94,95,96]))),cB=Ce(()=>ke(()=>import("./Search-DjpKZIsB.js").then(e=>e.Search),__vite__mapDeps([290,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,113,114,80,81,41,134,9,122,40,291,61,7,13,14,98,257,87,76,186,125,88,44,89,90,55,126,95,229,127,149,35,174,59,133,74]))),uB=Ce(()=>ke(()=>import("./IssueDetail-C0hCFL-i.js").then(e=>e.t).then(e=>e.IssueDetail),__vite__mapDeps([292,1,3,25,8,16,17,20,208,193,22,209,210,211,141,21,19,23,24,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,18,35,137,245,293,106,165,166,167,132,42,46,48,50,52,54,56,58,59,94,133,253,254,294,295,296,297,134,122,75,246,247,248,69,61,70,62,71,72,73,77,78,96,109,147,111,298,135,63,64,68,101,102,103,291,299,300,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,168,169,128,104,301,302,117,303,110,304,305,10,11,306,15,60,107,112,116,307,184,196,284,185,187,188,249,273,289,308,309,310,311,312,175,251,287,252,313,314,315,285,177,274,176,255,316,317,256,257,318]))),dB=Ce(()=>ke(()=>import("./AgentChats-56CMlXmb.js").then(e=>e.AgentChats),__vite__mapDeps([319,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,88,44,89,90,127,320]))),fB=Ce(()=>ke(()=>import("./AgentChat--rcr73Ls.js").then(e=>e.AgentChat),__vite__mapDeps([321,1,3,16,17,20,22,292,25,8,208,193,209,210,211,141,21,19,23,24,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,18,35,137,245,293,106,165,166,167,132,42,46,48,50,52,54,56,58,59,94,133,253,254,294,295,296,297,134,122,75,246,247,248,69,61,70,62,71,72,73,77,78,96,109,147,111,298,135,63,64,68,101,102,103,291,299,300,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,168,169,128,104,301,302,117,303,110,304,305,10,11,306,15,60,107,112,116,307,184,196,284,185,187,188,249,273,289,308,309,310,311,312,175,251,287,252,313,314,315,285,177,274,176,255,316,317,256,257,318,322,320]))),pB=Ce(()=>ke(()=>import("./IssueChatLongThreadPerf-BJ_Hr2PT.js").then(e=>e.IssueChatLongThreadPerf),__vite__mapDeps([323,1,3,125,8,9,175,311,16,17,20,209,22,210,211,141,21,19,23,24,25,26,27,28,29,5,30,31,32,33,212,205,74,7,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,245,312,11,35,152,150,42,46,48,50,52,54,56,58,59,301,61,78,75,94,96,302,117,102,148,303,110,304,305,101,116,109,154,107,251,287,159,160,164,252,253,254,313,166]))),mB=Ce(()=>ke(()=>import("./Routines-pnhQk9RN.js").then(e=>e.Routines),__vite__mapDeps([324,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,79,43,44,45,80,74,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,122,4,40,41,7,9,13,145,37,55,109,184,146,126,99,147,325,127,151,150,152,153,172,173,175,326,205,113,114,115,171,95,133,327,108,215,216,217,6,299,51,300,125,141,100,202,38,169]))),hB=Ce(()=>ke(()=>import("./Pipelines-DAuqtVqc.js").then(e=>e.Learnings),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),gB=Ce(()=>ke(()=>import("./Pipelines-DAuqtVqc.js").then(e=>e.PipelineItemDetail),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),xB=Ce(()=>ke(()=>import("./Pipelines-DAuqtVqc.js").then(e=>e.PipelineItemLegacyRedirect),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),$h=Ce(()=>ke(()=>import("./Pipelines-DAuqtVqc.js").then(e=>e.Pipelines),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),bB=Ce(()=>ke(()=>import("./Pipelines-DAuqtVqc.js").then(e=>e.ReviewQueue),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),vB=Ce(()=>ke(()=>import("./PipelineSettings-BgfMR73P.js").then(e=>e.PipelineSettings),__vite__mapDeps([332,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,212,113,114,80,81,4,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,90,91,92,93,139,46,144,160,40,218,215,7,9,216,99,153,217,161,115,219,155,53,13,14,220,162,221,118,125,37,174,222,11,12,171,141,95,127,225,100,151,150,233,152,331,333,108,47,172,173]))),Yw=Ce(()=>ke(()=>import("./StatusCards-Bqkb18QJ.js").then(e=>e.StatusCards),__vite__mapDeps([334,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,113,114,80,81,41,134,9,40,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,54,55,56,38,57,58,59,115,181,13,156,98,335,118,85,83,125,88,89,90,99,74,76,95,127,100,152,150,153,163,161,67,172,82,173,133,276,109,251]))),yB=Ce(()=>ke(()=>import("./PixelsOffice-CaQYQilp.js").then(e=>e.PixelsOffice),__vite__mapDeps([336,1,3,20,43,44,45,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,247,80,82,83,337,34,226,7,9,11,12,306,76,186,125,37,55,109,147,91,92,127,175,133,74,338,301,209,210,211,141,212,205,121,4,108,79,81,84,85,86,66,87,88,89,90,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,174,222,223,224,95,225,100,38,181,51,227,194,156,97,105,171,98,195,228,229,230,231,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,48,42,46,50,52,54,56,58,59,61,78,75,94,35,96,302,117,102,148,303,110,304,305,331,277]))),Xw=Ce(()=>ke(()=>import("./RoutineDetail-DPzql29w.js").then(e=>e.RoutineDetail),__vite__mapDeps([339,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,90,113,114,80,81,4,41,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,94,14,98,76,89,88,100,36,37,133,74,108,79,82,83,84,85,86,66,87,91,92,93,139,143,248,161,218,40,215,216,99,153,217,219,155,13,220,162,221,118,125,174,222,340,12,306,145,171,341,228,186,109,126,95,147,229,127,225,151,150,233,152,235,172,173,239,175,261,264,205,11,178,342,163,67,327,299,300,141,202,169,333,212,343]))),jB=Ce(()=>ke(()=>import("./UserProfile-CEpSKMzS.js").then(e=>e.UserProfile),__vite__mapDeps([344,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,90,161,7,9,221,197,198,127]))),Ql=Ce(()=>ke(()=>import("./ExecutionWorkspaceDetail-BxA_kWKs.js").then(e=>e.ExecutionWorkspaceDetail),__vite__mapDeps([345,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,101,125,140,141,134,80,81,4,40,6,145,98,37,55,109,184,146,126,95,185,186,187,188,91,92,127,100,38,175,168,84,261,275,65,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,58,59,156,99,74,76,163,161,67,172,82,83,173,250,209,210,211,212,205,121,108,79,85,86,66,87,88,89,90,93,213,214,143,144,41,215,216,153,217,218,113,114,115,219,155,13,220,162,221,118,174,222,223,224,225,181,226,227,194,97,105,171,195,228,229,230,231,232,233,199,39,200,234,235,236,237,238,201,202,239,203,240,241,242,243,36,244,119,276,251,280,327,299,300,151,150,152,169]))),wB=Ce(()=>ke(()=>import("./Goals-UrfBAjOT.js").then(e=>e.Goals),__vite__mapDeps([346,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,127,347,41]))),Zw=Ce(()=>ke(()=>import("./Artifacts-47GmGXVx.js").then(e=>e.Artifacts),__vite__mapDeps([348,1,3,16,17,20,208,18,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,4,6,34,12,35,36,37,38,113,114,80,81,41,214,7,9,76,125,95,127,317]))),kB=Ce(()=>ke(()=>import("./GoalDetail-C-uH9eNu.js").then(e=>e.GoalDetail),__vite__mapDeps([349,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,7,13,55,126,127,232,274,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,90,91,92,93,42,46,4,47,48,49,6,34,50,51,52,53,54,56,38,57,58,59,176,177,40,173,168,206,347,41]))),Jw=Ce(()=>ke(()=>import("./Approvals-CF4K0bD1.js").then(e=>e.Approvals),__vite__mapDeps([350,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,97,125,55,127,315,48,49,7,149,88,44,89,90,175,285,42,43,45,46,4,47,6,34,50,51,52,53,54,56,38,57,58,59,162]))),SB=Ce(()=>ke(()=>import("./ApprovalDetail-Cxhx_U0d.js").then(e=>e.ApprovalDetail),__vite__mapDeps([351,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,42,43,44,45,46,4,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,89,90,127,149,88,100,285,162,97]))),NB=Ce(()=>ke(()=>import("./CompanyActivity-BhNtXl8c.js").then(e=>e.CompanyActivity),__vite__mapDeps([352,1,3,353,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,108,134,80,81,9,139,354,144,65,40,41,337,7,10,54,13,14,286,162,272,98,95,175,186,125,44,89,90,88,37,55,109,99,74,76,147,229,325,91,92,127,149,172,82,83,4,173,119,318,165,166,167,355,356,277,343,357]))),Ad=Ce(()=>ke(()=>import("./AuditHub-DNmGrEzV.js").then(e=>e.AuditHub),__vite__mapDeps([353,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,108,134,80,81,9,139,354,144,65,40,41,337,7,10,54,13,14,286,162,272,98,95,175,186,125,44,89,90,88,37,55,109,99,74,76,147,229,325,91,92,127,149,172,82,83,4,173,119,318,165,166,167,355,356,277,343,357]))),CB=Ce(()=>ke(()=>import("./WhatNeedsMe-D0yh5L5H.js").then(e=>e.WhatNeedsMe),__vite__mapDeps([358,1,3,16,17,20,22,359,208,193,43,44,45,253,254,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,113,114,80,81,41,143,122,86,40,173,48,49,42,46,47,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,170,301,209,210,211,141,205,74,108,79,82,83,84,85,66,87,76,88,89,90,91,92,93,213,99,214,144,65,215,216,153,217,161,218,219,155,13,14,220,162,221,118,125,37,174,222,223,224,95,225,100,181,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,127,232,233,199,39,200,163,67,234,235,172,236,237,238,201,202,239,203,240,241,242,243,36,244,119,61,78,75,94,35,96,302,117,102,148,303,110,304,305,296,360,147,165,166,167,338,109,184,146]))),AB=Ce(()=>ke(()=>import("./DecisionQueuePage-DtzH_oQI.js").then(e=>e.DecisionQueuePage),__vite__mapDeps([361,1,3,16,17,20,22,359,208,193,43,44,45,253,254,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,113,114,80,81,41,143,122,86,40,173,48,49,42,46,47,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,170,301,209,210,211,141,205,74,108,79,82,83,84,85,66,87,76,88,89,90,91,92,93,213,99,214,144,65,215,216,153,217,161,218,219,155,13,14,220,162,221,118,125,37,174,222,223,224,95,225,100,181,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,127,232,233,199,39,200,163,67,234,235,172,236,237,238,201,202,239,203,240,241,242,243,36,244,119,61,78,75,94,35,96,302,117,102,148,303,110,304,305,296,360,147,165,166,167,338]))),_B=Ce(()=>ke(()=>import("./BoardChat-BenJSqr6.js").then(e=>e.BoardChat),__vite__mapDeps([362,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,113,114,80,81,4,41,139,39,40,161,363,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,61,170,263,94,364,307,98,87,183,118,85,83,88,89,90,184,146,92,127,35,175,112,115,116,117,76,99,74,100,36,37,133]))),EB=Ce(()=>ke(()=>import("./CompanySettings-C6FNik3j.js").then(e=>e.CompanySettings),__vite__mapDeps([365,1,3,16,17,20,22,21,212,25,8,26,205,74,27,7,9,40,215,23,24,4,76,216,31,99,153,217,10,13,125,37,141,95,198,127,232,233,172,82,83,80,173,238,41,47,118,85,201,65,30,304,366,209,210,211,19,28,29,5,32,33,121,108,79,43,44,45,81,84,86,66,87,88,89,90,91,92,93,213,214,143,144,161,49,6,218,113,114,115,219,155,53,14,220,162,221,174,222,34,223,224,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,199,39,200,163,67,234,235,236,237,202,239,57,203,240,241,242,243,36,244,119,355]))),IB=Ce(()=>ke(()=>import("./CompanyConnections-BwCkXXZK.js").then(e=>e.CompanyConnections),__vite__mapDeps([367,1,3,20,209,16,17,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,366,355,356]))),Uh=Ce(()=>ke(()=>import("./CompanyEnvironments-CyrghjsN.js").then(e=>e.CompanyEnvironments),__vite__mapDeps([368,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,205,74,7,9,214,4,218,113,114,80,81,41,40,215,76,216,99,153,217,161,115,219,155,53,13,14,220,162,221,118,85,83,125,37,174,222,227,12,156,171,55,141,127,225,236,121,108,95,100,172,82,173,238,47,233,201,65,202,203,297]))),TB=Ce(()=>ke(()=>import("./BootstrapSetupUxLab-DO03bmwI.js").then(e=>e.BootstrapSetupUxLab),__vite__mapDeps([369,1,3,7,8,9,97,33,98,175]))),RB=Ce(()=>ke(()=>import("./ResponsibleUserDenialUxLab-DGWo-GoD.js").then(e=>e.ResponsibleUserDenialUxLab),__vite__mapDeps([370,1,3,175,256,245,106,257]))),MB=Ce(()=>ke(()=>import("./CrossIssueCollaborationUxLab-D2bB9GTl.js").then(e=>e.CrossIssueCollaborationUxLab),__vite__mapDeps([371,1,3,293,245,143,49,219,97,106,165,166,167,90,25,8,26,89,175,313,118,85,83,125,9]))),DB=Ce(()=>ke(()=>import("./CompanySettingsPluginPage-DPHNF4sp.js").then(e=>e.CompanySettingsPluginPage),__vite__mapDeps([372,1,3,16,17,21,20,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,185,186,37,187,188,127]))),OB=Ce(()=>ke(()=>import("./CompanyAccess-BQZD0MZf.js").then(e=>e.CompanyAccess),__vite__mapDeps([373,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,90,134,80,81,9,4,6,7,97,171,125,37,55,99,74,76,147,185,186,187,188,197,198,127,38]))),LB=Ce(()=>ke(()=>import("./CompanyAccess-BQZD0MZf.js").then(e=>e.CompanyAccessLegacyRoute),__vite__mapDeps([373,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,90,134,80,81,9,4,6,7,97,171,125,37,55,99,74,76,147,185,186,187,188,197,198,127,38]))),ek=Ce(()=>ke(()=>import("./AdvancedToolsRoute-Bg4KowJU.js").then(e=>e.AdvancedToolsRoute),__vite__mapDeps([374,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,142,64,363,271,10,375,102,126,147,175,133,267,190,376,377,193]))),tk=Ce(()=>ke(()=>import("./ProfileWizardRoute-DvOWuvrG.js").then(e=>e.ProfileWizardRoute),__vite__mapDeps([378,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,108,40,41,7,9,302,13,76,125,37,95,230,127,100,234,88,44,89,90,229,172,82,83,80,173,174,267,98,175,377,193,55,126,91,92,379,162,147]))),zB=Ce(()=>ke(()=>import("./ProfileDetailRoute-YzeVN0Ko.js").then(e=>e.ProfileDetailRoute),__vite__mapDeps([380,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,108,142,6,7,9,97,171,167,125,37,99,74,76,95,230,127,100,267,98,175,376,377,193,55,126,91,92,379,162,147]))),PB=Ce(()=>ke(()=>import("./Browse-gMVDtSCz.js").then(e=>e.Browse),__vite__mapDeps([381,1,3,20,193,22,382,16,17,210,211,141,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,205,74,7,9,121,4,41,156,98,221,89,90,109,99,76,95,229,230,56,163,161,67,235,357,383,113,114,80,81,108,295,115,34,227,224,171,118,85,83,88,44,37,55,147,249,231,127,244,110,384,385,134,6,302,183,38,239,100,57]))),RA=Ce(()=>ke(()=>import("./AppsConnect-D7l2xnv-.js").then(e=>e.AppsConnect),__vite__mapDeps([386,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,383,387]))),$B=Ce(()=>ke(()=>import("./ChatEndpointSetup-CTntfzjg.js").then(e=>e.ChatEndpointSetup),__vite__mapDeps([388,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,108,47,6,34,219,155,7,9,98,228,186,118,85,83,88,44,89,90,37,55,141,126,99,74,76,95,198,249,127,100,234,41,229,38,243,36,389,214,143,230,175,110,305,261,265,162,238,40,233,201,65,390]))),nk=Ce(()=>ke(()=>import("./ChatEndpointDetail-DPiCCvto.js").then(e=>e.ChatEndpointDetail),__vite__mapDeps([391,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,205,74,7,9,121,4,113,114,80,81,41,108,79,43,44,45,82,83,84,85,86,66,87,76,88,89,90,91,92,93,139,354,144,40,47,42,46,48,49,6,34,50,51,52,53,54,55,56,38,57,58,59,115,11,12,13,156,171,98,118,125,37,99,95,147,249,230,231,127,100,233,242,241,110,261,392,234,229,235,389,214,143,126,175,305,265,162,238,201,65,390]))),UB=Ce(()=>ke(()=>import("./ChatIdentityConfirm-Dc4AnYX8.js").then(e=>e.ChatIdentityConfirm),__vite__mapDeps([393,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,198,249]))),BB=Ce(()=>ke(()=>import("./AppsReview-Chv6Jms5.js").then(e=>e.AppsReview),__vite__mapDeps([394,1,3,21,20,22,127,395,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,301,209,210,211,141,212,205,74,121,108,79,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,218,113,114,115,219,155,13,14,220,162,221,118,125,37,174,222,223,224,95,225,100,181,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,203,240,241,242,243,36,244,119,61,78,75,94,35,96,302,117,102,148,303,110,304,305]))),KB=Ce(()=>ke(()=>import("./AppDetail-CwyYWsvw.js").then(e=>e.AppDetail),__vite__mapDeps([396,1,3,16,17,20,22,209,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,382,109,56,357,383,147,308,384,387,392,389,126,175,110,305,261,265,395,42,46,48,50,52,54,58,59,301,61,78,75,94,35,96,302,117,102,148,303,304]))),ak=Ce(()=>ke(()=>import("./AppNotConnected-DzDZR0-8.js").then(e=>e.AppNotConnected),__vite__mapDeps([397,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,396,382,109,56,357,383,147,308,384,387,392,389,126,175,110,305,261,265,395,42,46,48,50,52,54,58,59,301,61,78,75,94,35,96,302,117,102,148,303,304]))),sk=Ce(()=>ke(()=>import("./GatewaysList-Ad1dZuwC.js").then(e=>e.GatewaysList),__vite__mapDeps([398,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,37,55,126,95,229,230,127,233,267,98,125,175,399,139,6,53,99,74,76,38]))),qB=Ce(()=>ke(()=>import("./GatewayDetail-CUcpw4Hj.js").then(e=>e.GatewayDetail),__vite__mapDeps([400,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,65,248,4,40,75,41,173,215,7,9,76,216,74,99,153,217,47,310,6,53,271,13,364,118,85,83,37,55,126,95,229,230,127,233,38,267,98,125,175,399,139]))),FB=Ce(()=>ke(()=>import("./CompanySkills-DsgjKlp7.js").then(e=>e.CompanySkills),__vite__mapDeps([401,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,113,114,80,81,41,134,9,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,90,91,92,93,214,40,75,161,47,42,46,48,49,6,34,50,51,52,53,7,54,55,56,38,57,58,59,310,115,155,61,181,300,227,68,11,13,156,220,307,162,97,171,98,102,183,118,125,37,126,99,95,127,149,100,163,67,234,229,242,241,36,260,261,178,402,326,205,133,403]))),ik=Ce(()=>ke(()=>import("./SkillSources-CYYp9Mds.js").then(e=>e.SkillSources),__vite__mapDeps([404,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,113,114,80,81,4,41,161,135,34,61,7,9,13,156,98,99,74,76,95,56,127,216,244,77,403,405,67,125,387]))),Bh=Ce(()=>ke(()=>import("./SkillStudio-Dl28fokd.js").then(e=>e.SkillStudio),__vite__mapDeps([406,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,90,113,114,80,81,4,41,108,134,9,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,91,92,93,214,40,215,7,216,99,153,217,407,65,155,223,121,6,53,224,162,118,125,37,95,225,100,38,335,49,42,46,47,48,34,50,51,52,54,55,56,57,58,59,115,61,181,330,67,71,301,209,210,211,141,205,213,143,144,161,218,219,13,14,220,221,174,222,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,173,236,237,238,201,202,239,203,240,241,242,243,36,244,119,78,75,94,35,96,302,117,102,148,303,110,304,305,149,150,175,73,77,177,133,260,206,178,130,402,403,401,310,300,68,11,307,183,126,261,326,408,409]))),HB=Ce(()=>ke(()=>import("./Secrets-BOZydXaY.js").then(e=>e.Secrets),__vite__mapDeps([410,1,3,16,17,20,21,22,121,25,8,4,113,26,114,80,27,81,41,5,134,9,23,24,142,46,143,75,161,48,298,6,115,34,223,108,53,7,224,162,118,85,83,125,88,44,89,90,37,99,74,76,95,225,100,38,51,124,226,67,227,340,13,156,31,97,171,98,221,102,55,147,197,198,229,127,234,172,82,40,173,222,36,133]))),VB=Ce(()=>ke(()=>import("./CompanyImport-5M7yWHR-.js").then(e=>e.CompanyImport),__vite__mapDeps([411,1,3,20,22,209,16,17,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,42,46,48,50,52,54,56,58,59,412,413,414]))),WB=Ce(()=>ke(()=>import("./DesignGuide-CXHLyL_C.js").then(e=>e.DesignGuide),__vite__mapDeps([415,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,247,134,64,312,11,35,152,150,42,46,48,50,52,54,56,58,59,63,61,68,69,70,18,62,71,72,73,75,77,78,94,96,101,102,103,182,104,416,301,302,117,148,303,110,304,305,417,360,183,307,149,175,107,109,157,309,310,145,284,311,245,116,154,251,287,159,160,164,252,253,254,313,166,274,176,177,168,133,262,263,266,267,206,130,402,189,405,342,408,288,289,409]))),QB=Ce(()=>ke(()=>import("./InstanceFeatures-C1eqcxDI.js").then(e=>e.InstanceFeatures),__vite__mapDeps([418,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,125,9,95,188,127,419,141,197,198,233]))),GB=Ce(()=>ke(()=>import("./AgentDefaults-C0WFwQky.js").then(e=>e.AgentDefaults),__vite__mapDeps([420,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,143,55,127,258,259,7,9,14,76,125,172,82,83,80,4,40,173,119]))),YB=Ce(()=>ke(()=>import("./OmpAllSettings-DTJLATQL.js").then(e=>e.n).then(e=>e.OmpAllSettingsPage),__vite__mapDeps([268,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,214,7,9,14,125,55,95,127,100,233,172,82,83,80,4,40,173,174,258,259,76,119]))),XB=Ce(()=>ke(()=>import("./ModelsAndProviders-C7VZHvPR.js").then(e=>e.ModelsAndProviders),__vite__mapDeps([421,1,3,20,21,22,7,8,9,13,156,55,127,258]))),ZB=Ce(()=>ke(()=>import("./InstanceAdvanced-DYZ50o97.js").then(e=>e.InstanceAdvanced),__vite__mapDeps([422,1,3,7,8,9,12,14,98,125,127,419,20,141,197,198,233]))),JB=Ce(()=>ke(()=>import("./InstanceAccess-D4ZbGCeK.js").then(e=>e.InstanceAccess),__vite__mapDeps([423,1,3,20,22,121,25,8,4,7,9,97,32,37,147,127,175]))),eK=Ce(()=>ke(()=>import("./ProfileSettings-BLh9EdSK.js").then(e=>e.ProfileSettings),__vite__mapDeps([424,1,3,20,22,21,90,25,8,26,108,226,7,9,12,220,364,171,195,55,95,127,232,233,234,121,4,23,24,27,41,88,44,89,229,235,172,82,83,80,40,173,175]))),tK=Ce(()=>ke(()=>import("./PluginManager-DkADWuR8.js").then(e=>e.PluginManager),__vite__mapDeps([425,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,108,181,7,9,13,375,307,171,98,125,37,99,74,76,95,187,127,175]))),nK=Ce(()=>ke(()=>import("./PluginSettings-D365WG22.js").then(e=>e.PluginSettings),__vite__mapDeps([426,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,213,99,74,7,76,214,86,48,49,51,220,162,98,341,125,187,185,186,37,188,127,236,121,4,108,40,41,161,219,155,53,13,171,95,225,100,172,82,83,173,175,168,84,140,141]))),rk=Ce(()=>ke(()=>import("./AdapterManager-C59AKY0f.js").then(e=>e.AdapterManager),__vite__mapDeps([427,1,3,20,21,22,108,25,8,213,33,99,74,26,27,7,9,76,30,51,13,375,156,171,98,125,37,95,127,237,23,24,40,199,39,200,4,31,174,238,41,47,118,85,83,233,201,65,240,241,175]))),lk=Ce(()=>ke(()=>import("./PluginPage-C-W3lTd9.js").then(e=>e.PluginPage),__vite__mapDeps([428,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,214,7,9,187,185,186,37,188,127]))),aK=Ce(()=>ke(()=>import("./NewAgent-BzZI-FBE.js").then(e=>e.NewAgent),__vite__mapDeps([429,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119]))),sK=Ce(()=>ke(()=>import("./Auth-D0lGuVnd.js").then(e=>e.AuthPage),__vite__mapDeps([430,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,417,360,183,58,198,431]))),iK=Ce(()=>ke(()=>import("./BoardClaim-CbYY66Qd.js").then(e=>e.BoardClaimPage),__vite__mapDeps([432,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,175]))),rK=Ce(()=>ke(()=>import("./AssistantConnection-BCrEgmJR.js").then(e=>e.AssistantConnection),__vite__mapDeps([385,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,4,6,34,7,302,183,89,90,127,38,239,76,100,57,384]))),ok=Ce(()=>ke(()=>import("./McpConnect-BYYMfbhs.js").then(e=>e.McpConnectPage),__vite__mapDeps([433,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,183,89,90,95,175,384]))),lK=Ce(()=>ke(()=>import("./McpConnect-BYYMfbhs.js").then(e=>e.McpDevicePage),__vite__mapDeps([433,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,183,89,90,95,175,384]))),oK=Ce(()=>ke(()=>import("./McpConnect-BYYMfbhs.js").then(e=>e.AssistantConnectionsPage),__vite__mapDeps([433,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,183,89,90,95,175,384]))),cK=Ce(()=>ke(()=>import("./CliAuth-CatEsBxW.js").then(e=>e.CliAuthPage),__vite__mapDeps([434,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,175]))),uK=Ce(()=>ke(()=>import("./InviteLanding-Bqp1ulQV.js").then(e=>e.InviteLandingPage),__vite__mapDeps([435,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,198,201,65,431]))),ck=Ce(()=>ke(()=>import("./PublicIssueSharePage-Cg0GqSVM.js").then(e=>e.PublicIssueSharePage),__vite__mapDeps([436,1,3,16,17,20,214,42,43,44,45,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,46,4,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,60,61,62,89,90,229,316]))),dK=Ce(()=>ke(()=>import("./JoinRequestQueue-DyPP4DL2.js").then(e=>e.JoinRequestQueue),__vite__mapDeps([437,1,3,20,21,22,7,8,9,125,37,147,127,175]))),MA=Ce(()=>ke(()=>Promise.resolve().then(()=>X8).then(e=>e.NotFoundPage),void 0)),fc=Ce(()=>ke(()=>import("./Inbox-BzkFmAxU.js").then(e=>e.n).then(e=>e.Inbox),__vite__mapDeps([283,1,3,16,17,20,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,46,122,4,41,48,49,226,7,11,13,14,98,87,76,186,89,90,37,55,109,141,184,146,126,99,74,147,284,148,127,149,88,44,175,59,285,42,43,45,47,6,34,50,51,52,53,54,56,38,57,58,162,97,168,84]))),fK=Ce(()=>ke(()=>import("./CompanyExport-BlQuIvDU.js").then(e=>e.CompanyExport),__vite__mapDeps([438,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,42,43,44,45,46,4,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,14,76,37,126,127,77,414]))),pK=Ce(()=>ke(()=>import("./Terminal-YAhWrMv9.js").then(e=>e.Terminal),__vite__mapDeps([439,1,3,16,17,20,294,25,8,114,80,26,27,81,39,200,295,6,7,9,296,31,195,76,95,38,36,37,297,21,22,19,23,24,28,29,5,30,32,33,212,108,4,40,48,298,53,13,72,105,98,99,74,147,127,216,100,172,82,83,173,202,119,408])));function mK({children:e}){return(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:e})}r(mK,"ProductionSurface");function hK(e){const t=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{index:!0,element:(0,a.jsx)(We,{to:"dashboard",replace:!0})}),(0,a.jsx)(L,{path:"dashboard",element:(0,a.jsx)(nB,{})}),(0,a.jsx)(L,{path:"dashboard/live",element:(0,a.jsx)(We,{to:pI("all"),replace:!0})}),(0,a.jsx)(L,{path:"timeline",element:(0,a.jsx)(Gs,{to:"/activity/timeline"})}),(0,a.jsx)(L,{path:"onboarding",element:(0,a.jsx)(LA,{})}),(0,a.jsx)(L,{path:"companies",element:(0,a.jsx)(aB,{})}),(0,a.jsx)(L,{path:"company/settings",element:(0,a.jsx)(EB,{})}),(0,a.jsx)(L,{path:"company/settings/connections",element:(0,a.jsx)(IB,{})}),(0,a.jsx)(L,{path:"company/settings/agent-defaults",element:(0,a.jsx)(GB,{})}),(0,a.jsx)(L,{path:"company/settings/agent-defaults/all",element:(0,a.jsx)(YB,{})}),(0,a.jsx)(L,{path:"company/settings/models",element:(0,a.jsx)(XB,{})}),(0,a.jsx)(L,{path:"company/settings/environments",element:(0,a.jsx)(We,{to:"/company/settings/instance/environments",replace:!0})}),(0,a.jsx)(L,{path:"company/settings/cloud-upstream",element:(0,a.jsx)(We,{to:"/company/export",replace:!0})}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"company.members"}),children:[(0,a.jsx)(L,{path:"company/settings/members",element:(0,a.jsx)(OB,{})}),(0,a.jsx)(L,{path:"company/settings/access",element:(0,a.jsx)(LB,{})})]}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.invites"}),children:(0,a.jsx)(L,{path:"company/settings/invites",element:(0,a.jsx)(We,{to:"/company/settings/members?tab=invites",replace:!0})})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.export"}),children:(0,a.jsx)(L,{path:"company/export/*",element:(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:(0,a.jsx)(fK,{})})})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.import"}),children:(0,a.jsx)(L,{path:"company/import",element:(0,a.jsx)(VB,{})})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.secrets"}),children:(0,a.jsx)(L,{path:"company/settings/secrets",element:(0,a.jsx)(HB,{})})}),(0,a.jsx)(L,{path:"company/settings/tools",element:(0,a.jsx)(fk,{})}),(0,a.jsx)(L,{path:"company/settings/tools/:tab",element:(0,a.jsx)(fk,{})}),(0,a.jsx)(L,{path:"tools",element:(0,a.jsx)(pk,{})}),(0,a.jsx)(L,{path:"tools/:tab",element:(0,a.jsx)(pk,{})}),(0,a.jsx)(L,{path:"apps",element:(0,a.jsx)(PB,{})}),(0,a.jsx)(L,{path:"apps/assistant-connection",element:(0,a.jsx)(rK,{})}),(0,a.jsx)(L,{path:"apps/browse",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/connections",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/byo",element:(0,a.jsx)(RA,{byoOnly:!0})}),(0,a.jsx)(L,{path:"apps/vercel-connect",element:(0,a.jsx)(uk,{credentialSource:"vercel_connect"})}),(0,a.jsx)(L,{path:"apps/connect",element:(0,a.jsx)(uk,{})}),(0,a.jsx)(L,{path:"apps/chat/connect",element:(0,a.jsx)(Cd,{children:(0,a.jsx)($B,{})})}),(0,a.jsx)(L,{path:"apps/chat/:endpointId",element:(0,a.jsx)(Cd,{children:(0,a.jsx)(We,{to:"settings",replace:!0})})}),(0,a.jsx)(L,{path:"apps/chat/:endpointId/reviews/:reviewId",element:(0,a.jsx)(Cd,{children:(0,a.jsx)(nk,{})})}),(0,a.jsx)(L,{path:"apps/chat/:endpointId/:tab",element:(0,a.jsx)(Cd,{children:(0,a.jsx)(nk,{})})}),(0,a.jsx)(L,{path:"apps/connect/:appKey",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/connect/:appKey/:stage",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/review",element:(0,a.jsx)(BB,{})}),(0,a.jsx)(L,{path:"apps/attention",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/gateways",element:(0,a.jsx)(sk,{})}),(0,a.jsx)(L,{path:"apps/gateways/:gatewayId",element:(0,a.jsx)(We,{to:"overview",replace:!0})}),(0,a.jsx)(L,{path:"apps/gateways/:gatewayId/:tab",element:(0,a.jsx)(qB,{})}),(0,a.jsx)(L,{path:"apps/advanced",element:(0,a.jsx)(ek,{})}),(0,a.jsx)(L,{path:"apps/advanced/gateways",element:(0,a.jsx)(sk,{})}),(0,a.jsx)(L,{path:"apps/advanced/profiles/new",element:(0,a.jsx)(tk,{mode:"new"})}),(0,a.jsx)(L,{path:"apps/advanced/profiles/:profileId/edit",element:(0,a.jsx)(tk,{mode:"edit"})}),(0,a.jsx)(L,{path:"apps/advanced/profiles/:profileId",element:(0,a.jsx)(zB,{})}),(0,a.jsx)(L,{path:"apps/advanced/audit",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/advanced/run-your-own",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/advanced/:tab",element:(0,a.jsx)(ek,{})}),(0,a.jsx)(L,{path:"apps/app/:applicationId",element:(0,a.jsx)(ak,{})}),(0,a.jsx)(L,{path:"apps/app/:applicationId/:tab",element:(0,a.jsx)(ak,{})}),(0,a.jsx)(L,{path:"apps/:connectionId",element:(0,a.jsx)(We,{to:"permissions",replace:!0})}),(0,a.jsx)(L,{path:"apps/:connectionId/:tab",element:(0,a.jsx)(KB,{})}),(0,a.jsx)(L,{path:"company/settings/instance",element:(0,a.jsx)(We,{to:"/company/settings",replace:!0})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.profile"}),children:(0,a.jsx)(L,{path:"company/settings/instance/profile",element:(0,a.jsx)(eK,{})})}),(0,a.jsx)(L,{path:"company/settings/instance/general",element:(0,a.jsx)(We,{to:"/company/settings",replace:!0})}),(0,a.jsx)(L,{path:"company/settings/instance/heartbeats",element:(0,a.jsx)(We,{to:"/company/settings",replace:!0})}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.environments"}),children:[(0,a.jsx)(L,{path:"company/settings/instance/environments",element:(0,a.jsx)(Uh,{})}),(0,a.jsx)(L,{path:"company/settings/instance/environments/new",element:(0,a.jsx)(Uh,{mode:"create"})}),(0,a.jsx)(L,{path:"company/settings/instance/environments/:environmentId/edit",element:(0,a.jsx)(Uh,{mode:"edit"})})]}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.access"}),children:(0,a.jsx)(L,{path:"company/settings/instance/access",element:(0,a.jsx)(JB,{})})}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.experimental"}),children:[(0,a.jsx)(L,{path:"company/settings/instance/features",element:(0,a.jsx)(QB,{})}),(0,a.jsx)(L,{path:"company/settings/instance/advanced",element:(0,a.jsx)(ZB,{})}),(0,a.jsx)(L,{path:"company/settings/instance/experimental",element:(0,a.jsx)(We,{to:"/company/settings/instance/features",replace:!0})})]}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.plugins"}),children:[(0,a.jsx)(L,{path:"company/settings/instance/plugins",element:(0,a.jsx)(tK,{})}),(0,a.jsx)(L,{path:"company/settings/instance/plugins/:pluginId",element:(0,a.jsx)(nK,{})})]}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.adapters"}),children:(0,a.jsx)(L,{path:"company/settings/instance/adapters",element:(0,a.jsx)(rk,{})})}),(0,a.jsx)(L,{path:"company/settings/:settingsRoutePath/*",element:(0,a.jsx)(DB,{})}),(0,a.jsx)(L,{path:"skills/sources",element:(0,a.jsx)(ik,{})}),(0,a.jsx)(L,{path:"skills/sources/:sourceId",element:(0,a.jsx)(ik,{})}),(0,a.jsx)(L,{path:"skills/studio",element:(0,a.jsx)(Bh,{})}),(0,a.jsx)(L,{path:"skills/studio/new",element:(0,a.jsx)(Bh,{})}),(0,a.jsx)(L,{path:"skills/studio/:skillId",element:(0,a.jsx)(Bh,{})}),(0,a.jsx)(L,{path:"skills/:skillId/studio",element:(0,a.jsx)(DA,{})}),(0,a.jsx)(L,{path:"skills/*",element:(0,a.jsx)(FB,{})}),(0,a.jsx)(L,{path:"settings",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"settings/*",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"plugins/:pluginId",element:(0,a.jsx)(lk,{})}),(0,a.jsx)(L,{path:"org",element:(0,a.jsx)(We,{to:"/agents/all",replace:!0})}),(0,a.jsx)(L,{path:"agents",element:(0,a.jsx)(We,{to:"/agents/all",replace:!0})}),TA.map(s=>(0,a.jsx)(L,{path:`agents/${s}`,element:(0,a.jsx)(sB,{})},s)),(0,a.jsx)(L,{path:"agents/new",element:(0,a.jsx)(aK,{})}),(0,a.jsx)(L,{path:"agents/:agentId",element:(0,a.jsx)(Ph,{})}),(0,a.jsx)(L,{path:"agents/:agentId/:tab",element:(0,a.jsx)(Ph,{})}),(0,a.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,a.jsx)(Ph,{})}),(0,a.jsx)(L,{path:"projects",element:(0,a.jsx)(iB,{})}),(0,a.jsx)(L,{path:"projects/:projectId",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/overview",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Ih,{}),children:(0,a.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,a.jsx)(rB,{})})}),(0,a.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/configuration",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/budget",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Ih,{}),children:(0,a.jsx)(L,{path:"workspaces",element:(0,a.jsx)(lB,{})})}),(0,a.jsx)(L,{path:"terminal",element:(0,a.jsx)(mK,{children:(0,a.jsx)(pK,{})})}),(0,a.jsx)(L,{path:"issues",element:(0,a.jsx)(oB,{})}),(0,a.jsx)(L,{path:"tasks",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"tasks/new",element:(0,a.jsx)(V6,{})}),(0,a.jsx)(L,{path:"search",element:(0,a.jsx)(cB,{})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"issues/all",element:(0,a.jsx)(xs,{view:"all"})}),(0,a.jsx)(L,{path:"issues/active",element:(0,a.jsx)(xs,{view:"active"})}),(0,a.jsx)(L,{path:"issues/backlog",element:(0,a.jsx)(xs,{view:"backlog"})}),(0,a.jsx)(L,{path:"issues/done",element:(0,a.jsx)(xs,{view:"done"})}),(0,a.jsx)(L,{path:"issues/recent",element:(0,a.jsx)(xs,{view:"recent"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"issues/all",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/active",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/backlog",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/done",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/recent",element:(0,a.jsx)(We,{to:"/issues",replace:!0})})]}),(0,a.jsx)(L,{path:"chats",element:(0,a.jsx)(dB,{})}),(0,a.jsx)(L,{path:"chats/:agentRef",element:(0,a.jsx)(fB,{})}),(0,a.jsx)(L,{path:"issues/:issueId",element:(0,a.jsx)(uB,{})}),null,(0,a.jsx)(L,{path:"routines",element:(0,a.jsx)(mB,{})}),(0,a.jsx)(L,{path:"cases",element:(0,a.jsx)(qw,{children:(0,a.jsx)(eB,{})})}),(0,a.jsx)(L,{path:"cases/:caseIdentifier",element:(0,a.jsx)(qw,{children:(0,a.jsx)(tB,{})})}),(0,a.jsx)(L,{path:"pixels-office",element:(0,a.jsx)(i6,{children:(0,a.jsx)(yB,{})})}),(0,a.jsx)(L,{path:"status",element:(0,a.jsx)(Fw,{children:(0,a.jsx)(Yw,{})})}),(0,a.jsx)(L,{path:"status/:cardId",element:(0,a.jsx)(Fw,{children:(0,a.jsx)(Yw,{})})}),(0,a.jsx)(L,{path:"status-cards",element:(0,a.jsx)(mk,{})}),(0,a.jsx)(L,{path:"status-cards/:cardId",element:(0,a.jsx)(mk,{})}),(0,a.jsx)(L,{path:"review-queue",element:(0,a.jsx)(nr,{children:(0,a.jsx)(bB,{})})}),(0,a.jsx)(L,{path:"learnings",element:(0,a.jsx)(nr,{children:(0,a.jsx)(hB,{})})}),(0,a.jsx)(L,{path:"pipelines",element:(0,a.jsx)(nr,{children:(0,a.jsx)($h,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId",element:(0,a.jsx)(nr,{children:(0,a.jsx)($h,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,a.jsx)(nr,{children:(0,a.jsx)($h,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,a.jsx)(nr,{children:(0,a.jsx)(vB,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,a.jsx)(nr,{children:(0,a.jsx)(gB,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,a.jsx)(nr,{children:(0,a.jsx)(xB,{})})}),(0,a.jsx)(L,{path:"routines/:routineId",element:(0,a.jsx)(Xw,{})}),(0,a.jsx)(L,{path:"routines/:routineId/:section",element:(0,a.jsx)(Xw,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Ih,{}),children:(0,a.jsxs)(L,{element:(0,a.jsx)(r6,{}),children:[(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,a.jsx)(Ql,{})})]})}),(0,a.jsx)(L,{path:"goals",element:(0,a.jsx)(wB,{})}),(0,a.jsx)(L,{path:"goals/:goalId",element:(0,a.jsx)(kB,{})}),(0,a.jsx)(L,{path:"artifacts",element:(0,a.jsx)(Zw,{})}),(0,a.jsx)(L,{path:"approvals",element:(0,a.jsx)(We,{to:"/approvals/pending",replace:!0})}),(0,a.jsx)(L,{path:"approvals/pending",element:(0,a.jsx)(Jw,{})}),(0,a.jsx)(L,{path:"approvals/all",element:(0,a.jsx)(Jw,{})}),(0,a.jsx)(L,{path:"approvals/:approvalId",element:(0,a.jsx)(SB,{})}),(0,a.jsx)(L,{path:"activity",element:(0,a.jsx)(NB,{})}),(0,a.jsx)(L,{path:"activity/runs",element:(0,a.jsx)(Ad,{section:"runs"})}),(0,a.jsx)(L,{path:"activity/costs",element:(0,a.jsx)(Ad,{section:"costs"})}),(0,a.jsx)(L,{path:"activity/budgets",element:(0,a.jsx)(Ad,{section:"budgets"})}),(0,a.jsx)(L,{path:"activity/timeline",element:(0,a.jsx)(Ad,{section:"timeline"})}),(0,a.jsx)(L,{path:"audit",element:(0,a.jsx)(Gs,{to:"/activity",forceAgentMode:!0})}),(0,a.jsx)(L,{path:"audit/activity",element:(0,a.jsx)(Gs,{to:"/activity"})}),(0,a.jsx)(L,{path:"audit/runs",element:(0,a.jsx)(Gs,{to:"/activity/runs"})}),(0,a.jsx)(L,{path:"audit/costs",element:(0,a.jsx)(Gs,{to:"/activity/costs"})}),(0,a.jsx)(L,{path:"audit/budgets",element:(0,a.jsx)(Gs,{to:"/activity/budgets"})}),(0,a.jsx)(L,{path:"audit/timeline",element:(0,a.jsx)(Gs,{to:"/activity/timeline"})}),(0,a.jsx)(L,{path:"runs",element:(0,a.jsx)(Gs,{to:"/activity/runs"})}),(0,a.jsx)(L,{path:"costs",element:(0,a.jsx)(Gs,{to:"/activity/costs"})}),(0,a.jsx)(L,{path:"budgets",element:(0,a.jsx)(Gs,{to:"/activity/budgets"})}),(0,a.jsxs)(L,{element:(0,a.jsx)(s6,{}),children:[(0,a.jsx)(L,{path:"board-chat",element:(0,a.jsx)(_B,{})}),(0,a.jsx)(L,{path:"artifacts",element:(0,a.jsx)(Zw,{})})]}),null,(0,a.jsx)(L,{path:"decisions",element:(0,a.jsx)(CB,{})}),(0,a.jsx)(L,{path:"decisions/queues/:key",element:(0,a.jsx)(AB,{})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"inbox",element:(0,a.jsx)(dk,{})}),(0,a.jsx)(L,{path:"inbox/mine",element:(0,a.jsx)(xs,{view:"mine"})}),(0,a.jsx)(L,{path:"inbox/recent",element:(0,a.jsx)(xs,{view:"recent"})}),(0,a.jsx)(L,{path:"inbox/unread",element:(0,a.jsx)(xs,{view:"unread"})}),(0,a.jsx)(L,{path:"inbox/blocked",element:(0,a.jsx)(xs,{view:"blocked"})}),(0,a.jsx)(L,{path:"inbox/all",element:(0,a.jsx)(xs,{view:"everything"})}),(0,a.jsx)(L,{path:"inbox/new",element:(0,a.jsx)(xs,{view:"mine"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"inbox",element:(0,a.jsx)(dk,{})}),(0,a.jsx)(L,{path:"inbox/mine",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/recent",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/unread",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/blocked",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/all",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/new",element:(0,a.jsx)(We,{to:"/inbox/mine",replace:!0})})]}),(0,a.jsx)(L,{path:"inbox/requests",element:(0,a.jsx)(dK,{})}),(0,a.jsx)(L,{path:"u/:userSlug",element:(0,a.jsx)(jB,{})}),(0,a.jsx)(L,{path:"design-guide",element:(0,a.jsx)(WB,{})}),(0,a.jsx)(L,{path:"instance/settings/adapters",element:(0,a.jsx)(rk,{})}),(0,a.jsx)(L,{path:":pluginRoutePath/*",element:(0,a.jsx)(lk,{})}),(0,a.jsx)(L,{path:"*",element:(0,a.jsx)(MA,{scope:"board"})})]})}r(hK,"boardRoutes");function uk({credentialSource:e="wardmote_vault"}={}){const t=hn(),s=new URLSearchParams(t.search),{enabled:l,githubEnabled:c}=w0();return qT(s,{chatConnectorsEnabled:l,githubReviewBotsEnabled:c})?(0,a.jsx)(RA,{credentialSource:e}):(0,a.jsx)(We,{to:"/apps",replace:!0})}r(uk,"AppsConnectEntryRoute");function dk(){const{enabled:e}=Zf();return e?(0,a.jsx)(xs,{view:gI(Rj())}):(0,a.jsx)(We,{to:`/inbox/${Rj()}`,replace:!0})}r(dk,"InboxRootRedirect");function xs({view:e}){const t=hn(),s=new URLSearchParams(t.search);return s.set(uI,e),(0,a.jsx)(We,{to:`/issues?${s.toString()}${t.hash}`,replace:!0})}r(xs,"TaskViewRedirect");function DA(){const e=hn(),{companies:t,selectedCompany:s,loading:l}=vt(),{companyPrefix:c,skillId:u}=zs();if(l)return null;const p=(c?t.find(f=>f.issuePrefix.toUpperCase()===c.toUpperCase()):null)??s??t[0]??null;return!p||!u?(0,a.jsx)(We,{to:"/skills/studio",replace:!0}):(0,a.jsx)(We,{to:`/${p.issuePrefix}/skills/studio/${encodeURIComponent(u)}${e.search}${e.hash}`,replace:!0})}r(DA,"LegacySkillStudioRedirect");function qr(){const e=hn(),{companies:t,selectedCompany:s,loading:l}=vt(),{companyPrefix:c}=zs(),{hidden:u}=hr();if(l)return(0,a.jsx)(Ms,{});const p=(c?t.find(h=>h.issuePrefix.toUpperCase()===c.toUpperCase()):null)??s??t[0]??null;if(!p)return mx({pathname:e.pathname,hasCompanies:!1})?(0,a.jsx)(We,{to:"/onboarding",replace:!0}):(0,a.jsx)(xx,{});const f=rT(lT(`${e.pathname}${e.search}${e.hash}`),u);return(0,a.jsx)(We,{to:`/${p.issuePrefix}${f}`,replace:!0})}r(qr,"LegacySettingsRedirect");function fk(){const{tab:e}=zs();return(0,a.jsx)(We,{to:OA(e),replace:!0})}r(fk,"LegacyToolsSettingsRedirect");function pk(){const{tab:e}=zs();return(0,a.jsx)(We,{to:OA(e),replace:!0})}r(pk,"LegacyToolsRedirect");function OA(e){return e?e==="applications"||e==="connections"||e==="overview"||e==="examples"||e==="runtime"||e==="audit"?"/apps":e==="policies"?"/apps/advanced/profiles":`/apps/advanced/${e}`:"/apps/advanced/profiles"}r(OA,"legacyToolsRedirectTarget");function LA(){const{companies:e}=vt(),{openOnboarding:t}=$s(),{t:s}=IN(),{onboardingOpen:l,onboardingRouteDismissed:c}=qf(),{companyPrefix:u}=zs(),p=u?e.find(g=>g.issuePrefix.toUpperCase()===u.toUpperCase())??null:null;if(lU({onboardingOpen:l,routeDismissed:c}))return null;const f=p?`Add another agent to ${p.name}`:e.length>0?"Create another organization":"Create your first organization",h=p?"Run onboarding again to add an agent and a starter task for this organization.":e.length>0?"Run onboarding again to create another organization and seed its first agent.":"Get started by creating an organization and your first agent.";return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:f}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:h}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(oe,{onClick:r(()=>p?t({initialStep:gA(),companyId:p.id}):t(),"onClick"),children:p?"Add Agent":"Start Onboarding"})})]})})}r(LA,"OnboardingRoutePage");function gK(){const{companies:e,selectedCompany:t,loading:s}=vt(),l=hn();if(s)return(0,a.jsx)(Ms,{});const c=t??e[0]??null;return c?(0,a.jsx)(We,{to:`/${c.issuePrefix}/dashboard`,replace:!0}):mx({pathname:l.pathname,hasCompanies:!1})?(0,a.jsx)(We,{to:"/onboarding",replace:!0}):(0,a.jsx)(xx,{})}r(gK,"CompanyRootRedirect");function mk(){const{cardId:e}=zs(),t=hI(),s=t?`/${t}`:"";return(0,a.jsx)(We,{to:`${s}/status${e?`/${e}`:""}`,replace:!0})}r(mk,"StatusCardsLegacyRedirect");function Gs({to:e,forceAgentMode:t=!1}){const s=hn(),l=new URLSearchParams(s.search);t&&l.set("mode","agents");const c=l.toString();return(0,a.jsx)(We,{to:`${e}${c?`?${c}`:""}${s.hash}`,replace:!0})}r(Gs,"AuditCompatibilityRedirect");function Ze(){const e=hn(),{companies:t,selectedCompany:s,loading:l}=vt();if(l)return(0,a.jsx)(Ms,{});const c=s??t[0]??null;return c?(0,a.jsx)(We,{to:`/${c.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):mx({pathname:e.pathname,hasCompanies:!1})?(0,a.jsx)(We,{to:"/onboarding",replace:!0}):(0,a.jsx)(xx,{})}r(Ze,"UnprefixedBoardRedirect");function xx(){const{openOnboarding:e}=$s(),{t}=IN();return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:t("app.noCompanies.title",{defaultValue:"Create your first organization"})}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:t("app.noCompanies.description",{defaultValue:"Get started by creating an organization."})}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(oe,{onClick:r(()=>e(),"onClick"),children:t("app.noCompanies.newCompany",{defaultValue:"New Organization"})})})]})})}r(xx,"NoCompaniesStartPage");function xK(){const{enabled:e}=Zf();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:(0,a.jsxs)(OE,{children:[(0,a.jsx)(L,{path:"auth",element:(0,a.jsx)(sK,{})}),(0,a.jsx)(L,{path:"board-claim/:token",element:(0,a.jsx)(iK,{})}),(0,a.jsx)(L,{path:"mcp-connect/:id",element:(0,a.jsx)(ok,{})}),(0,a.jsx)(L,{path:"dot-connect/:id",element:(0,a.jsx)(ok,{agentPairingOnly:!0})}),(0,a.jsx)(L,{path:"mcp-device",element:(0,a.jsx)(lK,{})}),(0,a.jsx)(L,{path:"assistant-connections",element:(0,a.jsx)(oK,{})}),(0,a.jsx)(L,{path:"cli-auth/:id",element:(0,a.jsx)(cK,{})}),(0,a.jsx)(L,{path:"invite/:token",element:(0,a.jsx)(uK,{})}),(0,a.jsx)(L,{path:"s/:token",element:(0,a.jsx)(ck,{})}),(0,a.jsx)(L,{path:"s/:token/issues/:issueId",element:(0,a.jsx)(ck,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Gw,{allowMembershipRequest:!0}),children:(0,a.jsx)(L,{path:"chat-identity/confirm",element:(0,a.jsx)(UB,{})})}),(0,a.jsx)(L,{path:"tests/perf/long-thread",element:(0,a.jsx)(pB,{})}),(0,a.jsx)(L,{path:"ux-lab/bootstrap-setup",element:(0,a.jsx)(TB,{})}),(0,a.jsx)(L,{path:"ux-lab/responsible-user-denial",element:(0,a.jsx)(RB,{})}),(0,a.jsx)(L,{path:"ux-lab/cross-issue-collaboration",element:(0,a.jsx)(MB,{})}),(0,a.jsxs)(L,{element:(0,a.jsx)(Gw,{}),children:[(0,a.jsx)(L,{index:!0,element:(0,a.jsx)(gK,{})}),(0,a.jsx)(L,{path:"onboarding",element:(0,a.jsx)(LA,{})}),(0,a.jsx)(L,{path:"instance",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"instance/settings",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"instance/settings/*",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"companies",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"dashboard",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"inbox/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"issues",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"tasks",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"tasks/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"issues/:issueId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"routines",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"routines/:routineId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"review-queue",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"learnings",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"cases",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"cases/:caseIdentifier",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pixels-office",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status/:cardId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status-cards",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status-cards/:cardId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"artifacts",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"audit",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"audit/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"activity",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"activity/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"runs",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"costs",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"budgets",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"decisions",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"u/:userSlug",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/studio",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/studio/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/studio/:skillId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/:skillId/studio",element:(0,a.jsx)(DA,{})}),(0,a.jsx)(L,{path:"skills/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"settings",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"settings/*",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"agents",element:(0,a.jsx)(Ze,{})}),TA.map(t=>(0,a.jsx)(L,{path:`agents/${t}`,element:(0,a.jsx)(Ze,{})},t)),(0,a.jsx)(L,{path:"agents/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"agents/:agentId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"agents/:agentId/:tab",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/overview",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/configuration",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"workspaces",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"terminal",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:":companyPrefix",element:(0,a.jsx)(t6,{}),children:hK(e)}),(0,a.jsx)(L,{path:"*",element:(0,a.jsx)(MA,{scope:"global"})})]})]})}),(0,a.jsx)(F6,{}),(0,a.jsx)(x8,{})]})}r(xK,"App");var bK=class extends x.Component{static{r(this,"AppErrorBoundary")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){wA(e,{boundary:"app",componentStack:t.componentStack})}render(){const{error:e}=this.state;return e?(0,a.jsxs)("div",{className:"mx-auto flex min-h-screen max-w-2xl flex-col justify-center space-y-4 px-4 py-10",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-semibold",children:"Wardmote hit an error"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while running the app. Reloading usually fixes this."})]}),(0,a.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{type:"button",className:"inline-flex items-center rounded-md border border-line-strong bg-bg px-3 py-1.5 text-sm font-medium shadow-sm hover:bg-bg-3 hover:text-ink",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})})]}):this.props.children}};function vK(){const{data:e}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),t=e?.sentryDsn,s=e?.sentryEnvironment??void 0;return(0,x.useEffect)(()=>{if(t)return FU(t,s),()=>{HU()}},[t,s]),null}r(vK,"SentryGate");function yK(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}r(yK,"createDeferred");function jK(e,t=300){const s=new Map;let l=null,c=null;const u=r(async()=>{l!==null&&(clearTimeout(l),l=null);const h=c;if(c=null,s.size===0){h?.resolve();return}const g=[...s.values()];s.clear();try{await Promise.all(g.map(v=>e.invalidateQueries(Kc().visible?v:{...v,refetchType:"none"})))}finally{h?.resolve()}},"flush");return{schedule:r(h=>(s.set(wK(h),h),c===null&&(c=yK()),l===null&&(l=setTimeout(()=>{u()},t)),c.promise),"schedule"),flush:u,dispose:r(()=>{l!==null&&(clearTimeout(l),l=null),s.clear(),c?.resolve(),c=null},"dispose")}}r(jK,"createInvalidationBatcher");var hk=0;function wK(e){if(typeof e.predicate=="function")return`__predicate__:${hk+=1}`;try{return JSON.stringify([e.queryKey??null,e.refetchType??null,e.exact??null,e.type??null])}catch{return`__nonserializable__:${hk+=1}`}}r(wK,"serializeFilters");function kK(e,t){return new Proxy(e,{get(s,l){if(l==="invalidateQueries")return u=>t.schedule(u??{});const c=Reflect.get(s,l,s);return typeof c=="function"?c.bind(s):c}})}r(kK,"createCoalescingQueryClient");function SK(e,t){if(!e)return e;const s=e.filter(l=>l.id!==t);return s.length===e.length?e:s}r(SK,"removeRunFromList");function NK(e,t,s){if(!e)return{next:e,present:!1};let l=!1,c=!1;const u=e.map(p=>p.id!==t||(l=!0,p.status===s)?p:(c=!0,{...p,status:s}));return{next:c?u:e,present:l}}r(NK,"patchRunStatusInList");function CK(e,t){if(!e)return e;const s=e.filter(l=>l.id!==t);return s.length===e.length?e:s}r(CK,"removeLiveRunById");function AK(e,t){return!e||e.executionRunId!==t?e:{...e,executionRunId:null,executionAgentNameKey:null,executionLockedAt:null}}r(AK,"clearIssueExecutionRun");var _K=3e4,EK=["status","priority","title","assigneeAgentId","assigneeUserId","projectId","parentId"],IK=new Set(["issue.read_marked","issue.read_unmarked","issue.inbox_archived","issue.inbox_unarchived"]);function Yg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(Yg,"isRecord");function bx(e){return Yg(e)&&Array.isArray(e.pages)}r(bx,"isInfiniteIssueData");function TK(e){return Array.isArray(e)?e.length:bx(e)?e.pages.reduce((t,s)=>t+(Array.isArray(s)?s.length:0),0):0}r(TK,"issueListRowCount");function RK(e){const t=e.state.data;return bx(t)||TK(t)>=100}r(RK,"isLargeIssueListQuery");function MK(e,t,s){const l={},c=Yg(t?.changes)?t.changes:null;if(e==="issue.updated"&&c)for(const u of EK){const p=c[u];!Yg(p)||p.updated===!0||!("to"in p)||(l[u]=p.to)}return s&&e&&!IK.has(e)&&!Number.isNaN(Date.parse(s))&&(l.lastActivityAt=s),l}r(MK,"readIssueListPatchFromActivity");function DK(e,t){let s=null;for(const[l,c]of Object.entries(t)){if(l==="lastActivityAt"){const u=e.lastActivityAt?new Date(e.lastActivityAt).getTime():0;if(new Date(c).getTime()<=u)continue}else if(!(l in e)||e[l]===c)continue;s??={...e},s[l]=c}return s??e}r(DK,"patchIssueRow");function gk(e,t,s){const l=e.findIndex(p=>p?.id===t);if(l<0)return e;const c=DK(e[l],s);if(c===e[l])return e;const u=e.slice();return u[l]=c,u}r(gk,"patchIssueRows");function OK(e,t,s){if(Array.isArray(e))return gk(e,t,s);if(!bx(e))return e;let l=!1;const c=e.pages.map(u=>{if(!Array.isArray(u))return u;const p=gk(u,t,s);return p!==u&&(l=!0),p});return l?{...e,pages:c}:e}r(OK,"patchIssueListData");function LK(e,t,s,l){if(Object.keys(l).length===0)return 0;let c=0;for(const[u,p]of e.getQueriesData({queryKey:P.issues.list(t)})){const f=OK(p,s,l);f!==p&&(e.setQueryData(u,f),c+=1)}return c}r(LK,"patchIssueInListCaches");function zK(e,t){for(const s of e.getQueryCache().findAll({queryKey:P.issues.list(t)}))e.invalidateQueries({queryKey:s.queryKey,exact:!0,...RK(s)?{refetchType:"none"}:{}})}r(zK,"invalidateIssueListsForActivity");function PK(e,t){const s=r(l=>l.state.isInvalidated,"predicate");return Promise.all([e.refetchQueries({queryKey:P.issues.list(t),type:"active",predicate:s}),e.refetchQueries({queryKey:P.heartbeats(t),type:"active",predicate:s})])}r(PK,"refreshInvalidatedLiveLists");function ao(e){return typeof e=="string"&&e.length>0?e:null}r(ao,"readString$1");function $K(e){return e.length===3&&e[0]==="issues"&&e[2]==="agent-todo"}r($K,"isAgentTodoQueryKey");function UK(e){if(e.type!=="heartbeat.run.event")return null;const t=e.payload??{};if(t.eventType!=="agent.todo")return null;const s=ao(t.runId),l=ao(t.agentId),c=ao(t.issueId),u=t.seq;if(!s||!l||!c||typeof u!="number"||!Number.isInteger(u))return null;const p=vE(t.payload);return p?{...p,runId:s,agentId:l,issueId:c,seq:u,createdAt:ao(t.lastEventAt)??e.createdAt,runStatus:"running"}:null}r(UK,"readAgentTodoSnapshotFromLiveEvent");function xk(e,t){if(t.type==="heartbeat.run.status"){const l=t.payload??{},c=ao(l.runId),u=ao(l.status);if(!c||!u)return;e.setQueriesData({predicate:r(p=>$K(p.queryKey),"predicate")},p=>p&&p.runId===c&&p.runStatus!==u?{...p,runStatus:u}:p);return}const s=UK(t);s&&e.setQueryData(P.issues.agentTodo(s.issueId),l=>l&&l.runId===s.runId&&l.seq>=s.seq?l:s)}r(xk,"applyAgentTodoLiveEvent");function BK(e){const t=e.trim().toLowerCase();return t==="0.0.0.0"||t==="::"||t==="[::]"}r(BK,"isWildcardHost");function KK(e=window.location){return BK(e.hostname)?e.port?`localhost:${e.port}`:"localhost":e.host}r(KK,"browserReachableHost");function qK(e,t=window.location){const s=t.protocol==="https:"?"wss":"ws",l=e.startsWith("/")?e:`/${e}`;return`${s}://${KK(t)}${l}`}r(qK,"buildSameOriginWebSocketUrl");function FK(e){try{return new WebSocket(e)}catch{return null}}r(FK,"tryCreateWebSocket");var HK="/pwa-192x192.png",VK="/pwa-monochrome-512x512.png";function vx(){return typeof window<"u"&&"Notification"in window}r(vx,"notificationsSupported");function yx(){return vx()?Notification.permission:"unsupported"}r(yx,"notificationPermission");async function WK(){return vx()?Notification.permission!=="default"?Notification.permission:Notification.requestPermission():"unsupported"}r(WK,"requestNotificationPermission");function QK(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window}r(QK,"pushSupported");function AY(e=typeof navigator>"u"?void 0:navigator){return e?(/iPad|iPhone|iPod/.test(e.userAgent)||e.platform==="MacIntel"&&(e.maxTouchPoints??0)>1)&&e.standalone!==!0:!1}r(AY,"isIosWithoutHomeScreenInstall");async function zA(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{return await navigator.serviceWorker.getRegistration()??null}catch{return null}}r(zA,"getServiceWorkerRegistration");var PA="wardmote.notifications.seen.v1",GK="wardmote.notifications.claim",YK=6e5,XK=200,ZK=new Map;function JK(){let e=null;try{e=typeof localStorage>"u"?null:localStorage}catch{e=null}const t=typeof navigator<"u"&&navigator.locks?{request:r((s,l)=>navigator.locks.request(s,l),"request")}:null;return{storage:e,locks:t,now:r(()=>Date.now(),"now"),memory:ZK}}r(JK,"defaultEnv");function eq(e){const t=e.storage?.getItem(PA);if(!t)return new Map(e.memory);try{const s=JSON.parse(t),l=new Map(e.memory);for(const[c,u]of Object.entries(s))typeof u=="number"&&l.set(c,u);return l}catch{return new Map(e.memory)}}r(eq,"readSeen");function Kh(e,t){const s=t.now(),l=eq(t);for(const[u,p]of l)s-p>YK&&l.delete(u);if(l.has(e))return!1;l.set(e,s);const c=[...l.entries()].sort((u,p)=>p[1]-u[1]).slice(0,XK);t.memory.clear();for(const[u,p]of c)t.memory.set(u,p);return tq(t,c),!0}r(Kh,"claimInsideLock");function tq(e,t){try{e.storage?.setItem(PA,JSON.stringify(Object.fromEntries(t)))}catch{return}}r(tq,"writeSeen");async function nq(e,t=JK()){if(!t.locks)return Kh(e,t);try{return await t.locks.request(GK,()=>Kh(e,t))}catch{return Kh(e,t)}}r(nq,"claimNotificationKey");var aq="wardmote-notifications",bf="custom-sounds";function sq(e){return e.type.startsWith("audio/")?e.size<=0?{ok:!1,error:"The audio file is empty."}:e.size>524288?{ok:!1,error:"Custom sounds must be 512 KB or smaller."}:{ok:!0}:{ok:!1,error:"Choose an audio file."}}r(sq,"validateCustomSoundFile");function $A(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}r($A,"requestResult");var _d=null;function iq(){if(typeof indexedDB>"u")return Promise.reject(new Error("IndexedDB is unavailable."));if(!_d){const e=indexedDB.open(aq,1);e.onupgradeneeded=()=>{e.result.objectStoreNames.contains(bf)||e.result.createObjectStore(bf,{keyPath:"kind"})},_d=$A(e).catch(t=>{throw _d=null,t})}return _d}r(iq,"openDb");async function jx(e,t){return $A(t((await iq()).transaction(bf,e).objectStore(bf)))}r(jx,"withStore");var Xg=new Set;function rq(e){return Xg.add(e),()=>Xg.delete(e)}r(rq,"subscribeCustomSounds");function UA(){for(const e of Xg)e()}r(UA,"notifyCustomSoundsChanged");async function _Y(e,t){const s=sq(t);if(!s.ok)throw new Error(s.error);const l={kind:e,name:t.name,type:t.type,size:t.size,blob:t,updatedAt:new Date().toISOString()};return await jx("readwrite",c=>c.put(l)),UA(),l}r(_Y,"saveCustomSound");async function lq(e){try{return await jx("readonly",t=>t.get(e))??null}catch{return null}}r(lq,"loadCustomSound");async function EY(e){await jx("readwrite",t=>t.delete(e)),UA()}r(EY,"removeCustomSound");var oq=[{id:"confirmation",label:"Confirmation"},{id:"question",label:"Question"},{id:"glass",label:"Glass"},{id:"bong",label:"Bong"},{id:"maximize",label:"Rise"},{id:"pluck",label:"Pluck"},{id:"error",label:"Alert"},{id:"drop",label:"Drop"},{id:"select",label:"Select"},{id:"open",label:"Open"}],IY="custom",TY="none",Zg={approval:"confirmation",question:"question",comment:"pluck",assignment:"maximize",review:"glass",run_failed:"error",join_request:"bong",disk_space:"drop"},RY={approval:"Approvals",question:"Agent questions",comment:"Comments",assignment:"Assignments",review:"Ready for review",run_failed:"Failed runs",join_request:"Join requests",disk_space:"Low disk space"},BA=new Set(oq.map(e=>e.id));function cq(e){return typeof e=="string"&&(BA.has(e)||e==="custom"||e==="none")}r(cq,"isKnownSoundId");function uq(e){return BA.has(e)}r(uq,"isLibrarySoundId");function bk(e,t){return`/sounds/${e}.${t}`}r(bk,"librarySoundUrl");var Jg=new Map,vf=new Map,vk=!1,Ed=null;function KA(){return typeof Audio<"u"}r(KA,"audioSupported");function yk(){return Ed||(Ed=new Audio().canPlayType('audio/ogg; codecs="vorbis"')?"ogg":"mp3",Ed)}r(yk,"libraryFormat");function qA(e){let t=Jg.get(e);return t||(t=new Audio,t.preload="auto",t.src=e,Jg.set(e,t)),t}r(qA,"audioFor");function dq(){for(const e of vf.values())e.then(t=>{t&&(Jg.delete(t),URL.revokeObjectURL(t))});vf.clear()}r(dq,"revokeCustomSounds");function fq(e){vk||(vk=!0,rq(dq));let t=vf.get(e);return t||(t=lq(e).then(s=>s?URL.createObjectURL(s.blob):null),vf.set(e,t)),t}r(fq,"customSoundUrl");async function FA(e,t){if(t==="none")return null;if(t==="custom"){const s=await fq(e);return s||bk(Zg[e],yk())}return bk(uq(t)?t:Zg[e],yk())}r(FA,"resolveSoundUrl");async function pq(e,t,s){if(!KA())return!1;const l=await FA(e,t);if(!l)return!1;const c=qA(l);c.volume=Math.min(1,Math.max(0,s)),c.currentTime=0;try{return await c.play(),!0}catch{return!1}}r(pq,"playSound");function mq(e,t){return pq(e,t.kinds[e].soundId,t.volume)}r(mq,"playKindSound");function jk(e){if(!(!KA()||!e.enabled))for(const[t,s]of Object.entries(e.kinds))s.enabled&&FA(t,s.soundId).then(l=>{l&&qA(l)})}r(jk,"preloadNotificationSounds");var e0={getWebPushConfig:r(()=>je.get("/notifications/web-push/config"),"getWebPushConfig"),upsertWebPushSubscription:r(e=>je.put("/notifications/web-push/subscription",e),"upsertWebPushSubscription"),deleteWebPushSubscription:r(e=>je.deleteWithBody("/notifications/web-push/subscription",e),"deleteWebPushSubscription"),sendWebPushTest:r(()=>je.post("/notifications/web-push/test",{}),"sendWebPushTest")},HA="wardmote.notifications.v1",hq=.6;function t0(){const e={};for(const t of g0)e[t]={enabled:!0,soundId:Zg[t]};return{enabled:!0,volume:hq,pushEnabled:!0,kinds:e}}r(t0,"defaultNotificationSettings");function qh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}r(qh,"asRecord");function VA(e){const t=t0(),s=qh(e);if(!s)return t;const l=typeof s.volume=="number"&&Number.isFinite(s.volume)?Math.min(1,Math.max(0,s.volume)):t.volume,c=qh(s.kinds)??{},u={...t.kinds};for(const p of g0){const f=qh(c[p]);f&&(u[p]={enabled:typeof f.enabled=="boolean"?f.enabled:t.kinds[p].enabled,soundId:cq(f.soundId)?f.soundId:t.kinds[p].soundId})}return{enabled:typeof s.enabled=="boolean"?s.enabled:t.enabled,volume:l,pushEnabled:typeof s.pushEnabled=="boolean"?s.pushEnabled:t.pushEnabled,kinds:u}}r(VA,"normalizeNotificationSettings");function yf(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}r(yf,"storage");function gq(){const e=yf()?.getItem(HA);if(!e)return t0();try{return VA(JSON.parse(e))}catch{return t0()}}r(gq,"readStored");var jf,mc=null,Ud=new Set,Id=!1;function Zr(){const e=yf()?.getItem("wardmote.notifications.v1")??null;return mc&&e===jf||(jf=e,mc=gq()),mc}r(Zr,"getNotificationSettings");function WA(){for(const e of Ud)e()}r(WA,"notify");function QA(e){const t=VA(typeof e=="function"?e(Zr()):e);try{yf()?.setItem(HA,JSON.stringify(t))}catch{jf=void 0}return mc=t,jf=yf()?.getItem("wardmote.notifications.v1")??null,WA(),t}r(QA,"setNotificationSettings");function MY(e,t){return QA(s=>({...s,kinds:{...s.kinds,[e]:{...s.kinds[e],...t}}}))}r(MY,"updateKindSettings");function xq(e){return e.enabled?g0.filter(t=>e.kinds[t].enabled):[]}r(xq,"enabledNotificationKinds");function wk(e){e.key!==null&&e.key!=="wardmote.notifications.v1"||WA()}r(wk,"onStorage");function GA(e){return Ud.add(e),!Id&&typeof window<"u"&&(Id=!0,window.addEventListener("storage",wk)),()=>{Ud.delete(e),Ud.size===0&&Id&&typeof window<"u"&&(Id=!1,window.removeEventListener("storage",wk))}}r(GA,"subscribeNotificationSettings");function DY(){return(0,x.useSyncExternalStore)(GA,Zr,Zr)}r(DY,"useNotificationSettings");var kc={status:"unknown",error:null},n0=new Set,a0=null,kk=Promise.resolve();function Sk(e){if(!(e.status===kc.status&&e.error===kc.error)){kc=e;for(const t of n0)t()}}r(Sk,"setPushState");function Nk(){return kc}r(Nk,"getPushState");function bq(){return kc.status==="active"}r(bq,"hasActivePushSubscription");function vq(e){return n0.add(e),()=>n0.delete(e)}r(vq,"subscribePushState");function OY(){return(0,x.useSyncExternalStore)(vq,Nk,Nk)}r(OY,"usePushState");function YA(e){const t=e.padEnd(e.length+(4-e.length%4)%4,"=").replace(/-/g,"+").replace(/_/g,"/"),s=atob(t),l=new Uint8Array(new ArrayBuffer(s.length));for(let c=0;c<s.length;c+=1)l[c]=s.charCodeAt(c);return l}r(YA,"urlBase64ToUint8Array");function yq(e,t){const s=e.options?.applicationServerKey;if(!s)return!0;const l=YA(t),c=new Uint8Array(s);return c.length===l.length&&c.every((u,p)=>u===l[p])}r(yq,"sameApplicationServerKey");async function Ck(e){await e0.deleteWebPushSubscription({endpoint:e.endpoint}).catch(()=>{}),await e.unsubscribe().catch(()=>!1),a0=null}r(Ck,"forgetSubscription");async function jq(e,t){if(!QK())return{status:"unsupported",error:null};const s=await zA();if(!s)return{status:"unsupported",error:null};let l=await s.pushManager.getSubscription();if(!(e.enabled&&e.pushEnabled))return l&&await Ck(l),{status:"off",error:null};if(yx()!=="granted")return{status:"permission",error:null};const c=await e0.getWebPushConfig();if(!c.enabled||!c.publicKey)return{status:"server-disabled",error:null};l&&!yq(l,c.publicKey)&&(await Ck(l),l=null),l||(l=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:YA(c.publicKey)}));const u=l.toJSON(),p=u.keys?.p256dh,f=u.keys?.auth;if(!p||!f)return{status:"error",error:"The browser returned an incomplete push subscription."};const h=xq(e),g=[t,l.endpoint,...h].join("|");return g!==a0&&(await e0.upsertWebPushSubscription({endpoint:l.endpoint,keys:{p256dh:p,auth:f},kinds:h}),a0=g),{status:"active",error:null}}r(jq,"reconcile");function s0(e,t){const s=kk.then(async()=>{try{const l=await jq(e,t);return Sk(l),l}catch(l){const c={status:"error",error:l instanceof Error?l.message:"Push subscription failed."};return Sk(c),c}});return kk=s.catch(()=>{}),s}r(s0,"syncPushSubscription");function XA(e,t){return t.enabled&&t.kinds[e.kind]?.enabled===!0}r(XA,"kindEnabled");function wq(e){const{payload:t,userId:s,settings:l}=e;return!s||!t.recipientUserIds.includes(s)||!XA(t.notification,l)?"none":e.visible?"sound":e.pushActive?"none":"os"}r(wq,"decideLiveNotification");function kq(e){return!e.visible||!XA(e.notification,e.settings)?"none":"sound"}r(kq,"decideServiceWorkerNotification");async function Sq(e){if(yx()!=="granted")return;const t={body:e.body,tag:e.key,data:{url:e.url},icon:HK,badge:VK},s=await zA();if(s){await s.showNotification(e.title,t);return}new Notification(e.title,t)}r(Sq,"showOsNotification");var ZA={claim:r(e=>nq(e),"claim"),playSound:r((e,t)=>mq(e.kind,t),"playSound"),showOsNotification:Sq};async function JA(e,t,s,l){return e==="none"?e:await l.claim(t.key)?(e==="sound"?await l.playSound(t,s):await l.showOsNotification(t),e):"none"}r(JA,"perform");function Nq(e,t,s=ZA,l={}){const c=l.settings??Zr();return JA(wq({payload:e,userId:t,settings:c,visible:l.visible??Kc().visible,pushActive:l.pushActive??bq()}),e.notification,c,s)}r(Nq,"deliverLiveNotification");function Cq(e,t=ZA,s={}){const l=s.settings??Zr();return JA(kq({notification:e,settings:l,visible:s.visible??Kc().visible}),e,l,t)}r(Cq,"deliverServiceWorkerNotification");function e2(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.key=="string"&&typeof t.kind=="string"&&typeof t.title=="string"?t:null}r(e2,"readNotification");function Aq(e){if(!e||typeof e!="object")return null;const t=e,s=e2(t.notification);return!s||!Array.isArray(t.recipientUserIds)?null:{notification:s,recipientUserIds:t.recipientUserIds.filter(l=>typeof l=="string")}}r(Aq,"readNotificationCreatedPayload");function _q(e){if(!e||typeof e!="object")return null;const t=e;if(t.type==="wardmote.notification"){const s=e2(t.notification);return s?{type:"notification",notification:s}:null}return t.type==="wardmote.navigate"&&typeof t.url=="string"&&t.url.startsWith("/")?{type:"navigate",url:t.url}:null}r(_q,"readServiceWorkerMessage");var Eq=1e4,Iq=3,Tq=2e3,Rq=3e5,Mq=2e3,Dq=15e3,Oq=0,Lq=1,Uc=new Set(["succeeded","interrupted","failed","cancelled","timed_out"]),t2=(0,x.createContext)(null);function zq(e,t,s){if(s.companyId===t)for(const l of Array.from(e))try{l(s)}catch{}}r(zq,"dispatchLiveEventToSubscribers");function LY(e){const t=(0,x.useContext)(t2),s=(0,x.useRef)(e);(0,x.useEffect)(()=>{s.current=e}),(0,x.useEffect)(()=>{if(t)return t.subscribe(l=>{s.current(l)})},[t])}r(LY,"useCompanyLiveEvent");function be(e){return typeof e=="string"&&e.length>0?e:null}r(be,"readString");function al(e){return typeof e!="object"||e===null||Array.isArray(e)?null:e}r(al,"readRecord");function wf(e){return e.slice(0,8)}r(wf,"shortId");function n2(e,t,s){const l=e.getQueryData(P.agents.list(t))?.find(c=>c.id===s);return l?.name?l.name:e.getQueryData(P.agents.detail(s))?.name??null}r(n2,"resolveAgentName");function Pq(e,t,s){const l=e.getQueryData(P.access.companyUserDirectory(t));if(!l)return null;const c=l.users.find(u=>u.principalId===s);return c?.user?.name?.trim()||c?.user?.email?.trim()||null}r(Pq,"resolveUserName");function Fr(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}r(Fr,"truncate");function $q(e,t,s,l){return s==="agent"&&l?n2(e,t,l)??`Agent ${wf(l)}`:s==="system"?"System":s==="user"&&l?Pq(e,t,l)??(l==="board"||l==="local-board"?"Board":`User ${wf(l)}`):s==="plugin"?"Plugin":"Unknown actor"}r($q,"resolveActorLabel");function wx(e,t,s,l){const c=new Set([s]),u=e.getQueryData(P.issues.detail(s)),p=e.getQueryData(P.issues.list(t)),f=be(l?.identifier)??be(l?.issueIdentifier);f&&c.add(f),u?.id&&c.add(u.id),u?.identifier&&c.add(u.identifier);const h=p?.find(g=>!!(g.id===s||g.identifier&&g.identifier===s||f&&g.identifier===f));return h?.id&&c.add(h.id),h?.identifier&&c.add(h.identifier),Array.from(c)}r(wx,"resolveIssueQueryRefs");function Uq(e,t,s,l){const c=wx(e,t,s,l),u=c.map(v=>e.getQueryData(P.issues.detail(v))).find(v=>!!v),p=e.getQueryData(P.issues.list(t))?.find(v=>c.some(y=>v.id===y||v.identifier===y)),f=u??p??null,h=be(l?.identifier)??be(l?.issueIdentifier)??f?.identifier??`Task ${wf(s)}`,g=be(l?.title)??be(l?.issueTitle)??f?.title??null;return{ref:h,title:g,label:g?`${h} - ${Fr(g,72)}`:h,href:`/issues/${f?.identifier??s}`}}r(Uq,"resolveIssueToastContext");function a2(){return!(typeof document>"u"||document.visibilityState!=="visible"||typeof document.hasFocus=="function"&&!document.hasFocus())}r(a2,"isPageForegrounded");function gr(e,t,s){if(!(s?.isForegrounded??a2()))return null;const l=If(t).split("/").filter(Boolean);if(!["issues","chats"].includes(l[0])||!l[1])return null;let c=decodeURIComponent(l[1]);if(l[0]==="chats"){const j=e.getQueryData(P.auth.session),k=j?.user?.id??j?.session?.userId??null,S=h1(t),N=e.getQueryData(P.companies.list(k))?.companies.find(M=>M.issuePrefix.toUpperCase()===S?.toUpperCase());if(!N)return null;const I=e.getQueryData(P.agents.list(N.id))?.find(M=>M.id===c||dr(M)===c);if(!I)return null;const C=e.getQueryData(P.agentChats.detail(N.id,k,I.id));if(!C)return null;c=C.id}const u=e.getQueryData(P.issues.detail(c))??null,p=new Set([c]);u?.id&&p.add(u.id),u?.identifier&&p.add(u.identifier);function f(j,k){const S=e.getQueryData(P.issues.activeRun(j)),N=e.getQueryData(P.issues.liveRuns(j))??[],I=e.getQueryData(P.issues.runs(j))??[];S?.id&&k.add(S.id);for(const C of N)C.id&&k.add(C.id);for(const C of I)C.runId&&k.add(C.runId)}r(f,"collectCachedIssueRunIds");const h=new Set;for(const j of p)f(j,h);const g=new Set(p),v=new Set,y=new Set(h);if(u?.companyId&&u.id){const j=e.getQueryData(P.issues.listByDescendantRoot(u.companyId,u.id))??[];for(const k of j)g.add(k.id),k.identifier&&g.add(k.identifier),k.assigneeAgentId&&v.add(k.assigneeAgentId),k.executionRunId&&y.add(k.executionRunId),f(k.id,y),k.identifier&&f(k.identifier,y)}if(u?.companyId){const j=e.getQueryData(P.liveRuns(u.companyId))??[];for(const k of j)k.issueId&&g.has(k.issueId)&&y.add(k.id)}return{routeIssueRef:c,issueRefs:p,assigneeAgentId:u?.assigneeAgentId??null,runIds:h,subtreeIssueRefs:g,subtreeAgentIds:v,subtreeRunIds:y}}r(gr,"resolveVisibleIssueRouteContext");function np(e,t){const s=new Set([e]),l=be(t?.identifier)??be(t?.issueIdentifier);return l&&s.add(l),s}r(np,"buildIssueRefsForPayload");function ap(e,t){for(const s of e)if(t.has(s))return!0;return!1}r(ap,"overlaps");function Bq(e,t,s,l){const c=be(s.entityType),u=be(s.entityId);if(c!=="issue"||!u)return!1;const p=gr(e,t,l);return p?ap(p.subtreeIssueRefs,np(u,al(s.details))):!1}r(Bq,"shouldSuppressActivityToastForVisibleIssue");function Kq(e,t,s,l){if(!(l?.isForegrounded??a2()))return!1;const c=If(t).match(/^\/agents\/[^/]+\/runs\/([^/]+)/)?.[1];if(c&&decodeURIComponent(c)===be(s.runId))return!0;const u=gr(e,t,l);if(!u)return!1;const p=be(s.issueId);if(p)return u.subtreeIssueRefs.has(p);const f=be(s.runId);if(f)return u.subtreeRunIds.has(f);const h=be(s.agentId);return!!h&&(h===u.assigneeAgentId||u.subtreeAgentIds.has(h))}r(Kq,"shouldSuppressRunStatusToastForVisibleIssue");function Ak(e,t,s,l){const c=gr(e,t,l);if(!c)return!1;const u=be(s.runId),p=be(s.agentId);if(!(u!==null&&c.runIds.has(u)||p&&c.assigneeAgentId&&p===c.assigneeAgentId))return!1;const f=be(s.status);if(u&&f&&Uc.has(f))for(const v of c.issueRefs)e.invalidateQueries({queryKey:P.issues.comments(v)}),e.setQueryData(P.issues.liveRuns(v),y=>CK(y,u)),e.setQueryData(P.issues.activeRun(v),y=>y?.id===u?null:y),e.setQueryData(P.issues.detail(v),y=>AK(y,u));const h=!!f&&Uc.has(f),g=!h&&(l?.liveStatusAlreadyPatched??!1);for(const v of c.issueRefs)e.invalidateQueries({queryKey:P.issues.detail(v)}),e.invalidateQueries({queryKey:P.issues.activity(v)}),e.invalidateQueries({queryKey:P.issues.runs(v)}),l?.runLifecycleEvent&&e.invalidateQueries({queryKey:P.issues.queuedComments(v)}),g||(e.invalidateQueries({queryKey:P.issues.liveRuns(v)}),e.invalidateQueries({queryKey:P.issues.activeRun(v)})),h&&(e.invalidateQueries({queryKey:P.issues.comments(v)}),e.invalidateQueries({queryKey:P.issues.attachments(v)}),e.invalidateQueries({queryKey:P.issues.workProducts(v)}),e.invalidateQueries({queryKey:P.issues.workProductPullRequestRefresh(v)}),e.invalidateQueries({queryKey:["issues","tree-control-state",v]}));return!0}r(Ak,"invalidateVisibleIssueRunQueries");function pc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(pc,"hasPatchKey");function s2(e,t){return e.id!==t.runId?e:{...e,...pc(t,"message")?{currentStatusMessage:t.message}:{},...pc(t,"updatedAt")?{currentStatusUpdatedAt:t.updatedAt}:{},...pc(t,"currentToolName")?{currentToolName:t.currentToolName}:{},...pc(t,"lastAssistantSnippet")?{lastAssistantSnippet:t.lastAssistantSnippet}:{},...pc(t,"lastEventAt")?{lastEventAt:t.lastEventAt}:{}}}r(s2,"applyRunLiveStatusPatch");function _k(e,t){if(!e)return e;let s=!1;const l=e.map(c=>c.id!==t.runId?c:(s=!0,s2(c,t)));return s?l:e}r(_k,"applyRunLiveStatusPatchToArray");function qq(e,t,s){const l=be(e.runId);if(!l)return null;const c={runId:l,agentId:be(e.agentId),issueId:be(e.issueId)};if(s==="heartbeat.run.progress")return c.message=be(e.message),c.updatedAt=be(e.updatedAt)??t,c.currentToolName=be(e.currentToolName),c.lastAssistantSnippet=be(e.lastAssistantSnippet),c.lastEventAt=be(e.lastEventAt)??c.updatedAt,c;if(s==="heartbeat.run.log")return c.lastEventAt=be(e.ts)??t,c;if(s==="heartbeat.run.event"){const u=be(e.message);u&&(c.message=u),c.updatedAt=be(e.updatedAt)??t;const p=be(e.currentToolName);p&&(c.currentToolName=p);const f=be(e.lastAssistantSnippet);return f&&(c.lastAssistantSnippet=f),c.lastEventAt=be(e.lastEventAt)??t,c}return null}r(qq,"readRunLiveStatusPatchFromPayload");var Fq=1e3;function Hq(e=Fq){const t=new Map,s=new Map,l=r(c=>{const u=t.get(c);if(!u){s.delete(c);return}t.delete(c),s.set(c,setTimeout(()=>l(c),e)),u.apply(u.patch)},"release");return{submit:r((c,u)=>{if(s.has(c.runId)){t.set(c.runId,{patch:c,apply:u});return}s.set(c.runId,setTimeout(()=>l(c.runId),e)),u(c)},"submit"),dispose:r(()=>{for(const c of s.values())clearTimeout(c);s.clear(),t.clear()},"dispose")}}r(Hq,"createRunLogPatchThrottle");function Vq(e,t,s,l,c){let u=!1;e.setQueryData(P.liveRuns(t),h=>{const g=_k(h,l);return g!==h&&(u=!0),g});const p=new Set;if(l.issueId)for(const h of wx(e,t,l.issueId,null))p.add(h);const f=gr(e,s,c);if(f&&(f.runIds.has(l.runId)||l.issueId&&f.issueRefs.has(l.issueId)||l.agentId&&f.assigneeAgentId&&l.agentId===f.assigneeAgentId))for(const h of f.issueRefs)p.add(h);for(const h of p)e.setQueryData(P.issues.activeRun(h),g=>!g||g.id!==l.runId?g:(u=!0,s2(g,l))),e.setQueryData(P.issues.liveRuns(h),g=>{const v=_k(g,l);return v!==g&&(u=!0),v});return u}r(Vq,"applyRunLiveStatusPatchToCaches");function Wq(e,t,s,l){const c=gr(e,t,l);if(!c)return!1;const u=be(s.agentId);return!!u&&(u===c.assigneeAgentId||c.subtreeAgentIds.has(u))}r(Wq,"shouldSuppressAgentStatusToastForVisibleIssue");function Qq(e,t,s,l){const c=be(s.entityType),u=be(s.entityId),p=be(s.actorType),f=be(s.action),h=al(s.details);if(c!=="issue"||!u||p!=="agent"&&p!=="system"||f!=="issue.updated"||be(h?.source)==="comment")return!1;const g=gr(e,t,l);return g?ap(g.issueRefs,np(u,h)):!1}r(Qq,"shouldDeferIssueRefetchForVisibleAgentActivity");function i2(e){return{isForegrounded:e?.isForegrounded??Kc().visible}}r(i2,"commentRouteOptions");function r2(e,t,s,l){const c=be(s.entityType),u=be(s.entityId),p=be(s.action),f=al(s.details);if(c!=="issue"||!u||p!=="issue.comment_added"||!be(f?.commentId))return!1;const h=gr(e,t,i2(l));return h?ap(h.issueRefs,np(u,f)):!1}r(r2,"shouldDeferVisibleIssueCommentActivity");async function Gq(e,t,s,l){const c=be(s.entityType),u=be(s.action),p=al(s.details),f=be(p?.commentId);if(c!=="issue"||u!=="issue.comment_added"||!f)return!1;const h=gr(e,t,i2(l));if(!h)return!1;const g=be(s.entityId);if(!g||!ap(h.issueRefs,np(g,p)))return!1;try{const v=await on.getComment(h.routeIssueRef,f);for(const y of h.issueRefs)e.setQueryData(P.issues.comments(y),j=>j?{...j,pages:dI(j.pages,v)}:{pages:[[v]],pageParams:[null]});return!0}catch{for(const v of h.issueRefs)e.invalidateQueries({queryKey:P.issues.comments(v)});return!1}}r(Gq,"hydrateVisibleIssueComment");var Yq=new Set(["issue.created","issue.updated","issue.comment_added"]),Ek=new Set(["issue.document_created","issue.document_updated","issue.document_restored","issue.document_deleted"]),Xq=new Set(["issue.document_annotation_thread_created","issue.document_annotation_comment_added","issue.document_annotation_thread_resolved","issue.document_annotation_thread_reopened","issue.document_annotation_remapped"]),Zq=new Set(["routine.document_annotation_thread_created","routine.document_annotation_comment_added","routine.document_annotation_thread_resolved","routine.document_annotation_thread_reopened","routine.document_annotation_remapped"]),Jq=new Set(["case.document_annotation_thread_created","case.document_annotation_comment_added","case.document_annotation_thread_resolved","case.document_annotation_thread_reopened","case.document_annotation_remapped"]),e7=new Set(["error"]),t7=new Set(["failed","timed_out","cancelled"]);function n7(e){if(!e)return null;const t=[];if(typeof e.status=="string"&&t.push(`status -> ${e.status.replace(/_/g," ")}`),typeof e.priority=="string"&&t.push(`priority -> ${e.priority}`),typeof e.assigneeAgentId=="string"||typeof e.assigneeUserId=="string"?t.push("reassigned"):(e.assigneeAgentId===null||e.assigneeUserId===null)&&t.push("unassigned"),e.reopened===!0){const s=be(e.reopenedFrom);t.push(s?`reopened from ${s.replace(/_/g," ")}`:"reopened")}return typeof e.title=="string"&&t.push("title changed"),typeof e.description=="string"&&t.push("description changed"),t.length>0?t.join(", "):null}r(n7,"describeIssueUpdate");function a7(e,t,s,l){const c=be(s.entityType),u=be(s.entityId),p=be(s.action),f=al(s.details),h=be(s.actorId),g=be(s.actorType);if(c!=="issue"||!u||!p||!Yq.has(p))return null;const v=Uq(e,t,u,f),y=be(be(s.actorName)?.trim())??$q(e,t,g,h),j=g==="agent"&&h?e.getQueryData(P.agents.list(t))?.find(K=>K.id===h)??e.getQueryData(P.agents.detail(h)):void 0,k=g==="user"&&h?e.getQueryData(P.access.companyUserDirectory(t))?.users.find(K=>K.principalId===h)?.user:void 0,S=h&&(g==="user"||g==="agent")?{type:g,id:h,name:y,image:s.actorImage!==void 0?be(s.actorImage):k?.image,appearance:g==="agent"?TE(s.actorAppearance!==void 0?s.actorAppearance:j?.appearance,h):void 0}:void 0;if(g==="user"&&l.userId&&h===l.userId||g==="agent"&&l.agentId&&h===l.agentId||p==="issue.comment_added"&&be(f?.source)?.startsWith("chat:"))return null;if(p==="issue.created")return{actor:S,title:`${y} created ${v.ref}`,body:v.title?Fr(v.title,96):void 0,tone:"success",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${p}:${u}`};if(p==="issue.updated"){if(be(f?.source)==="comment")return null;const K=n7(f),z=K?v.title?`${Fr(v.title,64)} - ${K}`:K:v.title?Fr(v.title,96):v.label;return{actor:S,title:`${y} updated ${v.ref}`,body:Fr(z,100),tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${p}:${u}`}}const N=be(f?.commentId),I=be(f?.bodySnippet),C=f?.reopened===!0,M=f?.updated===!0,R=be(f?.reopenedFrom),_=C?R?`reopened from ${R.replace(/_/g," ")}`:"reopened":null,D=C?`${y} reopened and commented on ${v.ref}`:M?`${y} commented and updated ${v.ref}`:`${y} commented on ${v.ref}`,U=I?_?`${_} - ${I.replace(/^#+\s*/m,"").replace(/\n/g," ")}`:I.replace(/^#+\s*/m,"").replace(/\n/g," "):_?v.title?`${_} - ${v.title}`:_:v.title??void 0;return{actor:S,title:D,body:U?Fr(U,96):void 0,tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${p}:${u}:${N??"na"}`}}r(a7,"buildActivityToast");function s7(e){const t=be(e.entityType),s=be(e.action),l=be(e.entityId),c=al(e.details);return t!=="join_request"||!s||!l||s!=="join.requested"&&s!=="join.request_replayed"?null:{title:`${be(c?.requestType)==="agent"?"Agent":"Someone"} wants to join`,body:"A new join request is waiting for approval.",tone:"info",action:{label:"View inbox",href:"/inbox/mine"},dedupeKey:`join-request:${l}`}}r(s7,"buildJoinRequestToast");function i7(e,t,s,l){const c=be(e.agentId),u=be(e.status);if(!c||!u||!e7.has(u))return null;const p=u==="error"?"error":"info",f=t(c)??`Agent ${wf(c)}`;return{title:u==="running"?`${f} started`:`${f} errored`,body:s.getQueryData(P.agents.list(l))?.find(h=>h.id===c)?.title??void 0,tone:p,action:{label:"View agent",href:`/agents/${c}`},dedupeKey:`agent-status:${c}:${u}`}}r(i7,"buildAgentStatusToast");function r7(e,t){const s=be(e.runId),l=be(e.agentId),c=be(e.status);if(!s||!l||!c||!t7.has(c))return null;const u=be(e.error),p=be(e.errorCode);if(p==="operator_interrupted"||p==="workspace_busy")return null;const f=be(e.contextSource),h=be(e.triggerDetail),g=t(l)??"Agent";if(c==="failed"&&p==="low_trust_isolation_unavailable"&&f?.startsWith("chat:"))return{title:`${g} couldn't start this chat`,body:"This external chat identity isn't linked, and isolated guest workspaces are disabled. Link the identity in Connectors or enable isolated workspaces, then start a new task.",tone:"warn",ttlMs:1e4,action:{label:"Open chat connections",href:"/apps"},dedupeKey:`run-status:${s}:${c}`};const v=c==="succeeded"?"success":c==="cancelled"?"info":"error",y=`${g} run ${c==="succeeded"?"succeeded":c==="failed"?"failed":c==="timed_out"?"timed out":"cancelled"}`;let j;return u?j=Fr(u,100):h&&(j=`Trigger: ${h}`),{title:y,body:j,tone:v,ttlMs:c==="succeeded"?5e3:7e3,action:{label:"View run",href:`/agents/${l}/runs/${s}`},dedupeKey:`run-status:${s}:${c}`}}r(r7,"buildRunStatusToast");function l7(e,t,s){const l=be(s.runId),c=be(s.status);if(!l||!c)return!1;if(e.setQueryData(P.runDetail(l),p=>{if(!p)return p;const f=r(h=>Object.prototype.hasOwnProperty.call(s,h),"has");return{...p,status:c,...f("invocationSource")?{invocationSource:be(s.invocationSource)??p.invocationSource}:{},...f("triggerDetail")?{triggerDetail:be(s.triggerDetail)}:{},...f("error")?{error:be(s.error)}:{},...f("errorCode")?{errorCode:be(s.errorCode)}:{},...f("startedAt")?{startedAt:be(s.startedAt)}:{},...f("finishedAt")?{finishedAt:be(s.finishedAt)}:{}}}),Uc.has(c))return e.setQueryData(P.liveRuns(t),p=>SK(p,l)),e.getQueryData(P.pausedTasks(t))&&e.invalidateQueries({queryKey:P.pausedTasks(t)}),!0;let u=!1;return e.setQueryData(P.liveRuns(t),p=>{const f=NK(p,l,c);return u=f.present,f.next}),u}r(l7,"applyRunLifecycleToCompanyLiveRuns");function o7(e,t,s){const l=be(s.status);l&&Uc.has(l)&&e.invalidateQueries({queryKey:P.heartbeats(t),refetchType:"none"}),e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:P.sidebarBadges(t)});const c=be(s.agentId);c&&(e.invalidateQueries({queryKey:P.agents.detail(c)}),e.invalidateQueries({queryKey:P.heartbeats(t,c)}));const u=be(s.runId);u&&e.invalidateQueries({queryKey:P.runDetail(u)})}r(o7,"invalidateHeartbeatQueries");function c7(e,t,s){const l=be(s.agentId);l&&e.invalidateQueries({queryKey:P.agents.detail(l)})}r(c7,"invalidateHeartbeatProgressQueries");var u7=new Set(["approval","attention_source","budget_incident","decision","decision_queue","issue_recovery_action","join_request"]),d7=["issue.blockers_","issue.dependency_recovery_","issue.disposition_repair_","issue.execution_recovery_","issue.interaction_","issue.recovery_action_","issue.stalled_review_","issue.thread_interaction_"],f7=new Set(["failed","timed_out"]);function p7(e,t,s){return t?.startsWith("inbox.")||e&&u7.has(e)?!0:e!=="issue"||!t?!1:d7.some(l=>t.startsWith(l))||t==="issue.reviewers_updated"||t==="issue.status_decision_recorded"?!0:(t==="issue.created"||t==="issue.updated")&&(s?.status!==void 0||s?.blockedByIssueIds!==void 0)}r(p7,"activityChangesAttention");function Ik(e,t,s,l){return e.getQueriesData({queryKey:P.attention(t)}).some(([,c])=>c?"items"in c?Array.isArray(c.items)&&c.items.some(s):"count"in c&&l(c):!1)}r(Ik,"cachedAttentionIncludes");function i0(e,t){e.invalidateQueries({queryKey:P.attention(t)})}r(i0,"invalidateAttentionQueries");function m7(e,t,s,l,c){e.invalidateQueries({queryKey:P.activity(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:P.sidebarBadges(t)});const u=be(s.entityType),p=be(s.entityId),f=be(s.action),h=be(s.actorType),g=be(s.actorId),v=al(s.details),y=h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId;if(p7(u,f,v)&&i0(e,t),u==="decision"&&(e.invalidateQueries({queryKey:["decisions",t]}),p&&e.invalidateQueries({queryKey:P.decisions.detail(p)})),(f?.startsWith("ai_connection.")||f?.startsWith("connection_grant."))&&e.invalidateQueries({queryKey:["ai-connections",t]}),(f?.startsWith("primary_agent.")||f?.startsWith("agent.")||f?.startsWith("resource_membership."))&&e.invalidateQueries({queryKey:["primary-agent",t]}),f?.startsWith("resource_membership.")||f?.startsWith("primary_agent.")){const j=be(v?.userId);(!j||j===l.userId)&&e.invalidateQueries({queryKey:P.resourceMemberships.mine(t)})}if(u==="issue"){const j=P.agentChats.list(t,l.userId);if((p&&e.getQueryData(j)?.some(k=>k.id===p)||f==="issue.conversation_opened"&&y)&&e.invalidateQueries({queryKey:j}),(f==="issue.tree_hold_created"||f==="issue.tree_hold_released"||f==="issue.updated")&&(e.invalidateQueries({queryKey:["issues","tree-control-state"]}),f!=="issue.updated"&&e.invalidateQueries({queryKey:P.pausedTasks(t)})),p&&LK(e,t,p,MK(f,v,c?.occurredAt??null)),zK(e,t),ZI(e,t,s),p){const k=(f==="issue.comment_added"||f==="issue.updated"&&be(v?.source)==="comment")&&(h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId),S=!!c?.pathname&&Qq(e,c.pathname,s,{isForegrounded:c.isForegrounded}),N=!!c?.pathname&&r2(e,c.pathname,s,{isForegrounded:c.isForegrounded}),I=wx(e,t,p,v);for(const C of I){const M=k||S||N?{refetchType:"none"}:void 0;if(e.invalidateQueries({queryKey:P.issues.detail(C),...M}),e.invalidateQueries({queryKey:P.issues.activity(C),...M}),(f==="issue.comment_added"||f==="issue.conversation_session_started")&&e.invalidateQueries({queryKey:P.issues.comments(C),...M}),(f==="issue.comment_added"||f?.startsWith("issue.queued_comment"))&&e.invalidateQueries({queryKey:P.issues.queuedComments(C)}),(f?.startsWith("issue.attachment_")||f?.startsWith("issue.work_product_"))&&(e.invalidateQueries({queryKey:P.issues.attachments(C)}),e.invalidateQueries({queryKey:P.issues.workProducts(C)})),f==="issue.conversation_session_started"&&(e.invalidateQueries({queryKey:["issues","tree-control-state",C]}),e.invalidateQueries({queryKey:P.issues.interactions(C)})),f&&Ek.has(f)){const R=be(v?.key);e.invalidateQueries({queryKey:P.issues.documents(C),...M}),R?(e.invalidateQueries({queryKey:P.issues.document(C,R),...M}),e.invalidateQueries({queryKey:P.issues.documentRevisions(C,R),...M})):(e.invalidateQueries({queryKey:["issues","document",C],...M}),e.invalidateQueries({queryKey:["issues","document-revisions",C],...M}))}if(f&&(Ek.has(f)||Xq.has(f))){const R=be(v?.key)??be(v?.documentKey);e.invalidateQueries({queryKey:R?["issues","document-annotations",C,R]:["issues","document-annotations",C],...M})}(f?.startsWith("issue.thread_interaction_")||(f==="issue.updated"||f==="issue.status_decision_recorded")&&be(v?.source)==="native_status_decision")&&(e.invalidateQueries({queryKey:P.issues.interactions(C)}),e.invalidateQueries({queryKey:P.tools.actionRequests(t,"pending")}),e.invalidateQueries({queryKey:P.apps.attention(t)}),e.invalidateQueries({queryKey:P.tools.trustRules(t)}))}}return}if(u==="agent"){e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.org(t)}),p&&(e.invalidateQueries({queryKey:P.agents.detail(p)}),e.invalidateQueries({queryKey:P.heartbeats(t,p)}));return}if(u==="project"){const j=be(s.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:P.issues.activity(j)}),e.invalidateQueries({queryKey:P.projects.all(t)}),p&&e.invalidateQueries({queryKey:P.projects.detail(p)});return}if(u==="company_skill"){const j=be(s.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:P.issues.activity(j)}),p&&e.invalidateQueries({queryKey:P.companySkills.detail(t,p)}),e.invalidateQueries({queryKey:P.companySkills.list(t)});return}if(u==="goal"){e.invalidateQueries({queryKey:P.goals.list(t)}),p&&e.invalidateQueries({queryKey:P.goals.detail(p)});return}if(u==="approval"){e.invalidateQueries({queryKey:P.approvals.list(t)});return}if(u==="join_request"){e.invalidateQueries({queryKey:P.access.joinRequests(t)});return}if(u==="cost_event"){e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:["usage-by-provider",t]}),e.invalidateQueries({queryKey:["usage-by-biller",t]}),e.invalidateQueries({queryKey:P.usageWindowSpend(t)});return}if(u==="routine"||u==="routine_trigger"||u==="routine_run"){if(e.invalidateQueries({queryKey:["routines"]}),u==="routine"&&f&&Zq.has(f)&&p){const j=be(v?.key)??be(v?.documentKey)??"description",k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:["routines","document-annotations",p,j],...k})}return}if(u==="case"){if(e.invalidateQueries({queryKey:P.cases.list(t)}),p&&(e.invalidateQueries({queryKey:P.cases.detail(p)}),e.invalidateQueries({queryKey:P.cases.events(p)}),f&&Jq.has(f))){const j=be(v?.key)??be(v?.documentKey),k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:j?["cases","document-annotations",p,j]:["cases","document-annotations",p],...k})}return}if(u==="summary_slot"){const j=be(v?.scopeKind),k=be(v?.slotKey),S=be(v?.scopeId);j&&k&&(e.invalidateQueries({queryKey:P.summarySlots.detail(t,j,k,S)}),e.invalidateQueries({queryKey:P.summarySlots.revisions(t,j,k,S)}));return}u==="company"&&e.invalidateQueries({queryKey:P.companies.all})}r(m7,"invalidateActivityQueries");function h7(e,t){const s=t.payload??{},l=be(s.runId),c=be(s.status);if(!l||!c||!Uc.has(c))return!1;const u=`${t.companyId}:${l}:${c}`,p=e.observedRunOutcomes.has(u);e.observedRunOutcomes.delete(u),e.observedRunOutcomes.add(u),e.observedRunOutcomes.size>Mq&&e.observedRunOutcomes.delete(e.observedRunOutcomes.values().next().value);const f=Date.parse(be(s.finishedAt)??""),h=Date.parse(t.createdAt);return p||h-f>Rq}r(h7,"observeRunOutcome");function g7(e,t){const s=Date.now();if(s<e.suppressUntil)return!0;const l=e.cooldownHits.get(t);if(!l)return!1;const c=l.filter(u=>s-u<Eq);return e.cooldownHits.set(t,c),c.length>=Iq}r(g7,"shouldSuppressToast");function x7(e,t){const s=Date.now(),l=e.cooldownHits.get(t)??[];l.push(s),e.cooldownHits.set(t,l)}r(x7,"recordToastHit");function Fh(e,t,s,l){g7(e,s)||t(l)!==null&&x7(e,s)}r(Fh,"gatedPushToast");function b7(e,t,s,l,c,u,p,f){if(l.companyId!==t)return;const h=r(k=>n2(e,t,k),"nameOf"),g=l.payload??{},v=l.type==="heartbeat.run.status"&&(h7(u,l)||Kq(e,s,g)),y=qq(g,l.createdAt,l.type);let j=!1;if(y){const k=r(S=>{j=Vq(e,t,s,S)},"applyPatch");l.type==="heartbeat.run.log"&&f?f.submit(y,k):k(y)}if(l.type!=="heartbeat.run.log"){if(l.type==="heartbeat.run.queued"||l.type==="heartbeat.run.status"){const k=l7(e,t,g);if(o7(e,t,g),xk(e,l),k||e.invalidateQueries({queryKey:P.liveRuns(t)}),Ak(e,s,g,{runLifecycleEvent:!0}),(l.type==="heartbeat.run.status"&&f7.has(be(g.status)??"")||l.type==="heartbeat.run.queued"&&Ik(e,t,S=>S.sourceKind==="failed_run",S=>(S.countsBySourceKind?.failed_run??0)>0))&&i0(e,t),l.type==="heartbeat.run.status"){const S=r7(g,h);S&&!v&&Fh(u,c,"run-status",S)}return}if(l.type==="heartbeat.run.progress"){c7(e,t,g),Ak(e,s,g,{liveStatusAlreadyPatched:j});return}if(l.type==="heartbeat.run.event"){xk(e,l);return}if(l.type==="agent.status"){e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:P.org(t)});const k=be(g.agentId);k&&e.invalidateQueries({queryKey:P.agents.detail(k)}),(be(g.status)==="error"||k&&Ik(e,t,N=>N.sourceKind==="agent_error_alert"&&N.subject?.id===k,N=>N.errorAgentIds?.includes(k)===!0))&&i0(e,t);const S=i7(g,h,e,t);S&&!Wq(e,s,g)&&Fh(u,c,"agent-status",S);return}if(l.type==="activity.logged"){m7(e,t,g,p,{pathname:s,occurredAt:l.createdAt??null}),r2(e,s,g)&&Gq(e,s,g);const k=be(g.action),S=a7(e,t,g,p)??s7(g);S&&!Bq(e,s,g)&&Fh(u,c,`activity:${k??"unknown"}`,S)}}}r(b7,"handleLiveEvent");function v7(e,t){return e&&e===t?e:null}r(v7,"resolveLiveCompanyId");function Tk(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null}r(Tk,"resetSocketHandlers");function Rk(e,t){if(e){if(e.readyState===Oq){e.onopen=()=>{Tk(e),e.close(1e3,t)},e.onmessage=null,e.onerror=()=>{},e.onclose=null;return}Tk(e),e.readyState===Lq&&e.close(1e3,t)}}r(Rk,"closeSocketQuietly");function y7(e,t,s){return e==="success"&&(t||s==="local_trusted")}r(y7,"canUseLiveSession");function j7({children:e}){const{visible:t}=r1(),s=(0,x.useRef)(!t),{selectedCompanyId:l,selectedCompany:c}=vt(),u=kn(),{pushToast:p}=Ti(),f=hn(),h=(0,x.useRef)({cooldownHits:new Map,suppressUntil:0,observedRunOutcomes:new Set}),g=(0,x.useRef)(f.pathname),{data:v,status:y}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),{data:j}=me({queryKey:P.health,queryFn:Fc.get}),k=v?.user?.id??v?.session?.userId??(j?.deploymentMode==="local_trusted"?"local-board":null),S=v?.session?.id??k??"signed_out",N=v7(l,c?.id??null),I=y7(y,v!=null,j?.deploymentMode)&&N!==null,C=(0,x.useRef)({userId:k,agentId:null}),M=(0,x.useRef)(new Set),R=(0,x.useCallback)(z=>(M.current.add(z),()=>{M.current.delete(z)}),[]),_=(0,x.useMemo)(()=>({subscribe:R}),[R]),D=(0,x.useMemo)(()=>jK(u),[u]),U=(0,x.useMemo)(()=>kK(u,D),[u,D]),K=(0,x.useMemo)(()=>Hq(),[]);return(0,x.useEffect)(()=>()=>{D.dispose(),K.dispose()},[D,K]),(0,x.useEffect)(()=>{g.current=f.pathname},[f.pathname]),(0,x.useEffect)(()=>{C.current={userId:k,agentId:null}},[k]),(0,x.useEffect)(()=>{if(!t||!I||!N)return;const z=window.setInterval(()=>{PK(u,N)},_K);return()=>window.clearInterval(z)},[I,N,u,t]),(0,x.useEffect)(()=>{if(!t){s.current=!0,D.dispose(),K.dispose();return}if(!I||!N)return;s.current&&(s.current=!1,u.invalidateQueries({type:"active"},{cancelRefetch:!1}));let z=!1,E=0,B=null,O=null,Q=null;const V=r(()=>{B!==null&&(window.clearTimeout(B),B=null)},"clearReconnect"),ue=r(()=>{O!==null&&(window.clearInterval(O),O=null)},"stopPolling"),ce=r(()=>{z||O!==null||(O=window.setInterval(()=>{u.invalidateQueries({type:"active"},{cancelRefetch:!1})},Dq))},"startPolling"),X=r(()=>{if(z||B!==null)return;E+=1;const ie=Math.min(15e3,1e3*2**Math.min(E-1,4));B=window.setTimeout(()=>{B=null,A()},ie)},"scheduleReconnect"),A=r(()=>{if(z)return;const ie=qK(`/api/companies/${encodeURIComponent(N)}/events/ws`),le=FK(ie);if(!le){ce(),X();return}Q=le,le.onopen=()=>{if(z||Q!==le){Rk(le,"stale_connection");return}ue(),E>0&&(h.current.suppressUntil=Date.now()+Tq),u.invalidateQueries({type:"active"},{cancelRefetch:!1}),E=0},le.onmessage=Ae=>{if(!Kc().visible)return;const de=typeof Ae.data=="string"?Ae.data:"";if(de)try{const we=JSON.parse(de);if(b7(U,N,g.current,we,p,h.current,{userId:C.current.userId,agentId:C.current.agentId},K),zq(M.current,N,we),we.type==="notification.created"){const ye=Aq(we.payload);ye&&Nq(ye,C.current.userId)}}catch{}},le.onerror=()=>{},le.onclose=()=>{Q===le&&(Q=null,!z&&(ce(),X()))}},"connect"),ee=window.setTimeout(A,0);return()=>{z=!0,window.clearTimeout(ee),V(),ue();const ie=Q;Q=null,Rk(ie,"provider_unmount")}},[t,D,K,u,U,N,p,I,S]),(0,a.jsx)(t2.Provider,{value:_,children:e})}r(j7,"LiveUpdatesProvider");function w7(e){let t=Zr();jk(t),s0(t,e.userId);const s=GA(()=>{const u=Zr();u!==t&&(t=u,jk(u),s0(u,e.userId))}),l=typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:null,c=r(u=>{const p=_q(u.data);p&&(p.type==="navigate"?e.navigate(p.url):Cq(p.notification))},"onMessage");return l?.addEventListener("message",c),l?.startMessages(),()=>{s(),l?.removeEventListener("message",c)}}r(w7,"startNotificationRuntime");function k7(){const e=ja(),t=(0,x.useRef)(e),{data:s}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),l=s?.user?.id??s?.session?.userId??null;return(0,x.useEffect)(()=>{t.current=e},[e]),(0,x.useEffect)(()=>{if(l)return w7({userId:l,navigate:r(c=>t.current(c),"navigate")})},[l]),null}r(k7,"NotificationRuntime");var S7=36e5,N7=3e3,C7=2e3,Mk="wardmote.skip-waiting",A7="wardmote.build-id",l2=null,r0=new Set;function _7(e){l2=e;for(const t of r0)t()}r(_7,"publishUpdate");function E7(e){return r0.add(e),()=>{r0.delete(e)}}r(E7,"subscribe");function I7(){return(0,x.useSyncExternalStore)(E7,()=>l2,()=>null)}r(I7,"useServiceWorkerUpdate");function T7(e){return new Promise(t=>{const s=new MessageChannel,l=r(u=>{clearTimeout(c),s.port1.close(),t(u)},"finish"),c=setTimeout(()=>l(null),C7);s.port1.onmessage=u=>{l(typeof u.data?.buildId=="string"?u.data.buildId:null)},e.postMessage({type:A7},[s.port2])})}r(T7,"requestWorkerBuildId");function R7(e={}){const t=e.container??(typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:void 0);if(!t)return()=>{};const s=e.documentRef??document,l=e.reload??(()=>window.location.reload()),c=e.updateIntervalMs??S7,u=e.onUpdateReady??_7;let p=!!t.controller,f=!1,h=!1,g,v=!1;const y=r(async _=>e.pageBuildId?await T7(_)!==e.pageBuildId:!0,"servesNewerBuild"),j=r(()=>{h||(h=!0,g!==void 0&&clearTimeout(g),l())},"reloadOnce"),k=r(async _=>{const D=await y(_);if(!v){if(!D){_.postMessage({type:Mk});return}u(()=>{f=!0,_.postMessage({type:Mk}),g=setTimeout(j,N7)})}},"offerWaiting"),S=r(()=>{if(!p){p=!0;return}if(f){j();return}const _=t.controller;_&&y(_).then(D=>{D&&!v&&!f&&u(j)})},"onControllerChange");t.addEventListener("controllerchange",S);let N;const I=r(()=>{const _=N?.installing;_&&_.addEventListener("statechange",()=>{_.state==="installed"&&t.controller&&k(_)})},"watchInstalling"),C=r(()=>{N?.update().catch(()=>{})},"checkForUpdates"),M=r(()=>{s.visibilityState==="visible"&&C()},"onVisibilityChange");s.addEventListener("visibilitychange",M);const R=setInterval(C,c);return t.register("/sw.js").then(_=>{N=_,_.waiting&&t.controller&&k(_.waiting),_.addEventListener("updatefound",I)}).catch(()=>{}),()=>{v=!0,t.removeEventListener("controllerchange",S),s.removeEventListener("visibilitychange",M),N?.removeEventListener("updatefound",I),clearInterval(R),g!==void 0&&clearTimeout(g)}}r(R7,"startServiceWorkerUpdates");var o2="wardmote.notifications.asked-after-decision";function M7(){try{return window.localStorage.getItem(o2)==="1"}catch{return!0}}r(M7,"alreadyAsked");function D7(){try{window.localStorage.setItem(o2,"1")}catch{return}}r(D7,"markAsked");async function O7(e){const t=await WK();if(t!=="granted")return t;const s=QA(l=>({...l,enabled:!0,pushEnabled:!0}));return e&&await s0(s,e),t}r(O7,"enableNotificationsAfterDecision");function L7(){const{pushToast:e}=Ti(),{data:t}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),s=t?.user?.id??t?.session?.userId??null;(0,x.useEffect)(()=>PE(()=>{M7()||!vx()||yx()!=="default"||(D7(),e({id:"wardmote-notify-after-decision",title:"Get notified when an agent needs a decision",body:"Turn on notifications for this device. You can change it later in Settings.",tone:"info",persistent:!0,action:{label:"Turn on",onClick:r(()=>{O7(s)},"onClick")}}))}),[e,s])}r(L7,"useFirstDecisionNotificationPrompt");var z7="wardmote-update-ready";function P7(){const{pushToast:e}=Ti(),t=I7(),s=kn(),l=y0(),c=(0,x.useRef)(l);return(0,x.useEffect)(()=>{t&&e({id:z7,title:"A new version is ready.",tone:"info",persistent:!0,action:{label:"Reload",onClick:t}})},[t,e]),(0,x.useEffect)(()=>{if(l){c.current=!0;return}c.current&&(c.current=!1,s.invalidateQueries())},[l,s]),L7(),null}r(P7,"PwaRuntime");var c2={get:r(e=>je.get(`/companies/${e}/primary-agent/me`),"get"),set:r((e,t)=>je.put(`/companies/${e}/primary-agent/me`,t),"set")};function $7(e){const t=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),s=t.data?.user?.id??t.data?.session?.userId??"local-board",l=me({queryKey:P.primaryAgent.mine(e??"__none__",s),queryFn:r(()=>c2.get(e),"queryFn"),enabled:!!e&&t.isSuccess});return{...l,userId:s,loading:!!e&&(t.isPending||l.isPending&&!t.error),error:t.error??l.error,retry:r(()=>t.isError?t.refetch():l.refetch(),"retry")}}r($7,"usePrimaryAgent");function U7({children:e}){const{selectedCompanyId:t}=vt(),s=$7(t),l=kn(),{pushToast:c}=Ti(),u=(0,x.useRef)({companyId:t,userId:s.userId});u.current={companyId:t,userId:s.userId};const p=r(j=>P.primaryAgent.mine(j.companyId,j.userId),"keyFor"),f=r(j=>j.companyId===u.current.companyId&&j.userId===u.current.userId,"isCurrentScope"),h=me({queryKey:P.agents.list(t),queryFn:r(()=>Fa.list(t),"queryFn"),enabled:!!t}),g=Bt({mutationFn:r(j=>c2.set(j.companyId,{primaryAgentId:j.agentId}),"mutationFn"),onMutate:r(async j=>{const k=p(j);await l.cancelQueries({queryKey:k});const S=l.getQueryData(k);return l.setQueryData(k,{companyId:j.companyId,userId:j.userId,primaryAgentId:j.agentId,initialized:!0}),{previous:S}},"onMutate"),onError:r((j,k,S)=>{l.setQueryData(p(k),S?.previous),f(k)&&c({title:"Couldn't change your primary agent.",body:j.message,tone:"error",action:{label:"Retry",onClick:r(()=>{f(k)&&g.mutate(k)},"onClick")}})},"onError"),onSuccess:r((j,k)=>l.setQueryData(p(k),j),"onSuccess"),onSettled:r((j,k,S)=>{l.invalidateQueries({queryKey:p(S)}),l.invalidateQueries({queryKey:P.resourceMemberships.mine(S.companyId)})},"onSettled")}),v=h.data?.find(j=>j.id===s.data?.primaryAgentId&&j.status!=="terminated")??null,y=s.error??h.error;return(0,a.jsx)(d5,{value:t?{companyId:t,primaryAgentId:v?.id??null,primaryAgent:v,loading:s.loading||h.isPending,error:y?.message,onRetry:r(()=>{s.retry(),h.refetch()},"onRetry"),pendingAgentId:g.isPending&&f(g.variables)?g.variables.agentId:null,onChange:r(j=>g.mutate({companyId:t,userId:s.userId,agentId:j}),"onChange")}:null,children:e})}r(U7,"PrimaryAgentProvider");var Dk="min-h-9",B7={default:void 0,warning:"bg-amber-500/5 text-amber-700 dark:text-amber-300",error:"bg-bad/5 text-bad",muted:"opacity-50"};function zY(e,t){const s={name:"",path:"",kind:"dir",children:[]};for(const c of Object.keys(e)){const u=c.split("/").filter(Boolean);let p=s,f="";for(let h=0;h<u.length;h++){const g=u[h];f=f?`${f}/${g}`:g;const v=h===u.length-1;let y=p.children.find(j=>j.name===g);y||(y={name:g,path:f,kind:v?"file":"dir",children:[],action:v?t?.get(c)??null:null},p.children.push(y)),p=y}}function l(c){c.children.sort((u,p)=>u.kind!==p.kind?u.kind==="file"?-1:1:u.name.localeCompare(p.name)),c.children.forEach(l)}return r(l,"sortNode"),l(s),s.children}r(zY,"buildFileTree");function K7(e){let t=0;for(const s of e)s.kind==="file"?t++:t+=K7(s.children);return t}r(K7,"countFiles");function u2(e,t="all"){const s=new Set;for(const l of e){(t==="all"||l.kind===t)&&s.add(l.path);for(const c of u2(l.children,t))s.add(c)}return s}r(u2,"collectAllPaths");function q7(e){return e.endsWith(".yaml")||e.endsWith(".yml")?U1:B1}r(q7,"fileIcon");function d2(e,t,s=0){const l=[];for(const c of e)l.push({node:c,depth:s}),c.kind==="dir"&&t.has(c.path)&&l.push(...d2(c.children,t,s+1));return l}r(d2,"flattenVisibleNodes");function F7(e,t){if(e.kind==="file")return{allChecked:t.has(e.path),someChecked:!1};const s=[...u2(e.children,"file")],l=s.length>0&&s.every(c=>t.has(c));return{allChecked:l,someChecked:s.some(c=>t.has(c))&&!l}}r(F7,"checkboxState");function PY(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return null;const s={},l=t[1],c=t[2];let u=null,p=null;for(const f of l.split(`
58
+ `):[]),[D]),K=(0,x.useMemo)(()=>y&&!y.error&&!y.truncated?new Set(y.models.map(O=>O.id)):null,[y]),z=(0,x.useCallback)(O=>{f(Q=>{const V=Q.models.filter(X=>X.id.trim()),ue=new Set(V.map(X=>X.id.trim())),ce=O.filter(X=>!ue.has(X.id)).map(X=>({...$d,id:X.id,name:X.name??""}));return{...Q,models:[...V,...ce]}})},[]);function E(O){O.preventDefault(),C||M.mutate()}r(E,"submit");const B=[...I&&e.apiKey.kind!=="none"&&e.apiKey.kind!=="missing"?[{mode:"keep",label:"Keep saved"}]:[],{mode:"literal",label:"Key"},{mode:"env",label:"Env variable"},{mode:"command",label:"Command"},{mode:"none",label:"No key"}];return(0,a.jsxs)("form",{onSubmit:E,"aria-label":I?`Edit ${e.name}`:"Add a custom provider",className:"flex flex-col gap-4 rounded-lg border border-line bg-bg-2 px-4 py-4 sm:px-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:I?`Edit ${e.name}`:"Add a custom provider"}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:(0,a.jsx)(ia,{"aria-hidden":"true"})})]}),I&&e.otherKeys.length?(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Also kept as written in models.yml: ",e.otherKeys.join(", "),"."]}):null,(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(dc,{label:"Name",hint:C??"Used in model ids, e.g. my-gateway/model",children:(0,a.jsx)(Wn,{value:p.name,onChange:r(O=>k({name:O.target.value}),"onChange"),disabled:I,required:!0,"aria-invalid":!!C,placeholder:"my-gateway",autoComplete:"off"})}),(0,a.jsx)(dc,{label:"Base URL",hint:"Usually ends in /v1",children:(0,a.jsx)(Wn,{value:p.baseUrl,onChange:r(O=>k({baseUrl:O.target.value}),"onChange"),required:!0,type:"url",placeholder:"http://localhost:8000/v1",autoComplete:"off"})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"API key"}),(0,a.jsx)(HT,{"aria-label":"Where the key comes from",className:"flex-wrap self-start",children:B.map(({mode:O,label:Q})=>(0,a.jsx)(FT,{selected:p.keyMode===O,onClick:r(()=>k({keyMode:O,keyValue:""}),"onClick"),children:Q},O))}),p.keyMode==="literal"?(0,a.jsx)(Wn,{value:p.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),type:"password",autoComplete:"off",required:!0,"aria-label":"API key",placeholder:"sk-..."}):p.keyMode==="env"?(0,a.jsx)(Wn,{value:p.keyValue,onChange:r(O=>k({keyValue:O.target.value.toUpperCase()}),"onChange"),required:!0,"aria-label":"Environment variable name",placeholder:"MY_GATEWAY_KEY",autoComplete:"off"}):p.keyMode==="command"?(0,a.jsx)(Wn,{value:p.keyValue,onChange:r(O=>k({keyValue:O.target.value}),"onChange"),required:!0,"aria-label":"Command that prints the key",placeholder:"op read op://vault/gateway/key",autoComplete:"off",className:"font-mono"}):null,(0,a.jsx)("span",{className:"text-xs text-ink-3",children:p.keyMode==="keep"?`The saved ${e?.apiKey.kind==="env"?`variable ${e.apiKey.name}`:e?.apiKey.kind==="command"?"command":"key"} stays as it is.`:p.keyMode==="env"?"OMP reads the key from this variable on the machine that runs agents.":p.keyMode==="command"?"OMP runs this command and uses what it prints.":p.keyMode==="none"?"For local servers that need no key.":"Saved in OMP's models.yml. Wardmote never shows it again."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(dc,{label:"Wire format (api)",hint:"Picking the wrong one is the most common mistake. Test connection suggests the right one.",children:(0,a.jsxs)(hg,{value:p.api,onChange:r(O=>k({api:O.target.value}),"onChange"),className:"w-full",children:[(0,a.jsx)("option",{value:"",children:"Set per model"}),_E.map(O=>(0,a.jsx)("option",{value:O,children:h6[O]??O},O))]})}),(0,a.jsx)(oe,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!p.baseUrl.trim()||R.isPending,onClick:r(()=>R.mutate(),"onClick"),children:R.isPending?"Testing...":"Test connection"}),R.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(R.error).join(" ")}):null,g?(0,a.jsxs)(Ia,{tone:g.suggestedApi?"ok":"bad",children:[g.suggestedApi?`${g.suggestedApi} answered${g.usedModel?` for ${g.usedModel}`:""}, so the wire format is set to it.`:g.usedModel?`No wire format answered for ${g.usedModel}. Check the base URL, key and model id.`:"The server listed no models. Add a model id below, then test again.",(0,a.jsx)("ul",{className:"mt-1 flex flex-col gap-0.5 text-xs text-ink-3",children:g.attempts.map(O=>(0,a.jsxs)("li",{className:"break-all",children:[O.api,": ",O.status??"no answer",O.detail&&!O.ok?` (${O.detail})`:""]},O.api))})]}):null]}),(0,a.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,a.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Models"}),p.models.map((O,Q)=>(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 rounded-md border border-line-soft p-2 sm:grid-cols-[2fr_2fr_1fr_1fr_auto]",children:[K&&O.id.trim()&&!K.has(O.id.trim())?(0,a.jsx)("span",{className:"col-span-2 text-xs text-ink-3 sm:col-span-5",children:"Not listed upstream any more; kept until you remove it."}):null,(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} id`,value:O.id,onChange:r(V=>S(Q,{id:V.target.value}),"onChange"),placeholder:"model id",className:"col-span-2 sm:col-span-1",autoComplete:"off"}),(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} name`,value:O.name,onChange:r(V=>S(Q,{name:V.target.value}),"onChange"),placeholder:"Display name",className:"col-span-2 sm:col-span-1"}),(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} context window`,value:O.contextWindow,onChange:r(V=>S(Q,{contextWindow:V.target.value}),"onChange"),placeholder:"Context",inputMode:"numeric"}),(0,a.jsx)(Wn,{"aria-label":`Model ${Q+1} max output tokens`,value:O.maxTokens,onChange:r(V=>S(Q,{maxTokens:V.target.value}),"onChange"),placeholder:"Max output",inputMode:"numeric"}),(0,a.jsxs)("div",{className:"col-span-2 flex items-center justify-between gap-3 text-xs sm:col-span-1",children:[(0,a.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("input",{type:"checkbox",checked:O.reasoning,onChange:r(V=>S(Q,{reasoning:V.target.checked}),"onChange")}),"Thinks"]}),(0,a.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("input",{type:"checkbox",checked:O.images,onChange:r(V=>S(Q,{images:V.target.checked}),"onChange")}),"Images"]}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove model ${Q+1}`,onClick:r(()=>k({models:p.models.filter((V,ue)=>ue!==Q)}),"onClick"),children:(0,a.jsx)(rg,{"aria-hidden":"true"})})]})]},Q)),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>k({models:[...p.models,{...$d}]}),"onClick"),children:[(0,a.jsx)(ns,{"aria-hidden":"true"}),"Add model"]}),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",disabled:!p.baseUrl.trim()||_.isPending,onClick:r(()=>_.mutate(),"onClick"),children:[(0,a.jsx)(cR,{"aria-hidden":"true"}),_.isPending?"Fetching...":"Fetch models"]})]}),_.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(_.error).join(" ")}):null,y?.error?(0,a.jsx)(Ia,{tone:"bad",children:y.error}):null,y&&!y.error?(0,a.jsx)(m6,{result:y,savedIds:U,room:500-U.size,onAdd:z}):null,(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Leave context and max output empty when unsure; OMP fills known models in."})]}),(0,a.jsxs)("details",{className:"flex flex-col gap-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer select-none text-sm font-medium",children:"Advanced"}),(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[(0,a.jsx)(Oh,{label:"Send the key as an Authorization header",hint:"OpenAI wire formats already do. Turn on for discovery or proxies that need it.",checked:p.authHeader,onChange:r(O=>k({authHeader:O}),"onChange")}),(0,a.jsx)(Oh,{label:"Disable strict tools",hint:"For Anthropic-style proxies that reject strict tool schemas.",checked:p.disableStrictTools,onChange:r(O=>k({disableStrictTools:O}),"onChange")}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(dc,{label:"Model discovery",hint:"Ask the server for its models instead of listing them",children:(0,a.jsxs)(hg,{value:p.discovery,onChange:r(O=>k({discovery:O.target.value}),"onChange"),className:"w-full",children:[(0,a.jsx)("option",{value:"",children:"Off"}),wE.map(O=>(0,a.jsx)("option",{value:O,children:g6[O]??O},O))]})}),p.discovery?(0,a.jsx)(dc,{label:"Discovery timeout (ms)",children:(0,a.jsx)(Wn,{value:p.discoveryTimeout,onChange:r(O=>k({discoveryTimeout:O.target.value}),"onChange"),inputMode:"numeric",placeholder:"OMP default"})}):null]}),p.discovery==="openai-models-list"?(0,a.jsx)(Oh,{label:"Add /v1 to the discovery URL",hint:"Turn on when the base URL has no /v1 but the model list lives under it.",checked:p.injectV1,onChange:r(O=>k({injectV1:O}),"onChange")}):null,(0,a.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,a.jsx)("legend",{className:"mb-1.5 text-sm font-medium",children:"Extra headers"}),p.headers.map((O,Q)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2",children:[(0,a.jsx)(Wn,{"aria-label":`Header ${Q+1} name`,value:O.name,onChange:r(V=>N(Q,{name:V.target.value}),"onChange"),placeholder:"X-Header",disabled:O.saved}),(0,a.jsx)(Wn,{"aria-label":`Header ${Q+1} value`,value:O.value,onChange:r(V=>N(Q,{value:V.target.value}),"onChange"),placeholder:O.saved?"Saved; type to replace":"value",type:"password",autoComplete:"off"}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove header ${Q+1}`,onClick:r(()=>k({headers:p.headers.filter((V,ue)=>ue!==Q)}),"onClick"),children:(0,a.jsx)(rg,{"aria-hidden":"true"})})]},Q)),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",className:"self-start",onClick:r(()=>k({headers:[...p.headers,{name:"",value:"",saved:!1}]}),"onClick"),children:[(0,a.jsx)(ns,{"aria-hidden":"true"}),"Add header"]})]})]})]}),M.error?(0,a.jsx)(Ia,{tone:"bad",children:(0,a.jsx)("ul",{className:"flex flex-col gap-0.5",children:wc(M.error).map(O=>(0,a.jsx)("li",{children:O},O))})}):null,(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(oe,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),(0,a.jsx)(oe,{type:"submit",disabled:M.isPending||!!C,children:M.isPending?"Checking with OMP...":"Save provider"})]})]})}r(Ww,"CustomProviderForm");function v6(e){switch(e.apiKey.kind){case"env":return e.apiKey.present?`key from ${e.apiKey.name}`:`${e.apiKey.name} is not set on the server`;case"literal":return"key saved";case"command":return"key from a command";case"none":return"no key";case"oauth":return"OMP sign-in";default:return"no key set"}}r(v6,"keySummary");var to=":new";function y6(e){return e===to?to:e.name}r(y6,"providerKey");function j6({onChanged:e}){const t=kn(),s=me({queryKey:Dh,queryFn:r(()=>ya.customProviders(),"queryFn")}),l=d6(y6),c=Bt({mutationFn:r(h=>ya.removeCustomProvider(h),"mutationFn"),onSuccess:r((h,g)=>{t.setQueryData(Dh,h),l.openKey===g&&l.close(!1),e?.()},"onSuccess")}),u=s.data?.providers??[],p=u.map(h=>h.name),f=r(h=>{t.setQueryData(Dh,h),l.close(),e?.()},"onSaved");return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[s.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(s.error).join(" ")}):null,s.data?.parseError?(0,a.jsxs)(Ia,{tone:"bad",children:[s.data.parseError,". Fix ",s.data.modelsPath," by hand; Wardmote will not overwrite it."]}):null,u.length?(0,a.jsx)("ul",{"aria-label":"Custom providers",className:"flex flex-col divide-y divide-line rounded-lg border border-line",children:u.map(h=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 text-sm",children:[(0,a.jsx)("b",{className:"font-medium",children:h.name}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-ink-3",children:[h.baseUrl,h.api,v6(h),h.discovery?`discovery: ${h.discovery.type}`:`${h.models.length} ${h.models.length===1?"model":"models"}`].filter(Boolean).join(" · ")}),(0,a.jsxs)("span",{className:"flex gap-1",children:[(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Edit ${h.name}`,...l.triggerProps(h.name),onClick:r(()=>l.toggle(h),"onClick"),children:(0,a.jsx)(K0,{"aria-hidden":"true"})}),(0,a.jsx)(oe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${h.name}`,disabled:c.isPending,onClick:r(()=>{window.confirm(`Remove ${h.name} from OMP's models.yml? A backup stays in models.yml.bak.`)&&c.mutate(h.name)},"onClick"),children:(0,a.jsx)(rg,{"aria-hidden":"true"})})]})]}),l.openKey===h.name?(0,a.jsx)(Hw,{id:l.panelId(h.name),onEscape:l.dismiss,className:"px-2 pb-2 sm:px-3 sm:pb-3",children:(0,a.jsx)(Ww,{provider:h,takenNames:p,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):null]},h.name))}):s.isLoading?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Reading models.yml..."}):null,c.error?(0,a.jsx)(Ia,{tone:"bad",children:wc(c.error).join(" ")}):null,l.openKey===to?(0,a.jsx)(Hw,{id:l.panelId(to),onEscape:l.dismiss,children:(0,a.jsx)(Ww,{provider:null,takenNames:p,onCancel:r(()=>l.close(),"onCancel"),onSaved:f,onDirtyChange:l.setDirty})}):(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!!s.data?.parseError,...l.triggerProps(to),onClick:r(()=>l.request(to),"onClick"),children:[(0,a.jsx)(ns,{"aria-hidden":"true"}),"Add custom provider"]}),s.data?(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Saved to ",s.data.modelsPath,", with the previous copy in models.yml.bak."]}):null]})}r(j6,"CustomProviders");var w6=["Check OMP","Connect a model","First task"],Wg="Atlas",k6="general";var S6="Only an instance admin can set up OMP on this server.";function Lh(e){return e?e.status===403?{message:S6,retry:!1}:{message:e.message||"Could not check OMP on this server.",retry:!0}:null}r(Lh,"statusFailure");var N6={anthropic:"Anthropic",openai:"OpenAI","openai-codex":"OpenAI",openrouter:"OpenRouter",google:"Google",deepseek:"DeepSeek"};function C6(e){return e?N6[e]??e:null}r(C6,"providerLabel");function A6(e){return e.state==="ready"?"ready":e.state==="missing"?e.network==="offline"?"offline":"install":"old"}r(A6,"checkView");function _6(e){return(e?.models.length??0)>0}r(_6,"hasModel");function E6(e){return e.state!=="ready"?null:_6(e)?2:1}r(E6,"nextStepAfterCheck");function I6(e){return!e.connected||e.state!=="ready"?null:e.modelCount>0?2:1}r(I6,"nextStepAfterRemote");function T6(e){return e.copies.slice(1).filter(t=>t.version!==e.version)}r(T6,"olderCopies");function R6(e){const t=e.trim().split(/\r?\n/,1)[0]?.trim()??"";return t.length<=120?t:`${t.slice(0,119).trimEnd()}…`}r(R6,"taskTitle");function Qw(e){const t=e?.replace(/[\\/]+$/,"").split(/[\\/]/).pop()?.trim();return t||"My company"}r(Qw,"companyNameForFolder");function M6(e){return e?.recommendedModel?e.models.find(t=>t.id===e.recommendedModel)?.label??e.recommendedModel:null}r(M6,"recommendedModelLabel");function D6(e){return e?.recommendedModel?C6(e.models.find(t=>t.id===e.recommendedModel)?.provider??e.recommendedModel.split("/",1)[0]):null}r(D6,"signedInProvider");var gf="Wardmote",EA=2e3,kd=["onboarding","omp-status"],O6={ok:(0,a.jsx)(Rs,{className:"size-3.5","aria-hidden":!0}),bad:(0,a.jsx)(ia,{className:"size-3.5","aria-hidden":!0}),warn:(0,a.jsx)(ni,{className:"size-3.5","aria-hidden":!0}),wait:(0,a.jsx)(GI,{className:"size-3.5","aria-hidden":!0}),run:(0,a.jsx)(nl,{className:"size-3.5 motion-safe:animate-spin","aria-hidden":!0})},L6={ok:"bg-ok-soft text-ok",bad:"bg-bad-soft text-bad",warn:"bg-warn-soft text-warn",wait:"bg-bg-3 text-ink-3",run:"bg-run-soft text-run"};function no({rows:e,label:t}){return(0,a.jsx)("section",{"aria-label":t,className:"rounded-lg border border-line-soft bg-bg-2 px-4 py-1",children:(0,a.jsx)("ul",{children:e.map(s=>(0,a.jsxs)("li",{"data-check":s.state,className:"flex items-center gap-2.5 border-b border-line-soft py-2 text-(length:--t-13) last:border-b-0",children:[(0,a.jsx)("span",{className:Y("grid size-5.5 shrink-0 place-items-center rounded-full",L6[s.state]),children:O6[s.state]}),(0,a.jsx)("span",{className:"min-w-0",children:s.label}),s.value?(0,a.jsx)("span",{className:"ms-auto min-w-0 truncate font-mono text-xs text-ink-3",children:s.value}):null]},s.label))})})}r(no,"Checks");function Qg({command:e}){const[t,s]=(0,x.useState)(!1);return(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,a.jsx)("code",{className:"block w-full whitespace-pre-wrap break-all rounded-md border border-line-soft bg-bg-3 px-3 py-2.5 font-mono text-(length:--t-13)",children:e}),(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>{$0(e).then(()=>s(!0))},"onClick"),children:[t?(0,a.jsx)(Rs,{className:"size-3.5","aria-hidden":!0}):(0,a.jsx)(a3,{className:"size-3.5","aria-hidden":!0}),t?"Copied":"Copy command"]})]})}r(Qg,"CommandBlock");function xf({tone:e,children:t}){return(0,a.jsxs)("div",{role:e==="bad"?"alert":"note",className:Y("flex gap-2.5 rounded-md px-3 py-2.5 text-(length:--t-13)",{warn:"bg-warn-soft",info:"bg-run-soft",bad:"bg-bad-soft"}[e]),children:[(0,a.jsx)(ni,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:t})]})}r(xf,"Note");function z6({step:e}){return(0,a.jsx)("ol",{"aria-label":"Setup steps",className:"flex flex-wrap items-center gap-1.5 text-xs text-ink-2",children:w6.map((t,s)=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5","aria-current":s===e?"step":void 0,children:[s>0?(0,a.jsx)("span",{"aria-hidden":!0,className:"h-px w-5.5 bg-line"}):null,(0,a.jsx)("span",{className:Y("grid size-5 place-items-center rounded-full border border-line-strong text-(length:--text-micro) font-semibold",s<e&&"border-ok bg-ok text-bg",s===e&&"border-accent text-accent"),children:s<e?(0,a.jsx)(Rs,{className:"size-3","aria-hidden":!0}):s+1}),(0,a.jsx)("span",{className:Y(s===e?"font-semibold text-ink":"max-sm:sr-only"),children:t})]},t))})}r(z6,"Steps");function or({title:e,lede:t}){return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("h1",{id:"onboarding-title",className:"text-(length:--t-24) font-semibold tracking-tight sm:text-(length:--t-32) sm:leading-tight",children:e}),(0,a.jsx)("p",{className:"max-w-130 text-base text-ink-2",children:t})]})}r(or,"Heading");function IA({title:e,paragraphs:t}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e}),t.map(s=>(0,a.jsx)("p",{className:"text-sm text-ink-2",children:s},s))]})}r(IA,"SideText");var P6=(0,a.jsx)(IA,{title:"Why OMP",paragraphs:[`${gf} runs every agent on OMP. OMP talks to the model and uses the tools; ${gf} assigns work, keeps the record and holds the settings.`,"You will not need to open OMP's own settings: models, thinking and tools are set here."]});function $c({children:e}){return(0,a.jsx)("div",{className:"mt-auto flex flex-wrap items-center gap-2 pt-2",children:e})}r($c,"Actions");function Gg(e){if(e instanceof Ii){const t=e.body;if(t&&typeof t.error=="string")return t.error}return e instanceof Error?e.message:String(e)}r(Gg,"errorMessage$1");function $6({open:e,onOpenChange:t,onPick:s}){const[l,c]=(0,x.useState)(null),u=me({queryKey:["onboarding","omp-browse",l],queryFn:r(()=>ya.browse(l),"queryFn"),enabled:e});return(0,a.jsx)(ws,{open:e,onOpenChange:t,children:(0,a.jsxs)(Ps,{className:"sm:max-w-lg",children:[(0,a.jsxs)(bo,{children:[(0,a.jsx)(Ds,{children:"Choose omp"}),(0,a.jsx)(vo,{className:"truncate font-mono text-xs",children:u.data?.path??"…"})]}),(0,a.jsxs)("ul",{className:"-mx-2 max-h-80 overflow-y-auto",children:[u.data?.parent?(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>c(u.data?.parent??null),"onClick"),children:[(0,a.jsx)(_i,{className:"size-4 text-ink-3","aria-hidden":!0}),".."]})}):null,u.data?.entries.map(p=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-2 text-start text-sm hover:bg-bg-3",onClick:r(()=>{p.kind==="directory"?c(p.path):(s(p.path),t(!1))},"onClick"),children:[p.kind==="directory"?(0,a.jsx)(_i,{className:"size-4 text-ink-3","aria-hidden":!0}):(0,a.jsx)(fR,{className:"size-4 text-accent","aria-hidden":!0}),(0,a.jsx)("span",{className:"truncate",children:p.name})]})},p.path)),u.isError?(0,a.jsx)("li",{className:"px-2 py-2 text-sm text-bad",children:Gg(u.error)}):null]})]})})}r($6,"OmpFilePicker");function U6({status:e,failure:t,command:s,onChooseCommand:l,onRemote:c,onRetry:u}){const[p,f]=(0,x.useState)(!1),h=r(v=>v.state==="ready"?{state:"ok",label:`Version ${v.version}`,value:`needs ${v.minVersion} or newer`}:{state:"bad",label:v.version?`Version ${v.version}`:"Version unknown",value:`needs ${v.minVersion}`},"versionRow");if(!e)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Install OMP",lede:"Looking for OMP on this computer."}),(0,a.jsx)(no,{label:"OMP checks",rows:[t&&!t.retry?{state:"bad",label:"Looking for omp",value:"stopped"}:{state:"run",label:"Looking for omp",value:"every 2 s"}]}),t?(0,a.jsx)(xf,{tone:"bad",children:t.message}):null]});const g=A6(e);if(g==="old"){const v=T6(e);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Update OMP",lede:e.version?`OMP ${e.version} is older than ${e.minVersion}, so some settings set here would be ignored.`:`The version of OMP could not be read. ${gf} needs OMP ${e.minVersion} or newer.`}),(0,a.jsx)(Qg,{command:e.updateCommand}),(0,a.jsx)(no,{label:"OMP checks",rows:[{state:"ok",label:"omp found",value:e.path},h(e)]}),v.length>0?(0,a.jsxs)(xf,{tone:"warn",children:["Two copies of omp are installed. The older one in ",e.path," runs first. Remove it, or update it with the command above."]}):null]})}return g==="offline"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"You are offline",lede:"Installing needs the internet once. Connect, or point to an omp you already copied here."}),(0,a.jsx)(no,{label:"OMP checks",rows:[{state:"bad",label:"omp.sh not reachable",value:"3 tries"},s?h(e):{state:"wait",label:"Version check"}]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("span",{id:"omp-path-label",className:"text-sm font-medium",children:"Path to omp"}),(0,a.jsxs)(oe,{type:"button",variant:"secondary","aria-labelledby":"omp-path-label",className:"justify-between font-normal",onClick:r(()=>f(!0),"onClick"),children:[(0,a.jsx)("span",{className:Y("truncate",s?"font-mono text-xs":"text-ink-3"),children:s??"Choose file"}),(0,a.jsx)(_i,{className:"size-4","aria-hidden":!0})]})]}),(0,a.jsx)($6,{open:p,onOpenChange:f,onPick:l}),(0,a.jsx)($c,{children:(0,a.jsxs)(oe,{type:"button",variant:"secondary",onClick:u,children:[(0,a.jsx)(nl,{className:"size-3.5","aria-hidden":!0}),"Try again"]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Install OMP",lede:"Run this in a terminal on this computer. This page moves on by itself."}),(0,a.jsx)(Qg,{command:e.installCommand}),(0,a.jsxs)("p",{className:"text-sm text-ink-2",children:[e.os.label," detected ·"," ",(0,a.jsx)("a",{className:"inline-flex min-h-6 items-center text-accent underline-offset-2 hover:underline",href:"https://omp.sh",target:"_blank",rel:"noreferrer",children:"Other ways"})]}),(0,a.jsx)(no,{label:"OMP checks",rows:[e.state==="ready"?{state:"ok",label:"omp found",value:e.path}:{state:"run",label:"Looking for omp",value:"every 2 s"},e.state==="ready"?h(e):{state:"wait",label:`Version ${e.minVersion} or newer`},e.models.length>0?{state:"ok",label:`${e.models.length} models`}:{state:"wait",label:"At least one model"}]}),e.runtime==="local"?(0,a.jsx)($c,{children:(0,a.jsx)(oe,{type:"button",variant:"ghost",onClick:c,children:"Run agents on another machine"})}):null]})}r(U6,"CheckOmpScreen");function B6({remote:e,pending:t,error:s,onCheck:l,onLocal:c}){const[u,p]=(0,x.useState)(e?.address??""),f=e?[e.connected?{state:"ok",label:"Connected",value:e.latencyMs!==null?`${e.latencyMs} ms`:null}:{state:"bad",label:"Not connected",value:e.error},...e.connected?[e.state==="missing"?{state:"bad",label:"omp not found there"}:e.state==="ready"?{state:"ok",label:`omp ${e.version} found`}:{state:"bad",label:`omp ${e.version??""} is too old`.replace(" "," "),value:"needs 18.1.16"},e.modelCount>0?{state:"ok",label:`${e.modelCount} models signed in there`}:{state:"bad",label:"No model signed in there",value:"next step"}]:[]]:[];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Run agents on another machine",lede:"OMP must be installed where agents run. We check it over SSH."}),(0,a.jsxs)("form",{className:"flex flex-col gap-1.5",onSubmit:r(h=>{h.preventDefault(),l(u.trim())},"onSubmit"),id:"onboarding-remote-form",children:[(0,a.jsx)("label",{htmlFor:"onboarding-ssh-address",className:"text-sm font-medium",children:"SSH address"}),(0,a.jsx)(Wn,{id:"onboarding-ssh-address",value:u,onChange:r(h=>p(h.target.value),"onChange"),placeholder:"user@host",autoComplete:"off",spellCheck:!1,"aria-describedby":"onboarding-ssh-help"}),(0,a.jsx)("span",{id:"onboarding-ssh-help",className:"text-xs text-ink-3",children:"Uses your SSH keys. The working folder is your home folder unless you change it later."})]}),f.length>0?(0,a.jsx)(no,{label:"Remote checks",rows:f}):null,s?(0,a.jsx)(xf,{tone:"bad",children:s}):null,(0,a.jsxs)($c,{children:[(0,a.jsx)(oe,{type:"button",variant:"ghost",onClick:c,children:"Use this computer"}),(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsx)(oe,{type:"submit",form:"onboarding-remote-form",disabled:t||u.trim().length===0,children:t?"Checking…":"Continue"})]})]})}r(B6,"RemoteScreen");function K6({remote:e,onSignedIn:t}){const[s,l]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{if(!e)return;const c=window.setInterval(t,EA);return()=>window.clearInterval(c)},[e,t]),e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Connect a model",lede:`OMP on ${e.host} has no model signed in yet.`}),(0,a.jsxs)("p",{className:"text-sm text-ink-2",children:["Sign in on ",e.host,". This page moves on by itself."]}),(0,a.jsx)(Qg,{command:`ssh -t ${e.username}@${e.host}${e.port!==22?` -p ${e.port}`:""} omp login`})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(or,{title:"Connect a model",lede:s?"Add your own gateway or local server to OMP.":"OMP has no model signed in yet. Sign in to a provider; OMP keeps the sign-in."}),s?(0,a.jsx)(j6,{onChanged:t}):(0,a.jsx)(p6,{autoFocus:!0,onSignedIn:t}),(0,a.jsxs)($c,{children:[(0,a.jsx)(oe,{type:"button",variant:"link",size:"sm",onClick:r(()=>l(c=>!c),"onClick"),children:s?"Sign in to a provider instead":"Use my own server instead"}),(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Moves on by itself once OMP has a model."})]})]})}r(K6,"ConnectScreen");function q6({status:e,remote:t,pending:s,error:l,onStart:c}){const[u,p]=(0,x.useState)(""),f=t?t.homeFolder:e?.projectFolder,h=t?null:M6(e);return(0,a.jsxs)("form",{className:"contents",onSubmit:r(g=>{g.preventDefault(),u.trim()&&c(u.trim())},"onSubmit"),children:[(0,a.jsx)(or,{title:"What should your first agent do?",lede:`${Wg} starts as soon as you press Start. You can rename it and change its setup later.`}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("label",{htmlFor:"onboarding-first-task",className:"text-sm font-medium",children:"First task"}),(0,a.jsx)(eS,{id:"onboarding-first-task",value:u,onChange:r(g=>p(g.target.value),"onChange"),rows:4,placeholder:f?`Read the README in ${f} and list the three riskiest modules.`:void 0,autoFocus:!0})]}),(0,a.jsxs)("section",{"aria-label":"First agent",className:"flex flex-col gap-1.5 rounded-lg border border-line-soft bg-bg-2 px-4 py-3 text-sm",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Agent"}),Wg,", general assistant"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Model"}),h?`${h} (recommended)`:"OMP default"]}),(0,a.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,a.jsx)("span",{className:"w-21 shrink-0 text-ink-3",children:"Folder"}),(0,a.jsx)("span",{className:"min-w-0 truncate font-mono text-xs leading-5",children:f??"~"})]})]}),l?(0,a.jsx)(xf,{tone:"bad",children:l}):null,(0,a.jsxs)($c,{children:[(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsxs)(oe,{type:"submit",disabled:s||u.trim().length===0,children:[(0,a.jsx)(I0,{className:"size-3.5","aria-hidden":!0}),s?"Starting…":"Start"]})]})]})}r(q6,"TaskScreen");function F6(){const{onboardingOpen:e,onboardingOptions:t,closeOnboarding:s,onboardingRouteDismissed:l,setOnboardingRouteDismissed:c}=Vc(),{companies:u,loading:p}=vt(),f=hn(),h=iU(f.pathname),g=h&&p?null:rU({pathname:f.pathname,companyPrefix:h,companies:u});if(!(e||g!==null&&!l))return null;const v=(e?t.companyId:g?.companyId)??null;return(0,a.jsx)(H6,{companyId:v,onClose:r(()=>{s(),c(!0)},"onClose")})}r(F6,"OnboardingFlow");function H6({companyId:e,onClose:t}){const s=kn(),l=ja(),{setSelectedCompanyId:c}=vt(),[u,p]=(0,x.useState)(0),[f,h]=(0,x.useState)("local"),[g,v]=(0,x.useState)(null),[y,j]=(0,x.useState)(null),[k,S]=(0,x.useState)(null),N=me({queryKey:[...kd,g],queryFn:r(()=>ya.status({command:g}),"queryFn"),retry:r((z,E)=>(Lh(E)?.retry??!0)&&z<2,"retry"),refetchInterval:r(z=>Lh(z.state.error)?.retry===!1||u===2&&z.state.data?!1:EA,"refetchInterval")}),I=N.data,C=Lh(N.error),M=me({queryKey:[...kd,"network",g],queryFn:r(()=>ya.status({command:g,network:!0}),"queryFn"),enabled:I?.state==="missing"&&f==="local",refetchInterval:3e4}),R=(0,x.useMemo)(()=>{if(I)return I.state!=="missing"?I:{...I,network:M.data?.network??null}},[I,M.data]);(0,x.useEffect)(()=>{if(f!=="local"||!I||u===2)return;const z=E6(I);z!==null&&z>u&&p(z)},[f,I,u]);const _=Bt({mutationFn:r(z=>ya.remote(z),"mutationFn"),onSuccess:r(z=>{j(z);const E=I6(z);E!==null&&p(E)},"onSuccess")}),D=(0,x.useCallback)(()=>{if(!y){s.invalidateQueries({queryKey:kd});return}ya.remote(y.address).then(z=>{j(z),z.modelCount>0&&p(2)}).catch(()=>{})},[y,s]),U=Bt({mutationFn:r(async z=>{const E=f==="remote"?y?.homeFolder??null:I?.projectFolder??null;let B=e;B||(B=(await $y.create({name:Qw(f==="remote"?y?.host:E)})).id,await s.invalidateQueries({queryKey:P.companies.all}));let O=null;f==="remote"&&y?.homeFolder&&(O=(await PT.create(B,{name:y.host,driver:"ssh",config:{host:y.host,port:y.port,username:y.username,remoteWorkspacePath:y.homeFolder}})).id);const Q={};f==="local"&&I?.recommendedModel&&(Q.model=I.recommendedModel),E&&(Q.cwd=E),g&&(Q.command=g);const V=await Fa.hire(B,{name:Wg,role:k6,appearance:AE(),adapterType:"omp_local",adapterConfig:Q,onboardingFirstAgent:!0,runtimeConfig:l6(),...O?{defaultEnvironmentId:O}:{}});V.approval&&await HN.approve(V.approval.id,"Approved during onboarding first-agent setup.");const ue=await mr.create(B,{name:Qw(E),status:"in_progress",...f==="local"&&E?{workspace:{sourceType:"local_path",cwd:E,isPrimary:!0}}:{}}),ce=await on.create(B,{title:R6(z),description:z,status:"todo",assigneeAgentId:V.agent.id,projectId:ue.id});return{companyId:B,issue:ce}},"mutationFn"),onMutate:r(()=>S(null),"onMutate"),onError:r(z=>S(Gg(z)),"onError"),onSuccess:r(async({companyId:z,issue:E})=>{await Promise.all([s.invalidateQueries({queryKey:P.companies.all}),s.invalidateQueries({queryKey:P.agents.list(z)}),s.invalidateQueries({queryKey:P.projects.list(z)}),s.invalidateQueries({queryKey:P.issues.list(z)})]);const B=(await $y.list()).find(Q=>Q.id===z)?.issuePrefix??null;c(z,{source:"route_sync"}),t();const O=E.identifier??E.id;l(B?`/${B}/issues/${O}`:`/issues/${O}`)},"onSuccess")}),K=u===1?(0,a.jsx)(IA,{title:"Skipped when OMP is ready",paragraphs:["If OMP already has a signed-in model on this machine, this step is skipped and the best model is picked for you."]}):u===2?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:f==="remote"?`Found on ${y?.host??"that machine"}`:"Found on this computer"}),(0,a.jsx)(no,{label:"Found",rows:f==="remote"?[{state:"ok",label:`OMP ${y?.version??""}`.trim()},{state:"ok",label:`${y?.modelCount??0} models signed in`},{state:"ok",label:"Working folder",value:y?.homeFolder}]:[{state:"ok",label:`OMP ${I?.version??""}`.trim()},{state:"ok",label:`${D6(I)??"Model"} signed in`,value:"imported"},{state:"ok",label:"Project folder",value:I?.projectFolder}]})]}):P6;return(0,a.jsx)(ws,{open:!0,onOpenChange:r(z=>{z||t()},"onOpenChange"),children:(0,a.jsxs)(J3,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-50 bg-bg"}),(0,a.jsxs)("div",{"data-testid":"onboarding-flow","data-step":u,role:"dialog","aria-modal":"true","aria-labelledby":"onboarding-title",className:"fixed inset-0 z-50 grid overflow-y-auto lg:grid-cols-2",onKeyDown:r(z=>{z.key==="Escape"&&t()},"onKeyDown"),children:[(0,a.jsxs)("main",{className:"flex min-h-dvh min-w-0 flex-col gap-4.5 px-4 py-5 sm:px-8 sm:py-8 lg:px-14 lg:py-10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(T0,{className:"size-6.5 shrink-0 text-ink","aria-hidden":"true"}),(0,a.jsx)("b",{className:"text-base font-semibold",children:gf})]}),(0,a.jsx)(z6,{step:u}),u===0&&f==="local"?(0,a.jsx)(U6,{status:R,failure:C,command:g,onChooseCommand:v,onRemote:r(()=>h("remote"),"onRemote"),onRetry:r(()=>{s.invalidateQueries({queryKey:kd})},"onRetry")}):null,u===0&&f==="remote"?(0,a.jsx)(B6,{remote:y,pending:_.isPending,error:_.isError?Gg(_.error):null,onCheck:r(z=>_.mutate(z),"onCheck"),onLocal:r(()=>{h("local"),j(null)},"onLocal")}):null,u===1?(0,a.jsx)(K6,{remote:f==="remote"?y:null,onSignedIn:D}):null,u===2?(0,a.jsx)(q6,{status:I,remote:f==="remote"?y:null,pending:U.isPending,error:k,onStart:r(z=>U.mutate(z),"onStart")}):null]}),(0,a.jsx)("aside",{className:"hidden min-w-0 flex-col gap-4 border-s border-line-soft bg-bg-3 px-12 py-10 lg:flex",children:K})]})]})})}r(H6,"OnboardingFlowDialog");function V6(){const{openNewIssue:e}=$s();return(0,x.useEffect)(()=>{e()},[e]),(0,a.jsx)(We,{to:"/issues",replace:!0})}r(V6,"NewTaskShortcut");var W6="npx @tickernelz/wardmote auth bootstrap-ceo";function zh({hasActiveInvite:e=!1}){return(0,a.jsxs)("div",{className:"mt-6 border-t border-line pt-5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,a.jsx)(W1,{className:"size-4 text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{children:"Prefer to finish setup from the host?"})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:e?"A bootstrap invite is already active. Check your Wardmote startup logs for the first-admin URL, or run this command on the host to rotate it:":"Run this command on the host that runs Wardmote to print a one-time first-admin invite URL:"}),(0,a.jsx)("pre",{className:"mt-3 overflow-x-auto rounded-md border border-line bg-bg-3/30 p-3 font-mono text-xs",children:W6})]})}r(zh,"CliFallback");function Sd({children:e}){return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsx)(Hc,{className:"block p-6",children:e})})}r(Sd,"StateChrome");function Q6(e){return e.user.email||e.user.name||e.user.id}r(Q6,"displayIdentity");function G6(e){return e?.status===409?{title:"Someone else has already claimed this instance.",body:"Refresh to sign in, or ask the existing admin to invite you from Settings -> Access."}:e?.status===401?{title:"Your session expired. Sign in again to claim this instance.",body:""}:{title:"We couldn't reach the server. Try again in a moment.",body:""}}r(G6,"claimErrorCopy");function Y6({claimAvailable:e,hasActiveInvite:t=!1,session:s,claimState:l,claimError:c,onClaim:u}){if(!e)return(0,a.jsxs)(Sd,{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"This Wardmote is waiting on its first admin"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This instance runs in invite-only mode. The operator must generate a one-time first-admin invite URL from the host. Once you have the link, open it from this browser to finish setup."}),(0,a.jsx)(zh,{hasActiveInvite:t}),(0,a.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Browser-based claim is intentionally disabled in public mode so anyone on the network can't promote themselves."})]});if(l==="success")return(0,a.jsxs)(Sd,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",children:(0,a.jsx)(Cc,{className:"size-5","aria-hidden":!0})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"You're the instance admin"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Setup is complete. Taking you to onboarding to create your first organization..."})]})]}),(0,a.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,a.jsx)(Ta,{className:"size-4 animate-spin text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{className:"text-sm text-ink-3",children:"Redirecting..."})]}),(0,a.jsx)("div",{className:"mt-5",children:(0,a.jsx)(oe,{asChild:!0,variant:"secondary",children:(0,a.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]});if(!s)return(0,a.jsxs)(Sd,{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Sign in or create your Wardmote account to become the first admin from this browser."}),(0,a.jsx)("div",{className:"mt-5",children:(0,a.jsx)(oe,{asChild:!0,children:(0,a.jsx)(mn,{to:"/auth?next=/",children:"Sign in / Create account"})})}),(0,a.jsx)(zh,{hasActiveInvite:t})]});const p=G6(c),f=l==="claiming";return(0,a.jsxs)(Sd,{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,a.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,a.jsxs)(oe,{onClick:u,disabled:f,children:[f&&(0,a.jsx)(Ta,{className:"mr-2 size-4 animate-spin","aria-hidden":!0}),f?"Claiming...":"Claim this instance"]}),(0,a.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,a.jsx)("span",{className:"font-medium text-ink",children:Q6(s)})]})]}),(0,a.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["Wrong account?"," ",(0,a.jsx)(mn,{to:"/auth?next=/",className:"underline underline-offset-2",children:"Switch account"}),"."]}),c&&(0,a.jsxs)("div",{role:"alert",className:"mt-4 flex items-start gap-2 rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:[(0,a.jsx)(ni,{className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":!0}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:p.title}),p.body&&(0,a.jsx)("p",{className:"mt-1 text-bad/90",children:p.body})]})]}),(0,a.jsx)(zh,{hasActiveInvite:t})]})}r(Y6,"BootstrapPendingPage");var Nd=5e3;function X6({temporary:e,retrying:t,onRetry:s}){return(0,a.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col gap-4 px-4 py-16",children:[(0,a.jsx)(nl,{className:"size-6 text-ink-3","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",role:"status",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:e?"Reconnecting to Wardmote":"Unable to load Wardmote"}),(0,a.jsx)("p",{className:"text-sm text-ink-3",children:e?"The server may be restarting or your connection was interrupted. We’ll try again every few seconds and reconnect automatically.":"We couldn’t check your access to this instance. Try again, or contact your instance administrator if this continues."})]}),(0,a.jsx)("div",{children:(0,a.jsx)(oe,{variant:"secondary",onClick:s,disabled:t,children:t?"Connecting…":"Try again"})})]})}r(X6,"CloudAccessError");function Z6(){return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)(Hc,{className:"block p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"No organization access"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This account is signed in, but it does not have an active organization membership or instance-admin access on this Wardmote instance."}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Use an organization invite or sign in with an account that already belongs to this org."})]})})}r(Z6,"NoBoardAccessPage");function Gw({allowMembershipRequest:e=!1}={}){const t=hn(),s=kn(),[l,c]=(0,x.useState)(!1),u=me({queryKey:P.health,queryFn:r(()=>Fc.get(),"queryFn"),retry:!1,refetchInterval:r(R=>{if(R.state.error)return Pr(R.state.error)?Nd:!1;const _=R.state.data;return _?.status==="starting"?Nd:_?.deploymentMode==="authenticated"&&_.bootstrapStatus==="bootstrap_pending"?2e3:!1},"refetchInterval"),refetchIntervalInBackground:!0}),p=u.data?.deploymentMode==="authenticated",f=p&&u.data?.bootstrapStatus==="bootstrap_pending",h=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),enabled:p,retry:!1,refetchInterval:r(R=>Pr(R.state.error)?Nd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),g=me({queryKey:P.access.currentBoardAccess,queryFn:r(()=>ei.getCurrentBoardAccess(),"queryFn"),enabled:p&&!f&&!!h.data,retry:!1,refetchInterval:r(R=>Pr(R.state.error)?Nd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),v=Bt({mutationFn:r(()=>ei.claimBootstrapAdmin(),"mutationFn"),onSuccess:r(async()=>{await s.invalidateQueries({queryKey:P.auth.session}),await s.invalidateQueries({queryKey:P.health}),await s.invalidateQueries({queryKey:P.companies.all}),await s.invalidateQueries({queryKey:P.companies.stats}),await s.invalidateQueries({queryKey:P.access.currentBoardAccess})},"onSuccess")}),y=[u,...p?[h]:[],...p&&!f&&h.data?[g]:[]],j=u.data?.status==="starting",k=j||y.some(R=>Pr(R.error)),S=y.find(R=>R.error&&!(R.data!==void 0&&Pr(R.error)))?.error,N=u.isLoading||p&&h.isLoading||p&&!f&&!!h.data&&g.isLoading,I=e||!p||!!g.data?.isInstanceAdmin||(g.data?.companyIds.length??0)>0,C=!N&&!S&&!f&&(!p||!!h.data)&&I;(0,x.useEffect)(()=>{C?u.data?.status==="ok"&&c(!0):c(!1)},[C,u.data?.status]);const M=(0,x.useRef)(!1);if((0,x.useEffect)(()=>{k?M.current=!0:M.current&&!N&&!S&&(M.current=!1,s.invalidateQueries({predicate:r(R=>Pr(R.state.error),"predicate")}))},[k,N,S,s]),S||j&&!l)return(0,a.jsx)(X6,{temporary:S?Pr(S):!0,retrying:y.some(R=>R.isFetching),onRetry:r(()=>{for(const R of y)(R.error||R===u&&j)&&R.refetch({cancelRefetch:!1})},"onRetry")});if(N)return(0,a.jsx)(Ms,{});if(f){const R=u.data;if(!R)return(0,a.jsx)(Ms,{});const _=v.error instanceof Ii?{status:v.error.status,message:v.error.message}:v.error instanceof Error?{message:v.error.message}:null;return(0,a.jsx)(Y6,{claimAvailable:R.deploymentExposure==="private",hasActiveInvite:R.bootstrapInviteActive,session:h.data,claimState:v.isSuccess?"success":v.isPending?"claiming":"idle",claimError:_,onClaim:r(()=>v.mutate(),"onClaim")})}if(p&&!h.data){const R=encodeURIComponent(`${t.pathname}${t.search}`);return(0,a.jsx)(We,{to:`/auth?next=${R}`,replace:!0})}return I?(0,a.jsxs)(a.Fragment,{children:[k&&(0,a.jsx)("div",{role:"status",className:"bg-bg-3 px-4 py-2 text-center text-sm text-ink-3",children:"Connection interrupted. Reconnecting automatically…"}),(0,a.jsx)(xo,{})]}):(0,a.jsx)(Z6,{})}r(Gw,"CloudAccessGate");var TA=["all","active","paused","error","builtin"];function J6({endpointId:e,children:t}){const s=me({queryKey:P.chatEndpoints.detail(e),queryFn:r(()=>X1.get(e),"queryFn")}),{enabled:l,githubEnabled:c}=w0();return s.isError?(0,a.jsxs)("div",{className:"space-y-3 p-6",children:[(0,a.jsx)("p",{role:"alert",className:"text-sm text-bad",children:s.error.message}),(0,a.jsx)(oe,{variant:"secondary",onClick:r(()=>{s.refetch()},"onClick"),children:"Retry"})]}):s.data?u1(s.data.provider,l,c)?(0,a.jsx)(a.Fragment,{children:t}):(0,a.jsx)(We,{to:"/apps",replace:!0}):null}r(J6,"ProviderEndpointGate");function Cd({children:e}){const{enabled:t,githubEnabled:s,loaded:l}=w0(),[c]=i1(),{endpointId:u}=zs();return!u&&c.get("provider")==="agentmail"?(0,a.jsx)(a.Fragment,{children:e}):l?u?(0,a.jsx)(J6,{endpointId:u,children:e}):u1(c.get("provider"),t,s)?(0,a.jsx)(a.Fragment,{children:e}):(0,a.jsx)(We,{to:"/apps",replace:!0}):null}r(Cd,"ChatConnectorsExperimentalGate");Ce(()=>ke(()=>import("./TaskChatLab-BtodeACE.js").then(e=>e.TaskChatLab),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119])));var eB=Ce(()=>ke(()=>import("./Cases-Bd2Ckeh9.js").then(e=>e.Cases),__vite__mapDeps([120,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,122,40,123,124,7,9,125,126,95,127,128,129,38,130,76]))),tB=Ce(()=>ke(()=>import("./CaseDetail-CYIIqjOz.js").then(e=>e.CaseDetail),__vite__mapDeps([131,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,90,113,114,80,81,4,41,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,94,14,98,76,89,88,100,36,37,133,74,134,79,82,83,84,85,86,66,87,91,92,93,65,40,135,61,136,137,138,139,12,101,125,140,141,142,143,144,75,62,70,18,35,71,72,73,77,13,145,118,146,126,99,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,67,162,163,164,165,166,167,168,169,128,170,116,117,171,95,127,172,173,174,175,176,177,129,178,179]))),nB=Ce(()=>ke(()=>import("./Dashboard-b22e7HsQ.js").then(e=>e.Dashboard),__vite__mapDeps([180,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,139,65,41,181,182,7,9,97,183,55,184,146,185,186,37,187,188,127,163,161,67,98,175,189,190]))),aB=Ce(()=>ke(()=>import("./Companies-CQ_mUV6-.js").then(e=>e.Companies),__vite__mapDeps([191,1,3,20,22,21,113,25,8,26,114,80,27,81,4,41,5,142,29,115,7,9,13,171,102,76,125,95,127,175]))),sB=Ce(()=>ke(()=>import("./Agents-hJqeQN6A.js").then(e=>e.Agents),__vite__mapDeps([192,1,3,17,16,20,193,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,134,80,81,9,65,7,71,10,194,13,98,195,88,44,89,90,37,55,109,141,184,146,196,99,74,76,197,198,127,199,39,200,40,174,163,161,67,172,82,83,173,201,202,203,175,204,205,206]))),Ph=Ce(()=>ke(()=>import("./AgentDetail-D7joo2rc.js").then(e=>e.AgentDetail),__vite__mapDeps([207,1,3,16,17,20,208,193,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,245,246,247,248,69,42,46,48,50,52,54,56,58,59,61,70,18,35,62,71,72,73,75,77,78,94,96,109,147,111,133,183,126,249,250,251,164,252,253,254,154,255,256,106,257,258,259,260,204,261,262,263,264,11,265,266,267,175,268]))),iB=Ce(()=>ke(()=>import("./Projects-Ck08UWc-.js").then(e=>e.Projects),__vite__mapDeps([269,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,13,126,127,175,262,263,206]))),Br=Ce(()=>ke(()=>import("./ProjectDetail-BCjyXt2s.js").then(e=>e.ProjectDetail),__vite__mapDeps([270,1,3,16,17,20,22,209,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,134,142,46,271,272,175,109,184,146,126,147,185,187,188,273,274,42,48,50,52,54,56,58,59,176,177,168,262,263,275,250,276,251,277,278,101,140,261]))),rB=Ce(()=>ke(()=>import("./ProjectWorkspaceDetail-BcyMO75Z.js").then(e=>e.ProjectWorkspaceDetail),__vite__mapDeps([279,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,101,125,140,141,134,80,81,213,99,74,76,214,4,126,185,186,37,187,188,127,175,168,84,280]))),lB=Ce(()=>ke(()=>import("./Workspaces-z0KIx4hI.js").then(e=>e.Workspaces),__vite__mapDeps([281,1,3,20,208,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,141,127,275,65,42,43,44,45,46,4,47,48,49,6,34,50,51,52,53,54,55,56,38,57,58,59,156,125,37,99,74,76,163,161,67,98,172,82,83,80,40,173,250,209,210,211,212,205,121,108,79,81,84,85,86,66,87,88,89,90,91,92,93,213,214,143,144,41,215,216,153,217,218,113,114,115,219,155,13,14,220,162,221,118,174,222,223,224,95,225,100,181,226,227,194,12,97,105,171,195,228,186,229,230,231,232,233,199,39,200,234,235,236,237,238,201,202,239,203,240,241,242,243,36,244,119,276,109,251,278,101,126,140,261]))),oB=Ce(()=>ke(()=>import("./Issues-B4mFVMjr.js").then(e=>e.Issues),__vite__mapDeps([282,1,3,16,17,20,208,283,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,46,122,4,41,48,49,226,7,11,13,14,98,87,76,186,89,90,37,55,109,141,184,146,126,99,74,147,284,148,127,149,88,44,175,59,285,42,43,45,47,6,34,50,51,52,53,54,56,38,57,58,162,97,168,84,205,113,114,79,82,83,85,86,66,91,92,93,144,40,115,12,286,101,125,100,199,39,200,174,237,238,118,233,201,65,119,287,255,288,104,289,69,61,70,18,35,36,62,71,72,73,75,77,78,94,95,96]))),cB=Ce(()=>ke(()=>import("./Search-BgSHY-QB.js").then(e=>e.Search),__vite__mapDeps([290,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,113,114,80,81,41,134,9,122,40,291,61,7,13,14,98,257,87,76,186,125,88,44,89,90,55,126,95,229,127,149,35,174,59,133,74]))),uB=Ce(()=>ke(()=>import("./IssueDetail-BTGIxWc1.js").then(e=>e.t).then(e=>e.IssueDetail),__vite__mapDeps([292,1,3,25,8,16,17,20,208,193,22,209,210,211,141,21,19,23,24,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,18,35,137,245,293,106,165,166,167,132,42,46,48,50,52,54,56,58,59,94,133,253,254,294,295,296,297,134,122,75,246,247,248,69,61,70,62,71,72,73,77,78,96,109,147,111,298,135,63,64,68,101,102,103,291,299,300,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,168,169,128,104,301,302,117,303,110,304,305,10,11,306,15,60,107,112,116,307,184,196,284,185,187,188,249,273,289,308,309,310,311,312,175,251,287,252,313,314,315,285,177,274,176,255,316,317,256,257,318]))),dB=Ce(()=>ke(()=>import("./AgentChats-IEiJJtdg.js").then(e=>e.AgentChats),__vite__mapDeps([319,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,88,44,89,90,127,320]))),fB=Ce(()=>ke(()=>import("./AgentChat-BHjA0PWW.js").then(e=>e.AgentChat),__vite__mapDeps([321,1,3,16,17,20,22,292,25,8,208,193,209,210,211,141,21,19,23,24,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,18,35,137,245,293,106,165,166,167,132,42,46,48,50,52,54,56,58,59,94,133,253,254,294,295,296,297,134,122,75,246,247,248,69,61,70,62,71,72,73,77,78,96,109,147,111,298,135,63,64,68,101,102,103,291,299,300,136,138,139,140,142,145,146,126,148,149,150,151,152,154,157,158,159,160,164,168,169,128,104,301,302,117,303,110,304,305,10,11,306,15,60,107,112,116,307,184,196,284,185,187,188,249,273,289,308,309,310,311,312,175,251,287,252,313,314,315,285,177,274,176,255,316,317,256,257,318,322,320]))),pB=Ce(()=>ke(()=>import("./IssueChatLongThreadPerf-Bw21NogO.js").then(e=>e.IssueChatLongThreadPerf),__vite__mapDeps([323,1,3,125,8,9,175,311,16,17,20,209,22,210,211,141,21,19,23,24,25,26,27,28,29,5,30,31,32,33,212,205,74,7,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,245,312,11,35,152,150,42,46,48,50,52,54,56,58,59,301,61,78,75,94,96,302,117,102,148,303,110,304,305,101,116,109,154,107,251,287,159,160,164,252,253,254,313,166]))),mB=Ce(()=>ke(()=>import("./Routines-BB5zkfap.js").then(e=>e.Routines),__vite__mapDeps([324,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,79,43,44,45,80,74,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,122,4,40,41,7,9,13,145,37,55,109,184,146,126,99,147,325,127,151,150,152,153,172,173,175,326,205,113,114,115,171,95,133,327,108,215,216,217,6,299,51,300,125,141,100,202,38,169]))),hB=Ce(()=>ke(()=>import("./Pipelines-CBrVkNVf.js").then(e=>e.Learnings),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),gB=Ce(()=>ke(()=>import("./Pipelines-CBrVkNVf.js").then(e=>e.PipelineItemDetail),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),xB=Ce(()=>ke(()=>import("./Pipelines-CBrVkNVf.js").then(e=>e.PipelineItemLegacyRedirect),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),$h=Ce(()=>ke(()=>import("./Pipelines-CBrVkNVf.js").then(e=>e.Pipelines),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),bB=Ce(()=>ke(()=>import("./Pipelines-CBrVkNVf.js").then(e=>e.ReviewQueue),__vite__mapDeps([328,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,132,90,113,114,80,81,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,56,38,57,58,59,115,94,14,76,89,88,100,36,37,133,74,121,79,82,83,84,85,86,66,87,91,92,93,122,144,40,173,61,330,67,301,209,210,211,141,212,205,108,213,99,214,143,65,215,216,153,217,161,218,219,155,13,220,162,221,118,125,174,222,223,224,95,225,181,226,227,194,12,156,97,105,171,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,236,237,238,201,202,239,203,240,241,242,243,244,119,78,75,35,96,302,117,102,303,110,304,305,307,109,175,311,245,312,11,152,150,101,116,154,107,251,287,159,160,164,252,253,254,313,166,158,314,177,77,179,331]))),vB=Ce(()=>ke(()=>import("./PipelineSettings-CoFzH1-c.js").then(e=>e.PipelineSettings),__vite__mapDeps([332,1,3,16,17,20,22,329,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,98,55,126,147,148,212,113,114,80,81,4,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,90,91,92,93,139,46,144,160,40,218,215,7,9,216,99,153,217,161,115,219,155,53,13,14,220,162,221,118,125,37,174,222,11,12,171,141,95,127,225,100,151,150,233,152,331,333,108,47,172,173]))),Yw=Ce(()=>ke(()=>import("./StatusCards-BQYp9_rr.js").then(e=>e.StatusCards),__vite__mapDeps([334,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,113,114,80,81,41,134,9,40,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,54,55,56,38,57,58,59,115,181,13,156,98,335,118,85,83,125,88,89,90,99,74,76,95,127,100,152,150,153,163,161,67,172,82,173,133,276,109,251]))),yB=Ce(()=>ke(()=>import("./PixelsOffice-D1vo-0wW.js").then(e=>e.PixelsOffice),__vite__mapDeps([336,1,3,20,43,44,45,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,247,80,82,83,337,34,226,7,9,11,12,306,76,186,125,37,55,109,147,91,92,127,175,133,74,338,301,209,210,211,141,212,205,121,4,108,79,81,84,85,86,66,87,88,89,90,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,174,222,223,224,95,225,100,38,181,51,227,194,156,97,105,171,98,195,228,229,230,231,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,48,42,46,50,52,54,56,58,59,61,78,75,94,35,96,302,117,102,148,303,110,304,305,331,277]))),Xw=Ce(()=>ke(()=>import("./RoutineDetail-CM_C8njY.js").then(e=>e.RoutineDetail),__vite__mapDeps([339,1,3,16,17,20,132,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,90,113,114,80,81,4,41,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,94,14,98,76,89,88,100,36,37,133,74,108,79,82,83,84,85,86,66,87,91,92,93,139,143,248,161,218,40,215,216,99,153,217,219,155,13,220,162,221,118,125,174,222,340,12,306,145,171,341,228,186,109,126,95,147,229,127,225,151,150,233,152,235,172,173,239,175,261,264,205,11,178,342,163,67,327,299,300,141,202,169,333,212,343]))),jB=Ce(()=>ke(()=>import("./UserProfile-6tR8KBkI.js").then(e=>e.UserProfile),__vite__mapDeps([344,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,90,161,7,9,221,197,198,127]))),Ql=Ce(()=>ke(()=>import("./ExecutionWorkspaceDetail-2AFXb_-1.js").then(e=>e.ExecutionWorkspaceDetail),__vite__mapDeps([345,1,3,16,17,20,138,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,139,34,7,9,12,14,101,125,140,141,134,80,81,4,40,6,145,98,37,55,109,184,146,126,95,185,186,187,188,91,92,127,100,38,175,168,84,261,275,65,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,58,59,156,99,74,76,163,161,67,172,82,83,173,250,209,210,211,212,205,121,108,79,85,86,66,87,88,89,90,93,213,214,143,144,41,215,216,153,217,218,113,114,115,219,155,13,220,162,221,118,174,222,223,224,225,181,226,227,194,97,105,171,195,228,229,230,231,232,233,199,39,200,234,235,236,237,238,201,202,239,203,240,241,242,243,36,244,119,276,251,280,327,299,300,151,150,152,169]))),wB=Ce(()=>ke(()=>import("./Goals-BWNWwYmd.js").then(e=>e.Goals),__vite__mapDeps([346,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,127,347,41]))),Zw=Ce(()=>ke(()=>import("./Artifacts-BvvQffcj.js").then(e=>e.Artifacts),__vite__mapDeps([348,1,3,16,17,20,208,18,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,4,6,34,12,35,36,37,38,113,114,80,81,41,214,7,9,76,125,95,127,317]))),kB=Ce(()=>ke(()=>import("./GoalDetail-C8NwbVu0.js").then(e=>e.GoalDetail),__vite__mapDeps([349,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,7,13,55,126,127,232,274,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,90,91,92,93,42,46,4,47,48,49,6,34,50,51,52,53,54,56,38,57,58,59,176,177,40,173,168,206,347,41]))),Jw=Ce(()=>ke(()=>import("./Approvals-Zxq0yDz0.js").then(e=>e.Approvals),__vite__mapDeps([350,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,97,125,55,127,315,48,49,7,149,88,44,89,90,175,285,42,43,45,46,4,47,6,34,50,51,52,53,54,56,38,57,58,59,162]))),SB=Ce(()=>ke(()=>import("./ApprovalDetail-eGGSB0_Q.js").then(e=>e.ApprovalDetail),__vite__mapDeps([351,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,42,43,44,45,46,4,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,89,90,127,149,88,100,285,162,97]))),NB=Ce(()=>ke(()=>import("./CompanyActivity-CBwdj3In.js").then(e=>e.CompanyActivity),__vite__mapDeps([352,1,3,353,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,108,134,80,81,9,139,354,144,65,40,41,337,7,10,54,13,14,286,162,272,98,95,175,186,125,44,89,90,88,37,55,109,99,74,76,147,229,325,91,92,127,149,172,82,83,4,173,119,318,165,166,167,355,356,277,343,357]))),Ad=Ce(()=>ke(()=>import("./AuditHub-DCksM6Df.js").then(e=>e.AuditHub),__vite__mapDeps([353,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,108,134,80,81,9,139,354,144,65,40,41,337,7,10,54,13,14,286,162,272,98,95,175,186,125,44,89,90,88,37,55,109,99,74,76,147,229,325,91,92,127,149,172,82,83,4,173,119,318,165,166,167,355,356,277,343,357]))),CB=Ce(()=>ke(()=>import("./WhatNeedsMe-CokwG-qz.js").then(e=>e.WhatNeedsMe),__vite__mapDeps([358,1,3,16,17,20,22,359,208,193,43,44,45,253,254,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,113,114,80,81,41,143,122,86,40,173,48,49,42,46,47,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,170,301,209,210,211,141,205,74,108,79,82,83,84,85,66,87,76,88,89,90,91,92,93,213,99,214,144,65,215,216,153,217,161,218,219,155,13,14,220,162,221,118,125,37,174,222,223,224,95,225,100,181,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,127,232,233,199,39,200,163,67,234,235,172,236,237,238,201,202,239,203,240,241,242,243,36,244,119,61,78,75,94,35,96,302,117,102,148,303,110,304,305,296,360,147,165,166,167,338,109,184,146]))),AB=Ce(()=>ke(()=>import("./DecisionQueuePage-BxiBix3d.js").then(e=>e.DecisionQueuePage),__vite__mapDeps([361,1,3,16,17,20,22,359,208,193,43,44,45,253,254,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,113,114,80,81,41,143,122,86,40,173,48,49,42,46,47,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,115,170,301,209,210,211,141,205,74,108,79,82,83,84,85,66,87,76,88,89,90,91,92,93,213,99,214,144,65,215,216,153,217,161,218,219,155,13,14,220,162,221,118,125,37,174,222,223,224,95,225,100,181,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,127,232,233,199,39,200,163,67,234,235,172,236,237,238,201,202,239,203,240,241,242,243,36,244,119,61,78,75,94,35,96,302,117,102,148,303,110,304,305,296,360,147,165,166,167,338]))),_B=Ce(()=>ke(()=>import("./BoardChat-Bp_P56xH.js").then(e=>e.BoardChat),__vite__mapDeps([362,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,113,114,80,81,4,41,139,39,40,161,363,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,61,170,263,94,364,307,98,87,183,118,85,83,88,89,90,184,146,92,127,35,175,112,115,116,117,76,99,74,100,36,37,133]))),EB=Ce(()=>ke(()=>import("./CompanySettings-D4-cqzil.js").then(e=>e.CompanySettings),__vite__mapDeps([365,1,3,16,17,20,22,21,212,25,8,26,205,74,27,7,9,40,215,23,24,4,76,216,31,99,153,217,10,13,125,37,141,95,198,127,232,233,172,82,83,80,173,238,41,47,118,85,201,65,30,304,366,209,210,211,19,28,29,5,32,33,121,108,79,43,44,45,81,84,86,66,87,88,89,90,91,92,93,213,214,143,144,161,49,6,218,113,114,115,219,155,53,14,220,162,221,174,222,34,223,224,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,199,39,200,163,67,234,235,236,237,202,239,57,203,240,241,242,243,36,244,119,355]))),IB=Ce(()=>ke(()=>import("./CompanyConnections-D7x76vZy.js").then(e=>e.CompanyConnections),__vite__mapDeps([367,1,3,20,209,16,17,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,366,355,356]))),Uh=Ce(()=>ke(()=>import("./CompanyEnvironments-fJh3Mt-u.js").then(e=>e.CompanyEnvironments),__vite__mapDeps([368,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,205,74,7,9,214,4,218,113,114,80,81,41,40,215,76,216,99,153,217,161,115,219,155,53,13,14,220,162,221,118,85,83,125,37,174,222,227,12,156,171,55,141,127,225,236,121,108,95,100,172,82,173,238,47,233,201,65,202,203,297]))),TB=Ce(()=>ke(()=>import("./BootstrapSetupUxLab-CcxoPa2W.js").then(e=>e.BootstrapSetupUxLab),__vite__mapDeps([369,1,3,7,8,9,97,33,98,175]))),RB=Ce(()=>ke(()=>import("./ResponsibleUserDenialUxLab-DGWo-GoD.js").then(e=>e.ResponsibleUserDenialUxLab),__vite__mapDeps([370,1,3,175,256,245,106,257]))),MB=Ce(()=>ke(()=>import("./CrossIssueCollaborationUxLab-D2bB9GTl.js").then(e=>e.CrossIssueCollaborationUxLab),__vite__mapDeps([371,1,3,293,245,143,49,219,97,106,165,166,167,90,25,8,26,89,175,313,118,85,83,125,9]))),DB=Ce(()=>ke(()=>import("./CompanySettingsPluginPage-DQeyVIjI.js").then(e=>e.CompanySettingsPluginPage),__vite__mapDeps([372,1,3,16,17,21,20,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,185,186,37,187,188,127]))),OB=Ce(()=>ke(()=>import("./CompanyAccess-CZAfSbtD.js").then(e=>e.CompanyAccess),__vite__mapDeps([373,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,90,134,80,81,9,4,6,7,97,171,125,37,55,99,74,76,147,185,186,187,188,197,198,127,38]))),LB=Ce(()=>ke(()=>import("./CompanyAccess-CZAfSbtD.js").then(e=>e.CompanyAccessLegacyRoute),__vite__mapDeps([373,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,90,134,80,81,9,4,6,7,97,171,125,37,55,99,74,76,147,185,186,187,188,197,198,127,38]))),ek=Ce(()=>ke(()=>import("./AdvancedToolsRoute-tleFHTcB.js").then(e=>e.AdvancedToolsRoute),__vite__mapDeps([374,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,142,64,363,271,10,375,102,126,147,175,133,267,190,376,377,193]))),tk=Ce(()=>ke(()=>import("./ProfileWizardRoute-Bk8tx6UC.js").then(e=>e.ProfileWizardRoute),__vite__mapDeps([378,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,121,4,108,40,41,7,9,302,13,76,125,37,95,230,127,100,234,88,44,89,90,229,172,82,83,80,173,174,267,98,175,377,193,55,126,91,92,379,162,147]))),zB=Ce(()=>ke(()=>import("./ProfileDetailRoute-nVOQkxal.js").then(e=>e.ProfileDetailRoute),__vite__mapDeps([380,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,108,142,6,7,9,97,171,167,125,37,99,74,76,95,230,127,100,267,98,175,376,377,193,55,126,91,92,379,162,147]))),PB=Ce(()=>ke(()=>import("./Browse-DQJ6Gj80.js").then(e=>e.Browse),__vite__mapDeps([381,1,3,20,193,22,382,16,17,210,211,141,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,205,74,7,9,121,4,41,156,98,221,89,90,109,99,76,95,229,230,56,163,161,67,235,357,383,113,114,80,81,108,295,115,34,227,224,171,118,85,83,88,44,37,55,147,249,231,127,244,110,384,385,134,6,302,183,38,239,100,57]))),RA=Ce(()=>ke(()=>import("./AppsConnect-D7l2xnv-.js").then(e=>e.AppsConnect),__vite__mapDeps([386,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,383,387]))),$B=Ce(()=>ke(()=>import("./ChatEndpointSetup-BZGnK0W7.js").then(e=>e.ChatEndpointSetup),__vite__mapDeps([388,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,108,47,6,34,219,155,7,9,98,228,186,118,85,83,88,44,89,90,37,55,141,126,99,74,76,95,198,249,127,100,234,41,229,38,243,36,389,214,143,230,175,110,305,261,265,162,238,40,233,201,65,390]))),nk=Ce(()=>ke(()=>import("./ChatEndpointDetail-DdbIST5k.js").then(e=>e.ChatEndpointDetail),__vite__mapDeps([391,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,205,74,7,9,121,4,113,114,80,81,41,108,79,43,44,45,82,83,84,85,86,66,87,76,88,89,90,91,92,93,139,354,144,40,47,42,46,48,49,6,34,50,51,52,53,54,55,56,38,57,58,59,115,11,12,13,156,171,98,118,125,37,99,95,147,249,230,231,127,100,233,242,241,110,261,392,234,229,235,389,214,143,126,175,305,265,162,238,201,65,390]))),UB=Ce(()=>ke(()=>import("./ChatIdentityConfirm-Dc4AnYX8.js").then(e=>e.ChatIdentityConfirm),__vite__mapDeps([393,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,198,249]))),BB=Ce(()=>ke(()=>import("./AppsReview-BlGCgr9w.js").then(e=>e.AppsReview),__vite__mapDeps([394,1,3,21,20,22,127,395,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,4,42,43,44,45,46,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,301,209,210,211,141,212,205,74,121,108,79,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,218,113,114,115,219,155,13,14,220,162,221,118,125,37,174,222,223,224,95,225,100,181,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,203,240,241,242,243,36,244,119,61,78,75,94,35,96,302,117,102,148,303,110,304,305]))),KB=Ce(()=>ke(()=>import("./AppDetail-B8ZBWzk8.js").then(e=>e.AppDetail),__vite__mapDeps([396,1,3,16,17,20,22,209,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,382,109,56,357,383,147,308,384,387,392,389,126,175,110,305,261,265,395,42,46,48,50,52,54,58,59,301,61,78,75,94,35,96,302,117,102,148,303,304]))),ak=Ce(()=>ke(()=>import("./AppNotConnected-NVgEwEYJ.js").then(e=>e.AppNotConnected),__vite__mapDeps([397,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,396,382,109,56,357,383,147,308,384,387,392,389,126,175,110,305,261,265,395,42,46,48,50,52,54,58,59,301,61,78,75,94,35,96,302,117,102,148,303,304]))),sk=Ce(()=>ke(()=>import("./GatewaysList-BgwbsqYZ.js").then(e=>e.GatewaysList),__vite__mapDeps([398,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,37,55,126,95,229,230,127,233,267,98,125,175,399,139,6,53,99,74,76,38]))),qB=Ce(()=>ke(()=>import("./GatewayDetail-BRId71b2.js").then(e=>e.GatewayDetail),__vite__mapDeps([400,1,3,16,17,20,208,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,65,248,4,40,75,41,173,215,7,9,76,216,74,99,153,217,47,310,6,53,271,13,364,118,85,83,37,55,126,95,229,230,127,233,38,267,98,125,175,399,139]))),FB=Ce(()=>ke(()=>import("./CompanySkills-Doub2oUz.js").then(e=>e.CompanySkills),__vite__mapDeps([401,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,113,114,80,81,41,134,9,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,90,91,92,93,214,40,75,161,47,42,46,48,49,6,34,50,51,52,53,7,54,55,56,38,57,58,59,310,115,155,61,181,300,227,68,11,13,156,220,307,162,97,171,98,102,183,118,125,37,126,99,95,127,149,100,163,67,234,229,242,241,36,260,261,178,402,326,205,133,403]))),ik=Ce(()=>ke(()=>import("./SkillSources-BG_dPDP8.js").then(e=>e.SkillSources),__vite__mapDeps([404,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,113,114,80,81,4,41,161,135,34,61,7,9,13,156,98,99,74,76,95,56,127,216,244,77,403,405,67,125,387]))),Bh=Ce(()=>ke(()=>import("./SkillStudio-D4GvrYEe.js").then(e=>e.SkillStudio),__vite__mapDeps([406,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,90,113,114,80,81,4,41,108,134,9,79,43,44,45,74,82,83,84,85,86,66,87,76,88,89,91,92,93,214,40,215,7,216,99,153,217,407,65,155,223,121,6,53,224,162,118,125,37,95,225,100,38,335,49,42,46,47,48,34,50,51,52,54,55,56,57,58,59,115,61,181,330,67,71,301,209,210,211,141,205,213,143,144,161,218,219,13,14,220,221,174,222,226,227,194,12,156,97,105,171,98,195,228,186,229,230,231,127,232,233,199,39,200,163,234,235,172,173,236,237,238,201,202,239,203,240,241,242,243,36,244,119,78,75,94,35,96,302,117,102,148,303,110,304,305,149,150,175,73,77,177,133,260,206,178,130,402,403,401,310,300,68,11,307,183,126,261,326,408,409]))),HB=Ce(()=>ke(()=>import("./Secrets-zu14ajI8.js").then(e=>e.Secrets),__vite__mapDeps([410,1,3,16,17,20,21,22,121,25,8,4,113,26,114,80,27,81,41,5,134,9,23,24,142,46,143,75,161,48,298,6,115,34,223,108,53,7,224,162,118,85,83,125,88,44,89,90,37,99,74,76,95,225,100,38,51,124,226,67,227,340,13,156,31,97,171,98,221,102,55,147,197,198,229,127,234,172,82,40,173,222,36,133]))),VB=Ce(()=>ke(()=>import("./CompanyImport-D3UlNq4i.js").then(e=>e.CompanyImport),__vite__mapDeps([411,1,3,20,22,209,16,17,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,42,46,48,50,52,54,56,58,59,412,413,414]))),WB=Ce(()=>ke(()=>import("./DesignGuide-5uuu_1IQ.js").then(e=>e.DesignGuide),__vite__mapDeps([415,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119,247,134,64,312,11,35,152,150,42,46,48,50,52,54,56,58,59,63,61,68,69,70,18,62,71,72,73,75,77,78,94,96,101,102,103,182,104,416,301,302,117,148,303,110,304,305,417,360,183,307,149,175,107,109,157,309,310,145,284,311,245,116,154,251,287,159,160,164,252,253,254,313,166,274,176,177,168,133,262,263,266,267,206,130,402,189,405,342,408,288,289,409]))),QB=Ce(()=>ke(()=>import("./InstanceFeatures-C1eqcxDI.js").then(e=>e.InstanceFeatures),__vite__mapDeps([418,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,125,9,95,188,127,419,141,197,198,233]))),GB=Ce(()=>ke(()=>import("./AgentDefaults-C0WFwQky.js").then(e=>e.AgentDefaults),__vite__mapDeps([420,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,143,55,127,258,259,7,9,14,76,125,172,82,83,80,4,40,173,119]))),YB=Ce(()=>ke(()=>import("./OmpAllSettings-DTJLATQL.js").then(e=>e.n).then(e=>e.OmpAllSettingsPage),__vite__mapDeps([268,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,214,7,9,14,125,55,95,127,100,233,172,82,83,80,4,40,173,174,258,259,76,119]))),XB=Ce(()=>ke(()=>import("./ModelsAndProviders-Bzd4NZcX.js").then(e=>e.ModelsAndProviders),__vite__mapDeps([421,1,3,20,21,22,7,8,9,13,156,55,127,258]))),ZB=Ce(()=>ke(()=>import("./InstanceAdvanced-DHBs71Ii.js").then(e=>e.InstanceAdvanced),__vite__mapDeps([422,1,3,7,8,9,12,14,98,125,127,419,20,141,197,198,233]))),JB=Ce(()=>ke(()=>import("./InstanceAccess-D4ZbGCeK.js").then(e=>e.InstanceAccess),__vite__mapDeps([423,1,3,20,22,121,25,8,4,7,9,97,32,37,147,127,175]))),eK=Ce(()=>ke(()=>import("./ProfileSettings-D_ZrTEBL.js").then(e=>e.ProfileSettings),__vite__mapDeps([424,1,3,20,22,21,90,25,8,26,108,226,7,9,12,220,364,171,195,55,95,127,232,233,234,121,4,23,24,27,41,88,44,89,229,235,172,82,83,80,40,173,175]))),tK=Ce(()=>ke(()=>import("./PluginManager-DkADWuR8.js").then(e=>e.PluginManager),__vite__mapDeps([425,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,108,181,7,9,13,375,307,171,98,125,37,99,74,76,95,187,127,175]))),nK=Ce(()=>ke(()=>import("./PluginSettings-Hcx5yZJk.js").then(e=>e.PluginSettings),__vite__mapDeps([426,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,213,99,74,7,76,214,86,48,49,51,220,162,98,341,125,187,185,186,37,188,127,236,121,4,108,40,41,161,219,155,53,13,171,95,225,100,172,82,83,173,175,168,84,140,141]))),rk=Ce(()=>ke(()=>import("./AdapterManager-Dn6r8M3v.js").then(e=>e.AdapterManager),__vite__mapDeps([427,1,3,20,21,22,108,25,8,213,33,99,74,26,27,7,9,76,30,51,13,375,156,171,98,125,37,95,127,237,23,24,40,199,39,200,4,31,174,238,41,47,118,85,83,233,201,65,240,241,175]))),lk=Ce(()=>ke(()=>import("./PluginPage-BtaYd9AD.js").then(e=>e.PluginPage),__vite__mapDeps([428,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,214,7,9,187,185,186,37,188,127]))),aK=Ce(()=>ke(()=>import("./NewAgent-wSr42KiN.js").then(e=>e.NewAgent),__vite__mapDeps([429,1,3,16,17,20,209,22,210,211,141,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,212,205,74,7,9,121,4,108,79,43,44,45,80,81,82,83,84,85,86,66,87,76,88,89,90,91,92,93,213,99,214,143,144,65,40,41,215,216,153,217,161,47,49,6,218,113,114,115,219,155,53,13,14,220,162,221,118,125,37,174,222,34,223,224,95,225,100,38,181,51,226,227,194,12,156,97,105,171,98,195,228,186,55,229,230,231,127,232,233,199,39,200,163,67,234,235,172,173,236,237,238,201,202,239,57,203,240,241,242,243,36,244,119]))),sK=Ce(()=>ke(()=>import("./Auth-D0lGuVnd.js").then(e=>e.AuthPage),__vite__mapDeps([430,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,417,360,183,58,198,431]))),iK=Ce(()=>ke(()=>import("./BoardClaim-CbYY66Qd.js").then(e=>e.BoardClaimPage),__vite__mapDeps([432,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,175]))),rK=Ce(()=>ke(()=>import("./AssistantConnection-XWq_Gvxh.js").then(e=>e.AssistantConnection),__vite__mapDeps([385,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,4,6,34,7,302,183,89,90,127,38,239,76,100,57,384]))),ok=Ce(()=>ke(()=>import("./McpConnect-Dqx0rBQk.js").then(e=>e.McpConnectPage),__vite__mapDeps([433,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,183,89,90,95,175,384]))),lK=Ce(()=>ke(()=>import("./McpConnect-Dqx0rBQk.js").then(e=>e.McpDevicePage),__vite__mapDeps([433,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,183,89,90,95,175,384]))),oK=Ce(()=>ke(()=>import("./McpConnect-Dqx0rBQk.js").then(e=>e.AssistantConnectionsPage),__vite__mapDeps([433,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,121,4,7,9,183,89,90,95,175,384]))),cK=Ce(()=>ke(()=>import("./CliAuth-CatEsBxW.js").then(e=>e.CliAuthPage),__vite__mapDeps([434,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,175]))),uK=Ce(()=>ke(()=>import("./InviteLanding-DTNcs2-Z.js").then(e=>e.InviteLandingPage),__vite__mapDeps([435,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,147,198,201,65,431]))),ck=Ce(()=>ke(()=>import("./PublicIssueSharePage-D28zKQ4N.js").then(e=>e.PublicIssueSharePage),__vite__mapDeps([436,1,3,16,17,20,214,42,43,44,45,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,46,4,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,60,61,62,89,90,229,316]))),dK=Ce(()=>ke(()=>import("./JoinRequestQueue-DyPP4DL2.js").then(e=>e.JoinRequestQueue),__vite__mapDeps([437,1,3,20,21,22,7,8,9,125,37,147,127,175]))),MA=Ce(()=>ke(()=>Promise.resolve().then(()=>X8).then(e=>e.NotFoundPage),void 0)),fc=Ce(()=>ke(()=>import("./Inbox-cm1ulHkR.js").then(e=>e.n).then(e=>e.Inbox),__vite__mapDeps([283,1,3,16,17,20,22,137,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,134,80,81,9,46,122,4,41,48,49,226,7,11,13,14,98,87,76,186,89,90,37,55,109,141,184,146,126,99,74,147,284,148,127,149,88,44,175,59,285,42,43,45,47,6,34,50,51,52,53,54,56,38,57,58,162,97,168,84]))),fK=Ce(()=>ke(()=>import("./CompanyExport-B9FgX5uJ.js").then(e=>e.CompanyExport),__vite__mapDeps([438,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,42,43,44,45,46,4,47,48,49,6,34,50,51,52,53,7,9,54,55,56,38,57,58,59,14,76,37,126,127,77,414]))),pK=Ce(()=>ke(()=>import("./Terminal-D_PTBqFk.js").then(e=>e.Terminal),__vite__mapDeps([439,1,3,16,17,20,294,25,8,114,80,26,27,81,39,200,295,6,7,9,296,31,195,76,95,38,36,37,297,21,22,19,23,24,28,29,5,30,32,33,212,108,4,40,48,298,53,13,72,105,98,99,74,147,127,216,100,172,82,83,173,202,119,408])));function mK({children:e}){return(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:e})}r(mK,"ProductionSurface");function hK(e){const t=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{index:!0,element:(0,a.jsx)(We,{to:"dashboard",replace:!0})}),(0,a.jsx)(L,{path:"dashboard",element:(0,a.jsx)(nB,{})}),(0,a.jsx)(L,{path:"dashboard/live",element:(0,a.jsx)(We,{to:pI("all"),replace:!0})}),(0,a.jsx)(L,{path:"timeline",element:(0,a.jsx)(Gs,{to:"/activity/timeline"})}),(0,a.jsx)(L,{path:"onboarding",element:(0,a.jsx)(LA,{})}),(0,a.jsx)(L,{path:"companies",element:(0,a.jsx)(aB,{})}),(0,a.jsx)(L,{path:"company/settings",element:(0,a.jsx)(EB,{})}),(0,a.jsx)(L,{path:"company/settings/connections",element:(0,a.jsx)(IB,{})}),(0,a.jsx)(L,{path:"company/settings/agent-defaults",element:(0,a.jsx)(GB,{})}),(0,a.jsx)(L,{path:"company/settings/agent-defaults/all",element:(0,a.jsx)(YB,{})}),(0,a.jsx)(L,{path:"company/settings/models",element:(0,a.jsx)(XB,{})}),(0,a.jsx)(L,{path:"company/settings/environments",element:(0,a.jsx)(We,{to:"/company/settings/instance/environments",replace:!0})}),(0,a.jsx)(L,{path:"company/settings/cloud-upstream",element:(0,a.jsx)(We,{to:"/company/export",replace:!0})}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"company.members"}),children:[(0,a.jsx)(L,{path:"company/settings/members",element:(0,a.jsx)(OB,{})}),(0,a.jsx)(L,{path:"company/settings/access",element:(0,a.jsx)(LB,{})})]}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.invites"}),children:(0,a.jsx)(L,{path:"company/settings/invites",element:(0,a.jsx)(We,{to:"/company/settings/members?tab=invites",replace:!0})})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.export"}),children:(0,a.jsx)(L,{path:"company/export/*",element:(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:(0,a.jsx)(fK,{})})})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.import"}),children:(0,a.jsx)(L,{path:"company/import",element:(0,a.jsx)(VB,{})})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"company.secrets"}),children:(0,a.jsx)(L,{path:"company/settings/secrets",element:(0,a.jsx)(HB,{})})}),(0,a.jsx)(L,{path:"company/settings/tools",element:(0,a.jsx)(fk,{})}),(0,a.jsx)(L,{path:"company/settings/tools/:tab",element:(0,a.jsx)(fk,{})}),(0,a.jsx)(L,{path:"tools",element:(0,a.jsx)(pk,{})}),(0,a.jsx)(L,{path:"tools/:tab",element:(0,a.jsx)(pk,{})}),(0,a.jsx)(L,{path:"apps",element:(0,a.jsx)(PB,{})}),(0,a.jsx)(L,{path:"apps/assistant-connection",element:(0,a.jsx)(rK,{})}),(0,a.jsx)(L,{path:"apps/browse",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/connections",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/byo",element:(0,a.jsx)(RA,{byoOnly:!0})}),(0,a.jsx)(L,{path:"apps/vercel-connect",element:(0,a.jsx)(uk,{credentialSource:"vercel_connect"})}),(0,a.jsx)(L,{path:"apps/connect",element:(0,a.jsx)(uk,{})}),(0,a.jsx)(L,{path:"apps/chat/connect",element:(0,a.jsx)(Cd,{children:(0,a.jsx)($B,{})})}),(0,a.jsx)(L,{path:"apps/chat/:endpointId",element:(0,a.jsx)(Cd,{children:(0,a.jsx)(We,{to:"settings",replace:!0})})}),(0,a.jsx)(L,{path:"apps/chat/:endpointId/reviews/:reviewId",element:(0,a.jsx)(Cd,{children:(0,a.jsx)(nk,{})})}),(0,a.jsx)(L,{path:"apps/chat/:endpointId/:tab",element:(0,a.jsx)(Cd,{children:(0,a.jsx)(nk,{})})}),(0,a.jsx)(L,{path:"apps/connect/:appKey",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/connect/:appKey/:stage",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/review",element:(0,a.jsx)(BB,{})}),(0,a.jsx)(L,{path:"apps/attention",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/gateways",element:(0,a.jsx)(sk,{})}),(0,a.jsx)(L,{path:"apps/gateways/:gatewayId",element:(0,a.jsx)(We,{to:"overview",replace:!0})}),(0,a.jsx)(L,{path:"apps/gateways/:gatewayId/:tab",element:(0,a.jsx)(qB,{})}),(0,a.jsx)(L,{path:"apps/advanced",element:(0,a.jsx)(ek,{})}),(0,a.jsx)(L,{path:"apps/advanced/gateways",element:(0,a.jsx)(sk,{})}),(0,a.jsx)(L,{path:"apps/advanced/profiles/new",element:(0,a.jsx)(tk,{mode:"new"})}),(0,a.jsx)(L,{path:"apps/advanced/profiles/:profileId/edit",element:(0,a.jsx)(tk,{mode:"edit"})}),(0,a.jsx)(L,{path:"apps/advanced/profiles/:profileId",element:(0,a.jsx)(zB,{})}),(0,a.jsx)(L,{path:"apps/advanced/audit",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/advanced/run-your-own",element:(0,a.jsx)(We,{to:"/apps",replace:!0})}),(0,a.jsx)(L,{path:"apps/advanced/:tab",element:(0,a.jsx)(ek,{})}),(0,a.jsx)(L,{path:"apps/app/:applicationId",element:(0,a.jsx)(ak,{})}),(0,a.jsx)(L,{path:"apps/app/:applicationId/:tab",element:(0,a.jsx)(ak,{})}),(0,a.jsx)(L,{path:"apps/:connectionId",element:(0,a.jsx)(We,{to:"permissions",replace:!0})}),(0,a.jsx)(L,{path:"apps/:connectionId/:tab",element:(0,a.jsx)(KB,{})}),(0,a.jsx)(L,{path:"company/settings/instance",element:(0,a.jsx)(We,{to:"/company/settings",replace:!0})}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.profile"}),children:(0,a.jsx)(L,{path:"company/settings/instance/profile",element:(0,a.jsx)(eK,{})})}),(0,a.jsx)(L,{path:"company/settings/instance/general",element:(0,a.jsx)(We,{to:"/company/settings",replace:!0})}),(0,a.jsx)(L,{path:"company/settings/instance/heartbeats",element:(0,a.jsx)(We,{to:"/company/settings",replace:!0})}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.environments"}),children:[(0,a.jsx)(L,{path:"company/settings/instance/environments",element:(0,a.jsx)(Uh,{})}),(0,a.jsx)(L,{path:"company/settings/instance/environments/new",element:(0,a.jsx)(Uh,{mode:"create"})}),(0,a.jsx)(L,{path:"company/settings/instance/environments/:environmentId/edit",element:(0,a.jsx)(Uh,{mode:"edit"})})]}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.access"}),children:(0,a.jsx)(L,{path:"company/settings/instance/access",element:(0,a.jsx)(JB,{})})}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.experimental"}),children:[(0,a.jsx)(L,{path:"company/settings/instance/features",element:(0,a.jsx)(QB,{})}),(0,a.jsx)(L,{path:"company/settings/instance/advanced",element:(0,a.jsx)(ZB,{})}),(0,a.jsx)(L,{path:"company/settings/instance/experimental",element:(0,a.jsx)(We,{to:"/company/settings/instance/features",replace:!0})})]}),(0,a.jsxs)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.plugins"}),children:[(0,a.jsx)(L,{path:"company/settings/instance/plugins",element:(0,a.jsx)(tK,{})}),(0,a.jsx)(L,{path:"company/settings/instance/plugins/:pluginId",element:(0,a.jsx)(nK,{})})]}),(0,a.jsx)(L,{element:(0,a.jsx)(_s,{pageKey:"instance.adapters"}),children:(0,a.jsx)(L,{path:"company/settings/instance/adapters",element:(0,a.jsx)(rk,{})})}),(0,a.jsx)(L,{path:"company/settings/:settingsRoutePath/*",element:(0,a.jsx)(DB,{})}),(0,a.jsx)(L,{path:"skills/sources",element:(0,a.jsx)(ik,{})}),(0,a.jsx)(L,{path:"skills/sources/:sourceId",element:(0,a.jsx)(ik,{})}),(0,a.jsx)(L,{path:"skills/studio",element:(0,a.jsx)(Bh,{})}),(0,a.jsx)(L,{path:"skills/studio/new",element:(0,a.jsx)(Bh,{})}),(0,a.jsx)(L,{path:"skills/studio/:skillId",element:(0,a.jsx)(Bh,{})}),(0,a.jsx)(L,{path:"skills/:skillId/studio",element:(0,a.jsx)(DA,{})}),(0,a.jsx)(L,{path:"skills/*",element:(0,a.jsx)(FB,{})}),(0,a.jsx)(L,{path:"settings",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"settings/*",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"plugins/:pluginId",element:(0,a.jsx)(lk,{})}),(0,a.jsx)(L,{path:"org",element:(0,a.jsx)(We,{to:"/agents/all",replace:!0})}),(0,a.jsx)(L,{path:"agents",element:(0,a.jsx)(We,{to:"/agents/all",replace:!0})}),TA.map(s=>(0,a.jsx)(L,{path:`agents/${s}`,element:(0,a.jsx)(sB,{})},s)),(0,a.jsx)(L,{path:"agents/new",element:(0,a.jsx)(aK,{})}),(0,a.jsx)(L,{path:"agents/:agentId",element:(0,a.jsx)(Ph,{})}),(0,a.jsx)(L,{path:"agents/:agentId/:tab",element:(0,a.jsx)(Ph,{})}),(0,a.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,a.jsx)(Ph,{})}),(0,a.jsx)(L,{path:"projects",element:(0,a.jsx)(iB,{})}),(0,a.jsx)(L,{path:"projects/:projectId",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/overview",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Ih,{}),children:(0,a.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,a.jsx)(rB,{})})}),(0,a.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/configuration",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{path:"projects/:projectId/budget",element:(0,a.jsx)(Br,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Ih,{}),children:(0,a.jsx)(L,{path:"workspaces",element:(0,a.jsx)(lB,{})})}),(0,a.jsx)(L,{path:"terminal",element:(0,a.jsx)(mK,{children:(0,a.jsx)(pK,{})})}),(0,a.jsx)(L,{path:"issues",element:(0,a.jsx)(oB,{})}),(0,a.jsx)(L,{path:"tasks",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"tasks/new",element:(0,a.jsx)(V6,{})}),(0,a.jsx)(L,{path:"search",element:(0,a.jsx)(cB,{})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"issues/all",element:(0,a.jsx)(xs,{view:"all"})}),(0,a.jsx)(L,{path:"issues/active",element:(0,a.jsx)(xs,{view:"active"})}),(0,a.jsx)(L,{path:"issues/backlog",element:(0,a.jsx)(xs,{view:"backlog"})}),(0,a.jsx)(L,{path:"issues/done",element:(0,a.jsx)(xs,{view:"done"})}),(0,a.jsx)(L,{path:"issues/recent",element:(0,a.jsx)(xs,{view:"recent"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"issues/all",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/active",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/backlog",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/done",element:(0,a.jsx)(We,{to:"/issues",replace:!0})}),(0,a.jsx)(L,{path:"issues/recent",element:(0,a.jsx)(We,{to:"/issues",replace:!0})})]}),(0,a.jsx)(L,{path:"chats",element:(0,a.jsx)(dB,{})}),(0,a.jsx)(L,{path:"chats/:agentRef",element:(0,a.jsx)(fB,{})}),(0,a.jsx)(L,{path:"issues/:issueId",element:(0,a.jsx)(uB,{})}),null,(0,a.jsx)(L,{path:"routines",element:(0,a.jsx)(mB,{})}),(0,a.jsx)(L,{path:"cases",element:(0,a.jsx)(qw,{children:(0,a.jsx)(eB,{})})}),(0,a.jsx)(L,{path:"cases/:caseIdentifier",element:(0,a.jsx)(qw,{children:(0,a.jsx)(tB,{})})}),(0,a.jsx)(L,{path:"pixels-office",element:(0,a.jsx)(i6,{children:(0,a.jsx)(yB,{})})}),(0,a.jsx)(L,{path:"status",element:(0,a.jsx)(Fw,{children:(0,a.jsx)(Yw,{})})}),(0,a.jsx)(L,{path:"status/:cardId",element:(0,a.jsx)(Fw,{children:(0,a.jsx)(Yw,{})})}),(0,a.jsx)(L,{path:"status-cards",element:(0,a.jsx)(mk,{})}),(0,a.jsx)(L,{path:"status-cards/:cardId",element:(0,a.jsx)(mk,{})}),(0,a.jsx)(L,{path:"review-queue",element:(0,a.jsx)(nr,{children:(0,a.jsx)(bB,{})})}),(0,a.jsx)(L,{path:"learnings",element:(0,a.jsx)(nr,{children:(0,a.jsx)(hB,{})})}),(0,a.jsx)(L,{path:"pipelines",element:(0,a.jsx)(nr,{children:(0,a.jsx)($h,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId",element:(0,a.jsx)(nr,{children:(0,a.jsx)($h,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,a.jsx)(nr,{children:(0,a.jsx)($h,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,a.jsx)(nr,{children:(0,a.jsx)(vB,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,a.jsx)(nr,{children:(0,a.jsx)(gB,{})})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,a.jsx)(nr,{children:(0,a.jsx)(xB,{})})}),(0,a.jsx)(L,{path:"routines/:routineId",element:(0,a.jsx)(Xw,{})}),(0,a.jsx)(L,{path:"routines/:routineId/:section",element:(0,a.jsx)(Xw,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Ih,{}),children:(0,a.jsxs)(L,{element:(0,a.jsx)(r6,{}),children:[(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,a.jsx)(Ql,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,a.jsx)(Ql,{})})]})}),(0,a.jsx)(L,{path:"goals",element:(0,a.jsx)(wB,{})}),(0,a.jsx)(L,{path:"goals/:goalId",element:(0,a.jsx)(kB,{})}),(0,a.jsx)(L,{path:"artifacts",element:(0,a.jsx)(Zw,{})}),(0,a.jsx)(L,{path:"approvals",element:(0,a.jsx)(We,{to:"/approvals/pending",replace:!0})}),(0,a.jsx)(L,{path:"approvals/pending",element:(0,a.jsx)(Jw,{})}),(0,a.jsx)(L,{path:"approvals/all",element:(0,a.jsx)(Jw,{})}),(0,a.jsx)(L,{path:"approvals/:approvalId",element:(0,a.jsx)(SB,{})}),(0,a.jsx)(L,{path:"activity",element:(0,a.jsx)(NB,{})}),(0,a.jsx)(L,{path:"activity/runs",element:(0,a.jsx)(Ad,{section:"runs"})}),(0,a.jsx)(L,{path:"activity/costs",element:(0,a.jsx)(Ad,{section:"costs"})}),(0,a.jsx)(L,{path:"activity/budgets",element:(0,a.jsx)(Ad,{section:"budgets"})}),(0,a.jsx)(L,{path:"activity/timeline",element:(0,a.jsx)(Ad,{section:"timeline"})}),(0,a.jsx)(L,{path:"audit",element:(0,a.jsx)(Gs,{to:"/activity",forceAgentMode:!0})}),(0,a.jsx)(L,{path:"audit/activity",element:(0,a.jsx)(Gs,{to:"/activity"})}),(0,a.jsx)(L,{path:"audit/runs",element:(0,a.jsx)(Gs,{to:"/activity/runs"})}),(0,a.jsx)(L,{path:"audit/costs",element:(0,a.jsx)(Gs,{to:"/activity/costs"})}),(0,a.jsx)(L,{path:"audit/budgets",element:(0,a.jsx)(Gs,{to:"/activity/budgets"})}),(0,a.jsx)(L,{path:"audit/timeline",element:(0,a.jsx)(Gs,{to:"/activity/timeline"})}),(0,a.jsx)(L,{path:"runs",element:(0,a.jsx)(Gs,{to:"/activity/runs"})}),(0,a.jsx)(L,{path:"costs",element:(0,a.jsx)(Gs,{to:"/activity/costs"})}),(0,a.jsx)(L,{path:"budgets",element:(0,a.jsx)(Gs,{to:"/activity/budgets"})}),(0,a.jsxs)(L,{element:(0,a.jsx)(s6,{}),children:[(0,a.jsx)(L,{path:"board-chat",element:(0,a.jsx)(_B,{})}),(0,a.jsx)(L,{path:"artifacts",element:(0,a.jsx)(Zw,{})})]}),null,(0,a.jsx)(L,{path:"decisions",element:(0,a.jsx)(CB,{})}),(0,a.jsx)(L,{path:"decisions/queues/:key",element:(0,a.jsx)(AB,{})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"inbox",element:(0,a.jsx)(dk,{})}),(0,a.jsx)(L,{path:"inbox/mine",element:(0,a.jsx)(xs,{view:"mine"})}),(0,a.jsx)(L,{path:"inbox/recent",element:(0,a.jsx)(xs,{view:"recent"})}),(0,a.jsx)(L,{path:"inbox/unread",element:(0,a.jsx)(xs,{view:"unread"})}),(0,a.jsx)(L,{path:"inbox/blocked",element:(0,a.jsx)(xs,{view:"blocked"})}),(0,a.jsx)(L,{path:"inbox/all",element:(0,a.jsx)(xs,{view:"everything"})}),(0,a.jsx)(L,{path:"inbox/new",element:(0,a.jsx)(xs,{view:"mine"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{path:"inbox",element:(0,a.jsx)(dk,{})}),(0,a.jsx)(L,{path:"inbox/mine",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/recent",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/unread",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/blocked",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/all",element:(0,a.jsx)(fc,{})}),(0,a.jsx)(L,{path:"inbox/new",element:(0,a.jsx)(We,{to:"/inbox/mine",replace:!0})})]}),(0,a.jsx)(L,{path:"inbox/requests",element:(0,a.jsx)(dK,{})}),(0,a.jsx)(L,{path:"u/:userSlug",element:(0,a.jsx)(jB,{})}),(0,a.jsx)(L,{path:"design-guide",element:(0,a.jsx)(WB,{})}),(0,a.jsx)(L,{path:"instance/settings/adapters",element:(0,a.jsx)(rk,{})}),(0,a.jsx)(L,{path:":pluginRoutePath/*",element:(0,a.jsx)(lk,{})}),(0,a.jsx)(L,{path:"*",element:(0,a.jsx)(MA,{scope:"board"})})]})}r(hK,"boardRoutes");function uk({credentialSource:e="wardmote_vault"}={}){const t=hn(),s=new URLSearchParams(t.search),{enabled:l,githubEnabled:c}=w0();return qT(s,{chatConnectorsEnabled:l,githubReviewBotsEnabled:c})?(0,a.jsx)(RA,{credentialSource:e}):(0,a.jsx)(We,{to:"/apps",replace:!0})}r(uk,"AppsConnectEntryRoute");function dk(){const{enabled:e}=Zf();return e?(0,a.jsx)(xs,{view:gI(Rj())}):(0,a.jsx)(We,{to:`/inbox/${Rj()}`,replace:!0})}r(dk,"InboxRootRedirect");function xs({view:e}){const t=hn(),s=new URLSearchParams(t.search);return s.set(uI,e),(0,a.jsx)(We,{to:`/issues?${s.toString()}${t.hash}`,replace:!0})}r(xs,"TaskViewRedirect");function DA(){const e=hn(),{companies:t,selectedCompany:s,loading:l}=vt(),{companyPrefix:c,skillId:u}=zs();if(l)return null;const p=(c?t.find(f=>f.issuePrefix.toUpperCase()===c.toUpperCase()):null)??s??t[0]??null;return!p||!u?(0,a.jsx)(We,{to:"/skills/studio",replace:!0}):(0,a.jsx)(We,{to:`/${p.issuePrefix}/skills/studio/${encodeURIComponent(u)}${e.search}${e.hash}`,replace:!0})}r(DA,"LegacySkillStudioRedirect");function qr(){const e=hn(),{companies:t,selectedCompany:s,loading:l}=vt(),{companyPrefix:c}=zs(),{hidden:u}=hr();if(l)return(0,a.jsx)(Ms,{});const p=(c?t.find(h=>h.issuePrefix.toUpperCase()===c.toUpperCase()):null)??s??t[0]??null;if(!p)return mx({pathname:e.pathname,hasCompanies:!1})?(0,a.jsx)(We,{to:"/onboarding",replace:!0}):(0,a.jsx)(xx,{});const f=rT(lT(`${e.pathname}${e.search}${e.hash}`),u);return(0,a.jsx)(We,{to:`/${p.issuePrefix}${f}`,replace:!0})}r(qr,"LegacySettingsRedirect");function fk(){const{tab:e}=zs();return(0,a.jsx)(We,{to:OA(e),replace:!0})}r(fk,"LegacyToolsSettingsRedirect");function pk(){const{tab:e}=zs();return(0,a.jsx)(We,{to:OA(e),replace:!0})}r(pk,"LegacyToolsRedirect");function OA(e){return e?e==="applications"||e==="connections"||e==="overview"||e==="examples"||e==="runtime"||e==="audit"?"/apps":e==="policies"?"/apps/advanced/profiles":`/apps/advanced/${e}`:"/apps/advanced/profiles"}r(OA,"legacyToolsRedirectTarget");function LA(){const{companies:e}=vt(),{openOnboarding:t}=$s(),{t:s}=IN(),{onboardingOpen:l,onboardingRouteDismissed:c}=qf(),{companyPrefix:u}=zs(),p=u?e.find(g=>g.issuePrefix.toUpperCase()===u.toUpperCase())??null:null;if(lU({onboardingOpen:l,routeDismissed:c}))return null;const f=p?`Add another agent to ${p.name}`:e.length>0?"Create another organization":"Create your first organization",h=p?"Run onboarding again to add an agent and a starter task for this organization.":e.length>0?"Run onboarding again to create another organization and seed its first agent.":"Get started by creating an organization and your first agent.";return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:f}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:h}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(oe,{onClick:r(()=>p?t({initialStep:gA(),companyId:p.id}):t(),"onClick"),children:p?"Add Agent":"Start Onboarding"})})]})})}r(LA,"OnboardingRoutePage");function gK(){const{companies:e,selectedCompany:t,loading:s}=vt(),l=hn();if(s)return(0,a.jsx)(Ms,{});const c=t??e[0]??null;return c?(0,a.jsx)(We,{to:`/${c.issuePrefix}/dashboard`,replace:!0}):mx({pathname:l.pathname,hasCompanies:!1})?(0,a.jsx)(We,{to:"/onboarding",replace:!0}):(0,a.jsx)(xx,{})}r(gK,"CompanyRootRedirect");function mk(){const{cardId:e}=zs(),t=hI(),s=t?`/${t}`:"";return(0,a.jsx)(We,{to:`${s}/status${e?`/${e}`:""}`,replace:!0})}r(mk,"StatusCardsLegacyRedirect");function Gs({to:e,forceAgentMode:t=!1}){const s=hn(),l=new URLSearchParams(s.search);t&&l.set("mode","agents");const c=l.toString();return(0,a.jsx)(We,{to:`${e}${c?`?${c}`:""}${s.hash}`,replace:!0})}r(Gs,"AuditCompatibilityRedirect");function Ze(){const e=hn(),{companies:t,selectedCompany:s,loading:l}=vt();if(l)return(0,a.jsx)(Ms,{});const c=s??t[0]??null;return c?(0,a.jsx)(We,{to:`/${c.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):mx({pathname:e.pathname,hasCompanies:!1})?(0,a.jsx)(We,{to:"/onboarding",replace:!0}):(0,a.jsx)(xx,{})}r(Ze,"UnprefixedBoardRedirect");function xx(){const{openOnboarding:e}=$s(),{t}=IN();return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)("div",{className:"rounded-lg border border-line bg-bg-2 p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:t("app.noCompanies.title",{defaultValue:"Create your first organization"})}),(0,a.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:t("app.noCompanies.description",{defaultValue:"Get started by creating an organization."})}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(oe,{onClick:r(()=>e(),"onClick"),children:t("app.noCompanies.newCompany",{defaultValue:"New Organization"})})})]})})}r(xx,"NoCompaniesStartPage");function xK(){const{enabled:e}=Zf();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Suspense,{fallback:(0,a.jsx)(Ms,{}),children:(0,a.jsxs)(OE,{children:[(0,a.jsx)(L,{path:"auth",element:(0,a.jsx)(sK,{})}),(0,a.jsx)(L,{path:"board-claim/:token",element:(0,a.jsx)(iK,{})}),(0,a.jsx)(L,{path:"mcp-connect/:id",element:(0,a.jsx)(ok,{})}),(0,a.jsx)(L,{path:"dot-connect/:id",element:(0,a.jsx)(ok,{agentPairingOnly:!0})}),(0,a.jsx)(L,{path:"mcp-device",element:(0,a.jsx)(lK,{})}),(0,a.jsx)(L,{path:"assistant-connections",element:(0,a.jsx)(oK,{})}),(0,a.jsx)(L,{path:"cli-auth/:id",element:(0,a.jsx)(cK,{})}),(0,a.jsx)(L,{path:"invite/:token",element:(0,a.jsx)(uK,{})}),(0,a.jsx)(L,{path:"s/:token",element:(0,a.jsx)(ck,{})}),(0,a.jsx)(L,{path:"s/:token/issues/:issueId",element:(0,a.jsx)(ck,{})}),(0,a.jsx)(L,{element:(0,a.jsx)(Gw,{allowMembershipRequest:!0}),children:(0,a.jsx)(L,{path:"chat-identity/confirm",element:(0,a.jsx)(UB,{})})}),(0,a.jsx)(L,{path:"tests/perf/long-thread",element:(0,a.jsx)(pB,{})}),(0,a.jsx)(L,{path:"ux-lab/bootstrap-setup",element:(0,a.jsx)(TB,{})}),(0,a.jsx)(L,{path:"ux-lab/responsible-user-denial",element:(0,a.jsx)(RB,{})}),(0,a.jsx)(L,{path:"ux-lab/cross-issue-collaboration",element:(0,a.jsx)(MB,{})}),(0,a.jsxs)(L,{element:(0,a.jsx)(Gw,{}),children:[(0,a.jsx)(L,{index:!0,element:(0,a.jsx)(gK,{})}),(0,a.jsx)(L,{path:"onboarding",element:(0,a.jsx)(LA,{})}),(0,a.jsx)(L,{path:"instance",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"instance/settings",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"instance/settings/*",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"companies",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"dashboard",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"inbox/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"issues",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"tasks",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"tasks/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"issues/:issueId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"routines",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"routines/:routineId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"review-queue",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"learnings",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"cases",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"cases/:caseIdentifier",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pixels-office",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status/:cardId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status-cards",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"status-cards/:cardId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/add",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/settings",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/items/:caseId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"artifacts",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"audit",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"audit/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"activity",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"activity/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"runs",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"costs",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"budgets",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"decisions",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"u/:userSlug",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/studio",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/studio/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/studio/:skillId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"skills/:skillId/studio",element:(0,a.jsx)(DA,{})}),(0,a.jsx)(L,{path:"skills/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"settings",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"settings/*",element:(0,a.jsx)(qr,{})}),(0,a.jsx)(L,{path:"agents",element:(0,a.jsx)(Ze,{})}),TA.map(t=>(0,a.jsx)(L,{path:`agents/${t}`,element:(0,a.jsx)(Ze,{})},t)),(0,a.jsx)(L,{path:"agents/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"agents/:agentId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"agents/:agentId/:tab",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"agents/:agentId/runs/:runId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/overview",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/issues/:filter",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/workspaces",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"projects/:projectId/configuration",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"workspaces",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"terminal",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/services",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/configuration",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/issues",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:"execution-workspaces/:workspaceId/routines",element:(0,a.jsx)(Vl,{})}),(0,a.jsx)(L,{path:":companyPrefix",element:(0,a.jsx)(t6,{}),children:hK(e)}),(0,a.jsx)(L,{path:"*",element:(0,a.jsx)(MA,{scope:"global"})})]})]})}),(0,a.jsx)(F6,{}),(0,a.jsx)(x8,{})]})}r(xK,"App");var bK=class extends x.Component{static{r(this,"AppErrorBoundary")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){wA(e,{boundary:"app",componentStack:t.componentStack})}render(){const{error:e}=this.state;return e?(0,a.jsxs)("div",{className:"mx-auto flex min-h-screen max-w-2xl flex-col justify-center space-y-4 px-4 py-10",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-semibold",children:"Wardmote hit an error"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Something went wrong while running the app. Reloading usually fixes this."})]}),(0,a.jsx)("pre",{className:"overflow-auto rounded-md border border-bad/30 bg-bad/10 px-3 py-2 text-xs text-bad whitespace-pre-wrap",children:e.message}),(0,a.jsx)("div",{children:(0,a.jsx)("button",{type:"button",className:"inline-flex items-center rounded-md border border-line-strong bg-bg px-3 py-1.5 text-sm font-medium shadow-sm hover:bg-bg-3 hover:text-ink",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})})]}):this.props.children}};function vK(){const{data:e}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),t=e?.sentryDsn,s=e?.sentryEnvironment??void 0;return(0,x.useEffect)(()=>{if(t)return FU(t,s),()=>{HU()}},[t,s]),null}r(vK,"SentryGate");function yK(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}r(yK,"createDeferred");function jK(e,t=300){const s=new Map;let l=null,c=null;const u=r(async()=>{l!==null&&(clearTimeout(l),l=null);const h=c;if(c=null,s.size===0){h?.resolve();return}const g=[...s.values()];s.clear();try{await Promise.all(g.map(v=>e.invalidateQueries(Kc().visible?v:{...v,refetchType:"none"})))}finally{h?.resolve()}},"flush");return{schedule:r(h=>(s.set(wK(h),h),c===null&&(c=yK()),l===null&&(l=setTimeout(()=>{u()},t)),c.promise),"schedule"),flush:u,dispose:r(()=>{l!==null&&(clearTimeout(l),l=null),s.clear(),c?.resolve(),c=null},"dispose")}}r(jK,"createInvalidationBatcher");var hk=0;function wK(e){if(typeof e.predicate=="function")return`__predicate__:${hk+=1}`;try{return JSON.stringify([e.queryKey??null,e.refetchType??null,e.exact??null,e.type??null])}catch{return`__nonserializable__:${hk+=1}`}}r(wK,"serializeFilters");function kK(e,t){return new Proxy(e,{get(s,l){if(l==="invalidateQueries")return u=>t.schedule(u??{});const c=Reflect.get(s,l,s);return typeof c=="function"?c.bind(s):c}})}r(kK,"createCoalescingQueryClient");function SK(e,t){if(!e)return e;const s=e.filter(l=>l.id!==t);return s.length===e.length?e:s}r(SK,"removeRunFromList");function NK(e,t,s){if(!e)return{next:e,present:!1};let l=!1,c=!1;const u=e.map(p=>p.id!==t||(l=!0,p.status===s)?p:(c=!0,{...p,status:s}));return{next:c?u:e,present:l}}r(NK,"patchRunStatusInList");function CK(e,t){if(!e)return e;const s=e.filter(l=>l.id!==t);return s.length===e.length?e:s}r(CK,"removeLiveRunById");function AK(e,t){return!e||e.executionRunId!==t?e:{...e,executionRunId:null,executionAgentNameKey:null,executionLockedAt:null}}r(AK,"clearIssueExecutionRun");var _K=3e4,EK=["status","priority","title","assigneeAgentId","assigneeUserId","projectId","parentId"],IK=new Set(["issue.read_marked","issue.read_unmarked","issue.inbox_archived","issue.inbox_unarchived"]);function Yg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(Yg,"isRecord");function bx(e){return Yg(e)&&Array.isArray(e.pages)}r(bx,"isInfiniteIssueData");function TK(e){return Array.isArray(e)?e.length:bx(e)?e.pages.reduce((t,s)=>t+(Array.isArray(s)?s.length:0),0):0}r(TK,"issueListRowCount");function RK(e){const t=e.state.data;return bx(t)||TK(t)>=100}r(RK,"isLargeIssueListQuery");function MK(e,t,s){const l={},c=Yg(t?.changes)?t.changes:null;if(e==="issue.updated"&&c)for(const u of EK){const p=c[u];!Yg(p)||p.updated===!0||!("to"in p)||(l[u]=p.to)}return s&&e&&!IK.has(e)&&!Number.isNaN(Date.parse(s))&&(l.lastActivityAt=s),l}r(MK,"readIssueListPatchFromActivity");function DK(e,t){let s=null;for(const[l,c]of Object.entries(t)){if(l==="lastActivityAt"){const u=e.lastActivityAt?new Date(e.lastActivityAt).getTime():0;if(new Date(c).getTime()<=u)continue}else if(!(l in e)||e[l]===c)continue;s??={...e},s[l]=c}return s??e}r(DK,"patchIssueRow");function gk(e,t,s){const l=e.findIndex(p=>p?.id===t);if(l<0)return e;const c=DK(e[l],s);if(c===e[l])return e;const u=e.slice();return u[l]=c,u}r(gk,"patchIssueRows");function OK(e,t,s){if(Array.isArray(e))return gk(e,t,s);if(!bx(e))return e;let l=!1;const c=e.pages.map(u=>{if(!Array.isArray(u))return u;const p=gk(u,t,s);return p!==u&&(l=!0),p});return l?{...e,pages:c}:e}r(OK,"patchIssueListData");function LK(e,t,s,l){if(Object.keys(l).length===0)return 0;let c=0;for(const[u,p]of e.getQueriesData({queryKey:P.issues.list(t)})){const f=OK(p,s,l);f!==p&&(e.setQueryData(u,f),c+=1)}return c}r(LK,"patchIssueInListCaches");function zK(e,t){for(const s of e.getQueryCache().findAll({queryKey:P.issues.list(t)}))e.invalidateQueries({queryKey:s.queryKey,exact:!0,...RK(s)?{refetchType:"none"}:{}})}r(zK,"invalidateIssueListsForActivity");function PK(e,t){const s=r(l=>l.state.isInvalidated,"predicate");return Promise.all([e.refetchQueries({queryKey:P.issues.list(t),type:"active",predicate:s}),e.refetchQueries({queryKey:P.heartbeats(t),type:"active",predicate:s})])}r(PK,"refreshInvalidatedLiveLists");function ao(e){return typeof e=="string"&&e.length>0?e:null}r(ao,"readString$1");function $K(e){return e.length===3&&e[0]==="issues"&&e[2]==="agent-todo"}r($K,"isAgentTodoQueryKey");function UK(e){if(e.type!=="heartbeat.run.event")return null;const t=e.payload??{};if(t.eventType!=="agent.todo")return null;const s=ao(t.runId),l=ao(t.agentId),c=ao(t.issueId),u=t.seq;if(!s||!l||!c||typeof u!="number"||!Number.isInteger(u))return null;const p=vE(t.payload);return p?{...p,runId:s,agentId:l,issueId:c,seq:u,createdAt:ao(t.lastEventAt)??e.createdAt,runStatus:"running"}:null}r(UK,"readAgentTodoSnapshotFromLiveEvent");function xk(e,t){if(t.type==="heartbeat.run.status"){const l=t.payload??{},c=ao(l.runId),u=ao(l.status);if(!c||!u)return;e.setQueriesData({predicate:r(p=>$K(p.queryKey),"predicate")},p=>p&&p.runId===c&&p.runStatus!==u?{...p,runStatus:u}:p);return}const s=UK(t);s&&e.setQueryData(P.issues.agentTodo(s.issueId),l=>l&&l.runId===s.runId&&l.seq>=s.seq?l:s)}r(xk,"applyAgentTodoLiveEvent");function BK(e){const t=e.trim().toLowerCase();return t==="0.0.0.0"||t==="::"||t==="[::]"}r(BK,"isWildcardHost");function KK(e=window.location){return BK(e.hostname)?e.port?`localhost:${e.port}`:"localhost":e.host}r(KK,"browserReachableHost");function qK(e,t=window.location){const s=t.protocol==="https:"?"wss":"ws",l=e.startsWith("/")?e:`/${e}`;return`${s}://${KK(t)}${l}`}r(qK,"buildSameOriginWebSocketUrl");function FK(e){try{return new WebSocket(e)}catch{return null}}r(FK,"tryCreateWebSocket");var HK="/pwa-192x192.png",VK="/pwa-monochrome-512x512.png";function vx(){return typeof window<"u"&&"Notification"in window}r(vx,"notificationsSupported");function yx(){return vx()?Notification.permission:"unsupported"}r(yx,"notificationPermission");async function WK(){return vx()?Notification.permission!=="default"?Notification.permission:Notification.requestPermission():"unsupported"}r(WK,"requestNotificationPermission");function QK(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window}r(QK,"pushSupported");function AY(e=typeof navigator>"u"?void 0:navigator){return e?(/iPad|iPhone|iPod/.test(e.userAgent)||e.platform==="MacIntel"&&(e.maxTouchPoints??0)>1)&&e.standalone!==!0:!1}r(AY,"isIosWithoutHomeScreenInstall");async function zA(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{return await navigator.serviceWorker.getRegistration()??null}catch{return null}}r(zA,"getServiceWorkerRegistration");var PA="wardmote.notifications.seen.v1",GK="wardmote.notifications.claim",YK=6e5,XK=200,ZK=new Map;function JK(){let e=null;try{e=typeof localStorage>"u"?null:localStorage}catch{e=null}const t=typeof navigator<"u"&&navigator.locks?{request:r((s,l)=>navigator.locks.request(s,l),"request")}:null;return{storage:e,locks:t,now:r(()=>Date.now(),"now"),memory:ZK}}r(JK,"defaultEnv");function eq(e){const t=e.storage?.getItem(PA);if(!t)return new Map(e.memory);try{const s=JSON.parse(t),l=new Map(e.memory);for(const[c,u]of Object.entries(s))typeof u=="number"&&l.set(c,u);return l}catch{return new Map(e.memory)}}r(eq,"readSeen");function Kh(e,t){const s=t.now(),l=eq(t);for(const[u,p]of l)s-p>YK&&l.delete(u);if(l.has(e))return!1;l.set(e,s);const c=[...l.entries()].sort((u,p)=>p[1]-u[1]).slice(0,XK);t.memory.clear();for(const[u,p]of c)t.memory.set(u,p);return tq(t,c),!0}r(Kh,"claimInsideLock");function tq(e,t){try{e.storage?.setItem(PA,JSON.stringify(Object.fromEntries(t)))}catch{return}}r(tq,"writeSeen");async function nq(e,t=JK()){if(!t.locks)return Kh(e,t);try{return await t.locks.request(GK,()=>Kh(e,t))}catch{return Kh(e,t)}}r(nq,"claimNotificationKey");var aq="wardmote-notifications",bf="custom-sounds";function sq(e){return e.type.startsWith("audio/")?e.size<=0?{ok:!1,error:"The audio file is empty."}:e.size>524288?{ok:!1,error:"Custom sounds must be 512 KB or smaller."}:{ok:!0}:{ok:!1,error:"Choose an audio file."}}r(sq,"validateCustomSoundFile");function $A(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}r($A,"requestResult");var _d=null;function iq(){if(typeof indexedDB>"u")return Promise.reject(new Error("IndexedDB is unavailable."));if(!_d){const e=indexedDB.open(aq,1);e.onupgradeneeded=()=>{e.result.objectStoreNames.contains(bf)||e.result.createObjectStore(bf,{keyPath:"kind"})},_d=$A(e).catch(t=>{throw _d=null,t})}return _d}r(iq,"openDb");async function jx(e,t){return $A(t((await iq()).transaction(bf,e).objectStore(bf)))}r(jx,"withStore");var Xg=new Set;function rq(e){return Xg.add(e),()=>Xg.delete(e)}r(rq,"subscribeCustomSounds");function UA(){for(const e of Xg)e()}r(UA,"notifyCustomSoundsChanged");async function _Y(e,t){const s=sq(t);if(!s.ok)throw new Error(s.error);const l={kind:e,name:t.name,type:t.type,size:t.size,blob:t,updatedAt:new Date().toISOString()};return await jx("readwrite",c=>c.put(l)),UA(),l}r(_Y,"saveCustomSound");async function lq(e){try{return await jx("readonly",t=>t.get(e))??null}catch{return null}}r(lq,"loadCustomSound");async function EY(e){await jx("readwrite",t=>t.delete(e)),UA()}r(EY,"removeCustomSound");var oq=[{id:"confirmation",label:"Confirmation"},{id:"question",label:"Question"},{id:"glass",label:"Glass"},{id:"bong",label:"Bong"},{id:"maximize",label:"Rise"},{id:"pluck",label:"Pluck"},{id:"error",label:"Alert"},{id:"drop",label:"Drop"},{id:"select",label:"Select"},{id:"open",label:"Open"}],IY="custom",TY="none",Zg={approval:"confirmation",question:"question",comment:"pluck",assignment:"maximize",review:"glass",run_failed:"error",join_request:"bong",disk_space:"drop"},RY={approval:"Approvals",question:"Agent questions",comment:"Comments",assignment:"Assignments",review:"Ready for review",run_failed:"Failed runs",join_request:"Join requests",disk_space:"Low disk space"},BA=new Set(oq.map(e=>e.id));function cq(e){return typeof e=="string"&&(BA.has(e)||e==="custom"||e==="none")}r(cq,"isKnownSoundId");function uq(e){return BA.has(e)}r(uq,"isLibrarySoundId");function bk(e,t){return`/sounds/${e}.${t}`}r(bk,"librarySoundUrl");var Jg=new Map,vf=new Map,vk=!1,Ed=null;function KA(){return typeof Audio<"u"}r(KA,"audioSupported");function yk(){return Ed||(Ed=new Audio().canPlayType('audio/ogg; codecs="vorbis"')?"ogg":"mp3",Ed)}r(yk,"libraryFormat");function qA(e){let t=Jg.get(e);return t||(t=new Audio,t.preload="auto",t.src=e,Jg.set(e,t)),t}r(qA,"audioFor");function dq(){for(const e of vf.values())e.then(t=>{t&&(Jg.delete(t),URL.revokeObjectURL(t))});vf.clear()}r(dq,"revokeCustomSounds");function fq(e){vk||(vk=!0,rq(dq));let t=vf.get(e);return t||(t=lq(e).then(s=>s?URL.createObjectURL(s.blob):null),vf.set(e,t)),t}r(fq,"customSoundUrl");async function FA(e,t){if(t==="none")return null;if(t==="custom"){const s=await fq(e);return s||bk(Zg[e],yk())}return bk(uq(t)?t:Zg[e],yk())}r(FA,"resolveSoundUrl");async function pq(e,t,s){if(!KA())return!1;const l=await FA(e,t);if(!l)return!1;const c=qA(l);c.volume=Math.min(1,Math.max(0,s)),c.currentTime=0;try{return await c.play(),!0}catch{return!1}}r(pq,"playSound");function mq(e,t){return pq(e,t.kinds[e].soundId,t.volume)}r(mq,"playKindSound");function jk(e){if(!(!KA()||!e.enabled))for(const[t,s]of Object.entries(e.kinds))s.enabled&&FA(t,s.soundId).then(l=>{l&&qA(l)})}r(jk,"preloadNotificationSounds");var e0={getWebPushConfig:r(()=>je.get("/notifications/web-push/config"),"getWebPushConfig"),upsertWebPushSubscription:r(e=>je.put("/notifications/web-push/subscription",e),"upsertWebPushSubscription"),deleteWebPushSubscription:r(e=>je.deleteWithBody("/notifications/web-push/subscription",e),"deleteWebPushSubscription"),sendWebPushTest:r(()=>je.post("/notifications/web-push/test",{}),"sendWebPushTest")},HA="wardmote.notifications.v1",hq=.6;function t0(){const e={};for(const t of g0)e[t]={enabled:!0,soundId:Zg[t]};return{enabled:!0,volume:hq,pushEnabled:!0,kinds:e}}r(t0,"defaultNotificationSettings");function qh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}r(qh,"asRecord");function VA(e){const t=t0(),s=qh(e);if(!s)return t;const l=typeof s.volume=="number"&&Number.isFinite(s.volume)?Math.min(1,Math.max(0,s.volume)):t.volume,c=qh(s.kinds)??{},u={...t.kinds};for(const p of g0){const f=qh(c[p]);f&&(u[p]={enabled:typeof f.enabled=="boolean"?f.enabled:t.kinds[p].enabled,soundId:cq(f.soundId)?f.soundId:t.kinds[p].soundId})}return{enabled:typeof s.enabled=="boolean"?s.enabled:t.enabled,volume:l,pushEnabled:typeof s.pushEnabled=="boolean"?s.pushEnabled:t.pushEnabled,kinds:u}}r(VA,"normalizeNotificationSettings");function yf(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}r(yf,"storage");function gq(){const e=yf()?.getItem(HA);if(!e)return t0();try{return VA(JSON.parse(e))}catch{return t0()}}r(gq,"readStored");var jf,mc=null,Ud=new Set,Id=!1;function Zr(){const e=yf()?.getItem("wardmote.notifications.v1")??null;return mc&&e===jf||(jf=e,mc=gq()),mc}r(Zr,"getNotificationSettings");function WA(){for(const e of Ud)e()}r(WA,"notify");function QA(e){const t=VA(typeof e=="function"?e(Zr()):e);try{yf()?.setItem(HA,JSON.stringify(t))}catch{jf=void 0}return mc=t,jf=yf()?.getItem("wardmote.notifications.v1")??null,WA(),t}r(QA,"setNotificationSettings");function MY(e,t){return QA(s=>({...s,kinds:{...s.kinds,[e]:{...s.kinds[e],...t}}}))}r(MY,"updateKindSettings");function xq(e){return e.enabled?g0.filter(t=>e.kinds[t].enabled):[]}r(xq,"enabledNotificationKinds");function wk(e){e.key!==null&&e.key!=="wardmote.notifications.v1"||WA()}r(wk,"onStorage");function GA(e){return Ud.add(e),!Id&&typeof window<"u"&&(Id=!0,window.addEventListener("storage",wk)),()=>{Ud.delete(e),Ud.size===0&&Id&&typeof window<"u"&&(Id=!1,window.removeEventListener("storage",wk))}}r(GA,"subscribeNotificationSettings");function DY(){return(0,x.useSyncExternalStore)(GA,Zr,Zr)}r(DY,"useNotificationSettings");var kc={status:"unknown",error:null},n0=new Set,a0=null,kk=Promise.resolve();function Sk(e){if(!(e.status===kc.status&&e.error===kc.error)){kc=e;for(const t of n0)t()}}r(Sk,"setPushState");function Nk(){return kc}r(Nk,"getPushState");function bq(){return kc.status==="active"}r(bq,"hasActivePushSubscription");function vq(e){return n0.add(e),()=>n0.delete(e)}r(vq,"subscribePushState");function OY(){return(0,x.useSyncExternalStore)(vq,Nk,Nk)}r(OY,"usePushState");function YA(e){const t=e.padEnd(e.length+(4-e.length%4)%4,"=").replace(/-/g,"+").replace(/_/g,"/"),s=atob(t),l=new Uint8Array(new ArrayBuffer(s.length));for(let c=0;c<s.length;c+=1)l[c]=s.charCodeAt(c);return l}r(YA,"urlBase64ToUint8Array");function yq(e,t){const s=e.options?.applicationServerKey;if(!s)return!0;const l=YA(t),c=new Uint8Array(s);return c.length===l.length&&c.every((u,p)=>u===l[p])}r(yq,"sameApplicationServerKey");async function Ck(e){await e0.deleteWebPushSubscription({endpoint:e.endpoint}).catch(()=>{}),await e.unsubscribe().catch(()=>!1),a0=null}r(Ck,"forgetSubscription");async function jq(e,t){if(!QK())return{status:"unsupported",error:null};const s=await zA();if(!s)return{status:"unsupported",error:null};let l=await s.pushManager.getSubscription();if(!(e.enabled&&e.pushEnabled))return l&&await Ck(l),{status:"off",error:null};if(yx()!=="granted")return{status:"permission",error:null};const c=await e0.getWebPushConfig();if(!c.enabled||!c.publicKey)return{status:"server-disabled",error:null};l&&!yq(l,c.publicKey)&&(await Ck(l),l=null),l||(l=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:YA(c.publicKey)}));const u=l.toJSON(),p=u.keys?.p256dh,f=u.keys?.auth;if(!p||!f)return{status:"error",error:"The browser returned an incomplete push subscription."};const h=xq(e),g=[t,l.endpoint,...h].join("|");return g!==a0&&(await e0.upsertWebPushSubscription({endpoint:l.endpoint,keys:{p256dh:p,auth:f},kinds:h}),a0=g),{status:"active",error:null}}r(jq,"reconcile");function s0(e,t){const s=kk.then(async()=>{try{const l=await jq(e,t);return Sk(l),l}catch(l){const c={status:"error",error:l instanceof Error?l.message:"Push subscription failed."};return Sk(c),c}});return kk=s.catch(()=>{}),s}r(s0,"syncPushSubscription");function XA(e,t){return t.enabled&&t.kinds[e.kind]?.enabled===!0}r(XA,"kindEnabled");function wq(e){const{payload:t,userId:s,settings:l}=e;return!s||!t.recipientUserIds.includes(s)||!XA(t.notification,l)?"none":e.visible?"sound":e.pushActive?"none":"os"}r(wq,"decideLiveNotification");function kq(e){return!e.visible||!XA(e.notification,e.settings)?"none":"sound"}r(kq,"decideServiceWorkerNotification");async function Sq(e){if(yx()!=="granted")return;const t={body:e.body,tag:e.key,data:{url:e.url},icon:HK,badge:VK},s=await zA();if(s){await s.showNotification(e.title,t);return}new Notification(e.title,t)}r(Sq,"showOsNotification");var ZA={claim:r(e=>nq(e),"claim"),playSound:r((e,t)=>mq(e.kind,t),"playSound"),showOsNotification:Sq};async function JA(e,t,s,l){return e==="none"?e:await l.claim(t.key)?(e==="sound"?await l.playSound(t,s):await l.showOsNotification(t),e):"none"}r(JA,"perform");function Nq(e,t,s=ZA,l={}){const c=l.settings??Zr();return JA(wq({payload:e,userId:t,settings:c,visible:l.visible??Kc().visible,pushActive:l.pushActive??bq()}),e.notification,c,s)}r(Nq,"deliverLiveNotification");function Cq(e,t=ZA,s={}){const l=s.settings??Zr();return JA(kq({notification:e,settings:l,visible:s.visible??Kc().visible}),e,l,t)}r(Cq,"deliverServiceWorkerNotification");function e2(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.key=="string"&&typeof t.kind=="string"&&typeof t.title=="string"?t:null}r(e2,"readNotification");function Aq(e){if(!e||typeof e!="object")return null;const t=e,s=e2(t.notification);return!s||!Array.isArray(t.recipientUserIds)?null:{notification:s,recipientUserIds:t.recipientUserIds.filter(l=>typeof l=="string")}}r(Aq,"readNotificationCreatedPayload");function _q(e){if(!e||typeof e!="object")return null;const t=e;if(t.type==="wardmote.notification"){const s=e2(t.notification);return s?{type:"notification",notification:s}:null}return t.type==="wardmote.navigate"&&typeof t.url=="string"&&t.url.startsWith("/")?{type:"navigate",url:t.url}:null}r(_q,"readServiceWorkerMessage");var Eq=1e4,Iq=3,Tq=2e3,Rq=3e5,Mq=2e3,Dq=15e3,Oq=0,Lq=1,Uc=new Set(["succeeded","interrupted","failed","cancelled","timed_out"]),t2=(0,x.createContext)(null);function zq(e,t,s){if(s.companyId===t)for(const l of Array.from(e))try{l(s)}catch{}}r(zq,"dispatchLiveEventToSubscribers");function LY(e){const t=(0,x.useContext)(t2),s=(0,x.useRef)(e);(0,x.useEffect)(()=>{s.current=e}),(0,x.useEffect)(()=>{if(t)return t.subscribe(l=>{s.current(l)})},[t])}r(LY,"useCompanyLiveEvent");function be(e){return typeof e=="string"&&e.length>0?e:null}r(be,"readString");function al(e){return typeof e!="object"||e===null||Array.isArray(e)?null:e}r(al,"readRecord");function wf(e){return e.slice(0,8)}r(wf,"shortId");function n2(e,t,s){const l=e.getQueryData(P.agents.list(t))?.find(c=>c.id===s);return l?.name?l.name:e.getQueryData(P.agents.detail(s))?.name??null}r(n2,"resolveAgentName");function Pq(e,t,s){const l=e.getQueryData(P.access.companyUserDirectory(t));if(!l)return null;const c=l.users.find(u=>u.principalId===s);return c?.user?.name?.trim()||c?.user?.email?.trim()||null}r(Pq,"resolveUserName");function Fr(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}r(Fr,"truncate");function $q(e,t,s,l){return s==="agent"&&l?n2(e,t,l)??`Agent ${wf(l)}`:s==="system"?"System":s==="user"&&l?Pq(e,t,l)??(l==="board"||l==="local-board"?"Board":`User ${wf(l)}`):s==="plugin"?"Plugin":"Unknown actor"}r($q,"resolveActorLabel");function wx(e,t,s,l){const c=new Set([s]),u=e.getQueryData(P.issues.detail(s)),p=e.getQueryData(P.issues.list(t)),f=be(l?.identifier)??be(l?.issueIdentifier);f&&c.add(f),u?.id&&c.add(u.id),u?.identifier&&c.add(u.identifier);const h=p?.find(g=>!!(g.id===s||g.identifier&&g.identifier===s||f&&g.identifier===f));return h?.id&&c.add(h.id),h?.identifier&&c.add(h.identifier),Array.from(c)}r(wx,"resolveIssueQueryRefs");function Uq(e,t,s,l){const c=wx(e,t,s,l),u=c.map(v=>e.getQueryData(P.issues.detail(v))).find(v=>!!v),p=e.getQueryData(P.issues.list(t))?.find(v=>c.some(y=>v.id===y||v.identifier===y)),f=u??p??null,h=be(l?.identifier)??be(l?.issueIdentifier)??f?.identifier??`Task ${wf(s)}`,g=be(l?.title)??be(l?.issueTitle)??f?.title??null;return{ref:h,title:g,label:g?`${h} - ${Fr(g,72)}`:h,href:`/issues/${f?.identifier??s}`}}r(Uq,"resolveIssueToastContext");function a2(){return!(typeof document>"u"||document.visibilityState!=="visible"||typeof document.hasFocus=="function"&&!document.hasFocus())}r(a2,"isPageForegrounded");function gr(e,t,s){if(!(s?.isForegrounded??a2()))return null;const l=If(t).split("/").filter(Boolean);if(!["issues","chats"].includes(l[0])||!l[1])return null;let c=decodeURIComponent(l[1]);if(l[0]==="chats"){const j=e.getQueryData(P.auth.session),k=j?.user?.id??j?.session?.userId??null,S=h1(t),N=e.getQueryData(P.companies.list(k))?.companies.find(M=>M.issuePrefix.toUpperCase()===S?.toUpperCase());if(!N)return null;const I=e.getQueryData(P.agents.list(N.id))?.find(M=>M.id===c||dr(M)===c);if(!I)return null;const C=e.getQueryData(P.agentChats.detail(N.id,k,I.id));if(!C)return null;c=C.id}const u=e.getQueryData(P.issues.detail(c))??null,p=new Set([c]);u?.id&&p.add(u.id),u?.identifier&&p.add(u.identifier);function f(j,k){const S=e.getQueryData(P.issues.activeRun(j)),N=e.getQueryData(P.issues.liveRuns(j))??[],I=e.getQueryData(P.issues.runs(j))??[];S?.id&&k.add(S.id);for(const C of N)C.id&&k.add(C.id);for(const C of I)C.runId&&k.add(C.runId)}r(f,"collectCachedIssueRunIds");const h=new Set;for(const j of p)f(j,h);const g=new Set(p),v=new Set,y=new Set(h);if(u?.companyId&&u.id){const j=e.getQueryData(P.issues.listByDescendantRoot(u.companyId,u.id))??[];for(const k of j)g.add(k.id),k.identifier&&g.add(k.identifier),k.assigneeAgentId&&v.add(k.assigneeAgentId),k.executionRunId&&y.add(k.executionRunId),f(k.id,y),k.identifier&&f(k.identifier,y)}if(u?.companyId){const j=e.getQueryData(P.liveRuns(u.companyId))??[];for(const k of j)k.issueId&&g.has(k.issueId)&&y.add(k.id)}return{routeIssueRef:c,issueRefs:p,assigneeAgentId:u?.assigneeAgentId??null,runIds:h,subtreeIssueRefs:g,subtreeAgentIds:v,subtreeRunIds:y}}r(gr,"resolveVisibleIssueRouteContext");function np(e,t){const s=new Set([e]),l=be(t?.identifier)??be(t?.issueIdentifier);return l&&s.add(l),s}r(np,"buildIssueRefsForPayload");function ap(e,t){for(const s of e)if(t.has(s))return!0;return!1}r(ap,"overlaps");function Bq(e,t,s,l){const c=be(s.entityType),u=be(s.entityId);if(c!=="issue"||!u)return!1;const p=gr(e,t,l);return p?ap(p.subtreeIssueRefs,np(u,al(s.details))):!1}r(Bq,"shouldSuppressActivityToastForVisibleIssue");function Kq(e,t,s,l){if(!(l?.isForegrounded??a2()))return!1;const c=If(t).match(/^\/agents\/[^/]+\/runs\/([^/]+)/)?.[1];if(c&&decodeURIComponent(c)===be(s.runId))return!0;const u=gr(e,t,l);if(!u)return!1;const p=be(s.issueId);if(p)return u.subtreeIssueRefs.has(p);const f=be(s.runId);if(f)return u.subtreeRunIds.has(f);const h=be(s.agentId);return!!h&&(h===u.assigneeAgentId||u.subtreeAgentIds.has(h))}r(Kq,"shouldSuppressRunStatusToastForVisibleIssue");function Ak(e,t,s,l){const c=gr(e,t,l);if(!c)return!1;const u=be(s.runId),p=be(s.agentId);if(!(u!==null&&c.runIds.has(u)||p&&c.assigneeAgentId&&p===c.assigneeAgentId))return!1;const f=be(s.status);if(u&&f&&Uc.has(f))for(const v of c.issueRefs)e.invalidateQueries({queryKey:P.issues.comments(v)}),e.setQueryData(P.issues.liveRuns(v),y=>CK(y,u)),e.setQueryData(P.issues.activeRun(v),y=>y?.id===u?null:y),e.setQueryData(P.issues.detail(v),y=>AK(y,u));const h=!!f&&Uc.has(f),g=!h&&(l?.liveStatusAlreadyPatched??!1);for(const v of c.issueRefs)e.invalidateQueries({queryKey:P.issues.detail(v)}),e.invalidateQueries({queryKey:P.issues.activity(v)}),e.invalidateQueries({queryKey:P.issues.runs(v)}),l?.runLifecycleEvent&&e.invalidateQueries({queryKey:P.issues.queuedComments(v)}),g||(e.invalidateQueries({queryKey:P.issues.liveRuns(v)}),e.invalidateQueries({queryKey:P.issues.activeRun(v)})),h&&(e.invalidateQueries({queryKey:P.issues.comments(v)}),e.invalidateQueries({queryKey:P.issues.attachments(v)}),e.invalidateQueries({queryKey:P.issues.workProducts(v)}),e.invalidateQueries({queryKey:P.issues.workProductPullRequestRefresh(v)}),e.invalidateQueries({queryKey:["issues","tree-control-state",v]}));return!0}r(Ak,"invalidateVisibleIssueRunQueries");function pc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(pc,"hasPatchKey");function s2(e,t){return e.id!==t.runId?e:{...e,...pc(t,"message")?{currentStatusMessage:t.message}:{},...pc(t,"updatedAt")?{currentStatusUpdatedAt:t.updatedAt}:{},...pc(t,"currentToolName")?{currentToolName:t.currentToolName}:{},...pc(t,"lastAssistantSnippet")?{lastAssistantSnippet:t.lastAssistantSnippet}:{},...pc(t,"lastEventAt")?{lastEventAt:t.lastEventAt}:{}}}r(s2,"applyRunLiveStatusPatch");function _k(e,t){if(!e)return e;let s=!1;const l=e.map(c=>c.id!==t.runId?c:(s=!0,s2(c,t)));return s?l:e}r(_k,"applyRunLiveStatusPatchToArray");function qq(e,t,s){const l=be(e.runId);if(!l)return null;const c={runId:l,agentId:be(e.agentId),issueId:be(e.issueId)};if(s==="heartbeat.run.progress")return c.message=be(e.message),c.updatedAt=be(e.updatedAt)??t,c.currentToolName=be(e.currentToolName),c.lastAssistantSnippet=be(e.lastAssistantSnippet),c.lastEventAt=be(e.lastEventAt)??c.updatedAt,c;if(s==="heartbeat.run.log")return c.lastEventAt=be(e.ts)??t,c;if(s==="heartbeat.run.event"){const u=be(e.message);u&&(c.message=u),c.updatedAt=be(e.updatedAt)??t;const p=be(e.currentToolName);p&&(c.currentToolName=p);const f=be(e.lastAssistantSnippet);return f&&(c.lastAssistantSnippet=f),c.lastEventAt=be(e.lastEventAt)??t,c}return null}r(qq,"readRunLiveStatusPatchFromPayload");var Fq=1e3;function Hq(e=Fq){const t=new Map,s=new Map,l=r(c=>{const u=t.get(c);if(!u){s.delete(c);return}t.delete(c),s.set(c,setTimeout(()=>l(c),e)),u.apply(u.patch)},"release");return{submit:r((c,u)=>{if(s.has(c.runId)){t.set(c.runId,{patch:c,apply:u});return}s.set(c.runId,setTimeout(()=>l(c.runId),e)),u(c)},"submit"),dispose:r(()=>{for(const c of s.values())clearTimeout(c);s.clear(),t.clear()},"dispose")}}r(Hq,"createRunLogPatchThrottle");function Vq(e,t,s,l,c){let u=!1;e.setQueryData(P.liveRuns(t),h=>{const g=_k(h,l);return g!==h&&(u=!0),g});const p=new Set;if(l.issueId)for(const h of wx(e,t,l.issueId,null))p.add(h);const f=gr(e,s,c);if(f&&(f.runIds.has(l.runId)||l.issueId&&f.issueRefs.has(l.issueId)||l.agentId&&f.assigneeAgentId&&l.agentId===f.assigneeAgentId))for(const h of f.issueRefs)p.add(h);for(const h of p)e.setQueryData(P.issues.activeRun(h),g=>!g||g.id!==l.runId?g:(u=!0,s2(g,l))),e.setQueryData(P.issues.liveRuns(h),g=>{const v=_k(g,l);return v!==g&&(u=!0),v});return u}r(Vq,"applyRunLiveStatusPatchToCaches");function Wq(e,t,s,l){const c=gr(e,t,l);if(!c)return!1;const u=be(s.agentId);return!!u&&(u===c.assigneeAgentId||c.subtreeAgentIds.has(u))}r(Wq,"shouldSuppressAgentStatusToastForVisibleIssue");function Qq(e,t,s,l){const c=be(s.entityType),u=be(s.entityId),p=be(s.actorType),f=be(s.action),h=al(s.details);if(c!=="issue"||!u||p!=="agent"&&p!=="system"||f!=="issue.updated"||be(h?.source)==="comment")return!1;const g=gr(e,t,l);return g?ap(g.issueRefs,np(u,h)):!1}r(Qq,"shouldDeferIssueRefetchForVisibleAgentActivity");function i2(e){return{isForegrounded:e?.isForegrounded??Kc().visible}}r(i2,"commentRouteOptions");function r2(e,t,s,l){const c=be(s.entityType),u=be(s.entityId),p=be(s.action),f=al(s.details);if(c!=="issue"||!u||p!=="issue.comment_added"||!be(f?.commentId))return!1;const h=gr(e,t,i2(l));return h?ap(h.issueRefs,np(u,f)):!1}r(r2,"shouldDeferVisibleIssueCommentActivity");async function Gq(e,t,s,l){const c=be(s.entityType),u=be(s.action),p=al(s.details),f=be(p?.commentId);if(c!=="issue"||u!=="issue.comment_added"||!f)return!1;const h=gr(e,t,i2(l));if(!h)return!1;const g=be(s.entityId);if(!g||!ap(h.issueRefs,np(g,p)))return!1;try{const v=await on.getComment(h.routeIssueRef,f);for(const y of h.issueRefs)e.setQueryData(P.issues.comments(y),j=>j?{...j,pages:dI(j.pages,v)}:{pages:[[v]],pageParams:[null]});return!0}catch{for(const v of h.issueRefs)e.invalidateQueries({queryKey:P.issues.comments(v)});return!1}}r(Gq,"hydrateVisibleIssueComment");var Yq=new Set(["issue.created","issue.updated","issue.comment_added"]),Ek=new Set(["issue.document_created","issue.document_updated","issue.document_restored","issue.document_deleted"]),Xq=new Set(["issue.document_annotation_thread_created","issue.document_annotation_comment_added","issue.document_annotation_thread_resolved","issue.document_annotation_thread_reopened","issue.document_annotation_remapped"]),Zq=new Set(["routine.document_annotation_thread_created","routine.document_annotation_comment_added","routine.document_annotation_thread_resolved","routine.document_annotation_thread_reopened","routine.document_annotation_remapped"]),Jq=new Set(["case.document_annotation_thread_created","case.document_annotation_comment_added","case.document_annotation_thread_resolved","case.document_annotation_thread_reopened","case.document_annotation_remapped"]),e7=new Set(["error"]),t7=new Set(["failed","timed_out","cancelled"]);function n7(e){if(!e)return null;const t=[];if(typeof e.status=="string"&&t.push(`status -> ${e.status.replace(/_/g," ")}`),typeof e.priority=="string"&&t.push(`priority -> ${e.priority}`),typeof e.assigneeAgentId=="string"||typeof e.assigneeUserId=="string"?t.push("reassigned"):(e.assigneeAgentId===null||e.assigneeUserId===null)&&t.push("unassigned"),e.reopened===!0){const s=be(e.reopenedFrom);t.push(s?`reopened from ${s.replace(/_/g," ")}`:"reopened")}return typeof e.title=="string"&&t.push("title changed"),typeof e.description=="string"&&t.push("description changed"),t.length>0?t.join(", "):null}r(n7,"describeIssueUpdate");function a7(e,t,s,l){const c=be(s.entityType),u=be(s.entityId),p=be(s.action),f=al(s.details),h=be(s.actorId),g=be(s.actorType);if(c!=="issue"||!u||!p||!Yq.has(p))return null;const v=Uq(e,t,u,f),y=be(be(s.actorName)?.trim())??$q(e,t,g,h),j=g==="agent"&&h?e.getQueryData(P.agents.list(t))?.find(K=>K.id===h)??e.getQueryData(P.agents.detail(h)):void 0,k=g==="user"&&h?e.getQueryData(P.access.companyUserDirectory(t))?.users.find(K=>K.principalId===h)?.user:void 0,S=h&&(g==="user"||g==="agent")?{type:g,id:h,name:y,image:s.actorImage!==void 0?be(s.actorImage):k?.image,appearance:g==="agent"?TE(s.actorAppearance!==void 0?s.actorAppearance:j?.appearance,h):void 0}:void 0;if(g==="user"&&l.userId&&h===l.userId||g==="agent"&&l.agentId&&h===l.agentId||p==="issue.comment_added"&&be(f?.source)?.startsWith("chat:"))return null;if(p==="issue.created")return{actor:S,title:`${y} created ${v.ref}`,body:v.title?Fr(v.title,96):void 0,tone:"success",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${p}:${u}`};if(p==="issue.updated"){if(be(f?.source)==="comment")return null;const K=n7(f),z=K?v.title?`${Fr(v.title,64)} - ${K}`:K:v.title?Fr(v.title,96):v.label;return{actor:S,title:`${y} updated ${v.ref}`,body:Fr(z,100),tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${p}:${u}`}}const N=be(f?.commentId),I=be(f?.bodySnippet),C=f?.reopened===!0,M=f?.updated===!0,R=be(f?.reopenedFrom),_=C?R?`reopened from ${R.replace(/_/g," ")}`:"reopened":null,D=C?`${y} reopened and commented on ${v.ref}`:M?`${y} commented and updated ${v.ref}`:`${y} commented on ${v.ref}`,U=I?_?`${_} - ${I.replace(/^#+\s*/m,"").replace(/\n/g," ")}`:I.replace(/^#+\s*/m,"").replace(/\n/g," "):_?v.title?`${_} - ${v.title}`:_:v.title??void 0;return{actor:S,title:D,body:U?Fr(U,96):void 0,tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${p}:${u}:${N??"na"}`}}r(a7,"buildActivityToast");function s7(e){const t=be(e.entityType),s=be(e.action),l=be(e.entityId),c=al(e.details);return t!=="join_request"||!s||!l||s!=="join.requested"&&s!=="join.request_replayed"?null:{title:`${be(c?.requestType)==="agent"?"Agent":"Someone"} wants to join`,body:"A new join request is waiting for approval.",tone:"info",action:{label:"View inbox",href:"/inbox/mine"},dedupeKey:`join-request:${l}`}}r(s7,"buildJoinRequestToast");function i7(e,t,s,l){const c=be(e.agentId),u=be(e.status);if(!c||!u||!e7.has(u))return null;const p=u==="error"?"error":"info",f=t(c)??`Agent ${wf(c)}`;return{title:u==="running"?`${f} started`:`${f} errored`,body:s.getQueryData(P.agents.list(l))?.find(h=>h.id===c)?.title??void 0,tone:p,action:{label:"View agent",href:`/agents/${c}`},dedupeKey:`agent-status:${c}:${u}`}}r(i7,"buildAgentStatusToast");function r7(e,t){const s=be(e.runId),l=be(e.agentId),c=be(e.status);if(!s||!l||!c||!t7.has(c))return null;const u=be(e.error),p=be(e.errorCode);if(p==="operator_interrupted"||p==="workspace_busy")return null;const f=be(e.contextSource),h=be(e.triggerDetail),g=t(l)??"Agent";if(c==="failed"&&p==="low_trust_isolation_unavailable"&&f?.startsWith("chat:"))return{title:`${g} couldn't start this chat`,body:"This external chat identity isn't linked, and isolated guest workspaces are disabled. Link the identity in Connectors or enable isolated workspaces, then start a new task.",tone:"warn",ttlMs:1e4,action:{label:"Open chat connections",href:"/apps"},dedupeKey:`run-status:${s}:${c}`};const v=c==="succeeded"?"success":c==="cancelled"?"info":"error",y=`${g} run ${c==="succeeded"?"succeeded":c==="failed"?"failed":c==="timed_out"?"timed out":"cancelled"}`;let j;return u?j=Fr(u,100):h&&(j=`Trigger: ${h}`),{title:y,body:j,tone:v,ttlMs:c==="succeeded"?5e3:7e3,action:{label:"View run",href:`/agents/${l}/runs/${s}`},dedupeKey:`run-status:${s}:${c}`}}r(r7,"buildRunStatusToast");function l7(e,t,s){const l=be(s.runId),c=be(s.status);if(!l||!c)return!1;if(e.setQueryData(P.runDetail(l),p=>{if(!p)return p;const f=r(h=>Object.prototype.hasOwnProperty.call(s,h),"has");return{...p,status:c,...f("invocationSource")?{invocationSource:be(s.invocationSource)??p.invocationSource}:{},...f("triggerDetail")?{triggerDetail:be(s.triggerDetail)}:{},...f("error")?{error:be(s.error)}:{},...f("errorCode")?{errorCode:be(s.errorCode)}:{},...f("startedAt")?{startedAt:be(s.startedAt)}:{},...f("finishedAt")?{finishedAt:be(s.finishedAt)}:{}}}),Uc.has(c))return e.setQueryData(P.liveRuns(t),p=>SK(p,l)),e.getQueryData(P.pausedTasks(t))&&e.invalidateQueries({queryKey:P.pausedTasks(t)}),!0;let u=!1;return e.setQueryData(P.liveRuns(t),p=>{const f=NK(p,l,c);return u=f.present,f.next}),u}r(l7,"applyRunLifecycleToCompanyLiveRuns");function o7(e,t,s){const l=be(s.status);l&&Uc.has(l)&&e.invalidateQueries({queryKey:P.heartbeats(t),refetchType:"none"}),e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:P.sidebarBadges(t)});const c=be(s.agentId);c&&(e.invalidateQueries({queryKey:P.agents.detail(c)}),e.invalidateQueries({queryKey:P.heartbeats(t,c)}));const u=be(s.runId);u&&e.invalidateQueries({queryKey:P.runDetail(u)})}r(o7,"invalidateHeartbeatQueries");function c7(e,t,s){const l=be(s.agentId);l&&e.invalidateQueries({queryKey:P.agents.detail(l)})}r(c7,"invalidateHeartbeatProgressQueries");var u7=new Set(["approval","attention_source","budget_incident","decision","decision_queue","issue_recovery_action","join_request"]),d7=["issue.blockers_","issue.dependency_recovery_","issue.disposition_repair_","issue.execution_recovery_","issue.interaction_","issue.recovery_action_","issue.stalled_review_","issue.thread_interaction_"],f7=new Set(["failed","timed_out"]);function p7(e,t,s){return t?.startsWith("inbox.")||e&&u7.has(e)?!0:e!=="issue"||!t?!1:d7.some(l=>t.startsWith(l))||t==="issue.reviewers_updated"||t==="issue.status_decision_recorded"?!0:(t==="issue.created"||t==="issue.updated")&&(s?.status!==void 0||s?.blockedByIssueIds!==void 0)}r(p7,"activityChangesAttention");function Ik(e,t,s,l){return e.getQueriesData({queryKey:P.attention(t)}).some(([,c])=>c?"items"in c?Array.isArray(c.items)&&c.items.some(s):"count"in c&&l(c):!1)}r(Ik,"cachedAttentionIncludes");function i0(e,t){e.invalidateQueries({queryKey:P.attention(t)})}r(i0,"invalidateAttentionQueries");function m7(e,t,s,l,c){e.invalidateQueries({queryKey:P.activity(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:P.sidebarBadges(t)});const u=be(s.entityType),p=be(s.entityId),f=be(s.action),h=be(s.actorType),g=be(s.actorId),v=al(s.details),y=h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId;if(p7(u,f,v)&&i0(e,t),u==="decision"&&(e.invalidateQueries({queryKey:["decisions",t]}),p&&e.invalidateQueries({queryKey:P.decisions.detail(p)})),(f?.startsWith("ai_connection.")||f?.startsWith("connection_grant."))&&e.invalidateQueries({queryKey:["ai-connections",t]}),(f?.startsWith("primary_agent.")||f?.startsWith("agent.")||f?.startsWith("resource_membership."))&&e.invalidateQueries({queryKey:["primary-agent",t]}),f?.startsWith("resource_membership.")||f?.startsWith("primary_agent.")){const j=be(v?.userId);(!j||j===l.userId)&&e.invalidateQueries({queryKey:P.resourceMemberships.mine(t)})}if(u==="issue"){const j=P.agentChats.list(t,l.userId);if((p&&e.getQueryData(j)?.some(k=>k.id===p)||f==="issue.conversation_opened"&&y)&&e.invalidateQueries({queryKey:j}),(f==="issue.tree_hold_created"||f==="issue.tree_hold_released"||f==="issue.updated")&&(e.invalidateQueries({queryKey:["issues","tree-control-state"]}),f!=="issue.updated"&&e.invalidateQueries({queryKey:P.pausedTasks(t)})),p&&LK(e,t,p,MK(f,v,c?.occurredAt??null)),zK(e,t),ZI(e,t,s),p){const k=(f==="issue.comment_added"||f==="issue.updated"&&be(v?.source)==="comment")&&(h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId),S=!!c?.pathname&&Qq(e,c.pathname,s,{isForegrounded:c.isForegrounded}),N=!!c?.pathname&&r2(e,c.pathname,s,{isForegrounded:c.isForegrounded}),I=wx(e,t,p,v);for(const C of I){const M=k||S||N?{refetchType:"none"}:void 0;if(e.invalidateQueries({queryKey:P.issues.detail(C),...M}),e.invalidateQueries({queryKey:P.issues.activity(C),...M}),(f==="issue.comment_added"||f==="issue.conversation_session_started")&&e.invalidateQueries({queryKey:P.issues.comments(C),...M}),(f==="issue.comment_added"||f?.startsWith("issue.queued_comment"))&&e.invalidateQueries({queryKey:P.issues.queuedComments(C)}),(f?.startsWith("issue.attachment_")||f?.startsWith("issue.work_product_"))&&(e.invalidateQueries({queryKey:P.issues.attachments(C)}),e.invalidateQueries({queryKey:P.issues.workProducts(C)})),f==="issue.conversation_session_started"&&(e.invalidateQueries({queryKey:["issues","tree-control-state",C]}),e.invalidateQueries({queryKey:P.issues.interactions(C)})),f&&Ek.has(f)){const R=be(v?.key);e.invalidateQueries({queryKey:P.issues.documents(C),...M}),R?(e.invalidateQueries({queryKey:P.issues.document(C,R),...M}),e.invalidateQueries({queryKey:P.issues.documentRevisions(C,R),...M})):(e.invalidateQueries({queryKey:["issues","document",C],...M}),e.invalidateQueries({queryKey:["issues","document-revisions",C],...M}))}if(f&&(Ek.has(f)||Xq.has(f))){const R=be(v?.key)??be(v?.documentKey);e.invalidateQueries({queryKey:R?["issues","document-annotations",C,R]:["issues","document-annotations",C],...M})}(f?.startsWith("issue.thread_interaction_")||(f==="issue.updated"||f==="issue.status_decision_recorded")&&be(v?.source)==="native_status_decision")&&(e.invalidateQueries({queryKey:P.issues.interactions(C)}),e.invalidateQueries({queryKey:P.tools.actionRequests(t,"pending")}),e.invalidateQueries({queryKey:P.apps.attention(t)}),e.invalidateQueries({queryKey:P.tools.trustRules(t)}))}}return}if(u==="agent"){e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.org(t)}),p&&(e.invalidateQueries({queryKey:P.agents.detail(p)}),e.invalidateQueries({queryKey:P.heartbeats(t,p)}));return}if(u==="project"){const j=be(s.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:P.issues.activity(j)}),e.invalidateQueries({queryKey:P.projects.all(t)}),p&&e.invalidateQueries({queryKey:P.projects.detail(p)});return}if(u==="company_skill"){const j=be(s.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:P.issues.activity(j)}),p&&e.invalidateQueries({queryKey:P.companySkills.detail(t,p)}),e.invalidateQueries({queryKey:P.companySkills.list(t)});return}if(u==="goal"){e.invalidateQueries({queryKey:P.goals.list(t)}),p&&e.invalidateQueries({queryKey:P.goals.detail(p)});return}if(u==="approval"){e.invalidateQueries({queryKey:P.approvals.list(t)});return}if(u==="join_request"){e.invalidateQueries({queryKey:P.access.joinRequests(t)});return}if(u==="cost_event"){e.invalidateQueries({queryKey:["costs",t]}),e.invalidateQueries({queryKey:["usage-by-provider",t]}),e.invalidateQueries({queryKey:["usage-by-biller",t]}),e.invalidateQueries({queryKey:P.usageWindowSpend(t)});return}if(u==="routine"||u==="routine_trigger"||u==="routine_run"){if(e.invalidateQueries({queryKey:["routines"]}),u==="routine"&&f&&Zq.has(f)&&p){const j=be(v?.key)??be(v?.documentKey)??"description",k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:["routines","document-annotations",p,j],...k})}return}if(u==="case"){if(e.invalidateQueries({queryKey:P.cases.list(t)}),p&&(e.invalidateQueries({queryKey:P.cases.detail(p)}),e.invalidateQueries({queryKey:P.cases.events(p)}),f&&Jq.has(f))){const j=be(v?.key)??be(v?.documentKey),k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:j?["cases","document-annotations",p,j]:["cases","document-annotations",p],...k})}return}if(u==="summary_slot"){const j=be(v?.scopeKind),k=be(v?.slotKey),S=be(v?.scopeId);j&&k&&(e.invalidateQueries({queryKey:P.summarySlots.detail(t,j,k,S)}),e.invalidateQueries({queryKey:P.summarySlots.revisions(t,j,k,S)}));return}u==="company"&&e.invalidateQueries({queryKey:P.companies.all})}r(m7,"invalidateActivityQueries");function h7(e,t){const s=t.payload??{},l=be(s.runId),c=be(s.status);if(!l||!c||!Uc.has(c))return!1;const u=`${t.companyId}:${l}:${c}`,p=e.observedRunOutcomes.has(u);e.observedRunOutcomes.delete(u),e.observedRunOutcomes.add(u),e.observedRunOutcomes.size>Mq&&e.observedRunOutcomes.delete(e.observedRunOutcomes.values().next().value);const f=Date.parse(be(s.finishedAt)??""),h=Date.parse(t.createdAt);return p||h-f>Rq}r(h7,"observeRunOutcome");function g7(e,t){const s=Date.now();if(s<e.suppressUntil)return!0;const l=e.cooldownHits.get(t);if(!l)return!1;const c=l.filter(u=>s-u<Eq);return e.cooldownHits.set(t,c),c.length>=Iq}r(g7,"shouldSuppressToast");function x7(e,t){const s=Date.now(),l=e.cooldownHits.get(t)??[];l.push(s),e.cooldownHits.set(t,l)}r(x7,"recordToastHit");function Fh(e,t,s,l){g7(e,s)||t(l)!==null&&x7(e,s)}r(Fh,"gatedPushToast");function b7(e,t,s,l,c,u,p,f){if(l.companyId!==t)return;const h=r(k=>n2(e,t,k),"nameOf"),g=l.payload??{},v=l.type==="heartbeat.run.status"&&(h7(u,l)||Kq(e,s,g)),y=qq(g,l.createdAt,l.type);let j=!1;if(y){const k=r(S=>{j=Vq(e,t,s,S)},"applyPatch");l.type==="heartbeat.run.log"&&f?f.submit(y,k):k(y)}if(l.type!=="heartbeat.run.log"){if(l.type==="heartbeat.run.queued"||l.type==="heartbeat.run.status"){const k=l7(e,t,g);if(o7(e,t,g),xk(e,l),k||e.invalidateQueries({queryKey:P.liveRuns(t)}),Ak(e,s,g,{runLifecycleEvent:!0}),(l.type==="heartbeat.run.status"&&f7.has(be(g.status)??"")||l.type==="heartbeat.run.queued"&&Ik(e,t,S=>S.sourceKind==="failed_run",S=>(S.countsBySourceKind?.failed_run??0)>0))&&i0(e,t),l.type==="heartbeat.run.status"){const S=r7(g,h);S&&!v&&Fh(u,c,"run-status",S)}return}if(l.type==="heartbeat.run.progress"){c7(e,t,g),Ak(e,s,g,{liveStatusAlreadyPatched:j});return}if(l.type==="heartbeat.run.event"){xk(e,l);return}if(l.type==="agent.status"){e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:P.org(t)});const k=be(g.agentId);k&&e.invalidateQueries({queryKey:P.agents.detail(k)}),(be(g.status)==="error"||k&&Ik(e,t,N=>N.sourceKind==="agent_error_alert"&&N.subject?.id===k,N=>N.errorAgentIds?.includes(k)===!0))&&i0(e,t);const S=i7(g,h,e,t);S&&!Wq(e,s,g)&&Fh(u,c,"agent-status",S);return}if(l.type==="activity.logged"){m7(e,t,g,p,{pathname:s,occurredAt:l.createdAt??null}),r2(e,s,g)&&Gq(e,s,g);const k=be(g.action),S=a7(e,t,g,p)??s7(g);S&&!Bq(e,s,g)&&Fh(u,c,`activity:${k??"unknown"}`,S)}}}r(b7,"handleLiveEvent");function v7(e,t){return e&&e===t?e:null}r(v7,"resolveLiveCompanyId");function Tk(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null}r(Tk,"resetSocketHandlers");function Rk(e,t){if(e){if(e.readyState===Oq){e.onopen=()=>{Tk(e),e.close(1e3,t)},e.onmessage=null,e.onerror=()=>{},e.onclose=null;return}Tk(e),e.readyState===Lq&&e.close(1e3,t)}}r(Rk,"closeSocketQuietly");function y7(e,t,s){return e==="success"&&(t||s==="local_trusted")}r(y7,"canUseLiveSession");function j7({children:e}){const{visible:t}=r1(),s=(0,x.useRef)(!t),{selectedCompanyId:l,selectedCompany:c}=vt(),u=kn(),{pushToast:p}=Ti(),f=hn(),h=(0,x.useRef)({cooldownHits:new Map,suppressUntil:0,observedRunOutcomes:new Set}),g=(0,x.useRef)(f.pathname),{data:v,status:y}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),{data:j}=me({queryKey:P.health,queryFn:Fc.get}),k=v?.user?.id??v?.session?.userId??(j?.deploymentMode==="local_trusted"?"local-board":null),S=v?.session?.id??k??"signed_out",N=v7(l,c?.id??null),I=y7(y,v!=null,j?.deploymentMode)&&N!==null,C=(0,x.useRef)({userId:k,agentId:null}),M=(0,x.useRef)(new Set),R=(0,x.useCallback)(z=>(M.current.add(z),()=>{M.current.delete(z)}),[]),_=(0,x.useMemo)(()=>({subscribe:R}),[R]),D=(0,x.useMemo)(()=>jK(u),[u]),U=(0,x.useMemo)(()=>kK(u,D),[u,D]),K=(0,x.useMemo)(()=>Hq(),[]);return(0,x.useEffect)(()=>()=>{D.dispose(),K.dispose()},[D,K]),(0,x.useEffect)(()=>{g.current=f.pathname},[f.pathname]),(0,x.useEffect)(()=>{C.current={userId:k,agentId:null}},[k]),(0,x.useEffect)(()=>{if(!t||!I||!N)return;const z=window.setInterval(()=>{PK(u,N)},_K);return()=>window.clearInterval(z)},[I,N,u,t]),(0,x.useEffect)(()=>{if(!t){s.current=!0,D.dispose(),K.dispose();return}if(!I||!N)return;s.current&&(s.current=!1,u.invalidateQueries({type:"active"},{cancelRefetch:!1}));let z=!1,E=0,B=null,O=null,Q=null;const V=r(()=>{B!==null&&(window.clearTimeout(B),B=null)},"clearReconnect"),ue=r(()=>{O!==null&&(window.clearInterval(O),O=null)},"stopPolling"),ce=r(()=>{z||O!==null||(O=window.setInterval(()=>{u.invalidateQueries({type:"active"},{cancelRefetch:!1})},Dq))},"startPolling"),X=r(()=>{if(z||B!==null)return;E+=1;const ie=Math.min(15e3,1e3*2**Math.min(E-1,4));B=window.setTimeout(()=>{B=null,A()},ie)},"scheduleReconnect"),A=r(()=>{if(z)return;const ie=qK(`/api/companies/${encodeURIComponent(N)}/events/ws`),le=FK(ie);if(!le){ce(),X();return}Q=le,le.onopen=()=>{if(z||Q!==le){Rk(le,"stale_connection");return}ue(),E>0&&(h.current.suppressUntil=Date.now()+Tq),u.invalidateQueries({type:"active"},{cancelRefetch:!1}),E=0},le.onmessage=Ae=>{if(!Kc().visible)return;const de=typeof Ae.data=="string"?Ae.data:"";if(de)try{const we=JSON.parse(de);if(b7(U,N,g.current,we,p,h.current,{userId:C.current.userId,agentId:C.current.agentId},K),zq(M.current,N,we),we.type==="notification.created"){const ye=Aq(we.payload);ye&&Nq(ye,C.current.userId)}}catch{}},le.onerror=()=>{},le.onclose=()=>{Q===le&&(Q=null,!z&&(ce(),X()))}},"connect"),ee=window.setTimeout(A,0);return()=>{z=!0,window.clearTimeout(ee),V(),ue();const ie=Q;Q=null,Rk(ie,"provider_unmount")}},[t,D,K,u,U,N,p,I,S]),(0,a.jsx)(t2.Provider,{value:_,children:e})}r(j7,"LiveUpdatesProvider");function w7(e){let t=Zr();jk(t),s0(t,e.userId);const s=GA(()=>{const u=Zr();u!==t&&(t=u,jk(u),s0(u,e.userId))}),l=typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:null,c=r(u=>{const p=_q(u.data);p&&(p.type==="navigate"?e.navigate(p.url):Cq(p.notification))},"onMessage");return l?.addEventListener("message",c),l?.startMessages(),()=>{s(),l?.removeEventListener("message",c)}}r(w7,"startNotificationRuntime");function k7(){const e=ja(),t=(0,x.useRef)(e),{data:s}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),l=s?.user?.id??s?.session?.userId??null;return(0,x.useEffect)(()=>{t.current=e},[e]),(0,x.useEffect)(()=>{if(l)return w7({userId:l,navigate:r(c=>t.current(c),"navigate")})},[l]),null}r(k7,"NotificationRuntime");var S7=36e5,N7=3e3,C7=2e3,Mk="wardmote.skip-waiting",A7="wardmote.build-id",l2=null,r0=new Set;function _7(e){l2=e;for(const t of r0)t()}r(_7,"publishUpdate");function E7(e){return r0.add(e),()=>{r0.delete(e)}}r(E7,"subscribe");function I7(){return(0,x.useSyncExternalStore)(E7,()=>l2,()=>null)}r(I7,"useServiceWorkerUpdate");function T7(e){return new Promise(t=>{const s=new MessageChannel,l=r(u=>{clearTimeout(c),s.port1.close(),t(u)},"finish"),c=setTimeout(()=>l(null),C7);s.port1.onmessage=u=>{l(typeof u.data?.buildId=="string"?u.data.buildId:null)},e.postMessage({type:A7},[s.port2])})}r(T7,"requestWorkerBuildId");function R7(e={}){const t=e.container??(typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:void 0);if(!t)return()=>{};const s=e.documentRef??document,l=e.reload??(()=>window.location.reload()),c=e.updateIntervalMs??S7,u=e.onUpdateReady??_7;let p=!!t.controller,f=!1,h=!1,g,v=!1;const y=r(async _=>e.pageBuildId?await T7(_)!==e.pageBuildId:!0,"servesNewerBuild"),j=r(()=>{h||(h=!0,g!==void 0&&clearTimeout(g),l())},"reloadOnce"),k=r(async _=>{const D=await y(_);if(!v){if(!D){_.postMessage({type:Mk});return}u(()=>{f=!0,_.postMessage({type:Mk}),g=setTimeout(j,N7)})}},"offerWaiting"),S=r(()=>{if(!p){p=!0;return}if(f){j();return}const _=t.controller;_&&y(_).then(D=>{D&&!v&&!f&&u(j)})},"onControllerChange");t.addEventListener("controllerchange",S);let N;const I=r(()=>{const _=N?.installing;_&&_.addEventListener("statechange",()=>{_.state==="installed"&&t.controller&&k(_)})},"watchInstalling"),C=r(()=>{N?.update().catch(()=>{})},"checkForUpdates"),M=r(()=>{s.visibilityState==="visible"&&C()},"onVisibilityChange");s.addEventListener("visibilitychange",M);const R=setInterval(C,c);return t.register("/sw.js").then(_=>{N=_,_.waiting&&t.controller&&k(_.waiting),_.addEventListener("updatefound",I)}).catch(()=>{}),()=>{v=!0,t.removeEventListener("controllerchange",S),s.removeEventListener("visibilitychange",M),N?.removeEventListener("updatefound",I),clearInterval(R),g!==void 0&&clearTimeout(g)}}r(R7,"startServiceWorkerUpdates");var o2="wardmote.notifications.asked-after-decision";function M7(){try{return window.localStorage.getItem(o2)==="1"}catch{return!0}}r(M7,"alreadyAsked");function D7(){try{window.localStorage.setItem(o2,"1")}catch{return}}r(D7,"markAsked");async function O7(e){const t=await WK();if(t!=="granted")return t;const s=QA(l=>({...l,enabled:!0,pushEnabled:!0}));return e&&await s0(s,e),t}r(O7,"enableNotificationsAfterDecision");function L7(){const{pushToast:e}=Ti(),{data:t}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),retry:!1}),s=t?.user?.id??t?.session?.userId??null;(0,x.useEffect)(()=>PE(()=>{M7()||!vx()||yx()!=="default"||(D7(),e({id:"wardmote-notify-after-decision",title:"Get notified when an agent needs a decision",body:"Turn on notifications for this device. You can change it later in Settings.",tone:"info",persistent:!0,action:{label:"Turn on",onClick:r(()=>{O7(s)},"onClick")}}))}),[e,s])}r(L7,"useFirstDecisionNotificationPrompt");var z7="wardmote-update-ready";function P7(){const{pushToast:e}=Ti(),t=I7(),s=kn(),l=y0(),c=(0,x.useRef)(l);return(0,x.useEffect)(()=>{t&&e({id:z7,title:"A new version is ready.",tone:"info",persistent:!0,action:{label:"Reload",onClick:t}})},[t,e]),(0,x.useEffect)(()=>{if(l){c.current=!0;return}c.current&&(c.current=!1,s.invalidateQueries())},[l,s]),L7(),null}r(P7,"PwaRuntime");var c2={get:r(e=>je.get(`/companies/${e}/primary-agent/me`),"get"),set:r((e,t)=>je.put(`/companies/${e}/primary-agent/me`,t),"set")};function $7(e){const t=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),s=t.data?.user?.id??t.data?.session?.userId??"local-board",l=me({queryKey:P.primaryAgent.mine(e??"__none__",s),queryFn:r(()=>c2.get(e),"queryFn"),enabled:!!e&&t.isSuccess});return{...l,userId:s,loading:!!e&&(t.isPending||l.isPending&&!t.error),error:t.error??l.error,retry:r(()=>t.isError?t.refetch():l.refetch(),"retry")}}r($7,"usePrimaryAgent");function U7({children:e}){const{selectedCompanyId:t}=vt(),s=$7(t),l=kn(),{pushToast:c}=Ti(),u=(0,x.useRef)({companyId:t,userId:s.userId});u.current={companyId:t,userId:s.userId};const p=r(j=>P.primaryAgent.mine(j.companyId,j.userId),"keyFor"),f=r(j=>j.companyId===u.current.companyId&&j.userId===u.current.userId,"isCurrentScope"),h=me({queryKey:P.agents.list(t),queryFn:r(()=>Fa.list(t),"queryFn"),enabled:!!t}),g=Bt({mutationFn:r(j=>c2.set(j.companyId,{primaryAgentId:j.agentId}),"mutationFn"),onMutate:r(async j=>{const k=p(j);await l.cancelQueries({queryKey:k});const S=l.getQueryData(k);return l.setQueryData(k,{companyId:j.companyId,userId:j.userId,primaryAgentId:j.agentId,initialized:!0}),{previous:S}},"onMutate"),onError:r((j,k,S)=>{l.setQueryData(p(k),S?.previous),f(k)&&c({title:"Couldn't change your primary agent.",body:j.message,tone:"error",action:{label:"Retry",onClick:r(()=>{f(k)&&g.mutate(k)},"onClick")}})},"onError"),onSuccess:r((j,k)=>l.setQueryData(p(k),j),"onSuccess"),onSettled:r((j,k,S)=>{l.invalidateQueries({queryKey:p(S)}),l.invalidateQueries({queryKey:P.resourceMemberships.mine(S.companyId)})},"onSettled")}),v=h.data?.find(j=>j.id===s.data?.primaryAgentId&&j.status!=="terminated")??null,y=s.error??h.error;return(0,a.jsx)(d5,{value:t?{companyId:t,primaryAgentId:v?.id??null,primaryAgent:v,loading:s.loading||h.isPending,error:y?.message,onRetry:r(()=>{s.retry(),h.refetch()},"onRetry"),pendingAgentId:g.isPending&&f(g.variables)?g.variables.agentId:null,onChange:r(j=>g.mutate({companyId:t,userId:s.userId,agentId:j}),"onChange")}:null,children:e})}r(U7,"PrimaryAgentProvider");var Dk="min-h-9",B7={default:void 0,warning:"bg-amber-500/5 text-amber-700 dark:text-amber-300",error:"bg-bad/5 text-bad",muted:"opacity-50"};function zY(e,t){const s={name:"",path:"",kind:"dir",children:[]};for(const c of Object.keys(e)){const u=c.split("/").filter(Boolean);let p=s,f="";for(let h=0;h<u.length;h++){const g=u[h];f=f?`${f}/${g}`:g;const v=h===u.length-1;let y=p.children.find(j=>j.name===g);y||(y={name:g,path:f,kind:v?"file":"dir",children:[],action:v?t?.get(c)??null:null},p.children.push(y)),p=y}}function l(c){c.children.sort((u,p)=>u.kind!==p.kind?u.kind==="file"?-1:1:u.name.localeCompare(p.name)),c.children.forEach(l)}return r(l,"sortNode"),l(s),s.children}r(zY,"buildFileTree");function K7(e){let t=0;for(const s of e)s.kind==="file"?t++:t+=K7(s.children);return t}r(K7,"countFiles");function u2(e,t="all"){const s=new Set;for(const l of e){(t==="all"||l.kind===t)&&s.add(l.path);for(const c of u2(l.children,t))s.add(c)}return s}r(u2,"collectAllPaths");function q7(e){return e.endsWith(".yaml")||e.endsWith(".yml")?U1:B1}r(q7,"fileIcon");function d2(e,t,s=0){const l=[];for(const c of e)l.push({node:c,depth:s}),c.kind==="dir"&&t.has(c.path)&&l.push(...d2(c.children,t,s+1));return l}r(d2,"flattenVisibleNodes");function F7(e,t){if(e.kind==="file")return{allChecked:t.has(e.path),someChecked:!1};const s=[...u2(e.children,"file")],l=s.length>0&&s.every(c=>t.has(c));return{allChecked:l,someChecked:s.some(c=>t.has(c))&&!l}}r(F7,"checkboxState");function PY(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return null;const s={},l=t[1],c=t[2];let u=null,p=null;for(const f of l.split(`
59
59
  `)){const h=f.trim();if(!h||h.startsWith("#"))continue;if(h.startsWith("- ")&&u){p||(p=[]),p.push(h.slice(2).trim().replace(/^["']|["']$/g,""));continue}u&&p&&(s[u]=p,p=null,u=null);const g=h.match(/^([a-zA-Z_][\w-]*)\s*:\s*(.*)$/);if(g){const v=g[1],y=g[2].trim().replace(/^["']|["']$/g,"");if(y==="null"){u=null;continue}y?(s[v]=y,u=null):u=v}}return u&&p&&(s[u]=p),Object.keys(s).length>0?{data:s,body:c}:null}r(PY,"parseFrontmatter");var $Y={name:"Name",title:"Title",kind:"Kind",reportsTo:"Reports to",skills:"Skills",status:"Status",description:"Description",priority:"Priority",assignee:"Responsible",project:"Project",recurring:"Recurring",targetDate:"Target date"};function H7({nodes:e,selectedFile:t,expandedDirs:s,checkedFiles:l,onToggleDir:c,onSelectFile:u,onToggleCheck:p,fileBadges:f,fileTones:h,renderFileExtra:g,renderLabel:v,checkboxLabel:y,getCheckboxState:j,renderNodeExtra:k,visiblePaths:S,disabled:N=!1,fileRowClassName:I,layout:C="default",showCheckboxes:M=!0,wrapLabels:R=!0,loading:_=!1,error:D,empty:U,ariaLabel:K="Files"}){const z=l??new Set,E=(0,x.useMemo)(()=>d2(e,s).filter(({node:A})=>!S||S.has(A.path)),[s,e,S]),[B,O]=(0,x.useState)(null),Q=(0,x.useRef)(new Map),V=E.some(({node:A})=>A.path===B)?B:E[0]?.node.path;function ue(A){O(A),window.requestAnimationFrame(()=>{Q.current.get(A)?.focus()})}r(ue,"focusPath");function ce(A){N||(A.kind==="dir"?c(A.path):u(A.path))}r(ce,"toggleNode");function X(A,ee,ie){if(!N)switch(A.key){case"ArrowDown":{A.preventDefault();const le=E[Math.min(ee+1,E.length-1)];le&&ue(le.node.path);break}case"ArrowUp":{A.preventDefault();const le=E[Math.max(ee-1,0)];le&&ue(le.node.path);break}case"ArrowRight":ie.kind==="dir"&&!s.has(ie.path)&&(A.preventDefault(),c(ie.path));break;case"ArrowLeft":ie.kind==="dir"&&s.has(ie.path)&&(A.preventDefault(),c(ie.path));break;case"Enter":A.preventDefault(),ce(ie);break;case" ":M&&p&&j?.(ie)!==null&&(A.preventDefault(),p(ie.path,ie.kind))}}return r(X,"handleRowKeyDown"),_?(0,a.jsx)("div",{"aria-busy":"true","aria-label":K,role:"tree",className:"py-1",children:[0,1,2,3].map(A=>(0,a.jsxs)("div",{className:Y("flex items-center gap-2 px-4",Dk),children:[(0,a.jsx)(rt,{className:"h-4 w-4 shrink-0 rounded-sm"}),(0,a.jsx)(rt,{className:Y("h-3.5",A===1?"w-3/5":"w-4/5")})]},A))}):D?(0,a.jsx)("div",{"aria-label":K,role:"tree",className:"p-3",children:(0,a.jsxs)("div",{role:"treeitem","aria-level":1,className:"flex min-h-9 items-center justify-between gap-3 rounded-md border border-bad/30 bg-bad/5 px-3 py-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)(Dn,{variant:"ghost",className:Y("px-2.5",Fd.error??"bg-bg-3 text-ink-3"),children:"error"}),(0,a.jsx)("span",{className:"min-w-0 text-bad",children:D.message})]}),D.retry&&(0,a.jsx)(oe,{type:"button",size:"xs",variant:"secondary",onClick:D.retry,children:"Retry"})]})}):E.length===0?(0,a.jsx)("div",{"aria-label":K,role:"tree",className:"p-3",children:(0,a.jsxs)("div",{className:"rounded-md border border-dashed border-line px-4 py-8 text-center",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:U?.title??"No files"}),(0,a.jsx)("div",{className:"mt-1 text-xs text-ink-3",children:U?.description??"Files will appear here when they are available."})]})}):(0,a.jsx)("div",{"aria-label":K,role:"tree",children:E.map(({node:A,depth:ee},ie)=>{const le=A.kind==="dir"&&s.has(A.path),Ae=j?.(A),de=M&&Ae!==null,{allChecked:we,someChecked:ye}=Ae==null?F7(A,z):{allChecked:Ae==="checked",someChecked:Ae==="mixed"},Me=f?.[A.path],he=h?.[A.path]??"default",ve=A.kind==="file"?I?.(A,we):void 0,et=A.kind==="file"?q7(A.name):null,Pe=A.kind==="file"&&A.path===t;return(0,a.jsxs)("div",{ref:r(Ee=>{Ee?Q.current.set(A.path,Ee):Q.current.delete(A.path)},"ref"),role:"treeitem","aria-level":ee+1,"aria-expanded":A.kind==="dir"?le:void 0,"aria-selected":A.kind==="file"?Pe:void 0,"aria-checked":de?ye?"mixed":we:void 0,"aria-disabled":N||void 0,tabIndex:V===A.path?0:-1,className:Y(C==="explorer"?"group flex w-full items-center gap-2 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 cursor-pointer":A.kind==="dir"?M?"group grid w-full grid-cols-(--gtc-2) items-center gap-x-1 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 hover:text-ink":"group grid w-full grid-cols-(--gtc-3) items-center gap-x-1 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 hover:text-ink max-[480px]:grid-cols-(--gtc-4)":"group flex w-full items-center gap-1 pr-3 text-left text-sm text-ink-3 hover:bg-bg-3/30 hover:text-ink cursor-pointer",C==="explorer"?"h-8":Dk,C==="explorer"&&"file-tree-row-explorer",Pe&&"text-ink bg-bg-3/20",B7[he],ve,N&&"opacity-50","file-tree-row","outline-none focus-visible:ring-2 focus-visible:ring-focus/50 focus-visible:ring-inset"),style:{"--file-tree-depth":ee},onFocus:r(()=>O(A.path),"onFocus"),onClick:r(()=>ce(A),"onClick"),onKeyDown:r(Ee=>X(Ee,ie,A),"onKeyDown"),"data-file-tree-path":A.path,children:[C==="explorer"&&(A.kind==="dir"?(0,a.jsx)("button",{type:"button",disabled:N,className:"flex size-4 shrink-0 items-center justify-center rounded-sm hover:text-ink focus-visible:ring-2 focus-visible:ring-focus/50",onClick:r(Ee=>{Ee.stopPropagation(),c(A.path)},"onClick"),"aria-label":le?`Collapse ${A.name}`:`Expand ${A.name}`,children:le?(0,a.jsx)(Qr,{className:"size-3.5"}):(0,a.jsx)(cr,{className:"size-3.5"})}):(0,a.jsx)("span",{className:"size-4 shrink-0","aria-hidden":"true"})),de?(0,a.jsx)("label",{className:Y("flex items-center",C==="explorer"?"size-4 shrink-0 justify-center":"pl-2"),onClick:r(Ee=>Ee.stopPropagation(),"onClick"),children:(0,a.jsx)("input",{type:"checkbox","aria-label":y?.(A)??`Select ${A.path}`,disabled:N,checked:we,ref:r(Ee=>{Ee&&(Ee.indeterminate=ye)},"ref"),onChange:r(()=>p?.(A.path,A.kind),"onChange"),className:C==="explorer"?"size-3.5 shrink-0 accent-ink":"mr-2 accent-ink"})}):M&&C==="explorer"?(0,a.jsx)("span",{className:"size-4 shrink-0","aria-hidden":"true"}):null,(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2 py-1 text-left",children:[(0,a.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:A.kind==="dir"?le?(0,a.jsx)(K1,{className:"h-3.5 w-3.5"}):(0,a.jsx)(_i,{className:"h-3.5 w-3.5"}):et?(0,a.jsx)(et,{className:"h-3.5 w-3.5"}):null}),(0,a.jsx)("span",{className:Y("min-w-0",C==="explorer"&&"flex-1",R?"break-all leading-4":"truncate"),children:v?v(A):A.name})]}),Me&&(0,a.jsx)(Dn,{variant:"ghost",className:Y("ml-3 text-(length:--text-nano) uppercase tracking-wide",Fd[Me.status]??"bg-bg-3 text-ink-3"),title:Me.tooltip,children:Me.label}),k?.(A),A.kind==="file"&&g?.(A,we),A.kind==="dir"&&C==="default"&&(0,a.jsx)("button",{type:"button",disabled:N,className:"flex h-9 w-9 items-center justify-center self-center rounded-sm text-ink-3 opacity-70 transition-(--tp-background-color-color-opacity) hover:bg-bg-3 hover:text-ink group-hover:opacity-100 focus-visible:ring-2 focus-visible:ring-focus/50 max-[480px]:hidden",onClick:r(Ee=>{Ee.stopPropagation(),c(A.path)},"onClick"),"aria-label":le?`Collapse ${A.name}`:`Expand ${A.name}`,children:le?(0,a.jsx)(Qr,{className:"h-3.5 w-3.5"}):(0,a.jsx)(cr,{className:"h-3.5 w-3.5"})})]},A.path)})})}r(H7,"FileTree");function V7(e,t){return e.visible?e.focused?t.visibleMs:t.unfocusedMs??t.visibleMs:t.hiddenMs??!1}r(V7,"resolvePollingInterval");function W7(e,t){if(e<=0)return 0;const s=Math.min(Math.max(t(),0),.999999);return Math.round(s*e)}r(W7,"computeStartupJitterMs");function Q7(e){const t=r1(),s=(0,x.useRef)(null);s.current===null&&(e.jitter===!1?s.current=0:s.current=W7(Math.min(e.jitterMaxMs??1e3,Math.round(e.visibleMs*.2)),Math.random));const l=s.current;return(0,x.useMemo)(()=>{const c=V7(t,e);return c===!1?!1:c+l},[t,e.visibleMs,e.unfocusedMs,e.hiddenMs,l])}r(Q7,"useVisibilityRefetchInterval");var G7=3e4,Y7=[];function X7(e,t=!0){const{data:s}=me({queryKey:P.pausedTasks(e??"none"),queryFn:r(()=>on.listPausedTasks(e),"queryFn"),enabled:!!e&&t,refetchInterval:r(l=>l.state.data?.some(c=>c.state==="pausing")?G7:!1,"refetchInterval")});return s??Y7}r(X7,"usePausedTasks");var f2={listForIssue:r(e=>je.get(`/issues/${e}/external-objects`),"listForIssue"),getIssueSummary:r(e=>je.get(`/issues/${e}/external-object-summary`),"getIssueSummary"),getIssueSummaries:r((e,t)=>je.post(`/companies/${e}/issues/external-object-summaries`,{issueIds:t}),"getIssueSummaries"),refreshIssueObjects:r((e,t)=>je.post(`/issues/${e}/external-objects/refresh`,t??{}),"refreshIssueObjects"),getProjectSummary:r(e=>je.get(`/projects/${e}/external-object-summary`),"getProjectSummary")};async function Z7(e,t){const s={};for(let l=0;l<t.length;l+=500){const c=t.slice(l,l+500),u=await f2.getIssueSummaries(e,c);Object.assign(s,u.summaries)}return{summaries:s}}r(Z7,"fetchIssueExternalObjectSummariesInBatches");function J7(e){switch(e.sourceKind){case"title":return"Title";case"description":return"Description";case"comment":return"Comment";case"document":return e.documentKey?`Document: ${e.documentKey}`:"Document";case"property":return e.propertyKey?`Property: ${e.propertyKey}`:"Property";case"plugin":return"Plugin";default:return"Source"}}r(J7,"formatMentionSourceLabel");function p2(){const e=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn"),retry:!1});return{isEnabled:e.data?.enableExternalObjects===!0,isLoaded:e.data!==void 0||e.isError}}r(p2,"useExternalObjectsFeature");function UY(e){const t=p2(),s=t.isEnabled&&!!e,l=me({queryKey:P.externalObjects.byIssue(e??"__none__"),queryFn:r(()=>f2.listForIssue(e),"queryFn"),enabled:s,staleTime:6e4}),c=(0,x.useMemo)(()=>(l.data??[]).filter(f=>!!f.object).map(f=>{const h=f.object,g=f.sourceLabels&&f.sourceLabels.length>0?f.sourceLabels:Array.from(new Set(f.mentions.map(J7)));return{group:f,mentionCount:f.mentionCount??f.mentions.length,sourceLabels:g,pill:{providerKey:h.providerKey,objectType:h.objectType,displayKey:h.displayKey,iconKey:h.iconKey,statusCategory:h.statusCategory,liveness:h.liveness,displayTitle:h.displayTitle,statusLabel:h.statusLabel,statusIconKey:h.statusIconKey,url:h.sanitizedCanonicalUrl}}}),[l.data]),u=(0,x.useMemo)(()=>{const f={};for(const{group:h}of c){const g=h.object;if(!g)continue;const v=qy(g.sanitizedCanonicalUrl??null);v&&(f[v]={providerKey:g.providerKey,objectType:g.objectType,displayKey:g.displayKey,iconKey:g.iconKey,statusCategory:g.statusCategory,liveness:g.liveness,statusLabel:g.statusLabel,statusIconKey:g.statusIconKey,displayTitle:g.displayTitle});for(const y of h.mentions){const j=qy(y.sanitizedDisplayUrl??null);j&&!f[j]&&(f[j]={providerKey:g.providerKey,objectType:g.objectType,displayKey:g.displayKey,iconKey:g.iconKey,statusCategory:g.statusCategory,liveness:g.liveness,statusLabel:g.statusLabel,statusIconKey:g.statusIconKey,displayTitle:g.displayTitle})}}return f},[c]),p=(0,x.useCallback)(()=>{l.refetch()},[l.refetch]);return{isEnabled:t.isEnabled,groups:c,markdownReferences:u,isLoading:s&&l.isLoading,isError:l.isError,refetch:p}}r(UY,"useIssueExternalObjects");function e9(e,t){const s=p2(),l=(0,x.useMemo)(()=>[...new Set(t.filter(p=>p.length>0))].sort(),[t]),c=s.isEnabled&&!!e&&l.length>0,u=me({queryKey:P.externalObjects.issueSummaries(e??"__none__",l),queryFn:r(()=>Z7(e,l),"queryFn"),enabled:c,staleTime:6e4});return{summaries:(0,x.useMemo)(()=>new Map(Object.entries(u.data?.summaries??{})),[u.data?.summaries]),isLoading:c&&u.isLoading,isReady:s.isLoaded&&(!c||u.isSuccess)}}r(e9,"useIssueExternalObjectSummaries");var BY={relevance:"Relevance",updated:"Recently updated",created:"Newest created",priority:"Priority"},t9={"24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days","90d":"Last 90 days"};function m2(e){return t9[e]??`Updated ≤ ${e}`}r(m2,"updatedWithinLabel");var n9=new Set(jE);function KY(e){const t=e.get("sort");return t&&n9.has(t)?t:"relevance"}r(KY,"parseSearchSort");function qY(e){let t=0;return e.status?.length&&(t+=1),e.priority?.length&&(t+=1),(e.assigneeAgentId!==void 0||e.assigneeUserId)&&(t+=1),e.projectId&&(t+=1),e.labelId&&(t+=1),(e.updatedWithin||e.updatedAfter)&&(t+=1),t}r(qY,"countActiveFilters");function FY(e,t){if(e.assigneeAgentId===null)return"none";if(typeof e.assigneeAgentId=="string")return`agent:${e.assigneeAgentId}`;if(e.assigneeUserId)return e.assigneeUserId===t?"me":`user:${e.assigneeUserId}`}r(FY,"assigneeToken");function HY(e,t,s){const l={...e};return delete l.assigneeAgentId,delete l.assigneeUserId,t&&(t==="none"?l.assigneeAgentId=null:t==="me"?s&&(l.assigneeUserId=s):t.startsWith("agent:")?l.assigneeAgentId=t.slice(6):t.startsWith("user:")&&(l.assigneeUserId=t.slice(5))),l}r(HY,"applyAssigneeToken");function Sc(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(Sc,"humanize$1");function a9(e,t){return e.assigneeAgentId===null?"Unassigned":typeof e.assigneeAgentId=="string"?t.agentName(e.assigneeAgentId)??"Agent":e.assigneeUserId?e.assigneeUserId===t.currentUserId?"Me":t.userName(e.assigneeUserId)??"User":"Assignee"}r(a9,"assigneeChipLabel");function VY(e,t){const s=[];for(const l of e.status??[])s.push({id:`status:${l}`,label:`Status: ${Sc(l)}`,remove:r(c=>{const u={...c},p=(c.status??[]).filter(f=>f!==l);return p.length>0?u.status=p:delete u.status,u},"remove")});for(const l of e.priority??[])s.push({id:`priority:${l}`,label:`Priority: ${Sc(l)}`,remove:r(c=>{const u={...c},p=(c.priority??[]).filter(f=>f!==l);return p.length>0?u.priority=p:delete u.priority,u},"remove")});return(e.assigneeAgentId!==void 0||e.assigneeUserId)&&s.push({id:"assignee",label:`Assignee: ${a9(e,t)}`,remove:r(l=>{const c={...l};return delete c.assigneeAgentId,delete c.assigneeUserId,c},"remove")}),e.projectId&&s.push({id:"project",label:`Project: ${t.projectName(e.projectId)??"Project"}`,remove:r(l=>{const c={...l};return delete c.projectId,c},"remove")}),e.labelId&&s.push({id:"label",label:`Label: ${t.labelName(e.labelId)??"Label"}`,remove:r(l=>{const c={...l};return delete c.labelId,c},"remove")}),e.updatedWithin&&s.push({id:"updated",label:`Updated: ${m2(e.updatedWithin)}`,remove:r(l=>{const c={...l};return delete c.updatedWithin,delete c.updatedAfter,c},"remove")}),s}r(VY,"buildFilterChips");function WY(e,t,s){switch(e){case"status":return`Status: ${t.map(Sc).join(", ")}`;case"priority":return`Priority: ${t.map(Sc).join(", ")}`;case"assigneeAgentId":return`Assignee: ${t.map(l=>s.agentName(l)??"Agent").join(", ")}`;case"assigneeUserId":return`Assignee: ${t.map(l=>l===s.currentUserId?"Me":s.userName(l)??"User").join(", ")}`;case"projectId":return`Project: ${t.map(l=>s.projectName(l)??"Project").join(", ")}`;case"labelId":return`Label: ${t.map(l=>s.labelName(l)??"Label").join(", ")}`;case"updatedWithin":case"updatedAfter":return"Updated window";default:return Sc(e)}}r(WY,"describeLoosenSuggestion");function QY(e,t){const s={...e};switch(t){case"status":delete s.status;break;case"priority":delete s.priority;break;case"assigneeAgentId":case"assigneeUserId":delete s.assigneeAgentId,delete s.assigneeUserId;break;case"projectId":delete s.projectId;break;case"labelId":delete s.labelId;break;case"updatedWithin":case"updatedAfter":delete s.updatedWithin,delete s.updatedAfter}return s}r(QY,"clearFilterDimension");var s9='Search title, ID, description… (pick a field or type "exact phrase")';function Ok(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(Ok,"humanize");function Hh(e,t,s,l=""){const c=t?t.kind==="text"&&s.trim()?Hr(t.key,s):"":s;return[...e,l,c].filter(u=>u.trim().length>0).join(" ")}r(Hh,"composeRaw");function i9(e,t){typeof e=="function"?e(t):e&&(e.current=t)}r(i9,"assignRef");function Lk(e,t,s){const l=!!(t.currentUserId||t.currentAgentId);switch(e){case"status":return[...Bc.map(c=>({id:c,label:Ok(c),token:`status:${c}`})),...s.includes("is")?[{id:"is:open",label:"Open",description:"Any open status",token:"is:open"},{id:"is:closed",label:"Closed",description:"Done or cancelled",token:"is:closed"}]:[]];case"priority":return h0.map(c=>({id:c,label:Ok(c),token:`priority:${c}`}));case"assignee":return[...l?[{id:"me",label:"Me",token:"assignee:me"}]:[],{id:"none",label:"Unassigned",token:"assignee:none"},...(t.agents??[]).map(c=>({id:c.id,label:c.name,token:Hr("assignee",c.name)}))];case"author":return[...l?[{id:"me",label:"Me",token:"author:me"}]:[],...(t.agents??[]).map(c=>({id:c.id,label:c.name,token:Hr("author",c.name)}))];case"label":return(t.labels??[]).map(c=>({id:c.id,label:c.name,token:Hr("label",c.name)}));case"project":return(t.projects??[]).map(c=>({id:c.id,label:c.name,token:Hr("project",c.name)}));case"updated":return Jk.map(c=>({id:c,label:m2(c),token:`updated:>${c}`}));default:return[]}}r(Lk,"pickerOptions");function r9(e,t){if(!t)return e;const s=[],l=[];for(const c of e){const u=c.label.toLowerCase();u.startsWith(t)||c.id.toLowerCase().startsWith(t)?s.push(c):u.includes(t)&&l.push(c)}return[...s,...l]}r(r9,"rankOptions");function l9({value:e,onChange:t,context:s={},operatorKeys:l=nA,debounceMs:c=250,placeholder:u=s9,ariaLabel:p="Search",className:f,fieldClassName:h,inputClassName:g,clearOnEscape:v=!1,inputRef:y,autoFocus:j,pageSearchTarget:k,trailing:S,onKeyDown:N}){const I=(0,x.useId)(),C=(0,x.useRef)(null),[M,R]=(0,x.useState)(()=>uc(e,l).tokens),[_,D]=(0,x.useState)(()=>uc(e,l).text),[U,K]=(0,x.useState)(null),[z,E]=(0,x.useState)(""),[B,O]=(0,x.useState)(!1),[Q,V]=(0,x.useState)(-1),ue=(0,x.useRef)(e),ce=(0,x.useRef)(s);ce.current=s;const X=(0,x.useRef)(t);X.current=t;const A=(0,x.useRef)(l);A.current=l;const ee=(0,x.useMemo)(()=>sP.filter(ge=>ge.kind==="text"||l.includes(ge.key)),[l]),ie=Hh(M,U,_,U?z:"");(0,x.useEffect)(()=>{if(e===ue.current)return;ue.current=e;const ge=uc(e,A.current);R(ge.tokens),D(ge.text),K(null),E("")},[e]);const le=(0,x.useCallback)(ge=>{ue.current=ge;const Oe=uo(ge,{...ce.current,operatorKeys:A.current}),De={raw:ge,q:Oe.query,filters:Oe.filters};c<=0?X.current(De):(0,x.startTransition)(()=>X.current(De))},[c]);(0,x.useEffect)(()=>{if(ie===ue.current)return;if(c<=0){le(ie);return}const ge=window.setTimeout(()=>{ie!==ue.current&&le(ie)},c);return()=>window.clearTimeout(ge)},[c,le,ie]);const Ae=(0,x.useCallback)(ge=>ee.find(Oe=>Oe.key===ge.toLowerCase())??null,[ee]),de=(0,x.useMemo)(()=>{if(U){if(U.kind==="text")return[];const De=_.trim().replace(/"/g,"").toLowerCase();return r9(Lk(U.key,s,l),De)}const{token:ge}=yh(_);if(ge.includes(":")||ge.startsWith('"'))return[];const Oe=ge.toLowerCase();return ee.filter(De=>!Oe||De.key.startsWith(Oe)||De.label.toLowerCase().startsWith(Oe)).map(De=>({id:De.key,label:De.label,description:De.description,field:De}))},[s,_,ee,l,U]),we=B&&de.length>0;(0,x.useEffect)(()=>{V(U&&U.kind==="picker"?0:-1)},[U,_]);const ye=r(()=>C.current?.focus(),"focusInput"),Me=r((ge,Oe)=>{E(Oe.trim()),K(ge),D(""),O(!0),ye()},"startField"),he=r(()=>{K(null),D(z?`${z} `:""),E("")},"releaseHeldText"),ve=r((ge,Oe=!0)=>{R(De=>[...De,ge]),he(),O(Oe),ye()},"commitToken"),et=r((ge,Oe=!0)=>{if(ge.field){Me(ge.field,_.slice(0,yh(_).start));return}ge.token&&ve(ge.token,Oe)},"selectOption"),Pe=r(ge=>{const Oe=/\s$/.test(ge);if(Oe&&O(!0),U){D(ge);return}const{start:De,token:ut}=yh(ge),Ht=/^([a-zA-Z]+):$/.exec(ut),Vt=Ht?Ae(Ht[1]):null;if(Vt){Me(Vt,ge.slice(0,De));return}const gt=uc(ge,l,!Oe);if(gt.tokens.length>0){R(cn=>[...cn,...gt.tokens]),D(gt.text&&Oe?`${gt.text} `:gt.text);return}D(ge)},"handleDraftChange"),Ee=r(ge=>{R(Oe=>Oe.filter((De,ut)=>ut!==ge)),ye()},"removeToken"),ct=r(()=>{if(!U)return!1;const ge=_.trim();if(!ge)return!1;if(U.kind==="text")return ve(Hr(U.key,ge)),!0;const Oe=ge.toLowerCase(),De=Lk(U.key,s,l).find(ut=>ut.label.toLowerCase()===Oe||ut.id.toLowerCase()===Oe)??(we&&Q>=0?de[Q]:void 0)??(de.length===1?de[0]:void 0);return De?.token?(ve(De.token),!0):!1},"commitPendingDraft"),Ve=r(ge=>{const Oe=ge.nativeEvent.isComposing;if(!Oe&&ge.key==="Tab"&&!ge.shiftKey&&(U||we)){if(ge.preventDefault(),ct())return;if(!U&&we&&Q>=0&&de[Q]){et(de[Q]);return}U||O(!1);return}if(!Oe&&ge.key==="ArrowDown"){if(ge.preventDefault(),!B){O(!0);return}de.length>0&&V(De=>(De+1)%de.length);return}if(!Oe&&ge.key==="ArrowUp"&&we){ge.preventDefault(),V(De=>De<=0?de.length-1:De-1);return}if(!Oe&&ge.key==="Enter"){if(we&&Q>=0&&de[Q]){ge.preventDefault(),et(de[Q],!1);return}let De=ie;if(U?.kind==="text"&&_.trim()){const ut=Hr(U.key,_.trim());ve(ut,!1),De=Hh([...M,ut],null,z)}else if(!U){const ut=uc(_,l);ut.tokens.length>0&&(R([...M,...ut.tokens]),D(ut.text),De=Hh([...M,...ut.tokens],null,ut.text))}De!==ue.current&&le(De),O(!1)}if(!Oe&&ge.key==="Escape"&&we&&(O(!1),_.length>0||U)){ge.preventDefault();return}if(!Oe&&ge.key==="Escape"&&v&&ie.length>0){ge.preventDefault(),R([]),K(null),E(""),D(""),ue.current="",X.current({raw:"",q:"",filters:{}});return}if(!Oe&&ge.key==="Backspace"&&ge.currentTarget.selectionStart===0&&ge.currentTarget.selectionEnd===0){if(U){ge.preventDefault(),he();return}if(M.length>0){ge.preventDefault(),R(De=>De.slice(0,-1));return}}N?.(ge)},"handleKeyDown"),yt=M.map(ge=>oP(ge,s)),Zt=U?U.kind==="text"?`${U.label}: type text, Tab or Enter to add`:`Pick ${U.label.toLowerCase()}…`:M.length>0?"":u;return(0,a.jsxs)("div",{className:Y("relative",f),"data-testid":"scoped-search",children:[(0,a.jsxs)("div",{className:Y("flex h-8 w-full min-w-0 items-center gap-1 overflow-x-auto rounded-md border border-line-strong bg-transparent pl-7 pr-1 shadow-xs focus-within:border-focus focus-within:ring-(length:--rad-3) focus-within:ring-focus/50 dark:bg-line-strong/30",h),onMouseDown:r(ge=>{ge.target===ge.currentTarget&&(ge.preventDefault(),ye())},"onMouseDown"),children:[(0,a.jsx)(fr,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),yt.map((ge,Oe)=>(0,a.jsxs)(Dn,{variant:"secondary",className:"max-w-56 gap-1 pr-0.5 font-normal","data-testid":"scoped-search-pill",children:[(0,a.jsx)("span",{className:"truncate",children:ge.label}),(0,a.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg/60","aria-label":`Remove ${ge.label}`,onMouseDown:r(De=>De.preventDefault(),"onMouseDown"),onClick:r(()=>Ee(Oe),"onClick"),children:(0,a.jsx)(ia,{className:"h-3 w-3"})})]},`${M[Oe]}:${Oe}`)),U?(0,a.jsxs)(Dn,{variant:"outline",className:"gap-1 pr-0.5 font-normal","data-testid":"scoped-search-pending-field",children:[(0,a.jsxs)("span",{children:[U.key,":"]}),(0,a.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg-3","aria-label":`Remove ${U.label} field`,onMouseDown:r(ge=>ge.preventDefault(),"onMouseDown"),onClick:r(()=>{he(),ye()},"onClick"),children:(0,a.jsx)(ia,{className:"h-3 w-3"})})]}):null,(0,a.jsx)("input",{ref:r(ge=>{C.current=ge,i9(y,ge)},"ref"),role:"combobox","aria-label":p,"aria-expanded":we,"aria-controls":I,"aria-autocomplete":"list","aria-activedescendant":we&&Q>=0?`${I}-${Q}`:void 0,autoFocus:j,value:_,placeholder:Zt,"data-page-search-target":k?"true":void 0,className:Y("h-full min-w-24 flex-1 bg-transparent text-base outline-none placeholder:text-ink-3 md:text-sm",g),onChange:r(ge=>Pe(ge.target.value),"onChange"),onFocus:r(()=>O(!0),"onFocus"),onBlur:r(()=>O(!1),"onBlur"),onKeyDown:Ve}),S]}),we?(0,a.jsx)("div",{id:I,role:"listbox","aria-label":U?`${U.label} values`:"Search fields",className:"absolute left-0 top-full z-50 mt-1 max-h-64 w-full min-w-56 overflow-y-auto rounded-md border border-line bg-bg-2 p-1 text-ink shadow-md","data-testid":"scoped-search-options",children:de.map((ge,Oe)=>(0,a.jsxs)("div",{id:`${I}-${Oe}`,role:"option","aria-selected":Oe===Q,className:Y("flex cursor-pointer items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-sm",Oe===Q?"bg-bg-3 text-ink":"hover:bg-bg-3/50"),onMouseDown:r(De=>De.preventDefault(),"onMouseDown"),onMouseEnter:r(()=>V(Oe),"onMouseEnter"),onClick:r(()=>et(ge),"onClick"),children:[(0,a.jsx)("span",{className:"truncate",children:ge.label}),ge.description?(0,a.jsx)("span",{className:"hidden truncate text-xs text-ink-3 sm:inline",children:ge.description}):null]},ge.id))}):null]})}r(l9,"ScopedSearchInput");function h2(e){if(e.length<=1)return[...e];const t=r((v,y)=>{const j=zk(v.createdAt),k=zk(y.createdAt);return j!==k?j-k:v.id<y.id?-1:v.id>y.id?1:0},"tieBreakAsc"),s=new Map;for(const v of e)s.set(v.id,v);const l=new Map,c=new Map;for(const v of e)l.set(v.id,[]),c.set(v.id,0);for(const v of e){const y=new Set;for(const j of v.blockedBy??[])!j||!s.has(j.id)||j.id!==v.id&&(y.has(j.id)||(y.add(j.id),l.get(j.id).push(v.id),c.set(v.id,(c.get(v.id)??0)+1)))}for(const v of l.values())v.sort((y,j)=>t(s.get(y),s.get(j)));const u=[];for(const v of e)c.get(v.id)===0&&u.push(v);u.sort(t);const p=new Set,f=[],h=r(v=>{let y=0,j=u.length;for(;y<j;){const k=y+j>>>1;t(u[k],v)<=0?y=k+1:j=k}u.splice(y,0,v)},"insertReady"),g=r(v=>{for(const y of l.get(v)??[]){if(p.has(y))continue;const j=(c.get(y)??0)-1;if(c.set(y,j),j===0){const k=s.get(y);k&&h(k)}}},"releaseSuccessors");for(;u.length>0;){let v=u.shift();for(;v&&!p.has(v.id);){f.push(v),p.add(v.id),g(v.id);const y=l.get(v.id)??[];if(y.length!==1)break;const j=y[0];if(p.has(j)||(c.get(j)??0)!==0)break;const k=u.findIndex(S=>S.id===j);if(k<0)break;[v]=u.splice(k,1)}}return p.size<e.length?[...e].sort(t):f}r(h2,"workflowSort");function zk(e){if(!e)return 0;const t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:0}r(zk,"toTimestamp");var o9=2;function c9(e,t){return e===!0&&t>=o9}r(c9,"shouldRenderSubIssueProgressSummary");function u9(e){const t={},s=e.filter(f=>f.status!=="cancelled");for(const f of s)t[f.status]=(t[f.status]??0)+1;const l=h2(s),c=l.find(f=>d9(f.status))??null,u=l.filter(f=>!f9(f.status)),p=c===null&&u.length>0&&u.every(f=>f.status==="blocked")?u[0]:null;return{totalCount:s.length,doneCount:t.done??0,inProgressCount:t.in_progress??0,blockedCount:t.blocked??0,countsByStatus:t,target:c?{issue:c,kind:"next"}:p?{issue:p,kind:"blocked"}:null}}r(u9,"buildSubIssueProgressSummary");function d9(e){return e!=="done"&&e!=="cancelled"&&e!=="blocked"}r(d9,"isActionableStatus");function f9(e){return e==="done"||e==="cancelled"}r(f9,"isTerminalStatus");function Gl(e,t){const s={};for(const l of e){const c=t(l);s[c]||(s[c]=[]),s[c].push(l)}return s}r(Gl,"groupBy");function p9(e){return e==="queued"||e==="running"}r(p9,"isLiveRunStatus");var m9=new Set(["done","cancelled"]);function l0(e){return m9.has(e)}r(l0,"isTerminalIssueStatus");function mo(e,t){return p9(e.status)&&!l0(t)}r(mo,"isLiveIssueRun");function h9(e){const t=new Map;for(const s of e??[]){const l={status:s.status,updatedAtMs:g9(s.updatedAt)},c=t.get(s.id);(!c||x9(c,l))&&t.set(s.id,l)}return new Map([...t].map(([s,l])=>[s,l.status]))}r(h9,"collectIssueStatusById");function g9(e){if(e==null)return null;const t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:null}r(g9,"issueUpdatedAtMs");function x9(e,t){if(t.updatedAtMs!==null&&e.updatedAtMs!==null){if(t.updatedAtMs!==e.updatedAtMs)return t.updatedAtMs>e.updatedAtMs}else{if(t.updatedAtMs!==null)return!0;if(e.updatedAtMs!==null)return!1}return!l0(e.status)&&l0(t.status)}r(x9,"shouldReplaceIssueStatusSnapshot");function b9(e,t){const s=new Set,l=h9(t);for(const c of e??[])c.issueId&&mo(c,l.get(c.issueId))&&s.add(c.issueId);return s}r(b9,"collectLiveIssueIds");function g2(e,t){const s=new Map;if(!e||e.length===0||t.size===0)return s;const l=new Map;for(const c of e)l.set(c.id,c.parentId);for(const c of t){if(!l.has(c))continue;const u=new Set([c]);let p=l.get(c)??null;for(;p&&!u.has(p);)u.add(p),s.set(p,(s.get(p)??0)+1),p=l.get(p)??null}return s}r(g2,"collectSubtreeLiveCounts");function v9(e){return(0,a.jsxs)("svg",{viewBox:"0 0 180 180",fill:"none",stroke:"currentColor",strokeWidth:14,strokeLinecap:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,a.jsx)("path",{d:"M18 84.8528L85.8822 16.9706C95.2548 7.59798 110.451 7.59798 119.823 16.9706C129.196 26.3431 129.196 41.5391 119.823 50.9117L68.5581 102.177"}),(0,a.jsx)("path",{d:"M69.2652 101.47L119.823 50.9117C129.196 41.5391 144.392 41.5391 153.765 50.9117L154.118 51.2652C163.491 60.6378 163.491 75.8338 154.118 85.2063L92.7248 146.6C89.6006 149.724 89.6006 154.789 92.7248 157.913L105.331 170.52"}),(0,a.jsx)("path",{d:"M102.853 33.9411L52.6482 84.1457C43.2756 93.5183 43.2756 108.714 52.6482 118.087C62.0208 127.459 77.2167 127.459 86.5893 118.087L136.794 67.8822"})]})}r(v9,"McpIcon");var y9=new Set(["tool","tool call","tool_call","acp_tool"]);function Bd(e){const t=(e??"").trim().toLowerCase().replace(/\s*\((?:pending|in[_ -]?progress|completed|failed|cancelled|canceled)\)$/,"");return!t||y9.has(t)}r(Bd,"isGenericToolName");function x2(e){const t=e.match(/^mcp__(.+?)__(.+)$/i);if(t)return{namespace:t[1],name:t[2]};const s=e.match(/^mcp\.([^.]+)\.(.+)$/i);return s?{namespace:s[1],name:s[2]}:null}r(x2,"mcpToolIdentity");function kx(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[^A-Za-z0-9]+/g," ").trim().toLowerCase().split(/\s+/).filter(Boolean)}r(kx,"identifierWords");function b2(e){if(e.length===0)return"";const t=e.map(s=>["api","id","lsp","mcp","pr","url"].includes(s)?s.toUpperCase():s).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}r(b2,"sentenceCase");function Pk(e){const t=(e??"").trim();return Bd(t)?"Unnamed tool":b2(kx(x2(t)?.name??t))}r(Pk,"humanizeToolName");var va=r((e,t,s)=>({key:e,singular:t,plural:s}),"group"),j9={bash:{action:"run"},terminal:{action:"run"},shell:{action:"run"},command:{action:"run"},run:{action:"run"},execute:{action:"run"},exec_command:{action:"run"},apply_patch:{action:"update",running:"Applying a patch",completed:"Applied a patch"},read:{action:"read",running:"Reading a file",completed:"Read a file"},write:{action:"update",running:"Writing a file",completed:"Wrote a file"},edit:{action:"update",running:"Editing a file",completed:"Edited a file"},notebook_read:{action:"read",running:"Reading a notebook",completed:"Read a notebook"},notebook_edit:{action:"update",running:"Editing a notebook",completed:"Edited a notebook"},glob:{action:"search",running:"Searching files",completed:"Searched files"},grep:{action:"search",running:"Searching file contents",completed:"Searched file contents",family:"grep"},tool_search:{action:"search",running:"Searching available tools",completed:"Searched available tools",group:va("tool_search","tool search","tool searches")},web_search:{action:"search",running:"Searching the web",completed:"Searched the web",family:"web"},web_fetch:{action:"fetch",running:"Fetching a web page",completed:"Fetched a web page",family:"web"},todo_write:{action:"update",running:"Updating the task list",completed:"Updated the task list",family:"plan",group:va("task_operation","task operation","task operations")},task_create:{action:"create",running:"Creating a task",completed:"Created a task",family:"plan",group:va("task_operation","task operation","task operations")},task_update:{action:"update",running:"Updating a task",completed:"Updated a task",family:"plan",group:va("task_operation","task operation","task operations")},task_list:{action:"list",running:"Listing tasks",completed:"Listed tasks",family:"plan",group:va("task_operation","task operation","task operations")},task_get:{action:"read",running:"Reading a task",completed:"Read a task",family:"plan",group:va("task_operation","task operation","task operations")},enter_plan_mode:{action:"switch",running:"Entering plan mode",completed:"Entered plan mode",family:"plan"},exit_plan_mode:{action:"switch",running:"Leaving plan mode",completed:"Left plan mode",family:"plan"},skill:{action:"read",running:"Loading a skill",completed:"Loaded a skill"},ask_user_question:{action:"request",running:"Requesting input",completed:"Requested input",family:"question"},request_human_input:{action:"request",running:"Requesting input",completed:"Requested input",family:"question",group:va("task_operation","task operation","task operations")},agent:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},task:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},task_output:{action:"read",running:"Checking subagent progress",completed:"Checked subagent progress",family:"agent"},task_stop:{action:"stop",running:"Stopping a subagent",completed:"Stopped a subagent",family:"agent"},send_message:{action:"post",running:"Messaging a subagent",completed:"Messaged a subagent",family:"agent"},spawn_agent:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},wait_agent:{action:"wait",running:"Checking subagent progress",completed:"Checked subagent progress",family:"agent"},wait_threads:{action:"wait",running:"Checking task progress",completed:"Checked task progress",family:"agent"},interrupt_agent:{action:"stop",running:"Interrupting a subagent",completed:"Interrupted a subagent",family:"agent"},report_findings:{action:"post",running:"Reporting findings",completed:"Reported findings",family:"safety"},guardian_review:{action:"think",running:"Reviewing safety",completed:"Reviewed safety",family:"safety"},lsp:{action:"read",running:"Inspecting code intelligence",completed:"Inspected code intelligence"},compact_conversation:{action:"think",running:"Compacting context",completed:"Compacted context"},image_generation:{action:"create",running:"Generating an image",completed:"Generated an image",family:"image"},view_image:{action:"read",running:"Viewing an image",completed:"Viewed an image",family:"image"},multi_tool_use_parallel:{action:"run",running:"Running tools in parallel",completed:"Ran tools in parallel"},get_task_context:{action:"read",running:"Reading task context",completed:"Read task context"},get_task_history:{action:"read",running:"Reading task history",completed:"Read task history"},list_documents:{action:"list",running:"Listing documents",completed:"Listed documents"},read_document:{action:"read",running:"Reading a document",completed:"Read a document"},list_document_revisions:{action:"list",running:"Listing document revisions",completed:"Listed document revisions"},report_progress:{action:"post",running:"Reporting progress",completed:"Reported progress"},answer_status_question:{action:"post",running:"Answering a status question",completed:"Answered a status question"},write_document:{action:"update",running:"Writing a document",completed:"Wrote a document"},register_deliverable:{action:"create",running:"Registering a deliverable",completed:"Registered a deliverable"},finish_task:{action:"finish",running:"Reporting completion",completed:"Reported completion"},wardmote_finish:{action:"finish",running:"Reporting completion",completed:"Reported completion"},block_task:{action:"block",running:"Reporting a blocker",completed:"Reported a blocker"},wardmote_block:{action:"block",running:"Reporting a blocker",completed:"Reported a blocker"},request_review:{action:"request",running:"Requesting review",completed:"Requested review"},list_agents:{action:"list",running:"Listing agents",completed:"Listed agents"},get_agent:{action:"read",running:"Reading agent details",completed:"Read agent details"},search_tasks:{action:"search",running:"Searching tasks",completed:"Searched tasks"},list_approvals:{action:"list",running:"Listing approvals",completed:"Listed approvals"},get_approval:{action:"read",running:"Reading an approval",completed:"Read an approval"},get_approval_context:{action:"read",running:"Reading approval context",completed:"Read approval context"},get_workspace_runtime:{action:"read",running:"Reading workspace status",completed:"Read workspace status"},control_workspace_service:{action:"run",running:"Controlling a workspace service",completed:"Controlled a workspace service"},set_dependencies:{action:"update",running:"Updating task dependencies",completed:"Updated task dependencies"},set_task_title:{action:"update",running:"Naming the task",completed:"Named the task"},create_task:{action:"create",running:"Creating a task",completed:"Created a task"},request_approval:{action:"request",running:"Requesting approval",completed:"Requested approval"},decide_approval:{action:"update",running:"Deciding an approval",completed:"Decided an approval"},comment_on_approval:{action:"post",running:"Commenting on an approval",completed:"Commented on an approval"},schedule_wake:{action:"create",running:"Scheduling a wake-up",completed:"Scheduled a wake-up",family:"wait"},generic_api_request:{action:"request",running:"Calling the Wardmote API",completed:"Called the Wardmote API"}},w9={read:["get","read","inspect","view"],list:["list","glob"],search:["find","search","grep","query","lookup"],fetch:["fetch","browse"],open:["open"],update:["write","edit","update","set","patch","upsert","sync"],create:["create","add","register","upload"],delete:["delete","remove"],move:["move","rename"],run:["run","execute","bash","shell","command"],request:["request","ask","prompt"],post:["send","message","comment","report","answer"],start:["start","spawn","delegate"],stop:["stop","cancel","interrupt"],wait:["wait","sleep","poll"],finish:["finish","complete"],block:["block"],think:["think","reason","compact","review"],switch:["switch","enter","exit"],other:[]},k9={read:"read",edit:"update",delete:"delete",move:"move",search:"search",list:"list",execute:"run",think:"think",fetch:"fetch",switch_mode:"switch"};function S9(e){return kx(e).join("_")}r(S9,"normalizedKey");function N9(e){const t=e[0];if(!t)return null;for(const[s,l]of Object.entries(w9))if(l.includes(t))return s;return null}r(N9,"inferredAction");function C9(e){return e==="run"?"terminal":e==="read"||e==="list"?"read":e==="search"?"search":e==="fetch"||e==="open"?"web":["update","create","delete","move"].includes(e)?"edit":e==="request"?"question":e==="start"||e==="stop"?"agent":e==="wait"?"wait":"other"}r(C9,"actionFamily");var A9={terminal:W1,grep:_R,search:fr,read:R1,edit:dR,web:lR,plan:DS,question:ag,agent:F1,safety:Cc,image:bR,wait:xS,mcp:v9,other:Ef};function _9(e,t){const s=t?` ${t}`:"";switch(e){case"read":return{running:`Reading${s||" data"}`,completed:`Read${s||" data"}`};case"list":return{running:`Listing${s||" items"}`,completed:`Listed${s||" items"}`};case"search":return{running:`Searching${s||""}`,completed:`Searched${s||""}`};case"fetch":return{running:`Fetching${s||" data"}`,completed:`Fetched${s||" data"}`};case"open":return{running:`Opening${s||" an item"}`,completed:`Opened${s||" an item"}`};case"update":return{running:`Updating${s||" data"}`,completed:`Updated${s||" data"}`};case"create":return{running:`Creating${s||" an item"}`,completed:`Created${s||" an item"}`};case"delete":return{running:`Deleting${s||" an item"}`,completed:`Deleted${s||" an item"}`};case"move":return{running:`Moving${s||" an item"}`,completed:`Moved${s||" an item"}`};case"run":return{running:"Running a command",completed:"Ran a command"};case"request":return{running:`Requesting${s||" input"}`,completed:`Requested${s||" input"}`};case"post":return{running:`Posting${s||" an update"}`,completed:`Posted${s||" an update"}`};case"start":return{running:`Starting${s||" an operation"}`,completed:`Started${s||" an operation"}`};case"stop":return{running:`Stopping${s||" an operation"}`,completed:`Stopped${s||" an operation"}`};case"wait":return{running:"Waiting",completed:"Finished waiting"};case"finish":return{running:"Reporting completion",completed:"Reported completion"};case"block":return{running:"Reporting a blocker",completed:"Reported a blocker"};case"think":return{running:"Thinking",completed:"Finished thinking"};case"switch":return{running:`Switching${s||" mode"}`,completed:`Switched${s||" mode"}`};case"other":return{running:"Running",completed:"Ran"}}}r(_9,"actionCopy");function E9(e){switch(e){case"run":return va("command","command","commands");case"read":case"list":return va("read","read","reads");case"search":return va("search","search","searches");case"update":case"create":case"delete":case"move":return va("file_change","file change","file changes");case"start":case"stop":return va("delegation","delegation","delegations");case"wait":return va("wait","wait","waits");default:return va("tool_action","tool action","tool actions")}}r(E9,"defaultSummaryGroup");function I9(e){return e==="read"||e==="list"?va("wardmote_read","Wardmote read","Wardmote reads"):va("task_operation","task operation","task operations")}r(I9,"wardmoteSummaryGroup");function T9(e){const t=(e.name??"").trim(),s=x2(t),l=(e.namespace??s?.namespace??"").trim(),c=(s?"mcp":e.transport??"builtin").toLowerCase(),u=(s?.name??t).trim(),p=kx(u),f=S9(u),h=j9[f],g=k9[(e.operation??"").trim().toLowerCase()],v=N9(p),y=h?.action??g??v??"other",j=h?"exact":g?"kind":v?"inferred":Bd(u)?"unnamed":"fallback",k=Bd(u)?"Unnamed tool":Pk(u),S=/^[A-Za-z][A-Za-z0-9_.:-]*$/.test(u),N=v&&S&&p.length>1?p.slice(1):[],I=N.length?b2(N).replace(/^./,U=>U.toLowerCase()):void 0,C=h?.running&&h.completed?{running:h.running,completed:h.completed}:y==="other"?Bd(u)?{running:"Running an unnamed tool",completed:"Ran an unnamed tool"}:{running:`Running ${k}`,completed:`Ran ${k}`}:_9(y,h?void 0:I),M=h?.family??C9(y),R=c==="mcp"?"mcp":M,_=l?Pk(l):c==="mcp"?"MCP":void 0,D=l.toLowerCase()==="wardmote"?I9(y):h?.group??E9(y);return{icon:A9[R],family:R,runningLabel:C.running,completedLabel:C.completed,failedLabel:`${C.completed} · failed`,interruptedLabel:`${C.running} · stopped`,displayName:k,sourceLabel:_,technicalName:t||void 0,confidence:j,summaryGroup:D}}r(T9,"toolActivityPresentation");function $k(e){const t=T9({name:e});return{family:t.family,icon:t.icon,verbLabel:t.runningLabel}}r($k,"toolTaxonomy");function R9(e){const t=(e??"").trim().toLowerCase();return t==="thinking"?fI:t==="responding"||t.startsWith("responding (")?wR:null}r(R9,"statusLabelIcon");var o0=6e4,c0=12e4,v2=9e5,kf={paused:-2,pausing:-1,active:0,thinking:1,starting:2,quiet:3,stalled:4,pause_failed:5},GY={starting:"loading",active:"working",thinking:"thinking",quiet:"sleepy",stalled:"confused",pausing:"loading",paused:"sleepy",pause_failed:"confused"},M9={pausing:"Pausing",paused:"Paused",pause_failed:"Pause failed"};function D9(e){return{health:e,label:M9[e],silentMs:null}}r(D9,"pauseSignal");function Sx(e){if(!e)return null;const t=new Date(e).getTime();return Number.isFinite(t)?t:null}r(Sx,"toMs");function y2(e){let t=null;for(const s of[e.lastEventAt,e.currentStatusUpdatedAt,e.outputSilence?.lastOutputAt,e.lastUsefulActionAt]){const l=Sx(s);l!==null&&(t===null||l>t)&&(t=l)}return t}r(y2,"lastLiveActivityMs");function Uk(e){const t=Math.floor(e/6e4);if(t<1)return`${Math.max(0,Math.floor(e/1e3))}s`;if(t<60)return`${t}m`;const s=Math.floor(t/60),l=t%60;return l>0?`${s}h ${l}m`:`${s}h`}r(Uk,"formatSilence");function O9(e){return!!e.currentToolName&&!/^finished\b/i.test(e.currentStatusMessage??"")}r(O9,"toolInFlight");function Nx(e,t){const s=Sx(e.startedAt);if(s===null||e.status==="queued"||e.status==="scheduled_retry")return{health:"starting",label:"Queued",silentMs:null};const l=y2(e);if(l===null&&t-s<o0)return{health:"starting",label:"Starting",silentMs:null};const c=Math.max(0,t-(l??s)),u=e.outputSilence?.level,p=e.outputSilence?.criticalThresholdMs||v2;return u==="critical"||u!=="snoozed"&&c>=p?{health:"stalled",label:`Stalled ${Uk(c)}`,silentMs:c}:u==="suspicious"||c>=c0?{health:"quiet",label:`Quiet ${Uk(c)}`,silentMs:c}:O9(e)?{health:"active",label:"Working",silentMs:c}:{health:"thinking",label:"Thinking",silentMs:c}}r(Nx,"classifyLiveNowHealth");function L9(e,t){const s=Sx(e.startedAt);if(s===null||e.status==="queued"||e.status==="scheduled_retry")return null;const l=y2(e);if(l===null&&t-s<o0)return s+o0;const c=l??s,u=Math.max(0,t-c),p=e.outputSilence?.level;if(u<6e4&&(p==="suspicious"||p==="critical"))return c+(Math.floor(u/1e3)+1)*1e3;if(u<c0)return c+c0;const f=c+(Math.floor(u/6e4)+1)*6e4,h=c+(e.outputSilence?.criticalThresholdMs||v2);return h>t?Math.min(f,h):f}r(L9,"nextLiveNowHealthChangeMs");function j2(e){return e==="paused"?"paused":e==="stalled"||e==="quiet"||e==="pause_failed"?"attention":"working"}r(j2,"liveNowGroupOf");function w2(e,t){return kf[t]-kf[e]}r(w2,"compareLiveNowSeverity");function k2(e){return e.reduce((t,s)=>kf[s.health]>kf[t.health]?s:t)}r(k2,"mostSevereSignal");function YY(e){const t=e.currentToolName?.trim()||null,s=(e.currentStatusMessage?.trim()||null)??(t?$k(t).verbLabel:null);return s?{icon:t?$k(t).icon:R9(s)??Rf,text:s}:null}r(YY,"describeLiveActivity");var z9=3e4,P9=[];function Vh(e){return e.startedAt??e.createdAt}r(Vh,"runStartAt");function ho(e){const t=new Date(e).getTime();return Number.isFinite(t)?t:0}r(ho,"timestampMs");function S2(e,t){const s=new Map;for(const c of e??[]){if(!c.issueId||!mo(c,t.get(c.issueId)))continue;const u=s.get(c.issueId);u?u.push(c):s.set(c.issueId,[c])}const l=[];for(const[c,u]of s)l.push({issueId:c,...N2(u)});return l.sort((c,u)=>ho(u.latestStartAt)-ho(c.latestStartAt))}r(S2,"buildLiveNowEntries");function N2(e){e.sort((s,l)=>ho(Vh(l))-ho(Vh(s)));const t=e.filter(s=>s.startedAt!==null);return{runs:e,latestStartAt:Vh(e[0]),earliestStartedAt:t.length>0?t[t.length-1].startedAt:null}}r(N2,"toRunSet");function $9(e,t){return(e??[]).filter(s=>!s.issueId&&mo(s)).map(s=>{const l=Nx(s,t);return{entry:N2([s]),signal:l,group:j2(l.health)}}).sort((s,l)=>ho(l.entry.latestStartAt)-ho(s.entry.latestStartAt)).sort((s,l)=>s.group!==l.group?s.group==="attention"?-1:1:s.group==="attention"?w2(s.signal.health,l.signal.health):0)}r($9,"buildLiveNowHeartbeats");function U9(e,t,s){const l=[],c=new Set;let u=e?.parentId??null,p=!1;for(;u&&!c.has(u);){c.add(u);const f=t.get(u);if(!f){p=!0;break}l.push({id:f.id,identifier:f.identifier??null,title:f.title}),u=f.parentId??null}return p?s?{ancestors:[...s].reverse().map(({id:f,identifier:h,title:g})=>({id:f,identifier:h,title:g})),complete:!0}:{ancestors:l.reverse(),complete:!1}:{ancestors:l.reverse(),complete:!0}}r(U9,"resolveLiveNowParentPath");function B9(e,t,s,l=new Map){const c=e.map((u,p)=>{const f=t(u.issueId),h=l.get(u.issueId)??null,g=h?D9(h.state):k2(u.runs.map(v=>Nx(v,s)));return{order:p,item:{entry:u,issue:f,identifier:f?.identifier??u.issueId.slice(0,8),signal:g,group:j2(g.health),pause:h}}});return c.sort((u,p)=>{if(u.item.group!==p.item.group)return u.item.group==="attention"?-1:1;if(u.item.group==="attention"){const f=w2(u.item.signal.health,p.item.signal.health);if(f!==0)return f}return u.order-p.order}),c.map(({item:u})=>u)}r(B9,"buildLiveNowItems");function C2(e){const[t,s]=(0,x.useState)(0);return(0,x.useEffect)(()=>{const l=Date.now();let c=null;for(const p of e){const f=L9(p,l);f!==null&&(c===null||f<c)&&(c=f)}if(c===null)return;const u=window.setTimeout(()=>s(p=>p+1),Math.max(0,c-l)+50);return()=>window.clearTimeout(u)},[e,t]),Date.now()}r(C2,"useLiveNowClock");function XY(e,t,s=P9){const l=(0,x.useMemo)(()=>new Map(t.map(C=>[C.id,C])),[t]),c=(0,x.useMemo)(()=>{const C=new Set;for(const M of e??[]){if(!M.issueId||C.has(M.issueId)||!mo(M))continue;const R=l.get(M.issueId);(!R||!U9(R,l).complete)&&C.add(M.issueId)}return[...C]},[e,l]),u=_f({queries:c.map(C=>({queryKey:P.issues.detail(C),queryFn:r(()=>on.get(C),"queryFn"),staleTime:z9,retry:!1}))}),{detailById:p,failedIds:f}=(0,x.useMemo)(()=>{const C=new Map,M=new Set;return u.forEach((R,_)=>{const D=c[_];R.data?C.set(D,R.data):R.isError&&M.add(D)}),{detailById:C,failedIds:M}},[c,u]),h=(0,x.useMemo)(()=>{const C=new Map;for(const M of e??[]){if(!M.issueId)continue;const R=l.get(M.issueId)?.status??p.get(M.issueId)?.status;R&&C.set(M.issueId,R)}return S2(e,C)},[p,e,l]),g=(0,x.useMemo)(()=>(e??[]).filter(C=>!C.issueId&&mo(C)),[e]),v=C2((0,x.useMemo)(()=>[...h.flatMap(C=>C.runs),...g],[h,g])),y=$9(g,v),j=(0,x.useMemo)(()=>new Map(s.map(C=>[C.issueId,C])),[s]),k=r(C=>l.get(C)??p.get(C)??null,"issueById"),S=h.filter(C=>j.get(C.issueId)?.state!=="paused"),N=B9(S,k,v,j),I=new Set(S.map(C=>C.issueId));return{items:N,heartbeats:y,pausedItems:s.filter(C=>!I.has(C.issueId)).map(C=>({pause:C,issue:k(C.issueId),identifier:C.identifier??C.issueId.slice(0,8)})),loadedById:l,detailById:p,failedIds:f,now:v}}r(XY,"useLiveNowModel");var K9=["assignee","kickedOffBy","project","workspace","parent","labels","updated"],q9={status:"Status",id:"ID",assignee:"Responsible",kickedOffBy:"Kicked off by",project:"Project",workspace:"Workspace",parent:"Parent task",labels:"Tags",updated:"Last updated"},F9={status:"Task state chip on the left edge.",id:"Ticket identifier like PAP-1009.",assignee:"Responsible agent or board user.",kickedOffBy:"Board user or agent who created the task.",project:"Linked project pill with its color.",workspace:"Execution or project workspace used for the task.",parent:"Parent task identifier and title.",labels:"Task labels and tags.",updated:"Latest visible activity time."};function H9(e,t="legacy"){return e==="id"&&t==="task"?"Task identifier like PAP-1009 on the trailing edge.":e==="status"&&t==="task"?"Task state icon on the leading edge.":F9[e]}r(H9,"issueColumnDescription");function Sf(e){return xI(e.lastActivityAt??e.lastExternalCommentAt??e.updatedAt)}r(Sf,"issueActivityTimestamp");function V9(e){return`Updated ${Sf(e)}`}r(V9,"issueActivityText");function W9(e){return e.map(t=>t==="assignee"||t==="kickedOffBy"?"minmax(6rem, 8rem)":t==="project"?"minmax(4.5rem, 7rem)":t==="workspace"?"minmax(6rem, 9rem)":t==="parent"?"minmax(3.5rem, 5.5rem)":t==="labels"?"minmax(3rem, 6rem)":"minmax(3.5rem, 4.5rem)").join(" ")}r(W9,"issueTrailingGridTemplate");function Q9({availableColumns:e,visibleColumnSet:t,onToggleColumn:s,showDateGroupSeparators:l,onToggleDateGroupSeparators:c,onResetColumns:u,title:p,iconOnly:f=!1,rowPresentation:h="legacy"}){return(0,a.jsxs)(tl,{children:[(0,a.jsx)(Jr,{asChild:!0,children:(0,a.jsxs)(oe,{type:"button",variant:f?"secondary":"ghost",size:f?"icon":"sm",className:f?"h-8 w-8 shrink-0":"hidden h-8 shrink-0 px-2 text-xs sm:inline-flex",title:"Columns",children:[(0,a.jsx)(n3,{className:f?"h-3.5 w-3.5":"mr-1 h-3.5 w-3.5"}),!f&&"Columns"]})}),(0,a.jsxs)(el,{align:"end",className:"w-(--sz-300px) rounded-xl border-line/70 p-1.5 shadow-xl shadow-black/10",children:[(0,a.jsx)(_1,{className:"px-2 pb-1 pt-1.5",children:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"text-(length:--text-nano) font-semibold uppercase tracking-(--tracking-caps) text-ink-3",children:"Desktop task rows"}),(0,a.jsx)("div",{className:"text-sm font-medium text-ink",children:p})]})}),(0,a.jsx)(Ei,{}),e.map(g=>(0,a.jsx)(Ky,{checked:t.has(g),onSelect:r(v=>v.preventDefault(),"onSelect"),onCheckedChange:r(v=>s(g,v===!0),"onCheckedChange"),className:"items-start rounded-lg px-3 py-2.5 pl-8",children:(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-ink",children:q9[g]}),(0,a.jsx)("span",{className:"text-xs leading-relaxed text-ink-3",children:H9(g,h)})]})},g)),l!==void 0&&c?(0,a.jsx)(Ky,{checked:l,onSelect:r(g=>g.preventDefault(),"onSelect"),onCheckedChange:r(g=>c(g===!0),"onCheckedChange"),className:"items-start rounded-lg px-3 py-2.5 pl-8",children:(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-ink",children:"Date group separators"}),(0,a.jsx)("span",{className:"text-xs leading-relaxed text-ink-3",children:"Show Today, Yesterday, and Earlier rules on newest-first task lists."})]})}):null,(0,a.jsx)(Ei,{}),(0,a.jsxs)(Sn,{onSelect:u,className:"rounded-lg px-3 py-2 text-sm",children:["Reset defaults",(0,a.jsx)("span",{className:"ml-auto text-xs text-ink-3",children:"status, id, updated"})]})]})]})}r(Q9,"IssueColumnPicker");function G9(){return(0,a.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,a.jsx)("span",{className:"absolute inline-flex h-full w-full animate-pulse rounded-full bg-blue-400 opacity-75"}),(0,a.jsx)("span",{className:Y("relative inline-flex h-2 w-2 rounded-full","bg-blue-500")})]})}r(G9,"LiveRunDot");function Y9(){return(0,a.jsxs)(Dn,{variant:"ghost",className:Y("px-1.5 sm:gap-1.5 sm:px-2","bg-blue-500/10"),children:[(0,a.jsx)(G9,{}),(0,a.jsx)("span",{className:Y("hidden text-(length:--text-micro) font-medium sm:inline","text-blue-600 dark:text-blue-400"),children:"Live"})]})}r(Y9,"LiveRunBadge");function Bk({issue:e,isLive:t,subtreeLiveCount:s=0,showSubtreeLiveChip:l=!0,showStatus:c=!0,showIdentifier:u=!0,statusSlot:p,checklistStepNumber:f=null}){return(0,a.jsxs)(a.Fragment,{children:[c?(0,a.jsx)("span",{className:"hidden shrink-0 items-center sm:inline-flex",children:p??(0,a.jsx)(Js,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention})}):null,f!==null?(0,a.jsxs)("span",{className:"shrink-0 font-mono text-xs text-ink-3","aria-hidden":"true",children:[f,"."]}):null,u?(0,a.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:e.identifier??e.id.slice(0,8)}):null,t&&(0,a.jsx)(Y9,{}),l&&!t&&s>0&&(0,a.jsxs)(Dn,{variant:"outline",className:Y("px-1.5 sm:gap-1.5 sm:px-2","border-line bg-transparent"),title:`${s} sub-task${s===1?"":"s"} running below`,children:[(0,a.jsx)("span",{className:Y("h-2 w-2 shrink-0 rounded-full border","border-ink-3/60 bg-transparent"),"aria-hidden":"true"}),(0,a.jsxs)("span",{className:"hidden text-(length:--text-micro) font-medium text-ink-3 sm:inline",children:[s," live below"]})]})]})}r(Bk,"InboxIssueMetaLeading");function X9({issue:e,columns:t,projectName:s,projectColor:l,workspaceId:c,workspaceName:u,assigneeName:p,assigneeAgent:f,creatorAgent:h,assigneeUserName:g,assigneeUserAvatarUrl:v,creatorAgentName:y,creatorUserName:j,creatorUserAvatarUrl:k,viaAgentName:S,currentUserId:N,parentIdentifier:I,parentTitle:C,assigneeContent:M,onFilterWorkspace:R}){const _=Sf(e),D=g??Vr(e.assigneeUserId,N)??"User",U=o1(e),K=U?.kind==="user"?U.id:null,z=j??Vr(K,N)??"User";return(0,a.jsx)("span",{className:"grid items-center gap-2",style:{gridTemplateColumns:W9(t)},children:t.map(E=>{if(E==="assignee")return M?(0,a.jsx)("span",{className:"min-w-0",children:M},E):e.assigneeAgentId?(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(co,{agent:f??{id:e.assigneeAgentId,name:p??e.assigneeAgentId.slice(0,8)},size:"sm",className:"min-w-0"})},E):e.assigneeUserId?(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(lg,{name:D,avatarUrl:v,size:"sm",className:"min-w-0"})},E):(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"Unassigned"},E);if(E==="kickedOffBy"){if(U?.kind==="agent"){const B=y??U.id.slice(0,8);return(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(co,{agent:h??{id:U.id,name:B},size:"sm",className:"min-w-0"})})}),(0,a.jsx)(Is,{side:"top",sideOffset:6,children:B})]},E)}if(U?.kind==="user"){const B=S?`${z} · via ${S}`:z;return(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(lg,{name:z,avatarUrl:k,size:"sm",className:"min-w-0"})})}),(0,a.jsx)(Is,{side:"top",sideOffset:6,children:B})]},E)}return(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"Unknown"},E)}if(E==="project"){if(s){const B=l??"#64748b";return(0,a.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-2 text-xs font-medium",style:{color:tj(B,.12)},children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:B}}),(0,a.jsx)("span",{className:"truncate",children:s})]},E)}return(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"No project"},E)}return E==="labels"?(e.labels??[]).length>0?(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[(e.labels??[]).slice(0,2).map(B=>(0,a.jsx)(Dn,{variant:"outline",className:"min-w-0 max-w-full px-1.5 py-0 text-(length:--text-nano)",style:{borderColor:B.color,color:tj(B.color,.12),backgroundColor:`${B.color}1f`},children:(0,a.jsx)("span",{className:"truncate",children:B.name})},B.id)),(e.labels??[]).length>2?(0,a.jsxs)("span",{className:"shrink-0 text-(length:--text-nano) font-medium text-ink-3",children:["+",(e.labels??[]).length-2]}):null]},E):(0,a.jsx)("span",{className:"min-w-0","aria-hidden":"true"},E):E==="workspace"?u?(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:c&&R?(0,a.jsxs)(Ts,{children:[(0,a.jsx)(Es,{asChild:!0,children:(0,a.jsx)("button",{type:"button",className:"truncate rounded-sm text-left text-xs text-ink-3 transition-colors hover:text-ink hover:underline",onClick:r(B=>{B.preventDefault(),B.stopPropagation(),R(c)},"onClick"),children:u})}),(0,a.jsx)(Is,{side:"top",sideOffset:6,children:"Filter by workspace"})]}):u},E):(0,a.jsx)("span",{className:"min-w-0","aria-hidden":"true"},E):E==="parent"?e.parentId?(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",title:C??void 0,children:I?(0,a.jsx)("span",{className:"font-mono",children:I}):(0,a.jsx)("span",{className:"italic",children:"Sub-task"})},E):(0,a.jsx)("span",{className:"min-w-0","aria-hidden":"true"},E):E==="updated"?(0,a.jsx)("span",{className:"min-w-0 truncate text-right text-(length:--text-micro) font-medium text-ink-3",children:_},E):null})})}r(X9,"InboxIssueTrailingColumns");function Z9({icon:e,title:t,message:s,description:l,action:c,onAction:u,hideActionIcon:p=!1}){return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,a.jsx)("div",{className:"bg-bg-3/50 p-4 mb-4",children:(0,a.jsx)(e,{className:"h-10 w-10 text-ink-3/50"})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-base font-semibold text-ink mb-1.5",children:t}),(0,a.jsx)("p",{className:"text-sm text-ink-3 mb-4 max-w-md",children:s})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-ink mb-1",children:s}),l&&(0,a.jsx)("p",{className:"max-w-md text-sm text-ink-3 mb-4",children:l})]}),c&&u&&(0,a.jsxs)(oe,{onClick:u,children:[!p&&(0,a.jsx)(ns,{className:"h-4 w-4 mr-1.5"}),c]})]})}r(Z9,"EmptyState");function J9({label:e,collapsible:t=!1,collapsed:s=!1,onToggle:l,trailing:c,className:u}){return(0,a.jsxs)("div",{className:Y("flex items-center py-1.5 pl-1 pr-3",u),children:[t?(0,a.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left","aria-expanded":!s,onClick:l,children:[(0,a.jsx)("span",{className:"inline-flex w-4 shrink-0 items-center justify-center",children:(0,a.jsx)(cr,{className:Y("h-3.5 w-3.5 shrink-0 text-ink-3 transition-transform",!s&&"rotate-90")})}),(0,a.jsx)("span",{className:"truncate text-sm font-semibold uppercase tracking-wide",children:e})]}):(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5",children:(0,a.jsx)("span",{className:"truncate text-sm font-semibold uppercase tracking-wide",children:e})}),c?(0,a.jsx)("div",{className:"ml-auto",children:c}):null]})}r(J9,"IssueGroupHeader");var Wh={critical:{icon:ni,color:ld.critical??"text-yellow-600 dark:text-yellow-400",label:"Critical"},high:{icon:T1,color:ld.high??"text-yellow-600 dark:text-yellow-400",label:"High"},medium:{icon:j3,color:ld.medium??"text-yellow-600 dark:text-yellow-400",label:"Medium"},low:{icon:RI,color:ld.low??"text-yellow-600 dark:text-yellow-400",label:"Low"}},eF=["critical","high","medium","low"];function ZY({priority:e,onChange:t,className:s,showLabel:l}){const[c,u]=(0,x.useState)(!1),p=Wh[e]??Wh.medium,f=p.icon,h=(0,a.jsx)("span",{className:Y("inline-flex items-center justify-center shrink-0",p.color,t&&!l&&"cursor-pointer",s),children:(0,a.jsx)(f,{className:"h-3.5 w-3.5"})});if(!t)return l?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[h,(0,a.jsx)("span",{className:"text-sm",children:p.label})]}):h;const g=l?(0,a.jsxs)("button",{type:"button","aria-label":`Change priority (current: ${p.label})`,className:"inline-flex min-h-5 items-center gap-1.5 cursor-pointer hover:bg-bg-3/50 rounded px-1 -mx-1 py-0.5 transition-colors",children:[h,(0,a.jsx)("span",{className:"text-sm",children:p.label})]}):(0,a.jsx)("button",{type:"button","data-slot":"icon-button","aria-label":`Change priority (current: ${p.label})`,className:"inline-flex cursor-pointer items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus",children:h});return(0,a.jsxs)(js,{open:c,onOpenChange:u,children:[(0,a.jsx)(vs,{asChild:!0,children:g}),(0,a.jsx)(ys,{className:"w-36 p-1",align:"start",children:eF.map(v=>{const y=Wh[v],j=y.icon;return(0,a.jsxs)(oe,{active:v===e,variant:"ghost",size:"sm",className:Y("w-full justify-start gap-2 text-xs"),onClick:r(()=>{t(v),u(!1)},"onClick"),children:[(0,a.jsx)(j,{className:Y("h-3.5 w-3.5",y.color)}),y.label]},v)})})]})}r(ZY,"PriorityIcon");var tF=[["everything","All categories"],["issues_i_touched","My recent tasks"],["join_requests","Join requests"],["approvals","Approvals"],["failed_runs","Failed runs"],["alerts","Alerts"]],nF=[["all","All approval statuses"],["actionable","Needs action"],["resolved","Resolved"]],Qh=6;function Gh({value:e,onChange:t,label:s}){return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(fr,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-ink-3"}),(0,a.jsx)(Wn,{value:e,onChange:r(l=>t(l.target.value),"onChange"),placeholder:`Search ${s.toLowerCase()}...`,"aria-label":`Search ${s.toLowerCase()}`,className:"h-8 pl-7 text-xs"})]})}r(Gh,"FilterOptionSearch");function aF({state:e,onChange:t,activeFilterCount:s,agents:l,projects:c,labels:u,currentUserId:p,enableExternalObjectFilters:f=!0,enableRoutineVisibilityFilter:h=!1,enableHiddenTasksFilter:g=!1,buttonVariant:v="ghost",iconOnly:y=!1,creators:j,presentation:k="legacy",inboxScopeFilters:S}){const N=k==="streamlined",[I,C]=(0,x.useState)(""),[M,R]=(0,x.useState)(""),[_,D]=(0,x.useState)(""),[U,K]=(0,x.useState)(""),z=(0,x.useMemo)(()=>ah(l,M,A=>A.name),[l,M]),E=(0,x.useMemo)(()=>ah(c,_,A=>A.name),[c,_]),B=(0,x.useMemo)(()=>ah(u,U,A=>A.name),[u,U]),O=j??[],Q=(0,x.useMemo)(()=>new Map(O.map(A=>[A.id,A])),[O]),V=I.trim().toLowerCase(),ue=(0,x.useMemo)(()=>V?O.filter(A=>`${A.label} ${A.searchText??""}`.toLowerCase().includes(V)):O,[O,V]),ce=(0,x.useMemo)(()=>e.creators.map(A=>{const ee=Q.get(A);if(ee)return ee;if(A.startsWith("agent:"))return{id:A,label:A.slice(6).slice(0,8),kind:"agent"};const ie=A.startsWith("user:")?A.slice(5):A;return{id:A,label:Vr(ie,p)??ie.slice(0,5),kind:"user"}}),[Q,p,e.creators]),X=r(()=>{t(G1),S?.onClear()},"clearFilters");return(0,a.jsxs)(js,{children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsxs)(oe,{variant:v,size:y?"icon":"sm",className:`text-xs ${y?"relative h-8 w-8 shrink-0":""}`,title:y?s>0?`Filters: ${s}`:"Filter":void 0,children:[(0,a.jsx)(x3,{className:y?"h-3.5 w-3.5":"h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1"}),!y&&(0,a.jsx)("span",{className:"hidden sm:inline",children:s>0?`Filters: ${s}`:"Filter"}),!y&&s>0?(0,a.jsx)("span",{className:"ml-0.5 text-(length:--text-nano) font-medium sm:hidden",children:s}):null,y&&s>0?(0,a.jsx)("span",{className:"absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-600 text-(length:--text-nano) font-bold text-white",children:s}):null,!y&&s>0?(0,a.jsx)(ia,{className:"ml-1 hidden h-3 w-3 sm:block",onClick:r(A=>{A.stopPropagation(),X()},"onClick")}):null]})}),(0,a.jsx)(ys,{align:"end",className:N?"w-(--sz-calc-10) max-h-(--sz-calc-9) overflow-y-auto overscroll-contain p-0":"w-(--sz-calc-10) p-0",children:(0,a.jsxs)("div",{className:"space-y-3 p-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Filters"}),s>0?(0,a.jsx)("button",{type:"button",className:"text-xs text-ink-3 hover:text-ink",onClick:X,children:"Clear"}):null]}),S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-1","data-filter-options":"inbox-category",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Category"}),(0,a.jsx)("div",{className:"space-y-0.5",children:tF.map(([A,ee])=>{const ie=S.category===A;return(0,a.jsxs)("button",{type:"button","aria-pressed":ie,className:Y("flex w-full items-center justify-between rounded-sm px-2 py-1 text-left text-sm",ie?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),onClick:r(()=>S.onCategoryChange(A),"onClick"),children:[(0,a.jsx)("span",{children:ee}),ie?(0,a.jsx)(Rs,{className:"h-3.5 w-3.5"}):null]},A)})})]}),S.showApprovalStatus?(0,a.jsxs)("div",{className:"space-y-1","data-filter-options":"inbox-approval-status",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Approval status"}),(0,a.jsx)("div",{className:"space-y-0.5",children:nF.map(([A,ee])=>{const ie=S.approvalStatus===A;return(0,a.jsxs)("button",{type:"button","aria-pressed":ie,className:Y("flex w-full items-center justify-between rounded-sm px-2 py-1 text-left text-sm",ie?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),onClick:r(()=>S.onApprovalStatusChange(A),"onClick"),children:[(0,a.jsx)("span",{children:ee}),ie?(0,a.jsx)(Rs,{className:"h-3.5 w-3.5"}):null]},A)})})]}):null]}),(0,a.jsx)("div",{className:"border-t border-line"})]}):null,(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Quick filters"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:aT.map(A=>{const ee=iT(e.statuses,A.statuses);return(0,a.jsx)(zT,{selected:ee,onClick:r(()=>t({statuses:ee?[]:[...A.statuses]}),"onClick"),children:A.label},A.label)})})]}),(0,a.jsx)("div",{className:"border-t border-line"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Status"}),(0,a.jsx)("div",{className:"space-y-0.5",children:Xd.map(A=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.statuses.includes(A),onCheckedChange:r(()=>t({statuses:tr(e.statuses,A)}),"onCheckedChange")}),(0,a.jsx)(Js,{status:A}),(0,a.jsx)("span",{className:"text-sm",children:ug(A)})]},A))})]}),!1]}),(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Responsible"}),N&&(l?.length??0)+(p?2:1)>Qh?(0,a.jsx)(Gh,{value:M,onChange:R,label:"Responsible"}):null,(0,a.jsxs)("div",{"data-filter-options":"responsible",className:N?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.assignees.includes("__unassigned"),onCheckedChange:r(()=>t({assignees:tr(e.assignees,"__unassigned")}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:"No responsible"})]}),p?(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.assignees.includes("__me"),onCheckedChange:r(()=>t({assignees:tr(e.assignees,"__me")}),"onCheckedChange")}),(0,a.jsx)(so,{className:"h-3.5 w-3.5 text-ink-3"}),(0,a.jsx)("span",{className:"text-sm",children:"Me"})]}):null,(N?z:l??[]).map(A=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.assignees.includes(A.id),onCheckedChange:r(()=>t({assignees:tr(e.assignees,A.id)}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:A.name})]},A.id))]})]}),O.length>0?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Creator"}),ce.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:ce.map(A=>(0,a.jsxs)(Dn,{variant:"secondary",className:"gap-1 pr-1",children:[A.kind==="agent"?(0,a.jsx)(Nc,{className:"h-3 w-3"}):(0,a.jsx)(so,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:A.label}),(0,a.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg-3",onClick:r(()=>t({creators:e.creators.filter(ee=>ee!==A.id)}),"onClick"),"aria-label":`Remove creator ${A.label}`,children:(0,a.jsx)(ia,{className:"h-3 w-3"})})]},A.id))}):null,(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(fr,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-ink-3"}),(0,a.jsx)(Wn,{value:I,onChange:r(A=>C(A.target.value),"onChange"),placeholder:"Search creators...",className:"h-8 pl-7 text-xs"})]}),(0,a.jsx)("div",{"data-filter-options":"creators",className:N?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:ue.length>0?ue.map(A=>{const ee=e.creators.includes(A.id);return(0,a.jsxs)("button",{type:"button",className:`flex w-full items-center gap-2 rounded-sm px-2 py-1 text-left text-sm ${ee?"bg-bg-3 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"}`,onClick:r(()=>t({creators:tr(e.creators,A.id)}),"onClick"),children:[A.kind==="agent"?(0,a.jsx)(Nc,{className:"h-3.5 w-3.5"}):(0,a.jsx)(so,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:A.label}),ee?(0,a.jsx)(ia,{className:"h-3 w-3"}):null]},A.id)}):(0,a.jsx)("div",{className:"px-2 py-1 text-xs text-ink-3",children:"No creators match."})})]}):null,c&&c.length>0?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Project"}),N&&c.length>Qh?(0,a.jsx)(Gh,{value:_,onChange:D,label:"Projects"}):null,(0,a.jsx)("div",{"data-filter-options":"projects",className:N?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:(N?E:c).map(A=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.projects.includes(A.id),onCheckedChange:r(()=>t({projects:tr(e.projects,A.id)}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:A.name})]},A.id))})]}):null]}),(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[u&&u.length>0?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Labels"}),N&&u.length>Qh?(0,a.jsx)(Gh,{value:U,onChange:K,label:"Labels"}):null,(0,a.jsx)("div",{"data-filter-options":"labels",className:N?"space-y-0.5":"max-h-32 space-y-0.5 overflow-y-auto",children:(N?B:u).map(A=>(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.labels.includes(A.id),onCheckedChange:r(()=>t({labels:tr(e.labels,A.id)}),"onCheckedChange")}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:A.color}}),(0,a.jsx)("span",{className:"text-sm",children:A.name})]},A.id))})]}):null,f?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"External object status"}),(0,a.jsx)("div",{className:"space-y-0.5",children:eT.map(A=>{const ee=A==="failed"?"failed":A==="waiting"?"waiting":A==="running"?"running":A==="auth_required"?"auth_required":A==="unreachable"?"unreachable":A==="stale"?"unknown":"closed",ie=P1(ee),le=(nI[ee]??"").split(" ").filter(Ae=>Ae.startsWith("text-")).join(" ");return(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.externalObjectStatuses.includes(A),onCheckedChange:r(()=>t({externalObjectStatuses:tr(e.externalObjectStatuses,A)}),"onCheckedChange")}),(0,a.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0 ${le}`,"aria-hidden":"true"}),(0,a.jsx)("span",{className:"text-sm",children:nT(A)})]},A)})})]}):null,(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Visibility"}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.liveOnly,onCheckedChange:r(A=>t({liveOnly:A===!0}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:"Live runs only"})]}),h?(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.hideRoutineExecutions,onCheckedChange:r(A=>t({hideRoutineExecutions:A===!0}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:"Hide routine runs"})]}):null,g?(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1 hover:bg-bg-3/50",children:[(0,a.jsx)(Qs,{checked:e.showHiddenTasks,onCheckedChange:r(A=>t({showHiddenTasks:A===!0}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:"Show hidden tasks"})]}):null]})]})]})]})})]})}r(aF,"IssueFiltersPopover");function sF(e){return e.objects.find(t=>t.statusTone===e.highestSeverity)?.statusCategory??"unknown"}r(sF,"dominantCategory");function iF(e){return e.objects.find(t=>t.statusTone===e.highestSeverity)??null}r(iF,"dominantObject");function rF(e){const t=[];for(const[s,l]of Object.entries(e.byStatusCategory))l&&t.push(`${l} ${t3(s).toLowerCase()}`);return e.staleCount>0&&t.push(`${e.staleCount} stale`),t.push(`${e.total} total`),`External objects: ${t.join(", ")}`}r(rF,"buildBreakdownTitle");function Kk({summary:e,compact:t,className:s}){const l=U0(),c=YI(e),u=e?.total??0;if(!e||u===0||!c)return null;const p=iF(e),f=p?.statusCategory??sF(e),h=JI(p?.statusIconKey)??P1(f),g=cI[f]??"bg-bg-3 text-ink-3",v=XI(e),y=rF(e),j=f==="running"&&!l?"animate-spin":"";return(0,a.jsxs)("span",{role:"img","aria-label":y,title:y,className:Y("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-(length:--text-nano) font-medium tabular-nums leading-none",g,t&&"px-1 py-0.5",s),"data-external-status":f,"data-external-tone":c,children:[(0,a.jsx)(h,{"aria-hidden":"true",className:Y("h-3 w-3 shrink-0",j)}),(0,a.jsx)("span",{children:v>0?v:u})]})}r(Kk,"ExternalObjectStatusSummary");function qk({onArchive:e,disabled:t,compact:s=!1}){return(0,a.jsxs)("button",{type:"button","data-slot":"icon-button",onClick:r(l=>{l.preventDefault(),l.stopPropagation(),e()},"onClick"),onKeyDown:r(l=>{l.key!=="Enter"&&l.key!==" "||(l.preventDefault(),l.stopPropagation(),e())},"onKeyDown"),disabled:t,className:Y("inline-flex shrink-0 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-ink-3 opacity-0 transition-opacity hover:bg-bg-3 hover:text-ink group-hover:opacity-100 focus-visible:opacity-100 disabled:pointer-events-none disabled:opacity-30",s?"h-5 py-0":"py-1"),"aria-label":"Archive",children:[(0,a.jsx)(I1,{className:"h-3.5 w-3.5"}),"Archive"]})}r(qk,"InboxArchiveButton");function lF({issue:e,issueLinkState:t,selected:s=!1,presentation:l="legacy",leadingControl:c,statusSlot:u,metadata:p,actions:f,showIdentifier:h=!0,mobileLeading:g,desktopMetaLeading:v,desktopLeadingSpacer:y=!1,mobileMeta:j,mobileTitleMeta:k,desktopTrailing:S,externalObjectSummary:N,trailingMeta:I,titleSuffix:C,titleClassName:M,checklistStepNumber:R=null,checklistCurrentStep:_=!1,checklistDependencyChips:D,checklistRowId:U,unreadState:K=null,onMarkRead:z,onArchive:E,archiveDisabled:B,className:O,onMouseEnter:Q,treeGuides:V=0,chevronInGuide:ue=!1,showDivider:ce=!1}){const X=e.identifier??e.id,A=e.identifier??e.id.slice(0,8),ee=K!=null,ie=K==="visible"||K==="fading",le=(0,a.jsx)("button",{type:"button","data-slot":"icon-button",onClick:r(ve=>{ve.preventDefault(),ve.stopPropagation(),z?.()},"onClick"),onKeyDown:r(ve=>{(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),ve.stopPropagation(),z?.())},"onKeyDown"),className:Y("inline-flex h-4 w-4 items-center justify-center rounded-full transition-colors",s?"hover:bg-bg-3/80":"hover:bg-blue-500/20"),"aria-label":"Mark as read",children:(0,a.jsx)("span",{className:Y("block h-2 w-2 rounded-full transition-opacity duration-300",s?"bg-ink-3/70":"bg-blue-600 dark:bg-blue-400",K==="fading"?"opacity-0":"opacity-100")})}),Ae=s?"!text-ink-3 !border-ink-3":void 0,de=k0(t,e),we=R!==null?(0,a.jsxs)("span",{className:"shrink-0 font-mono text-xs text-ink-3","aria-hidden":"true",children:[R,"."]}):null,ye=e.activeRecoveryAction??null,Me=ye&&!YE(ye.cause)?oF(ye,s,{scheduledRetry:e.scheduledRetry??null}):null,he=ZT(e.blockedBy)?(0,a.jsxs)(Dn,{variant:"outline","data-testid":"issue-row-parked-blocker",className:"[&>svg]:size-2.5 ml-1.5 gap-0.5 border-amber-500/60 bg-amber-500/15 text-(length:--text-nano) text-amber-700 dark:text-amber-300",title:"Blocked by parked work — at least one assigned blocker is in backlog and will not wake its assignee.",children:[(0,a.jsx)(C0,{className:"h-2.5 w-2.5","aria-hidden":!0}),"Blocked by parked work"]}):null;if(l==="task"){const ve=K==="visible"||K==="fading";return(0,a.jsxs)("div",{onMouseEnter:Q,"data-slot":"task-row","data-unread":ve?"true":void 0,className:Y("group relative flex min-w-0 items-start gap-2 rounded-lg py-2.5 pr-2 text-sm no-underline text-inherit sm:items-center sm:py-2",ee?"pl-4":"pl-2 sm:pl-4","[&_button]:relative [&_button]:z-10",s?"bg-bg-3/50 hover:bg-bg-3/50":"hover:bg-bg-3/50",_&&"bg-accent/5",O),children:[(0,a.jsx)(mn,{to:Hd(X),state:de,disableIssueQuicklook:!0,issuePrefetch:e,"data-inbox-issue-link":!0,id:U,"aria-current":_?"step":void 0,onClickCapture:r(()=>ng(X,de),"onClickCapture"),className:"absolute inset-0 rounded-lg no-underline text-inherit focus-visible:z-10 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus",children:(0,a.jsxs)("span",{className:"sr-only",children:["Open ",A,": ",e.title]})}),ee?(0,a.jsx)("span",{"data-testid":"issue-row-unread-slot",className:"absolute left-0 top-3 inline-flex h-4 w-4 items-center justify-center sm:top-1/2 sm:-translate-y-1/2",children:ie?le:null}):null,(0,a.jsxs)("span",{"data-slot":"task-row-leading",className:"flex shrink-0 items-start self-stretch gap-1 pt-px sm:items-center sm:pt-0",children:[V>0?Array.from({length:V},(et,Pe)=>{const Ee=ue&&Pe===V-1;return(0,a.jsx)("span",{"data-slot":"task-row-tree-guide","aria-hidden":"true",className:"relative block w-4 shrink-0 self-stretch",children:(0,a.jsx)("span",{"data-slot":"task-row-tree-connector",className:"absolute -inset-y-3 left-7 w-px bg-bg",children:Ee?(0,a.jsxs)("span",{className:"absolute inset-0 flex flex-col",children:[(0,a.jsx)("span",{className:"flex-1 bg-line"}),(0,a.jsx)("span",{className:"h-3.5 shrink-0"}),(0,a.jsx)("span",{className:"flex-1 bg-line"})]}):(0,a.jsx)("span",{className:"absolute inset-0 bg-line"})})},`task-guide-${Pe}`)}):null,c,u??(0,a.jsx)(Js,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ae}),he]}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2",children:[(0,a.jsxs)("span",{"data-slot":"task-row-title-cluster",className:"flex min-w-0 flex-1 items-baseline gap-1.5 sm:items-center",children:[(0,a.jsxs)("span",{"data-slot":"task-row-title",className:Y("min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",ve&&"font-semibold",M),children:[e.title,C]}),Me,k?(0,a.jsx)("span",{className:"ml-auto shrink-0 whitespace-nowrap text-right text-xs text-ink-3 sm:hidden",children:k}):null]}),D?(0,a.jsx)("span",{className:"flex flex-wrap gap-1",children:D}):null,j?(0,a.jsx)("span",{className:"text-xs text-ink-3 sm:hidden",children:j}):null]}),(0,a.jsxs)("span",{"data-slot":"task-row-trailing",className:"ml-auto hidden min-w-0 shrink-0 items-center gap-2 sm:flex",children:[N?(0,a.jsx)(Kk,{summary:N,compact:!0}):null,p?(0,a.jsx)("span",{"data-slot":"task-row-metadata",className:"min-w-0",children:p}):null,S,f?(0,a.jsx)("span",{"data-slot":"task-row-actions",className:"flex shrink-0 items-center gap-1",children:f}):null,E?(0,a.jsx)(qk,{onArchive:E,disabled:B,compact:!0}):null,h?(0,a.jsx)("span",{"data-slot":"task-row-identifier",className:"w-20 shrink-0 text-right font-mono text-xs text-ink-3",children:A}):null,I?(0,a.jsx)("span",{"data-slot":"task-row-timestamp",className:"w-24 shrink-0 truncate text-right text-xs text-ink-3",children:I}):null]})]})}return(0,a.jsxs)("div",{onMouseEnter:Q,className:Y("group relative flex items-start gap-2 rounded-lg py-2.5 pr-3 text-sm no-underline text-inherit sm:items-center sm:py-2 sm:pl-1",ee?"pl-4":"pl-2","[&_button]:relative [&_button]:z-10",ce&&"border-b border-line last:border-b-0",s?"hover:bg-transparent":"hover:bg-bg-3/50",_?"bg-accent/5":null,O),children:[(0,a.jsx)(mn,{to:Hd(X),state:de,disableIssueQuicklook:!0,issuePrefetch:e,"data-inbox-issue-link":!0,id:U,"aria-current":_?"step":void 0,onClickCapture:r(()=>ng(X,de),"onClickCapture"),className:Y("absolute inset-0 rounded-lg no-underline text-inherit focus-visible:z-10 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus"),children:(0,a.jsxs)("span",{className:"sr-only",children:["Open ",A,": ",e.title]})}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-1 pt-px sm:hidden",children:[g??(0,a.jsx)(Js,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ae}),he]}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:contents",children:[(0,a.jsxs)("span",{"data-slot":"task-row-title-cluster",className:"flex min-w-0 items-start gap-1.5 sm:order-2 sm:flex-1 sm:items-center",children:[(0,a.jsxs)("span",{"data-slot":"task-row-title",className:Y("min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",M),children:[e.title,C]}),Me]}),D?(0,a.jsx)("span",{className:"flex flex-wrap gap-1 sm:order-3 sm:ml-(--sz-calc-13)",children:D}):null,(0,a.jsxs)("span",{className:"flex items-center gap-2 self-stretch sm:order-1 sm:shrink-0",children:[ee?(0,a.jsx)("span",{"data-testid":"issue-row-unread-slot",className:"hidden h-4 w-4 shrink-0 items-center justify-center self-center sm:inline-flex",children:ie?le:null}):null,V>0?Array.from({length:V},(ve,et)=>{const Pe=ue&&et===V-1;return(0,a.jsx)("span",{"aria-hidden":"true",className:"relative hidden w-4 shrink-0 self-stretch sm:block",children:(0,a.jsx)("span",{className:"absolute -inset-y-3 left-8 w-px bg-bg",children:Pe?(0,a.jsxs)("span",{className:"absolute inset-0 flex flex-col",children:[(0,a.jsx)("span",{className:"flex-1 bg-line"}),(0,a.jsx)("span",{className:"h-3.5 shrink-0"}),(0,a.jsx)("span",{className:"flex-1 bg-line"})]}):(0,a.jsx)("span",{className:"absolute inset-0 bg-line"})})},`guide-${et}`)}):null,y?(0,a.jsx)("span",{className:"hidden w-3.5 shrink-0 sm:block"}):null,v??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"hidden shrink-0 items-center gap-1 sm:inline-flex",children:(0,a.jsx)(Js,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ae})}),we,(0,a.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:A}),he]}),j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-ink-3 sm:hidden","aria-hidden":"true",children:"·"}),(0,a.jsx)("span",{className:"text-xs text-ink-3 sm:hidden",children:j})]}):null]})]}),E||S||I||N?(0,a.jsxs)("span",{className:"ml-auto hidden shrink-0 items-center gap-2 sm:order-3 sm:flex sm:gap-3",children:[E?(0,a.jsx)(qk,{onArchive:E,disabled:B}):null,N?(0,a.jsx)(Kk,{summary:N,compact:!0}):null,S,I?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:I}):null]}):null,ie?(0,a.jsx)("span",{className:"absolute left-0 top-1/2 inline-flex h-4 w-4 -translate-y-1/2 items-center justify-center sm:hidden",children:le}):null]})}r(lF,"IssueRow");function oF(e,t,s){const l=WT(e,s);if(!l)return null;const c=GT[l],u=c.icon,p=QT(e,s),f=XT(l,e.kind,p),h=p?YT(p):null;return(0,a.jsxs)(Dn,{variant:"outline","data-testid":"issue-row-recovery-indicator","data-recovery-state":l,"data-recovery-kind":e.kind,"data-recovery-lane":p?.lane,role:"status","aria-label":h?`${f} — ${h}`:f,className:Y("shrink-0 gap-0.5 text-(length:--text-nano)",c.className,t?"!border-ink-3 !text-ink-3":null),title:h?`${f} — ${h}. Open the source task to act.`:`${f} — open the source task to act.`,children:[(0,a.jsx)(u,{className:"h-2.5 w-2.5","aria-hidden":!0}),f]})}r(oF,"renderRecoveryChip");var cF="Kembali ke model utama.";function uF(e,t){return e instanceof Error&&e.message?e.message:t}r(uF,"errorMessage");function dF({issueId:e,run:t,companyId:s,taskLabel:l,className:c}){const u=kn(),[p,f]=(0,x.useState)(!1),h=t?.modelFallback??null,g=Bt({mutationFn:r(async()=>{if(!e||!t)throw new Error("This task has no run on a fallback model.");return await Lf.cancel(t.id),on.addComment(e,cF,void 0,void 0,void 0,crypto.randomUUID())},"mutationFn"),onSuccess:r(()=>{s&&u.invalidateQueries({queryKey:P.liveRuns(s)}),e&&(u.invalidateQueries({queryKey:P.issues.liveRuns(e)}),u.invalidateQueries({queryKey:P.issues.activeRun(e)}),u.invalidateQueries({queryKey:P.issues.runs(e)}),u.invalidateQueries({queryKey:P.issues.comments(e)}))},"onSuccess")});if(!e||!t||!h)return null;const v=l?` on ${l}`:"";return(0,a.jsxs)("span",{"data-slot":"restore-primary-model",className:Y("inline-flex min-w-0 items-center gap-1.5",c),children:[(0,a.jsxs)(oe,{type:"button",variant:"secondary",size:"xs",disabled:g.isPending,"aria-label":`Back to the primary model${v}`,title:`Back to the primary model — stops this fallback run and wakes the assignee on ${h.primaryModel}`,onClick:r(y=>{y.preventDefault(),y.stopPropagation(),f(!0)},"onClick"),children:[(0,a.jsx)(gc,{"aria-hidden":"true"}),g.isPending?"Restoring…":"Back to primary model"]}),g.error?(0,a.jsx)("span",{role:"alert",className:"text-xs text-bad",children:uF(g.error,"Couldn’t restore the primary model.")}):null,(0,a.jsx)(A1,{open:p,onOpenChange:f,children:(0,a.jsxs)(w1,{children:[(0,a.jsxs)(C1,{children:[(0,a.jsxs)(j1,{children:["Back to the primary model",v,"?"]}),(0,a.jsxs)(y1,{children:["This stops the run on ",h.activeModel," now, so any unsaved work in that turn is lost, and wakes the assignee again on ",h.primaryModel,"."]})]}),(0,a.jsxs)(S1,{children:[(0,a.jsx)(N1,{children:"Keep running"}),(0,a.jsx)(k1,{onClick:r(()=>{f(!1),g.mutate()},"onClick"),children:"Stop and switch"})]})]})})]})}r(dF,"RestorePrimaryModelControl");function fF({context:e,search:t,controls:s,actions:l,feedback:c,className:u,ariaLabel:p="Collection controls"}){return(0,a.jsxs)("div",{"data-slot":"collection-toolbar",className:Y("flex flex-col gap-2",u),role:"toolbar","aria-label":p,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center",children:[e?(0,a.jsx)("div",{"data-slot":"collection-toolbar-context",className:"min-w-0 shrink-0",children:e}):null,t?(0,a.jsx)("div",{"data-slot":"collection-toolbar-search",className:"min-w-0 flex-1",children:t}):null,s||l?(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1 sm:ml-auto sm:flex-nowrap",children:[s?(0,a.jsx)("div",{"data-slot":"collection-toolbar-controls",className:"flex min-w-0 flex-wrap items-center gap-1",children:s}):null,l?(0,a.jsx)("div",{"data-slot":"collection-toolbar-actions",className:"flex shrink-0 items-center gap-1",children:l}):null]}):null]}),c?(0,a.jsx)("div",{"data-slot":"collection-toolbar-feedback",className:"min-w-0",children:c}):null]})}r(fF,"CollectionToolbar");function pF({variant:e="list"}){return e==="dashboard"?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(rt,{className:"h-32 w-full border border-line"}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-4",children:Array.from({length:4}).map((t,s)=>(0,a.jsx)(rt,{className:"h-24 w-full"},s))}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:Array.from({length:4}).map((t,s)=>(0,a.jsx)(rt,{className:"h-44 w-full"},s))}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,a.jsx)(rt,{className:"h-72 w-full"}),(0,a.jsx)(rt,{className:"h-72 w-full"})]})]}):e==="approvals"?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsx)(rt,{className:"h-9 w-44"})}),(0,a.jsx)("div",{className:"grid gap-3",children:Array.from({length:3}).map((t,s)=>(0,a.jsx)(rt,{className:"h-36 w-full"},s))})]}):e==="costs"?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:Array.from({length:6}).map((t,s)=>(0,a.jsx)(rt,{className:"h-9 w-28"},s))}),(0,a.jsx)(rt,{className:"h-40 w-full"}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,a.jsx)(rt,{className:"h-72 w-full"}),(0,a.jsx)(rt,{className:"h-72 w-full"})]})]}):e==="inbox"?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(rt,{className:"h-9 w-56"}),(0,a.jsx)(rt,{className:"h-8 w-40"})]}),(0,a.jsx)("div",{className:"space-y-5",children:Array.from({length:3}).map((t,s)=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(rt,{className:"h-4 w-40"}),(0,a.jsx)("div",{className:"space-y-1 border border-line",children:Array.from({length:3}).map((l,c)=>(0,a.jsx)(rt,{className:"h-14 w-full rounded-none"},c))})]},s))})]}):e==="org-chart"?(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsx)(rt,{className:"h-(--sz-calc-17) w-full rounded-lg border border-line"})}):e==="detail"?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(rt,{className:"h-3 w-64"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(rt,{className:"h-6 w-6"}),(0,a.jsx)(rt,{className:"h-6 w-6"}),(0,a.jsx)(rt,{className:"h-7 w-48"})]}),(0,a.jsx)(rt,{className:"h-4 w-40"})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(rt,{className:"h-10 w-full"}),(0,a.jsx)(rt,{className:"h-32 w-full"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(rt,{className:"h-8 w-24"}),(0,a.jsx)(rt,{className:"h-8 w-24"}),(0,a.jsx)(rt,{className:"h-8 w-24"})]}),(0,a.jsx)(rt,{className:"h-24 w-full"}),(0,a.jsx)(rt,{className:"h-24 w-full"})]})]}):e==="issues-list"?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(rt,{className:"h-9 w-64"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(rt,{className:"h-8 w-16"}),(0,a.jsx)(rt,{className:"h-8 w-16"}),(0,a.jsx)(rt,{className:"h-8 w-16"}),(0,a.jsx)(rt,{className:"h-8 w-24"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(rt,{className:"h-4 w-40"}),(0,a.jsx)("div",{className:"space-y-1",children:Array.from({length:8}).map((t,s)=>(0,a.jsx)(rt,{className:"h-11 w-full rounded-none"},s))})]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(rt,{className:"h-9 w-44"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(rt,{className:"h-8 w-20"}),(0,a.jsx)(rt,{className:"h-8 w-24"})]})]}),(0,a.jsx)("div",{className:"space-y-1",children:Array.from({length:7}).map((t,s)=>(0,a.jsx)(rt,{className:"h-11 w-full rounded-none"},s))})]})}r(pF,"PageSkeleton");var JY="issue.successful_run_handoff_required",eX="issue.successful_run_handoff_escalated";function A2(e){const t=e.successfulRunHandoff;return t?.required!==!0?!1:t.hasLiveContinuation?e.scheduledRetry?.status==="scheduled_retry":!0}r(A2,"isSuccessfulRunHandoffRequired");function tX(e){const t=e.trim();return t==="Wardmote needs a disposition before this issue can continue."||/^##\s+(This issue still needs a next step|Run finished without a next step|Successful run missing issue disposition)/i.test(t)||mF(t)}r(tX,"isSuccessfulRunHandoffComment");function mF(e){const t=e.trim();return t==="Wardmote could not resolve this issue's missing disposition automatically. The source assignment is unchanged and a board decision is required."||/^Wardmote exhausted the bounded successful-run handoff correction\b/i.test(t)}r(mF,"isSuccessfulRunHandoffEscalationComment");function nX(e){return e==="issue.successful_run_handoff_escalated"?{className:"border-red-500/35 bg-red-500/10 text-red-950 dark:text-red-100",iconClassName:"text-red-600 dark:text-red-300"}:e==="issue.successful_run_handoff_required"?{className:"border-amber-300/70 bg-amber-50/90 text-amber-950 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100",iconClassName:"text-amber-600 dark:text-amber-300"}:{className:"border-line/60 text-ink-3",iconClassName:"text-ink-3"}}r(nX,"successfulRunHandoffActivityTone");var _2=[10,25,50];var hF=["backlog","done","cancelled"],u0=["backlog","todo","in_progress","in_review","blocked","done","cancelled"],gF={rail:"border-line bg-bg-3/20",railOver:"bg-bg-3/50 ring-1 ring-accent/20",header:"text-ink-3",count:"text-ink-3/60",body:"bg-bg-3/20",bodyOver:"bg-bg-3/40",card:""},xF={backlog:{rail:"border-line bg-bg-3/30",railOver:"bg-bg-3/50 ring-1 ring-neutral-400/25",header:"text-ink-3",count:"text-ink-3/60",body:"bg-bg-3/30 ring-1 ring-inset ring-line/50",bodyOver:"bg-bg-3/50 ring-1 ring-inset ring-neutral-400/25",card:""},todo:{rail:"border-amber-500/25 bg-amber-50/60 dark:bg-amber-950/20",railOver:"bg-amber-100/70 ring-1 ring-amber-500/25 dark:bg-amber-950/35",header:"text-amber-700 dark:text-amber-300",count:"text-amber-700/65 dark:text-amber-300/65",body:"bg-amber-50/45 ring-1 ring-inset ring-amber-500/15 dark:bg-amber-950/15",bodyOver:"bg-amber-100/70 ring-1 ring-inset ring-amber-500/25 dark:bg-amber-950/30",card:""},in_progress:{rail:"border-blue-500/25 bg-blue-50/60 dark:bg-blue-950/20",railOver:"bg-blue-100/70 ring-1 ring-blue-500/25 dark:bg-blue-950/35",header:"text-blue-700 dark:text-blue-300",count:"text-blue-700/65 dark:text-blue-300/65",body:"bg-blue-50/45 ring-1 ring-inset ring-blue-500/15 dark:bg-blue-950/15",bodyOver:"bg-blue-100/70 ring-1 ring-inset ring-blue-500/25 dark:bg-blue-950/30",card:""},blocked:{rail:"border-red-500/25 bg-red-50/60 dark:bg-red-950/20",railOver:"bg-red-100/70 ring-1 ring-red-500/25 dark:bg-red-950/35",header:"text-red-700 dark:text-red-300",count:"text-red-700/65 dark:text-red-300/65",body:"bg-red-50/45 ring-1 ring-inset ring-red-500/15 dark:bg-red-950/15",bodyOver:"bg-red-100/70 ring-1 ring-inset ring-red-500/25 dark:bg-red-950/30",card:""},in_review:{rail:"border-violet-500/25 bg-violet-50/60 dark:bg-violet-950/20",railOver:"bg-violet-100/70 ring-1 ring-violet-500/25 dark:bg-violet-950/35",header:"text-violet-700 dark:text-violet-300",count:"text-violet-700/65 dark:text-violet-300/65",body:"bg-violet-50/45 ring-1 ring-inset ring-violet-500/15 dark:bg-violet-950/15",bodyOver:"bg-violet-100/70 ring-1 ring-inset ring-violet-500/25 dark:bg-violet-950/30",card:""},done:{rail:"border-green-500/25 bg-green-50/60 dark:bg-green-950/20",railOver:"bg-green-100/70 ring-1 ring-green-500/25 dark:bg-green-950/35",header:"text-green-700 dark:text-green-300",count:"text-green-700/65 dark:text-green-300/65",body:"bg-green-50/45 ring-1 ring-inset ring-green-500/15 dark:bg-green-950/15",bodyOver:"bg-green-100/70 ring-1 ring-inset ring-green-500/25 dark:bg-green-950/30",card:""},cancelled:{rail:"border-neutral-300/70 bg-bg-3/25 opacity-80 dark:border-neutral-700/70 dark:bg-neutral-900/20",railOver:"bg-bg-3/45 opacity-90 ring-1 ring-neutral-400/25 dark:bg-neutral-900/35",header:"text-ink-3/80",count:"text-ink-3/50",body:"bg-bg-3/25 ring-1 ring-inset ring-line/50",bodyOver:"bg-bg-3/45 ring-1 ring-inset ring-neutral-400/25",card:"bg-bg-3/35 text-ink-3 opacity-80 hover:shadow-none"}};function bF(e){return xF[e]??gF}r(bF,"getKanbanColumnTone");function Yh(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(Yh,"statusLabel");function vF(e,t){return u0.includes(e)?e:t.find(s=>s.id===e)?.status??null}r(vF,"resolveKanbanTargetStatus");function yF({status:e,issues:t,agents:s,liveIssueIds:l,liveRunsByIssueId:c,pauseStateByIssueId:u,subtreeLiveCounts:p,compactCards:f=!1,collapsed:h=!1,visibleCount:g,revealIncrement:v,onShowMore:y}){const{setNodeRef:j,isOver:k}=OC({id:e});t.length;const S=h?[]:t.slice(0,g),N=Math.max(t.length-S.length,0),I=Math.min(v,N),C=bF(e);return h?(0,a.jsxs)("div",{ref:j,className:Y("flex min-h-(--sz-220px) w-(--sz-52px) shrink-0 flex-col items-center rounded-md border px-1.5 py-2 transition-colors",C.rail,k&&C.railOver),title:`${Yh(e)}: ${t.length}`,children:[(0,a.jsx)(Js,{status:e}),(0,a.jsx)("span",{className:Y("mt-2 [writing-mode:vertical-rl] rotate-180 text-(length:--text-nano) font-semibold uppercase tracking-wide",C.header),children:Yh(e)}),(0,a.jsx)(Dn,{variant:"ghost",className:Y("mt-auto bg-bg px-1.5 text-(length:--text-nano) tabular-nums",C.header),children:t.length})]}):(0,a.jsxs)("div",{className:"flex flex-col shrink-0 min-w-(--sz-260px) w-(--sz-260px)",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 mb-1",children:[(0,a.jsx)(Js,{status:e}),(0,a.jsx)("span",{className:Y("text-xs font-semibold uppercase tracking-wide",C.header),children:Yh(e)}),(0,a.jsx)("span",{className:Y("ml-auto text-xs tabular-nums",C.count),children:t.length})]}),(0,a.jsxs)("div",{ref:j,className:Y("flex-1 min-h-(--sz-120px) rounded-md p-2 space-y-1 transition-colors",k?C.bodyOver:C.body),children:[(0,a.jsx)(sx,{items:S.map(M=>M.id),strategy:zC,children:S.map(M=>(0,a.jsx)(E2,{issue:M,agents:s,isLive:l?.has(M.id),liveRuns:c?.get(M.id),pauseState:u?.get(M.id),subtreeLiveCount:p?.get(M.id)??0,compact:f,className:C.card},M.id))}),N>0?(0,a.jsxs)("button",{type:"button",className:"mt-1 flex w-full items-center justify-center rounded-md border border-dashed border-line bg-bg/70 px-2 py-2 text-xs font-medium text-ink-3 transition-colors hover:border-ink/30 hover:text-ink",onClick:y,children:["Show ",I," more"]}):null,t.length>0&&(N>0||t.length>=g)?(0,a.jsxs)("p",{className:"px-1 pt-1 text-(length:--text-micro) text-ink-3",children:["Showing ",S.length," of ",t.length]}):null]})]})}r(yF,"KanbanColumn");function E2({issue:e,agents:t,isLive:s,liveRuns:l,pauseState:c,subtreeLiveCount:u=0,isOverlay:p,compact:f=!1,className:h}){const{attributes:g,listeners:v,setNodeRef:y,transform:j,transition:k,isDragging:S}=ix({id:e.id,data:{issue:e}}),N={transform:ti.Transform.toString(j),transition:k},I=r(C=>!C||!t?null:t.find(M=>M.id===C)?.name??null,"agentName");return(0,a.jsx)(Hc,{ref:y,style:N,...g,...v,className:Y("block cursor-grab active:cursor-grabbing transition-shadow",S&&!p?"opacity-30":"",p?"shadow-lg ring-1 ring-accent/20":"hover:shadow-sm",f?"p-2":"p-2.5",h),children:(0,a.jsxs)(mn,{to:`/issues/${e.identifier??e.id}`,disableIssueQuicklook:!0,className:"block no-underline text-inherit",onClick:r(C=>{S&&C.preventDefault()},"onClick"),children:[(0,a.jsxs)("div",{className:`flex items-start gap-1.5 ${f?"mb-1":"mb-1.5"}`,children:[(0,a.jsx)("span",{className:"text-xs text-ink-3 font-mono shrink-0",children:e.identifier??e.id.slice(0,8)}),A2(e)?(0,a.jsxs)(Dn,{variant:"outline",className:"border-amber-400/45 bg-amber-50/60 px-1.5 text-(length:--text-nano) text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300",title:"This task needs a next step","aria-label":"Needs next step",children:[(0,a.jsx)(ni,{className:"h-3 w-3"}),"Next step"]}):null,c?(0,a.jsx)(kF,{state:c}):s&&(0,a.jsx)(jF,{runs:l}),!s&&u>0&&(0,a.jsxs)(Dn,{variant:"outline",className:"border-line px-1.5 text-(length:--text-nano) text-ink-3",title:`${u} sub-task${u===1?"":"s"} running below`,children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full border border-ink-3/60","aria-hidden":"true"}),u," live below"]})]}),(0,a.jsx)("p",{className:`${f?"mb-1.5 text-xs":"mb-2 text-sm"} leading-snug line-clamp-2`,children:e.title}),(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[!1,e.assigneeAgentId&&(()=>{const C=I(e.assigneeAgentId);return C?(0,a.jsx)(co,{agent:t?.find(M=>M.id===e.assigneeAgentId)??{id:e.assigneeAgentId,name:C},size:"xs"}):(0,a.jsx)("span",{className:"text-xs text-ink-3 font-mono",children:e.assigneeAgentId.slice(0,8)})})()]})]})})}r(E2,"KanbanCard");function jF({runs:e}){const t=C2(e??SF),s=e&&e.length>0?k2(e.map(c=>Nx(c,t))).health:"active",l=s==="stalled"?"Stalled":s==="quiet"?"Quiet":"Live";return(0,a.jsxs)("span",{"data-live-marker":l.toLowerCase(),"data-live-health":s,className:Y("inline-flex shrink-0 items-center gap-1 text-(length:--text-nano) font-medium",l==="Live"?"text-blue-600 dark:text-blue-400":"text-ink-2"),children:[l==="Live"?(0,a.jsxs)("span",{"aria-hidden":"true",className:"relative flex h-2 w-2",children:[(0,a.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75 motion-reduce:animate-none"}),(0,a.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}):(0,a.jsx)("span",{"aria-hidden":"true",className:"live-now-health-dot h-2 w-2 rounded-full"}),l]})}r(jF,"KanbanLiveMarker");var wF={pausing:"Pausing",paused:"Paused",pause_failed:"Pause failed"};function kF({state:e}){return(0,a.jsxs)("span",{"data-live-marker":e,"data-live-health":e,className:"inline-flex shrink-0 items-center gap-1 text-(length:--text-nano) font-medium text-ink-2",children:[(0,a.jsx)(B0,{"aria-hidden":"true",className:"live-now-health-icon h-3 w-3"}),wF[e]]})}r(kF,"KanbanPausedMarker");var SF=[];function NF({issues:e,agents:t,liveIssueIds:s,liveRunsByIssueId:l,pauseStateByIssueId:c,compactCards:u=!1,collapsedStatuses:p=[],initialVisibleCount:f=10,revealIncrement:h=10,onUpdateIssue:g}){const[v,y]=(0,x.useState)(null),j=`${f}:${h}`,[k,S]=(0,x.useState)({paginationKey:j,counts:{}}),N=k.paginationKey===j?k.counts:{},I=(0,x.useMemo)(()=>new Set(p),[p]),C=X0(Mc(Gf,{activationConstraint:{distance:5}})),M=(0,x.useMemo)(()=>{const z={};for(const E of u0)z[E]=[];for(const E of e)z[E.status]&&z[E.status].push(E);return z},[e]),R=(0,x.useMemo)(()=>v?e.find(z=>z.id===v):null,[v,e]),_=(0,x.useMemo)(()=>g2(e,s??new Set),[e,s]);function D(z){y(z.active.id)}r(D,"handleDragStart");function U(z){y(null);const{active:E,over:B}=z;if(!B)return;const O=E.id,Q=e.find(ue=>ue.id===O);if(!Q)return;const V=vF(B.id,e);V&&V!==Q.status&&g(O,{status:V})}r(U,"handleDragEnd");function K(z){}return r(K,"handleDragOver"),(0,a.jsxs)(nx,{sensors:C,onDragStart:D,onDragOver:K,onDragEnd:U,children:[(0,a.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-4 -mx-2 px-2",children:u0.map(z=>(0,a.jsx)(yF,{status:z,issues:M[z]??[],agents:t,liveIssueIds:s,liveRunsByIssueId:l,pauseStateByIssueId:c,subtreeLiveCounts:_,compactCards:u,collapsed:I.has(z)||I.size>0&&M[z].length===0,visibleCount:N[z]??f,revealIncrement:h,onShowMore:r(()=>{S(E=>{const B=E.paginationKey===j?E.counts:{};return{paginationKey:j,counts:{...B,[z]:(B[z]??f)+h}}})},"onShowMore")},z))}),(0,a.jsx)(r4,{children:R?(0,a.jsx)(E2,{issue:R,agents:t,isOverlay:!0,compact:u}):null})]})}r(NF,"KanbanBoard");function Nf(e,t){const s=new Set(e.map(p=>p.id)),l=r(p=>!p.parentId||!s.has(p.parentId)||t?.has(p.id)===!0,"isRoot"),c=e.filter(l),u=new Map;for(const p of e)if(p.parentId&&!l(p)){const f=u.get(p.parentId)??[];f.push(p),u.set(p.parentId,f)}return{roots:c,childMap:u}}r(Nf,"buildIssueTree");function I2(e,t){return(t.get(e)??[]).reduce((s,l)=>s+1+I2(l.id,t),0)}r(I2,"countDescendants");function aX(e,t){const s=new Map;for(const p of t){if(!p.parentId)continue;const f=s.get(p.parentId)??[];f.push(p),s.set(p.parentId,f)}const l=[],c=new Set([e]);let u=[e];for(;u.length>0;){const p=[];for(const f of u)for(const h of s.get(f)??[])c.has(h.id)||(c.add(h.id),l.push(h),p.push(h.id));u=p}return l}r(aX,"filterIssueDescendants");function CF(e,t){const s=e.currentExecutionWorkspace?.name??e.currentExecutionWorkspace?.branchName??e.currentExecutionWorkspace?.cwd??e.executionWorkspaceId??null,l=e.assigneeUserId&&e.assigneeUserId!==t?e.assigneeUserId??void 0:void 0;return{parentId:e.id,parentIdentifier:e.identifier??void 0,parentTitle:e.title,...e.projectId?{projectId:e.projectId}:{},...e.projectWorkspaceId?{projectWorkspaceId:e.projectWorkspaceId}:{},...e.goalId?{goalId:e.goalId}:{},...e.executionWorkspaceId?{executionWorkspaceId:e.executionWorkspaceId}:{},...e.executionWorkspaceId?{executionWorkspaceMode:"reuse_existing"}:e.executionWorkspacePreference?{executionWorkspaceMode:e.executionWorkspacePreference}:{},...s?{parentExecutionWorkspaceLabel:s}:{},...e.assigneeAgentId?{assigneeAgentId:e.assigneeAgentId}:{},...l?{assigneeUserId:l}:{}}}r(CF,"buildSubIssueDefaultsForViewer");function T2(){return typeof localStorage>"u"?null:localStorage}r(T2,"browserStorage");function Xh(e,t){if(!t)return null;try{const s=e.getItem(t);return s==null?null:JSON.parse(s)}catch{return null}}r(Xh,"parseStoredJson");function R2({companyId:e,collectionKey:t}){return`wardmote:task-collection:v1:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}r(R2,"taskCollectionPreferencesStorageKey");function AF(e,t){if(!e||typeof e!="object")return!1;const s=e;return s.version===1&&s.companyId===t.companyId&&s.collectionKey===t.collectionKey&&"viewState"in s&&Array.isArray(s.columns)}r(AF,"isCurrentEnvelope");function d0(e,t,s=T2()){if(!s)return;const l={version:1,companyId:e.companyId,collectionKey:e.collectionKey,viewState:t.viewState,viewStateSource:t.viewStateSource??"stored",columns:t.columns};try{s.setItem(R2(e),JSON.stringify(l)),e.legacyViewStorageKey&&s.setItem(e.legacyViewStorageKey,JSON.stringify(t.viewState)),e.legacyColumnsStorageKey&&s.setItem(e.legacyColumnsStorageKey,JSON.stringify(t.columns))}catch{}}r(d0,"saveTaskCollectionPreferences");function _F({storage:e=T2(),defaultViewState:t,defaultColumns:s,normalizeViewState:l,normalizeColumns:c,...u}){if(!e)return{viewState:t,columns:s,migrated:!1,source:"default"};const p=Xh(e,R2(u));if(AF(p,u))return{viewState:l(p.viewState),columns:c(p.columns),migrated:!1,source:p.viewStateSource==="default"?"default":"current"};const f=Xh(e,u.legacyViewStorageKey),h=Xh(e,u.legacyColumnsStorageKey),g=f!==null||h!==null,v={viewState:f===null?t:l(f),columns:h===null?s:c(h)};return g&&d0(u,{...v,viewStateSource:f===null?"default":"stored"},e),{...v,migrated:g,source:f!==null?"legacy":"default"}}r(_F,"loadTaskCollectionPreferences");var EF={today:"Today",yesterday:"Yesterday",earlier:"Earlier"};function Fk(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}r(Fk,"localCalendarOrdinal");function IF(e,t=new Date){const s=e instanceof Date?e:new Date(e);if(Number.isNaN(s.getTime()))return"earlier";const l=Math.round((Fk(t)-Fk(s))/864e5);return l<=0?"today":l===1?"yesterday":"earlier"}r(IF,"taskDateGroup");function TF(e,t){return e===t||e===null&&t==="earlier"?null:EF[t]}r(TF,"taskDateGroupSeparator");var Td=200,Rd=200;function Hk(e){const t=new Date(e.startedAt??e.createdAt).getTime();return Number.isFinite(t)?t:0}r(Hk,"runStartMs");function RF(e,t){const s=new Map(t.map(c=>[c.id,c.status])),l=new Map;for(const c of e??[]){if(!c.issueId||!c.modelFallback||!mo(c,s.get(c.issueId)))continue;const u=l.get(c.issueId);(!u||Hk(c)>Hk(u))&&l.set(c.issueId,c)}return l}r(RF,"fallbackRunsByIssueId");function Md(e){return e.type==="group"?`group:${e.key}`:`issue:${e.issue.id}`}r(Md,"issuesListNavEntryKey");function Vk(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}r(Vk,"escapeAttrValue");function MF(e){const t=[],s=new Array(e.length);for(let c=0;c<e.length;c+=1){let u=0,p=t.length;for(;u<p;){const f=u+p>>1;e[t[f]]<e[c]?u=f+1:p=f}s[c]=u>0?t[u-1]:-1,t[u]=c}const l=[];for(let c=t.length>0?t[t.length-1]:-1;c>=0;c=s[c])l.push(c);return l.reverse()}r(MF,"longestIncreasingSubsequence");function DF(e,t){const s=new Map;e?.keys.forEach((f,h)=>s.set(f,h));const l=[],c=[];t.forEach((f,h)=>{const g=s.get(f);g!==void 0&&(l.push(g),c.push(h))});const u=new Set(MF(l).map(f=>c[f])),p=new Map;return{keys:t,generations:p,renderKeys:t.map((f,h)=>{const g=e?.generations.get(f)??0,v=s.has(f)&&!u.has(h)?g+1:g;return v===0?f:(p.set(f,v),`${f}~${v}`)})}}r(DF,"insertionStableRowKeys");var M2=100,OF=150,LF=320;function zF(e){if(!e||typeof window>"u")return null;let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){const s=window.getComputedStyle(t).overflowY;if(s==="auto"||s==="scroll"||s==="overlay")return t;t=t.parentElement}return null}r(zF,"findIssuesScrollContainer");var PF=Bc,$F={backlog:"Backlog",todo:"Todo",in_progress:"In progress",in_review:"In review",done:"Done",blocked:"Blocked",cancelled:"Cancelled"},UF={backlog:"bg-ink-3/40",todo:"bg-blue-500",in_progress:"bg-yellow-500",in_review:"bg-violet-500",done:"bg-green-500",blocked:"bg-red-500",cancelled:"bg-neutral-400"},Kd={...G1,sortField:"updated",sortDir:"desc",groupBy:"none",viewMode:"list",nestingEnabled:!0,showDateGroupSeparators:!0,collapsedGroups:[],collapsedParents:[],boardCardDensity:"auto",boardColdLaneMode:"expanded",boardColumnPageSize:10};function BF(e){return e==="compact"||e==="comfortable"||e==="auto"?e:"auto"}r(BF,"normalizeBoardCardDensity");function KF(e){return e==="collapsed"||e==="expanded"||e==="auto"?e:"auto"}r(KF,"normalizeBoardColdLaneMode");function qF(e){return _2.includes(e)?e:10}r(qF,"normalizeBoardColumnPageSize");function FF(e){const t=e&&typeof e=="object"?e:{};return{...Kd,...t,...tT(t),workspaces:[],sortField:["status","priority","title","created","updated","workflow"].includes(t.sortField??"")?t.sortField:Kd.sortField,sortDir:t.sortDir==="asc"?"asc":"desc",groupBy:["status","priority","assignee","project","workspace","parent","none"].includes(t.groupBy??"")?t.groupBy:Kd.groupBy,viewMode:t.viewMode==="board"?"board":"list",nestingEnabled:t.nestingEnabled!==!1,showDateGroupSeparators:t.showDateGroupSeparators!==!1,collapsedGroups:Array.isArray(t.collapsedGroups)?t.collapsedGroups.filter(s=>typeof s=="string"):[],collapsedParents:Array.isArray(t.collapsedParents)?t.collapsedParents.filter(s=>typeof s=="string"):[],boardCardDensity:BF(t.boardCardDensity),boardColdLaneMode:KF(t.boardColdLaneMode),boardColumnPageSize:qF(t.boardColumnPageSize)}}r(FF,"normalizeIssueViewState");function HF(e,t,s){const l=e.source==="default"&&s?{...e.viewState,sortField:s,sortDir:"asc"}:e.viewState;return t?{...l,assignees:t,statuses:[]}:l}r(HF,"getInitialViewState");function Wk(e,t,s,l,c){const u=HF(e,t,l),p=s?{...u,workspaces:s,statuses:[]}:u;return c?{...p,statuses:c}:p}r(Wk,"getInitialWorkspaceViewState");function VF(e){return`${e}:issue-columns`}r(VF,"getIssueColumnsStorageKey");function D2(e,t){const s=e?`${t}:${e}`:t;return{companyId:e??"__unscoped__",collectionKey:t,legacyViewStorageKey:s,legacyColumnsStorageKey:VF(s)}}r(D2,"issueCollectionPreferenceLocation");function sX(e,t){return f0(D2(e,t)).viewState.showHiddenTasks}r(sX,"loadStoredShowHiddenTasks");function f0(e){return _F({...e,defaultViewState:Kd,defaultColumns:ZN,normalizeViewState:FF,normalizeColumns:r(t=>tC(Array.isArray(t)?t:[]),"normalizeColumns")})}r(f0,"loadIssueCollectionPreferences");function WF(e,t){if(t.sortField==="workflow"){const c=h2(e);return t.sortDir==="desc"?[...c].reverse():c}const s=[...e],l=t.sortDir==="asc"?1:-1;return s.sort((c,u)=>{switch(t.sortField){case"status":return l*(Xd.indexOf(c.status)-Xd.indexOf(u.status));case"priority":return l*(cg.indexOf(c.priority)-cg.indexOf(u.priority));case"title":return l*c.title.localeCompare(u.title);case"created":return l*(new Date(c.createdAt).getTime()-new Date(u.createdAt).getTime());case"updated":return l*GF(c,u);default:return 0}}),s}r(WF,"sortIssues");var Qk=new Map;function QF(e,t,s,l,c){const u=Math.min(s.length,Math.max(M2,c));if(!e||e.identity!==t)return u;if(e.ids===s)return Math.min(s.length,Math.max(e.limit,l,u));const p=new Map;s.forEach((g,v)=>p.set(g,v));const f=Math.min(e.limit,e.ids.length);let h=-1;for(let g=0;g<f;g+=1){const v=p.get(e.ids[g]);v!==void 0&&v>h&&(h=v)}return Math.min(s.length,Math.max(h+1,l,u))}r(QF,"nextIssueRowRenderLimit");function p0(e){return e.lastActivityAt??e.updatedAt}r(p0,"issueRecencyDate");function GF(e,t){const s=new Date(p0(e)).getTime()-new Date(p0(t)).getTime();return s!==0?s:new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}r(GF,"compareIssueRecency");function YF(e){return e.sortDir!=="desc"?null:e.sortField==="created"?t=>t.createdAt:e.sortField==="updated"?p0:null}r(YF,"issueDateSeparatorDate");var O2=864e5,XF=7*O2;function ZF(e,t=Date.now()){const s=t-new Date(e).getTime();return s<O2?0:s<XF?1:2}r(ZF,"issueAgeBucket");function JF(e){return e===1?"Older than a day":"Older than a week"}r(JF,"issueAgeSeparatorLabel");function eH(e,t){const s=[];return e<1&&t>=1&&s.push(1),e<2&&t>=2&&s.push(2),s}r(eH,"issueAgeBucketsCrossed");function Gk({label:e}){return(0,a.jsxs)("div",{className:"flex items-center gap-3 px-3 py-1.5 sm:pl-0 sm:pr-4",role:"separator","aria-label":e,"data-issues-date-separator":"",children:[(0,a.jsx)("span",{className:"h-px min-w-0 flex-1 bg-line/80","aria-hidden":"true","data-date-group-rule":""}),(0,a.jsx)("span",{className:"shrink-0 text-(length:--text-nano) font-medium uppercase tracking-wider text-ink-3/70","data-date-group-label":"",children:e}),(0,a.jsx)("span",{className:"h-px min-w-0 flex-1 bg-line/80","aria-hidden":"true","data-date-group-rule":""})]})}r(Gk,"IssueDateSeparator");function tH(e){return e!=="done"&&e!=="cancelled"&&e!=="blocked"}r(tH,"isActionableWorkflowStatus");function nH(e,t){const s=new Map;if(!t)return e.forEach((p,f)=>{s.set(p.id,String(f+1))}),s;const{roots:l,childMap:c}=Nf(e),u=r((p,f)=>{p.forEach((h,g)=>{const v=f?`${f}.${g+1}`:String(g+1);s.set(h.id,v),u(c.get(h.id)??[],v)})},"visit");return u(l,null),e.forEach((p,f)=>{s.has(p.id)||s.set(p.id,String(f+1))}),s}r(nH,"buildChecklistStepNumberMap");function aH(e,t){const s=new Map;if(!t){const p=new Map;for(const f of e){if(!f.parentId)continue;const h=p.get(f.parentId);h&&s.set(f.id,h.id),p.set(f.parentId,f)}return s}const{roots:l,childMap:c}=Nf(e),u=r(p=>{p.forEach((f,h)=>{const g=h>0?p[h-1]:null;f.parentId&&g?.parentId===f.parentId&&s.set(f.id,g.id),u(c.get(f.id)??[])})},"visit");return u(l),s}r(aH,"buildPreviousSiblingIssueIdMap");function sH(e,t,s){return!!(e.parentId&&s&&(e.blockedBy??[]).length===1&&t.length===1&&t[0]===s)}r(sH,"shouldSuppressSinglePreviousSiblingBlockerChip");function iH({context:e,search:t,controls:s}){return(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 sm:gap-3",children:[e,t]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:s})]})}r(iH,"LegacyIssuesToolbar");function rH({value:e,context:t,onDebouncedChange:s}){return(0,a.jsx)(l9,{value:e,context:t,onChange:r(({raw:l})=>s(l),"onChange"),ariaLabel:"Search tasks",className:"w-full sm:w-64 md:w-80",inputClassName:"text-xs sm:text-sm",pageSearchTarget:!0,onKeyDown:r(l=>{if(D8({key:l.key,isComposing:l.nativeEvent.isComposing})){l.currentTarget.blur();return}O8({key:l.key,isComposing:l.nativeEvent.isComposing,currentValue:l.currentTarget.value})&&l.currentTarget.blur()},"onKeyDown")})}r(rH,"IssueSearchInput");function lH({summary:e,issueLinkState:t,parentIssueIdForCostSummary:s}){const l=e.target,c=l?.issue??null,u=c?.identifier??c?.id??"",p=c?k0(t,c):void 0,f=Bc.map(k=>({status:k,count:e.countsByStatus[k]??0})).filter(k=>k.count>0),h=e.inProgressCount>0,g=Q7({visibleMs:5e3}),{data:v}=me({queryKey:P.issues.costSummary(s??"pending",{excludeRoot:!0}),queryFn:r(()=>on.getCostSummary(s,{excludeRoot:!0}),"queryFn"),enabled:!!s,refetchInterval:h?g:!1}),y=v?v.inputTokens+v.cachedInputTokens+v.outputTokens:0,j=!!v&&(v.runCount>0||y>0);return(0,a.jsx)("div",{className:"border border-line bg-bg p-3",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm",children:[(0,a.jsxs)("span",{className:"font-medium text-ink",children:[e.doneCount,"/",e.totalCount," done"]}),(0,a.jsxs)("span",{className:"text-ink-3",children:[e.inProgressCount," in progress"]}),(0,a.jsxs)("span",{className:"text-ink-3",children:[e.blockedCount," blocked"]}),j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"text-ink-3 tabular-nums",title:`${v.runCount.toLocaleString()} run${v.runCount===1?"":"s"} across ${v.issueCount} sub-task${v.issueCount===1?"":"s"}`,children:[RE(y)," tokens"]}),(0,a.jsxs)("span",{className:"text-ink-3 tabular-nums",children:[CE(v.runtimeMs)," runtime"]})]})]}),(0,a.jsx)("div",{role:"progressbar","aria-label":"Sub-tasks completion progress","aria-valuemin":0,"aria-valuenow":e.doneCount,"aria-valuemax":e.totalCount,className:"flex h-2 w-full overflow-hidden rounded-full bg-bg-3",children:f.map(({status:k,count:S})=>(0,a.jsx)("span",{className:Y("h-full",UF[k]),style:{width:`${S/e.totalCount*100}%`},title:`${$F[k]}: ${S}`,"aria-hidden":"true"},k))})]}),(0,a.jsx)("div",{className:"min-w-0 border border-line bg-bg px-3 py-2 text-sm lg:w-72",children:l&&c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-xs font-medium text-ink-3",children:l.kind==="next"?"Next up":"Waiting on blockers"}),(0,a.jsxs)(mn,{to:Hd(u),state:p,issuePrefetch:c,className:"mt-1 block min-w-0 text-ink underline-offset-2 hover:underline",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-ink-3",children:c.identifier??c.id.slice(0,8)})," ",(0,a.jsx)("span",{children:c.title})]})]}):e.totalCount===0?(0,a.jsx)("div",{className:"text-sm font-medium text-ink",children:"No active sub-tasks"}):e.doneCount===e.totalCount?(0,a.jsx)("div",{className:"text-sm font-medium text-ink",children:"All sub-tasks done"}):(0,a.jsx)("div",{className:"text-sm font-medium text-ink",children:"No actionable sub-tasks"})})]})})}r(lH,"SubIssueProgressSummaryStrip");var Yk=["","pl-4 sm:pl-0","pl-8 sm:pl-0","pl-12 sm:pl-0","pl-16 sm:pl-0"];function oH(e){return(0,a.jsx)(cH,{...e})}r(oH,"IssuesList");function cH({issues:e,isLoading:t,error:s,agents:l,projects:c,liveIssueIds:u,liveRuns:p,projectId:f,viewStateKey:h,issueLinkState:g,initialAssignees:v,initialWorkspaces:y,initialStatuses:j,initialSearch:k,searchFilters:S,searchWithinLoadedIssues:N=!1,baseCreateIssueDefaults:I,createIssueLabel:C,defaultSortField:M,showProgressSummary:R=!1,parentIssueIdForCostSummary:_,enableRoutineVisibilityFilter:D=!1,onShowHiddenTasksChange:U,hasMoreIssues:K=!1,isLoadingMoreIssues:z=!1,mutedIssueIds:E,issueBadgeById:B,onLoadMoreIssues:O,onSearchChange:Q,rowPresentation:V="legacy",toolbarContext:ue,toolbarPresentation:ce="legacy",listHeader:X,onUpdateIssue:A}){const ee=(0,x.useRef)(null),ie=ja(),le=hn().key,Ae=kn(),[de,we]=(0,x.useState)(null),ye=(0,x.useRef)(!0);(0,x.useEffect)(()=>{const F=r(()=>{ye.current=!0},"handlePointerMove");return window.addEventListener("mousemove",F,{passive:!0}),()=>window.removeEventListener("mousemove",F)},[]);const Me=(0,x.useRef)(null),he=(0,x.useCallback)(F=>{ye.current&&(Me.current=F,we(W=>W===null?W:null))},[]),{selectedCompanyId:ve}=vt(),{openNewIssue:et}=$s(),{data:Pe}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),{data:Ee}=me({queryKey:P.access.companyUserDirectory(ve),queryFn:r(()=>ei.listUserDirectory(ve),"queryFn"),enabled:!!ve}),{data:ct}=me({queryKey:P.instance.experimentalSettings,queryFn:r(()=>pa.getExperimental(),"queryFn"),retry:!1}),Ve=Pe?.user?.id??Pe?.session?.userId??null,yt=ct!==void 0,Zt=ct?.enableIsolatedWorkspaces===!0,ge=ct?.enableExternalObjects===!0,Oe=ve?`${h}:${ve}`:h,De=D2(ve,h),ut=v?.join("|")??"",Ht=y?.join("|")??"",Vt=j?`set:${j.join("|")}`:"",gt=(0,x.useRef)(null);gt.current===null&&(gt.current=f0(De));const cn=gt.current,[$,qe]=(0,x.useState)(()=>Wk(cn,v,y,M,j)),[Xe,xt]=(0,x.useState)(null),[at,Kt]=(0,x.useState)(""),[ea,Jt]=(0,x.useState)(k??""),[Mt,Gt]=(0,x.useState)(M2),[dt,On]=(0,x.useState)(cn.columns),mt=(0,x.useRef)(!1),[Nn,It]=(0,x.useState)(!1),en=(0,x.useDeferredValue)(ea).trim().toLowerCase();(0,x.useEffect)(()=>{Jt(k??"")},[k]);const{data:qt}=me({queryKey:P.issues.labels(ve),queryFn:r(()=>on.listLabels(ve),"queryFn"),enabled:!!ve}),Tt=(0,x.useMemo)(()=>({currentUserId:Ve,agents:l,projects:c,labels:qt}),[l,Ve,qt,c]),At=(0,x.useMemo)(()=>uo(en,Tt),[en,Tt]),_e=At.query,Re=_e.length>0||aA(At.filters),lt=Re&&!N;(0,x.useEffect)(()=>{Re||It(!1)},[Re]);const Dt=(0,x.useRef)(`${Oe}::${ut}::${Ht}::${Vt}`);(0,x.useEffect)(()=>{const F=`${Oe}::${ut}::${Ht}::${Vt}`;if(Dt.current!==F){Dt.current=F;const W=f0(De);qe(Wk(W,v,y,M,j)),On(W.columns)}},[Oe,v,ut,y,Ht,j,Vt,M,De.companyId,De.collectionKey,De.legacyViewStorageKey,De.legacyColumnsStorageKey]);const Le=(0,x.useCallback)(F=>{qe(W=>{const J={...W,...F};return d0(De,{viewState:J,columns:dt}),J})},[De.companyId,De.collectionKey,De.legacyColumnsStorageKey,De.legacyViewStorageKey,dt]);(0,x.useEffect)(()=>{!yt||ge||$.externalObjectStatuses.length===0||Le({externalObjectStatuses:[]})},[yt,ge,Le,$.externalObjectStatuses.length]),(0,x.useEffect)(()=>{const F=new Set(e.map(J=>J.parentId).filter(Boolean)),W=$.collapsedParents.filter(J=>F.has(J));W.length!==$.collapsedParents.length&&Le({collapsedParents:W})},[e]);const Ot=U!==void 0,Rt=Ot&&$.showHiddenTasks;(0,x.useEffect)(()=>{U?.(Rt)},[Rt,U]);const Lt=(0,x.useMemo)(()=>{if(!Re)return{};const F={...hP($),...iA(At.filters)};return f&&(F.projectId=f),F},[Re,At.filters,f,$]),{data:tn=[]}=me({queryKey:[...P.issues.search(ve,_e,f),S??{},Lt,"compact",Td,D?"with-routine-executions":"without-routine-executions",Rt?"with-hidden":"without-hidden"],queryFn:r(({signal:F})=>on.listCompact(ve,{...Lt,..._e.length>0?{q:_e}:{},projectId:f,limit:Td,...S,...D?{includeRoutineExecutions:!0}:{},...Rt?{includeHidden:!0}:{}},{signal:F}).then(W=>W),"queryFn"),enabled:!!ve&&lt,placeholderData:r(F=>F,"placeholderData")}),Wt=_f({queries:PF.map(F=>({queryKey:[...P.issues.list(ve??"__no-company__"),"board-column",F,_e,Lt,f??"__all-projects__",S??{},"compact",Rd,D?"with-routine-executions":"without-routine-executions",Rt?"with-hidden":"without-hidden"],queryFn:r(({signal:W})=>Lt.status&&!Lt.status.split(",").includes(F)?Promise.resolve([]):on.listCompact(ve,{...Lt,...S,..._e.length>0?{q:_e}:{},projectId:f,status:F,limit:Rd,...D?{includeRoutineExecutions:!0}:{},...Rt?{includeHidden:!0}:{}},{signal:W}).then(J=>J),"queryFn"),enabled:!!ve&&$.viewMode==="board"&&!N,placeholderData:r(W=>W,"placeholderData")}))}),{data:Ln=[]}=me({queryKey:ve?P.executionWorkspaces.summaryList(ve):["execution-workspaces","__disabled__"],queryFn:r(()=>Jf.listSummaries(ve),"queryFn"),enabled:!!ve&&Zt}),gn=(0,x.useCallback)(F=>!F||!l?null:l.find(W=>W.id===F)?.name??null,[l]),zn=(0,x.useMemo)(()=>zP(Ee?.users),[Ee?.users]),ss=(0,x.useMemo)(()=>PP(Ee?.users),[Ee?.users]),Da=(0,x.useMemo)(()=>{const F=new Map;for(const W of c??[])F.set(W.id,{name:W.name,color:W.color??null});return F},[c]),wa=(0,x.useMemo)(()=>{const F=new Map;for(const W of c??[])for(const J of W.workspaces??[])F.set(J.id,{name:J.name||W.name,projectId:W.id});return F},[c]),ka=(0,x.useMemo)(()=>{const F=new Map;for(const W of c??[]){const J=W.executionWorkspacePolicy?.defaultProjectWorkspaceId??W.primaryWorkspace?.id??null;J&&F.set(W.id,J)}return F},[c]),Qn=(0,x.useMemo)(()=>new Set(ka.values()),[ka]),jt=(0,x.useMemo)(()=>{const F=new Map;for(const W of Ln){const J=W.projectWorkspaceId?wa.get(W.projectWorkspaceId)??null:null;F.set(W.id,{name:W.name,mode:W.mode,projectWorkspaceId:W.projectWorkspaceId??null,projectId:J?.projectId??null})}return F},[Ln,wa]),un=(0,x.useMemo)(()=>({executionWorkspaceById:jt,defaultProjectWorkspaceIdByProjectId:ka}),[ka,jt]),Oa=(0,x.useMemo)(()=>{const F=new Map;for(const[W,J]of wa)Gy({id:W},Qn)&&F.set(W,J.name);for(const[W,J]of jt)Gy({id:W,mode:J.mode,projectWorkspaceId:J.projectWorkspaceId},Qn)&&F.set(W,J.name);return F},[Qn,jt,wa]),ai=(0,x.useMemo)(()=>{const F=new Map,W=new Set;Ve&&F.set(`user:${Ve}`,{id:`user:${Ve}`,label:Ve==="local-board"?"Board":"Me",kind:"user",searchText:Ve==="local-board"?"board me human local-board":`me board human ${Ve}`});for(const J of e)if(J.createdByUserId){const Ie=`user:${J.createdByUserId}`;F.has(Ie)||F.set(Ie,{id:Ie,label:Vr(J.createdByUserId,Ve)??J.createdByUserId.slice(0,5),kind:"user",searchText:`${J.createdByUserId} board user human`})}for(const J of l??[]){W.add(J.id);const Ie=`agent:${J.id}`;F.has(Ie)||F.set(Ie,{id:Ie,label:J.name,kind:"agent",searchText:`${J.name} ${J.id} agent`})}for(const J of e)if(J.createdByAgentId&&!W.has(J.createdByAgentId)){const Ie=`agent:${J.createdByAgentId}`;F.has(Ie)||F.set(Ie,{id:Ie,label:J.createdByAgentId.slice(0,8),kind:"agent",searchText:`${J.createdByAgentId} agent`})}return[...F.values()].sort((J,Ie)=>J.kind!==Ie.kind?J.kind==="user"?-1:1:J.label.localeCompare(Ie.label))},[l,Ve,e]),pn=(0,x.useMemo)(()=>new Set(dt),[dt]),Us=(0,x.useMemo)(()=>Q5(Zt),[Zt]),Pn=(0,x.useMemo)(()=>new Set(Us),[Us]),ra=(0,x.useMemo)(()=>g2(e,u??new Set),[e,u]),ma=(0,x.useMemo)(()=>RF(p,e),[e,p]),ha=(0,x.useMemo)(()=>K9.filter(F=>pn.has(F)&&Pn.has(F)&&(V==="legacy"||F!=="updated")),[Pn,V,pn]),$n=(0,x.useMemo)(()=>{const F=new Map;for(const W of e)F.set(W.id,W);return F},[e]),Gn=(0,x.useMemo)(()=>{const F=new Map;for(const W of e)F.set(W.id,W.identifier?`${W.identifier}: ${W.title}`:W.title);return F},[e]),La=(0,x.useMemo)(()=>{if($.viewMode!=="board"||N)return null;const F=new Map;let W=!1;for(const J of Wt){W||=J.isPending;for(const Ie of J.data??[])F.set(Ie.id,Ie)}return F.size>0?[...F.values()]:W?e:[]},[Wt,e,N,$.viewMode]),xn=(0,x.useMemo)(()=>$.viewMode==="board"&&!N&&Wt.some(F=>(F.data?.length??0)===Rd),[Wt,N,$.viewMode]),is=(0,x.useMemo)(()=>La??(lt?tn:e),[La,e,lt,tn]),Sa=(0,x.useMemo)(()=>{if(!Re||!N)return is;const F=Ig(_e);return is.filter(W=>dw(W,F)&&fw(W,At.filters))},[Re,_e,At.filters,N,is]),In=lt&&!Nn&&$.viewMode==="list",ga=$.externalObjectStatuses.length>0,Bs=(0,x.useMemo)(()=>$.viewMode==="list"||ga?Sa.map(F=>F.id):[],[ga,Sa,$.viewMode]),{summaries:Ks,isLoading:rs,isReady:Ha}=e9(ve,Bs),Na=(0,x.useMemo)(()=>({...un,externalObjectSummaryByIssueId:Ks,externalObjectSummariesReady:Ha&&!rs}),[rs,Ha,Ks,un]),za=ga&&rs&&!Ha,ht=(0,x.useMemo)(()=>{const F=dg(Sa,$,Ve,D,u,Na);return In?F:WF(F,$)},[In,Sa,$,Ve,D,u,Na]),Un=(0,x.useMemo)(()=>c9(R,e.length)?u9(e):null,[e,R]),si=(0,x.useMemo)(()=>M==="workflow"&&$.groupBy==="none",[M,$.groupBy]),ii=(0,x.useMemo)(()=>{if(!si)return null;const F=new Set(ht.map(Fe=>Fe.id)),W=nH(ht,$.nestingEnabled),J=aH(ht,$.nestingEnabled),Ie=new Map;return ht.forEach(Fe=>{const bt=(Fe.blockedBy??[]).map(pt=>pt.id).filter(pt=>{if(!F.has(pt))return!1;const an=$n.get(pt);return an?an.status!=="done"&&an.status!=="cancelled":!1}),Kn=sH(Fe,bt,J.get(Fe.id));Ie.set(Fe.id,Kn?[]:bt)}),{stepNumberByIssueId:W,unresolvedVisibleBlockersByIssueId:Ie,currentStepIssueId:(ht.find(Fe=>tH(Fe.status))??null??ht.find(Fe=>Fe.status==="blocked")??null)?.id??null}},[si,ht,$n,$.nestingEnabled]),Va=sT($,D,Ot),se=(0,x.useMemo)(()=>{if(Va===0&&!Re)return null;const F=Ig(_e),W=Re?new Set(Sa.map(J=>J.id)):null;return J=>dg([J],$,Ve,D,u,Na).length>0&&(W===null||W.has(J.id)||dw(J,F)&&fw(J,At.filters))},[Va,Ve,D,Na,Re,_e,u,At.filters,Sa,$]),Te=(0,x.useMemo)(()=>{if($.viewMode!=="board")return;const F=new Map(is.map(W=>[W.id,W.status]));return new Map(S2(p,F).map(W=>[W.issueId,W.runs]))},[p,is,$.viewMode]),Je=X7(ve,$.viewMode==="board"),Qe=(0,x.useMemo)(()=>new Map(Je.map(F=>[F.issueId,F.state])),[Je]),zt=$.viewMode==="board"&&ht.length>100,Qt=$.boardCardDensity==="compact"||$.boardCardDensity==="auto"&&zt,Z=(0,x.useMemo)(()=>$.boardColdLaneMode==="collapsed"||$.boardColdLaneMode==="auto"&&zt?[...hF]:[],[zt,$.boardColdLaneMode]),Ne=$.boardCardDensity!=="auto"||$.boardColdLaneMode!=="auto"||$.boardColumnPageSize!==10,Be=(0,x.useMemo)(()=>{if($.groupBy==="none")return[{key:"__all",label:null,items:ht}];if($.groupBy==="status"){const W=Gl(ht,J=>J.status);return Xd.filter(J=>W[J]?.length).map(J=>({key:J,label:ug(J),items:W[J]}))}if($.groupBy==="priority"){const W=Gl(ht,J=>J.priority);return cg.filter(J=>W[J]?.length).map(J=>({key:J,label:ug(J),items:W[J]}))}if($.groupBy==="workspace"){const W=Gl(ht,J=>Qy(J,un)??"__no_workspace");return Object.keys(W).sort((J,Ie)=>J==="__no_workspace"?1:Ie==="__no_workspace"?-1:(W[Ie]?.length??0)-(W[J]?.length??0)).map(J=>({key:J,label:J==="__no_workspace"?"No Workspace":Oa.get(J)??J.slice(0,8),items:W[J]}))}if($.groupBy==="project"){const W=Gl(ht,J=>J.projectId??"__no_project");return Object.keys(W).sort((J,Ie)=>{if(J==="__no_project")return 1;if(Ie==="__no_project")return-1;const Fe=Da.get(J)?.name??J,bt=Da.get(Ie)?.name??Ie;return Fe.localeCompare(bt)}).map(J=>({key:J,label:J==="__no_project"?"No Project":Da.get(J)?.name??J.slice(0,8),items:W[J]}))}if($.groupBy==="parent"){const W=Gl(ht,J=>J.parentId??"__no_parent");return Object.keys(W).sort((J,Ie)=>J==="__no_parent"?1:Ie==="__no_parent"?-1:(W[Ie]?.length??0)-(W[J]?.length??0)).map(J=>({key:J,label:J==="__no_parent"?"No Parent":Gn.get(J)??J.slice(0,8),items:W[J]}))}const F=Gl(ht,W=>W.assigneeAgentId??(W.assigneeUserId?`__user:${W.assigneeUserId}`:"__unassigned"));return Object.keys(F).map(W=>({key:W,label:W==="__unassigned"?"Unassigned":W.startsWith("__user:")?Vr(W.slice(7),Ve,zn)??"User":gn(W)??W.slice(0,8),items:F[W]}))},[ht,un,$.groupBy,l,gn,Ve,Oa,Gn,zn,Da]),$e=(0,x.useMemo)(()=>JSON.stringify([Oe,en,$.statuses,$.priorities,$.assignees,$.creators,$.labels,$.projects,$.workspaces,$.liveOnly??!1,$.externalObjectStatuses,$.hideRoutineExecutions,Rt,$.sortField,$.sortDir,$.groupBy,$.viewMode,$.nestingEnabled,In]),[Oe,en,$.statuses,$.priorities,$.assignees,$.creators,$.labels,$.projects,$.workspaces,$.liveOnly,$.externalObjectStatuses,$.hideRoutineExecutions,Rt,$.sortField,$.sortDir,$.groupBy,$.viewMode,$.nestingEnabled,In]),st=(0,x.useRef)({identity:"",keptRootIds:new Set,seenIds:new Set,knownIds:new Set}),it=(0,x.useMemo)(()=>{const F=new Map;if($.viewMode!=="list")return F;const W=st.current.identity===$e?st.current:null;for(const J of Be){if(!$.nestingEnabled){F.set(J.key,{roots:J.items,childMap:new Map});continue}let Ie;if(W){Ie=new Set(W.keptRootIds);for(const Fe of J.items)Fe.parentId&&!W.knownIds.has(Fe.id)&&W.seenIds.has(Fe.parentId)&&Ie.add(Fe.id)}F.set(J.key,Nf(J.items,Ie))}return F},[Be,$e,$.nestingEnabled,$.viewMode]),Pt=r(F=>it.get(F.key)??($.nestingEnabled?Nf(F.items):{roots:F.items,childMap:new Map}),"issueTreeForGroup"),bn=(0,x.useMemo)(()=>{if($.viewMode!=="list")return[];const F=[];let W=0;for(const J of Be){const Ie=!!J.label&&$.collapsedGroups.includes(J.key);J.label&&F.push({type:"group",key:J.key,collapsed:Ie});const{roots:Fe,childMap:bt}=Pt(J),Kn=r(pt=>{W+=1;const an=bt.get(pt.id)??[],An=!$.collapsedParents.includes(pt.id);if(Ie||F.push({type:"issue",issue:pt,hasChildren:an.length>0,expanded:An,budgetOrdinal:W}),An)for(const Se of an)Kn(Se)},"walk");for(const pt of Fe)Kn(pt)}return F},[Be,$.viewMode,$.collapsedGroups,$.collapsedParents,$.nestingEnabled]),Bn=(0,x.useRef)({flatNavEntries:bn,selectedNavKey:de,viewMode:$.viewMode,issueLinkState:g,collapsedGroups:$.collapsedGroups,collapsedParents:$.collapsedParents,updateView:Le});Bn.current={flatNavEntries:bn,selectedNavKey:de,viewMode:$.viewMode,issueLinkState:g,collapsedGroups:$.collapsedGroups,collapsedParents:$.collapsedParents,updateView:Le};const Wa=(0,x.useCallback)(F=>{if(F.startsWith("group:")){const J=ee.current?.querySelector(`[data-issues-group-key="${Vk(F.slice(6))}"]`);return J instanceof HTMLElement?J:null}const W=ee.current?.querySelector(`[data-issue-row-id="${Vk(F.slice(6))}"]`)?.querySelector("[data-inbox-issue-link]");return W instanceof HTMLElement?W:null},[]);(0,x.useEffect)(()=>{const F=r(W=>{if(W.defaultPrevented)return;const J=W.target;if(!(J instanceof HTMLElement)||ko(J)||Fg(document)||W.metaKey||W.ctrlKey||W.altKey)return;const Ie=Bn.current;if(Ie.viewMode!=="list"||Ie.flatNavEntries.length===0)return;const Fe=r(pt=>pt?Ie.flatNavEntries.findIndex(an=>Md(an)===pt):-1,"indexOfKey"),bt=Fe(Me.current),Kn=ye.current&&bt>=0?bt:Fe(Ie.selectedNavKey);switch(W.key){case"j":case"ArrowDown":case"k":case"ArrowUp":{W.preventDefault(),ye.current=!1;const pt=W.key==="j"||W.key==="ArrowDown"?"next":"previous",an=J5(Kn,Ie.flatNavEntries.length,pt),An=Ie.flatNavEntries[an];if(!An)break;we(Md(An)),An.type==="issue"&&Gt(Se=>Math.max(Se,An.budgetOrdinal+1));break}case"ArrowLeft":case"ArrowRight":{const pt=Ie.flatNavEntries[Kn];if(!pt)return;const an=W.key==="ArrowLeft";if(pt.type==="group"){W.preventDefault(),ye.current=!1,we(Md(pt)),Ie.updateView({collapsedGroups:an?Ie.collapsedGroups.includes(pt.key)?Ie.collapsedGroups:[...Ie.collapsedGroups,pt.key]:Ie.collapsedGroups.filter(An=>An!==pt.key)});break}if(!pt.hasChildren)return;W.preventDefault(),ye.current=!1,we(Md(pt)),Ie.updateView({collapsedParents:an?Ie.collapsedParents.includes(pt.issue.id)?Ie.collapsedParents:[...Ie.collapsedParents,pt.issue.id]:Ie.collapsedParents.filter(An=>An!==pt.issue.id)});break}case"Enter":{const pt=Ie.flatNavEntries[Kn];if(!pt||pt.type!=="issue")return;W.preventDefault();const an=pt.issue,An=an.identifier??an.id,Se=k0(Ie.issueLinkState,an);ng(An,Se),iI(Ae,An,{issue:an}),ie(Hd(An),{state:Se});break}default:return}},"handleKeyDown");return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[ie,Ae]);const Pa=(0,x.useMemo)(()=>{if($.viewMode!=="list")return[];const F=[];for(const W of Be){const{roots:J,childMap:Ie}=Pt(W),Fe=r(bt=>{if(F.push(bt.id),!$.collapsedParents.includes(bt.id))for(const Kn of Ie.get(bt.id)??[])Fe(Kn)},"walk");for(const bt of J)Fe(bt)}return F},[Be,$.collapsedParents,$.nestingEnabled,$.viewMode]),Cn=(0,x.useRef)(null),[wt]=(0,x.useState)(()=>Qk.get(le)??null),la=wt?.identity===$e?wt.limit:0,nn=(0,x.useMemo)(()=>$.viewMode==="list"?QF(Cn.current,$e,Pa,Mt,la):Mt,[Pa,$e,Mt,la,$.viewMode]);(0,x.useLayoutEffect)(()=>{$.viewMode==="list"&&(Cn.current={identity:$e,ids:Pa,limit:nn},Qk.set(le,{identity:$e,limit:nn}),Mt!==nn&&Gt(nn))},[Pa,le,$e,nn,Mt,$.viewMode]);const ta=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!de){ta.current=null;return}if(ta.current===de)return;const F=Wa(de);F&&(F.scrollIntoView({block:"nearest"}),ta.current=de)},[Wa,nn,de]),(0,x.useLayoutEffect)(()=>{if(!$.nestingEnabled||$.viewMode!=="list")return;const F=st.current,W=F.identity===$e?F:{identity:$e,keptRootIds:new Set,seenIds:new Set,knownIds:new Set},J=Pa.slice(0,nn);for(const Ie of J)W.seenIds.add(Ie);for(const Ie of Be)for(const Fe of Ie.items)W.knownIds.add(Fe.id);for(const Ie of it.values())for(const Fe of Ie.roots)Fe.parentId&&(W.seenIds.has(Fe.id)||W.knownIds.has(Fe.parentId))&&W.keptRootIds.add(Fe.id);st.current=W},[Pa,Be,it,$e,nn,$.nestingEnabled,$.viewMode]);const dn=(0,x.useRef)(new Map),qs=new Map;(0,x.useLayoutEffect)(()=>{dn.current=qs});const ri=r((F,W)=>{const J=W,Ie=DF(dn.current.get(F),J.map(Fe=>String(Fe.key)));return qs.set(F,Ie),J.map((Fe,bt)=>Fe.key===Ie.renderKeys[bt]?Fe:(0,x.cloneElement)(Fe,{key:Ie.renderKeys[bt]}))},"withInsertionStableKeys"),So=$.viewMode==="list"&&nn>0;(0,x.useLayoutEffect)(()=>{const F=ee.current;if(!F||!So)return;let W=window.requestAnimationFrame(()=>{W=window.requestAnimationFrame(()=>F.setAttribute("data-row-deferral",""))});return()=>{window.cancelAnimationFrame(W),F.removeAttribute("data-row-deferral")}},[So]);const xr=!!X&&!$.liveOnly,Ca=$.viewMode==="list"&&nn<ht.length,sl=Math.max(ht.length-nn,0),Ri=(0,x.useCallback)(()=>{if($.viewMode==="list"){if(Ca){Gt(Math.min(ht.length,nn+OF));return}K&&!z&&O?.()}},[ht.length,K,Ca,z,O,nn,$.viewMode]),ks=$.viewMode==="list"&&!t&&(Ca||K&&!z);(0,x.useEffect)(()=>{if(!ks)return;let F=null;const W=zF(ee.current),J=W??window,Ie=r((Kn="scroll")=>{F===null&&(F=window.requestAnimationFrame(()=>{F=null;const pt=W?.scrollHeight??document.documentElement.scrollHeight;if(pt===0)return;const an=W?.clientHeight??window.innerHeight,An=W?W.scrollTop+W.clientHeight:window.scrollY+window.innerHeight,Se=pt>an+1;if(An>=pt-LF){if(Kn==="initial"&&!Ca&&K&&!Se){if(mt.current)return;mt.current=!0}Ri()}}))},"checkScrollPosition"),Fe=r(()=>Ie("scroll"),"handleScroll"),bt=r(()=>Ie("resize"),"handleResize");return J.addEventListener("scroll",Fe,{passive:!0}),window.addEventListener("resize",bt),Ie("initial"),()=>{J.removeEventListener("scroll",Fe),window.removeEventListener("resize",bt),F!==null&&window.cancelAnimationFrame(F)}},[ks,K,Ca,Ri]);const il=(0,x.useCallback)(F=>{const W=F?.key,J={...I??{}};if(f&&J.projectId===void 0&&(J.projectId=f),W){if($.groupBy==="status")J.status=W;else if($.groupBy==="priority")J.priority=W;else if($.groupBy==="assignee"&&W!=="__unassigned")W.startsWith("__user:")?J.assigneeUserId=W.slice(7):J.assigneeAgentId=W;else if($.groupBy==="project"&&W!=="__no_project")J.projectId=W;else if($.groupBy==="workspace"&&W!=="__no_workspace"){const Ie=F?.items.find(bt=>bt.executionWorkspaceId===W||bt.projectWorkspaceId===W)??null,Fe=jt.get(W);if(Fe){J.executionWorkspaceId=W,J.executionWorkspaceMode="reuse_existing",Fe.projectWorkspaceId&&(J.projectWorkspaceId=Fe.projectWorkspaceId);const bt=Fe.projectId??(Fe.projectWorkspaceId?wa.get(Fe.projectWorkspaceId)?.projectId:null)??(Ie?.executionWorkspaceId===W?Ie.projectId:null);bt&&(J.projectId=bt)}else{const bt=wa.get(W);bt&&(J.projectWorkspaceId=W,J.projectId=bt.projectId)}}else if($.groupBy==="parent"&&W!=="__no_parent"){const Ie=$n.get(W);Ie?Object.assign(J,CF(Ie,Ve)):J.parentId=W}}return J},[I,Ve,jt,$n,f,wa,$.groupBy]),rl=C?`Create ${C}`:"Create Task",br=C?`New ${C}`:"New Task",li=(0,x.useCallback)(F=>{et(il(F))},[il,et]),ll=(0,x.useCallback)(F=>{Le({workspaces:[F]})},[Le]),vr=(0,x.useCallback)(F=>{const W=tC(F);On(W),d0(De,{viewState:$,columns:W})},[De.companyId,De.collectionKey,De.legacyColumnsStorageKey,De.legacyViewStorageKey,$]),xa=(0,x.useCallback)((F,W)=>{if(W){vr([...dt,F]);return}vr(dt.filter(J=>J!==F))},[vr,dt]),Ss=(0,x.useCallback)((F,W,J=null)=>{A(F,{assigneeAgentId:W,assigneeUserId:J}),xt(null),Kt("")},[A]);let Mi=$.viewMode==="list"?nn:Number.POSITIVE_INFINITY;return(0,a.jsxs)("div",{ref:ee,className:"wardmote-issue-list space-y-4",children:[Un?(0,a.jsx)(lH,{summary:Un,issueLinkState:g,parentIssueIdForCostSummary:_}):null,(0,a.jsx)(ce==="collection"?fF:iH,{className:"wardmote-task-list-toolbar",ariaLabel:ce==="collection"?"Task controls":void 0,context:ue?(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[ue,(0,a.jsxs)(oe,{size:"sm",variant:"secondary","aria-label":br,onClick:r(()=>li(),"onClick"),children:[(0,a.jsx)(ns,{className:"h-4 w-4 sm:mr-1"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:br})]})]}):(0,a.jsxs)(oe,{size:"sm",variant:"secondary","aria-label":br,onClick:r(()=>li(),"onClick"),children:[(0,a.jsx)(ns,{className:"h-4 w-4 sm:mr-1"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:br})]}),search:(0,a.jsx)(rH,{value:ea,context:Tt,onDebouncedChange:r(F=>{Jt(F),Q?.(F)},"onDebouncedChange")}),controls:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center border border-line rounded-md overflow-hidden mr-1",role:"group","aria-label":"View mode",children:[(0,a.jsx)("button",{className:`flex h-8 w-8 items-center justify-center transition-colors ${$.viewMode==="list"?"bg-bg-3 text-ink":"text-ink-3 hover:text-ink"}`,onClick:r(()=>Le({viewMode:"list"}),"onClick"),title:"List view","aria-label":"List view","aria-pressed":$.viewMode==="list",children:(0,a.jsx)(jR,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{className:`flex h-8 w-8 items-center justify-center transition-colors ${$.viewMode==="board"?"bg-bg-3 text-ink":"text-ink-3 hover:text-ink"}`,onClick:r(()=>Le({viewMode:"board"}),"onClick"),title:"Board view","aria-label":"Board view","aria-pressed":$.viewMode==="board",children:(0,a.jsx)(RR,{className:"h-3.5 w-3.5"})})]}),$.viewMode==="list"&&(0,a.jsx)(oe,{active:$.nestingEnabled,type:"button",variant:"secondary",size:"icon",className:Y("hidden h-8 w-8 shrink-0 sm:inline-flex"),onClick:r(()=>Le({nestingEnabled:!$.nestingEnabled}),"onClick"),title:$.nestingEnabled?"Disable parent-child nesting":"Enable parent-child nesting",children:(0,a.jsx)(zS,{className:"h-3.5 w-3.5"})}),$.viewMode==="board"&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(oe,{active:Qt,type:"button",variant:"secondary",size:"icon",className:Y("h-8 w-8 shrink-0"),onClick:r(()=>Le({boardCardDensity:Qt?"comfortable":"compact"}),"onClick"),title:Qt?"Use comfortable cards":"Use compact cards",children:(0,a.jsx)(rR,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(oe,{active:Z.length>0,type:"button",variant:"secondary",size:"icon",className:Y("h-8 w-8 shrink-0"),onClick:r(()=>Le({boardColdLaneMode:Z.length>0?"expanded":"collapsed"}),"onClick"),title:Z.length>0?"Expand cold lanes":"Collapse cold lanes",children:(0,a.jsx)(NR,{className:"h-3.5 w-3.5"})}),(0,a.jsxs)(js,{children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsxs)(oe,{active:$.boardColumnPageSize!==10,type:"button",variant:"secondary",size:"sm",className:Y("h-8 shrink-0 gap-1.5 px-2"),title:"Cards per column",children:[(0,a.jsx)(yR,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"min-w-4 text-xs tabular-nums",children:$.boardColumnPageSize})]})}),(0,a.jsx)(ys,{align:"end",className:"w-40 p-0",children:(0,a.jsx)("div",{className:"p-2 space-y-0.5",children:_2.map(F=>(0,a.jsxs)("button",{type:"button",className:Y("flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm",$.boardColumnPageSize===F?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50"),onClick:r(()=>Le({boardColumnPageSize:F}),"onClick"),children:[(0,a.jsxs)("span",{children:[F," per column"]}),$.boardColumnPageSize===F&&(0,a.jsx)(Rs,{className:"h-3.5 w-3.5"})]},F))})})]}),(0,a.jsx)(oe,{type:"button",variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",onClick:r(()=>Le({boardCardDensity:"auto",boardColdLaneMode:"expanded",boardColumnPageSize:10}),"onClick"),disabled:!Ne,title:"Reset board density",children:(0,a.jsx)(gc,{className:"h-3.5 w-3.5"})})]}),(0,a.jsx)(Q9,{availableColumns:Us,visibleColumnSet:pn,onToggleColumn:xa,showDateGroupSeparators:$.showDateGroupSeparators,onToggleDateGroupSeparators:r(F=>Le({showDateGroupSeparators:F}),"onToggleDateGroupSeparators"),onResetColumns:r(()=>vr(ZN),"onResetColumns"),title:"Choose which task columns stay visible",iconOnly:!0,rowPresentation:V}),(0,a.jsx)(aF,{state:$,onChange:Le,buttonVariant:"secondary",activeFilterCount:Va,agents:l,creators:ai,projects:c?.map(F=>({id:F.id,name:F.name})),labels:qt?.map(F=>({id:F.id,name:F.name,color:F.color})),currentUserId:Ve,enableExternalObjectFilters:ge,enableRoutineVisibilityFilter:D,enableHiddenTasksFilter:Ot,iconOnly:!0,presentation:V==="task"?"streamlined":"legacy"}),$.viewMode==="list"&&(0,a.jsxs)(js,{children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsx)(oe,{variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",title:"Sort",children:(0,a.jsx)(DI,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(ys,{align:"end",className:"w-48 p-0",children:(0,a.jsxs)("div",{className:"p-2 space-y-0.5",children:[lt&&(0,a.jsx)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${In?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>It(!1),"onClick"),children:(0,a.jsx)("span",{children:"Relevance"})}),[["workflow","Workflow"],["status","Status"],["priority","Priority"],["title","Title"],["created","Created"],["updated","Updated"]].filter(([F])=>F!=="priority").map(([F,W])=>(0,a.jsxs)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${!In&&$.sortField===F?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>{lt&&It(!0),In?Le({sortField:F,sortDir:F==="updated"||F==="created"?"desc":"asc"}):$.sortField===F?Le({sortDir:$.sortDir==="asc"?"desc":"asc"}):Le({sortField:F,sortDir:"asc"})},"onClick"),children:[(0,a.jsx)("span",{children:W}),!In&&$.sortField===F&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:$.sortDir==="asc"?"↑":"↓"})]},F))]})})]}),$.viewMode==="list"&&(0,a.jsxs)(js,{children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsx)(oe,{variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",title:"Group",children:(0,a.jsx)(Tf,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(ys,{align:"end",className:"w-44 p-0",children:(0,a.jsx)("div",{className:"p-2 space-y-0.5",children:[["status","Status"],["priority","Priority"],["assignee","Responsible"],["project","Project"],["workspace","Workspace"],["parent","Parent Task"],["none","None"]].filter(([F])=>F!=="priority").map(([F,W])=>(0,a.jsxs)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${$.groupBy===F?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>Le({groupBy:F}),"onClick"),children:[(0,a.jsx)("span",{children:W}),$.groupBy===F&&(0,a.jsx)(Rs,{className:"h-3.5 w-3.5"})]},F))})})]})]})}),xr&&X?X({viewMode:$.viewMode,issueFilter:se}):null,(t||za)&&(0,a.jsx)(pF,{variant:"issues-list"}),s&&(0,a.jsx)("p",{className:"text-sm text-bad",children:s.message}),lt&&tn.length===Td&&(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Showing up to ",Td," matches. Refine the search to narrow further."]}),xn&&(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Some board columns are showing up to ",Rd," tasks. Refine filters or search to reveal the rest."]}),!t&&!za&&ht.length===0&&$.viewMode==="list"&&(0,a.jsx)(Z9,{icon:Yd,message:"No tasks match the current filters or search.",action:rl,onAction:r(()=>li(),"onAction")}),$.viewMode==="board"?(0,a.jsx)(NF,{issues:ht,agents:l,liveIssueIds:u,liveRunsByIssueId:Te,pauseStateByIssueId:Qe,compactCards:Qt,collapsedStatuses:Z,initialVisibleCount:$.boardColumnPageSize,revealIncrement:$.boardColumnPageSize,onUpdateIssue:A}):(0,a.jsxs)("div",{className:"-mx-2 sm:mx-0",children:[Be.map(F=>Mi<=0?null:(0,a.jsxs)(v1,{open:!$.collapsedGroups.includes(F.key),onOpenChange:r(W=>{Le({collapsedGroups:W?$.collapsedGroups.filter(J=>J!==F.key):[...$.collapsedGroups,F.key]})},"onOpenChange"),children:[F.label&&(0,a.jsx)("div",{"data-issues-group-key":F.key,className:Y("rounded-lg px-3 sm:pl-0 sm:pr-4",de===`group:${F.key}`?"bg-bg-3/50":"hover:bg-bg-3/50"),onClick:r(()=>we(`group:${F.key}`),"onClick"),onMouseEnter:r(()=>he(`group:${F.key}`),"onMouseEnter"),children:(0,a.jsx)(J9,{label:F.label,collapsible:!0,collapsed:$.collapsedGroups.includes(F.key),onToggle:r(()=>{Le({collapsedGroups:$.collapsedGroups.includes(F.key)?$.collapsedGroups.filter(W=>W!==F.key):[...$.collapsedGroups,F.key]})},"onToggle"),trailing:(0,a.jsx)(oe,{variant:"ghost",size:"icon-xs",className:"-mr-2",title:`New task in ${F.label}`,"aria-label":`New task in ${F.label}`,onClick:r(()=>li(F),"onClick"),children:(0,a.jsx)(ns,{className:"h-3 w-3"})})})}),(0,a.jsx)(b1,{children:(()=>{const{roots:W,childMap:J}=Pt(F),Ie=r((Se,Fs)=>{if(Mi<=0)return null;Mi-=1;const Qa=(J.get(Se.id)??[]).length>0,Ga=Qa?I2(Se.id,J):0,ba=!$.collapsedParents.includes(Se.id),sp=!(Qa&&ba),ol=Se.projectId?Da.get(Se.projectId)??null:null,Zc=Se.parentId?$n.get(Se.parentId)??null:null,cl=B?.get(Se.id),ip=E?.has(Se.id)===!0,No=Se.assigneeUserId?ss.get(Se.assigneeUserId)??null:null,Jc=Vr(Se.assigneeUserId,Ve,zn)??No?.label??null,ul=o1(Se),dl=ul?.kind==="user"?ul.id:null,fl=ul?.kind==="user"?ul.viaAgentId??null:null,oi=r(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Le({collapsedParents:ba?[...$.collapsedParents,Se.id]:$.collapsedParents.filter(Aa=>Aa!==Se.id)})},"toggleCollapse"),ci=ii,pl=ci?.stepNumberByIssueId.get(Se.id)??null,eu=ci?.unresolvedVisibleBlockersByIssueId.get(Se.id)??[],tu=ci?`issue-workflow-row-${Se.id}`:void 0,nu=ci&&Se.status==="done"?"text-ink-3":void 0,ml=eu.map(Ue=>{const Aa=$n.get(Ue);if(!Aa)return null;const iu=Aa.identifier??Aa.id.slice(0,8),hl=ci?.stepNumberByIssueId.get(Ue);return{blockerId:Ue,chipLabel:`blocked by ${iu}${hl?` · step ${hl}`:""}`}}).filter(Ue=>Ue!==null),ls=ml[0]??null,Co=Math.max(ml.length-1,0),rp=Co>0?` ... and ${Co} more`:"",Ao=ls?`${ls.chipLabel}${rp}`:"",au=ml.slice(1).map(Ue=>Ue.chipLabel).join(", "),_o=Co>0?`${Ao}: ${au}`:Ao,yr=ci&&ls?(0,a.jsx)("button",{type:"button","data-slot":"icon-button",onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation();const Aa=document.getElementById(`issue-workflow-row-${ls.blockerId}`);Aa&&(Aa.scrollIntoView({behavior:"smooth",block:"nearest"}),Aa.focus?.())},"onClick"),className:"inline-flex items-center rounded-full border border-amber-400/45 bg-amber-50/60 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-amber-700 hover:bg-amber-100/80 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300",title:_o,"aria-label":_o,children:Ao},ls.blockerId):null,Di=ma.get(Se.id)??null,su=Di?(0,a.jsx)(dF,{issueId:Se.id,run:Di,companyId:ve,taskLabel:Se.identifier??Se.id.slice(0,8)}):void 0;return(0,a.jsx)("div",{"data-issue-row-id":Se.id,className:Y(V==="legacy"&&Fs>0&&Yk[Math.min(Fs,Yk.length-1)],sp&&"wardmote-issue-list-row-deferred")||void 0,children:(0,a.jsx)(lF,{issue:Se,presentation:V,issueLinkState:g,selected:de===`issue:${Se.id}`,onMouseEnter:r(()=>he(`issue:${Se.id}`),"onMouseEnter"),treeGuides:Fs,chevronInGuide:Fs>0&&Qa,checklistStepNumber:pl,checklistCurrentStep:ci?.currentStepIssueId===Se.id,checklistDependencyChips:yr,checklistRowId:tu,titleClassName:nu,externalObjectSummary:Ks.get(Se.id)??null,titleSuffix:(0,a.jsxs)(a.Fragment,{children:[Qa&&!ba?(0,a.jsxs)("span",{className:"ml-1.5 text-xs text-ink-3",children:["(",Ga," sub-task",Ga!==1?"s":"",")"]}):null,cl?cl==="Paused"?(0,a.jsxs)(Dn,{variant:"ghost",className:Y("ml-1.5 px-1.5 text-(length:--text-nano)",Fd.paused),"aria-label":"Paused",title:"Paused",children:[(0,a.jsx)(oR,{className:"h-3 w-3"}),"Paused"]}):(0,a.jsx)(Dn,{variant:"outline",className:"ml-1.5 border-amber-500/40 bg-amber-500/10 px-1.5 text-(length:--text-nano) text-amber-700 dark:text-amber-300",children:cl}):null,A2(Se)?(0,a.jsxs)(Dn,{variant:"outline",className:"ml-1.5 border-amber-400/45 bg-amber-50/60 px-1.5 text-(length:--text-nano) text-amber-700 dark:border-amber-300/35 dark:bg-amber-400/10 dark:text-amber-300","aria-label":"Needs next step",title:"This task needs a next step",children:[(0,a.jsx)(Yd,{className:"h-3 w-3"}),"Needs next step"]}):null]}),className:Y(ip&&"opacity-70",de===`issue:${Se.id}`&&"bg-bg-3/50 hover:bg-bg-3/50"),leadingControl:V==="task"?Qa?(0,a.jsx)("button",{type:"button","data-slot":"icon-button",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center","aria-label":ba?"Collapse sub-tasks":"Expand sub-tasks",onClick:oi,children:(0,a.jsx)(cr,{className:Y("h-3.5 w-3.5 transition-transform",ba&&"rotate-90")})}):(0,a.jsx)("span",{"data-slot":"task-row-disclosure-spacer",className:"h-4 w-4 shrink-0","aria-hidden":"true"}):void 0,statusSlot:V==="task"?(0,a.jsxs)("span",{className:"relative inline-flex items-start self-stretch sm:items-center",onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation()},"onClick"),children:[(0,a.jsx)(Js,{status:Se.status,externalConversationState:Se.externalConversationState,size:"md",blockerAttention:Se.blockerAttention,onChange:r(Ue=>A(Se.id,{status:Ue}),"onChange")}),Qa&&ba?(0,a.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-5 -bottom-2.5 left-1/2 w-px bg-line sm:hidden"}):null]}):void 0,metadata:V==="task"?(0,a.jsx)(Bk,{issue:Se,isLive:u?.has(Se.id)===!0,subtreeLiveCount:ra.get(Se.id)??0,showStatus:!1,showIdentifier:!1,checklistStepNumber:pl}):void 0,actions:su,showIdentifier:pn.has("id")&&Pn.has("id"),mobileLeading:Qa?(0,a.jsx)("button",{type:"button","data-slot":"icon-button",onClick:oi,children:(0,a.jsx)(cr,{className:Y("h-3.5 w-3.5 transition-transform",ba&&"rotate-90")})}):(0,a.jsx)("span",{className:"inline-flex items-center",onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation()},"onClick"),children:(0,a.jsx)(Js,{status:Se.status,externalConversationState:Se.externalConversationState,size:"md",blockerAttention:Se.blockerAttention,onChange:r(Ue=>A(Se.id,{status:Ue}),"onChange")})}),desktopMetaLeading:V==="legacy"?(0,a.jsxs)(a.Fragment,{children:[Qa?(0,a.jsx)("button",{type:"button","data-slot":"icon-button",className:"relative z-10 hidden w-4 shrink-0 items-center justify-center sm:inline-flex",onClick:oi,children:(0,a.jsx)(cr,{className:Y("h-3.5 w-3.5 transition-transform",ba&&"rotate-90")})}):(0,a.jsx)("span",{className:"hidden w-4 shrink-0 sm:block"}),(0,a.jsx)(Bk,{issue:Se,isLive:u?.has(Se.id)===!0,subtreeLiveCount:ra.get(Se.id)??0,showStatus:pn.has("status")&&Pn.has("status"),showIdentifier:pn.has("id")&&Pn.has("id"),checklistStepNumber:pl,statusSlot:(0,a.jsx)("span",{className:"inline-flex items-center",onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation()},"onClick"),children:(0,a.jsx)(Js,{status:Se.status,externalConversationState:Se.externalConversationState,size:"md",blockerAttention:Se.blockerAttention,onChange:r(Ue=>A(Se.id,{status:Ue}),"onChange")})})})]}):void 0,mobileTitleMeta:V==="task"?Sf(Se):void 0,mobileMeta:V==="legacy"?V9(Se).toLowerCase():su,trailingMeta:V==="task"&&pn.has("updated")&&Pn.has("updated")?Sf(Se):void 0,desktopTrailing:ha.length>0?(0,a.jsx)(X9,{issue:Se,columns:ha,projectName:ol?.name??null,projectColor:ol?.color??null,workspaceId:Qy(Se,un),workspaceName:nC(Se,{executionWorkspaceById:jt,projectWorkspaceById:wa,defaultProjectWorkspaceIdByProjectId:ka}),onFilterWorkspace:ll,assigneeName:gn(Se.assigneeAgentId),assigneeAgent:l?.find(Ue=>Ue.id===Se.assigneeAgentId),creatorAgent:l?.find(Ue=>Ue.id===Se.createdByAgentId),assigneeUserName:Jc,assigneeUserAvatarUrl:No?.image??null,creatorAgentName:gn(Se.createdByAgentId),creatorUserName:dl?ss.get(dl)?.label??null:null,creatorUserAvatarUrl:dl?ss.get(dl)?.image??null:null,viaAgentName:fl?gn(fl):null,currentUserId:Ve,parentIdentifier:Zc?.identifier??null,parentTitle:Zc?.title??null,assigneeContent:(0,a.jsxs)(js,{open:Xe===Se.id,onOpenChange:r(Ue=>{xt(Ue?Se.id:null),Ue||Kt("")},"onOpenChange"),children:[(0,a.jsx)(vs,{asChild:!0,children:(0,a.jsx)("button",{className:"flex w-full shrink-0 items-center overflow-hidden rounded-md px-2 py-1 transition-colors hover:bg-bg-3/50",onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation()},"onClick"),children:Se.assigneeAgentId&&gn(Se.assigneeAgentId)?(0,a.jsx)(co,{agent:l.find(Ue=>Ue.id===Se.assigneeAgentId),size:"sm",className:"min-w-0"}):Se.assigneeUserId?(0,a.jsx)(lg,{name:Jc??"User",avatarUrl:No?.image??null,size:"sm",className:"min-w-0"}):(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-ink-3",children:[(0,a.jsx)("span",{className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-dashed border-ink-3/35 bg-bg-3/30",children:(0,a.jsx)(so,{className:"h-3.5 w-3.5"})}),"Assignee"]})})}),(0,a.jsxs)(ys,{className:"w-56 p-1",align:"end",onClick:r(Ue=>Ue.stopPropagation(),"onClick"),onPointerDownOutside:r(()=>Kt(""),"onPointerDownOutside"),children:[(0,a.jsx)("input",{className:"mb-1 w-full border-b border-line bg-transparent px-2 py-1.5 text-xs outline-none placeholder:text-ink-3/50",placeholder:"Search responsible...",value:at,onChange:r(Ue=>Kt(Ue.target.value),"onChange"),autoFocus:!0}),(0,a.jsxs)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:[(0,a.jsx)("button",{className:Y("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-bg-3/50",!Se.assigneeAgentId&&!Se.assigneeUserId&&"bg-bg-3"),onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Ss(Se.id,null,null)},"onClick"),children:"No responsible"}),Ve&&(0,a.jsxs)("button",{className:Y("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",Se.assigneeUserId===Ve&&"bg-bg-3"),onClick:r(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Ss(Se.id,null,Ve)},"onClick"),children:[(0,a.jsx)(so,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,a.jsx)("span",{children:"Me"})]}),(l??[]).filter(Ue=>at.trim()?Ue.name.toLowerCase().includes(at.toLowerCase()):!0).map(Ue=>(0,a.jsx)("button",{className:Y("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",Se.assigneeAgentId===Ue.id&&"bg-bg-3"),onClick:r(Aa=>{Aa.preventDefault(),Aa.stopPropagation(),Ss(Se.id,Ue.id,null)},"onClick"),children:(0,a.jsx)(co,{agent:Ue,size:"sm",className:"min-w-0"})},Ue.id))]})]})]})}):void 0})},Se.id)},"renderIssueRow"),Fe=$.showDateGroupSeparators&&!In?YF($):null,bt=new Date,Kn=[];let pt=null,an=null;const An=r((Se,Fs)=>{const Qa=Ie(Se,Fs);if(Qa!==null){if(Fe&&V==="task"){const Ga=IF(Fe(Se),bt),ba=TF(pt,Ga);ba&&Kn.push((0,a.jsx)(Gk,{label:ba},`date-sep-${Se.id}-${Ga}`)),pt=Ga}else if(Fe){const Ga=ZF(Fe(Se),bt.getTime());for(const ba of an===null?[]:eH(an,Ga))Kn.push((0,a.jsx)(Gk,{label:JF(ba)},`date-sep-${Se.id}-${ba}`));an=Ga}if(Kn.push(Qa),!$.collapsedParents.includes(Se.id))for(const Ga of J.get(Se.id)??[])An(Ga,Fs+1)}},"appendIssueRow");for(const Se of W)An(Se,0);return ri(F.key,Kn)})()})]},F.key)),(sl>0||K||z)&&(0,a.jsx)("div",{className:"py-2","data-testid":"issues-load-more-sentinel",children:(0,a.jsx)("p",{className:"text-xs text-ink-3",children:z?"Loading more tasks...":sl>0?`Rendering ${Math.min(nn,ht.length)} of ${ht.length} tasks`:"Scroll to load more tasks"})})]})]})}r(cH,"StreamlinedIssuesList");function uH(e){return e?new Date(e).toLocaleString():"Never"}r(uH,"formatLastRunTimestamp");function dH(e){return e?e.replaceAll("_"," "):null}r(dH,"formatRoutineRunStatus");function iX(e,t){return e==="archived"&&t||t?"active":"paused"}r(iX,"nextRoutineStatus");function fH({routine:e,projectById:t,agentById:s,runningRoutineId:l,statusMutationRoutineId:c,href:u,configureLabel:p="Edit",managedByLabel:f,secondaryDetails:h,runNowButton:g=!1,disableRunNow:v=!1,disableToggle:y=!1,hideArchiveAction:j=!1,divider:k=!0,selected:S=!1,selectMode:N=!1,extraMenuItems:I,onSelectChange:C,onRunNow:M,onToggleEnabled:R,onToggleArchived:_}){const D=e.status==="active",U=e.status==="archived",K=c===e.id,z=e.projectId?t.get(e.projectId)??null:null,E=e.assigneeAgentId?s.get(e.assigneeAgentId)??null:null,B=!U&&!e.assigneeAgentId,O=l===e.id||U||v;return(0,a.jsxs)(mn,{to:u,className:`group flex flex-col gap-3 px-3 py-3 transition-colors hover:bg-bg-3/50 sm:flex-row sm:items-center no-underline text-inherit${k?" border-b border-line last:border-b-0":""}`,children:[N?(0,a.jsx)("div",{className:"flex items-start pt-0.5 sm:pt-1",onClick:r(Q=>{Q.preventDefault(),Q.stopPropagation()},"onClick"),children:(0,a.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded border-line",checked:S,"aria-label":`Select ${e.title}`,onChange:r(Q=>C?.(e,Q.target.checked),"onChange")})}):null,(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e.title}),U||e.status==="paused"||B?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:U?"archived":B?"draft":"paused"}):null,f?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:f}):null]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-ink-3",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:z?.color??"var(--project-none)"}}),(0,a.jsx)("span",{children:e.projectId?z?.name??"Unknown project":"No project"})]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[e.assigneeAgentId?(0,a.jsx)(pr,{agent:{...E,id:e.assigneeAgentId},size:16,className:"h-3.5 w-3.5 shrink-0"}):null,(0,a.jsx)("span",{children:e.assigneeAgentId?E?.name??"Unknown agent":"No default agent"})]}),(0,a.jsxs)("span",{children:[uH(e.lastRun?.triggeredAt),e.lastRun?` · ${dH(e.lastRun.status)}`:""]})]}),h?(0,a.jsx)("div",{className:"text-xs text-ink-3",children:h}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",onClick:r(Q=>{Q.preventDefault(),Q.stopPropagation()},"onClick"),children:[g?(0,a.jsxs)(oe,{variant:"secondary",size:"sm",disabled:O,onClick:r(()=>M(e),"onClick"),children:[(0,a.jsx)(I0,{className:"h-3.5 w-3.5"}),l===e.id?"Running...":"Run now"]}):null,(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(aS,{size:"lg",checked:D,onCheckedChange:r(()=>R(e,D),"onCheckedChange"),disabled:K||U||y,"aria-label":D?`Disable ${e.title}`:`Enable ${e.title}`}),(0,a.jsx)("span",{className:"w-12 text-xs text-ink-3",children:U?"Archived":B?"Draft":D?"On":"Off"})]}),(0,a.jsxs)(tl,{children:[(0,a.jsx)(Jr,{asChild:!0,children:(0,a.jsx)(oe,{variant:"ghost",size:"icon-sm","aria-label":`More actions for ${e.title}`,children:(0,a.jsx)(Mf,{className:"h-4 w-4"})})}),(0,a.jsxs)(el,{align:"end",children:[(0,a.jsx)(Sn,{asChild:!0,children:(0,a.jsx)(mn,{to:u,children:p})}),(0,a.jsx)(Sn,{disabled:O,onClick:r(()=>M(e),"onClick"),children:l===e.id?"Running...":"Run now"}),I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Ei,{}),I]}):null,(0,a.jsx)(Ei,{}),(0,a.jsx)(Sn,{onClick:r(()=>R(e,D),"onClick"),disabled:K||U||y,children:D?"Pause":"Enable"}),!j&&_?(0,a.jsx)(Sn,{onClick:r(()=>_(e),"onClick"),disabled:K,children:e.status==="archived"?"Restore":"Archive"}):null]})]})]})]})}r(fH,"RoutineListRow");function pH(e){return{id:e.key,title:e.title,status:e.status,projectId:e.projectId??null,assigneeAgentId:e.assigneeAgentId??null,lastRun:e.lastRunAt||e.lastRunStatus?{triggeredAt:e.lastRunAt??null,status:e.lastRunStatus??null}:null}}r(pH,"managedRoutineToRow");function mH({routines:e,agents:t=[],projects:s=[],pluginDisplayName:l=null,emptyMessage:c="No managed routines.",runningRoutineKey:u=null,statusMutationRoutineKey:p=null,reconcilingRoutineKey:f=null,resettingRoutineKey:h=null,onRunNow:g,onToggleEnabled:v,onReconcile:y,onReset:j}){const k=new Map(t.map(N=>[N.id,N])),S=new Map(s.map(N=>[N.id,{name:N.name,color:N.color}]));return e.length===0?(0,a.jsx)("div",{className:"rounded-lg border border-line px-3 py-8 text-center text-sm text-ink-3",children:c}):(0,a.jsx)("div",{className:"rounded-lg border border-line",children:e.map(N=>{const I=pH(N),C=N.href??(N.routineId?`/routines/${N.routineId}`:"/routines"),M=N.missingRefs??[],R=!!(N.routineId&&N.resourceKey&&M.length===0),_=N.managedByPluginDisplayName??l,D=!!(y||j);return(0,a.jsxs)("div",{className:"last:[&_a]:border-b-0",children:[(0,a.jsx)(fH,{routine:I,projectById:S,agentById:k,runningRoutineId:u,statusMutationRoutineId:p,href:C,configureLabel:"Configure",managedByLabel:_?`Managed by ${_}`:null,runNowButton:!0,hideArchiveAction:!0,disableRunNow:!R,disableToggle:!R,secondaryDetails:(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[N.resourceKey?(0,a.jsx)("span",{children:N.resourceKey}):null,N.cronExpression?(0,a.jsxs)("span",{children:["Schedule ",N.cronExpression]}):null]}),onRunNow:r(()=>g?.(N),"onRunNow"),onToggleEnabled:r(()=>v?.(N,I.status==="active"),"onToggleEnabled")}),D?(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-line px-3 pb-3 text-xs text-ink-3 last:border-b-0",onClick:r(U=>{U.preventDefault(),U.stopPropagation()},"onClick"),children:[(0,a.jsx)("span",{children:M.length?`Missing ${M.map(U=>`${U.resourceKind}:${U.resourceKey}`).join(", ")}`:"Routine defaults can be repaired."}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[y?(0,a.jsx)(oe,{size:"sm",variant:"ghost",disabled:f===N.key,onClick:r(()=>y(N),"onClick"),children:f===N.key?"Reconciling...":"Reconcile"}):null,j?(0,a.jsx)(oe,{size:"sm",variant:"ghost",disabled:h===N.key,onClick:r(()=>j(N),"onClick"),children:h===N.key?"Resetting...":"Reset"}):null]})]}):null]},N.key)})})}r(mH,"ManagedRoutinesList");function Xk(e){return new Set(e??[])}r(Xk,"toPathSet");function hH({expandedPaths:e,checkedPaths:t,selectedFile:s=null,showCheckboxes:l=!1,onToggleDir:c,onSelectFile:u,...p}){return(0,x.createElement)(H7,{...p,selectedFile:s,expandedDirs:Xk(e),checkedFiles:t?Xk(t):void 0,showCheckboxes:l,onToggleDir:c??(()=>{}),onSelectFile:u??(()=>{})})}r(hH,"PluginSdkFileTree");function gH(e){const[t,s]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let l=!1;return ke(()=>import("./MarkdownEditor-ubJimjUH.js").then(c=>c.n).then(c=>{l||s(()=>c.MarkdownEditor)}),__vite__mapDeps([79,1,3,25,8,17,20,43,44,45,21,22,80,27,26,74,81,82,83,24,84,85,28,86,66,87,76,88,89,90,91,92,93])),()=>{l=!0}},[]),t?(0,x.createElement)(t,e):(0,x.createElement)("textarea",{className:e.className,value:e.value,placeholder:e.placeholder,readOnly:e.readOnly,onBlur:e.onBlur,onChange:r(l=>e.onChange(l.currentTarget.value),"onChange")})}r(gH,"PluginSdkMarkdownEditor");function xH(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""&&t!==!1))}r(xH,"compactIssueFilters");function bH({companyId:e,projectId:t=null,filters:s,viewStateKey:l="wardmote:plugin-issues-view",initialSearch:c,createIssueLabel:u,searchWithinLoadedIssues:p=!0}){const f=kn(),h=(0,x.useMemo)(()=>xH({...s??{},projectId:s?.projectId??t??void 0}),[s,t]),g=h.originKindPrefix??null,v=h.projectId??t??null,y=(0,x.useMemo)(()=>["plugins","sdk-ui","issues-list",e??"__no-company__",h],[e,h]),{data:j}=me({queryKey:P.agents.list(e??"__no-company__"),queryFn:r(()=>Fa.list(e),"queryFn"),enabled:!!e}),{data:k}=me({queryKey:P.projects.list(e??"__no-company__",{includeArchived:!0}),queryFn:r(()=>mr.list(e,{includeArchived:!0}),"queryFn"),enabled:!!e}),S=P.liveRuns(e??"__no-company__"),N=Ac({companyId:e,resourceKey:"live-runs",queryKey:S,enabled:!!e,refetchInterval:!1,leaderOnly:!0}),{data:I,dataUpdatedAt:C}=me({queryKey:S,queryFn:r(()=>Lf.liveRunsForCompany(e),"queryFn"),enabled:N.enabled,refetchInterval:N.refetchInterval});_c(N,I,C);const{data:M,isLoading:R,error:_}=me({queryKey:y,queryFn:r(()=>on.list(e,h),"queryFn"),enabled:!!e}),D=(0,x.useMemo)(()=>b9(I,M),[M,I]),U=Bt({mutationFn:r(({id:K,data:z})=>on.update(K,z),"mutationFn"),onSuccess:r(()=>{e&&(f.invalidateQueries({queryKey:["plugins","sdk-ui","issues-list",e]}),f.invalidateQueries({queryKey:P.issues.list(e)}),v&&(f.invalidateQueries({queryKey:P.issues.listByProject(e,v)}),g&&f.invalidateQueries({queryKey:P.issues.listPluginOperationsByProject(e,v,g)})))},"onSuccess")});return e?(0,x.createElement)(oH,{issues:M??[],isLoading:R,error:_,agents:j,projects:k,liveIssueIds:D,projectId:v??void 0,viewStateKey:l,initialSearch:c,createIssueLabel:u,searchWithinLoadedIssues:p,onUpdateIssue:r((K,z)=>U.mutate({id:K,data:z}),"onUpdateIssue")}):(0,x.createElement)("div",{className:"text-sm text-ink-3"},"Select an organization to view tasks.")}r(bH,"PluginSdkIssuesList");function vH({companyId:e,value:t,onChange:s,placeholder:l="Responsible",noneLabel:c="No responsible",searchPlaceholder:u="Search responsible...",emptyMessage:p="No responsible found.",includeUsers:f=!0,includeTerminatedAgents:h=!1,className:g,onConfirm:v}){const y=M0(),j=e??y.companyId??null,{data:k}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn"),enabled:f}),S=k?.user?.id??k?.session?.userId??null,{data:N}=me({queryKey:P.agents.list(j??"__no-company__"),queryFn:r(()=>Fa.list(j),"queryFn"),enabled:!!j}),{data:I}=me({queryKey:P.access.companyUserDirectory(j??"__no-company__"),queryFn:r(()=>ei.listUserDirectory(j),"queryFn"),enabled:!!j&&f}),C=(0,x.useMemo)(()=>mg(),[]),M=(0,x.useMemo)(()=>C.map(K=>K.startsWith("agent:")?K.slice(6):null).filter(K=>!!K),[C]),R=(0,x.useMemo)(()=>nS((N??[]).filter(K=>h||K.status!=="terminated"),M),[N,h,M]),_=(0,x.useMemo)(()=>[...f?Y1(S):[],...f?lA(I?.users,{excludeUserIds:[S]}):[],...R.map(K=>({id:Kr({assigneeAgentId:K.id}),label:K.name,searchText:`${K.name} ${K.role} ${K.title??""}`}))],[I?.users,S,f,R]),D=io(t),U=D.assigneeAgentId?R.find(K=>K.id===D.assigneeAgentId):null;return(0,x.createElement)(P0,{value:t,options:_,recentOptionIds:C,placeholder:l,noneLabel:c,searchPlaceholder:u,emptyMessage:p,className:g,onConfirm:v,onChange:r(K=>{const z=io(K);z.assigneeAgentId&&ef(z.assigneeAgentId),z.assigneeUserId&&Jd(z.assigneeUserId),s(K,z)},"onChange"),renderTriggerValue:r(K=>K?U?(0,x.createElement)(Cf,null,(0,x.createElement)(sg,{icon:U.icon,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,x.createElement)("span",{className:"truncate"},K.label)):(0,x.createElement)("span",{className:"truncate"},K.label):(0,x.createElement)("span",{className:"text-ink-3"},l),"renderTriggerValue"),renderOption:r(K=>{if(!K.id)return(0,x.createElement)("span",{className:"truncate"},K.label);const z=io(K.id),E=z.assigneeAgentId?R.find(B=>B.id===z.assigneeAgentId):null;return(0,x.createElement)(Cf,null,E?(0,x.createElement)(sg,{icon:E.icon,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,x.createElement)(so,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,x.createElement)("span",{className:"truncate"},K.label))},"renderOption")})}r(vH,"PluginSdkAssigneePicker");function yH({companyId:e,value:t,onChange:s,placeholder:l="Project",noneLabel:c="No project",searchPlaceholder:u="Search projects...",emptyMessage:p="No projects found.",includeArchived:f=!1,className:h,onConfirm:g}){const v=M0(),y=e??v.companyId??null,{data:j}=me({queryKey:P.auth.session,queryFn:r(()=>Zn.getSession(),"queryFn")}),k=j?.user?.id??j?.session?.userId??null,{data:S}=me({queryKey:P.projects.list(y??"__no-company__",{includeArchived:f}),queryFn:r(()=>mr.list(y,{includeArchived:f}),"queryFn"),enabled:!!y}),N=(0,x.useMemo)(()=>(S??[]).filter(_=>f||!_.archivedAt),[f,S]),{orderedProjects:I}=cA({projects:N,companyId:y,userId:k}),C=(0,x.useMemo)(()=>Rg(),[]),M=(0,x.useMemo)(()=>I.map(_=>({id:_.id,label:_.name,searchText:_.description??""})),[I]),R=I.find(_=>_.id===t)??null;return(0,x.createElement)(P0,{value:t,options:M,recentOptionIds:C,placeholder:l,noneLabel:c,searchPlaceholder:u,emptyMessage:p,className:h,onConfirm:g,onChange:r(_=>{_&&pf(_),s(_)},"onChange"),renderTriggerValue:r(_=>!_||!R?(0,x.createElement)("span",{className:"text-ink-3"},l):(0,x.createElement)(Cf,null,(0,x.createElement)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:R.color??"#6366f1"}}),(0,x.createElement)("span",{className:"truncate"},_.label)),"renderTriggerValue"),renderOption:r(_=>{if(!_.id)return(0,x.createElement)("span",{className:"truncate"},_.label);const D=I.find(U=>U.id===_.id);return(0,x.createElement)(Cf,null,(0,x.createElement)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:D?.color??"#6366f1"}}),(0,x.createElement)("span",{className:"truncate"},_.label))},"renderOption")})}r(yH,"PluginSdkProjectPicker");function Cf({children:e}){return(0,x.createElement)("span",{className:"contents"},e)}r(Cf,"FragmentSafe");function jH({label:e,status:t}){const s={ok:"border-emerald-300 bg-emerald-50 text-emerald-700",warning:"border-amber-300 bg-amber-50 text-amber-800",error:"border-red-300 bg-red-50 text-red-700",info:"border-slate-300 bg-slate-50 text-slate-700",pending:"border-slate-300 bg-slate-50 text-slate-600"}[t];return(0,x.createElement)("span",{className:`inline-flex w-fit items-center rounded-full border px-2 py-0.5 text-xs font-medium ${s}`},e)}r(jH,"PluginSdkStatusBadge");function wH({columns:e,rows:t,loading:s,emptyMessage:l="No rows."}){if(s)return(0,x.createElement)("div",{className:"text-sm text-ink-3"},"Loading...");if(!t.length)return(0,x.createElement)("div",{className:"text-sm text-ink-3"},l);const c=e.map(u=>u.width??"minmax(0, 1fr)").join(" ");return(0,x.createElement)("div",{className:"overflow-hidden rounded-md border"},(0,x.createElement)("div",{className:"hidden border-b bg-bg-3/35 px-3 py-2 text-xs font-medium uppercase tracking-wide text-ink-3 md:grid md:[grid-template-columns:var(--plugin-grid-cols)]",style:{"--plugin-grid-cols":c}},e.map(u=>(0,x.createElement)("div",{key:u.key},u.header))),(0,x.createElement)("div",{className:"divide-y"},t.map((u,p)=>(0,x.createElement)("div",{key:String(u.id??p),className:"grid gap-2 px-3 py-3 md:items-center md:[grid-template-columns:var(--plugin-grid-cols)]",style:{"--plugin-grid-cols":c}},e.map(f=>(0,x.createElement)("div",{key:f.key,className:"min-w-0 text-sm"},(0,x.createElement)("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-ink-3 md:hidden"},f.header),f.render?f.render(u[f.key],u):String(u[f.key]??"")))))))}r(wH,"PluginSdkDataTable");function kH({pairs:e}){return(0,x.createElement)("dl",{className:"grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[max-content_minmax(0,1fr)]"},e.flatMap(t=>[(0,x.createElement)("dt",{key:`${t.label}:label`,className:"text-ink-3"},t.label),(0,x.createElement)("dd",{key:`${t.label}:value`,className:"min-w-0"},t.value)]))}r(kH,"PluginSdkKeyValueList");function SH({label:e,value:t,unit:s}){return(0,x.createElement)("div",{className:"rounded-md border bg-bg-2 p-3"},(0,x.createElement)("div",{className:"text-xs font-medium uppercase tracking-wide text-ink-3"},e),(0,x.createElement)("div",{className:"mt-1 text-lg font-semibold"},`${t}${s??""}`))}r(SH,"PluginSdkMetricCard");function NH({data:e}){return(0,x.createElement)("pre",{className:"max-h-80 overflow-auto rounded-md border bg-bg-3/30 p-2 text-xs"},JSON.stringify(e,null,2))}r(NH,"PluginSdkJsonTree");function CH({label:e="Loading"}){return(0,x.createElement)("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-ink-3/30 border-t-ink align-middle",role:"status","aria-label":e})}r(CH,"PluginSdkSpinner");var AH=class extends x.Component{static{r(this,"PluginSdkErrorBoundary")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback??(0,x.createElement)("div",{className:"rounded-md border border-bad/30 p-3 text-sm text-bad"},"Plugin UI failed to render."):this.props.children}};function _H(e,t){globalThis.__wardmotePluginBridge__={react:e,reactJsxRuntime:a,reactDom:t,sdkUi:{usePluginData:uT,usePluginAction:cT,useHostContext:M0,useHostLocation:dT,useHostNavigation:gT,usePluginStream:pT,usePluginToast:fT,copyTextToClipboard:$0,MarkdownBlock:r(({content:s,className:l,enableWikiLinks:c,wikiLinkRoot:u,resolveWikiLinkHref:p})=>(0,x.createElement)(e3,{className:l,softBreaks:!1,enableWikiLinks:c,wikiLinkRoot:u,resolveWikiLinkHref:p,children:s}),"MarkdownBlock"),MetricCard:SH,StatusBadge:jH,DataTable:wH,KeyValueList:kH,JsonTree:NH,Spinner:CH,ErrorBoundary:AH,MarkdownEditor:gH,FileTree:hH,IssuesList:bH,AssigneePicker:vH,ProjectPicker:yH,ManagedRoutinesList:mH}}}r(_H,"initPluginBridge");var EH=1e4;function IH(e=EH){if(typeof performance>"u"||typeof performance.clearMeasures!="function")return()=>{};const s=setInterval(r(()=>{globalThis.__wardmoteKeepPerfMeasures||performance.clearMeasures()},"reap"),e);return()=>clearInterval(s)}r(IH,"startPerfMeasureReaper");var TH=go((e=>{function t(X,A){var ee=X.length;X.push(A);e:for(;0<ee;){var ie=ee-1>>>1,le=X[ie];if(0<c(le,A))X[ie]=A,X[ee]=le,ee=ie;else break e}}r(t,"push");function s(X){return X.length===0?null:X[0]}r(s,"peek");function l(X){if(X.length===0)return null;var A=X[0],ee=X.pop();if(ee!==A){X[0]=ee;e:for(var ie=0,le=X.length,Ae=le>>>1;ie<Ae;){var de=2*(ie+1)-1,we=X[de],ye=de+1,Me=X[ye];if(0>c(we,ee))ye<le&&0>c(Me,we)?(X[ie]=Me,X[ye]=ee,ie=ye):(X[ie]=we,X[de]=ee,ie=de);else if(ye<le&&0>c(Me,ee))X[ie]=Me,X[ye]=ee,ie=ye;else break e}}return A}r(l,"pop");function c(X,A){var ee=X.sortIndex-A.sortIndex;return ee!==0?ee:X.id-A.id}if(r(c,"compare"),e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var p=Date,f=p.now();e.unstable_now=function(){return p.now()-f}}var h=[],g=[],v=1,y=null,j=3,k=!1,S=!1,N=!1,I=!1,C=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(X){for(var A=s(g);A!==null;){if(A.callback===null)l(g);else if(A.startTime<=X)l(g),A.sortIndex=A.expirationTime,t(h,A);else break;A=s(g)}}r(_,"advanceTimers");function D(X){if(N=!1,_(X),!S)if(s(h)!==null)S=!0,U||(U=!0,Q());else{var A=s(g);A!==null&&ce(D,A.startTime-X)}}r(D,"handleTimeout");var U=!1,K=-1,z=5,E=-1;function B(){return I?!0:!(e.unstable_now()-E<z)}r(B,"shouldYieldToHost");function O(){if(I=!1,U){var X=e.unstable_now();E=X;var A=!0;try{e:{S=!1,N&&(N=!1,M(K),K=-1),k=!0;var ee=j;try{t:{for(_(X),y=s(h);y!==null&&!(y.expirationTime>X&&B());){var ie=y.callback;if(typeof ie=="function"){y.callback=null,j=y.priorityLevel;var le=ie(y.expirationTime<=X);if(X=e.unstable_now(),typeof le=="function"){y.callback=le,_(X),A=!0;break t}y===s(h)&&l(h),_(X)}else l(h);y=s(h)}if(y!==null)A=!0;else{var Ae=s(g);Ae!==null&&ce(D,Ae.startTime-X),A=!1}}break e}finally{y=null,j=ee,k=!1}A=void 0}}finally{A?Q():U=!1}}}r(O,"performWorkUntilDeadline");var Q;if(typeof R=="function")Q=r(function(){R(O)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var V=new MessageChannel,ue=V.port2;V.port1.onmessage=O,Q=r(function(){ue.postMessage(null)},"schedulePerformWorkUntilDeadline")}else Q=r(function(){C(O,0)},"schedulePerformWorkUntilDeadline");function ce(X,A){K=C(function(){X(e.unstable_now())},A)}r(ce,"requestHostTimeout"),e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125<X||(z=0<X?Math.floor(1e3/X):5)},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(X){switch(j){case 1:case 2:case 3:var A=3;break;default:A=j}var ee=j;j=A;try{return X()}finally{j=ee}},e.unstable_requestPaint=function(){I=!0},e.unstable_runWithPriority=function(X,A){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var ee=j;j=X;try{return A()}finally{j=ee}},e.unstable_scheduleCallback=function(X,A,ee){var ie=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ie+ee:ie):ee=ie,X){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=ee+le,X={id:v++,callback:A,priorityLevel:X,startTime:ee,expirationTime:le,sortIndex:-1},ee>ie?(X.sortIndex=ee,t(g,X),s(h)===null&&X===s(g)&&(N?(M(K),K=-1):N=!0,ce(D,ee-ie))):(X.sortIndex=le,t(h,X),S||k||(S=!0,U||(U=!0,Q()))),X},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(X){var A=j;return function(){var ee=j;j=A;try{return X.apply(this,arguments)}finally{j=ee}}}})),RH=go(((e,t)=>{t.exports=TH()})),MH=go((e=>{var t=RH(),s=x0(),l=s1();function c(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}r(c,"formatProdErrorMessage");function u(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}r(u,"isValidContainer");function p(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}r(p,"getNearestMountedFiber");function f(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}r(f,"getSuspenseInstanceFromFiber");function h(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}r(h,"getActivityInstanceFromFiber");function g(n){if(p(n)!==n)throw Error(c(188))}r(g,"assertIsMounted");function v(n){var i=n.alternate;if(!i){if(i=p(n),i===null)throw Error(c(188));return i!==n?null:n}for(var o=n,d=i;;){var m=o.return;if(m===null)break;var b=m.alternate;if(b===null){if(d=m.return,d!==null){o=d;continue}break}if(m.child===b.child){for(b=m.child;b;){if(b===o)return g(m),n;if(b===d)return g(m),i;b=b.sibling}throw Error(c(188))}if(o.return!==d.return)o=m,d=b;else{for(var w=!1,T=m.child;T;){if(T===o){w=!0,o=m,d=b;break}if(T===d){w=!0,d=m,o=b;break}T=T.sibling}if(!w){for(T=b.child;T;){if(T===o){w=!0,o=b,d=m;break}if(T===d){w=!0,d=b,o=m;break}T=T.sibling}if(!w)throw Error(c(189))}}if(o.alternate!==d)throw Error(c(190))}if(o.tag!==3)throw Error(c(188));return o.stateNode.current===o?n:i}r(v,"findCurrentFiberUsingSlowPath");function y(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=y(n),i!==null)return i;n=n.sibling}return null}r(y,"findCurrentHostFiberImpl");var j=Object.assign,k=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),_=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function V(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}r(V,"getIteratorFn");var ue=Symbol.for("react.client.reference");function ce(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ue?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case I:return"Fragment";case M:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case K:return"SuspenseList";case B:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case N:return"Portal";case _:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case D:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return i=n.displayName||null,i!==null?i:ce(n.type)||"Memo";case E:i=n._payload,n=n._init;try{return ce(n(i))}catch{}}return null}r(ce,"getComponentNameFromType");var X=Array.isArray,A=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},le=[],Ae=-1;function de(n){return{current:n}}r(de,"createCursor");function we(n){0>Ae||(n.current=le[Ae],le[Ae]=null,Ae--)}r(we,"pop");function ye(n,i){Ae++,le[Ae]=n.current,n.current=i}r(ye,"push");var Me=de(null),he=de(null),ve=de(null),et=de(null);function Pe(n,i){switch(ye(ve,i),ye(he,n),ye(Me,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?cy(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=cy(i),n=uy(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}we(Me),ye(Me,n)}r(Pe,"pushHostContainer");function Ee(){we(Me),we(he),we(ve)}r(Ee,"popHostContainer");function ct(n){n.memoizedState!==null&&ye(et,n);var i=Me.current,o=uy(i,n.type);i!==o&&(ye(he,n),ye(Me,o))}r(ct,"pushHostContext");function Ve(n){he.current===n&&(we(Me),we(he)),et.current===n&&(we(et),ic._currentValue=ie)}r(Ve,"popHostContext");var yt,Zt;function ge(n){if(yt===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);yt=i&&i[1]||"",Zt=-1<o.stack.indexOf(`
60
60
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
61
61
  `+yt+n+Zt}r(ge,"describeBuiltInComponentFrame");var Oe=!1;function De(n,i){if(!n||Oe)return"";Oe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:r(function(){try{if(i){var xe=r(function(){throw Error()},"Fake");if(Object.defineProperty(xe.prototype,"props",{set:r(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(re){var ae=re}Reflect.construct(n,[],xe)}else{try{xe.call()}catch(re){ae=re}n.call(xe.prototype)}}else{try{throw Error()}catch(re){ae=re}(xe=n())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(re){if(re&&ae&&typeof re.stack=="string")return[re.stack,ae.stack]}return[null,null]},"DetermineComponentFrameRoot")};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),w=b[0],T=b[1];if(w&&T){var q=w.split(`